mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
In account_easy_reconcile, now write-off entries can be created with an analytic account
This commit is contained in:
@@ -188,6 +188,9 @@ class easy_reconcile_base(orm.AbstractModel):
|
||||
period_id = self.pool.get('account.period').find(
|
||||
cr, uid, dt=date, context=context)[0]
|
||||
|
||||
if rec.analytic_account_id:
|
||||
rec_ctx['analytic_id'] = rec.analytic_account_id.id
|
||||
|
||||
ml_obj.reconcile(
|
||||
cr, uid,
|
||||
line_ids,
|
||||
|
||||
@@ -56,6 +56,9 @@ class easy_reconcile_options(orm.AbstractModel):
|
||||
required=True,
|
||||
string='Date of reconciliation'),
|
||||
'filter': fields.char('Filter', size=128),
|
||||
'analytic_account_id': fields.many2one(
|
||||
'account.analytic.account', 'Analytic Account',
|
||||
help="Analytic account for the write-off"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -198,6 +201,8 @@ class account_easy_reconcile(orm.Model):
|
||||
rec_method.account_lost_id.id),
|
||||
'account_profit_id': (rec_method.account_profit_id and
|
||||
rec_method.account_profit_id.id),
|
||||
'analytic_account_id': (rec_method.analytic_account_id and
|
||||
rec_method.analytic_account_id.id),
|
||||
'journal_id': (rec_method.journal_id and
|
||||
rec_method.journal_id.id),
|
||||
'date_base_on': rec_method.date_base_on,
|
||||
|
||||
@@ -124,6 +124,7 @@ The lines should have the same amount (with the write-off) and the same referenc
|
||||
<field name="account_lost_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="account_profit_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="journal_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="date_base_on"/>
|
||||
</form>
|
||||
</field>
|
||||
@@ -141,6 +142,7 @@ The lines should have the same amount (with the write-off) and the same referenc
|
||||
<field name="account_lost_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="account_profit_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="journal_id" attrs="{'required':[('write_off','>',0)]}"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="date_base_on"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user