Don't allow to modify the second UoM if product has moves
This commit is contained in:
parent
99d9c4575b
commit
167003ed11
|
@ -1,3 +1,4 @@
|
|||
* Don't allow to modify the second UoM if product has moves
|
||||
* Allow to sale and purchase goods indicating second uom (extra depends)
|
||||
* Adapt to latest patched version of stock module
|
||||
|
||||
|
|
|
@ -36,6 +36,11 @@ class Template:
|
|||
if hasattr(cls, 'main_products'):
|
||||
cls.on_change_with_use_second_uom.depends.add('main_products')
|
||||
cls.on_change_with_use_second_uom.depends.add('raw_products')
|
||||
cls._error_messages.update({
|
||||
'change_second_uom': ('You cannot change the second uom for '
|
||||
'a product which is associated to stock moves.'),
|
||||
})
|
||||
cls._modify_no_move.append(('second_uom', 'change_second_uom'))
|
||||
|
||||
@fields.depends('products')
|
||||
def on_change_with_use_second_uom(self, name=None):
|
||||
|
|
Loading…
Reference in New Issue