mirror of
https://github.com/NaN-tic/trytond-stock_relocation.git
synced 2023-12-14 02:03:44 +01:00
Remove locations when on_change_product
This commit is contained in:
parent
ef17b2c1a4
commit
f7d507c2f8
|
@ -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
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
Loading…
Reference in a new issue