From d6d38a9d11ab1f16a9a238165e000998b4e95f81 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Mon, 28 Mar 2022 18:06:45 +0200 Subject: [PATCH] Set bom field not implemented error for o2m #049017 --- production.py | 9 +++++++-- view/production_process_form.xml | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/production.py b/production.py index 6649602..c389af6 100644 --- a/production.py +++ b/production.py @@ -30,9 +30,9 @@ class Process(DeactivableMixin, ModelSQL, ModelView): }, depends=['steps']) inputs = fields.Function(fields.One2Many('production.bom.input', None, - 'Inputs'), 'get_bom_field') + 'Inputs'), 'get_bom_field', setter='_set_bom_field') outputs = fields.Function(fields.One2Many('production.bom.output', None, - 'Outputs'), 'get_bom_field') + 'Outputs'), 'get_bom_field', setter='_set_bom_field') output_products = fields.Function(fields.Many2Many('production.bom.output', 'bom', 'product', 'Outputs'), 'get_bom_field', searcher='search_bom_field') @@ -46,6 +46,11 @@ class Process(DeactivableMixin, ModelSQL, ModelView): res += [x.id for x in getattr(self.bom, name)] return res + @classmethod + def _set_bom_field(cls, processes, name, value): + # Prevent NotImplementedError for One2Many + pass + def get_operations(self, name): res = [] if self.route: diff --git a/view/production_process_form.xml b/view/production_process_form.xml index 29477a8..364ce47 100644 --- a/view/production_process_form.xml +++ b/view/production_process_form.xml @@ -17,8 +17,8 @@ - - + +