openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #05373
[Bug 919353] [NEW] [V6] audittrail falls in error when name column is declared readonly=True at object class declaration
Public bug reported:
If you declare an object like this
class MyObject(osv.osv):
_name = 'my.object'
_columns = {
'name' : fields.char('Name', size=256, readonly=True),
}
Myobject()
Then at audittrail.py:327:
...
"name": resource['name'],
will fall in error as resource doesn't contain a key called 'name',
because that field was declared readonly=True at class declaration.
I have bypassed this error by changing that line with:
'name' : resource.get('name'),
** Affects: openobject-addons
Importance: Undecided
Status: New
** Description changed:
If you declare an object like this
class MyObject(osv.osv):
- _name = 'my.object'
+ _name = 'my.object'
- _columns = {
- 'name' : fields.char('Name', size=256, readonly=True),
- }
+ _columns = {
+ 'name' : fields.char('Name', size=256, readonly=True),
+ }
Myobject()
-
- Then at audittrail.py:327:
- ...
- "name": resource['name'],
+ Then at audittrail.py:327:
+ ...
+ "name": resource['name'],
will fall in error as resource doesn't contain a key called 'name',
because that field was declared readonly=True at class declaration.
I have bypassed this error by changing that line with:
- "name" : resource.get(name),
+ 'name' : resource.get('name'),
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/919353
Title:
[V6] audittrail falls in error when name column is declared
readonly=True at object class declaration
Status in OpenERP Addons (modules):
New
Bug description:
If you declare an object like this
class MyObject(osv.osv):
_name = 'my.object'
_columns = {
'name' : fields.char('Name', size=256, readonly=True),
}
Myobject()
Then at audittrail.py:327:
...
"name": resource['name'],
will fall in error as resource doesn't contain a key called 'name',
because that field was declared readonly=True at class declaration.
I have bypassed this error by changing that line with:
'name' : resource.get('name'),
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/919353/+subscriptions
Follow ups
References