Fix: Test

This commit is contained in:
sinergia 2024-10-21 20:52:01 -05:00
parent 4ebe44ae45
commit 8211278e78

View File

@ -2,7 +2,7 @@
# this repository contains the full copyright notices and license terms. # this repository contains the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, ModelSingleton, fields from trytond.model import ModelView, ModelSQL, ModelSingleton, fields
from trytond.modules.currency.fields import Monetary from trytond.modules.currency.fields import Monetary
from trytond.pyson import Eval # from trytond.pyson import Eval
from trytond.transaction import Transaction from trytond.transaction import Transaction
from trytond.pool import Pool from trytond.pool import Pool
@ -11,35 +11,32 @@ class Configuration(ModelSingleton, ModelView, ModelSQL):
"Configuration Chas Closures" "Configuration Chas Closures"
__name__ = 'sale.cash_closures' __name__ = 'sale.cash_closures'
company = fields.Many2One( # company = fields.Many2One(
'company.company', "Company", required=True) # 'company.company', "Company", required=True)
currency = fields.Many2One( currency = fields.Many2One(
'currency.currency', "Currency") 'currency.currency', "Currency")
mismatch_limit = Monetary( mismatch_limit = Monetary(
"Mismatch Limit", currency='currency', digits='currency') "Mismatch Limit", currency='currency', digits='currency')
account_mismatch_charge = fields.Many2One( account_mismatch_charge = fields.Many2One(
'account.account', "Account Mismatch Charge", 'account.account', "Account Mismatch Charge",
domain=[ domain=[
('company', '=', Eval('company', 0)),
('type', '!=', None), ('type', '!=', None),
('closed', '!=', True), ('closed', '!=', True),
],) ],)
account_mismatch_positive = fields.Many2One( account_mismatch_positive = fields.Many2One(
'account.account', "Account Mismatch Positivo", 'account.account', "Account Mismatch Positivo",
domain=[ domain=[
('company', '=', Eval('company', 0)),
('type', '!=', None), ('type', '!=', None),
('closed', '!=', True), ('closed', '!=', True),
],) ],)
@staticmethod @classmethod
def default_currency(): def default_currency(cls):
Company = Pool().get('company.company') Company = Pool().get('company.company')
company = Transaction().context.get('company') company = Transaction().context.get('company')
if company: if company:
return Company(company).currency.id return Company(company).currency.id
@staticmethod # @classmethod
def default_company(): # def default_company(cls):
return Transaction().context.get('company') # return Transaction().context.get('company')