Kirti Savalia(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-576180-ksa into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-576180-ksa/+merge/111822

Hello,

Fixed the issue with translation problem in procurement.

Thanks
KSA
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-576180-ksa/+merge/111822
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-576180-ksa.
=== modified file 'mrp/procurement.py'
--- mrp/procurement.py	2011-09-17 16:41:25 +0000
+++ mrp/procurement.py	2012-06-25 11:26:18 +0000
@@ -37,11 +37,14 @@
         """ Finds the bill of material for the product from procurement order.
         @return: True or False
         """
+        if context is None:
+            context = {}
+        context.update({'lang': self.pool.get('res.users').context_get(cr, uid, context)['lang']})
         properties = [x.id for x in procurement.property_ids]
         bom_id = self.pool.get('mrp.bom')._bom_find(cr, uid, procurement.product_id.id, procurement.product_uom.id, properties)
         if not bom_id:
             cr.execute('update procurement_order set message=%s where id=%s', (_('No BoM defined for this product !'), procurement.id))
-            for (id, name) in self.name_get(cr, uid, procurement.id):
+            for (id, name) in self.name_get(cr, uid, procurement.id, context=context):
                 message = _("Procurement '%s' has an exception: 'No BoM defined for this product !'") % name
                 self.log(cr, uid, id, message)
             return False

=== modified file 'procurement/procurement.py'
--- procurement/procurement.py	2012-01-04 06:38:07 +0000
+++ procurement/procurement.py	2012-06-25 11:26:18 +0000
@@ -277,13 +277,16 @@
                 return False
         return True
 
-    def check_buy(self, cr, uid, ids):
+    def check_buy(self, cr, uid, ids, context=None):
         """ Checks product type.
         @return: True or Product Id.
         """
+        if context is None:
+            context = {}
+        context.update({'lang': self.pool.get('res.users').context_get(cr, uid, context)['lang']})
         user = self.pool.get('res.users').browse(cr, uid, uid)
         partner_obj = self.pool.get('res.partner')
-        for procurement in self.browse(cr, uid, ids):
+        for procurement in self.browse(cr, uid, ids, context=context):
             if procurement.product_id.product_tmpl_id.supply_method <> 'buy':
                 return False
             if not procurement.product_id.seller_ids:
@@ -352,8 +355,11 @@
         """ Changes procurement state to Running and writes message.
         @return: True
         """
+        if context is None:
+            context = {}
+        context.update({'lang': self.pool.get('res.users').context_get(cr, uid, context)['lang']})
         self.write(cr, uid, ids, {'state': 'running',
-                'message': _('from stock: products assigned.')})
+                'message': _('from stock: products assigned.')}, context=context)
         return True
 
     def _check_make_to_stock_service(self, cr, uid, procurement, context=None):

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to