mirror of
https://bitbucket.org/presik/trytonpsk-purchase_co.git
synced 2023-12-14 06:43:05 +01:00
minor fix
This commit is contained in:
parent
8050a6cdbf
commit
d8dc97c8e4
1 changed files with 3 additions and 1 deletions
|
@ -68,7 +68,8 @@ class Line(metaclass=PoolMeta):
|
|||
digits=(16, Eval('default_uom_digits', 2))),
|
||||
'on_change_with_stock_quantity')
|
||||
|
||||
@fields.depends('product')
|
||||
@fields.depends('product', 'purchase',
|
||||
'_parent_purchase.warehouse')
|
||||
def on_change_with_stock_quantity(self, name=None):
|
||||
if self.product:
|
||||
context = {'stock_date_end': date.today()}
|
||||
|
@ -82,6 +83,7 @@ class Line(metaclass=PoolMeta):
|
|||
location_ids = [l.storage_location.id for l in locations if l.storage_location]
|
||||
else:
|
||||
location_ids = [self.purchase.warehouse.storage_location.id]
|
||||
|
||||
product_ids = [self.product.id]
|
||||
quantity = 0
|
||||
with Transaction().set_context(context):
|
||||
|
|
Loading…
Reference in a new issue