Remove locations when on_change_product

This commit is contained in:
Raimon Esteve 2017-01-09 16:39:30 +01:00
parent ef17b2c1a4
commit f7d507c2f8
3 changed files with 1 additions and 13 deletions

View file

@ -129,15 +129,6 @@ class StockRelocation(ModelSQL, ModelView):
today = Date.today()
if not self.from_location and self.warehouse and self.product.locations:
from_location = None
for l in self.product.locations:
if l.warehouse.id == self.warehouse.id:
from_location = l.location
break
if from_location:
self.from_location = from_location
if self.from_location:
with Transaction().set_context(
forecast=False,
@ -149,7 +140,6 @@ class StockRelocation(ModelSQL, ModelView):
@fields.depends('quantity', 'product', 'warehouse', 'from_location')
def on_change_product(self):
self.uom = None
self.from_location = None
if self.product:
self.uom = self.product.default_uom
self.unit_digits = self.product.default_uom.digits

View file

@ -18,8 +18,6 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
<field name="warehouse"/>
<label name="uom"/>
<field name="uom"/>
<label name="unit_digits"/>
<field name="unit_digits"/>
<label name="company"/>
<field name="company"/>
<label name="move"/>

View file

@ -2,9 +2,9 @@
<!-- This file is part stock_relocation module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
<tree string="ReLocations" editable="bottom">
<field name="from_location"/>
<field name="product"/>
<field name="quantity"/>
<field name="from_location"/>
<field name="to_location"/>
<field name="warehouse"/>
<field name="planned_date"/>