diff --git a/odex25_base/system_dashboard_classic/i18n/ar_001.po b/odex25_base/system_dashboard_classic/i18n/ar_001.po index af9b94f78..db63462a9 100644 --- a/odex25_base/system_dashboard_classic/i18n/ar_001.po +++ b/odex25_base/system_dashboard_classic/i18n/ar_001.po @@ -428,3 +428,8 @@ msgstr "" #: model:ir.model.fields,field_description:system_dashboard_classic.field_stage_stage__value msgid "value" msgstr "القيمة" + +#. module: system_dashboard_classic +#: model_terms:ir.ui.view,arch_db:system_dashboard_classic.view_base_dashboard_form +msgid "Unlink Nodes" +msgstr "حذف المراحل" \ No newline at end of file diff --git a/odex25_base/system_dashboard_classic/models/config.py b/odex25_base/system_dashboard_classic/models/config.py index dada504f4..c3ce8935e 100644 --- a/odex25_base/system_dashboard_classic/models/config.py +++ b/odex25_base/system_dashboard_classic/models/config.py @@ -74,6 +74,18 @@ class BaseDashboard(models.Model): relation = fields.Char( string='action_domain', ) + + def unlink_nodes(self): + for rec in self: + rec.is_button = False + nodes = self.env['node.state'].sudo().search([('model_id', '=', rec.model_id.id),('is_workflow', '=', False)]) + nodes.sudo().unlink() + + def unlink(self): + for rec in self: + rec.unlink_nodes() + return super(BaseDashboard, self).unlink() + @api.constrains('action_id') def _check_action_id(self): @@ -244,7 +256,7 @@ class BaseDashboard(models.Model): stage = self.env['node.state'].create({'model_id':rec.model_id.id , 'form_view_id':rec.form_view_id.id , 'list_view_id':rec.list_view_id.id , 'action_id':rec.action_id.id,'stage_id':rel.id ,'name':rel.name,'is_holiday_workflow':True}) else: - self.update_selection() + self.update_selection() if 'state' in model._fields and rec.model_name != 'hr.holidays' : if not current_model: @@ -281,7 +293,8 @@ class BaseDashboardUser(models.Model): ) board_id = fields.Many2one( string='Bord', - comodel_name='base.dashbord' + comodel_name='base.dashbord', + ondelete = 'cascade' ) state_id = fields.Many2one( diff --git a/odex25_base/system_dashboard_classic/views/config.xml b/odex25_base/system_dashboard_classic/views/config.xml index c5c778332..5f25d5dcc 100644 --- a/odex25_base/system_dashboard_classic/views/config.xml +++ b/odex25_base/system_dashboard_classic/views/config.xml @@ -31,7 +31,11 @@