@api.multi
def _compute_product_description(self):
def get_parent_move(move):
if move.move_dest_id:
return get_parent_move(move.move_dest_id)
return move
for production in self:
if production.move_prod_id:
move = get_parent_move(production.move_prod_id)
production.product_description = move.procurement_id and move.procurement_id.sale_line_id and move.procurement_id.sale_line_id.name or ''
product_description = fields.Char(string='Product description', compute='_compute_product_description', search='_description_search')
但是,当我开始寻找该字段时,我有一个无限的搜索循环。错了吗?