跳至内容
菜单
此问题已终结
2 回复
3000 查看

I want to disable following stock.inventory default function using my custom module:

@api.onchange('product_id', 'location_id', 'product_uom_id', 'prod_lot_id', 'partner_id', 'package_id')
def onchange_quantity_context(self):
if self.product_id and self.location_id and self.product_id.uom_id.category_id == self.product_uom_id.category_id: # TDE FIXME: last part added because crash
self._compute_theoretical_qty()
self.product_qty = self.theoretical_qty

Anyone can help?


形象
丢弃

Hope this customization tips will helps: https://goo.gl/8HgnCF

编写者 最佳答案

@Akshay

Your overwrite function is not working.

形象
丢弃
最佳答案

Inherit the model, then overwrite the function.

@api.onchange('product_id', 'location_id', 'product_uom_id', 'prod_lot_id', 'partner_id', 'package_id')
def onchange_quantity_context(self):
pass




形象
丢弃
相关帖文 回复 查看 活动
0
8月 25
107
1
8月 25
259
0
7月 25
354
2
6月 25
1431
1
5月 25
1425