From 20d79d06e0812f02e7c5b8a1462fe51a026b6bc6 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Wed, 25 Jul 2012 16:16:34 +0530 Subject: [PATCH] [IMP] account, purchase : Added 'Supplier Invoices' button on 'Supplier' form view and its related changes. bzr revid: mdi@tinyerp.com-20120725104634-2cj4g3zp5mrow6do --- addons/account/account_invoice.py | 2 +- addons/purchase/partner_view.xml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 6a0a29cb2fe..b1c5db23df6 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -306,7 +306,7 @@ class account_invoice(osv.osv): if view_type == 'form': if partner['supplier'] and not partner['customer']: view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.supplier.form')]) - else: + elif partner['customer'] and not partner['supplier']: view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.form')]) if view_id and isinstance(view_id, (list, tuple)): view_id = view_id[0] diff --git a/addons/purchase/partner_view.xml b/addons/purchase/partner_view.xml index d155f210ca8..87b40f398e6 100644 --- a/addons/purchase/partner_view.xml +++ b/addons/purchase/partner_view.xml @@ -47,6 +47,22 @@ + + + Supplier Invoices + account.invoice + form + tree,form,graph + [('type','=','in_invoice')] + {'search_default_partner_id': active_id, 'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'} + + Click here to create Supplier invoice. + <p> + You can control the invoice from your supplier according to what you purchased or received. + <p> + OpenERP can also generate draft invoices automatically from purchase orders or receipts. + + res.partner.view.purchase.buttons @@ -59,6 +75,8 @@