Created on 2021-12-21.15:42:34 by juanjogp, last changed 1 month ago by ced.
@pokoli described correctly the problem. The default value is not send by the client because it did not changed and it is not filled because it is not a creation. And as all accounting values are stored on the same model, once it is created it is created with None value for all fields that are not modified.
This is the usual problem of global default. Should we store the default value and so it is no more inherited from the global configuration or we should consider None as not a real value and change it for the default global. As usual I do not like implicit behavior so for me we must have checkboxes to define if we use the default or not.
But now to fix the behavior for backport the multivalue storage model must use the default value of the party on creation. This should work by extending
multivalue_record. But maybe we can have a generic fix in
I think the problem is related because the get_multivalue retuns default values when no record is found (this is the case for point 12) but this value is not written back to the server after creating the second record.
Could you test which values are sent from the client when you set the receivable account for the second company? I will expect that both the tax rule and the receivable account are sent to the server and written to the multivalue model.
I replicated this bug in https://demo6.2.tryton.org/:
(For the test, i will use the companies "Michael Scott Paper Company" and "Dunder Mifflin inc")
1. I'm going to start form the company "Michael Scott Paper Company":
2. Go to Financial -> Configuration -> Configuration
3. Create a "Default Customer Tax Rule", in this case Tax Test "Michael Scott Paper Company"
4. Do the same for the company "Dunder Mifflin inc"
5. Return to "Michael Scott Paper Company"
6. Create a party, for the test, i named it "Party Test"
7. In the same party, go to the Accounting page
8. Add a value in "Account Receivable" field
8. The field "Customer Tax Rule" must have a value (from the default field in Financial configuration)
10. Go to the company "Dunder Mifflin inc"
11. Go to the same party we created in the "Michael Scott Paper Company" company
12. If we go again to Accounting Page, the only field with value will be the "Customer Tax Rule"
(this field will have the default value from the "Dunder Mifflin inc" Financial configuration)
13. If we add a value to the "Account Receivable" and save, the value from "Customer Tax Rule" will disappear
I also replicated this bug in a local Tryton with the party and account modules installed (and its requirements)
nosy: + ced
nosy: + pokoli
status: unread -> chatting