Gab*_*bin 3 python overriding odoo
我的目标是使“描述”( name) 字段位于sale.order.line以显示产品“销售描述”( description_sale....而不是默认的产品“名称”+“销售描述”。
我看到有人说我必须覆盖该功能,product_id_change但我不知道该怎么做。
提前致谢,
小智 5
尝试这个:
@api.onchange('product_id')
def product_id_change(self):
res = super(classname, self).product_id_change()
self.name = self.product_id.description_sale if self.product_id and self.product_id.description_sale else self.product_id.name
return res
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
40 次 |
| 最近记录: |