Merge pull request #5997 from expsa/fix_bugs

Fix bugs
This commit is contained in:
NossibaElhadi 2026-01-06 01:24:02 +03:00 committed by GitHub
commit e64a78d370
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 72 additions and 17 deletions

View File

@ -4454,7 +4454,7 @@ msgstr "متأخر في سداد الكفالة بنسبة إجمالية %s"
#: model_terms:ir.ui.view,arch_db:odex_takaful.takaful_sponsorship_view_search
#: model_terms:ir.ui.view,arch_db:odex_takaful.view_sponsorship_scheduling_line_search
msgid "Paid"
msgstr "منتهي"
msgstr "تم الدفع"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_donation_extension_wizard__paid_amount
@ -7380,3 +7380,14 @@ msgstr "وسيلة الدفع"
#: model_terms:ir.ui.view,arch_db:odex_takaful.report_sponsorship_receipt_document
msgid "ونتشرف دائما باستقبال عطائك المستمر لدعم أبنائكم الأيتام."
msgstr "ونتشرف دائما باستقبال عطائك المستمر لدعم أبنائكم الأيتام."
#. module: odex_takaful
#: model_terms:ir.ui.view,arch_db:odex_takaful.takaful_sponsorship_form
msgid "Print Sponsorship Receipt"
msgstr "طباعة السند"
#. module: odex_takaful
#: model:ir.actions.report,name:odex_takaful.takaful_sponsorship_receipt_report
#: model:res.groups,name:odex_takaful.group_print_receipt
msgid "Sponsorship Receipt"
msgstr "طباعة السند"

View File

@ -1447,6 +1447,7 @@ class TakafulSponsorship(models.Model):
if self.sponsor_or_donor_type in ["registered", "new_sponsor"]:
partner_id = self.sponsor_id
elif self.sponsor_or_donor_type == "unknown":
self.sponsor_id = faal_kheer_partner_id
partner_id = faal_kheer_partner_id
else:
partner_id = faal_kheer_partner_id
@ -1562,6 +1563,12 @@ class TakafulSponsorship(models.Model):
datas = dict(self.env.context)
return self.env.ref('odex_takaful.makfuleen_report_pdf_act').report_action(self, data=datas)
def action_print_sponsorship_receipt(self):
self.ensure_one()
return self.env.ref(
'odex_takaful.takaful_sponsorship_receipt_report'
).report_action(self)
# @api.multi
def process_sponsor_payments_scheduler(self):
domain = []

View File

@ -140,6 +140,12 @@
<field name="name">Kufula User</field>
<field name="category_id" ref="module_category_kufula"/>
</record>
<odoo>
<record id="group_print_receipt" model="res.groups">
<field name="name">Sponsorship Receipt</field>
<field name="category_id" ref="module_category_kufula"/>
</record>
</odoo>
<record id="donation_officer_group" model="res.groups">
<field name="name">Donations Officer</field>

View File

@ -33,15 +33,28 @@
menu="False" />
<!-- Sponsorship receipt report directly on takaful.sponsorship -->
<report
id="takaful_sponsorship_receipt_report"
model="takaful.sponsorship"
string="Sponsorship Receipt"
report_type="qweb-pdf"
name="odex_takaful.report_sponsorship_receipt_document"
file="odex_takaful.report_sponsorship_receipt_document"
print_report_name="(object.code and ('Sponsorship Receipt - %s' % (object.code,))) or 'Sponsorship Receipt'"
/>
<!-- Sponsorship receipt report -->
<!-- <report-->
<!-- id="takaful_sponsorship_receipt_report"-->
<!-- model="takaful.sponsorship"-->
<!-- string="Sponsorship Receipt"-->
<!-- report_type="qweb-pdf"-->
<!-- name="odex_takaful.report_sponsorship_receipt_document"-->
<!-- file="odex_takaful.report_sponsorship_receipt_document"-->
<!-- print_report_name="(object.code and ('Sponsorship Receipt - %s' % (object.code,))) or 'Sponsorship Receipt'"-->
<!-- />-->
<record id="takaful_sponsorship_receipt_report" model="ir.actions.report">
<field name="name">Sponsorship Receipt</field>
<field name="model">takaful.sponsorship</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">odex_takaful.report_sponsorship_receipt_document</field>
<field name="report_file">odex_takaful.report_sponsorship_receipt_document</field>
<field name="print_report_name">
(object.code and ('Sponsorship Receipt - %s' % (object.code,))) or 'Sponsorship Receipt'
</field>
<field name="groups_id" eval="[(6, 0, [ref('odex_takaful.group_print_receipt')])]"/>
</record>
</data>
</odoo>

View File

