Merge pull request #5747 from expsa/hty
[IMP] odex_benefit: IMP benefit
This commit is contained in:
commit
8586773f86
|
|
@ -406,7 +406,7 @@ class GrantBenefitProfile(models.Model):
|
|||
], string='state', default="draft", tracking=True, group_expand='_expand_states')
|
||||
branch_custom_id = fields.Many2one('branch.settings', string="Branch")
|
||||
branch_family_id = fields.Many2one('branch.settings', string="Family Branch")
|
||||
branch_has_employees = fields.Boolean('Has Employees In branch',related="branch_family_id.has_employees")
|
||||
branch_has_employees = fields.Boolean('Has Employees In branch',related="branch_custom_id.has_employees")
|
||||
district_id = fields.Many2one('res.districts', string="District", domain="[('branch_custom_id','=',branch_custom_id)]")
|
||||
meal_card = fields.Boolean(string="Meal Card",related="district_id.meal_card", store=True,related_sudo=True)
|
||||
attachment_ids = fields.One2many('ir.attachment', 'benefit_id')
|
||||
|
|
|
|||
|
|
@ -992,8 +992,8 @@
|
|||
</group>
|
||||
<group>
|
||||
<field name="has_employees"/>
|
||||
<field name="replacement_branch_id"
|
||||
attrs="{'required':[('has_employees','=',False)]}"/>
|
||||
<field name="replacement_branch_id" domain="[('has_employees','=',True)]"
|
||||
attrs="{'invisible':[('has_employees','=',True)],'required':[('has_employees','=',False)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
|
|
|
|||
|
|
@ -840,7 +840,6 @@
|
|||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||
<field name="start_date"/>
|
||||
<field name="supporter_id"/>
|
||||
<field name="attach_status"/>
|
||||
<field name="mother_grant_benefit_id" invisible="1"/>
|
||||
<field name="member_id" invisible="1"/>
|
||||
<field name="file_size" invisible="1"/>
|
||||
|
|
@ -857,8 +856,8 @@
|
|||
<button name="action_preview_attachment"
|
||||
type="object" icon="fa-search-plus"
|
||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||
<field name="expiration_date"/>
|
||||
<field name="attach_status"/>
|
||||
<field name="start_date"/>
|
||||
<field name="supporter_id"/>
|
||||
<field name="mother_grant_benefit_id" invisible="1"/>
|
||||
<field name="member_id" invisible="1"/>
|
||||
<field name="file_size" invisible="1"/>
|
||||
|
|
@ -1006,7 +1005,6 @@
|
|||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||
<field name="start_date"/>
|
||||
<field name="supporter_id"/>
|
||||
<field name="attach_status"/>
|
||||
<field name="replacement_mother_grant_benefit_id" invisible="1"/>
|
||||
<field name="member_id" invisible="1"/>
|
||||
<field name="file_size" invisible="1"/>
|
||||
|
|
@ -1024,8 +1022,8 @@
|
|||
<button name="action_preview_attachment"
|
||||
type="object" icon="fa-search-plus"
|
||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||
<field name="expiration_date"/>
|
||||
<field name="attach_status"/>
|
||||
<field name="start_date"/>
|
||||
<field name="supporter_id"/>
|
||||
<field name="replacement_mother_grant_benefit_id" invisible="1"/>
|
||||
<field name="member_id" invisible="1"/>
|
||||
<field name="file_size" invisible="1"/>
|
||||
|
|
@ -1170,7 +1168,6 @@
|
|||
<button name="action_preview_attachment"
|
||||
type="object" icon="fa-search-plus"
|
||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||
<!-- <field name="attach_status"/>-->
|
||||
<field name="member_id" invisible="1"/>
|
||||
<field name="file_size" invisible="1"/>
|
||||
</tree>
|
||||
|
|
@ -1188,7 +1185,6 @@
|
|||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||
<field name="start_date"/>
|
||||
<field name="supporter_id"/>
|
||||
<field name="attach_status"/>
|
||||
<field name="member_id" invisible="1"/>
|
||||
<field name="file_size" invisible="1"/>
|
||||
</tree>
|
||||
|
|
@ -1204,8 +1200,8 @@
|
|||
<button name="action_preview_attachment"
|
||||
type="object" icon="fa-search-plus"
|
||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||
<field name="expiration_date"/>
|
||||
<field name="attach_status"/>
|
||||
<field name="start_date"/>
|
||||
<field name="supporter_id"/>
|
||||
<field name="member_id" invisible="1"/>
|
||||
<field name="file_size" invisible="1"/>
|
||||
</tree>
|
||||
|
|
|
|||
|
|
@ -189,7 +189,6 @@
|
|||
<field name="name"/>
|
||||
<field name="hobbies_id" required="1"/>
|
||||
<field name="datas" string="File content"/>
|
||||
<!-- <field name="attach_status"/>-->
|
||||
<field name="member_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
|
@ -202,7 +201,6 @@
|
|||
<field name="datas" string="File content"/>
|
||||
<field name="start_date"/>
|
||||
<field name="supporter_id"/>
|
||||
<field name="attach_status"/>
|
||||
<field name="member_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
|
@ -213,8 +211,8 @@
|
|||
<field name="name"/>
|
||||
<field name="disabilities_id" required="1"/>
|
||||
<field name="datas" string="File content"/>
|
||||
<field name="expiration_date"/>
|
||||
<field name="attach_status"/>
|
||||
<field name="start_date"/>
|
||||
<field name="supporter_id"/>
|
||||
<field name="member_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
active_ids = self._context.get('active_ids', [])
|
||||
if active_ids:
|
||||
benefit = self.env['grant.benefit'].browse(active_ids[0])
|
||||
return benefit.branch_family_id.id
|
||||
return benefit.branch_custom_id.id
|
||||
return False
|
||||
|
||||
researcher_team = fields.Many2one("committees.line", string="Researcher Team", )
|
||||
|
|
@ -75,7 +75,7 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
@api.onchange('benefit_ids')
|
||||
def _onchange_benefit_ids(self):
|
||||
if self.benefit_ids:
|
||||
branches = self.benefit_ids.mapped('branch_family_id')
|
||||
branches = self.benefit_ids.mapped('branch_custom_id')
|
||||
if len(branches) > 1:
|
||||
raise ValidationError(_('All selected families must be from the same branch'))
|
||||
if branches:
|
||||
|
|
@ -86,7 +86,7 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
raise ValidationError(_('Please select at least one family'))
|
||||
if not self.researcher_team:
|
||||
raise ValidationError(_('Please select a researcher'))
|
||||
branches = self.benefit_ids.mapped('branch_family_id')
|
||||
branches = self.benefit_ids.mapped('branch_custom_id')
|
||||
if len(branches) > 1:
|
||||
raise ValidationError(_('All selected families must be from the same branch'))
|
||||
draft_records = self.benefit_ids.filtered(lambda b: b.state == 'draft')
|
||||
|
|
|
|||
Loading…
Reference in New Issue