From 351f5231e2bafc4d9e131d05a45fa6b119de6aff Mon Sep 17 00:00:00 2001 From: Bhavik Bagdiya Date: Wed, 7 Jan 2015 12:03:40 +0530 Subject: [PATCH] [IMP] account, sale: allow to follow created and confirmed invoices on the sales team. --- addons/account/account_invoice.py | 5 +++++ addons/account/data/account_data.xml | 7 +++++++ addons/sale/sale_data.xml | 14 ++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 9dda9d0b772..be1f6cbf91c 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -57,6 +57,7 @@ class account_invoice(models.Model): 'state': { 'account.mt_invoice_paid': lambda self, cr, uid, obj, ctx=None: obj.state == 'paid' and obj.type in ('out_invoice', 'out_refund'), 'account.mt_invoice_validated': lambda self, cr, uid, obj, ctx=None: obj.state == 'open' and obj.type in ('out_invoice', 'out_refund'), + 'account.mt_invoice_created': lambda self, cr, uid, obj, ctx=None: obj.state == 'draft' and obj.type in ('out_invoice', 'out_refund'), }, } @@ -314,6 +315,10 @@ class account_invoice(models.Model): 'Invoice Number must be unique per Company!'), ] + @api.model + def create(self, vals): + return super(account_invoice, self.with_context(mail_create_nolog = True)).create(vals) + @api.model def fields_view_get(self, view_id=None, view_type=False, toolbar=False, submenu=False): context = self._context diff --git a/addons/account/data/account_data.xml b/addons/account/data/account_data.xml index f284d540e65..7b7fde2e40c 100644 --- a/addons/account/data/account_data.xml +++ b/addons/account/data/account_data.xml @@ -155,5 +155,12 @@ Invoice paid + + Invoice Created + account.invoice + + + Invoice Created + diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml index a44bb1ba2d5..74f3f060bd7 100644 --- a/addons/sale/sale_data.xml +++ b/addons/sale/sale_data.xml @@ -59,6 +59,20 @@ team_id + + Invoice Created + 22 + crm.team + + team_id + + + Invoice Confirmed + 23 + crm.team + + team_id +