[IMP] sale,sale_journal,purchase,purchase_requisition,stock:improved log messages
bzr revid: mtr@mtr-20100615042811-q9uhngxm9b0aw3nw
This commit is contained in:
parent
d21c958a32
commit
8284cc7e7d
|
@ -259,6 +259,9 @@ class purchase_order(osv.osv):
|
|||
|
||||
def wkf_approve_order(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state': 'approved', 'date_approve': time.strftime('%Y-%m-%d')})
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Purchase order ') + " '" + name + "' "+_("is approved by the supplier")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
#TODO: implement messages system
|
||||
|
@ -275,11 +278,10 @@ class purchase_order(osv.osv):
|
|||
self.pool.get('purchase.order.line').action_confirm(cr, uid, todo, context)
|
||||
for id in ids:
|
||||
self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid})
|
||||
for (id,name) in self.name_get(cr, uid, id):
|
||||
for line in po.order_line:
|
||||
product.append(line.product_id.default_code)
|
||||
params = ', '.join(map(lambda x : str(x),product))
|
||||
message = _('Purchase order ') + " '" + name + "' "+_('placed on')+ " '" + po.date_order + "' "+_('for')+" '" + params + "' "+ _("is confirmed")
|
||||
message = _('Purchase order ') + " '" + po.name + "' "+_('placed on')+ " '" + po.date_order + "' "+_('for')+" '" + params + "' "+ _("is confirmed")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
|
@ -322,6 +324,9 @@ class purchase_order(osv.osv):
|
|||
# Deleting the existing instance of workflow for PO
|
||||
wf_service.trg_delete(uid, 'purchase.order', p_id, cr)
|
||||
wf_service.trg_create(uid, 'purchase.order', p_id, cr)
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Purchase order') + " '" + name + "' "+ _("is in the draft state")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def action_invoice_create(self, cr, uid, ids, *args):
|
||||
|
@ -401,6 +406,8 @@ class purchase_order(osv.osv):
|
|||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'account.invoice', inv.id, 'invoice_cancel', cr)
|
||||
self.write(cr,uid,ids,{'state':'cancel'})
|
||||
message = _('Purchase order ') + " '" + purchase.name + "' "+ _("is cancelled")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def action_picking_create(self,cr, uid, ids, *args):
|
||||
|
|
|
@ -60,22 +60,25 @@ class purchase_requisition(osv.osv):
|
|||
purchase_order_obj.action_cancel(cr,uid,[purchase_id.id])
|
||||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Tender') + " '" + name + "' "+ _("Cancelled")
|
||||
message = _('Tender') + " '" + name + "' "+ _("is cancelled")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
def tender_in_progress(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'in_progress'} ,context=context)
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Tender') + " '" + name + "' "+ _("In Progress")
|
||||
message = _('Tender') + " '" + name + "' "+ _(" is In Progress")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
def tender_reset(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state': 'draft'})
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Tender') + " '" + name + "' "+ _("is in draft state")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
def tender_done(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Tender') + " '" + name + "' "+ _("Done")
|
||||
message = _('Tender') + " '" + name + "' "+ _("is done")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
|
|
|
@ -331,6 +331,9 @@ class sale_order(osv.osv):
|
|||
# Deleting the existing instance of workflow for SO
|
||||
wf_service.trg_delete(uid, 'sale.order', inv_id, cr)
|
||||
wf_service.trg_create(uid, 'sale.order', inv_id, cr)
|
||||
for (id,name) in self.name_get(cr, uid, id):
|
||||
message = _('Sale order ') + " '" + name + "' "+ _("is in draft state")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part):
|
||||
|
@ -550,6 +553,9 @@ class sale_order(osv.osv):
|
|||
sale_order_line_obj.write(cr, uid, [l.id for l in sale.order_line],
|
||||
{'state': 'cancel'})
|
||||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
for line in sale.order_line:
|
||||
message = _('Sale order') + " '" + sale.name + "' "+ _("created on")+" '" +sale.create_date + _(" is cancelled")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def action_wait(self, cr, uid, ids, *args):
|
||||
|
@ -564,9 +570,9 @@ class sale_order(osv.osv):
|
|||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
for line in o.order_line:
|
||||
product.append(line.product_id.default_code)
|
||||
params = ', '.join(map(lambda x : str(x),product))
|
||||
message = _('Quotation ') + " '" + name + "' "+ _("created on")+" '" +o.create_date + "' "+_("for")+" '" +params + "' "+_("converted to sale order.")
|
||||
self.log(cr, uid, id, message)
|
||||
params = ', '.join(map(lambda x : str(x),product))
|
||||
message = _('Sale order ') + " '" + o.name + "' "+ _("created on")+" '" +o.create_date + "' "+_("for")+" '" +params + "' "+_("is confirmed")
|
||||
self.log(cr, uid, id, message)
|
||||
|
||||
|
||||
def procurement_lines_get(self, cr, uid, ids, *args):
|
||||
|
@ -935,11 +941,16 @@ class sale_order_line(osv.osv):
|
|||
for line in self.browse(cr, uid, ids, context=context):
|
||||
if line.invoiced:
|
||||
raise osv.except_osv(_('Invalid action !'), _('You cannot cancel a sale order line that has already been invoiced !'))
|
||||
message = _('Sale order line') + " '" + line.name + "' "+_("is cancelled")
|
||||
self.log(cr, uid, id, message)
|
||||
return self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
|
||||
def button_confirm(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Sale order line') + " '" + name + "' "+ _("is confirmed")
|
||||
self.log(cr, uid, id, message)
|
||||
return self.write(cr, uid, ids, {'state': 'confirmed'})
|
||||
|
||||
def button_done(self, cr, uid, ids, context=None):
|
||||
|
@ -949,7 +960,8 @@ class sale_order_line(osv.osv):
|
|||
res = self.write(cr, uid, ids, {'state': 'done'})
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
wf_service.trg_write(uid, 'sale.order', line.order_id.id, cr)
|
||||
|
||||
message = _('Sale order line') + " '" + line.name + "' "+_("is done")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
def uos_change(self, cr, uid, ids, product_uos, product_uos_qty=0, product_id=None):
|
||||
|
|
|
@ -92,6 +92,9 @@ class sale_journal(osv.osv):
|
|||
|
||||
def button_draft(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
message = _('Sale Journal') + " '" + name + "' "+ _("is in draft state")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def button_close(self, cr, uid, ids, context={}):
|
||||
|
|
|
@ -1856,7 +1856,7 @@ class stock_move(osv.osv):
|
|||
if all(move.state == 'done' for move in pick.move_lines):
|
||||
picking_obj.action_done(cr, uid, [pick.id])
|
||||
for (id,name) in picking_obj.name_get(cr, uid, [pick.id]):
|
||||
message = _('Picking ') + " '" + name + "' "+ _("done")
|
||||
message = _('Picking ') + " '" + name + "' "+ _("is processed")
|
||||
self.log(cr, uid, id, message)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
|
|
Loading…
Reference in New Issue