Add company context to coupon parties field

issue11635
review439351003
This commit is contained in:
Cédric Krier
2022-08-08 22:23:11 +02:00
parent 03e8f0ca8c
commit e2e7da0d2f
3 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -191,7 +191,10 @@ class Sale(metaclass=PoolMeta):
},
depends={'coupon_parties'})
coupon_parties = fields.Function(fields.Many2Many(
'party.party', None, None, "Coupon Parties"),
'party.party', None, None, "Coupon Parties",
context={
'company': Eval('company', -1),
}),
'on_change_with_coupon_parties')
@fields.depends(methods=['_coupon_parties'])
+2 -1
View File
@@ -1,10 +1,11 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.modules.company.tests import CompanyTestMixin
from trytond.tests.test_tryton import ModuleTestCase
class SalePromotionCouponTestCase(ModuleTestCase):
class SalePromotionCouponTestCase(CompanyTestMixin, ModuleTestCase):
'Test Sale Promotion Coupon module'
module = 'sale_promotion_coupon'
+1
View File
@@ -1,6 +1,7 @@
[tryton]
version=6.5.0
depends:
company
ir
sale
sale_promotion