diff --git a/odex25_takaful/odex_takaful/models/account_move.py b/odex25_takaful/odex_takaful/models/account_move.py index a102f82a2..552181d0d 100644 --- a/odex25_takaful/odex_takaful/models/account_move.py +++ b/odex25_takaful/odex_takaful/models/account_move.py @@ -17,13 +17,18 @@ class AccountMove(models.Model): esterdad_id = fields.Many2one('esterdad.wizard') def action_view_esterdad_id(self): - self.ensure_one() # Ensure the method is called on a single record - action = self.env.ref('odex_takaful.view_esterdad_wizard_tree').read()[0] - action['domain'] = [('id', '=', self.esterdad_id.id)] - action['context'] = { - 'create': False + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'res_model': 'esterdad.wizard', + 'view_mode': 'form', + 'view_id': False, # or specify a particular form view if you have one + 'target': 'current', # or 'new' if you want a popup wizard + 'res_id': self.esterdad_id.id, # open this record directly + 'context': { + 'create': False + }, } - return action @api.depends('state') def _compute_takaful_sponsorship_id(self): diff --git a/odex25_takaful/odex_takaful/models/donation_details_lines.py b/odex25_takaful/odex_takaful/models/donation_details_lines.py index 39b810c54..20e02b766 100644 --- a/odex25_takaful/odex_takaful/models/donation_details_lines.py +++ b/odex25_takaful/odex_takaful/models/donation_details_lines.py @@ -163,7 +163,9 @@ class DonationsDetailsLines(models.Model): is_manager = ( user.has_group('odex_takaful.sponsorship_system_manager_group') or user.has_group('odex_takaful.branch_manager_group')) - rec.can_edit_benefit = (rec.create_uid == user and not is_manager) + print('is_manager >>>> ' , is_manager) + print('rec.create_uid >>>> ' , rec.create_uid) + rec.can_edit_benefit = (rec.create_uid == user or is_manager) @api.depends('sponsorship_duration', 'payment_month_count', 'direct_debit') def _compute_age_category(self): for rec in self: diff --git a/odex25_takaful/odex_takaful/views/acount_move.xml b/odex25_takaful/odex_takaful/views/acount_move.xml index 0eb0ea278..a0e0028d2 100644 --- a/odex25_takaful/odex_takaful/views/acount_move.xml +++ b/odex25_takaful/odex_takaful/views/acount_move.xml @@ -10,7 +10,7 @@ - + @@ -26,7 +26,7 @@ - diff --git a/odex25_takaful/odex_takaful/views/donations_details_lines.xml b/odex25_takaful/odex_takaful/views/donations_details_lines.xml index efed2002e..9908d1c4a 100644 --- a/odex25_takaful/odex_takaful/views/donations_details_lines.xml +++ b/odex25_takaful/odex_takaful/views/donations_details_lines.xml @@ -162,7 +162,7 @@ type="object" class="btn-primary" icon="fa-plus-circle" - attrs="{'invisible': ['|' , ('show_add_benefit_button', '=', False) , ('can_edit_benefit', '=', False)]}" + attrs="{'invisible': [ ('can_edit_benefit', '=', False)]}" groups="odex_takaful.group_kufula_user" /> - + - - + +