issue12109.diff # add get_warehouse() that is required from third modules
This commit is contained in:
parent
4843bbf2b3
commit
f85c3b65f5
|
@ -67,7 +67,7 @@ index faf35cecfa..bb564ff9f4 100644
|
||||||
if (self.quantity or 0) >= 0:
|
if (self.quantity or 0) >= 0:
|
||||||
if self.purchase.party.supplier_location:
|
if self.purchase.party.supplier_location:
|
||||||
diff --git a/tryton/modules/sale/sale.py b/tryton/modules/sale/sale.py
|
diff --git a/tryton/modules/sale/sale.py b/tryton/modules/sale/sale.py
|
||||||
index 1b0e36a3b3..6c85325b2b 100644
|
index 1b0e36a3b3..d628a9d2be 100644
|
||||||
--- a/tryton/modules/sale/sale.py
|
--- a/tryton/modules/sale/sale.py
|
||||||
+++ b/tryton/modules/sale/sale.py
|
+++ b/tryton/modules/sale/sale.py
|
||||||
@@ -1143,13 +1143,13 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView):
|
@@ -1143,13 +1143,13 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView):
|
||||||
|
@ -109,19 +109,18 @@ index 1b0e36a3b3..6c85325b2b 100644
|
||||||
from_location = fields.Function(fields.Many2One('stock.location',
|
from_location = fields.Function(fields.Many2One('stock.location',
|
||||||
'From Location'), 'get_from_location')
|
'From Location'), 'get_from_location')
|
||||||
to_location = fields.Function(fields.Many2One('stock.location',
|
to_location = fields.Function(fields.Many2One('stock.location',
|
||||||
@@ -1427,8 +1426,10 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView):
|
@@ -1430,6 +1429,11 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView):
|
||||||
return amount
|
def get_warehouse(self, name):
|
||||||
return Decimal('0.0')
|
return self.sale.warehouse.id if self.sale.warehouse else None
|
||||||
|
|
||||||
- def get_warehouse(self, name):
|
|
||||||
- return self.sale.warehouse.id if self.sale.warehouse else None
|
|
||||||
+ @fields.depends('sale', '_parent_sale.warehouse')
|
+ @fields.depends('sale', '_parent_sale.warehouse')
|
||||||
+ def on_change_with_warehouse(self, name=None):
|
+ def on_change_with_warehouse(self, name=None):
|
||||||
+ if self.sale and self.sale.warehouse:
|
+ if self.sale and self.sale.warehouse:
|
||||||
+ return self.sale.warehouse.id
|
+ return self.sale.warehouse.id
|
||||||
|
+
|
||||||
def get_from_location(self, name):
|
def get_from_location(self, name):
|
||||||
if (self.quantity or 0) >= 0:
|
if (self.quantity or 0) >= 0:
|
||||||
|
if self.warehouse:
|
||||||
diff --git a/tryton/modules/sale_product_customer/sale.py b/tryton/modules/sale_product_customer/sale.py
|
diff --git a/tryton/modules/sale_product_customer/sale.py b/tryton/modules/sale_product_customer/sale.py
|
||||||
index 4f0c4cca41..f77870d05f 100644
|
index 4f0c4cca41..f77870d05f 100644
|
||||||
--- a/tryton/modules/sale_product_customer/sale.py
|
--- a/tryton/modules/sale_product_customer/sale.py
|
||||||
|
|
Loading…
Reference in New Issue