[FIX] small issues
authorHarry (OpenERP) <hmo@tinyerp.com>
Wed, 3 Oct 2012 11:38:10 +0000 (17:08 +0530)
committerHarry (OpenERP) <hmo@tinyerp.com>
Wed, 3 Oct 2012 11:38:10 +0000 (17:08 +0530)
bzr revid: hmo@tinyerp.com-20121003113810-mnlg6rf50xi2ljnt

addons/mrp/procurement.py
addons/procurement/procurement.py
addons/project_mrp/project_procurement.py
addons/purchase/purchase.py

index f718856..82390a2 100644 (file)
@@ -31,7 +31,7 @@ class procurement_order(osv.osv):
     _columns = {
         'bom_id': fields.many2one('mrp.bom', 'BoM', ondelete='cascade', select=True),
         'property_ids': fields.many2many('mrp.property', 'procurement_property_rel', 'procurement_id','property_id', 'Properties'),
-        'production_id': fields.many2one('mrp.production', 'Manufucture Order'),
+        'production_id': fields.many2one('mrp.production', 'Manufacturing Order'),
     }
     
     def check_produce_product(self, cr, uid, procurement, context=None):
@@ -80,8 +80,10 @@ class procurement_order(osv.osv):
         procurement_obj = self.pool.get('procurement.order')
         for procurement in procurement_obj.browse(cr, uid, ids, context=context):
             res_id = procurement.move_id.id
+            #TOFIX: split into new function to compute manufacturing lead time
             newdate = datetime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - relativedelta(days=procurement.product_id.product_tmpl_id.produce_delay or 0.0)
             newdate = newdate - relativedelta(days=company.manufacturing_lead)
+            #TOFIX: implement hook method for creating production order
             produce_id = production_obj.create(cr, uid, {
                 'origin': procurement.origin,
                 'product_id': procurement.product_id.id,
@@ -111,8 +113,8 @@ class procurement_order(osv.osv):
 
     def production_order_create_note(self, cr, uid, ids, context=None):
         for procurement in self.browse(cr, uid, ids, context=context):
-            body = "%s %s %s" % (_("Manufacturing Order"), procurement.production_id.name, _("Created"))
-            self.message_post(cr, uid, ids, body=body, context=context)
+            body = "%s <em>%s</em> %s" % (_("Manufacturing Order"), procurement.production_id.name, _("Created"))
+            self.message_post(cr, uid, [procurement.id], body=body, context=context)
     
 procurement_order()
 
index aa3b2a2..5f8cd3c 100644 (file)
@@ -104,7 +104,7 @@ class procurement_order(osv.osv):
             " a make to order method."),
 
         'note': fields.text('Note'),
-        'message': fields.char('Latest error', size=124, help="Exception occurred while computing procurement orders."),
+        'message': fields.char('Latest error', size=124, help="Exception occurred while computing procurement orders."), #TOCHECK: is it need after OpenChatter ?
         'state': fields.selection([
             ('draft','Draft'),
             ('cancel','Cancelled'),
index 1daf03d..63e7249 100644 (file)
@@ -69,8 +69,10 @@ class procurement_order(osv.osv):
     def action_produce_assign_service(self, cr, uid, ids, context=None):
         project_task = self.pool.get('project.task')
         for procurement in self.browse(cr, uid, ids, context=context):
+            #TOFIX: split into new function to compute task planning hours
             project = self._get_project(cr, uid, procurement, context=context)
             planned_hours = self._convert_qty_company_hours(cr, uid, procurement, context=context)
+            #TOFIX: implement hook method for creating Task
             task_id = project_task.create(cr, uid, {
                 'name': '%s:%s' % (procurement.origin or '', procurement.product_id.name),
                 'date_deadline': procurement.date_planned,
@@ -90,8 +92,8 @@ class procurement_order(osv.osv):
 
     def project_task_create_note(self, cr, uid, ids, context=None):
         for procurement in self.browse(cr, uid, ids, context=context):
-            body = "%s %s %s" % (_("Task"), procurement.task_id.name, _("Created"))
-            self.message_post(cr, uid, ids, body=body, context=context)
+            body = "%s <em>%s</em> %s" % (_("Task"), procurement.task_id.name, _("Created"))
+            self.message_post(cr, uid, [procurement.id], body=body, context=context)
 
 procurement_order()
 
index a574d8e..6bc76f1 100644 (file)
@@ -1083,8 +1083,8 @@ class procurement_order(osv.osv):
 
     def purchase_order_create_note(self, cr, uid, ids, context=None):
         for procurement in self.browse(cr, uid, ids, context=context):
-            body = "%s %s %s" % (_("Draft Purchase Order"), procurement.purchase_id.name, _("Created"))
-            self.message_post(cr, uid, ids, body=body, context=context)
+            body = "%s <em>%s</em> %s" % (_("Draft Purchase Order"), procurement.purchase_id.name, _("Created"))
+            self.message_post(cr, uid, [procurement.id], body=body, context=context)
 
 procurement_order()