You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
511 B
16 lines
511 B
# Copyright (C) 2018 - Today: GRAP (http://www.grap.coop)
|
|
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from odoo import api, models
|
|
|
|
|
|
class ProductProduct(models.Model):
|
|
_inherit = 'product.product'
|
|
|
|
@api.onchange('uom_id', 'uom_po_id')
|
|
def _onchange_uom(self):
|
|
res = super(ProductProduct, self)._onchange_uom()
|
|
if self.uom_id:
|
|
self.to_weight = self.uom_id.to_weigh
|
|
return res
|