Set bom field not implemented error for o2m

#049017
This commit is contained in:
Raimon Esteve 2022-03-28 18:06:45 +02:00
parent bedcd2127f
commit d6d38a9d11
2 changed files with 9 additions and 4 deletions

View File

@ -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:

View File

@ -17,8 +17,8 @@
<field name="steps" colspan="4"/>
</page>
<page string="Products" id="products">
<field name="inputs" colspan="2"/>
<field name="outputs" colspan="2"/>
<field name="inputs" colspan="2" readonly="1"/>
<field name="outputs" colspan="2" readonly="1"/>
</page>
<page string="Operations" id="operations">
<field name="operations" colspan="4"/>