Tryton - Issues

 

Issue7198

Title Unable to create asset with analytic_account and multiple companies
Priority bug Status testing
Superseder Nosy List ced, pokoli, reviewbot
Type behavior Components analytic_invoice
Assigned To pokoli Keywords review
Reviews 46471002
View: 46471002

Created on 2018-03-08.11:18:30 by pokoli, last changed by reviewbot.

Messages
review46471002 updated at https://codereview.tryton.org/46471002/#ps40001
msg40997 (view) 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.
msg40996 (view) 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).
review46471002 updated at https://codereview.tryton.org/46471002/#ps20001
msg40994 (view) 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.
msg40993 (view) 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.
msg40990 (view) 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.
review43211002 updated at https://codereview.tryton.org/43211002/#ps40001
review43211002 updated at https://codereview.tryton.org/43211002/#ps20001
review43211002 updated at https://codereview.tryton.org/43211002/#ps1
msg38862 (view) 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
2018-05-24 11:21:40reviewbotsetmessages: + msg40999
2018-05-24 11:15:05cedsetmessages: + msg40997
2018-05-24 10:50:05pokolisetmessages: + msg40996
2018-05-24 10:49:22reviewbotsetmessages: + msg40995
2018-05-24 10:30:41cedsetmessages: + msg40994
2018-05-24 10:27:43pokolisetreviews: 43211002,46471002,45171002,45161002 -> 46471002
component: - analytic_account, analytic_purchase, analytic_sale
messages: + msg40993
2018-05-23 23:48:13cedsetnosy: + ced
messages: + msg40990
2018-05-21 12:27:42pokolisetcomponent: + analytic_invoice, analytic_purchase, analytic_sale
2018-05-21 12:26:40pokolisetreviews: 43211002 -> 43211002,46471002,45171002,45161002
2018-05-21 12:19:57reviewbotsetmessages: + msg40793

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