我收到RuntimeError:最大递归深度超出了错误,因为"' account_id''不在'''''''''''''''''&#39 34;我该怎么办呢?
@api.multi
def to_invoice(self):
pos_order = self.env['pos.order'].search([('id','=',self._context.get('active_id'))])
for line in pos_order.lines:
domain3 = [
('move_id', '=', pos_order.account_move.id),
('credit', '=', pos_order.amount_tax),
('account_id','not in', [pos_order.lines.tax_ids_after_fiscal_position, pos_order.lines.product_id.categ_id.property_account_income_categ_id])
]
if pos_order.amount_tax > 0:
move_line =
self.env['account.move.line'].search(domain3)
print move_line
move_line[0].unlink()
答案 0 :(得分:1)
试试这样:
@api.multi
def to_invoice(self):
pos_order = self.env['pos.order'].search([('id','=',self._context.get('active_id'))])
for line in pos_order.lines:
domain3 = [
('move_id', '=', pos_order.account_move.id),
('credit', '=', pos_order.amount_tax),
('account_id','not in', [pos_order.lines.tax_ids_after_fiscal_position, pos_order.lines.product_id.categ_id.property_account_income_categ_id])
]
if pos_order.amount_tax > 0:
move_line = self.env['account.move.line'].search(domain3)
print move_line
move_line[0].unlink()
break
答案 1 :(得分:0)
此行应为
('account_id','not in',[line.tax_ids_after_fiscal_position.id, line.product_id.categ_id.property_account_income_categ_id.id])