@ -49,12 +49,22 @@
attrs="{'invisible': True}"/>
<!-- attrs="{'invisible': [('state','not in',['confirmed'])]}"-->
<button
name="action_print_sponsorship_receipt"
type="object"
string="Print Sponsorship Receipt"
class="btn-primary"
icon="fa-print"
attrs="{'invisible': [('state','in',('draft', 'confirmed'))]}"
groups="odex_takaful.group_print_receipt"
/>
<button name="action_reset_to_draft" type="object"
string="Reset to Draft" class="btn-link"
attrs="{'invisible': [('state','!=','confirmed')]}"/>
<button name="action_set_close" type="object"
string="Close" class="oe_highlight"
attrs="{'invisible': [('state', 'not in', ['wait_pay', 'paid'])]}"/>
<!-- <button name="action_set_close" type="object"-->
<!-- string="Close" class="oe_highlight"-->
<!-- attrs="{'invisible': [('state', 'not in', ['wait_pay', 'paid'])]}"/>-->
<!-- <button name="action_refund" type="object"-->
<!-- string="Refund All" class="oe_highlight"-->
<!-- attrs="{'invisible': ['|','|',('state','not in',['paid','partial_refund','under_replacement','replacement_done']),('record_type','!=','donation'), ('cancel_refund', '=', True)]}"/>-->
@ -65,9 +75,9 @@
class="oe_highlight"
attrs="{'invisible': [ '|', ('record_type', '!=', 'donation'), ('state', '!=', 'approve_refund')]}"
groups="odex_takaful.group_refund_approval"/>
<button string="Send By Email" name="action_quotation_send" type="object"
class="oe_highlight" attrs="{'invisible': [ ('state', '=', 'draft')]}"
groups="odex_takaful.group_refund_approval"/>
<!-- <button string="Send By Email" name="action_quotation_send" type="object"-->
<!-- class="oe_highlight" attrs="{'invisible': [ ('state', '=', 'draft')]}"-->
<!-- groups="odex_takaful.group_refund_approval"/>-->
<field name="state" widget="statusbar"
statusbar_visible="draft,confirmed,wait_pay,paid,canceled,closed"/>
@ -171,6 +181,7 @@
attrs="{'invisible': [('record_type','!=','donation')], 'required': [('record_type','=','donation')], 'readonly': [('state','!=','draft')]}"/>
<field name="sponsor_donor_type"
attrs="{'invisible': [('record_type','!=','sponsorship')], 'required': [('record_type','=','sponsorship')], 'readonly': [('state','!=','draft')]}"/>
</div>
<label string="اسم الكافل/المتبرع" for="sponsor_id"
@ -209,6 +220,13 @@
]
}"/>
</div>
<field name="sponsor_name" attrs="{
'invisible': ['|',
'&amp;', ('record_type','=','donation'), ('sponsor_or_donor_type','!=','unknown'),
'&amp;', ('record_type','=','sponsorship'), ('sponsor_donor_type','!=','unknown')
],
'readonly': [('state','!=','draft')]
}"/>
<field name="sponsor_phone" string="رقم الجوال" widget="phone"
attrs="{

View File

@ -86,7 +86,7 @@
<field name="payment_method" invisible="1"/>
<field name="check_number" attrs="{'invisible': ['|', ('sponsorship_payment', '=', False), ('takaful_payment_method','!=','check')], 'required': [('sponsorship_payment', '=', True), ('takaful_payment_method','=','check')]}"/>
<field name="check_due_date" attrs="{'invisible': ['|', ('sponsorship_payment', '=', False), ('takaful_payment_method','!=','check')], 'required': [('sponsorship_payment', '=', True), ('takaful_payment_method','=','check')]}"/>
<field name="partner_bank_id" string="Donor Bank Account" options="{'skip_disable_quick_create': True}" context="{'form_view_ref': 'odex_takaful.res_partner_bank_view_form_quick_create', 'default_partner_id': context.get('force_sponsorship_line_partner_id')}" attrs="{'required': [('sponsorship_payment', '=', True), ('takaful_payment_method','=','bank')], 'invisible': ['|', ('sponsorship_payment', '=', False), ('takaful_payment_method','!=','bank')]}" create="1" edit="1"/>
<field name="partner_bank_id" string="Donor Bank Account" options="{'skip_disable_quick_create': True}" context="{'form_view_ref': 'odex_takaful.res_partner_bank_view_form_quick_create', 'default_partner_id': context.get('force_sponsorship_line_partner_id')}" attrs="{'required': [('sponsorship_payment', '=', True), ('takaful_payment_method','not in',('bank','check'))], 'invisible': ['|', ('sponsorship_payment', '=', False), ('takaful_payment_method','not',('bank','check'))]}" create="1" edit="1"/>
<field name="transaction_file_attachment" widget="binary"
filename="transaction_attachment_file_name"
attrs="{'invisible': ['|', ('sponsorship_payment', '=', False), ('takaful_payment_method','not in',['bank', 'check'])], 'required': [('sponsorship_payment', '=', True), ('takaful_payment_method','=','bank')]}"/>