Issue 7198

Title
Unable to create asset with analytic_account and multiple companies
Priority
bug
Status
resolved
Nosy list
ced, pokoli, reviewbot, roundup-bot
Assigned to
pokoli
Keywords
review

Created on 2018-03-08.11:18:30 by pokoli, last changed 7 months ago by roundup-bot.

Messages

New changeset e7c0b6446e17 by Sergi Almacellas Abellana in branch '5.4':
Add company domain on asset analytic accounts
https://hg.tryton.org/modules/analytic_invoice/rev/e7c0b6446e17

New changeset 95e207047ded by Sergi Almacellas Abellana in branch '5.2':
Add company domain on asset analytic accounts
https://hg.tryton.org/modules/analytic_invoice/rev/95e207047ded

New changeset 56d673829a7e by Sergi Almacellas Abellana in branch '5.0':
Add company domain on asset analytic accounts
https://hg.tryton.org/modules/analytic_invoice/rev/56d673829a7e
New changeset b0b9a02023e8 by Sergi Almacellas Abellana in branch 'default':
Add company domain on asset analytic accounts
https://hg.tryton.org/tryton-env/rev/b0b9a02023e8
New changeset 23df221a67f3 by Sergi Almacellas Abellana in branch 'default':
Add company domain on asset analytic accounts
https://hg.tryton.org/modules/analytic_invoice/rev/23df221a67f3
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2019-10-11.11:04:32
El 10/10/19 a les 23:53, C├ędric Krier ha escrit:
> Do you plan to finish the patch?

No, I'm unable to work on this now
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2019-10-10.23:53:05
Do you plan to finish the patch?
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2018-05-24.11:15:04
On 2018-05-24 10:50, Sergi Almacellas Abellana wrote:
> > I think such domain should never depends on the context, so I would
> > also update other modules to follow this rule.
> 
> Current situation is that default values are not loaded if we do not
> depend on the context. 

In which case? For SaleLine, the _parent_sale.company should always be
available as sale is required. Idem for PurchaseLine. For InvoiceLine, I
think it should use first 'company' and if not set,
'_parent_invoice.company', one of those should always be set.

> I'm wondering if we should not remove the context dependency with
> issue4080 as we have to much dependency on the context now that is
> hard to test the code when the context is not set (as currently you do
> not have access to any company).

issue4080 will take a lot of time to be solved. And indeed I think we
should go progressively and this issue is one example of small steps
that will ease to fix issue4080.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2018-05-24.10:50:05
> I think such domain should never depends on the context, so I would also update other modules to follow this rule.

Current situation is that default values are not loaded if we do not depend on the context. 

I'm wondering if we should not remove the context dependency with issue4080 as we have to much dependency on the context now that is hard to test the code when the context is not set (as currently you do not have access to any company).
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2018-05-24.10:30:41
I think such domain should never depends on the context, so I would also update other modules to follow this rule.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2018-05-24.10:27:43
Then it's simpler as the domain is only missing on asset. review46471002 should fix it.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2018-05-23.23:48:13
I think the Mixin can not have a generic domain for company. I would be in favor that each usage setup the correct domain depending on what is available. This will prevent to create technical fields when PYSON statement would be more efficient.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2018-03-08.11:18:29
I have a database with two Companies: Company A and Company B.
I have created an analytic account root for Company A, but not for company B. 

When I create an asset for Company A, there is no problem. But when I create an asset for Company B I get a domain validation error for the analytic accounts of the asset. 

This is because the default analytic_accounts of AnalyticMixin creates analytic accounts for every root, without taking in account it's domain.
History
Date User Action Args
2020-04-25 12:55:48roundup-botsetmessages: + msg57468
keyword: - backport
2020-04-18 17:45:07roundup-botsetmessages: + msg57274
2020-04-18 17:45:02roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg57273
2020-04-17 18:11:13pokolisetstatus: chatting -> testing
assignedto: pokoli
2020-04-17 17:56:01cedsetkeyword: + backport
2019-10-11 11:17:37cedsetstatus: in-progress -> chatting
2019-10-11 11:04:33pokolisetstatus: testing -> in-progress
assignedto: pokoli -> (no value)
messages: + msg52408
2019-10-10 23:53:06cedsetmessages: + msg52397
2018-05-24 11:21:40reviewbotsetmessages: + msg40999
2018-05-24 11:15:05cedsetmessages: + msg40997

Showing 10 items. Show all history (warning: this could be VERY long)