Enforce to set company context to field with CompanyMultiValueMixin target
In order to achieve #4080 (closed) we need to be sure that referential record of type CompanyMultiValueMixin
has the proper company in the context so the MultiValue
fields returns the correct value.
Initially I thought that we should use get_multivalue
everywhere and ensure to set the proper context but this can not be done for the on_change calls.
But since #8586 (closed) and #8225 (closed) we can rely on instance having the proper context (if the developer does not set deliberately something else).
So the proposal is to add a MixinTestCase
in company to be used on module depending on company that checks for models having a Many2One
to company.company
that fields linking to CompanyMultiValueMixin
have a company
context set.
This will not directly ensure that on_change calls have the proper depends but if accessing a CompanyMultiValue
from a field having the context defined but the value is empty, will return no value as None
will not match and so the code will fail even if the global context has the proper company
key.
Also this will reduce the cases where using get_multivalue
is really needed.
An initial test shows that such test enforces cases that may not be problematic like the party on shipments but in some point it will anyway good to show related properties like accounting for the shipment's company.
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Cédric Krier assigned to @ced
assigned to @ced
- Cédric Krier added company type::feature + 1 deleted label
added company type::feature + 1 deleted label
New review333851026 at https://codereview.tryton.org/333851026/#ps359121002
review333851026 updated at https://codereview.tryton.org/333851026/#ps349431002
review333851026 updated at https://codereview.tryton.org/333851026/#ps331971002
- Cédric Krier added 1 deleted label and removed 1 deleted label
added 1 deleted label and removed 1 deleted label
review333851026 updated at https://codereview.tryton.org/333851026/#ps361321002
New changeset 45ee2effc44c by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account/rev/45ee2effc44c- Roundup Robot added 1 deleted label and removed 1 deleted label
added 1 deleted label and removed 1 deleted label
- Roundup Robot closed
closed
New changeset 6778963ae1f6 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_credit_limit/rev/6778963ae1f6New changeset 583667a3e6bb by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_deposit/rev/583667a3e6bbNew changeset ba4f0f95aaad by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_dunning/rev/ba4f0f95aaadNew changeset 3c6c3291b227 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_dunning_letter/rev/3c6c3291b227New changeset fd2794c6e85f by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_eu/rev/fd2794c6e85fNew changeset c6194649bfbc by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_fr_chorus/rev/c6194649bfbcNew changeset e1bda4d7ae1d by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_invoice/rev/e1bda4d7ae1dNew changeset e16737bfa1cd by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_payment/rev/e16737bfa1cdNew changeset 4039f71221d1 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_payment_sepa/rev/4039f71221d1New changeset 0f7f1e7b54ea by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_payment_sepa_cfonb/rev/0f7f1e7b54eaNew changeset 472cf1d757b9 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_product/rev/472cf1d757b9New changeset 7a7db6cfa87b by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_statement/rev/7a7db6cfa87bNew changeset d97d7aad38d6 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/account_statement_rule/rev/d97d7aad38d6New changeset beb9d9a52376 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/analytic_account/rev/beb9d9a52376New changeset 1da4ea10bf4a by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/attendance/rev/1da4ea10bf4aNew changeset 720cf53c0c07 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/carrier_weight/rev/720cf53c0c07New changeset 172461253744 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/company/rev/172461253744New changeset f49c9caf802e by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/company_work_time/rev/f49c9caf802eNew changeset 7593dbf03bcb by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/notification_email/rev/7593dbf03bcbNew changeset 4559797d847c by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/product/rev/4559797d847cNew changeset f25c9efa916a by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/product_price_list/rev/f25c9efa916aNew changeset b448c92b5b34 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/production/rev/b448c92b5b34New changeset 46cd95e3f4e1 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/production_work/rev/46cd95e3f4e1New changeset f1f81a693bf3 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/project/rev/f1f81a693bf3New changeset cf445cd7954b by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/project_plan/rev/cf445cd7954bNew changeset ecb3b008b154 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/project_revenue/rev/ecb3b008b154New changeset 1e72fa3df393 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/purchase/rev/1e72fa3df393New changeset 71b597b62408 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/purchase_price_list/rev/71b597b62408New changeset ae93b9433870 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/purchase_request/rev/ae93b9433870New changeset 995f7ec8eb5d by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/purchase_request_quotation/rev/995f7ec8eb5dNew changeset 89d7c88aad99 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/purchase_requisition/rev/89d7c88aad99New changeset 8ebb6505676c by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/sale/rev/8ebb6505676cNew changeset 840def541d23 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/sale_complaint/rev/840def541d23New changeset 0581cdd92fbd by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/sale_credit_limit/rev/0581cdd92fbdNew changeset a9117f571bb8 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/sale_extra/rev/a9117f571bb8New changeset 8c8baff4fe23 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/sale_opportunity/rev/8c8baff4fe23New changeset 7af9b496a260 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/sale_price_list/rev/7af9b496a260New changeset c3476da72e5c by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/sale_promotion/rev/c3476da72e5cNew changeset e673033fdd74 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/sale_subscription/rev/e673033fdd74New changeset 29ca5bbe3215 by Cédric Krier in branch 'default':
Add test on context of company multivalue target fields
https://hg.tryton.org/modules/sale_supply_drop_shipment/rev/29ca5bbe3215