[IMP] stock: scrap location internal or inventory
We restrict the case of locations that can be scrap locations to locations of usage internal or inventory loss, depending on how you want to manage your scrap. Other usage of location shouldn't be scrap locations. TASK-ID: 38469
This commit is contained in:
@@ -74,6 +74,11 @@ class Location(models.Model):
|
||||
else:
|
||||
self.complete_name = self.name
|
||||
|
||||
@api.onchange('usage')
|
||||
def _onchange_usage(self):
|
||||
if self.usage not in ('internal', 'inventory'):
|
||||
self.scrap_location = False
|
||||
|
||||
def write(self, values):
|
||||
if 'usage' in values and values['usage'] == 'view':
|
||||
if self.mapped('quant_ids'):
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<group string="Additional Information">
|
||||
<field name="usage"/>
|
||||
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
|
||||
<field name="scrap_location"/>
|
||||
<field name="scrap_location" attrs="{'invisible': [('usage', 'not in', ('inventory', 'internal'))]}"/>
|
||||
<field name="return_location"/>
|
||||
</group>
|
||||
<group string="Localization" name="localization">
|
||||
|
||||
Reference in New Issue
Block a user