Merge branch 'dev_odex25_takaful' of https://github.com/expsa/odex25-standard-modules into esterdad_bugs
This commit is contained in:
commit
731be55e37
|
|
@ -31,6 +31,7 @@ jobs:
|
|||
github.actor == 'abdurrahman-saber' ||
|
||||
github.actor == 'altexp' ||
|
||||
github.actor == 'kchyounes19' ||
|
||||
github.actor == 'maltayyar2' ||
|
||||
github.actor == 'mohammed-alkhazrji')
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
|
|
@ -59,6 +60,7 @@ jobs:
|
|||
github.actor == 'abdurrahman-saber' ||
|
||||
github.actor == 'altexp' ||
|
||||
github.actor == 'kchyounes19' ||
|
||||
github.actor == 'maltayyar2' ||
|
||||
github.actor == 'mohammed-alkhazrji')
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
|
|
@ -87,6 +89,7 @@ jobs:
|
|||
github.actor == 'abdurrahman-saber' ||
|
||||
github.actor == 'altexp' ||
|
||||
github.actor == 'kchyounes19' ||
|
||||
github.actor == 'maltayyar2' ||
|
||||
github.actor == 'mohammed-alkhazrji')
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
|
|
@ -116,6 +119,7 @@ jobs:
|
|||
github.actor == 'abdurrahman-saber' ||
|
||||
github.actor == 'altexp' ||
|
||||
github.actor == 'kchyounes19' ||
|
||||
github.actor == 'maltayyar2' ||
|
||||
github.actor == 'mohammed-alkhazrji')
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
|
|
@ -144,6 +148,7 @@ jobs:
|
|||
github.actor == 'abdurrahman-saber' ||
|
||||
github.actor == 'altexp' ||
|
||||
github.actor == 'kchyounes19' ||
|
||||
github.actor == 'maltayyar2' ||
|
||||
github.actor == 'mohammed-alkhazrji')
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
|
|
@ -172,6 +177,7 @@ jobs:
|
|||
github.actor == 'abdurrahman-saber' ||
|
||||
github.actor == 'altexp' ||
|
||||
github.actor == 'kchyounes19' ||
|
||||
github.actor == 'maltayyar2' ||
|
||||
github.actor == 'mohammed-alkhazrji')
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
|
|
@ -199,6 +205,7 @@ jobs:
|
|||
github.actor == 'abdurrahman-saber' ||
|
||||
github.actor == 'altexp' ||
|
||||
github.actor == 'kchyounes19' ||
|
||||
github.actor == 'maltayyar2' ||
|
||||
github.actor == 'mohammed-alkhazrji')
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
|
|
@ -227,6 +234,7 @@ jobs:
|
|||
github.actor == 'abdurrahman-saber' ||
|
||||
github.actor == 'altexp' ||
|
||||
github.actor == 'kchyounes19' ||
|
||||
github.actor == 'maltayyar2' ||
|
||||
github.actor == 'mohammed-alkhazrji')
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ __pycache__/
|
|||
# C extensions
|
||||
*.so
|
||||
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from . import _cart_change
|
||||
from . import report_api
|
||||
from . import takaful_api
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
from odoo import http
|
||||
from odoo.http import request
|
||||
|
||||
class PartnerBankController(http.Controller):
|
||||
|
||||
@http.route('/api/create_partner_bank', type='json', auth='user', methods=['POST'], csrf=False)
|
||||
def create_partner_bank(self, **kwargs):
|
||||
# In Odoo JSON-RPC with type='json', params are passed as keyword arguments
|
||||
# Try kwargs first (standard Odoo JSON-RPC behavior)
|
||||
partner_id = kwargs.get('partner_id')
|
||||
bank_id = kwargs.get('bank_id')
|
||||
acc_number = kwargs.get('acc_number')
|
||||
|
||||
# Fallback to request.jsonrequest if not in kwargs
|
||||
# (request.jsonrequest contains params directly in Odoo JSON-RPC)
|
||||
if not partner_id and request.jsonrequest:
|
||||
data = request.jsonrequest
|
||||
partner_id = partner_id or data.get('partner_id')
|
||||
bank_id = bank_id or data.get('bank_id')
|
||||
acc_number = acc_number or data.get('acc_number')
|
||||
|
||||
if not partner_id:
|
||||
return {'error': 'partner_id is required'}
|
||||
|
||||
if not bank_id:
|
||||
return {'error': 'bank_id is required'}
|
||||
|
||||
if not acc_number:
|
||||
return {'error': 'acc_number is required'}
|
||||
|
||||
partner = request.env['res.partner'].sudo().browse(int(partner_id))
|
||||
if not partner.exists():
|
||||
return {'error': 'Partner not found'}
|
||||
|
||||
bank = request.env['res.bank'].sudo().browse(int(bank_id))
|
||||
if not bank.exists():
|
||||
return {'error': 'Bank not found'}
|
||||
|
||||
partner_bank = request.env['res.partner.bank'].sudo().create({
|
||||
'partner_id': partner.id,
|
||||
'bank_id': bank.id,
|
||||
'acc_number': acc_number,
|
||||
})
|
||||
|
||||
return {
|
||||
'success': True,
|
||||
'bank_account_id': partner_bank.id
|
||||
}
|
||||
|
|
@ -978,10 +978,7 @@ msgstr "عدد المستفيدين"
|
|||
#, fuzzy
|
||||
msgid "Total Months Amount"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"اجمالي مبلغ الشهور\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"اجمالي الشهور"
|
||||
"اجمالي مبلغ الشهور"
|
||||
|
||||
#. module: odex_takaful
|
||||
#: model:ir.model.fields.selection,name:odex_takaful.selection__benefit_wiz__report_type__benefit_month
|
||||
|
|
@ -1324,10 +1321,7 @@ msgstr ""
|
|||
#, fuzzy
|
||||
msgid "Closed"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"مغلق\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"ملغي"
|
||||
"مغلق"
|
||||
|
||||
#. module: odex_takaful
|
||||
#: model:ir.model.fields,field_description:odex_takaful.field_month_payment__code
|
||||
|
|
@ -2085,10 +2079,7 @@ msgstr "متبرع"
|
|||
#, fuzzy
|
||||
msgid "Donor Information"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"بيانات المتبرع\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"معلومات المتبرع"
|
||||
"بيانات المتبرع"
|
||||
|
||||
#. module: odex_takaful
|
||||
#: model:ir.model.fields.selection,name:odex_takaful.selection__month_payment__state__draft
|
||||
|
|
@ -2253,10 +2244,7 @@ msgstr "انتهاء العضوية"
|
|||
#, fuzzy
|
||||
msgid "Extend"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"تمديد\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"تمديد/دفع"
|
||||
"تمديد"
|
||||
|
||||
#. module: odex_takaful
|
||||
#: code:addons/odex_takaful/models/donation_details_lines.py:0
|
||||
|
|
@ -3229,12 +3217,7 @@ msgstr "تاريخ الانضمام"
|
|||
#, fuzzy
|
||||
msgid "Journal"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"دفتر اليومية\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"بنك الجمعية\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"حساب الجمعية"
|
||||
"بنك الجمعية"
|
||||
|
||||
#. module: odex_takaful
|
||||
#: model:ir.model,name:odex_takaful.model_account_move
|
||||
|
|
@ -4394,9 +4377,6 @@ msgstr "متأخر في سداد الكفالة بنسبة إجمالية %s"
|
|||
#, fuzzy
|
||||
msgid "Paid"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"تم الدفع\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"منتهي"
|
||||
|
||||
#. module: odex_takaful
|
||||
|
|
@ -5517,9 +5497,6 @@ msgstr "عذرا، لا توجد نتائج لهذا الاختيار!"
|
|||
#, fuzzy, python-format
|
||||
msgid "Sponsor"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"المستفيد\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"كافل"
|
||||
|
||||
#. module: odex_takaful
|
||||
|
|
@ -5608,11 +5585,6 @@ msgstr "جوال المتبرع"
|
|||
#, fuzzy
|
||||
msgid "Sponsor Name"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"اسم الكافل\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"إسم المهدى له\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"اسم الكافل/المتبرع"
|
||||
|
||||
#. module: odex_takaful
|
||||
|
|
@ -5814,9 +5786,6 @@ msgstr "نوع الكفالة"
|
|||
#, fuzzy
|
||||
msgid "Sponsorship End Date"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"تاريخ انتهاء الكفالة\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"تاريخ إنتهاء الكفالة"
|
||||
|
||||
#. module: odex_takaful
|
||||
|
|
@ -6500,9 +6469,6 @@ msgstr "الإجمالي المستحق"
|
|||
#, fuzzy
|
||||
msgid "Total Extension Amount"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"المبلغ الإجمالي\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"إجمالي مبلغ الدفع"
|
||||
|
||||
#. module: odex_takaful
|
||||
|
|
@ -6943,9 +6909,6 @@ msgstr "أرملة مع أيتامها؟"
|
|||
#, fuzzy
|
||||
msgid "Widows"
|
||||
msgstr ""
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"أرملة\n"
|
||||
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
|
||||
"أم الايتام"
|
||||
|
||||
#. module: odex_takaful
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class DonationsDetailsLines(models.Model):
|
|||
donation_qty = fields.Float(string='Donation QTY', default=1)
|
||||
donation_mechanism = fields.Selection(
|
||||
[('with_conditions', _('With Conditions')), ('without_conditions', _('Without Conditions'))],
|
||||
string='Donation Mechanism', readonly=True)
|
||||
string='Donation Mechanism', compute='_compute_donation_mechanism', store=True, readonly=True)
|
||||
benefit_type = fields.Selection([('orphan', 'Orphans'), ('widow', 'Widows'), ('both', 'Both')],
|
||||
string='Sponsorship Beneficiary Type', tracking=True, default="both")
|
||||
sponsorship_type = fields.Selection([('person', 'Individual'), ('group', 'Group')], string='Sponsorship Type',
|
||||
|
|
@ -72,7 +72,7 @@ class DonationsDetailsLines(models.Model):
|
|||
sponsorships_computed = fields.Boolean(copy=False, readonly=True)
|
||||
direct_debit = fields.Boolean(string='Direct Debit')
|
||||
benefit_id_number = fields.Char("Benefit ID Number")
|
||||
benefit_family_code = fields.Char("Benefit Family Code")
|
||||
benefit_family_code = fields.Char("Benefit Family Code", compute='_compute_family_code', store=True, readonly=True)
|
||||
editable = fields.Boolean(string="Editable", default=True) # To differentiate
|
||||
direct_debit_partner_bank_id = fields.Many2one("res.partner.bank", string="Direct Debit Partner Bank", domain="[('partner_id', '=', sponsor_id)]")
|
||||
sponsor_id = fields.Many2one('res.partner', compute='_compute_sponsor_id', store=True, readonly=True)
|
||||
|
|
@ -290,7 +290,7 @@ class DonationsDetailsLines(models.Model):
|
|||
rec.end_date and
|
||||
rec.end_date >= today and
|
||||
rec.state == 'active'
|
||||
and rec.sponsorship_id.state in ['canceled' , 'closed']
|
||||
and rec.sponsorship_id.state not in ['canceled' , 'closed']
|
||||
)
|
||||
rec.show_extend_button = show_extend_button
|
||||
|
||||
|
|
@ -703,7 +703,7 @@ class DonationsDetailsLines(models.Model):
|
|||
rec.total_donation_amount = rec.total_months_amount * (rec.benefits_count or 1)
|
||||
|
||||
@api.depends('record_type', 'benefit_id')
|
||||
def _compute_family_id(self):
|
||||
def _compute_family_code(self):
|
||||
for rec in self:
|
||||
if rec.family_id:
|
||||
rec.benefit_family_code = rec.family_id.code
|
||||
|
|
@ -878,13 +878,21 @@ class DonationsDetailsLines(models.Model):
|
|||
'product_template_id': domain}
|
||||
}
|
||||
|
||||
|
||||
@api.onchange('donation_type')
|
||||
def onchange_donation_type(self):
|
||||
@api.depends('donation_type', 'sponsorship_mechanism_id', 'sponsorship_id')
|
||||
def _compute_donation_mechanism(self):
|
||||
for rec in self:
|
||||
if rec.donation_type == 'sponsorship':
|
||||
rec.donation_mechanism = 'with_conditions'
|
||||
|
||||
elif rec.donation_type == 'donation':
|
||||
if rec.sponsorship_mechanism_id:
|
||||
rec.donation_mechanism = 'with_conditions'
|
||||
elif rec.sponsorship_id:
|
||||
rec.donation_mechanism = 'without_conditions'
|
||||
|
||||
else:
|
||||
rec.donation_mechanism = False
|
||||
|
||||
def compute_sponsorships_lines(self):
|
||||
for rec in self:
|
||||
rec.write({'sponsorship_scheduling_line_ids': [(5, 0, 0)]})
|
||||
|
|
|
|||
|
|
@ -950,7 +950,7 @@ class TakafulSponsorship(models.Model):
|
|||
Clears the One2many field when record_type is changed and data exists in the other field.
|
||||
"""
|
||||
if self.record_type == 'sponsorship':
|
||||
self.donation_mechanism = False
|
||||
self.donation_mechanism = 'with_conditions'
|
||||
elif self.record_type == 'donation':
|
||||
self.donation_mechanism = 'without_conditions'
|
||||
|
||||
|
|
|
|||
|
|
@ -8,23 +8,32 @@
|
|||
<!-- Reuse sale order header layout -->
|
||||
<t t-call="sale_order_report.sale_order_report_header">
|
||||
|
||||
<div class="page" style="position: relative;">
|
||||
<div class="page" style="position: relative; min-height: 800px; overflow: visible;">
|
||||
<!-- Watermark for canceled sponsorships -->
|
||||
<t t-if="doc.state == 'canceled'">
|
||||
<div style="position: absolute;
|
||||
inset: 0;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: red;
|
||||
font-size: 5rem;
|
||||
opacity: 0.1;
|
||||
transform: rotate(35deg);
|
||||
transform-origin: center;
|
||||
z-index: 0;
|
||||
top: 300px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: calc(100% - 250px);
|
||||
display: table;
|
||||
z-index: 999;
|
||||
pointer-events: none;">
|
||||
Canceled
|
||||
<div style="display: table-cell; vertical-align: middle; text-align: center;">
|
||||
<span style="color: #FAD3D4;
|
||||
font-size: 280px;
|
||||
opacity: 0.5;
|
||||
-webkit-transform: rotate(-35deg);
|
||||
-moz-transform: rotate(-35deg);
|
||||
transform: rotate(-35deg);
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
display: inline-block;">
|
||||
ملغي
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@
|
|||
<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)]}"/>
|
||||
<!-- <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)]}"/>-->
|
||||
<button name="action_set_esterdad" type="object"
|
||||
string="طلب الاسترداد" class="oe_highlight"
|
||||
attrs="{'invisible': ['|',('state','not in',['paid','partial_refund','under_replacement','replacement_done']), ('cancel_refund', '=', True)]}"/>
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class AccountRegisterPayment(models.TransientModel):
|
|||
state = 'paid'
|
||||
elif line.record_type == 'donation':
|
||||
if line.donation_mechanism == 'with_conditions':
|
||||
state = 'active'
|
||||
state = 'paid'
|
||||
else:
|
||||
state = 'paid'
|
||||
line.write({'state': state})
|
||||
|
|
|
|||
Loading…
Reference in New Issue