[IMP] Add data of subtype in mrp, mrp_repair & mrp_operations
bzr revid: fka@tinyerp.com-20120831131712-dz5b5isq797v5xfc
This commit is contained in:
parent
87658d9de8
commit
e44d125479
|
@ -1047,27 +1047,27 @@ class mrp_production(osv.osv):
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------
|
||||||
|
|
||||||
def create_send_note(self, cr, uid, ids, context=None):
|
def create_send_note(self, cr, uid, ids, context=None):
|
||||||
self.message_post(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), context=context)
|
self.message_post(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), subtype="new", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_cancel_send_note(self, cr, uid, ids, context=None):
|
def action_cancel_send_note(self, cr, uid, ids, context=None):
|
||||||
message = _("Manufacturing order has been <b>canceled</b>.")
|
message = _("Manufacturing order has been <b>canceled</b>.")
|
||||||
self.message_post(cr, uid, ids, body=message, context=context)
|
self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_ready_send_note(self, cr, uid, ids, context=None):
|
def action_ready_send_note(self, cr, uid, ids, context=None):
|
||||||
message = _("Manufacturing order is <b>ready to produce</b>.")
|
message = _("Manufacturing order is <b>ready to produce</b>.")
|
||||||
self.message_post(cr, uid, ids, body=message, context=context)
|
self.message_post(cr, uid, ids, body=message, subtype="ready", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_in_production_send_note(self, cr, uid, ids, context=None):
|
def action_in_production_send_note(self, cr, uid, ids, context=None):
|
||||||
message = _("Manufacturing order is <b>in production</b>.")
|
message = _("Manufacturing order is <b>in production</b>.")
|
||||||
self.message_post(cr, uid, ids, body=message, context=context)
|
self.message_post(cr, uid, ids, body=message, subtype="production", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_done_send_note(self, cr, uid, ids, context=None):
|
def action_done_send_note(self, cr, uid, ids, context=None):
|
||||||
message = _("Manufacturing order has been <b>done</b>.")
|
message = _("Manufacturing order has been <b>done</b>.")
|
||||||
self.message_post(cr, uid, ids, body=message, context=context)
|
self.message_post(cr, uid, ids, body=message, subtype="closed", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_confirm_send_note(self, cr, uid, ids, context=None):
|
def action_confirm_send_note(self, cr, uid, ids, context=None):
|
||||||
|
|
|
@ -27,5 +27,38 @@ From the Manufacturing Settings, you can choose to compute production schedules
|
||||||
<field name="number_increment">1</field>
|
<field name="number_increment">1</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||||
|
<field name="name">new</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||||
|
<field name="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_ready" model="mail.message.subtype">
|
||||||
|
<field name="name">ready</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||||
|
<field name="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_production" model="mail.message.subtype">
|
||||||
|
<field name="name">production</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||||
|
<field name="name">cancelled</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||||
|
<field name="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||||
|
<field name="name">closed</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||||
|
<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>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -30,5 +30,39 @@
|
||||||
<field name="start_stop">done</field>
|
<field name="start_stop">done</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- SUBTYPE -->
|
||||||
|
<record id="mail.mail_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="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_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="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_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'))]"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_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="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_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="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>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -224,7 +224,7 @@ class mrp_production_workcenter_line(osv.osv):
|
||||||
for workorder in self.browse(cr, uid, ids):
|
for workorder in self.browse(cr, uid, ids):
|
||||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
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)
|
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, context=context)
|
self.message_post(cr, uid, [workorder.id], body=message, subtype="new", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_start_send_note(self, cr, uid, ids, context=None):
|
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 workorder in self.browse(cr, uid, ids):
|
||||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
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)
|
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, context=context)
|
self.message_post(cr, uid, [workorder.id], body=message, subtype="started", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_done_send_note(self, cr, uid, ids, context=None):
|
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 workorder in self.browse(cr, uid, ids):
|
||||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
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)
|
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, context=context)
|
self.message_post(cr, uid, [workorder.id], body=message, subtype="closed", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_pending_send_note(self, cr, uid, ids, context=None):
|
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 workorder in self.browse(cr, uid, ids):
|
||||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
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)
|
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, context=context)
|
self.message_post(cr, uid, [workorder.id], body=message, subtype="pending", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_cancel_send_note(self, cr, uid, ids, context=None):
|
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 workorder in self.browse(cr, uid, ids):
|
||||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
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)
|
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, context=context)
|
self.message_post(cr, uid, [workorder.id], body=message, subtype="cancelled", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
mrp_production_workcenter_line()
|
mrp_production_workcenter_line()
|
||||||
|
|
|
@ -43,6 +43,7 @@ The following topics should be covered by this module:
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'security/mrp_repair_security.xml',
|
'security/mrp_repair_security.xml',
|
||||||
|
'mrp_repair_data.xml',
|
||||||
'mrp_repair_sequence.xml',
|
'mrp_repair_sequence.xml',
|
||||||
'wizard/mrp_repair_cancel_view.xml',
|
'wizard/mrp_repair_cancel_view.xml',
|
||||||
'wizard/mrp_repair_make_invoice_view.xml',
|
'wizard/mrp_repair_make_invoice_view.xml',
|
||||||
|
|
|
@ -571,40 +571,40 @@ class mrp_repair(osv.osv):
|
||||||
def create_send_note(self, cr, uid, ids, context=None):
|
def create_send_note(self, cr, uid, ids, context=None):
|
||||||
for repair in self.browse(cr, uid, ids, context):
|
for repair in self.browse(cr, uid, ids, context):
|
||||||
message = _("Repair Order for <em>%s</em> has been <b>created</b>." % (repair.product_id.name))
|
message = _("Repair Order for <em>%s</em> has been <b>created</b>." % (repair.product_id.name))
|
||||||
self.message_post(cr, uid, [repair.id], body=message, context=context)
|
self.message_post(cr, uid, [repair.id], body=message, subtype="new", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def set_start_send_note(self, cr, uid, ids, context=None):
|
def set_start_send_note(self, cr, uid, ids, context=None):
|
||||||
for repair in self.browse(cr, uid, ids, context):
|
for repair in self.browse(cr, uid, ids, context):
|
||||||
message = _("Repair Order for <em>%s</em> has been <b>started</b>." % (repair.product_id.name))
|
message = _("Repair Order for <em>%s</em> has been <b>started</b>." % (repair.product_id.name))
|
||||||
self.message_post(cr, uid, [repair.id], body=message, context=context)
|
self.message_post(cr, uid, [repair.id], body=message, subtype="started", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def set_toinvoiced_send_note(self, cr, uid, ids, context=None):
|
def set_toinvoiced_send_note(self, cr, uid, ids, context=None):
|
||||||
for repair in self.browse(cr, uid, ids, context):
|
for repair in self.browse(cr, uid, ids, context):
|
||||||
message = _("Draft Invoice of %s %s <b>waiting for validation</b>.") % (repair.invoice_id.amount_total, repair.invoice_id.currency_id.symbol)
|
message = _("Draft Invoice of %s %s <b>waiting for validation</b>.") % (repair.invoice_id.amount_total, repair.invoice_id.currency_id.symbol)
|
||||||
self.message_post(cr, uid, [repair.id], body=message, context=context)
|
self.message_post(cr, uid, [repair.id], body=message, subtype="pending", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def set_confirm_send_note(self, cr, uid, ids, context=None):
|
def set_confirm_send_note(self, cr, uid, ids, context=None):
|
||||||
for repair in self.browse(cr, uid, ids, context):
|
for repair in self.browse(cr, uid, ids, context):
|
||||||
message = _( "Repair Order for <em>%s</em> has been <b>accepted</b>." % (repair.product_id.name))
|
message = _( "Repair Order for <em>%s</em> has been <b>accepted</b>." % (repair.product_id.name))
|
||||||
self.message_post(cr, uid, [repair.id], body=message, context=context)
|
self.message_post(cr, uid, [repair.id], body=message, subtype="accepted", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def set_cancel_send_note(self, cr, uid, ids, context=None):
|
def set_cancel_send_note(self, cr, uid, ids, context=None):
|
||||||
message = _("Repair has been <b>cancelled</b>.")
|
message = _("Repair has been <b>cancelled</b>.")
|
||||||
self.message_post(cr, uid, ids, body=message, context=context)
|
self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def set_ready_send_note(self, cr, uid, ids, context=None):
|
def set_ready_send_note(self, cr, uid, ids, context=None):
|
||||||
message = _("Repair Order is now <b>ready</b> to repair.")
|
message = _("Repair Order is now <b>ready</b> to repair.")
|
||||||
self.message_post(cr, uid, ids, body=message, context=context)
|
self.message_post(cr, uid, ids, body=message, subtype="ready", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def set_done_send_note(self, cr, uid, ids, context=None):
|
def set_done_send_note(self, cr, uid, ids, context=None):
|
||||||
message = _("Repair Order is <b>closed</b>.")
|
message = _("Repair Order is <b>closed</b>.")
|
||||||
self.message_post(cr, uid, ids, body=message, context=context)
|
self.message_post(cr, uid, ids, body=message, subtype="closed", context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
mrp_repair()
|
mrp_repair()
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<openerp>
|
||||||
|
<data noupdate="1">
|
||||||
|
|
||||||
|
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||||
|
<field name="name">new</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||||
|
<field name="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_started" model="mail.message.subtype">
|
||||||
|
<field name="name">started</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||||
|
<field name="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_ready" model="mail.message.subtype">
|
||||||
|
<field name="name">ready</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||||
|
<field name="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||||
|
<field name="name">pending</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_accepted" model="mail.message.subtype">
|
||||||
|
<field name="name">accepted</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||||
|
<field name="name">cancelled</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||||
|
<field name="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||||
|
<field name="name">closed</field>
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||||
|
<field name="default" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||||
|
</record>
|
||||||
|
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||||
|
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</openerp>
|
Loading…
Reference in New Issue