adding an existing fileds to a new window

Asked by Bushair

i want to add a new field called 'Notes' to the point of sale window

i have modified the pos.order form to add the line

<field name="notes"/> as shown below

                         <tree string="Order lines" editable="bottom">
                                    <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" width="275"/>
                                    <field name="qty"/>
                                    <field name="discount"/>
                                     <field name="notes"/>
                                    <field name="price_unit"/>
                                    <field name="price_subtotal"/>
                                </tree>

                                <form string="Order lines">
                                    <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"/>
                                    <field name="qty"/>
                                    <field name="discount"/>
                                     <field name="notes"/>
                                    <field name="price_unit"/>
                                    <field name="price_subtotal"/>
                                </form>
                            </field>

Also modified the pos.py file located in /usr/src/openerp-server-5.0.6/bin/addons/point_of_sale folder
with the following changes

    _columns = {
        'name': fields.char('Line Description', size=512),
        'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], required=True, change_default=True),
        'price_unit': fields.float('Unit Price', required=True),
        'qty': fields.float('Quantity'),
        'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal'),
        'discount': fields.float('Discount (%)', digits=(16, 2)),
      'notes': fields.text('Notes'),
        'order_id': fields.many2one('pos.order', 'Order Ref', ondelete='cascade'),
        'create_date': fields.datetime('Creation Date', readonly=True),
        }

The other file which i modifed is pos_view.xml located in /usr/src/openerp-server-5.0.6/bin/addons/point_of_sale

                            <field name="lines" colspan="4" nolabel="1">
                                <tree string="Order lines" editable="bottom">
                                    <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" width="275"/>
                                    <field name="qty" />
                                    <field name="discount" />
                                    <field name="notes" />
                                    <field name="price_unit" />
                                    <field name="price_subtotal"/>
                                </tree>

                                <form string="Order lines">
                                    <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"/>
                                    <field name="qty" />
                                    <field name="discount" />
                                    <field name="notes" />
                                    <field name="price_unit" />
                                    <field name="price_subtotal"/>
                                </form>
                            </field>

Now when i tried to click the point of sale window link, am getting the
below error

View error

Can't find field 'notes' in the following view parts composing the view of object model 'pos.order':
 * pos.order

Either you wrongly customised this view, or some modules bringing those views are not compatible with your current data model

It looks like this issue is since i havent compiled the
.python file .
How can i compile and build the pos.py file located in /usr/src/openerp-server-5.0.6/bin/addons/point_of_sale
Where the compiled files will get stored?

Do i need to modify any other xml fils for this change to occur?

can anyone tell me the step by step procedure to add an existing
field like "notes" to a new window?

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Bushair
Solved:
Last query:
Last reply:
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#1

Hello Bushair,

Thank you for your interest in OpenERP.

You have added a field into a table of pos_lines.

It needs a database related procedure to be called upon, so you should have updated the module itself first(either by command line or by button of upgrademodule).

Let us know if it does not solve your problem.

Thank you.

Revision history for this message
Bushair (bushairka) said :
#2

Hi Jay
Thank you very much for the reply

when i do a >> locate pos_view.xml in my system , am getting the below list of files,

/home/bushair/.kde/share/apps/RecentDocuments/pos_view.xml.desktop
/usr/lib/openerp-server/addons/point_of_sale/pos_view.xml
/usr/local/lib/python2.6/site-packages/openerp-server/addons/point_of_sale/pos_view.xml
/usr/src/extra-trunk/point_of_sale/pos_view.xml
/usr/src/openerp-server-5.0.6/bin/addons/point_of_sale/pos_view.xml

i modified all the above files and then updated the module list using
Administration->ModulesManagement->Update Module list

But still am not able to see the newly added field serial_number in my point of sale window page.

it will be great if you can help me to resolve this

thanks
Bushair

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#3

Hello Bushair,

The file /usr/local/lib/python2.6/site-packages/openerp-server/addons/point_of_sale/pos_view.xml is the responsible one.

