help="The expense is accounted for when a vendor bill is validated, except in anglo-saxon accounting with perpetual inventory valuation in which case the expense (Cost of Goods Sold account) is recognized at the customer invoice validation.")
help="The expense is accounted for when a vendor bill is validated, except in anglo-saxon accounting with perpetual inventory valuation in which case the expense (Cost of Goods Sold account) is recognized at the customer invoice validation. If the field is empty, it uses the one defined in the product category.")
@api.multi
defwrite(self,vals):
#TODO: really? i don't see the reason we'd need that constraint..
check=self.idsand'uom_po_id'invals
ifcheck:
self._cr.execute("SELECT id, uom_po_id FROM product_template WHERE id IN %s",[tuple(self.ids)])
uoms=dict(self._cr.fetchall())
res=super(ProductTemplate,self).write(vals)
ifcheck:
self._cr.execute("SELECT id, uom_po_id FROM product_template WHERE id IN %s",[tuple(self.ids)])
raiseUserError(_('You can not change the unit of measure of a product that has been already used in an account journal item. If you need to change the unit of measure, you may deactivate this product.'))