[FIX] renamed methods' name and modified statements and removed need_action_user_id field from view.
bzr revid: bth@tinyerp.com-20120313114429-b1jyxk7i4v1e5n8t
This commit is contained in:
parent
55d5cf9dfa
commit
11b087a0b6
|
@ -361,10 +361,10 @@ class mrp_bom(osv.osv):
|
|||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
obj_id = super(mrp_bom, self).create(cr, uid, vals, context=context)
|
||||
self.create_notification(cr, uid, [obj_id], context=context)
|
||||
self.case_create_send_note(cr, uid, [obj_id], context=context)
|
||||
return obj_id
|
||||
|
||||
def create_notification(self, cr, uid, ids, context=None):
|
||||
def case_create_send_note(self, cr, uid, ids, context=None):
|
||||
prod_obj = self.pool.get('product.product')
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
for prod in prod_obj.browse(cr, uid, [obj.product_id], context=context):
|
||||
|
@ -514,7 +514,7 @@ class mrp_production(osv.osv):
|
|||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
obj_id = super(mrp_production, self).create(cr, uid, vals, context=context)
|
||||
self.create_notification(cr, uid, [obj_id], context=context)
|
||||
self.case_create_send_note(cr, uid, [obj_id], context=context)
|
||||
return obj_id
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
|
@ -531,34 +531,34 @@ class mrp_production(osv.osv):
|
|||
result[obj.id] = obj.user_id.id
|
||||
return result
|
||||
|
||||
def create_notification(self, cr, uid, ids, context=None):
|
||||
def case_create_send_note(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
if obj.user_id.id :
|
||||
self.message_subscribe(cr, uid, ids, [obj.user_id.id], context=context)
|
||||
obj.message_append_note('',_("Manufacturing Order has been <b>Created</b>."))
|
||||
return True
|
||||
|
||||
def cancel_notification(self, cr, uid, ids, context=None):
|
||||
def case_cancel_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order has been <b>cancelled</b>.")
|
||||
self.message_append_note(cr, uid, ids, '', message, context=context)
|
||||
return True
|
||||
|
||||
def ready_notification(self, cr, uid, ids, context=None):
|
||||
def case_ready_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order is <b>ready to produce</b>.")
|
||||
self.message_append_note(cr, uid, ids, '', message, context=context)
|
||||
return True
|
||||
|
||||
def inproduction_notification(self, cr, uid, ids, context=None):
|
||||
def case_inproduction_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order is <b>in production</b>.")
|
||||
self.message_append_note(cr, uid, ids, '', message, context=context)
|
||||
return True
|
||||
|
||||
def done_notification(self, cr, uid, ids, context=None):
|
||||
def case_done_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order has been <b>done</b>.")
|
||||
self.message_append_note(cr, uid, ids, '', message, context=context)
|
||||
return True
|
||||
|
||||
def waiting_notification(self, cr, uid, ids, context=None):
|
||||
def case_waiting_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order has been <b>confirmed and waiting for goods</b>.")
|
||||
self.message_append_note(cr, uid, ids, '', message, context=context)
|
||||
return True
|
||||
|
@ -689,7 +689,7 @@ class mrp_production(osv.osv):
|
|||
move_obj.action_cancel(cr, uid, [x.id for x in production.move_created_ids])
|
||||
move_obj.action_cancel(cr, uid, [x.id for x in production.move_lines])
|
||||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
self.cancel_notification(cr, uid, ids, context)
|
||||
self.case_cancel_send_note(cr, uid, ids, context)
|
||||
return True
|
||||
|
||||
def action_ready(self, cr, uid, ids, context=None):
|
||||
|
@ -704,7 +704,7 @@ class mrp_production(osv.osv):
|
|||
if production.move_prod_id:
|
||||
move_obj.write(cr, uid, [production.move_prod_id.id],
|
||||
{'location_id': production.location_dest_id.id})
|
||||
self.ready_notification(cr, uid, [production_id], context)
|
||||
self.case_ready_send_note(cr, uid, [production_id], context)
|
||||
return True
|
||||
|
||||
def action_production_end(self, cr, uid, ids, context=None):
|
||||
|
@ -714,7 +714,7 @@ class mrp_production(osv.osv):
|
|||
for production in self.browse(cr, uid, ids):
|
||||
self._costs_generate(cr, uid, production)
|
||||
self.write(cr, uid, ids, {'state': 'done', 'date_finished': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
self.done_notification(cr, uid, ids, context)
|
||||
self.case_done_send_note(cr, uid, ids, context)
|
||||
return True
|
||||
|
||||
def test_production_done(self, cr, uid, ids):
|
||||
|
@ -884,7 +884,7 @@ class mrp_production(osv.osv):
|
|||
@return: True
|
||||
"""
|
||||
self.write(cr, uid, ids, {'state': 'in_production', 'date_start': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
self.inproduction_notification(cr, uid, ids, context)
|
||||
self.case_inproduction_send_note(cr, uid, ids, context)
|
||||
return True
|
||||
|
||||
def test_if_product(self, cr, uid, ids):
|
||||
|
@ -1062,7 +1062,7 @@ class mrp_production(osv.osv):
|
|||
production.name,
|
||||
datetime.strptime(production.date_planned,'%Y-%m-%d %H:%M:%S').strftime('%m/%d/%Y'),
|
||||
)
|
||||
self.waiting_notification(cr, uid, [production.id], context);
|
||||
self.case_waiting_send_note(cr, uid, [production.id], context);
|
||||
return shipment_id
|
||||
|
||||
def force_production(self, cr, uid, ids, *args):
|
||||
|
|
|
@ -783,9 +783,6 @@
|
|||
<field name="move_prod_id" groups="base.group_extended"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<separator string="Temporary Need Action" colspan="4"/>
|
||||
<field name="need_action_user_id"/>
|
||||
<newline/>
|
||||
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -156,7 +156,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
prod_obj.write(cr, uid, [prod.production_id.id], {'date_start':dstart}, context=context, mini=False)
|
||||
return result
|
||||
|
||||
def draft_notification(self, cr, uid, ids):
|
||||
def case_draft_send_note(self, cr, uid, ids):
|
||||
prod_obj = self.pool.get('mrp.production')
|
||||
for workorder in self.browse(cr, uid, ids):
|
||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
||||
|
@ -164,7 +164,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
self.message_append_note(cr, uid, ids, '', message)
|
||||
return True
|
||||
|
||||
def start_notification(self, cr, uid, ids):
|
||||
def case_start_send_note(self, cr, uid, ids):
|
||||
prod_obj = self.pool.get('mrp.production')
|
||||
for workorder in self.browse(cr, uid, ids):
|
||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
||||
|
@ -172,7 +172,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
self.message_append_note(cr, uid, ids, '', message)
|
||||
return True
|
||||
|
||||
def done_notification(self, cr, uid, ids):
|
||||
def case_done_send_note(self, cr, uid, ids):
|
||||
prod_obj = self.pool.get('mrp.production')
|
||||
for workorder in self.browse(cr, uid, ids):
|
||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
||||
|
@ -180,7 +180,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
self.message_append_note(cr, uid, ids, '', message)
|
||||
return True
|
||||
|
||||
def pending_notification(self, cr, uid, ids):
|
||||
def case_pending_send_note(self, cr, uid, ids):
|
||||
prod_obj = self.pool.get('mrp.production')
|
||||
for workorder in self.browse(cr, uid, ids):
|
||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
||||
|
@ -188,7 +188,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
self.message_append_note(cr, uid, ids, '', message)
|
||||
return True
|
||||
|
||||
def cancel_notification(self, cr, uid, ids):
|
||||
def case_cancel_send_note(self, cr, uid, ids):
|
||||
prod_obj = self.pool.get('mrp.production')
|
||||
for workorder in self.browse(cr, uid, ids):
|
||||
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
|
||||
|
@ -201,7 +201,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
@return: True
|
||||
"""
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
self.draft_notification(cr, uid, ids)
|
||||
self.case_draft_send_note(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def action_start_working(self, cr, uid, ids):
|
||||
|
@ -210,7 +210,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
"""
|
||||
self.modify_production_order_state(cr, uid, ids, 'start')
|
||||
self.write(cr, uid, ids, {'state':'startworking', 'date_start': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
self.start_notification(cr, uid, ids)
|
||||
self.case_start_send_note(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def action_done(self, cr, uid, ids):
|
||||
|
@ -227,7 +227,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
delay += (date_finished-date_start).seconds / float(60*60)
|
||||
|
||||
self.write(cr, uid, ids, {'state':'done', 'date_finished': date_now,'delay':delay})
|
||||
self.done_notification(cr, uid, ids)
|
||||
self.case_done_send_note(cr, uid, ids)
|
||||
self.modify_production_order_state(cr,uid,ids,'done')
|
||||
return True
|
||||
|
||||
|
@ -236,7 +236,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
@return: True
|
||||
"""
|
||||
self.write(cr, uid, ids, {'state':'cancel'})
|
||||
self.cancel_notification(cr, uid, ids)
|
||||
self.case_cancel_send_note(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def action_pause(self, cr, uid, ids):
|
||||
|
@ -244,7 +244,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
@return: True
|
||||
"""
|
||||
self.write(cr, uid, ids, {'state':'pause'})
|
||||
self.pending_notification(cr, uid, ids)
|
||||
self.case_pending_send_note(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def action_resume(self, cr, uid, ids):
|
||||
|
@ -252,7 +252,7 @@ class mrp_production_workcenter_line(osv.osv):
|
|||
@return: True
|
||||
"""
|
||||
self.write(cr, uid, ids, {'state':'startworking'})
|
||||
self.start_notification(cr, uid, ids)
|
||||
self.case_start_send_note(cr, uid, ids)
|
||||
return True
|
||||
|
||||
mrp_production_workcenter_line()
|
||||
|
|
|
@ -530,10 +530,10 @@ class product_product(osv.osv):
|
|||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
obj_id = super(product_product, self).create(cr, uid, vals, context=context)
|
||||
self.create_notification(cr, uid, [obj_id], context=context)
|
||||
self.case_create_send_note(cr, uid, [obj_id], context=context)
|
||||
return obj_id
|
||||
|
||||
def create_notification(self, cr, uid, ids, context=None):
|
||||
def case_create_send_note(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
self.message_append_note(cr, uid, ids, _('System notification'),
|
||||
_("Product has been <b>Created</b>."), type='notification', context=context)
|
||||
|
|
|
@ -99,10 +99,10 @@ class stock_change_product_qty(osv.osv_memory):
|
|||
|
||||
inventry_obj.action_confirm(cr, uid, [inventory_id], context=context)
|
||||
inventry_obj.action_done(cr, uid, [inventory_id], context=context)
|
||||
self.quantity_change_notification(cr, uid, [data.id], context)
|
||||
self.case_quantity_change_send_note(cr, uid, [data.id], context)
|
||||
return {}
|
||||
|
||||
def quantity_change_notification (self, cr, uid, ids, context=None):
|
||||
def case_quantity_change_send_note (self, cr, uid, ids, context=None):
|
||||
prod_obj = self.pool.get('product.product')
|
||||
location_obj = self.pool.get('stock.location')
|
||||
prod_temp_obj = self.pool.get('product.template')
|
||||
|
|
Loading…
Reference in New Issue