fix translation
This commit is contained in:
parent
73ce10b009
commit
48e382fb16
File diff suppressed because it is too large
Load Diff
|
|
@ -422,6 +422,19 @@ class GrantBenefitProfile(models.Model):
|
|||
('benefit_family_id', '=', rec.id),
|
||||
])
|
||||
|
||||
def action_confirm_benefit(self):
|
||||
"""Open the confirm.benefit.wizard form dynamically."""
|
||||
active_ids = self.env.context.get('active_ids', [])
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': 'Confirm Benefit',
|
||||
'res_model': 'confirm.benefit.wizard',
|
||||
'view_mode': 'form',
|
||||
'target': 'new',
|
||||
'context': {'default_benefit_ids': active_ids}, # Pass any context you need to the wizard
|
||||
}
|
||||
|
||||
def action_open_related_move_line_records(self):
|
||||
""" Opens a tree view with related records filtered by a dynamic domain """
|
||||
move_lines = self.env['account.move.line'].search([
|
||||
|
|
|
|||
|
|
@ -103,4 +103,5 @@ access_education_classroom,access_education_classroom,model_education_classroom,
|
|||
access_education_result,access_education_result,model_education_result,,1,1,1,1
|
||||
access_study_material,access_study_material,model_study_material,,1,1,1,1
|
||||
access_suspend_reason,access_suspend_reason,model_suspend_reason,,1,1,1,1
|
||||
access_suspend_reason_wizard,access_suspend_reason_wizard,model_suspend_reason_wizard,,1,1,1,1
|
||||
access_suspend_reason_wizard,access_suspend_reason_wizard,model_suspend_reason_wizard,,1,1,1,1
|
||||
access_confirm_benefit_wizard,access_confirm_benefit_wizard,model_confirm_benefit_wizard,base.group_user,1,1,1,1
|
||||
|
|
|
@ -1085,25 +1085,16 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<odoo>
|
||||
<record id="action_confirm_beneit" model="ir.actions.server">
|
||||
<field name="name">Create Move</field>
|
||||
<field name="model_id" ref="model_grant_benefit"/>
|
||||
<field name="binding_model_id" ref="model_grant_benefit"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
action = {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': 'Confirm Benefit',
|
||||
'res_model': 'confirm.benefit.wizard',
|
||||
'view_mode': 'form',
|
||||
'view_type': 'form',
|
||||
'target': 'new',
|
||||
'context': {'active_ids': context.get('active_ids', [])},
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
<record id="action_confirm_benefit_from_list" model="ir.actions.server">
|
||||
<field name="name">Create Move</field>
|
||||
<field name="model_id" ref="model_grant_benefit"/>
|
||||
<field name="binding_model_id" ref="model_grant_benefit"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
if records:
|
||||
action = records.action_confirm_benefit()
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -15,15 +15,26 @@ class ConfirmBenefitWizard(models.TransientModel):
|
|||
date = fields.Date(string="Date", default=fields.Date.context_today, required=True)
|
||||
|
||||
def action_confirm_selected(self):
|
||||
active_ids = self.env.context.get('active_ids', [])
|
||||
active_ids = self.env.context.get('default_benefit_ids', [])
|
||||
benefits = self.env['grant.benefit'].browse(active_ids)
|
||||
|
||||
if not all(benefit.state not in ('second_approve', 'temporarily_suspend', 'suspend') for benefit in benefits):
|
||||
if any(benefit.state not in ('second_approve', 'temporarily_suspend', 'suspend') for benefit in benefits):
|
||||
raise UserError(_("All selected benefits should be either state of "
|
||||
"'second_approve','temporarily_suspend','suspend' state."))
|
||||
|
||||
validation_setting = self.env["family.validation.setting"].search([], limit=1)
|
||||
credit_account_id = self.payment_method_id.payment_account_id.id
|
||||
inbound_line_ids = self.journal_id.inbound_payment_method_line_ids.filtered(lambda l: l.payment_method_id == self.payment_method_id.id)
|
||||
outbound_line_ids = self.journal_id.outbound_payment_method_line_ids.filtered(lambda l: l.payment_method_id == self.payment_method_id.id)
|
||||
credit_account_id=False
|
||||
if not inbound_line_ids and not outbound_line_ids:
|
||||
raise UserError(_("Payment method is not configured for the selected journal."))
|
||||
if inbound_line_ids:
|
||||
credit_account_id = inbound_line_ids[0].payment_account_id.id
|
||||
if not credit_account_id and outbound_line_ids:
|
||||
credit_account_id = outbound_line_ids[0].payment_account_id.id
|
||||
|
||||
if not credit_account_id:
|
||||
raise UserError(_("Payment method is not configured for the selected journal."))
|
||||
|
||||
if benefits:
|
||||
lines = []
|
||||
|
|
|
|||
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
<odoo>
|
||||
|
||||
<record id="view_partner_property_form" model="ir.ui.view">
|
||||
<field name="name">account.sponsorship.payment.res.partner.form</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="account.view_partner_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="view_sponsorship_payment_action" class="oe_stat_button" string="Sponsorship Payment" type="object" icon="fa-dollar" attrs="{'invisible': [('is_partner_sponsor', '=', False)]}">
|
||||
<field name="is_partner_sponsor" invisible="1" />
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_partner_property_form" model="ir.ui.view">-->
|
||||
<!-- <field name="name">account.sponsorship.payment.res.partner.form</field>-->
|
||||
<!-- <field name="model">res.partner</field>-->
|
||||
<!-- <field name="inherit_id" ref="account.view_partner_property_form"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//div[@name='button_box']" position="inside">-->
|
||||
<!-- <button name="view_sponsorship_payment_action" class="oe_stat_button" string="Sponsorship Payment" type="object" icon="fa-dollar" attrs="{'invisible': [('is_partner_sponsor', '=', False)]}">-->
|
||||
<!-- <field name="is_partner_sponsor" invisible="1" />-->
|
||||
<!-- </button>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
Loading…
Reference in New Issue