You may go to this menu Administration/Customization/Database Structure/Objects, and check for the point of sale order line object whether the field has been added or not.

In addition to that, you may opt to look at Administration/Customization/User Interface/Views and check whether the view has been updated or not(Go to this menu and search for the pos view where you modified the code).

Hope it helps.

Thank you.

Revision history for this message
Bushair (bushairka) said :
#4

Hi Jay,
Thank you very much for the reply.
i modifed the file usr/local/lib/python2.6/site-packages/openerp-server/addons/point_of_sale/pos_view.xml to add the new filed serial_number.

The modified file is as
                        <page string="Order lines">
                            <field name="partner_id" on_change="onchange_partner_pricelist(partner_id)"/>
                            <field name="pricelist_id" domain="[('type','=','sale')]"/>
                            <field name="salesman_id" />
                            <field name="lines" colspan="4" nolabel="1">
                                <tree string="Order lines" editable="bottom">
                                    <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" width="275"/>
                                    <field name="qty" />
                                    <field name="discount" />
                                    <field name="serial_number" />
                                    <field name="price_unit" />
                                    <field name="price_subtotal"/>
                                </tree>

                                <form string="Order lines">
                                    <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)"/>
                                    <field name="qty" />
                                    <field name="discount" />
                                    <field name="serial_number" />
                                    <field name="price_unit" />
                                    <field name="price_subtotal"/>
                                </form>

added new field called serial_number after discount filed.

But when i looked to menu Administration/Customization/Database Structure/Objects
Lines of Point of Sale
i couldnot see the serial_number field.
qty,discount,price_unit and price_subtotal fields are there.
can i create a new field called serial_number at this window?
do i need to add this entry to any python file?

see my requirement is that i want to add a new filed called serial_number to the point of sale window after discount field.
it will be great if you can tell me steps required to do this
Thanks in millions

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#5

Hello,

You need to update your complete database in terminal (In Ubuntu Linux) by following way :

./openerp-server.py -u all -d <Your db name>

When all database will be updated you will be seen the new added field.

Thanks.

Revision history for this message
Bushair (bushairka) said :
#6

Hi,
Thanks for the mail.
So you mean to say that to add a new filed to the DB , the xml file /usr/local/lib/python2.6/site-packages/openerp-
server/addons/point_of_sale/pos_view.xml should be updated with the new filed and the do
./openerp-server.py -u all -d <Your db name> ?

do i need to add anything in .python files for adding a new field? if yes which python files?location of the python files?

i could see pos.py file in many location as

/home/bushair/openerp/addons/point_of_sale/pos.py
/home/bushair/openerp/addons-extra/point_of_sale_extension/pos.py
/usr/lib/openerp-server/addons/point_of_sale/pos.py
/usr/local/lib/python2.6/dist-packages/openerp-server/addons/point_of_sale/pos.py
/usr/local/lib/python2.6/site-packages/openerp-server/addons/point_of_sale/pos.py
/usr/src/extra-trunk/dm_purchase_advanced/wizard/dm_campaign_pos.py
/usr/src/extra-trunk/point_of_sale/pos.py
/usr/src/openerp-server-5.0.6/bin/addons/point_of_sale/pos.py
/usr/src/openerp-server-5.0.6/build/lib.linux-i686-2.6/openerp-server/addons/point_of_sale/pos.py

thanksHi,
Thanks for the mail.
So you mean to say that to add a new filed to the DB , the xml file /usr/local/lib/python2.6/site-packages/openerp-
server/addons/point_of_sale/pos_view.xml should be updated with the new filed and the do
./openerp-server.py -u all -d <Your db name> ?

do i need to add anything in .python files for adding a new field? if yes which python files?location of the python files?

i could see pos.py file in many location as

