-
Notifications
You must be signed in to change notification settings - Fork 0
/
company.py
35 lines (29 loc) · 1.18 KB
/
company.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# This file is part of account_invoice_ar_currency module for Tryton.
# The COPYRIGHT file at the top level of this repository contains
# the full copyright notices and license terms.
from trytond.model import fields
from trytond.pool import PoolMeta
from trytond.pyson import Eval, Bool
class Company(metaclass=PoolMeta):
__name__ = 'company.company'
force_currency_invoice_out = fields.Boolean(
"Set currency for customer invoice",
help="Force specific currency for customer invoice.")
currency_invoice_out = fields.Many2One('currency.currency',
"Currency for invoice",
states={
'invisible': ~Bool(Eval('force_currency_invoice_out')),
'required': Bool(Eval('force_currency_invoice_out')),
})
exclude_export_conversion = fields.Boolean(
"Exclude conversion in Export invoices",
states={
'invisible': ~Bool(Eval('force_currency_invoice_out')),
},
help="Exclude currency conversion in Export invoices.")
@classmethod
def default_force_currency_invoice_out(cls):
return False
@classmethod
def default_exclude_export_conversion(cls):
return True