From 005b1e302c50854539a7562e5c1ccba0d3418c10 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sun, 7 Oct 2007 12:09:50 +0000 Subject: [PATCH] Speed Improvement at installation Some Typos bzr revid: fp@tinyerp.com-2656cbbc886d5175d3bc3a1c2cfd3907527e8867 --- addons/mrp/mrp.py | 10 ++++++++++ addons/purchase/purchase_sequence.xml | 2 +- addons/scrum/scrum_view.xml | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index da12c60f394..78d5f8c7d23 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -724,8 +724,14 @@ class mrp_procurement(osv.osv): def check_produce(self, cr, uid, ids, context={}): res = True + user = self.pool.get('res.users').browse(cr, uid, uid) for procurement in self.browse(cr, uid, ids): if procurement.product_id.product_tmpl_id.supply_method=='buy': + if procurement.product_id.seller_ids: + partner = procurement.product_id.seller_ids[0].name + if user.company_id and user.company_id.partner_id: + if partner.id == user.company_id.partner_id.id: + return True return False if procurement.product_id.product_tmpl_id.type=='service': res = res and self.check_produce_service(cr, uid, procurement, context) @@ -736,6 +742,7 @@ class mrp_procurement(osv.osv): return res def check_buy(self, cr, uid, ids): + user = self.pool.get('res.users').browse(cr, uid, uid) for procurement in self.browse(cr, uid, ids): if procurement.product_id.product_tmpl_id.supply_method=='produce': return False @@ -743,6 +750,9 @@ class mrp_procurement(osv.osv): cr.execute('update mrp_procurement set message=%s where id=%d', ('No supplier defined for this product !', procurement.id)) return False partner = procurement.product_id.seller_ids[0].name + if user.company_id and user.company_id.partner_id: + if partner.id == user.company_id.partner_id.id: + return False address_id = self.pool.get('res.partner').address_get(cr, uid, [partner.id], ['delivery'])['delivery'] if not address_id: cr.execute('update mrp_procurement set message=%s where id=%d', ('No address defined for the supplier', procurement.id)) diff --git a/addons/purchase/purchase_sequence.xml b/addons/purchase/purchase_sequence.xml index b7474816865..109a56baca9 100644 --- a/addons/purchase/purchase_sequence.xml +++ b/addons/purchase/purchase_sequence.xml @@ -12,7 +12,7 @@ Purchase Order purchase.order - PO/ + PO 3 diff --git a/addons/scrum/scrum_view.xml b/addons/scrum/scrum_view.xml index 893d5cc78c4..0bed068860a 100644 --- a/addons/scrum/scrum_view.xml +++ b/addons/scrum/scrum_view.xml @@ -265,7 +265,7 @@ - scrum.meeting.form + Scrum Meeting scrum.meeting form