[IMP] Improving logging system for main messages
bzr revid: fp@tinyerp.com-20100519200236-t7y7pefns8t7cp9f
This commit is contained in:
parent
a3dd9f05dc
commit
bd46d32b0c
|
@ -50,7 +50,7 @@ write({'state':'open'})</field>
|
||||||
<field name="wkf_id" ref="wkf"/>
|
<field name="wkf_id" ref="wkf"/>
|
||||||
<field name="name">paid</field>
|
<field name="name">paid</field>
|
||||||
<!--<field name="flow_stop">True</field>-->
|
<!--<field name="flow_stop">True</field>-->
|
||||||
<field name="action">write({'state':'paid'})</field>
|
<field name="action">confirm_paid()</field>
|
||||||
<field name="kind">function</field>
|
<field name="kind">function</field>
|
||||||
<field name="signal_send">subflow.paid</field>
|
<field name="signal_send">subflow.paid</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
@ -217,6 +217,7 @@ class account_invoice(osv.osv):
|
||||||
_name = "account.invoice"
|
_name = "account.invoice"
|
||||||
_description = 'Invoice'
|
_description = 'Invoice'
|
||||||
_order = "number"
|
_order = "number"
|
||||||
|
_log_create = True
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Description', size=64, select=True,readonly=True, states={'draft':[('readonly',False)]}),
|
'name': fields.char('Description', size=64, select=True,readonly=True, states={'draft':[('readonly',False)]}),
|
||||||
'origin': fields.char('Source Document', size=64, help="Reference of the document that produced this invoice."),
|
'origin': fields.char('Source Document', size=64, help="Reference of the document that produced this invoice."),
|
||||||
|
@ -335,6 +336,13 @@ class account_invoice(osv.osv):
|
||||||
else:
|
else:
|
||||||
raise orm.except_orm(_('UnknownError'), str(e))
|
raise orm.except_orm(_('UnknownError'), str(e))
|
||||||
|
|
||||||
|
def confirm_paid(self, cr, uid, ids, context=None):
|
||||||
|
self.write(cr, uid, ids, {'state':'paid'}, context=context)
|
||||||
|
for (id,name) in self.name_get(cr, uid, ids):
|
||||||
|
message = _('Document ') + " '" + name + "' "+ _("has been paid.")
|
||||||
|
self.log(cr, uid, id, message)
|
||||||
|
return True
|
||||||
|
|
||||||
def unlink(self, cr, uid, ids, context=None):
|
def unlink(self, cr, uid, ids, context=None):
|
||||||
invoices = self.read(cr, uid, ids, ['state'])
|
invoices = self.read(cr, uid, ids, ['state'])
|
||||||
unlink_ids = []
|
unlink_ids = []
|
||||||
|
|
|
@ -419,7 +419,8 @@ class mrp_production(osv.osv):
|
||||||
"""
|
"""
|
||||||
_name = 'mrp.production'
|
_name = 'mrp.production'
|
||||||
_description = 'Production'
|
_description = 'Production'
|
||||||
_date_name = 'date_planned'
|
_date_name = 'date_planned'
|
||||||
|
_log_create = True
|
||||||
|
|
||||||
def _production_calc(self, cr, uid, ids, prop, unknow_none, context={}):
|
def _production_calc(self, cr, uid, ids, prop, unknow_none, context={}):
|
||||||
""" Calculates total hours and total no. of cycles for a production order.
|
""" Calculates total hours and total no. of cycles for a production order.
|
||||||
|
@ -647,6 +648,9 @@ class mrp_production(osv.osv):
|
||||||
""" Changes the production state to Ready and location id of stock move.
|
""" Changes the production state to Ready and location id of stock move.
|
||||||
@return: True
|
@return: True
|
||||||
"""
|
"""
|
||||||
|
for (id,name) in self.name_get(cr, uid, ids):
|
||||||
|
message = _('Manufacturing Order ') + " '" + name + "' "+ _("is ready to produce.")
|
||||||
|
self.log(cr, uid, id, message)
|
||||||
move_obj = self.pool.get('stock.move')
|
move_obj = self.pool.get('stock.move')
|
||||||
self.write(cr, uid, ids, {'state': 'ready'})
|
self.write(cr, uid, ids, {'state': 'ready'})
|
||||||
for production in self.browse(cr, uid, ids):
|
for production in self.browse(cr, uid, ids):
|
||||||
|
|
|
@ -68,8 +68,8 @@ class mrp_procurement(osv.osv):
|
||||||
"""
|
"""
|
||||||
_name = "mrp.procurement"
|
_name = "mrp.procurement"
|
||||||
_description = "Procurement"
|
_description = "Procurement"
|
||||||
_order = 'priority,date_planned'
|
_order = 'priority,date_planned desc'
|
||||||
|
_log_create = False
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Reason', size=64, required=True, help='Procurement name.'),
|
'name': fields.char('Reason', size=64, required=True, help='Procurement name.'),
|
||||||
'origin': fields.char('Source Document', size=64,
|
'origin': fields.char('Source Document', size=64,
|
||||||
|
|
|
@ -251,6 +251,7 @@ project()
|
||||||
class task(osv.osv):
|
class task(osv.osv):
|
||||||
_name = "project.task"
|
_name = "project.task"
|
||||||
_description = "Task"
|
_description = "Task"
|
||||||
|
_log_create = True
|
||||||
_date_name = "date_start"
|
_date_name = "date_start"
|
||||||
|
|
||||||
def _str_get(self, task, level=0, border='***', context={}):
|
def _str_get(self, task, level=0, border='***', context={}):
|
||||||
|
|
|
@ -211,6 +211,7 @@ class purchase_order(osv.osv):
|
||||||
}
|
}
|
||||||
_name = "purchase.order"
|
_name = "purchase.order"
|
||||||
_description = "Purchase Order"
|
_description = "Purchase Order"
|
||||||
|
_log_create = True
|
||||||
_order = "name desc"
|
_order = "name desc"
|
||||||
|
|
||||||
def unlink(self, cr, uid, ids, context=None):
|
def unlink(self, cr, uid, ids, context=None):
|
||||||
|
|
|
@ -52,6 +52,7 @@ def _incoterm_get(self, cr, uid, context=None):
|
||||||
|
|
||||||
class sale_order(osv.osv):
|
class sale_order(osv.osv):
|
||||||
_name = "sale.order"
|
_name = "sale.order"
|
||||||
|
_log_create = True
|
||||||
_description = "Sale Order"
|
_description = "Sale Order"
|
||||||
|
|
||||||
def copy(self, cr, uid, id, default=None, context=None):
|
def copy(self, cr, uid, id, default=None, context=None):
|
||||||
|
@ -551,16 +552,10 @@ class sale_order(osv.osv):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_wait(self, cr, uid, ids, *args):
|
def action_wait(self, cr, uid, ids, *args):
|
||||||
event_p = self.pool.get('res.partner.event.type').check(cr, uid, 'sale_open')
|
for (id,name) in self.name_get(cr, uid, ids):
|
||||||
event_obj = self.pool.get('res.partner.event')
|
message = _('Quotation ') + " '" + name + "' "+ _("converted to sale order.")
|
||||||
|
self.log(cr, uid, id, message)
|
||||||
for o in self.browse(cr, uid, ids):
|
for o in self.browse(cr, uid, ids):
|
||||||
if event_p:
|
|
||||||
event_obj.create(cr, uid, {'name': 'Sale Order: '+ o.name,\
|
|
||||||
'partner_id': o.partner_id.id,\
|
|
||||||
'date': time.strftime('%Y-%m-%d %H:%M:%S'),\
|
|
||||||
'user_id': (o.user_id and o.user_id.id) or uid,\
|
|
||||||
'partner_type': 'customer', 'probability': 1.0,\
|
|
||||||
'planned_revenue': o.amount_untaxed})
|
|
||||||
if (o.order_policy == 'manual'):
|
if (o.order_policy == 'manual'):
|
||||||
self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': time.strftime('%Y-%m-%d')})
|
self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': time.strftime('%Y-%m-%d')})
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -402,6 +402,7 @@ stock_tracking()
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
class stock_picking(osv.osv):
|
class stock_picking(osv.osv):
|
||||||
_name = "stock.picking"
|
_name = "stock.picking"
|
||||||
|
_log_create = True
|
||||||
_description = "Picking List"
|
_description = "Picking List"
|
||||||
|
|
||||||
def _set_maximum_date(self, cr, uid, ids, name, value, arg, context):
|
def _set_maximum_date(self, cr, uid, ids, name, value, arg, context):
|
||||||
|
@ -599,7 +600,16 @@ class stock_picking(osv.osv):
|
||||||
wf_service.trg_write(uid, 'stock.picking', pick.id, cr)
|
wf_service.trg_write(uid, 'stock.picking', pick.id, cr)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_assign_wkf(self, cr, uid, ids):
|
def action_assign_wkf(self, cr, uid, ids, context=None):
|
||||||
|
for pick in self.browse(cr, uid, ids, context=context):
|
||||||
|
type_list = {
|
||||||
|
'out':'Packing List',
|
||||||
|
'in':'Reception',
|
||||||
|
'internal': 'Internal picking',
|
||||||
|
'delivery': 'Delivery order'
|
||||||
|
}
|
||||||
|
message = type_list.get(pick.type, _('Document')) + " '" + pick.name + "' "+ _("is ready to be processed.")
|
||||||
|
self.log(cr, uid, id, message)
|
||||||
self.write(cr, uid, ids, {'state': 'assigned'})
|
self.write(cr, uid, ids, {'state': 'assigned'})
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -1153,6 +1163,7 @@ class stock_move(osv.osv):
|
||||||
return (res and res[0]) or False
|
return (res and res[0]) or False
|
||||||
_name = "stock.move"
|
_name = "stock.move"
|
||||||
_description = "Stock Move"
|
_description = "Stock Move"
|
||||||
|
_log_create = False
|
||||||
|
|
||||||
def name_get(self, cr, uid, ids, context={}):
|
def name_get(self, cr, uid, ids, context={}):
|
||||||
res = []
|
res = []
|
||||||
|
|
Loading…
Reference in New Issue