[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')
|
esterdad_id = fields.Many2one('esterdad.wizard')
|
||||||
|
|
||||||
def action_view_esterdad_id(self):
|
def action_view_esterdad_id(self):
|
||||||
self.ensure_one() # Ensure the method is called on a single record
|
self.ensure_one()
|
||||||
action = self.env.ref('odex_takaful.view_esterdad_wizard_tree').read()[0]
|
return {
|
||||||
action['domain'] = [('id', '=', self.esterdad_id.id)]
|
'type': 'ir.actions.act_window',
|
||||||
action['context'] = {
|
'res_model': 'esterdad.wizard',
|
||||||
'create': False
|
'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')
|
@api.depends('state')
|
||||||
def _compute_takaful_sponsorship_id(self):
|
def _compute_takaful_sponsorship_id(self):
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,9 @@ class DonationsDetailsLines(models.Model):
|
||||||
is_manager = (
|
is_manager = (
|
||||||
user.has_group('odex_takaful.sponsorship_system_manager_group') or
|
user.has_group('odex_takaful.sponsorship_system_manager_group') or
|
||||||
user.has_group('odex_takaful.branch_manager_group'))
|
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')
|
@api.depends('sponsorship_duration', 'payment_month_count', 'direct_debit')
|
||||||
def _compute_age_category(self):
|
def _compute_age_category(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='partner_id']" position="after">
|
<xpath expr="//field[@name='partner_id']" position="after">
|
||||||
<field name="esterdad_id" invisible="0"/>
|
<field name="esterdad_id" invisible="1"/>
|
||||||
|
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
<field name="inherit_id" ref="account.view_move_form"/>
|
<field name="inherit_id" ref="account.view_move_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//div[@name='button_box']" position="inside">
|
<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)]}">
|
attrs="{'invisible': [('esterdad_id', '=', False)]}">
|
||||||
</button>
|
</button>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@
|
||||||
type="object"
|
type="object"
|
||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
icon="fa-plus-circle"
|
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" />
|
groups="odex_takaful.group_kufula_user" />
|
||||||
|
|
||||||
<field name="state" widget="statusbar"
|
<field name="state" widget="statusbar"
|
||||||
|
|
@ -220,7 +220,7 @@
|
||||||
attrs="{'readonly': [('parent_state', '!=', 'draft')]}" />
|
attrs="{'readonly': [('parent_state', '!=', 'draft')]}" />
|
||||||
</group>
|
</group>
|
||||||
<group string="Sponsorship Information">
|
<group string="Sponsorship Information">
|
||||||
<field name="can_edit_benefit" invisible="0"/>
|
<field name="can_edit_benefit" invisible="1"/>
|
||||||
<field name="sponsorship_id" readonly="1"
|
<field name="sponsorship_id" readonly="1"
|
||||||
attrs="{'invisible': [('sponsorship_id', '=', False)]}" />
|
attrs="{'invisible': [('sponsorship_id', '=', False)]}" />
|
||||||
<field name="sponsorship_mechanism_id" readonly="1"
|
<field name="sponsorship_mechanism_id" readonly="1"
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@
|
||||||
<field name="another_reason"/>
|
<field name="another_reason"/>
|
||||||
<field name="reason" attrs="{'invisible': [('another_reason', '=', False)],
|
<field name="reason" attrs="{'invisible': [('another_reason', '=', False)],
|
||||||
'required': [('another_reason', '=', True)]}"/>
|
'required': [('another_reason', '=', True)]}"/>
|
||||||
<field name="sponsor_id" />
|
<field name="sponsor_id" invisible="1"/>
|
||||||
<field name="allowed_payment_ids" widget="many2many_tags" />
|
<field name="allowed_payment_ids" widget="many2many_tags" invisible="1"/>
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="بيانات المتبرع">
|
<page string="بيانات المتبرع">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue