Field company_id not found in browse_record(account.account, 15)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Medium
|
Vinay Rana (OpenERP) | ||
Bug Description
The following error is generated when selecting a product on the invoice_line_form.
I've tracked the problem down to line 1303:
app_acc_in = account_
The code is trying to retrieve the account.account record from an ir.property record. However, it is using the ir.property record's ID (15 in my case), instead getting the account.account.id from the ir.property record (which is 99 in my case). The current code won't give an error on some databases if an account.account record exists that has an ID that is the same as the ir.property.id - but the code is wrong.
The code should get the account.account.id from the ir.property record, and use that in the browse statement. Something like this:
# Get the fields from the ir.property record
# Parse the value_reference field to get the ID of the account.account record
# Use the ID of the account.account record in the browse for the account.account record
(I imagine that there is a utility function somewhere to parse the value_reference field on a ir.property, but I don't know what that is).
bzr addons version: 4729
Environment Information :
System : Linux-2.
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid
Operating System Release : 2.6.32-24-generic
Operating System Version : #39-Ubuntu SMP Wed Jul 28 06:07:29 UTC 2010
Operating System Architecture : 32bit
Operating System Locale : en_GB.UTF8
Python Version : 2.6.5
OpenERP-Client Version : 6.0dev
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
File "/home/
result = ExportService.
File "/home/
res = fn(db, uid, *params)
File "/home/
return f(self, dbname, *args, **kwargs)
File "/home/
res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/
if app_acc_
File "/home/
raise AttributeError(e)
AttributeError: 'Field company_id not found in browse_
Related branches
- Vinay Rana (OpenERP) (community): Approve
-
Diff: 17 lines (+6/-1)1 file modifiedaccount/invoice.py (+6/-1)
Changed in openobject-addons: | |
assignee: | nobody → JMA(Open ERP) (jma-openerp) |
Changed in openobject-addons: | |
assignee: | JMA(Open ERP) (jma-openerp) → vra (openerp) (vra-openerp) |
status: | New → Confirmed |
milestone: | none → 6.0 |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Forgot to mention that the problem is in account/invoice.py.
Also, slight amendment to my code (added [] around account_id in the browse call):
# Get the fields from the ir.property record
my_value = property_ obj.read( cr,uid, in_pro_ id,['name' ,'value_ reference' ,'res_id' ])
account_ id = int (my_value[ 0]["value_ reference" ].split( ",")[1] )
app_acc_ in = account_ obj.browse( cr, uid, [account_id])[0]
# Parse the value_reference field to get the ID of the account.account record
# Use the ID of the account.account record in the browse for the account.account record