[FIX] Access right issue
This commit is contained in:
parent
1724ec851e
commit
535708bcd7
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='partner_id']" position="after">
|
||||
<field name="esterdad_id" invisible="0"/>
|
||||
<field name="esterdad_id" invisible="1"/>
|
||||
|
||||
</xpath>
|
||||
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="action_view_esterdad_id" type="object" class="oe_stat_button" icon="fa-money"
|
||||
<button string="Cancel Form" name="action_view_esterdad_id" type="object" class="oe_stat_button" icon="fa-money"
|
||||
attrs="{'invisible': [('esterdad_id', '=', False)]}">
|
||||
</button>
|
||||
</xpath>
|
||||
|
|
|
|||
|
|
@ -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" />
|
||||
|
||||
<field name="state" widget="statusbar"
|
||||
|
|
@ -220,7 +220,7 @@
|
|||
attrs="{'readonly': [('parent_state', '!=', 'draft')]}" />
|
||||
</group>
|
||||
<group string="Sponsorship Information">
|
||||
<field name="can_edit_benefit" invisible="0"/>
|
||||
<field name="can_edit_benefit" invisible="1"/>
|
||||
<field name="sponsorship_id" readonly="1"
|
||||
attrs="{'invisible': [('sponsorship_id', '=', False)]}" />
|
||||
<field name="sponsorship_mechanism_id" readonly="1"
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@
|
|||
<field name="another_reason"/>
|
||||
<field name="reason" attrs="{'invisible': [('another_reason', '=', False)],
|
||||
'required': [('another_reason', '=', True)]}"/>
|
||||
<field name="sponsor_id" />
|
||||
<field name="allowed_payment_ids" widget="many2many_tags" />
|
||||
<field name="sponsor_id" invisible="1"/>
|
||||
<field name="allowed_payment_ids" widget="many2many_tags" invisible="1"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="بيانات المتبرع">
|
||||
|
|
|
|||
Loading…
Reference in New Issue