[FIX] Analytic account on writeoff should not be required

and be visible to group analytic only
This commit is contained in:
Stefan Rijnhart
2013-11-17 20:23:18 +01:00
parent 33ecf1181e
commit cb1c274e41
2 changed files with 4 additions and 2 deletions

View File

@@ -459,7 +459,7 @@ class banking_import_transaction(orm.Model):
'writeoff_amount': writeoff,
'payment_option': transaction.payment_option,
'writeoff_acc_id': transaction.writeoff_account_id.id,
'analytic_id': transaction.writeoff_analytic_id.id,
'analytic_id': transaction.writeoff_analytic_id.id or False,
'date': st_line.date,
'date_due': st_line.date,
'period_id': period_id,

View File

@@ -100,7 +100,9 @@
<label string="Choose what you want to do with the eventual difference between the paid amount and the sum of allocated amounts. You can either choose to keep open this difference on the partner's account, or reconcile it with the payment." colspan="2"/>
<field name="payment_option" />
<field name="writeoff_account_id" attrs="{'required':[('payment_option','=','with_writeoff')],'invisible':[('payment_option','=','without_writeoff')]}" />
<field name="writeoff_analytic_id" attrs="{'required':[('payment_option','=','with_writeoff')],'invisible':[('payment_option','=','without_writeoff')]}" />
<field name="writeoff_analytic_id"
groups="analytic.group_analytic_accounting"
attrs="{'invisible':[('payment_option','=','without_writeoff')]}" />
<button colspan="1"
name="trigger_write"
type="object"