[6.0] account_tax_include does not pass company_id in product_id_change
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Low
|
Unassigned |
Bug Description
On trunk/6.0 version, with account_tax_include module installed, trying to add a product to a supplier invoice will raise an "Wrong ID for the browse record, got None, expected an integer." exception.
The account_tax_include module on the 6.0 is not currently compatible with the account module on 6.0: The account module was updated to add multicompany support, so now, for the product_id field, the product_id_change method receives the company_id from the view in the context; but the account_tax_include module, that overwrites this field in the view, was not updated accordingly and no company_id is passed leading to a crash*.
* We have another bug here raising an exception instead of handling it gracefully (see bug 615322): The product_id_change of the account module does fail if no company_id is passed in the context!
Hi Borja,
I just had a close look at this one and found that the account_tax_include module doesn't break the chain of passing company_id in context.
The view it inherits is the list view(type=Tree) and so far the view is not editable, so there is no chance that the module stops passing company_id in context.
On_change() of product_id will always be called from form view and the module doesn't disturb original definition of on_change().
For the sake of consistence and future use(any module may make the list view editable for invoice line), I am doing the suggested changes.
Fixed by revision 4543 <email address hidden>.
Share your views.
Thanks.