[IMP]changed in mrp and mrp_operations for subtype
bzr revid: sgo@tinyerp.com-20120913071430-o7bml82s6tgnwn4h
This commit is contained in:
parent
97026e96d3
commit
fa5f1e174e
|
@ -1044,27 +1044,27 @@ class mrp_production(osv.osv):
|
|||
# ---------------------------------------------------
|
||||
|
||||
def create_send_note(self, cr, uid, ids, context=None):
|
||||
self.message_post(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), subtype="new", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), subtype_xml_id="mrp_subtype_new", context=context)
|
||||
return True
|
||||
|
||||
def action_cancel_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order has been <b>canceled</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_cancelled", context=context)
|
||||
return True
|
||||
|
||||
def action_ready_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order is <b>ready to produce</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="ready", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_ready", context=context)
|
||||
return True
|
||||
|
||||
def action_in_production_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order is <b>in production</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="production", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_production", context=context)
|
||||
return True
|
||||
|
||||
def action_done_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order has been <b>done</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_closed", context=context)
|
||||
return True
|
||||
|
||||
def action_confirm_send_note(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -27,38 +27,29 @@ From the Manufacturing Settings, you can choose to compute production schedules
|
|||
<field name="number_increment">1</field>
|
||||
</record>
|
||||
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.mrp_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_ready" model="mail.message.subtype">
|
||||
<record id="mail.mrp_subtype_ready" model="mail.message.subtype">
|
||||
<field name="name">ready</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_production" model="mail.message.subtype">
|
||||
<record id="mail.mrp_subtype_production" model="mail.message.subtype">
|
||||
<field name="name">production</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
<field name="res_model">mrp.production</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.mrp_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.mrp_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -31,38 +31,29 @@
|
|||
</record>
|
||||
|
||||
<!-- SUBTYPE -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.mrp_operations_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
<field name="res_model">mrp.production.workcenter.line</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_started" model="mail.message.subtype">
|
||||
<record id="mail.mrp_operations_subtype_started" model="mail.message.subtype">
|
||||
<field name="name">started</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
<field name="res_model">mrp.production.workcenter.line</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||
<record id="mail.mrp_operations_subtype_pending" model="mail.message.subtype">
|
||||
<field name="name">pending</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
<field name="res_model">mrp.production.workcenter.line</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.mrp_operations_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
<field name="res_model">mrp.production.workcenter.line</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.mrp_operations_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
<field name="res_model">mrp.production.workcenter.line</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -224,7 +224,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
for workorder in self.browse(cr, uid, ids):
|
||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
||||
message = _("Work order has been <b>created</b> for production order <em>%s</em>.") % (prod.id.name)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype="new", context=context)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="new", context=context)
|
||||
return True
|
||||
|
||||
def action_start_send_note(self, cr, uid, ids, context=None):
|
||||
|
@ -232,7 +232,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
for workorder in self.browse(cr, uid, ids):
|
||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
||||
message = _("Work order has been <b>started</b> for production order <em>%s</em>.") % (prod.id.name)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype="started", context=context)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="started", context=context)
|
||||
return True
|
||||
|
||||
def action_done_send_note(self, cr, uid, ids, context=None):
|
||||
|
@ -240,7 +240,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
for workorder in self.browse(cr, uid, ids):
|
||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
||||
message = _("Work order has been <b>done</b> for production order <em>%s</em>.") % (prod.id.name)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype="closed", context=context)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="closed", context=context)
|
||||
return True
|
||||
|
||||
def action_pending_send_note(self, cr, uid, ids, context=None):
|
||||
|
@ -248,7 +248,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
for workorder in self.browse(cr, uid, ids):
|
||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
||||
message = _("Work order is <b>pending</b> for production order <em>%s</em>.") % (prod.id.name)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype="pending", context=context)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="pending", context=context)
|
||||
return True
|
||||
|
||||
def action_cancel_send_note(self, cr, uid, ids, context=None):
|
||||
|
@ -256,7 +256,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
for workorder in self.browse(cr, uid, ids):
|
||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
||||
message = _("Work order has been <b>cancelled</b> for production order <em>%s</em>.") % (prod.id.name)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="cancelled", context=context)
|
||||
return True
|
||||
|
||||
mrp_production_workcenter_line()
|
||||
|
|
Loading…
Reference in New Issue