From e7a05236a75901bb54ba376049fec25b4fe7cc1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 10 Sep 2012 15:27:42 +0200 Subject: [PATCH] Merge all kind of buttons review483002 --- invoice.py | 11 ++++++++++- invoice.xml | 7 +------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/invoice.py b/invoice.py index e647fb9129..544b68558c 100644 --- a/invoice.py +++ b/invoice.py @@ -8,7 +8,7 @@ from trytond.report import Report from trytond.wizard import Wizard, StateView, StateTransition, StateAction, \ Button from trytond.backend import TableHandler, FIELDS -from trytond.pyson import If, Eval, Bool +from trytond.pyson import If, Eval, Bool, Id from trytond.tools import reduce_ids from trytond.transaction import Transaction from trytond.pool import Pool @@ -204,6 +204,11 @@ class Invoice(Workflow, ModelSQL, ModelView): 'open': { 'invisible': ~Eval('state').in_(['draft', 'proforma']), }, + 'pay': { + 'invisible': Eval('state') != 'open', + 'readonly': ~Eval('groups', []).contains( + Id('account', 'group_account')), + }, }) def init(self, module_name): @@ -1285,6 +1290,10 @@ class Invoice(Workflow, ModelSQL, ModelView): self.create_move(invoice) self.print_invoice(invoice) + @ModelView.button_action('account_invoice.wizard_pay') + def pay(self, ids): + pass + def process(self, ids): paid = [] open_ = [] diff --git a/invoice.xml b/invoice.xml index 3a1b94ae44..faf535519b 100644 --- a/invoice.xml +++ b/invoice.xml @@ -67,17 +67,12 @@ this repository contains the full copyright notices and license terms. -->