Search code examples
requiredodoo-13kanban

Required Fields in view Kanban Odoo13


I have some fields that are required in my form view. but in the kanban view, when moving the records between states, these required fields are not being evaluated. Does anyone know how to make them required when I am in the kanban view and move them from state to column?


Solution

  • if you are dragging your kanban card from one stage to another, you can add onchange method on the field on which you are grouping your kanban cards, in that onchange method you can validate your fields and if some validation condition failed, use odoo ValidationError

    @api.onchange('stage_id')
    def _onchange_kanban_stage(self):
        # do your validation here
        pass