[FIX] solve bugs from test5
This commit is contained in:
parent
9559a34382
commit
b2767d2ba4
|
|
@ -7658,3 +7658,11 @@ msgstr "مساهمة مالية بالأمر %s"
|
|||
#: model_terms:ir.ui.view,arch_db:odex_takaful.takaful_sponsorship_view_search
|
||||
msgid "Paid"
|
||||
msgstr "تم الدفع"
|
||||
|
||||
#. module: odex_takaful
|
||||
#: model:ir.model.fields,field_description:odex_takaful.field_account_journal__branch_ids
|
||||
msgid "Branchs"
|
||||
msgstr "الفروع المسموح بها"
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,3 +10,8 @@ class AccountPayment(models.Model):
|
|||
confirm_payment_refund_image = fields.Binary()
|
||||
payment_method_line_id_type = fields.Selection(related = 'journal_id.type')
|
||||
|
||||
|
||||
class AccountPayment(models.Model):
|
||||
_inherit = 'account.journal'
|
||||
|
||||
branch_ids = fields.Many2many('branch.settings', string="Branchs")
|
||||
|
|
@ -94,13 +94,14 @@ class FamilyMember(models.Model):
|
|||
@api.depends('member_education_status_ids', 'education_status', 'member_education_status_ids.case_study')
|
||||
def _compute_education_levels(self):
|
||||
for record in self:
|
||||
record.education_levels = (
|
||||
record.member_education_status_ids.search(
|
||||
[('case_study', '=', 'continuous')],
|
||||
order='create_date desc',
|
||||
limit=1
|
||||
).education_levels if record.education_status == 'educated' else False)
|
||||
|
||||
record.education_levels = False
|
||||
if record.education_status == 'educated':
|
||||
rec = record.member_education_status_ids.filtered(
|
||||
lambda r: r.case_study == 'continuous'
|
||||
).sorted(
|
||||
lambda r: r.create_date, reverse=True
|
||||
)[:1]
|
||||
record.education_levels = rec.education_levels if rec else False
|
||||
|
||||
@api.depends('sponsor_related_id')
|
||||
def _compute_kafala_status(self):
|
||||
|
|
|
|||
|
|
@ -32,4 +32,19 @@
|
|||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- add branch for journal account-->
|
||||
<record id="view_account_journal_form_inherit_custom" model="ir.ui.view">
|
||||
<field name="name">account.journal.form.inherit.custom</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<xpath expr="//field[@name='account_control_ids']" position="after">
|
||||
<field name="branch_ids" widget="many2many_tags"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ class AccountRegisterPayment(models.TransientModel):
|
|||
def onchange_takaful_payment_method_id(self):
|
||||
for rec in self:
|
||||
if rec.takaful_payment_method_id and rec.takaful_payment_method_id.journal_id:
|
||||
sponsorships = self.env['takaful.sponsorship'].browse(self.env.context.get('sponsorship_id'))
|
||||
branch_ids = sponsorships.mapped('branch_custom_id.id')
|
||||
rec.journal_id = rec.takaful_payment_method_id.journal_id.id
|
||||
payment_method = rec.takaful_payment_method_id.payment_method
|
||||
j_type = ""
|
||||
|
|
@ -76,7 +78,7 @@ class AccountRegisterPayment(models.TransientModel):
|
|||
elif payment_method in ("bank", "check","network"):
|
||||
j_type = "bank"
|
||||
if j_type:
|
||||
return {"domain": {"journal_id": [("type", "=", j_type)]}}
|
||||
return {"domain": {"journal_id": [("type", "=", j_type), ("branch_ids", "in", branch_ids)]}}
|
||||
|
||||
|
||||
@api.depends('source_amount', 'source_amount_currency', 'source_currency_id', 'company_id', 'currency_id', 'payment_date')
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ class DonationExtensionWizard(models.TransientModel):
|
|||
donation_line_ids += result[1]
|
||||
|
||||
if invoice_ids:
|
||||
sponsorship_id = self.line_ids.mapped('donation_line_id.sponsorship_mechanism_id.id')
|
||||
return {
|
||||
'name': _('Register Payment'),
|
||||
'res_model': 'account.payment.register',
|
||||
|
|
@ -128,7 +129,8 @@ class DonationExtensionWizard(models.TransientModel):
|
|||
'sponsorship_line_ids': self.line_ids.donation_line_id.ids,
|
||||
'sponsorship_payment': True,
|
||||
'default_sponsorship_payment': True,
|
||||
'wiz_id': self.id
|
||||
'wiz_id': self.id,
|
||||
'sponsorship_id': sponsorship_id,
|
||||
# 'force_sponsorship_line_partner_id': self.donation_detail_id.sponsor_id.id,
|
||||
},
|
||||
'target': 'new',
|
||||
|
|
|
|||
Loading…
Reference in New Issue