/home/bushair/openerp/addons/point_of_sale/pos.py
/home/bushair/openerp/addons-extra/point_of_sale_extension/pos.py
/usr/lib/openerp-server/addons/point_of_sale/pos.py
/usr/local/lib/python2.6/dist-packages/openerp-server/addons/point_of_sale/pos.py
/usr/local/lib/python2.6/site-packages/openerp-server/addons/point_of_sale/pos.py
/usr/src/extra-trunk/dm_purchase_advanced/wizard/dm_campaign_pos.py
/usr/src/extra-trunk/point_of_sale/pos.py
/usr/src/openerp-server-5.0.6/bin/addons/point_of_sale/pos.py
/usr/src/openerp-server-5.0.6/build/lib.linux-i686-2.6/openerp-server/addons/point_of_sale/pos.py

thanks

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#7

Hello Bushair,

Yes, you can create a new field via menu Administration/Customization/Database Structure/Objects
Lines of Point of Sale.

If you do anything via code(not in GUI),it will be just a back up as a module.

However,you can freely change the code on the mentioned menu.

Then you go to the menu Administration/Customization/User Interface/Views. find the related record of the view. change the same.

Feel free to ask more.

Thank you.

Revision history for this message
Bushair (bushairka) said :
#8

 Thank you very much Jay,
i could create a new field as per your suggestions

i could create a Custom field using the procedure you explained..
Can you please tell me how can i create a Base field using Menu?

thanks
Bushair

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#9

Hello Bushair,

Base field can be created by .py file.
I wonder why you are not able to add a field via .py file.

Have you updated the server by command line? You may need to remove *.pyc files.

Thank you.

Revision history for this message
Bushair (bushairka) said :
#10

Hi Jay,
Am trying using python file now.
But i got confused since i could see pos.py located in many locations as shown

/home/bushair/openerp/addons/point_of_sale/pos.py
/home/bushair/openerp/addons-extra/point_of_sale_extension/pos.py
/usr/lib/openerp-server/addons/point_of_sale/pos.py
/usr/local/lib/python2.6/dist-packages/openerp-server/addons/point_of_sale/pos.py
/usr/local/lib/python2.6/site-packages/openerp-server/addons/point_of_sale/pos.py
/usr/src/extra-trunk/dm_purchase_advanced/wizard/dm_campaign_pos.py
/usr/src/extra-trunk/point_of_sale/pos.py
/usr/src/openerp-server-5.0.6/bin/addons/point_of_sale/pos.py
/usr/src/openerp-server-5.0.6/build/lib.linux-i686-2.6/openerp-server/addons/point_of_sale/pos.py

which file i should modify for adding a new field.?

say i want to add a new filed called serial_number ,
so what all are the codes i have to add in pos.py file?

thanks

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#11

Hello Bushair,

How do we know that you have started server by what way?

I meant, you downloaded the files and started server? do you run by service or by ./openerp-server.py ?

I guess, /usr/src/openerp-server-5.0.6/bin/addons/point_of_sale/pos.py is the right path.

To do a test, remove the .pyc file within that folder,change the file so that it produces an error,so you can see that this file reflects or not.

The moral of the story is, you have to add a field in .py file, its view in .xml file and run the server with updation of the module.

Thank you.

Revision history for this message
Bushair (bushairka) said :
#12

Hi,
I modified the file /usr/src/openerp-server-5.0.6/bin/addons/point_of_sale/pos.py to add a new fields called serial_number and notes as follows.

    def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False):
        price = self.price_by_product(cr, uid, ids, pricelist, product_id, qty, partner_id)

        return {'value': {'price_unit': price}}

    _columns = {
        'name': fields.char('Line Description', size=512),
        'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], required=True, change_default=True),
        'price_unit': fields.float('Unit Price', required=True),
        'qty': fields.float('Quantity'),
        'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal'),
        'discount': fields.float('Discount (%)', digits=(16, 2)),
             'notes': fields.text('Notes'),
             'serial_number': fields.char('Serial Number', size=128),
        'order_id': fields.many2one('pos.order', 'Order Ref', ondelete='cascade'),
        'create_date': fields.datetime('Creation Date', readonly=True),
        }

i deleted the pos.pyc file from the above location.
But when i run the command ./openerp-server.py -u all -d test1 to update the Database ,am getting the below messages

