[FIX] replacement and extend process from donation

This commit is contained in:
Nossibaelhadi 2025-11-19 00:39:22 +03:00
parent 8b0ab0cfdb
commit 868fcabf17
4 changed files with 56 additions and 4 deletions

View File

@ -7504,4 +7504,52 @@ msgstr "سجل الإستبدال"
msgid "Paid"
msgstr "منتهي"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_extension_payment_wizard_line__check_number
msgid "Check Number"
msgstr "رقم الشيك"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_extension_payment_wizard_line__journal_id
msgid "Journal"
msgstr "حساب الجمعية"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_extension_payment_wizard_line__partner_bank_id
msgid "Partner Bank"
msgstr "بنك المتبرع"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_extension_payment_wizard_line__payment_amount
msgid "Payment Amount"
msgstr "المبلغ"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_extension_payment_wizard_line__payment_file_attachment
msgid "Payment Attachment"
msgstr "مرفق الدفع"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_extension_payment_wizard_line__payment_method
msgid "Payment Method"
msgstr "طريقة الدفع"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_extension_payment_wizard_line__check_due_date
msgid "Check Due Date"
msgstr "تاريخ الإستحقاق"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_extension_payment_wizard_line__check_number
msgid "Check Number"
msgstr "رقم الشيك"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_donation_extension_wizard__is_different_payment
msgid "Is Different Payment"
msgstr "طرف دفع متعددة"
#. module: odex_takaful
#: model_terms:ir.ui.view,arch_db:odex_takaful.view_account_payment_register_form
msgid "Association Journal"
msgstr "حساب الجمعية"

View File

@ -157,7 +157,7 @@ class DonationsDetailsLines(models.Model):
today = fields.Date.today()
for rec in self:
show_extend_button = (
((rec.record_type == 'donation' and rec.direct_debit) or rec.record_type == 'sponsorship') and
rec.record_type == 'sponsorship' and
rec.end_date and
rec.end_date >= today and
rec.state == 'active'
@ -168,9 +168,9 @@ class DonationsDetailsLines(models.Model):
def _compute_show_replaced_button(self):
for rec in self:
show_replaced_button = (
((rec.record_type == 'donation' and rec.donation_mechanism == 'with_conditions') or rec.record_type == 'sponsorship') and
rec.state in ('active', 'paid','replace') and
(rec.benefit_id or rec.benefit_ids or rec.family_id)
rec.record_type == 'sponsorship' and
rec.state in ('active','replace') and
(rec.benefit_id or rec.benefit_ids)
)
rec.show_replaced_button = show_replaced_button

View File

@ -148,6 +148,8 @@ class SchedulingLine(models.Model):
line.sudo().write({'status': 'paid'})
if line.donation_detail_linked_id.state == 'waiting' or (not line.donation_detail_linked_id.benefit_id and line.donation_detail_linked_id.record_type == 'sponsorship'):
line.donation_detail_linked_id.sudo().write({'state': 'waiting'})
elif line.donation_detail_linked_id.record_type == 'donation':
line.donation_detail_linked_id.sudo().write({'state': 'confirmed'})
else:
line.donation_detail_linked_id.sudo().write({'state': 'active'})
line.donation_detail_linked_id.sponsorship_id.sudo().write({'state': 'wait_pay'})

View File

@ -126,6 +126,8 @@ class DonationExtensionWizard(models.TransientModel):
'journal_id': pay_line.journal_id.id,
'payment_method_id': pay_line.payment_method.id,
'communication': _("Extension Payment for %s") % inv.name,
'transaction_file_attachment': pay_line.payment_file_attachment,
}
ctx = {