diff --git a/addons/account/data/email_template_data_invoice.xml b/addons/account/data/email_template_data_invoice.xml index 94a9be1cb77..e1442d6b421 100644 --- a/addons/account/data/email_template_data_invoice.xml +++ b/addons/account/data/email_template_data_invoice.xml @@ -29,7 +29,7 @@ % if object.number: invoice ${object.number} % else: -pro-forma invoice +invoice % endif % if object.origin: (with reference: ${object.origin}) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 7c18865b558..58c2b72ceb1 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -221,8 +221,6 @@ class AccountInvoice(models.Model): state = fields.Selection([ ('draft','Draft'), - ('proforma', 'Pro-forma'), - ('proforma2', 'Pro-forma'), ('open', 'Open'), ('paid', 'Paid'), ('cancel', 'Cancelled'), @@ -549,18 +547,12 @@ class AccountInvoice(models.Model): attachment.unlink() return True - @api.multi - def action_invoice_proforma2(self): - if self.filtered(lambda inv: inv.state != 'draft'): - raise UserError(_("Invoice must be a draft in order to set it to Pro-forma.")) - return self.write({'state': 'proforma2'}) - @api.multi def action_invoice_open(self): # lots of duplicate calls to action_invoice_open, so we remove those already open to_open_invoices = self.filtered(lambda inv: inv.state != 'open') - if to_open_invoices.filtered(lambda inv: inv.state not in ['proforma2', 'draft']): - raise UserError(_("Invoice must be in draft or Pro-forma state in order to validate it.")) + if to_open_invoices.filtered(lambda inv: inv.state != 'draft'): + raise UserError(_("Invoice must be in draft state in order to validate it.")) to_open_invoices.action_date_assign() to_open_invoices.action_move_create() return to_open_invoices.invoice_validate() @@ -583,8 +575,8 @@ class AccountInvoice(models.Model): @api.multi def action_invoice_cancel(self): - if self.filtered(lambda inv: inv.state not in ['proforma2', 'draft', 'open']): - raise UserError(_("Invoice must be in draft, Pro-forma or open state in order to be cancelled.")) + if self.filtered(lambda inv: inv.state not in ['draft', 'open']): + raise UserError(_("Invoice must be in draft or open state in order to be cancelled.")) return self.action_cancel() @api.multi diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py index d70eaa807bb..3498b71fe7f 100644 --- a/addons/account/models/account_journal_dashboard.py +++ b/addons/account/models/account_journal_dashboard.py @@ -175,7 +175,7 @@ class account_journal(models.Model): number_waiting = 0 for result in query_results: cur = self.env['res.currency'].browse(result.get('currency')) - if result.get('state') in ['draft', 'proforma', 'proforma2']: + if result.get('state') == 'draft': number_draft += 1 sum_draft += cur.compute(result.get('amount_total'), currency) elif result.get('state') == 'open': diff --git a/addons/account/models/res_config.py b/addons/account/models/res_config.py index dea258f4350..cf94197d1a7 100644 --- a/addons/account/models/res_config.py +++ b/addons/account/models/res_config.py @@ -32,9 +32,6 @@ class AccountConfigSettings(models.TransientModel): module_account_deferred_revenue = fields.Boolean(string="Revenue Recognition") module_account_budget = fields.Boolean(string='Budget Management') module_account_reports = fields.Boolean("Dynamic Reports") - group_proforma_invoices = fields.Boolean(string='Allow pro-forma invoices', - implied_group='account.group_proforma_invoices', - help="Allows you to put invoices in pro-forma state.") module_account_reports_followup = fields.Boolean("Enable payment followup management") default_sale_tax_id = fields.Many2one('account.tax', string="Default Sale Tax", default_model="account.config.settings", company_dependent=True, oldname="default_sale_tax") diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index f75fffea723..cf9b5738a47 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -55,8 +55,6 @@ class AccountInvoiceReport(models.Model): ], readonly=True) state = fields.Selection([ ('draft', 'Draft'), - ('proforma', 'Pro-forma'), - ('proforma2', 'Pro-forma'), ('open', 'Open'), ('paid', 'Paid'), ('cancel', 'Cancelled') diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index 5ceb73ecce1..a7cb1c560b9 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -72,8 +72,7 @@ - - + diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index 846a86724b2..d80c2797177 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -25,12 +25,6 @@ - - - Pro-forma Invoices - - - A warning can be set on a partner (Account) diff --git a/addons/account/tests/test_account_customer_invoice.py b/addons/account/tests/test_account_customer_invoice.py index 0c559892644..201d973673c 100644 --- a/addons/account/tests/test_account_customer_invoice.py +++ b/addons/account/tests/test_account_customer_invoice.py @@ -70,12 +70,6 @@ class TestAccountCustomerInvoice(AccountTestUsers): # I check that Initially customer invoice is in the "Draft" state self.assertEquals(self.account_invoice_customer0.state, 'draft') - # I change the state of invoice to "Proforma2" by clicking PRO-FORMA button - self.account_invoice_customer0.action_invoice_proforma2() - - # I check that the invoice state is now "Proforma2" - self.assertEquals(self.account_invoice_customer0.state, 'proforma2') - # I check that there is no move attached to the invoice self.assertEquals(len(self.account_invoice_customer0.move_id), 0) diff --git a/addons/account/views/account_invoice_view.xml b/addons/account/views/account_invoice_view.xml index 7154cb65c66..ce0079f032e 100644 --- a/addons/account/views/account_invoice_view.xml +++ b/addons/account/views/account_invoice_view.xml @@ -173,7 +173,7 @@
-
@@ -217,10 +217,10 @@
-
@@ -348,16 +348,14 @@
-
@@ -366,8 +364,7 @@ -