bushair@bushair:/usr/src/openerp-server-5.0.6/bin$ sudo ./openerp-server.py -u all -d test1
[2009-12-22 10:19:31,781] INFO:server:version - 5.0.6
[2009-12-22 10:19:31,781] INFO:server:addons_path - /usr/src/openerp-server-5.0.6/bin/addons
[2009-12-22 10:19:31,781] INFO:server:database hostname - localhost
[2009-12-22 10:19:31,781] INFO:server:database port - 5432
[2009-12-22 10:19:31,782] INFO:server:database user - root
[2009-12-22 10:19:31,782] INFO:objects:initialising distributed objects services
[2009-12-22 10:19:31,920] INFO:dbpool:Connecting to test1
[2009-12-22 10:19:31,934] INFO:init:module base: loading objects
[2009-12-22 10:19:31,935] INFO:init:module base: registering objects
[2009-12-22 10:19:32,172] INFO:init:module base: creating or updating database tables
[2009-12-22 10:19:33,663] INFO:init:module base: loading base_data.xml
[2009-12-22 10:19:33,914] INFO:init:module base: loading base_menu.xml
[2009-12-22 10:19:33,958] INFO:init:module base: loading security/base_security.xml
[2009-12-22 10:19:34,007] INFO:init:module base: loading res/res_security.xml
[2009-12-22 10:19:34,018] INFO:init:module base: loading maintenance/maintenance_security.xml
[2009-12-22 10:19:34,026] INFO:init:module base: loading base_update.xml
[2009-12-22 10:19:34,115] INFO:init:module base: loading ir/wizard/wizard_menu_view.xml
[2009-12-22 10:19:34,133] INFO:init:module base: loading ir/ir.xml
[2009-12-22 10:19:34,920] INFO:init:module base: loading ir/workflow/workflow_view.xml
[2009-12-22 10:19:35,050] INFO:init:module base: loading module/module_wizard.xml
[2009-12-22 10:19:35,127] INFO:init:module base: loading module/module_view.xml
[2009-12-22 10:19:35,257] INFO:init:module base: loading module/module_data.xml
[2009-12-22 10:19:35,266] INFO:init:module base: loading module/module_report.xml
[2009-12-22 10:19:35,273] INFO:init:module base: loading res/res_request_view.xml
[2009-12-22 10:19:35,349] INFO:init:module base: loading res/res_lang_view.xml
[2009-12-22 10:19:35,383] INFO:init:module base: loading res/partner/partner_report.xml
[2009-12-22 10:19:35,389] INFO:init:module base: loading res/partner/partner_view.xml
[2009-12-22 10:19:35,679] INFO:init:module base: loading res/partner/partner_wizard.xml
[2009-12-22 10:19:35,698] INFO:init:module base: loading res/bank_view.xml
[2009-12-22 10:19:35,730] INFO:init:module base: loading res/country_view.xml
[2009-12-22 10:19:35,785] INFO:init:module base: loading res/res_currency_view.xml
[2009-12-22 10:19:35,814] INFO:init:module base: loading res/partner/crm_view.xml
[2009-12-22 10:19:35,902] INFO:init:module base: loading res/partner/partner_data.xml
[2009-12-22 10:19:35,915] INFO:init:module base: loading res/ir_property_view.xml
[2009-12-22 10:19:35,956] INFO:init:module base: loading security/base_security.xml
[2009-12-22 10:19:36,005] INFO:init:module base: loading maintenance/maintenance_view.xml
[2009-12-22 10:19:36,055] INFO:init:module base: loading security/ir.model.access.csv
[2009-12-22 10:19:36,820] INFO:init:updating modules list
[2009-12-22 10:19:41,465] INFO:init:module base: loading objects
[2009-12-22 10:19:41,573] INFO:init:module process: loading objects
[2009-12-22 10:19:41,573] INFO:init:module process: registering objects
[2009-12-22 10:19:41,581] INFO:init:module process: creating or updating database tables
[2009-12-22 10:19:41,687] INFO:init:module base_setup: loading objects
[2009-12-22 10:19:41,688] INFO:init:module base_setup: registering objects
[2009-12-22 10:19:41,688] INFO:init:module base_setup: creating or updating database tables
[2009-12-22 10:19:41,689] INFO:init:module board: loading objects
[2009-12-22 10:19:41,689] INFO:init:module board: registering objects
[2009-12-22 10:19:41,695] INFO:init:module board: creating or updating database tables
[2009-12-22 10:19:41,756] INFO:init:module product: loading objects
[2009-12-22 10:19:41,757] INFO:init:module product: registering objects
[2009-12-22 10:19:41,781] INFO:init:module product: creating or updating database tables
[2009-12-22 10:19:42,126] INFO:init:module hr: loading objects
[2009-12-22 10:19:42,126] INFO:init:module hr: registering objects
[2009-12-22 10:19:42,137] INFO:init:module hr: creating or updating database tables
[2009-12-22 10:19:42,311] INFO:init:module hr_attendance: loading objects
[2009-12-22 10:19:42,311] INFO:init:module hr_attendance: registering objects
[2009-12-22 10:19:42,318] INFO:init:module hr_attendance: creating or updating database tables
[2009-12-22 10:19:42,414] INFO:init:module account: loading objects
[2009-12-22 10:19:42,414] INFO:init:module account: registering objects
[2009-12-22 10:19:42,514] INFO:init:module account: creating or updating database tables
[2009-12-22 10:19:43,469] WARNING:orm:column 'amount_untaxed' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:43,481] WARNING:orm:column 'amount_tax' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:43,498] WARNING:orm:column 'residual' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:43,513] WARNING:orm:column 'amount_total' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:43,544] WARNING:orm:column 'price_subtotal' in table 'account_invoice_line' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:43,987] INFO:init:module stock: loading objects
[2009-12-22 10:19:43,987] INFO:init:module stock: registering objects
[2009-12-22 10:19:44,025] INFO:init:module stock: creating or updating database tables
[2009-12-22 10:19:44,483] INFO:init:module hr_timesheet: loading objects
[2009-12-22 10:19:44,484] INFO:init:module hr_timesheet: registering objects
[2009-12-22 10:19:44,489] INFO:init:module hr_timesheet: creating or updating database tables
[2009-12-22 10:19:44,577] INFO:init:module account_tax_include: loading objects
[2009-12-22 10:19:44,577] INFO:init:module account_tax_include: registering objects
[2009-12-22 10:19:44,583] INFO:init:module account_tax_include: creating or updating database tables
[2009-12-22 10:19:44,639] WARNING:orm:column 'amount_untaxed' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:44,651] WARNING:orm:column 'amount_tax' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:44,671] WARNING:orm:column 'residual' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:44,701] WARNING:orm:column 'amount_total' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:44,743] WARNING:orm:column 'price_subtotal' in table 'account_invoice_line' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:44,745] WARNING:orm:column 'price_subtotal_incl' in table 'account_invoice_line' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:44,793] INFO:init:module project: loading objects
[2009-12-22 10:19:44,794] INFO:init:module project: registering objects
/usr/src/openerp-server-5.0.6/bin/addons/project/report/gantt_report.py:23: DeprecationWarning: the sets module is deprecated
  from sets import Set
