Don't allow to modify the second UoM if product has moves

This commit is contained in:
Guillem Barba 2015-06-17 15:11:54 +02:00
parent 99d9c4575b
commit 167003ed11
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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):