From 80b10274cb89135a110fb5f7629fb74a53751ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 27 Nov 2016 22:17:12 +0100 Subject: [PATCH] Fix missing depends and manage None as value of field in on_change method issue6069 review27851002 --- sale.py | 4 +++- stock.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sale.py b/sale.py index 913335b14f..cbb15120f3 100644 --- a/sale.py +++ b/sale.py @@ -56,7 +56,9 @@ class Sale: def _get_carrier_selection_pattern(self): pattern = {} - if self.warehouse.address and self.warehouse.address.country: + if (self.warehouse + and self.warehouse.address + and self.warehouse.address.country): pattern['from_country'] = self.warehouse.address.country.id if self.shipment_address and self.shipment_address.country: pattern['to_country'] = self.shipment_address.country.id diff --git a/stock.py b/stock.py index 1a4e95ef45..0c6289727d 100644 --- a/stock.py +++ b/stock.py @@ -43,7 +43,7 @@ class ShipmentOut: 'product "%s".'), }) - @fields.depends('currency') + @fields.depends('cost_currency') def on_change_with_cost_currency_digits(self, name=None): if self.cost_currency: return self.cost_currency.digits