[IMP] odex_benefit: IMP benefit
This commit is contained in:
parent
8373f078b5
commit
c8417d9b37
|
|
@ -406,7 +406,7 @@ class GrantBenefitProfile(models.Model):
|
||||||
], string='state', default="draft", tracking=True, group_expand='_expand_states')
|
], string='state', default="draft", tracking=True, group_expand='_expand_states')
|
||||||
branch_custom_id = fields.Many2one('branch.settings', string="Branch")
|
branch_custom_id = fields.Many2one('branch.settings', string="Branch")
|
||||||
branch_family_id = fields.Many2one('branch.settings', string="Family 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)]")
|
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)
|
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')
|
attachment_ids = fields.One2many('ir.attachment', 'benefit_id')
|
||||||
|
|
|
||||||
|
|
@ -992,8 +992,8 @@
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="has_employees"/>
|
<field name="has_employees"/>
|
||||||
<field name="replacement_branch_id"
|
<field name="replacement_branch_id" domain="[('has_employees','=',True)]"
|
||||||
attrs="{'required':[('has_employees','=',False)]}"/>
|
attrs="{'invisible':[('has_employees','=',True)],'required':[('has_employees','=',False)]}"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</sheet>
|
</sheet>
|
||||||
|
|
|
||||||
|
|
@ -840,7 +840,6 @@
|
||||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||||
<field name="start_date"/>
|
<field name="start_date"/>
|
||||||
<field name="supporter_id"/>
|
<field name="supporter_id"/>
|
||||||
<field name="attach_status"/>
|
|
||||||
<field name="mother_grant_benefit_id" invisible="1"/>
|
<field name="mother_grant_benefit_id" invisible="1"/>
|
||||||
<field name="member_id" invisible="1"/>
|
<field name="member_id" invisible="1"/>
|
||||||
<field name="file_size" invisible="1"/>
|
<field name="file_size" invisible="1"/>
|
||||||
|
|
@ -857,8 +856,8 @@
|
||||||
<button name="action_preview_attachment"
|
<button name="action_preview_attachment"
|
||||||
type="object" icon="fa-search-plus"
|
type="object" icon="fa-search-plus"
|
||||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||||
<field name="expiration_date"/>
|
<field name="start_date"/>
|
||||||
<field name="attach_status"/>
|
<field name="supporter_id"/>
|
||||||
<field name="mother_grant_benefit_id" invisible="1"/>
|
<field name="mother_grant_benefit_id" invisible="1"/>
|
||||||
<field name="member_id" invisible="1"/>
|
<field name="member_id" invisible="1"/>
|
||||||
<field name="file_size" invisible="1"/>
|
<field name="file_size" invisible="1"/>
|
||||||
|
|
@ -1006,7 +1005,6 @@
|
||||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||||
<field name="start_date"/>
|
<field name="start_date"/>
|
||||||
<field name="supporter_id"/>
|
<field name="supporter_id"/>
|
||||||
<field name="attach_status"/>
|
|
||||||
<field name="replacement_mother_grant_benefit_id" invisible="1"/>
|
<field name="replacement_mother_grant_benefit_id" invisible="1"/>
|
||||||
<field name="member_id" invisible="1"/>
|
<field name="member_id" invisible="1"/>
|
||||||
<field name="file_size" invisible="1"/>
|
<field name="file_size" invisible="1"/>
|
||||||
|
|
@ -1024,8 +1022,8 @@
|
||||||
<button name="action_preview_attachment"
|
<button name="action_preview_attachment"
|
||||||
type="object" icon="fa-search-plus"
|
type="object" icon="fa-search-plus"
|
||||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||||
<field name="expiration_date"/>
|
<field name="start_date"/>
|
||||||
<field name="attach_status"/>
|
<field name="supporter_id"/>
|
||||||
<field name="replacement_mother_grant_benefit_id" invisible="1"/>
|
<field name="replacement_mother_grant_benefit_id" invisible="1"/>
|
||||||
<field name="member_id" invisible="1"/>
|
<field name="member_id" invisible="1"/>
|
||||||
<field name="file_size" invisible="1"/>
|
<field name="file_size" invisible="1"/>
|
||||||
|
|
@ -1170,7 +1168,6 @@
|
||||||
<button name="action_preview_attachment"
|
<button name="action_preview_attachment"
|
||||||
type="object" icon="fa-search-plus"
|
type="object" icon="fa-search-plus"
|
||||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||||
<!-- <field name="attach_status"/>-->
|
|
||||||
<field name="member_id" invisible="1"/>
|
<field name="member_id" invisible="1"/>
|
||||||
<field name="file_size" invisible="1"/>
|
<field name="file_size" invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
@ -1188,7 +1185,6 @@
|
||||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||||
<field name="start_date"/>
|
<field name="start_date"/>
|
||||||
<field name="supporter_id"/>
|
<field name="supporter_id"/>
|
||||||
<field name="attach_status"/>
|
|
||||||
<field name="member_id" invisible="1"/>
|
<field name="member_id" invisible="1"/>
|
||||||
<field name="file_size" invisible="1"/>
|
<field name="file_size" invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
@ -1204,8 +1200,8 @@
|
||||||
<button name="action_preview_attachment"
|
<button name="action_preview_attachment"
|
||||||
type="object" icon="fa-search-plus"
|
type="object" icon="fa-search-plus"
|
||||||
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
attrs="{'invisible': [('file_size', '=', 0)]}"/>
|
||||||
<field name="expiration_date"/>
|
<field name="start_date"/>
|
||||||
<field name="attach_status"/>
|
<field name="supporter_id"/>
|
||||||
<field name="member_id" invisible="1"/>
|
<field name="member_id" invisible="1"/>
|
||||||
<field name="file_size" invisible="1"/>
|
<field name="file_size" invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
string="Second Approve" class="oe_highlight"
|
string="Second Approve" class="oe_highlight"
|
||||||
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['first_approve'])]}"
|
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['first_approve'])]}"
|
||||||
/>
|
/>
|
||||||
<button name="action_suspend_third_accept" type="object"
|
<button name="action_suspend_third_accept" type="object"
|
||||||
string="Third Approve" class="oe_highlight"
|
string="Third Approve" class="oe_highlight"
|
||||||
groups="odex_benefit.group_benefit_manager"
|
groups="odex_benefit.group_benefit_manager"
|
||||||
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['family_services_manager'])]}"/>
|
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['family_services_manager'])]}"/>
|
||||||
|
|
@ -189,7 +189,6 @@
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="hobbies_id" required="1"/>
|
<field name="hobbies_id" required="1"/>
|
||||||
<field name="datas" string="File content"/>
|
<field name="datas" string="File content"/>
|
||||||
<!-- <field name="attach_status"/>-->
|
|
||||||
<field name="member_id" invisible="1"/>
|
<field name="member_id" invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
|
@ -202,7 +201,6 @@
|
||||||
<field name="datas" string="File content"/>
|
<field name="datas" string="File content"/>
|
||||||
<field name="start_date"/>
|
<field name="start_date"/>
|
||||||
<field name="supporter_id"/>
|
<field name="supporter_id"/>
|
||||||
<field name="attach_status"/>
|
|
||||||
<field name="member_id" invisible="1"/>
|
<field name="member_id" invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
|
@ -213,8 +211,8 @@
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="disabilities_id" required="1"/>
|
<field name="disabilities_id" required="1"/>
|
||||||
<field name="datas" string="File content"/>
|
<field name="datas" string="File content"/>
|
||||||
<field name="expiration_date"/>
|
<field name="start_date"/>
|
||||||
<field name="attach_status"/>
|
<field name="supporter_id"/>
|
||||||
<field name="member_id" invisible="1"/>
|
<field name="member_id" invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
|
@ -297,7 +295,7 @@
|
||||||
<field name="model">family.member</field>
|
<field name="model">family.member</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Family Members" create="false">
|
<tree string="Family Members" create="false">
|
||||||
<field name="member_id_number"/>
|
<field name="member_id_number"/>
|
||||||
<field name="name" force_save="1"/>
|
<field name="name" force_save="1"/>
|
||||||
<field name="relationn"/>
|
<field name="relationn"/>
|
||||||
<field name="member_location_conf"/>
|
<field name="member_location_conf"/>
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
||||||
active_ids = self._context.get('active_ids', [])
|
active_ids = self._context.get('active_ids', [])
|
||||||
if active_ids:
|
if active_ids:
|
||||||
benefit = self.env['grant.benefit'].browse(active_ids[0])
|
benefit = self.env['grant.benefit'].browse(active_ids[0])
|
||||||
return benefit.branch_family_id.id
|
return benefit.branch_custom_id.id
|
||||||
return False
|
return False
|
||||||
|
|
||||||
researcher_team = fields.Many2one("committees.line", string="Researcher Team", )
|
researcher_team = fields.Many2one("committees.line", string="Researcher Team", )
|
||||||
|
|
@ -75,7 +75,7 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
||||||
@api.onchange('benefit_ids')
|
@api.onchange('benefit_ids')
|
||||||
def _onchange_benefit_ids(self):
|
def _onchange_benefit_ids(self):
|
||||||
if self.benefit_ids:
|
if self.benefit_ids:
|
||||||
branches = self.benefit_ids.mapped('branch_family_id')
|
branches = self.benefit_ids.mapped('branch_custom_id')
|
||||||
if len(branches) > 1:
|
if len(branches) > 1:
|
||||||
raise ValidationError(_('All selected families must be from the same branch'))
|
raise ValidationError(_('All selected families must be from the same branch'))
|
||||||
if branches:
|
if branches:
|
||||||
|
|
@ -86,7 +86,7 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
||||||
raise ValidationError(_('Please select at least one family'))
|
raise ValidationError(_('Please select at least one family'))
|
||||||
if not self.researcher_team:
|
if not self.researcher_team:
|
||||||
raise ValidationError(_('Please select a researcher'))
|
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:
|
if len(branches) > 1:
|
||||||
raise ValidationError(_('All selected families must be from the same branch'))
|
raise ValidationError(_('All selected families must be from the same branch'))
|
||||||
draft_records = self.benefit_ids.filtered(lambda b: b.state == 'draft')
|
draft_records = self.benefit_ids.filtered(lambda b: b.state == 'draft')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue