Created on 2021-06-15.17:36:54 by acaubet, last changed 1 month ago by roundup-bot.
New changeset fe1bafbeec05 by Sergi Almacellas Abellana in branch '6.0': Only return taxes for the current company https://hg.tryton.org/modules/account_product/rev/fe1bafbeec05
New changeset 76dc325d6ca1 by Sergi Almacellas Abellana in branch 'default': Only return taxes for the current company https://hg.tryton.org/tryton-env/rev/76dc325d6ca1
New changeset b6cdedd37deb by Sergi Almacellas Abellana in branch 'default': Only return taxes for the current company https://hg.tryton.org/modules/account_product/rev/b6cdedd37deb
The problem is that on_change_product returns taxes for all existing companies, which makes a record rule crash.
To reproduce the error you should do the following steps:
If the user only have access to a single company, the record rule is not satisfied so it produces an error
If the user has access to both companies, the taxes is duplicated
Here is review336421003 that fixes the problem for me.
I do not understand the problem. There can be only one account per tax which is enforced to be in the same company as the tax.
In multicompany environment, the tax account is not properly selected (wrong invoice_account and credit_note_account) on changing product as we search by id, causing a domain error.
IIUC I assume that a accounting category must have both taxes defined like:
ACCOUNT CATEGORY: GENERAL 21
TAX LINE 1: COMPANY A - IVA 21%
TAX LINE 2: COMPANY B - IVA 21%
For me the proper way to select the appropriate tax is by filtering only the ones from the invoice company instead of using a id.
I'm still trying to figure out how it works and how to solve to submit a patch. Appreciate any help.
messages: + msg68393
|2021-06-17 17:33:01||roundup-bot||set||messages: + msg68338|
nosy: + roundup-bot
status: testing -> resolved
|2021-06-16 10:36:44||reviewbot||set||messages: + msg68286|
|2021-06-16 09:29:14||ced||set||keyword: + backport|
nosy: + reviewbot
|2021-06-16 08:25:46||pokoli||set||assignedto: pokoli|
component: + account_product, - account_invoice
keyword: + review
messages: + msg68280
nosy: + pokoli
status: need-eg -> testing
nosy: + ced
status: chatting -> need-eg
Showing 10 items. Show all history (warning: this could be VERY long)