[6.0] account_tax_include does not pass company_id in product_id_change

Bug #615324 reported by Borja López Soilán (NeoPolus)
10
This bug affects 2 people
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!

Related branches

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :
description: updated
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

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.

Changed in openobject-addons:
importance: Undecided → Low
milestone: none → 6.0
status: New → Fix Released
Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Hi Jay and thanks :)

As you say, the list view is not editable on the latest 6.0dev revisions, but it was editable for supplier invoices on both 5.0 and 5.2dev versions. So some people might be used to the old behaviour and edit / extend the view so the tree is editable in list mode (editable="top").

In the end, it's just better to keep it consistent to prevent this kind of problems.

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.