[FIX] small issues

bzr revid: hmo@tinyerp.com-20121003113810-mnlg6rf50xi2ljnt
This commit is contained in:
Harry (OpenERP)
2012-10-03 17:08:10 +05:30
parent 319ba65bb8
commit dd44dab68c
4 changed files with 12 additions and 8 deletions
+5 -3
View 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()
+1 -1
View 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'),
+4 -2
View 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()
+2 -2
View 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()