Error when saving res_company object -> 'NoneType' object has no attribute 'id'

Bug #595399 reported by Alberto Luengo Cabanillas (Pexego)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

Hi all. Using 5.2dev server version, I got the following error after doing some changes on a res_company object through GTK client:

[2010-06-16 15:51:27,532] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
  File "/opt/openerp/server/bin/osv/osv.py", line 57, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp/server/bin/osv/osv.py", line 118, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp/server/bin/osv/osv.py", line 108, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp/server/bin/addons/base/res/res_company.py", line 164, in write
    return super(res_company, self).write(cr, *args, **argv)
  File "/opt/openerp/server/bin/osv/orm.py", line 3146, in write
    self._validate(cr, user, ids, context)
  File "/opt/openerp/server/bin/osv/orm.py", line 1015, in _validate
    if not fun(self, cr, uid, ids):
  File "/opt/openerp/server/bin/addons/product/company.py", line 42, in _check_currency
    if rec.currency_id.id <> rec.property_valuation_price_type.currency_id.id:
AttributeError: 'NoneType' object has no attribute 'id'

This was because I didn't have any value in 'property_valuation_price_type' field and when saving the server didn't complete it automatically (although it fills it in my own debugging environment version). Maybe it's a matter of revisions? Or this field should be mandatory?.

Thanks in advance.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Alberto,

You have to update the code.

Thanks.

Changed in openobject-addons:
milestone: none → 6.0
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.