I'm so confused about the creation of new modules in OpenERP.
I need to know what actually creates the tables in the database, and how to modify them.
Is it the classes of the new model where we define the "_columns" dictionary?
Is it the view (.xml) file where we define <field name="arch" type="xml">?
Or can I build the tables by myself in the pgAdmin?
It took me so much time yet I couldn't figure out the mechanism of creating the structure of the tables.
I downloaded a sample openerp module and installed it which ran successfully, but whenever I tried to add a new field in the xml file I kept getting the message "Invalid XML for View Architecture".
Your help is highly appreciated.
If you want to add a new new field, first you have to define it inside "_columns" dictionary , and than you have to restart the server. Doing so, you will be able to see the new column is added for that class(using pgAdmin). Once your field is created, you can add this field in the xml file, and upgrade the respective module. This will work :)
Related
I have created a Prestashop website with a database N°1. For some reasons, I want to write a script, that I'll execute a few times and that will simply fill a database N°2 with some data. This script has nothing to do with my Prestashop website, but is part of the same project and then, must be hosted in the same server, and moreover must be present within the Prestashop website's files (under a module directory I've made).
My question is: is it possible to use this database N°2 (only for this script)? Can I use Prestashop's Db.php class to do it?
Don't hesitate to ask for more informations if I'm not clear.
So if i am reading your post correctly you want to create two databases.
For example "prestashop_n1" and "prestashop_n2".
prestashop_n1 contains all prestashop required tables.
prestashop_n2 contains data extracted from prestashop_n1
In order to extracted data from prestashop_n1 to prestashop_n2 you could write a module.
In this module you can create a database connection to database prestashop_n2
You can use PHP to copy data from prestashop_n1 to prestashop_n2
Alternative you can add a cron-job to execute your script for copying data x times a day.
I have about 300 some reports, and the data source has been deleted during migration, so the dependency of the reports from the data source has been lost.
how can I re-associate the new data source I created to all the reports without manually going to each report and setting the data source in it.
There is one way to solve this issue,
Before that you wants to rember that you know the Datasource name you given to the rdl files,
You wants to create new datasource in your RDL,
And then you can deploy your datasource in your Reportserver.
Thats it.
I am developing a project in yii, in that, i will register companies, for each registered company i will create one order form. This form will be dependent on fields entered by me while company registration. This order form will be different for each company. Depending on that form i want to create table in mysql database and also model, view, controller files automatically as i click on submit button. Can anybody help me to create this files of view, model and controller through my application and not by using gii tool. I have created table using createTable() function but not getting how to create model view files in yii
Just use the gii templates by including them after setting the right variables perhaps?
You should be able to find them in framework/gii/generators/ folder. The template folders contain the files that gii uses to generate them. If they don't fit exactly, you could copy and modify them
That being said, I do want to point out that you have to make sure to do the correct chown's and chmod's after you have generated the php files, it's a pretty dangerous practice if you are planning to do that directly on a production machine.
You can edit the gii template to suite your needs. Otherwise, if not needed, you should use gii and do a little adjustments on the model.
I need to be able to dump my user table inside Drupal to an XML document that I can hit from a path in a browser.
e.g. mysite.com/users.php
Looking for an easy way to do this, an existing module would be ideal. Not sure if QueryPath does this.
Thanks.
Using Views Bonus Pack you can first build a view of all your users, and then create a 'feed' display. In the feed settings, you'll be able to select XML as one of the formats. You can then set the path to anything you like.
QueryPath can do this.
There is a database extension that comes with QueryPath's Drupal module that basically lets you take any SQL statement and inject the results into an XML document. The basic idea is explained here:
http://technosophos.com/content/using-querypath-interact-sql-database-part-1
The Drupal module has Drupal-specific DB bindings though. (So stuff like {table} is correctly translated.)
I've also used the Views Datasource module to do this, but it's buggy. The last two times I did it, I had to edit the source code for the module first.
I've created a JSR-268 portlet for Liferay which uses services to interact with a database. I can deploy the portlet without problems or errors, but the table defined by the services is not created!
I get no "table not found" error when I test the portlet. I get no errors at all! The table just isn't there in the database. I've found other things on the internet saying that I should use the generated "create.sql" file that the Liferay Service Builder created, but I don't see that file anywhere.
Can someone help me out?
Have the tables never been created? I had a similar problem when I deleted the tables by hand. I thought they would be created again when deploying the portlet again, but it didn't happen.
After studying the source code I found out that Liferay stores information about the portlets in the table servicecomponent and checks 2 things before it executes the (pseudo) SQL in META-INF/tables.sql:
The build.number in service.properties must be higher than that, stored in servicecomponent,
The tables.sql must be different from the one stored in servicecomponent.
Only then the tables.sql is executed.
An easy way to achieve that, is to delete all entries in servicecomponent addressing your portlet.
Try by deleting an entry from servicecomponent table. And redeploy your portlet.
delete FROM servicecomponent where buildNamespace="<your table namespace>"
I have faced the same problem and below given solution works for me.
Steps
I have changed the build.number in service.properties higher than that stored in servicecomponent.
Removed all the xml files from META-INF folder.
Removed all the sql files from webapp/WEB-INF/sql folder.
Then build-service and deploy will creates custom tables that are defiend in service.xml file.
If you're using serviceBuilder in Liferay 6.2 when you define a new entity in the Liferay schema in service.xml, the first time that any Portlet tries to access the table it will be created if it's not exist.
There are several problems when you're using a different schema because sometimes Liferay not create tables automatically. Then you need to lauch the Creation SQL sentence and create it manually and then access it through LocalServiceUtil.