[ADD] account check printing: 'Unmark Sent'

Possibility to go back from state 'sent' to 'posted'
This commit is contained in:
Arthur Maniet
2015-08-10 13:48:56 +02:00
parent 753cc6d246
commit 941fa2f48e
2 changed files with 6 additions and 1 deletions
@@ -125,6 +125,10 @@ class account_payment(models.Model):
else:
return self.do_print_checks()
@api.multi
def unmark_sent(self):
self.write({'state': 'posted'})
@api.multi
def do_print_checks(self):
""" This method is a hook for l10n_xx_check_printing modules to implement actual check printing capabilities """
@@ -7,7 +7,8 @@
<field name="inherit_id" ref="account.view_account_payment_form" />
<field name="arch" type="xml">
<xpath expr="//button[@name='post']" position="before">
<button name="print_checks" class="oe_highlight" attrs="{'invisible': ['|', ('payment_method_code', '!=', 'check_printing'), ('state', 'not in', ('posted', 'sent'))]}" string="Print Check" type="object"/>
<button name="print_checks" class="oe_highlight" attrs="{'invisible': ['|', ('payment_method_code', '!=', 'check_printing'), ('state', '!=', 'posted')]}" string="Print Check" type="object"/>
<button name="unmark_sent" attrs="{'invisible': ['|', ('payment_method_code', '!=', 'check_printing'), ('state', '!=', 'sent')]}" string="Unmark Sent" type="object"/>
</xpath>
<xpath expr="//div[@name='amount_div']" position="after">
<field name="check_amount_in_words" attrs="{'invisible': [('payment_method_code', '!=', 'check_printing')], 'readonly': [('state', '!=', 'draft')]}" groups="base.group_no_one"/>