In fact, I defined a function on "stock.picking", computes result for a functionnal field, on "stock.picking" object. this method browses account.move.line object, with ids of stock picking, is it correct ?
Here after the code :
class StockPicking(orm.Model):
_inherit = 'stock.picking'
_name = 'stock.picking'def _payed(self, cr, uid, ids, payedd, arg, context):
rs= {}
for picking in self.browse(cr, uid, ids, context):
rs[picking.id] = False
numbl = picking.num_bl
move_line_obj = self.pool.get('account.move.line')for move_line in move_line_obj.browse(cr, uid, ids, context):
if move_line.move_id.ref == numbl and move_line.reconcile_id:
rs[picking.id] = True
return rs_columns = {
'payedd' : fields.function(_payed, method=True, string='Encaisse', type='boolean'),
}
I've got this error :
AttributeError: 'Field move_id not found in browse_record(account.move.line, 20058)'
It seems that when browsing withs ids of stock_picking, it does'nt recognize account_move_line model. If true, is there any workaround to get the field : reference of account_move_line object ?