mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] Improve by adding group multicurrency and remove test on currency of account
This commit is contained in:
@@ -47,14 +47,6 @@ class EasyReconcileOptions(orm.AbstractModel):
|
||||
('newest_debit', 'Date of most recent debit')
|
||||
]
|
||||
|
||||
def _get_account_currency(self, cr, uid, ids, field_name, arg,
|
||||
context=None):
|
||||
result = {}
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
# Always provide second currency
|
||||
result[line.id] = bool(line.task_id.account.currency_id.id)
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'write_off': fields.float('Write off allowed'),
|
||||
'account_lost_id': fields.many2one(
|
||||
@@ -71,11 +63,6 @@ class EasyReconcileOptions(orm.AbstractModel):
|
||||
'analytic_account_id': fields.many2one(
|
||||
'account.analytic.account', 'Analytic Account',
|
||||
help="Analytic account for the write-off"),
|
||||
'account_has_currency': fields.function(
|
||||
_get_account_currency,
|
||||
type='boolean',
|
||||
string='has currency',
|
||||
help="Check if related account has currency."),
|
||||
'income_exchange_account_id': fields.many2one(
|
||||
'account.account', 'Gain Exchange Rate Account'),
|
||||
'expense_exchange_account_id': fields.many2one(
|
||||
|
||||
@@ -129,9 +129,8 @@ The lines should have the same amount (with the write-off) and the same referenc
|
||||
<field name="write_off"/>
|
||||
<field name="account_lost_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="account_profit_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="account_has_currency" invisible="1"/>
|
||||
<field name="income_exchange_account_id" attrs="{'required':[('account_has_currency','=',True)],'invisible':[('account_has_currency','=',False)]}"/>
|
||||
<field name="expense_exchange_account_id" attrs="{'required':[('account_has_currency','=',True)],'invisible':[('account_has_currency','=',False)]}"/>
|
||||
<field name="income_exchange_account_id" groups="base.group_multi_currency"/>
|
||||
<field name="expense_exchange_account_id" groups="base.group_multi_currency"/>
|
||||
<field name="journal_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="date_base_on"/>
|
||||
@@ -150,9 +149,8 @@ The lines should have the same amount (with the write-off) and the same referenc
|
||||
<field name="write_off"/>
|
||||
<field name="account_lost_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="account_profit_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="account_has_currency" invisible="1"/>
|
||||
<field name="income_exchange_account_id" attrs="{'required':[('account_has_currency','=',True)]}"/>
|
||||
<field name="expense_exchange_account_id" attrs="{'required':[('account_has_currency','=',True)]}"/>
|
||||
<field name="income_exchange_account_id" groups="base.group_multi_currency"/>
|
||||
<field name="expense_exchange_account_id" groups="base.group_multi_currency"/>
|
||||
<field name="journal_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="date_base_on"/>
|
||||
|
||||
Reference in New Issue
Block a user