[IMP] change the method name _claim_count into _claim_count_out
also, add a comment to explain why it is necessary to add a _claim_count_out method in stock_picking_out even though it will not be called. bzr revid: ged@openerp.com-20140508083149-rdophw2iihzntfpr
This commit is contained in:
parent
131f91db15
commit
8e16385aec
|
@ -4,7 +4,7 @@ from openerp.osv import fields, osv
|
||||||
class stock_picking(osv.osv):
|
class stock_picking(osv.osv):
|
||||||
_inherit = 'stock.picking'
|
_inherit = 'stock.picking'
|
||||||
|
|
||||||
def _claim_count(self, cr, uid, ids, field_name, arg, context=None):
|
def _claim_count_out(self, cr, uid, ids, field_name, arg, context=None):
|
||||||
Claim = self.pool['crm.claim']
|
Claim = self.pool['crm.claim']
|
||||||
return {
|
return {
|
||||||
id: Claim.search_count(cr, uid, [('ref', '=',('stock.picking.out,' + str(ids[0])))], context=context)
|
id: Claim.search_count(cr, uid, [('ref', '=',('stock.picking.out,' + str(ids[0])))], context=context)
|
||||||
|
@ -12,15 +12,19 @@ class stock_picking(osv.osv):
|
||||||
}
|
}
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'claim_count_out': fields.function(_claim_count, string='Claims', type='integer'),
|
'claim_count_out': fields.function(_claim_count_out, string='Claims', type='integer'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Because of the way inheritance works in the ORM (bug), and the way stock.picking.out
|
||||||
|
# is defined (inherit from stock.picking, dispatch read to stock.picking), it is necessary
|
||||||
|
# to add the field claim_count_out to this class, even though the _claim_count_out method
|
||||||
|
# in stock_picking_out will not be called (but its existence will be checked).
|
||||||
class stock_picking_out(osv.osv):
|
class stock_picking_out(osv.osv):
|
||||||
_inherit = 'stock.picking.out'
|
_inherit = 'stock.picking.out'
|
||||||
|
|
||||||
def _claim_count(self, cr, uid, ids, field_name, arg, context=None):
|
def _claim_count_out(self, cr, uid, ids, field_name, arg, context=None):
|
||||||
pass
|
return super(stock_picking_out, self)._claim_count_out(cr, uid, ids, field_name, arg, context=context)
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'claim_count_out': fields.function(_claim_count, string='Claims', type='integer'),
|
'claim_count_out': fields.function(_claim_count_out, string='Claims', type='integer'),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue