diff --git a/addons/purchase/partner.py b/addons/purchase/partner.py index 86cce749a21..d3f3e3e24d4 100644 --- a/addons/purchase/partner.py +++ b/addons/purchase/partner.py @@ -24,6 +24,13 @@ from osv import fields, osv class res_partner(osv.osv): _name = 'res.partner' _inherit = 'res.partner' + + def _purchase_order_count(self, cr, uid, ids, field_name, arg, context=None): + res = {} + for partner in self.browse(cr, uid, ids, context): + res[partner.id] = len(partner.purchase_order_ids) + return res + _columns = { 'property_product_pricelist_purchase': fields.property( 'product.pricelist', @@ -33,6 +40,8 @@ class res_partner(osv.osv): string="Purchase Pricelist", view_load=True, help="This pricelist will be used, instead of the default one, for purchases from the current partner"), + 'purchase_order_count': fields.function(_purchase_order_count, string='# of Purchase Order', type='integer'), + 'purchase_order_ids': fields.one2many('purchase.order','partner_id','Purchase Order') } res_partner() diff --git a/addons/purchase/partner_view.xml b/addons/purchase/partner_view.xml index 96981db1502..d155f210ca8 100644 --- a/addons/purchase/partner_view.xml +++ b/addons/purchase/partner_view.xml @@ -13,6 +13,55 @@ + + + RFQs and Purchases + purchase.order + form + tree,form,graph + {'search_default_partner_id': active_id} + + + This supplier has no RFQ or Purchase Order. Click here to create a new RFQ. + <p> + The "Quotation" is the first step of the Purchases flow. Manage your purchases from quotation to invoice. + <p> + You will be able to buy products (manage receptions) as well as services (create projects). + + + + + + res.partner.kanban.purchaseorder.inherit + res.partner + kanban + + + + + + + + Purchases + + + + + + + res.partner.view.purchase.buttons + res.partner + form + + + + +