Help

0

Can not change ECO approval_ids readonly attribute

Module : mrp_plm

Form View : mrp_eco_view_form  


I want to change the value of readonly attribute for field approval_ids


But if I do this : 

<xpath expr="//form/sheet/notebook/page[6]/field[@name='approval_ids']" position="attributes">

    <attribute name="readonly">0</attribute>

</xpath>



I am getting this error :


  File "/media/erp/Data/odoo_versions/13/odoo/addons/base/models/ir_ui_view.py", line 394, in _check_xml

    raise ValidationError("%s\n\n%s" % (_("Error while validating view"), tools.ustr(e)))

odoo.exceptions.ValidationError: ('Error while validating view\n\nField \'type_id\' used in attributes must be present in view but is missing:\n - \'type_id\' in domain="[(\'type_id\', \'=\', type_id)]"\n\nError context:\nView `mrp.eco.view.form.inherit.plm_enhancements`\n[view_id: 2347, xml_id: plm_enhancements.mrp_eco_view_form_inherit_plm_enhancements, model: mrp.eco, parent_id: 2328]', None)


Field 'type_id' used in attributes must be present in view but is missing:

 - 'type_id' in domain="[('type_id', '=', type_id)]"


This domain is applied on : 


stage_id = fields.Many2one(

    'mrp.eco.stage', 'Stage', ondelete='restrict', copy=False, domain="[('type_id', '=', type_id)]",

    group_expand='_read_group_stage_ids', tracking=True,

    default=lambda self: self.env['mrp.eco.stage'].search([('type_id', '=', self._context.get('default_type_id'))], limit=1))



Avatar
Discard