[6.1] form view of account.invoice.line uses parent.xxxx

Bug #1065568 reported by Alexandre Fayolle - camptocamp
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
OpenERP Publisher's Warranty Team

Bug Description

The form view for account.invoice.line defined in account/account_invoice_view.xml uses parent.xxx in various places. This must not be done as it breaks when the view is called from another context (and the crash is really not nice).

This view must be inlined in the account.invoice form view, and another safe form view must be provided.

Steps to reproduce:

1. define a custom tree view displaying account.invoice.line
2. display that view
3. click on a line

you get a crash

Client Traceback (most recent call last):
File "/srv/openerp/instances/openerp_test_alpesdeveloppement/src/webclient/addons/web/common/http.py", line 180, in dispatch
response["result"] = method(controller, self, **self.params)
File "/srv/openerp/instances/openerp_test_alpesdeveloppement/src/webclient/addons/web/controllers/main.py", line 1209, in load
return self.fields_view_get(req, model, view_id, view_type, toolbar=toolbar)
File "/srv/openerp/instances/openerp_test_alpesdeveloppement/src/webclient/addons/web/controllers/main.py", line 1090, in fields_view_get
context = req.session.eval_context(req.context)
File "/srv/openerp/instances/openerp_test_alpesdeveloppement/src/webclient/addons/web/common/session.py", line 196, in eval_context
return ccontext.evaluate(ctx)
File "/srv/openerp/instances/openerp_test_alpesdeveloppement/src/webclient/addons/web/common/nonliterals.py", line 267, in evaluate
final_context.update(context_to_eval.evaluate(ctx))
File "/srv/openerp/instances/openerp_test_alpesdeveloppement/src/webclient/addons/web/common/nonliterals.py", line 267, in evaluate
final_context.update(context_to_eval.evaluate(ctx))
File "/srv/openerp/instances/openerp_test_alpesdeveloppement/src/webclient/addons/web/common/nonliterals.py", line 185, in evaluate
return eval(self.get_context_string(), SuperDict(ctx))
File "<string>", line 1, in <module>
File "/srv/openerp/instances/openerp_test_alpesdeveloppement/src/webclient/addons/web/common/nonliterals.py", line 194, in __getattr__
raise AttributeError(name)
AttributeError: type

the attribute error comes from the use of parent.type in the form view.

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

This issue causes lp:1065850

Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
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.