From d8cc56970817c192134e7e98d75248c8d04891cc Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Thu, 24 May 2012 12:02:38 +0530 Subject: [PATCH] [IMP] account : Added one fields.boolean('sent', readonly=1) and display the 'print' button and the 'send by email' button only if it is False. bzr revid: mdi@tinyerp.com-20120524063238-ylx1djklh2zrydsq --- addons/account/account_invoice.py | 3 +++ addons/account/account_invoice_view.xml | 7 ++++--- addons/account/account_invoice_workflow.xml | 2 +- addons/account/account_report.xml | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 0d392d85fa2..288f1119639 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -213,6 +213,7 @@ class account_invoice(osv.osv): \n* The \'Open\' state is used when user create invoice,a invoice number is generated.Its in open state till user does not pay invoice. \ \n* The \'Paid\' state is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled. \ \n* The \'Cancelled\' state is used when user cancel invoice.'), + 'sent': fields.boolean('Sent', readonly=True, help="It indicates that the invoice has been sent."), 'date_invoice': fields.date('Invoice Date', readonly=True, states={'draft':[('readonly',False)]}, select=True, help="Keep empty to use the current date"), 'date_due': fields.date('Due Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, select=True, help="If you use payment terms, the due date will be computed automatically at the generation "\ @@ -287,6 +288,7 @@ class account_invoice(osv.osv): 'check_total': 0.0, 'internal_number': False, 'user_id': lambda s, cr, u, c: u, + 'sent': False, } _sql_constraints = [ ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'), @@ -641,6 +643,7 @@ class account_invoice(osv.osv): 'move_name':False, 'internal_number': False, 'period_id': False, + 'sent': False, }) if 'date_invoice' not in default: default.update({ diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index c6926ce742e..152dae5de8b 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -262,15 +262,15 @@
-