From 4be226a45d263490474c0d0ea691a4cdf73f9f74 Mon Sep 17 00:00:00 2001 From: Juanjo Garcia Date: Wed, 12 Feb 2020 15:13:51 +0100 Subject: [PATCH] [trytond] Allows dynamic fields in Model as required by the wizard in sale_pos_template_quantities --- model.diff | 13 +++++++++++++ series | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 model.diff diff --git a/model.diff b/model.diff new file mode 100644 index 0000000..f71d30a --- /dev/null +++ b/model.diff @@ -0,0 +1,13 @@ +diff --git a/trytond/model/model.py b/trytond/model/model.py +index c4ab96fc..bdb1c78b 100644 +--- a/trytond/trytond/model/model.py ++++ b/trytond/trytond/model/model.py +@@ -258,7 +258,7 @@ class Model(URLMixin, PoolBase, metaclass=ModelMeta): + name = name[len('_parent_'):] + parent_values[name][field] = value + value = parent_values[name] +- if getattr(self.__class__, name).context: ++ if hasattr(self.__class__, name) and getattr(self.__class__, name).context: + has_context[name] = value + + for name, value in parent_values.items(): diff --git a/series b/series index 4a716f4..8b2acc0 100644 --- a/series +++ b/series @@ -42,3 +42,6 @@ issue7805.diff # [stock] [stock_lot_sled] Allow configuring which quantity is gr issue8860.diff # [stock_forecast] stock_forecast does not spread all the quantities statement_of_account.diff # [account] Cumulate balance of previous fiscal years +issue9017.diff # [purchase] Doesn't copy product_suppliers when a template or a product is duplicated + +model.diff # [trytond] Allows dynamic fields in Model as required by the wizard in sale_pos_template_quantities