[2009-12-22 10:19:44,808] INFO:init:module project: creating or updating database tables
[2009-12-22 10:19:44,881] WARNING:orm:column 'effective_hours' in table 'project_task' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:44,890] WARNING:orm:column 'delay_hours' in table 'project_task' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:44,900] WARNING:orm:column 'total_hours' in table 'project_task' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:44,915] WARNING:orm:column 'progress' in table 'project_task' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:44,979] INFO:init:module hr_timesheet_invoice: loading objects
[2009-12-22 10:19:44,979] INFO:init:module hr_timesheet_invoice: registering objects
[2009-12-22 10:19:44,989] INFO:init:module hr_timesheet_invoice: creating or updating database tables
[2009-12-22 10:19:45,157] WARNING:orm:column 'amount_untaxed' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:45,168] WARNING:orm:column 'amount_tax' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:45,185] WARNING:orm:column 'residual' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:45,200] WARNING:orm:column 'amount_total' in table 'account_invoice' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:45,206] INFO:init:module purchase: loading objects
[2009-12-22 10:19:45,206] INFO:init:module purchase: registering objects
[2009-12-22 10:19:45,216] INFO:init:module purchase: creating or updating database tables
[2009-12-22 10:19:45,254] WARNING:orm:column 'amount_untaxed' in table 'purchase_order' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:45,266] WARNING:orm:column 'amount_tax' in table 'purchase_order' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:45,286] WARNING:orm:column 'amount_total' in table 'purchase_order' has changed type (DB = float8, def = float) but unable to migrate this change !
[2009-12-22 10:19:45,492] INFO:init:module report_analytic_line: loading objects
[2009-12-22 10:19:45,493] INFO:init:module report_analytic_line: registering objects
[2009-12-22 10:19:45,495] INFO:init:module report_analytic_line: creating or updating database tables
[2009-12-22 10:19:45,502] INFO:init:module report_timesheet: loading objects
[2009-12-22 10:19:45,502] INFO:init:module report_timesheet: registering objects
[2009-12-22 10:19:45,514] INFO:init:module report_timesheet: creating or updating database tables
[2009-12-22 10:19:45,585] INFO:init:module account_analytic_analysis: loading objects
[2009-12-22 10:19:45,585] INFO:init:module account_analytic_analysis: registering objects
[2009-12-22 10:19:45,596] INFO:init:module account_analytic_analysis: creating or updating database tables
[2009-12-22 10:19:45,688] INFO:init:module mrp: loading objects
[2009-12-22 10:19:45,689] INFO:init:module mrp: registering objects
[2009-12-22 10:19:45,721] INFO:init:module mrp: creating or updating database tables
[2009-12-22 10:19:46,402] INFO:init:module hr_timesheet_sheet: loading objects
[2009-12-22 10:19:46,402] INFO:init:module hr_timesheet_sheet: registering objects
[2009-12-22 10:19:46,413] INFO:init:module hr_timesheet_sheet: creating or updating database tables
/usr/src/openerp-server-5.0.6/bin/tools/misc.py:741: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  if hasattr(e, 'message'):
/usr/src/openerp-server-5.0.6/bin/tools/misc.py:742: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  return ustr(e.message)
Traceback (most recent call last):
  File "./openerp-server.py", line 111, in <module>
    pooler.get_db_and_pool(db, update_module=tools.config['init'] or tools.config['update'])
  File "/usr/src/openerp-server-5.0.6/bin/pooler.py", line 40, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/usr/src/openerp-server-5.0.6/bin/addons/__init__.py", line 728, in load_modules
    r = load_module_graph(cr, graph, status, report=report)
  File "/usr/src/openerp-server-5.0.6/bin/addons/__init__.py", line 581, in load_module_graph
    init_module_objects(cr, package.name, modules)
  File "/usr/src/openerp-server-5.0.6/bin/addons/__init__.py", line 370, in init_module_objects
    obj.init(cr)
  File "/usr/src/openerp-server-5.0.6/bin/addons/hr_timesheet_sheet/hr_timesheet_sheet.py", line 632, in init
    )) AS bar""")
  File "/usr/src/openerp-server-5.0.6/bin/sql_db.py", line 76, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/src/openerp-server-5.0.6/bin/sql_db.py", line 120, in execute
    res = self._obj.execute(query, params)
psycopg2.ProgrammingError: cannot change data type of view column "total_difference" from numeric to double precision

how can i resolve this issue...?
.pyc is not created in the location.

thanks
Bushair

Revision history for this message
Bushair (bushairka) said :
#13

Hi Jay
This issue got resolved when i changed the double precision to numeric in hr_timesshet_sheet.py
Now i could add fields using python files

Thanks
Bushair