Merge pull request #9 from lepistone/7.0-account_easy_reconcile-analytic-account

In account_easy_reconcile, now write-off entries can be created with an analytic account
This commit is contained in:
Leonardo Pistone
2014-07-11 16:15:29 +02:00
3 changed files with 10 additions and 0 deletions

View File

@@ -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,

View File

@@ -57,6 +57,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 = {
@@ -199,6 +202,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,

View File

@@ -130,6 +130,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>
@@ -147,6 +148,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>