changeset ecb3b008b154 in modules/project_revenue:default
details:
https://hg.tryton.org/modules/project_revenue?cmd=changeset;node=ecb3b008b154
description:
Add test on context of company multivalue target fields
issue10067
review333851026
diffstat:
tests/test_project_revenue.py | 4 +++-
work.py | 6 +++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diffs (31 lines):
diff -r f20d4ed231b0 -r ecb3b008b154 tests/test_project_revenue.py
--- a/tests/test_project_revenue.py Sat Dec 19 17:08:46 2020 +0100
+++ b/tests/test_project_revenue.py Fri Mar 05 15:49:19 2021 +0100
@@ -7,8 +7,10 @@
from trytond.tests.test_tryton import doctest_teardown
from trytond.tests.test_tryton import doctest_checker
+from trytond.modules.company.tests import CompanyMultiValueTestMixin
-class ProjectRevenueTestCase(ModuleTestCase):
+
+class ProjectRevenueTestCase(CompanyMultiValueTestMixin, ModuleTestCase):
'Test ProjectRevenue module'
module = 'project_revenue'
extras = ['purchase']
diff -r f20d4ed231b0 -r ecb3b008b154 work.py
--- a/work.py Sat Dec 19 17:08:46 2020 +0100
+++ b/work.py Fri Mar 05 15:49:19 2021 +0100
@@ -20,7 +20,11 @@
product = fields.Many2One('product.product', 'Product',
domain=[
('type', '=', 'service'),
- ])
+ ],
+ context={
+ 'company': Eval('company', -1),
+ },
+ depends=['company'])
list_price = fields.Numeric('List Price', digits=price_digits)
revenue = fields.Function(fields.Numeric('Revenue',
digits=(16, Eval('currency_digits', 2)),