【发布时间】:2016-06-30 09:45:46
【问题描述】:
在accounting->invoice下我试图在从列表中选择一个客户(字段:partner_id:many2one)时触发onchange,但它失败了,而在字段“origin”(类型:char ) 工作正常。有人可以帮忙吗?
注意:在 Odoo 调试模式下,在客户字段上拖动鼠标时显示的帮助消息已绑定到名为 onchange_partner_id(type,...) 的 onchange 函数,我想知道这是否是问题的原因
这里是代码:我从原始发票模型继承而不是添加 onchange 函数
class stock_picking(models.Model):
_inherit = "account.invoice"
#NOT triggered
@api.onchange('partner_id')
def _onchange_customer(self):
print("debug:y_account_invoice: _onchange_customer:selected")
#triggered successfully
@api.onchange('origin')
def _onchange_origin(self):
print("debug:y_account_invoice: _onchange_origin")
【问题讨论】:
标签: openerp onchange odoo-8 invoice accounting