[I18N] odex_takaful: automatic update
Auto-generated commit based on local changes.
This commit is contained in:
parent
dcd256e85f
commit
dd7ab6be20
|
|
@ -18,6 +18,7 @@
|
|||
# 'analytic_account',
|
||||
],
|
||||
'data': [
|
||||
'data/payment_methods_ar.xml',
|
||||
'security/security_data.xml',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
|
|
@ -90,6 +91,9 @@
|
|||
'reports/transfer_deduction_report.xml',
|
||||
'reports/transfer_deduction_report_templates.xml',
|
||||
],
|
||||
'qweb': [
|
||||
'static/src/xml/takaful_dashboard.xml',
|
||||
],
|
||||
'icon': 'static/description/icon.png',
|
||||
# 'installable': True,
|
||||
# 'application': True,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="0">
|
||||
<!-- Force update Payment Method Names to Arabic -->
|
||||
|
||||
<!-- Cash -> نقدي -->
|
||||
<function model="takaful.payment.method" name="write">
|
||||
<value model="takaful.payment.method" search="[('payment_method', '=', 'cash')]"/>
|
||||
<value eval="{'name': 'نقدي'}"/>
|
||||
</function>
|
||||
|
||||
<!-- Bank Transfer -> تحويل بنكي -->
|
||||
<function model="takaful.payment.method" name="write">
|
||||
<value model="takaful.payment.method" search="[('payment_method', '=', 'bank')]"/>
|
||||
<value eval="{'name': 'تحويل بنكي'}"/>
|
||||
</function>
|
||||
|
||||
<!-- Direct Debit -> استقطاع -->
|
||||
<function model="takaful.payment.method" name="write">
|
||||
<value model="takaful.payment.method" search="[('payment_method', '=', 'direct_debit')]"/>
|
||||
<value eval="{'name': 'استقطاع'}"/>
|
||||
</function>
|
||||
|
||||
<!-- Check -> شيك -->
|
||||
<function model="takaful.payment.method" name="write">
|
||||
<value model="takaful.payment.method" search="[('payment_method', '=', 'check')]"/>
|
||||
<value eval="{'name': 'شيك'}"/>
|
||||
</function>
|
||||
|
||||
<!-- Network -> شبكة -->
|
||||
<function model="takaful.payment.method" name="write">
|
||||
<value model="takaful.payment.method" search="[('payment_method', '=', 'network')]"/>
|
||||
<value eval="{'name': 'شبكة'}"/>
|
||||
</function>
|
||||
</data>
|
||||
</odoo>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -60,7 +60,7 @@ class DonationsDetailsLines(models.Model):
|
|||
string='Sponsorship Type', default="temporary")
|
||||
start_date = fields.Date(string="Sponsorship Start Date", copy=False, default=fields.Date.today())
|
||||
end_date = fields.Date(string="Sponsorship End Date", compute='_compute_end_date', store=True)
|
||||
payment_option = fields.Selection([('month', 'Monthly'), ('once', 'For Once')], string='Payment Option')
|
||||
payment_option = fields.Selection([('month', 'Monthly'), ('once', 'For Once')], string='Payment Option', default='once')
|
||||
payment_month_count = fields.Integer(string='Payment Month Count', default=1)
|
||||
payment_month_count_visibility = fields.Boolean(compute="_compute_payment_month_count_visibility")
|
||||
fixed_value = fields.Boolean(string='Is Fixed Value?', related='product_template_id.fixed_value')
|
||||
|
|
@ -129,6 +129,14 @@ class DonationsDetailsLines(models.Model):
|
|||
compute="_compute_direct_debit_filter", store=True,
|
||||
)
|
||||
|
||||
payment_method_display = fields.Many2one(
|
||||
'takaful.payment.method',
|
||||
string='Payment Method',
|
||||
compute='_compute_payment_method_display',
|
||||
store=True
|
||||
)
|
||||
payment_method_type = fields.Selection(related='payment_method_display.payment_method', string='Payment Method Type', store=True)
|
||||
|
||||
|
||||
@api.onchange('family_id')
|
||||
def onchange_family_id(self):
|
||||
|
|
@ -197,6 +205,48 @@ class DonationsDetailsLines(models.Model):
|
|||
def _compute_period_display(self):
|
||||
today = date.today()
|
||||
for rec in self:
|
||||
period_display = ""
|
||||
if rec.waiting_date:
|
||||
delta = rec.waiting_date - today
|
||||
if delta.days > 0:
|
||||
period_display = str(delta.days) + " Days"
|
||||
else:
|
||||
period_display = "Expired"
|
||||
elif rec.end_date:
|
||||
delta = rec.end_date - today
|
||||
if delta.days > 0:
|
||||
period_display = str(delta.days) + " Days"
|
||||
else:
|
||||
period_display = "Expired"
|
||||
rec.period_display = period_display
|
||||
|
||||
@api.depends('direct_debit', 'sponsorship_id', 'sponsorship_mechanism_id')
|
||||
def _compute_payment_method_display(self):
|
||||
for rec in self:
|
||||
method = False
|
||||
# 1. Check Direct Debit first
|
||||
if rec.direct_debit:
|
||||
dd_method = self.env['takaful.payment.method'].search([('payment_method', '=', 'direct_debit')], limit=1)
|
||||
if dd_method:
|
||||
method = dd_method.id
|
||||
|
||||
# 2. If not Direct Debit, check related Payments
|
||||
if not method:
|
||||
sponsorship_id = rec.sponsorship_id.id or rec.sponsorship_mechanism_id.id
|
||||
if sponsorship_id:
|
||||
# Find latest posted payment for this sponsorship
|
||||
# We use the related field 'takaful_sponsorship_id' on account.payment which is computed from the move
|
||||
payment = self.env['account.payment'].search([
|
||||
('takaful_sponsorship_id', '=', sponsorship_id),
|
||||
('state', '=', 'posted')
|
||||
], order='date desc', limit=1)
|
||||
|
||||
if payment and payment.journal_id:
|
||||
payment_method = self.env['takaful.payment.method'].search([('journal_id', '=', payment.journal_id.id)], limit=1)
|
||||
if payment_method:
|
||||
method = payment_method.id
|
||||
|
||||
rec.payment_method_display = method
|
||||
|
||||
# pick whichever date is set
|
||||
if rec.state == 'replace' :
|
||||
|
|
|
|||
|
|
@ -253,22 +253,21 @@ class ResPartner(models.Model):
|
|||
|
||||
def _compute_operation_count(self):
|
||||
# Get operation_count
|
||||
operation_count = self.env['takaful.sponsor.operation'].sudo().search_count([('sponsor_id', '=', self.id)])
|
||||
|
||||
if operation_count >0:
|
||||
self.operation_count = operation_count
|
||||
else:
|
||||
self.operation_count = 0
|
||||
|
||||
for record in self:
|
||||
operation_count = self.env['takaful.sponsor.operation'].sudo().search_count([('sponsor_id', '=', record.id)])
|
||||
if operation_count > 0:
|
||||
record.operation_count = operation_count
|
||||
else:
|
||||
record.operation_count = 0
|
||||
|
||||
def _compute_kafalat_count(self):
|
||||
# Get kafalat
|
||||
kafalat_count = self.env['takaful.sponsorship'].sudo().search_count([('sponsor_id', '=', self.id)])
|
||||
|
||||
if kafalat_count >0:
|
||||
self.kafalat_count = kafalat_count
|
||||
else:
|
||||
self.kafalat_count = 0
|
||||
for record in self:
|
||||
kafalat_count = self.env['takaful.sponsorship'].sudo().search_count([('sponsor_id', '=', record.id)])
|
||||
if kafalat_count > 0:
|
||||
record.kafalat_count = kafalat_count
|
||||
else:
|
||||
record.kafalat_count = 0
|
||||
|
||||
def _compute_contribution_count(self):
|
||||
# The current user may not have access rights for contributions.
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ from odoo import models, fields, api, _
|
|||
class TakafulPaymentMethod(models.Model):
|
||||
_name = 'takaful.payment.method'
|
||||
|
||||
name = fields.Char(required=True)
|
||||
name = fields.Char(required=True, translate=True)
|
||||
payment_method = fields.Selection([
|
||||
("cash", "Cash"),
|
||||
("bank", "Bank Transfer"),
|
||||
("direct_debit", "Direct Debit"),
|
||||
("check", "Check"),
|
||||
("network", "Network"),
|
||||
("cash", "نقدي"),
|
||||
("bank", "تحويل بنكي"),
|
||||
("direct_debit", "استقطاع"),
|
||||
("check", "شيك"),
|
||||
("network", "شبكة"),
|
||||
], required=True)
|
||||
|
||||
journal_id = fields.Many2one('account.journal', string="Journal", required=True)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from odoo import models, fields, api, _, exceptions
|
||||
from datetime import datetime, date
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from odoo.tools.misc import format_amount
|
||||
from odoo import SUPERUSER_ID
|
||||
from odoo.exceptions import UserError, ValidationError, Warning
|
||||
|
||||
|
|
@ -96,6 +98,14 @@ class TakafulSponsorship(models.Model):
|
|||
)
|
||||
|
||||
has_needs = fields.Boolean(store=True)
|
||||
payment_method_display = fields.Many2one(
|
||||
'takaful.payment.method',
|
||||
string='Payment Method',
|
||||
compute='_compute_payment_method_display',
|
||||
store=True
|
||||
)
|
||||
payment_method_type = fields.Selection(related='payment_method_display.payment_method', string='Payment Method Type', store=True)
|
||||
|
||||
donations_details_lines = fields.One2many(
|
||||
'donations.details.lines',
|
||||
'sponsorship_id',
|
||||
|
|
@ -120,7 +130,7 @@ class TakafulSponsorship(models.Model):
|
|||
refund_move_count = fields.Integer(compute="_compute_refund_move_count")
|
||||
related_move_lines_records_count = fields.Integer(compute="_compute_related_move_lines_records")
|
||||
refund_details_lines_ids = fields.One2many('refund.details.lines', 'sponsorship_id')
|
||||
donation_mechanism = fields.Selection([('with_conditions', 'With Conditions'),('without_conditions', 'Without Conditions')],string='Donation Mechanism', default='without_conditions')
|
||||
donation_mechanism = fields.Selection([('with_conditions', 'مشروط'),('without_conditions', 'غير مشروط')],string='Donation Mechanism', default='without_conditions')
|
||||
donations_count = fields.Integer(compute="_compute_donation_count", string="Donations Count")
|
||||
cancel_refund = fields.Boolean(string='Cancel Refund Time', compute="compute_days_after_payment")
|
||||
replaced = fields.Boolean('Replaced')
|
||||
|
|
@ -137,6 +147,88 @@ class TakafulSponsorship(models.Model):
|
|||
store=False
|
||||
)
|
||||
|
||||
|
||||
@api.model
|
||||
def retrieve_dashboard(self):
|
||||
""" This function returns the values to populate the custom dashboard in
|
||||
the takaful sponsorship views.
|
||||
"""
|
||||
self.check_access_rights('read')
|
||||
|
||||
result = {
|
||||
'all_sponsorships': 0,
|
||||
'all_conditional': 0,
|
||||
'all_unconditional': 0,
|
||||
'my_sponsorships': 0,
|
||||
'my_conditional': 0,
|
||||
'my_unconditional': 0,
|
||||
'all_avg_amount': 0,
|
||||
'all_avg_days_to_pay': 0,
|
||||
'all_total_last_7_days': 0,
|
||||
'all_new_last_7_days': 0,
|
||||
'company_currency_symbol': self.env.company.currency_id.symbol or self.env.company.currency_id.name or 'SAR'
|
||||
}
|
||||
|
||||
# Easy counts
|
||||
Sponsorship = self.env['takaful.sponsorship']
|
||||
uid = self.env.uid
|
||||
|
||||
# All Records - Sponsorships vs Conditional/Unconditional
|
||||
# CORRECT LOGIC (per user clarification):
|
||||
# - Sponsorships: record_type='sponsorship' (5 records)
|
||||
# - Conditional: record_type='donation' AND donation_mechanism='with_conditions' (1 record)
|
||||
# - Unconditional: record_type='donation' AND donation_mechanism='without_conditions' (22 records)
|
||||
result['all_sponsorships'] = Sponsorship.search_count([('record_type', '=', 'sponsorship')])
|
||||
result['all_conditional'] = Sponsorship.search_count([
|
||||
('record_type', '=', 'donation'),
|
||||
('donation_mechanism', '=', 'with_conditions')
|
||||
])
|
||||
result['all_unconditional'] = Sponsorship.search_count([
|
||||
('record_type', '=', 'donation'),
|
||||
('donation_mechanism', '=', 'without_conditions')
|
||||
])
|
||||
|
||||
# My Records
|
||||
result['my_sponsorships'] = Sponsorship.search_count([
|
||||
('record_type', '=', 'sponsorship'),
|
||||
('create_uid', '=', uid)
|
||||
])
|
||||
result['my_conditional'] = Sponsorship.search_count([
|
||||
('record_type', '=', 'donation'),
|
||||
('donation_mechanism', '=', 'with_conditions'),
|
||||
('create_uid', '=', uid)
|
||||
])
|
||||
result['my_unconditional'] = Sponsorship.search_count([
|
||||
('record_type', '=', 'donation'),
|
||||
('donation_mechanism', '=', 'without_conditions'),
|
||||
('create_uid', '=', uid)
|
||||
])
|
||||
|
||||
# --- KPI Section ---
|
||||
currency = self.env.company.currency_id
|
||||
|
||||
# 1. Pending Replacements (under_replacement state)
|
||||
result['all_avg_amount'] = Sponsorship.search_count([('state', '=', 'under_replacement')])
|
||||
|
||||
# 2. Total Collections (إجمالي التحصيلات) - Sum of amount_paid for paid records
|
||||
# amount_paid is computed, so use Python sum
|
||||
paid_sponsorships = Sponsorship.search([('state', '=', 'paid')])
|
||||
total_collections = sum(paid_sponsorships.mapped('amount_paid'))
|
||||
# Format as simple number with currency symbol
|
||||
result['all_total_last_7_days'] = "{:,.0f} {}".format(total_collections, currency.name or 'SAR')
|
||||
|
||||
# 3. Pending Payment (بانتظار السداد) - Records in confirmed state (not yet paid)
|
||||
result['all_avg_days_to_pay'] = Sponsorship.search_count([('state', '=', 'confirmed')])
|
||||
|
||||
# 4. Total Sponsored Beneficiaries (إجمالي المكفولين)
|
||||
# Count family members who are currently sponsored (have an active sponsorship link)
|
||||
FamilyMember = self.env['family.member']
|
||||
# Try to find field that links beneficiary to sponsor
|
||||
sponsored_count = FamilyMember.search_count([('sponsor_related_id', '!=', False)])
|
||||
result['all_new_last_7_days'] = sponsored_count
|
||||
|
||||
return result
|
||||
|
||||
def _compute_short_receipt_url(self):
|
||||
"""Compute short URL for receipt using link.tracker (same pattern as Odoo website_slides)"""
|
||||
base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url', '')
|
||||
|
|
@ -479,6 +571,32 @@ class TakafulSponsorship(models.Model):
|
|||
for rec in self:
|
||||
rec.journal_entry_count_vendor = len(rec.journal_entry_ids.filtered(lambda r: r.move_type == 'in_invoice'))
|
||||
|
||||
@api.depends('donations_details_lines.payment_method_display', 'donations_details_lines.direct_debit')
|
||||
def _compute_payment_method_display(self):
|
||||
for rec in self:
|
||||
method = False
|
||||
# 1. Check if ANY donation line is Direct Debit. If so, default to Direct Debit as it's the intended primary method.
|
||||
is_direct_debit = any(line.direct_debit for line in rec.donations_details_lines)
|
||||
if is_direct_debit:
|
||||
dd_method = self.env['takaful.payment.method'].search([('payment_method', '=', 'direct_debit')], limit=1)
|
||||
if dd_method:
|
||||
method = dd_method.id
|
||||
|
||||
# 2. If not Direct Debit, find the latest payment for this sponsorship
|
||||
if not method:
|
||||
# Find latest posted payment for this sponsorship
|
||||
payment = self.env['account.payment'].search([
|
||||
('takaful_sponsorship_id', '=', rec.id),
|
||||
('state', '=', 'posted')
|
||||
], order='date desc', limit=1)
|
||||
|
||||
if payment and payment.journal_id:
|
||||
payment_method = self.env['takaful.payment.method'].search([('journal_id', '=', payment.journal_id.id)], limit=1)
|
||||
if payment_method:
|
||||
method = payment_method.id
|
||||
|
||||
rec.payment_method_display = method
|
||||
|
||||
@api.depends('donations_details_lines')
|
||||
def _compute_donation_count(self):
|
||||
for rec in self:
|
||||
|
|
@ -819,8 +937,8 @@ class TakafulSponsorship(models.Model):
|
|||
last_invoice_date = fields.Date(string='Last Invoice')
|
||||
voucher_ids = fields.One2many('account.move','sponsorship_id',string='Vouchers', copy=False)
|
||||
record_type = fields.Selection([
|
||||
('donation', 'Donation'),
|
||||
('sponsorship', 'Sponsorship'),
|
||||
('donation', 'تبرع'),
|
||||
('sponsorship', 'كفالة'),
|
||||
], string="Record Type", required=True, default=lambda self: self._get_default_record_type(), copy=False)
|
||||
is_donations_coordinator = fields.Boolean(string="Is Donations Coordinator", compute='_compute_is_coordinator')
|
||||
is_sponsorship_coordinator = fields.Boolean(string="Is Sponsorship Coordinator", compute='_compute_is_coordinator')
|
||||
|
|
@ -2059,7 +2177,7 @@ class PaymentDetailsLines(models.Model):
|
|||
is_fully_refund = fields.Boolean(string='Is Fully Refund')
|
||||
is_partial_refund = fields.Boolean(string='Is Partial Refund')
|
||||
payment_method_id = fields.Many2one('takaful.payment.method', string="Payment Method")
|
||||
payment_method = fields.Selection(selection=[("cash", "Cash"),("card", "Card"),("check", "Check"),("credit_card", "Credit Card"),("bank", "Bank Transfer"),("direct_debit", "Direct Debit")], related="payment_method_id.payment_method")
|
||||
payment_method = fields.Selection(selection=[("cash", "نقدي"),("card", "بطاقة"),("check", "شيك"),("credit_card", "بطاقة ائتمان"),("bank", "تحويل بنكي"),("direct_debit", "استقطاع")], related="payment_method_id.payment_method")
|
||||
|
||||
def action_send_whatsapp(self):
|
||||
notification = self.env['takaful.notification'].sudo().search(
|
||||
|
|
@ -2231,7 +2349,7 @@ class PaymentDetailsLines(models.Model):
|
|||
# Example logic: Validate the fields and mark them as confirmed
|
||||
for record in self:
|
||||
if record.payment_method_id.payment_method in ('direct_debit', 'bank') and not record.bank_id:
|
||||
raise ValidationError("Bank is required for Direct Debit and Bank Transfer methods.")
|
||||
raise ValidationError("البنك مطلوب لطريقة الدفع (استقطاع بنكي - تحويل بنكي)")
|
||||
|
||||
# Close the wizard
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,151 @@
|
|||
odoo.define('takaful.dashboard', function (require) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* This file defines the Takaful Dashboard view (alongside its renderer, model
|
||||
* and controller). This Dashboard is added to the top of list and kanban Takaful
|
||||
* views, it extends both views with essentially the same code except for
|
||||
* _onDashboardActionClicked function so we can apply filters without changing our
|
||||
* current view.
|
||||
*/
|
||||
|
||||
var core = require('web.core');
|
||||
var ListController = require('web.ListController');
|
||||
var ListModel = require('web.ListModel');
|
||||
var ListRenderer = require('web.ListRenderer');
|
||||
var ListView = require('web.ListView');
|
||||
var SampleServer = require('web.SampleServer');
|
||||
var view_registry = require('web.view_registry');
|
||||
|
||||
var QWeb = core.qweb;
|
||||
|
||||
// Add mock of method 'retrieve_dashboard' in SampleServer
|
||||
let dashboardValues;
|
||||
SampleServer.mockRegistry.add('takaful.sponsorship/retrieve_dashboard', () => {
|
||||
return Object.assign({}, dashboardValues);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// List View
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
var TakafulListDashboardRenderer = ListRenderer.extend({
|
||||
events: _.extend({}, ListRenderer.prototype.events, {
|
||||
'click .o_dashboard_action': '_onDashboardActionClicked',
|
||||
}),
|
||||
/**
|
||||
* @override
|
||||
* @private
|
||||
* @returns {Promise}
|
||||
*/
|
||||
_renderView: function () {
|
||||
var self = this;
|
||||
return this._super.apply(this, arguments).then(function () {
|
||||
var values = self.state.dashboardValues;
|
||||
var takaful_dashboard = QWeb.render('takaful.TakafulDashboard', {
|
||||
values: values,
|
||||
});
|
||||
self.$el.prepend(takaful_dashboard);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {MouseEvent}
|
||||
*/
|
||||
_onDashboardActionClicked: function (e) {
|
||||
e.preventDefault();
|
||||
var $action = $(e.currentTarget);
|
||||
this.trigger_up('dashboard_open_action', {
|
||||
action_name: $action.attr('name'),
|
||||
action_context: $action.attr('context'),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
var TakafulListDashboardModel = ListModel.extend({
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
init: function () {
|
||||
this.dashboardValues = {};
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
__get: function (localID) {
|
||||
var result = this._super.apply(this, arguments);
|
||||
if (_.isObject(result)) {
|
||||
result.dashboardValues = this.dashboardValues[localID];
|
||||
}
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* @override
|
||||
* @returns {Promise}
|
||||
*/
|
||||
__load: function () {
|
||||
return this._loadDashboard(this._super.apply(this, arguments));
|
||||
},
|
||||
/**
|
||||
* @override
|
||||
* @returns {Promise}
|
||||
*/
|
||||
__reload: function () {
|
||||
return this._loadDashboard(this._super.apply(this, arguments));
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Promise} super_def a promise that resolves with a dataPoint id
|
||||
* @returns {Promise -> string} resolves to the dataPoint id
|
||||
*/
|
||||
_loadDashboard: function (super_def) {
|
||||
var self = this;
|
||||
var dashboard_def = this._rpc({
|
||||
model: 'takaful.sponsorship',
|
||||
method: 'retrieve_dashboard',
|
||||
});
|
||||
return Promise.all([super_def, dashboard_def]).then(function (results) {
|
||||
var id = results[0];
|
||||
dashboardValues = results[1];
|
||||
self.dashboardValues[id] = dashboardValues;
|
||||
return id;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
var TakafulListDashboardController = ListController.extend({
|
||||
custom_events: _.extend({}, ListController.prototype.custom_events, {
|
||||
dashboard_open_action: '_onDashboardOpenAction',
|
||||
}),
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {OdooEvent} e
|
||||
*/
|
||||
_onDashboardOpenAction: function (e) {
|
||||
return this.do_action(e.data.action_name,
|
||||
{ additional_context: JSON.parse(e.data.action_context) });
|
||||
},
|
||||
});
|
||||
|
||||
var TakafulListDashboardView = ListView.extend({
|
||||
config: _.extend({}, ListView.prototype.config, {
|
||||
Model: TakafulListDashboardModel,
|
||||
Renderer: TakafulListDashboardRenderer,
|
||||
Controller: TakafulListDashboardController,
|
||||
}),
|
||||
});
|
||||
|
||||
view_registry.add('takaful_dashboard', TakafulListDashboardView);
|
||||
|
||||
return {
|
||||
TakafulListDashboardModel: TakafulListDashboardModel,
|
||||
TakafulListDashboardRenderer: TakafulListDashboardRenderer,
|
||||
TakafulListDashboardController: TakafulListDashboardController,
|
||||
};
|
||||
|
||||
});
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
|
||||
.o_purchase_dashboard {
|
||||
flex: 1 0 100%;
|
||||
padding: 10px 10px 18px 10px;
|
||||
|
||||
background-color: white; // Fallback or $o-view-background-color
|
||||
position: relative;
|
||||
max-width:100%;
|
||||
|
||||
.row {
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.o_dashboard_action {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-bottom: 0;
|
||||
table-layout: fixed;
|
||||
border-spacing: 10px 0px;
|
||||
border-collapse: separate;
|
||||
font-size: 13px;
|
||||
|
||||
> thead, tbody {
|
||||
& > tr > td {
|
||||
text-align: center;
|
||||
width: 25%;
|
||||
height: 33px;
|
||||
vertical-align: middle;
|
||||
border-top: 1px solid white; // $o-view-background-color
|
||||
background-color: #e9ecef; // $o-brand-lightsecondary
|
||||
|
||||
&.o_text{
|
||||
background-color: white; // $o-view-background-color
|
||||
}
|
||||
|
||||
> a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&.o_main {
|
||||
background-color: #008784; // Default Teal
|
||||
color: white;
|
||||
|
||||
&:hover {
|
||||
background-color: darken(#008784, 10%);
|
||||
}
|
||||
> a {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
// Custom Colors for Takaful - Softer/Warmer Pastels
|
||||
&.o_main_green {
|
||||
background-color: #00887e; // User specified teal-green
|
||||
color: white;
|
||||
&:hover { background-color: darken(#00887e, 8%); }
|
||||
> a { color: white; }
|
||||
}
|
||||
|
||||
&.o_main_blue {
|
||||
background-color: #5DADE2; // Soft sky blue
|
||||
color: white;
|
||||
&:hover { background-color: darken(#5DADE2, 8%); }
|
||||
> a { color: white; }
|
||||
}
|
||||
|
||||
&.o_main_orange {
|
||||
background-color: #F0B27A; // Warm soft orange/peach
|
||||
color: #333; // Dark text for contrast
|
||||
&:hover { background-color: darken(#F0B27A, 8%); }
|
||||
> a { color: #333; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates>
|
||||
<!-- Takaful Dashboard KPI Table -->
|
||||
<t t-name="takaful.TakafulDashboard">
|
||||
<div class="o_purchase_dashboard container">
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="o_text">
|
||||
<div>كل السجلات</div>
|
||||
</td>
|
||||
<td class="o_main_green o_dashboard_action" title="كل الكفالات" name="odex_takaful.takaful_sponsorship_action" context='{"search_default_filter_sponsorship": true}'>
|
||||
<a href="#"><t t-esc="values['all_sponsorships']"/><br/>الكفالات</a>
|
||||
</td>
|
||||
<td class="o_main_blue o_dashboard_action" title="تبرعات مشروطة" name="odex_takaful.takaful_sponsorship_action" context='{"search_default_filter_conditional": true}'>
|
||||
<a href="#"><t t-esc="values['all_conditional']"/><br/>مشروط</a>
|
||||
</td>
|
||||
<td class="o_main_orange o_dashboard_action" title="تبرعات غير مشروطة" name="odex_takaful.takaful_sponsorship_action" context='{"search_default_filter_unconditional": true}'>
|
||||
<a href="#"><t t-esc="values['all_unconditional']"/><br/>غير مشروط</a>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="o_text">
|
||||
<div>سجلاتي</div>
|
||||
</td>
|
||||
<td class="o_main_green o_dashboard_action" title="كفالاتي" name="odex_takaful.takaful_sponsorship_action" context='{"search_default_filter_sponsorship": true, "search_default_filter_my_documents": true}'>
|
||||
<a href="#"><t t-esc="values['my_sponsorships']"/></a>
|
||||
</td>
|
||||
<td class="o_main_blue o_dashboard_action" title="تبرعاتي المشروطة" name="odex_takaful.takaful_sponsorship_action" context='{"search_default_filter_conditional": true, "search_default_filter_my_documents": true}'>
|
||||
<a href="#"><t t-esc="values['my_conditional']"/></a>
|
||||
</td>
|
||||
<td class="o_main_orange o_dashboard_action" title="تبرعاتي غير المشروطة" name="odex_takaful.takaful_sponsorship_action" context='{"search_default_filter_unconditional": true, "search_default_filter_my_documents": true}'>
|
||||
<a href="#"><t t-esc="values['my_unconditional']"/></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
|
||||
<div class="col-sm-7">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="o_text">استبدالات معلقة</td>
|
||||
<td><span><t t-esc="values['all_avg_amount']"/></span></td>
|
||||
<td class="o_text">إجمالي التحصيلات</td>
|
||||
<td><span><t t-esc="values['all_total_last_7_days']"/></span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="o_text">دفعات معلقة</td>
|
||||
<td><span><t t-esc="values['all_avg_days_to_pay']"/></span></td>
|
||||
<td class="o_text">إجمالي المكفولين</td>
|
||||
<td><span><t t-esc="values['all_new_last_7_days']"/></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div></div>
|
||||
</t>
|
||||
</templates>
|
||||
|
||||
|
|
@ -12,11 +12,13 @@
|
|||
<link rel="stylesheet" type="text/scss" href="/odex_takaful/static/src/scss/donation_item_views.scss"/>
|
||||
<link rel="stylesheet" type="text/scss" href="/odex_takaful/static/src/scss/fix_table_overflow.scss"/>
|
||||
<link rel="stylesheet" type="text/scss" href="/odex_takaful/static/src/scss/orphan-fonts.scss"/>
|
||||
<link rel="stylesheet" type="text/scss" href="/odex_takaful/static/src/scss/takaful_dashboard.scss"/>
|
||||
<script type="text/javascript" src="/odex_takaful/static/src/js/product_product_views.js"/>
|
||||
<script type="text/javascript" src="/odex_takaful/static/src/js/donation_catalog_button.js"/>
|
||||
<script type="text/javascript" src="/odex_takaful/static/src/js/donation_catalog_controls.js"/>
|
||||
<script type="text/javascript" src="/odex_takaful/static/src/js/hide_close_button.js"/>
|
||||
<!-- <script type="text/javascript" src="/odex_takaful/static/src/js/catalog_kanban_dynamic_button.js"/>-->
|
||||
<script type="text/javascript" src="/odex_takaful/static/src/js/takaful_dashboard.js"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
|
@ -25,7 +27,7 @@
|
|||
<template id="takaful_simple_enhancements" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<style>
|
||||
/* تحسينات بسيطة فقط */
|
||||
/* Simple enhancements only */
|
||||
.o_form_label {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
|
@ -328,7 +330,7 @@
|
|||
if (currentMechanism) {
|
||||
self.$('.mechanism_option[data-value="' + currentMechanism + '"]').addClass('selected');
|
||||
} else {
|
||||
// Default to without_conditions (غير مشروط) as requested
|
||||
// Default to without_conditions (Unconditional) as requested
|
||||
self.$('.mechanism_option[data-value="without_conditions"]').addClass('selected');
|
||||
}
|
||||
}, 100);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
<field name="extension_date"/>
|
||||
<field name="user_id"/>
|
||||
<field name="invoice_id"/>
|
||||
<field name="state" widget="badge" decoration-success="state == 'paid'" decoration-info="state == 'active'" decoration-danger="state == 'cancel'"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -29,7 +30,7 @@
|
|||
<form create="0" edit="0" delete="0">
|
||||
<header>
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="active,cancel" />
|
||||
statusbar_visible="active,paid,cancel" />
|
||||
</header>
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="Canceld" bg_color="bg-danger" attrs="{'invisible': [('state', '!=', 'cancel')]}"/>
|
||||
|
|
@ -57,6 +58,10 @@
|
|||
<field name="notes"/>
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids"/>
|
||||
<field name="message_ids"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<field name="sponsor_id"/>
|
||||
<field name="benefit_id"/>
|
||||
<field name="product_template_id"/>
|
||||
<field name="payment_method_display"/>
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="branch_group_id"/>
|
||||
<field name="family_id"/>
|
||||
|
|
@ -49,6 +50,7 @@
|
|||
<filter string="State" name="group_state" context="{'group_by': 'state'}"/>
|
||||
<filter string="Donation Type" name="group_donation_type" context="{'group_by': 'donation_type'}"/>
|
||||
<filter string="Sponsorship Duration" name="group_duration" context="{'group_by': 'sponsorship_duration'}"/>
|
||||
<filter string="Payment Method" name="group_payment_method" context="{'group_by': 'payment_method_display'}"/>
|
||||
<filter string="Donation Mechanism" name="group_mechanism" context="{'group_by': 'donation_mechanism'}"/>
|
||||
<filter string="Sponsor" name="group_sponsor" context="{'group_by': 'sponsor_id'}"/>
|
||||
<filter string="Branch" name="group_branch" context="{'group_by': 'branch_group_id'}"/>
|
||||
|
|
@ -58,11 +60,13 @@
|
|||
<separator/>
|
||||
<searchpanel>
|
||||
<field name="state" enable_counters="1"/>
|
||||
<field name="product_template_id" icon="fa-gift" enable_counters="1"/>
|
||||
<field name="record_type" enable_counters="1"/>
|
||||
<field name="sponsorship_duration" enable_counters="1"/>
|
||||
<field name="donation_mechanism" enable_counters="1"/>
|
||||
<field name="direct_debit_filter" enable_counters="1"/>
|
||||
|
||||
<field name="payment_method_display" icon="fa-credit-card" enable_counters="1"/>
|
||||
<field name="branch_group_id" icon="fa-building" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
|
|
@ -77,8 +81,14 @@
|
|||
<field name="direct_debit" invisible="1" />
|
||||
<field name="sequence_no" />
|
||||
<field name="sponsor_id" />
|
||||
|
||||
<field name="sponsor_phone" widget="phone"/>
|
||||
<field name="payment_method_type" invisible="1"/>
|
||||
<field name="payment_method_display" widget="badge"
|
||||
decoration-success="payment_method_type == 'cash'"
|
||||
decoration-info="payment_method_type == 'bank'"
|
||||
decoration-danger="payment_method_type == 'direct_debit'"
|
||||
decoration-warning="payment_method_type == 'network'"
|
||||
decoration-muted="payment_method_type == 'check'"/>
|
||||
<field name="donation_type" optional="hide"/>
|
||||
<field name="sponsorship_duration" />
|
||||
<field name="donation_mechanism" optional="hide"/>
|
||||
|
|
@ -92,15 +102,15 @@
|
|||
<field name="diseases_attachment_ids" widget="many2many_tags" optional="hide"/>
|
||||
<field name="start_date" widget="date" optional="hide"/>
|
||||
<field name="end_date" widget="date" optional="hide"/>
|
||||
<field name="sponsorship_mechanism_id" optional="hide"/>
|
||||
<field name="sponsorship_creation_date" optional="hide"/>
|
||||
<field name="create_date" optional="hide"/>
|
||||
<field name="donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="total_donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="branch_custom_id" optional="hide" />
|
||||
<field name="branch_custom_id" optional="hide"/>
|
||||
<field name="family_id" optional="hide" />
|
||||
<!-- <field name="benefit_family_code" optional="hide" />-->
|
||||
<field name="benefit_id" optional="hide" />
|
||||
<!-- <field name="sponsorship_creation_date" />-->
|
||||
<field name="create_date" optional="hide"/>
|
||||
<field name="waiting_date" widget="date" optional="hide"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-muted="state == 'draft'"
|
||||
|
|
@ -381,52 +391,24 @@
|
|||
<field name="name">donations.details.lines.view.tree.waiting</field>
|
||||
<field name="model">donations.details.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree default_order="waiting_date asc" create="0" edit="0" >
|
||||
<field name="sponsorship_scheduling_line_ids" invisible="1" />
|
||||
<field name="direct_debit" invisible="1" />
|
||||
<field name="sequence_no" />
|
||||
<field name="sponsor_id" />
|
||||
<tree default_order="waiting_date asc" create="0" edit="0" sample="1" decoration-info="waiting_date >= current_date" decoration-warning="waiting_date < current_date">
|
||||
<field name="sequence_no" decoration-bf="1"/>
|
||||
<field name="sponsor_id" widget="many2one_avatar"/>
|
||||
<field name="sponsor_phone" widget="phone"/>
|
||||
<field name="donation_type" optional="hide"/>
|
||||
<field name="sponsorship_duration" optional="hide"/>
|
||||
<field name="donation_mechanism" optional="hide"/>
|
||||
<field name="product_template_id" />
|
||||
<field name="benefit_status" widget="badge"
|
||||
decoration-success="benefit_status == 'benefit'"
|
||||
decoration-danger="benefit_status == 'non_benefit'"/>
|
||||
<field name="education_level" optional="hide"/>
|
||||
<field name="age"/>
|
||||
<field name="number_of_family_member" optional="hide"/>
|
||||
<field name="diseases_attachment_ids" widget="many2many_tags" optional="hide"/>
|
||||
<field name="start_date" widget="date" optional="hide"/>
|
||||
<field name="end_date" widget="date" optional="hide"/>
|
||||
<field name="donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="total_donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="branch_custom_id" optional="hide" />
|
||||
<field name="family_id" optional="hide" />
|
||||
<!-- <field name="benefit_family_code" optional="hide" />-->
|
||||
<field name="benefit_id" optional="hide" />
|
||||
<!-- <field name="sponsorship_creation_date" />-->
|
||||
<field name="product_template_id" optional="show"/>
|
||||
<field name="payment_method_type" invisible="1"/>
|
||||
<field name="payment_method_display" widget="badge"
|
||||
decoration-success="payment_method_type == 'cash'"
|
||||
decoration-info="payment_method_type == 'bank'"
|
||||
decoration-danger="payment_method_type == 'direct_debit'"
|
||||
decoration-warning="payment_method_type == 'network'"
|
||||
decoration-muted="payment_method_type == 'check'"/>
|
||||
<field name="waiting_date" widget="remaining_days" string="Waiting Duration"/>
|
||||
<field name="donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}" optional="hide"/>
|
||||
<field name="create_date" optional="hide"/>
|
||||
<field name="waiting_date" />
|
||||
<field name="waiting_date" string='مدة الانتظار' widget="remaining_days" />
|
||||
<!-- <field name="period_display" />-->
|
||||
<field name="state" widget="badge"
|
||||
decoration-muted="state == 'draft'"
|
||||
decoration-warning="state == 'waiting'"
|
||||
decoration-success="state in ['active', 'paid','confirmed']"
|
||||
decoration-danger="state == 'closed'"
|
||||
decoration-info="state == 'extended'" />
|
||||
<field name="age_category" widget="state" />
|
||||
|
||||
|
||||
<button name="action_view_scheduling_lines"
|
||||
string="View Scheduling Lines"
|
||||
type="object"
|
||||
attrs="{'invisible': ['|', ('direct_debit', '=', False), ('sponsorship_scheduling_line_ids', '=', [])]}"
|
||||
class="btn-secondary"
|
||||
icon="fa-calendar" />
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="state" widget="badge" decoration-warning="state == 'waiting'"/>
|
||||
<button name="add_benefit_wizard" string="Link Beneficiary" type="object" class="btn-primary" icon="fa-plus-circle"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -435,49 +417,24 @@
|
|||
<field name="name">donations.details.lines.view.tree.replace</field>
|
||||
<field name="model">donations.details.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree default_order="end_date asc" create="0" edit="0" >
|
||||
<field name="sponsorship_scheduling_line_ids" invisible="1" />
|
||||
<field name="direct_debit" invisible="1" />
|
||||
<field name="sequence_no" />
|
||||
<field name="sponsor_id" />
|
||||
<tree default_order="actual_end_date asc" create="0" edit="0" sample="1" decoration-danger="actual_end_date < current_date">
|
||||
<field name="sequence_no" decoration-bf="1"/>
|
||||
<field name="sponsor_id" widget="many2one_avatar"/>
|
||||
<field name="sponsor_phone" widget="phone"/>
|
||||
<field name="donation_type" optional="show"/>
|
||||
<field name="sponsorship_duration" optional="hide"/>
|
||||
<field name="donation_mechanism" optional="hide"/>
|
||||
<field name="product_template_id" />
|
||||
<field name="benefit_status" widget="badge"
|
||||
decoration-success="benefit_status == 'benefit'"
|
||||
decoration-danger="benefit_status == 'non_benefit'"/>
|
||||
<field name="education_level" optional="hide"/>
|
||||
<field name="age"/>
|
||||
<field name="number_of_family_member" optional="hide"/>
|
||||
<field name="diseases_attachment_ids" widget="many2many_tags" optional="hide"/>
|
||||
<field name="start_date" widget="date"/>
|
||||
<field name="end_date" widget="date"/>
|
||||
<field name="donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="total_donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="product_template_id" optional="show"/>
|
||||
<field name="payment_method_type" invisible="1"/>
|
||||
<field name="payment_method_display" widget="badge"
|
||||
decoration-success="payment_method_type == 'cash'"
|
||||
decoration-info="payment_method_type == 'bank'"
|
||||
decoration-danger="payment_method_type == 'direct_debit'"
|
||||
decoration-warning="payment_method_type == 'network'"
|
||||
decoration-muted="payment_method_type == 'check'"/>
|
||||
<field name="actual_end_date" widget="remaining_days" string="Exit Period"/>
|
||||
<field name="benefit_id" optional="show"/>
|
||||
<field name="donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}" optional="hide"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="branch_custom_id" optional="hide" />
|
||||
<field name="family_id" optional="hide" />
|
||||
<!-- <field name="benefit_family_code" optional="hide" />-->
|
||||
<field name="benefit_id" optional="hide" />
|
||||
<!-- <field name="sponsorship_creation_date" />-->
|
||||
<field name="create_date" optional="hide"/>
|
||||
<field name="actual_end_date" widget="date" string="تاريخ خروج المستفيد" />
|
||||
<field name="actual_end_date" widget="remaining_days" string="فترة الخروج" />
|
||||
<field name="state" widget="badge"
|
||||
decoration-muted="state == 'draft'"
|
||||
decoration-warning="state == 'waiting'"
|
||||
decoration-success="state in ['active', 'paid','confirmed']"
|
||||
decoration-danger="state == 'closed'"
|
||||
decoration-info="state == 'extended'" />
|
||||
<field name="age_category" widget="state" />
|
||||
<button name="action_view_scheduling_lines"
|
||||
string="View Scheduling Lines"
|
||||
type="object"
|
||||
attrs="{'invisible': ['|', ('direct_debit', '=', False), ('sponsorship_scheduling_line_ids', '=', [])]}"
|
||||
class="btn-secondary"
|
||||
icon="fa-calendar" />
|
||||
<field name="state" widget="badge" decoration-warning="state == 'replace'"/>
|
||||
<button name="action_view_replacement_wizard" string="Replace Beneficiary" type="object" class="btn-primary" icon="fa-exchange"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -514,4 +471,315 @@
|
|||
<field name="context">{'create': False,'search_default_filter_my_documents': 1, 'delete': False}</field>
|
||||
</record>
|
||||
|
||||
<!-- ========================================== -->
|
||||
<!-- بنود الكفالات - Sponsorship Lines Views -->
|
||||
<!-- ========================================== -->
|
||||
|
||||
<!-- Tree View for Sponsorship Lines -->
|
||||
<record id="donations_details_lines_sponsorship_tree" model="ir.ui.view">
|
||||
<field name="name">donations.details.lines.sponsorship.tree</field>
|
||||
<field name="model">donations.details.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree default_order="create_date asc" create="0" edit="0" decoration-danger="state == 'closed'" decoration-warning="state == 'waiting'" decoration-success="state == 'active'">
|
||||
<field name="sequence_no"/>
|
||||
<field name="sponsor_id"/>
|
||||
<field name="sponsor_phone" widget="phone" optional="show"/>
|
||||
<field name="payment_method_type" invisible="1"/>
|
||||
<field name="benefit_id"/>
|
||||
<field name="family_id" optional="hide"/>
|
||||
<field name="age" string="Age"/>
|
||||
<field name="age_category" widget="badge"
|
||||
decoration-info="age_category == 'all'"
|
||||
decoration-warning="age_category == '16'"
|
||||
decoration-danger="age_category == '18'" optional="hide"/>
|
||||
<field name="benefit_status" widget="badge"
|
||||
decoration-success="benefit_status == 'benefit'"
|
||||
decoration-danger="benefit_status == 'non_benefit'" optional="show"/>
|
||||
<field name="product_template_id" optional="hide"/>
|
||||
<field name="sponsorship_duration" widget="badge"
|
||||
decoration-info="sponsorship_duration == 'temporary'"
|
||||
decoration-success="sponsorship_duration == 'permanent'"/>
|
||||
<field name="payment_month_count" string="Months"/>
|
||||
<field name="start_date" widget="date" optional="hide"/>
|
||||
<field name="end_date" widget="date"/>
|
||||
<field name="payment_method_display" widget="badge"
|
||||
decoration-success="payment_method_type == 'cash'"
|
||||
decoration-info="payment_method_type == 'bank'"
|
||||
decoration-danger="payment_method_type == 'direct_debit'"
|
||||
decoration-warning="payment_method_type == 'network'"
|
||||
decoration-muted="payment_method_type == 'check'"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}" optional="hide"/>
|
||||
<field name="total_donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}" optional="hide"/>
|
||||
<field name="direct_debit" widget="boolean_toggle" optional="hide"/>
|
||||
<field name="extension_count" string="Extensions" optional="show"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-muted="state == 'draft'"
|
||||
decoration-warning="state == 'waiting'"
|
||||
decoration-success="state in ['active', 'paid','confirmed']"
|
||||
decoration-danger="state in ['closed', 'cancel']"
|
||||
decoration-info="state == 'extended'"
|
||||
decoration-primary="state == 'replace'"/>
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="sponsorship_scheduling_line_ids" invisible="1"/>
|
||||
<button name="action_extend_sponsorship"
|
||||
string="Extension"
|
||||
type="object"
|
||||
icon="fa-plus-circle"
|
||||
class="btn-link"
|
||||
attrs="{'invisible': [('state', '!=', 'active')]}"/>
|
||||
<button name="action_view_scheduling_lines"
|
||||
string="Scheduling"
|
||||
type="object"
|
||||
attrs="{'invisible': ['|', ('direct_debit', '=', False), ('sponsorship_scheduling_line_ids', '=', [])]}"
|
||||
class="btn-link"
|
||||
icon="fa-calendar"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Search View for Sponsorship Lines -->
|
||||
<record id="donations_details_lines_sponsorship_search" model="ir.ui.view">
|
||||
<field name="name">donations.details.lines.sponsorship.search</field>
|
||||
<field name="model">donations.details.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Sponsorship Items">
|
||||
<field name="sequence_no"/>
|
||||
<field name="sponsor_id"/>
|
||||
<field name="benefit_id"/>
|
||||
<field name="family_id"/>
|
||||
<field name="product_template_id"/>
|
||||
<field name="payment_method_display"/>
|
||||
<separator/>
|
||||
<!-- State Filters -->
|
||||
<filter string="Active" name="filter_active" domain="[('state', '=', 'active')]"/>
|
||||
<filter string="Waiting" name="filter_waiting" domain="[('state', '=', 'waiting')]"/>
|
||||
<filter string="Needs Replacement" name="filter_replace" domain="[('state', '=', 'replace')]"/>
|
||||
<filter string="Extended" name="filter_extended" domain="[('state', '=', 'extended')]"/>
|
||||
<filter string="Closed" name="filter_closed" domain="[('state', '=', 'closed')]"/>
|
||||
<separator/>
|
||||
<!-- Duration Filters -->
|
||||
<filter string="Temporary" name="filter_temporary" domain="[('sponsorship_duration', '=', 'temporary')]"/>
|
||||
<filter string="Permanent" name="filter_permanent" domain="[('sponsorship_duration', '=', 'permanent')]"/>
|
||||
<separator/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="State" name="group_state" context="{'group_by': 'state'}"/>
|
||||
<filter string="Sponsor" name="group_sponsor" context="{'group_by': 'sponsor_id'}"/>
|
||||
<filter string="Sponsorship Type" name="group_duration" context="{'group_by': 'sponsorship_duration'}"/>
|
||||
<filter string="Product" name="group_product" context="{'group_by': 'product_template_id'}"/>
|
||||
<filter string="Branch" name="group_branch" context="{'group_by': 'branch_group_id'}"/>
|
||||
<filter string="End Date" name="group_end_date" context="{'group_by': 'end_date:month'}"/>
|
||||
<filter string="Payment Method" name="group_payment_method" context="{'group_by': 'payment_method_display'}"/>
|
||||
</group>
|
||||
<searchpanel>
|
||||
<field name="state" enable_counters="1"/>
|
||||
<field name="sponsorship_duration" enable_counters="1"/>
|
||||
<field name="payment_method_display" icon="fa-credit-card" enable_counters="1"/>
|
||||
<field name="branch_group_id" icon="fa-building" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action for Sponsorship Lines -->
|
||||
<record id="donations_details_lines_sponsorship_action" model="ir.actions.act_window">
|
||||
<field name="name">Sponsorship Items</field>
|
||||
<field name="res_model">donations.details.lines</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('record_type', '=', 'sponsorship')]</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('donations_details_lines_sponsorship_tree')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('donations_details_lines_view_form')})]"/>
|
||||
<field name="search_view_id" ref="donations_details_lines_sponsorship_search"/>
|
||||
<field name="context">{'create': False, 'delete': False, 'default_record_type': 'sponsorship'}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No sponsorship items found
|
||||
</p>
|
||||
<p>
|
||||
Sponsorship items appear here After confirming sponsorships from the sponsorships screen main
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ========================================== -->
|
||||
<!-- التبرعات غير المشروطة - Unconditional -->
|
||||
<!-- ========================================== -->
|
||||
|
||||
<!-- Tree View for Unconditional Donations -->
|
||||
<record id="donations_unconditional_tree" model="ir.ui.view">
|
||||
<field name="name">donations.details.lines.unconditional.tree</field>
|
||||
<field name="model">donations.details.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree default_order="create_date desc" create="0" edit="0" decoration-success="state == 'paid'" decoration-info="state == 'confirmed'">
|
||||
<field name="sequence_no"/>
|
||||
<field name="sponsor_id" string="Donor"/>
|
||||
<field name="sponsor_phone" widget="phone" optional="hide"/>
|
||||
<field name="product_template_id" string="Donation Item"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}" string="Amount"/>
|
||||
<field name="create_date" string="Donation Date"/>
|
||||
<field name="branch_custom_id" optional="hide"/>
|
||||
<field name="payment_method_type" invisible="1"/>
|
||||
<field name="payment_method_display" widget="badge"
|
||||
decoration-success="payment_method_type == 'cash'"
|
||||
decoration-info="payment_method_type == 'bank'"
|
||||
decoration-danger="payment_method_type == 'direct_debit'"
|
||||
decoration-warning="payment_method_type == 'network'"
|
||||
decoration-muted="payment_method_type == 'check'"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-muted="state == 'draft'"
|
||||
decoration-info="state == 'confirmed'"
|
||||
decoration-success="state == 'paid'"
|
||||
decoration-danger="state == 'cancel'"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Search View for Unconditional Donations -->
|
||||
<record id="donations_unconditional_search" model="ir.ui.view">
|
||||
<field name="name">donations.details.lines.unconditional.search</field>
|
||||
<field name="model">donations.details.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Unconditional Donations">
|
||||
<field name="sequence_no"/>
|
||||
<field name="sponsor_id"/>
|
||||
<field name="product_template_id"/>
|
||||
<field name="payment_method_display"/>
|
||||
<separator/>
|
||||
<!-- State Filters -->
|
||||
<filter string="Paid" name="filter_paid" domain="[('state', '=', 'paid')]"/>
|
||||
<filter string="Confirmed" name="filter_confirmed" domain="[('state', '=', 'confirmed')]"/>
|
||||
<filter string="Draft" name="filter_draft" domain="[('state', '=', 'draft')]"/>
|
||||
<separator/>
|
||||
<!-- Date Filters -->
|
||||
<filter string="Today" name="filter_today" domain="[('create_date', '>=', (context_today() - datetime.timedelta(days=0)).strftime('%Y-%m-%d'))]"/>
|
||||
<filter string="This Week" name="filter_week" domain="[('create_date', '>=', (context_today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"/>
|
||||
<filter string="This Month" name="filter_month" domain="[('create_date', '>=', (context_today() - datetime.timedelta(days=30)).strftime('%Y-%m-%d'))]"/>
|
||||
<separator/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="State" name="group_state" context="{'group_by': 'state'}"/>
|
||||
<filter string="Donor" name="group_sponsor" context="{'group_by': 'sponsor_id'}"/>
|
||||
<filter string="Product" name="group_product" context="{'group_by': 'product_template_id'}"/>
|
||||
<filter string="Branch" name="group_branch" context="{'group_by': 'branch_group_id'}"/>
|
||||
<filter string="Payment Method" name="group_payment_method" context="{'group_by': 'payment_method_display'}"/>
|
||||
</group>
|
||||
<searchpanel>
|
||||
<field name="state" enable_counters="1"/>
|
||||
<field name="payment_method_display" icon="fa-credit-card" enable_counters="1"/>
|
||||
<field name="branch_group_id" icon="fa-building" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action for Unconditional Donations -->
|
||||
<record id="donations_unconditional_action" model="ir.actions.act_window">
|
||||
<field name="name">Unconditional Donations</field>
|
||||
<field name="res_model">donations.details.lines</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('donation_mechanism', '=', 'without_conditions')]</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('donations_unconditional_tree')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('donations_details_lines_view_form')})]"/>
|
||||
<field name="search_view_id" ref="donations_unconditional_search"/>
|
||||
<field name="context">{'create': False, 'delete': False}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No unconditional donations found
|
||||
</p>
|
||||
<p>
|
||||
Unconditional donations are general donations without a specific beneficiary
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ========================================== -->
|
||||
<!-- التبرعات المشروطة - Conditional (For Families) -->
|
||||
<!-- ========================================== -->
|
||||
|
||||
<!-- Tree View for Conditional Donations -->
|
||||
<record id="donations_conditional_tree" model="ir.ui.view">
|
||||
<field name="name">donations.details.lines.conditional.tree</field>
|
||||
<field name="model">donations.details.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree default_order="create_date desc" create="0" edit="0" decoration-success="state == 'paid'" decoration-info="state == 'confirmed'">
|
||||
<field name="sequence_no"/>
|
||||
<field name="sponsor_id" string="Donor"/>
|
||||
<field name="sponsor_phone" widget="phone" optional="show"/>
|
||||
<field name="family_id" string="Beneficiary Family"/>
|
||||
<field name="product_template_id" string="Donation Item"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}" string="Amount"/>
|
||||
<field name="create_date" string="Donation Date"/>
|
||||
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="payment_method_type" invisible="1"/>
|
||||
<field name="payment_method_display" widget="badge"
|
||||
decoration-success="payment_method_type == 'cash'"
|
||||
decoration-info="payment_method_type == 'bank'"
|
||||
decoration-danger="payment_method_type == 'direct_debit'"
|
||||
decoration-warning="payment_method_type == 'network'"
|
||||
decoration-muted="payment_method_type == 'check'"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-muted="state == 'draft'"
|
||||
decoration-info="state == 'confirmed'"
|
||||
decoration-success="state == 'paid'"
|
||||
decoration-danger="state == 'cancel'"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Search View for Conditional Donations -->
|
||||
<record id="donations_conditional_search" model="ir.ui.view">
|
||||
<field name="name">donations.details.lines.conditional.search</field>
|
||||
<field name="model">donations.details.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Conditional Donations">
|
||||
<field name="sequence_no"/>
|
||||
<field name="sponsor_id"/>
|
||||
<field name="family_id"/>
|
||||
<field name="product_template_id"/>
|
||||
<field name="payment_method_display"/>
|
||||
<separator/>
|
||||
<!-- State Filters -->
|
||||
<filter string="Paid" name="filter_paid" domain="[('state', '=', 'paid')]"/>
|
||||
<filter string="Confirmed" name="filter_confirmed" domain="[('state', '=', 'confirmed')]"/>
|
||||
<filter string="Draft" name="filter_draft" domain="[('state', '=', 'draft')]"/>
|
||||
<separator/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="State" name="group_state" context="{'group_by': 'state'}"/>
|
||||
<filter string="Donor" name="group_sponsor" context="{'group_by': 'sponsor_id'}"/>
|
||||
<filter string="Family" name="group_family" context="{'group_by': 'family_id'}"/>
|
||||
<filter string="Product" name="group_product" context="{'group_by': 'product_template_id'}"/>
|
||||
</group>
|
||||
<searchpanel>
|
||||
<field name="state" enable_counters="1"/>
|
||||
<field name="branch_group_id" icon="fa-building" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action for Conditional Donations -->
|
||||
<record id="donations_conditional_action" model="ir.actions.act_window">
|
||||
<field name="name">Conditional Donations (Families)</field>
|
||||
<field name="res_model">donations.details.lines</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('donation_mechanism', '=', 'with_conditions'), ('record_type', '=', 'donation')]</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('donations_conditional_tree')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('donations_details_lines_view_form')})]"/>
|
||||
<field name="search_view_id" ref="donations_conditional_search"/>
|
||||
<field name="context">{'create': False, 'delete': False}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No conditional donations found
|
||||
</p>
|
||||
<p>
|
||||
Conditional donations are donations directed to specific families
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -149,12 +149,12 @@
|
|||
<span style="font-weight: 600;">
|
||||
<t t-if="record.kafala_status.raw_value == 'have_kafala'">
|
||||
<span style="background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%); color: #2e7d32; padding: 2px 6px; border-radius: 8px; font-weight: 700; font-size: 10px; border: 1px solid #4caf50;">
|
||||
مكفول
|
||||
Sponsored
|
||||
</span>
|
||||
</t>
|
||||
<t t-elif="record.kafala_status.raw_value == 'have_not_kafala'">
|
||||
<span style="background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%); color: #e65100; padding: 2px 6px; border-radius: 8px; font-weight: 700; font-size: 10px; border: 1px solid #ff9800;">
|
||||
غير مكفول
|
||||
Not Sponsored
|
||||
</span>
|
||||
</t>
|
||||
<t t-else="">
|
||||
|
|
@ -166,7 +166,7 @@
|
|||
<t t-if="record.kafala_status.raw_value == 'have_kafala'">
|
||||
<div style="display: inline-flex; align-items: center;">
|
||||
<i class="fa fa-calendar" style="color: #6c757d; margin-left: 4px;"/>
|
||||
<span style="font-weight: 600; color: #495057; margin-left: 4px;">تنتهي الكفالة: </span>
|
||||
<span style="font-weight: 600; color: #495057; margin-left: 4px;">انتهاء الكفالة: </span>
|
||||
<span style="color: #212529; font-weight: 500;">
|
||||
<t t-if="record.sponsorship_end_date.raw_value">
|
||||
<field name="sponsorship_end_date"/>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
alt="Product" class="o_image_64_contain" style="width: 100%;object-fit: cover;height: 100px;"/>
|
||||
</div>
|
||||
<h5 style="margin-top: 5px;text-align: center;">
|
||||
<span>Amount:</span>
|
||||
<span>المبلغ:</span>
|
||||
<field name="lst_price" widget="monetary"/>
|
||||
<svg id="Layer_1" data-name="Layer 1" viewBox="0 0 1124.14 1256.39" style="height: 11px"><defs><style>.cls-1 {fill: #231f20;}</style></defs><path class="cls-1" d="M699.62,1113.02h0c-20.06,44.48-33.32,92.75-38.4,143.37l424.51-90.24c20.06-44.47,33.31-92.75,38.4-143.37l-424.51,90.24Z"/><path class="cls-1" d="M1085.73,895.8c20.06-44.47,33.32-92.75,38.4-143.37l-330.68,70.33v-135.2l292.27-62.11c20.06-44.47,33.32-92.75,38.4-143.37l-330.68,70.27V66.13c-50.67,28.45-95.67,66.32-132.25,110.99v403.35l-132.25,28.11V0c-50.67,28.44-95.67,66.32-132.25,110.99v525.69l-295.91,62.88c-20.06,44.47-33.33,92.75-38.42,143.37l334.33-71.05v170.26l-358.3,76.14c-20.06,44.47-33.32,92.75-38.4,143.37l375.04-79.7c30.53-6.35,56.77-24.4,73.83-49.24l68.78-101.97v-.02c7.14-10.55,11.3-23.27,11.3-36.97v-149.98l132.25-28.11v270.4l424.53-90.28Z"/></svg>
|
||||
</h5>
|
||||
|
|
@ -52,10 +52,10 @@
|
|||
<button class="btn btn-secondary" type="button"
|
||||
name="add_quantity_button_so"
|
||||
data-name="add_quantity_button_request"
|
||||
title="إضافة منتج"
|
||||
title="Add Product"
|
||||
onclick="return window.__dc_first_add(this);">
|
||||
<i class="fa fa-shopping-cart" />
|
||||
<span>Add</span>
|
||||
<span>إضافة</span>
|
||||
</button>
|
||||
|
||||
<div class="dc-qty-controls d-none">
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
type="button"
|
||||
name="remove_quantity_button_so"
|
||||
data-name="remove_quantity_button_so"
|
||||
title="تقليل الكمية"
|
||||
title="Reduce Quantity"
|
||||
onclick="return window.__dc_remove(this);">
|
||||
<i class="fa fa-minus" />
|
||||
</button>
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
type="button"
|
||||
name="add_quantity_button_so"
|
||||
data-name="add_quantity_button_so"
|
||||
title="إضافة"
|
||||
title="Add"
|
||||
onclick="return window.__dc_add(this);">
|
||||
<i class="fa fa-plus" />
|
||||
</button>
|
||||
|
|
@ -104,13 +104,13 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Products">
|
||||
<header>
|
||||
<button name="link_to_sponsorship" type="object" string="Link to Sponsorship"
|
||||
<button name="link_to_sponsorship" type="object" string="ربط بكفالة"
|
||||
class="btn-primary"
|
||||
icon="fa-link" />
|
||||
</header>
|
||||
<field name="name" />
|
||||
<field name="donation_category" />
|
||||
<field name="list_price" string="Price" />
|
||||
<field name="list_price" string="السعر" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -133,11 +133,11 @@
|
|||
|
||||
<xpath expr="//search/filter[1]" position="before">
|
||||
|
||||
<filter string="Target"
|
||||
<filter string="مستهدف"
|
||||
name="target_donation_true"
|
||||
domain="[('target_donation','=','target')]"/>
|
||||
|
||||
<filter string="Not Target"
|
||||
<filter string="غير مستهدف"
|
||||
name="target_donation_false"
|
||||
domain="[('target_donation','=','not_target')]"/>
|
||||
<separator/>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<div>
|
||||
|
||||
<field name="payment_month_number" required="1" class="oe_inline" style="margin-right:50px; margin-bottom:20px;"/>
|
||||
<span class="oe_inline text-muted"> Months</span>
|
||||
<span class="oe_inline text-muted"> شهور</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<odoo>
|
||||
<data noupdate="0">
|
||||
<record id="financial_gift" model="product.product">
|
||||
<field name="name">هدية مالية</field>
|
||||
<field name="name">Financial Gift</field>
|
||||
<field name="type">service</field>
|
||||
<!-- <field name="standard_price">0</field> -->
|
||||
<field name="list_price">300.0</field>
|
||||
|
|
|
|||
|
|
@ -3,49 +3,51 @@
|
|||
|
||||
<menuitem id="takaful_kufula_app_top_menu" sequence="15" name="Kafalat System" web_icon="odex_takaful,static/description/icon.png" groups="odex_takaful.group_kufula_user"/>
|
||||
|
||||
<!-- Main Kafalat-->
|
||||
<!-- ========================================== -->
|
||||
<!-- كفالات و نقاط بيع - Donations POS Menu -->
|
||||
<!-- Direct action on parent menu (no submenu needed) -->
|
||||
<!-- ========================================== -->
|
||||
<menuitem id="kafalat_main_menu" parent="takaful_kufula_app_top_menu"
|
||||
sequence="10" name="Kafalat"/>
|
||||
sequence="10" name="Donations POS" action="takaful_sponsorship_action"/>
|
||||
|
||||
<!-- Kafala Processes (moved from replacement_process_views.xml) -->
|
||||
<menuitem id="menu_replacement_root" name="Kafala Processes" sequence="11"
|
||||
parent="takaful_kufula_app_top_menu" groups="odex_takaful.group_kufula_user"/>
|
||||
<!-- ========================================== -->
|
||||
<!-- الكفالات - Sponsorships Menu (Lines, Sponsors, Processes) -->
|
||||
<!-- NEW separate menu for sponsorship management -->
|
||||
<!-- ========================================== -->
|
||||
<menuitem id="sponsorship_lines_menu" parent="takaful_kufula_app_top_menu"
|
||||
sequence="15" name="Sponsorships"/>
|
||||
|
||||
<menuitem id="takaful_sponsorship_app_menu" parent="kafalat_main_menu"
|
||||
name="Sponsorships" action="takaful_sponsorship_action" sequence="1"/>
|
||||
<!-- Sponsorship Lines -->
|
||||
<menuitem id="donations_details_lines_app_menu" parent="sponsorship_lines_menu"
|
||||
name="Sponsorship Lines" action="donations_details_lines_sponsorship_action" sequence="1"/>
|
||||
|
||||
<menuitem id="donations_details_lines_app_menu" parent="kafalat_main_menu"
|
||||
name="Donations Details Lines" action="donations_details_lines_action" sequence="2"/>
|
||||
<!-- Sponsors Record -->
|
||||
<menuitem id="takaful_sponsor_menu" parent="sponsorship_lines_menu"
|
||||
name="Sponsors Record" action="takaful_sponsor_action" sequence="2"/>
|
||||
|
||||
<!-- Sponsorship Processes Submenu -->
|
||||
<menuitem id="menu_replacement_root" name="Sponsorship Processes" sequence="10"
|
||||
parent="sponsorship_lines_menu" groups="odex_takaful.group_kufula_user"/>
|
||||
|
||||
<menuitem id="donations_details_lines_to_replace_app_menu" parent="menu_replacement_root"
|
||||
name="Donations Details Lines To Replace Benefit" action="donations_details_lines_replace_action" sequence="3" groups="odex_takaful.group_orphan_replacement"/>
|
||||
name="Needs Replacement" action="donations_details_lines_replace_action" sequence="1" groups="odex_takaful.group_orphan_replacement"/>
|
||||
|
||||
<menuitem id="donations_details_lines_waiting_app_menu" parent="menu_replacement_root"
|
||||
name="Donations Details Lines Waiting Benefit" action="donations_details_lines_waiting_action" sequence="4"/>
|
||||
name="Waiting for Beneficiary" action="donations_details_lines_waiting_action" sequence="2"/>
|
||||
|
||||
<!-- ========================================== -->
|
||||
<!-- التبرعات - Donations Menu -->
|
||||
<!-- ========================================== -->
|
||||
<menuitem id="donations_main_menu" parent="takaful_kufula_app_top_menu"
|
||||
sequence="20" name="Donations" groups="odex_takaful.group_kufula_user"/>
|
||||
|
||||
<menuitem id="donations_unconditional_menu" parent="donations_main_menu"
|
||||
name="Unconditional Donations" action="donations_unconditional_action" sequence="1"/>
|
||||
|
||||
<!-- TODO WE WILL USE IT LATER DON'T REMOVE THIS -->
|
||||
<!-- START OF THE BLOCK -->
|
||||
<!-- <menuitem id="takaful_sponsorship_payment_menu" name="Sponsorship Payment"
|
||||
parent="kafalat_main_menu" action="takaful_sponsorship_payment_action" sequence="2" />
|
||||
<menuitem id="donations_conditional_menu" parent="donations_main_menu"
|
||||
name="Conditional Donations" action="donations_conditional_action" sequence="2"/>
|
||||
|
||||
<menuitem id="sponsorship_cancellation_menu" name="Sponsorship Cancellation"
|
||||
parent="kafalat_main_menu" action="sponsorship_cancellation_action" sequence="3" />
|
||||
|
||||
<menuitem id="takaful_contribution_app_menu" name="The Financial Contributions"
|
||||
parent="kafalat_main_menu" action="takaful_financial_contribution_action" sequence="4"/>
|
||||
|
||||
<menuitem id="takaful_push_notification_menu" name="Notifications Messages"
|
||||
parent="kafalat_main_menu" action="takaful_push_notification_action" sequence="5" /> -->
|
||||
<!-- END OF THE BLOCK -->
|
||||
|
||||
<!-- Main Kafileen-->
|
||||
<menuitem id="kafileen_main_menu" parent="takaful_kufula_app_top_menu"
|
||||
sequence="12" name="Kafileen"/>
|
||||
|
||||
<menuitem id="takaful_sponsor_menu" parent="kafileen_main_menu"
|
||||
name="Sponsors Record" action="takaful_sponsor_action" sequence="1"/>
|
||||
<!-- Old Kafileen menu - removed, sponsor menu moved under kafalat_main_menu -->
|
||||
|
||||
<!-- <menuitem id="takaful_sponsor_operation_menu" name="Operations Records" parent="kafileen_main_menu" action="takaful_sponsor_operation_action" sequence="2"/> -->
|
||||
|
||||
|
|
@ -77,7 +79,7 @@
|
|||
|
||||
<!-- Main Reports -->
|
||||
<menuitem id="sponsor_report_menu" parent="takaful_kufula_app_top_menu"
|
||||
name="Reports" sequence="40" />
|
||||
name="Reports" sequence="40" active="False"/>
|
||||
|
||||
<menuitem id="active_sponsor_report_menu" parent="sponsor_report_menu" sequence="10" name="Active Sponsors Report" action="action_active_sponsor_report"/>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<data noupdate="0">
|
||||
<record id="sponsorship" model="product.product">
|
||||
<field name="name">كفالة</field>
|
||||
<field name="name">Sponsorship</field>
|
||||
<field name="type">service</field>
|
||||
<field name="default_code">sponsorship</field>
|
||||
<!-- <field name="standard_price">0</field> -->
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
<!-- 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"
|
||||
string="Request Refund" class="oe_highlight"
|
||||
attrs="{'invisible': ['|',('state','not in',['paid','partial_refund','under_replacement','replacement_done']), ('cancel_refund', '=', True)]}"/>
|
||||
<button string="Approve Refund" name="approve_refund" type="object"
|
||||
class="oe_highlight"
|
||||
|
|
@ -185,7 +185,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
<label string="اسم الكافل/المتبرع" for="sponsor_id"
|
||||
<label string="Sponsor/Donor Name" for="sponsor_id"
|
||||
attrs="{
|
||||
'invisible': ['|',
|
||||
'&', ('record_type','=','donation'), ('sponsor_or_donor_type','=','unknown'),
|
||||
|
|
@ -210,7 +210,7 @@
|
|||
options="{'no_create': True, 'no_create_edit': True}"/>
|
||||
|
||||
<button name="create_new_sponsor" type="object"
|
||||
string="إنشاء مشترك"
|
||||
string="Create Joint"
|
||||
class="btn-primary oe_highlight"
|
||||
icon="fa-plus"
|
||||
attrs="{
|
||||
|
|
@ -229,7 +229,7 @@
|
|||
'readonly': [('state','!=','draft')]
|
||||
}"/>
|
||||
|
||||
<field name="sponsor_phone" string="رقم الجوال" widget="phone"
|
||||
<field name="sponsor_phone" string="Mobile Number" widget="phone"
|
||||
attrs="{
|
||||
'invisible': ['|',
|
||||
'&', ('record_type','=','donation'), ('sponsor_or_donor_type','!=','unknown'),
|
||||
|
|
@ -239,7 +239,7 @@
|
|||
}"
|
||||
placeholder="05xxxxxxxx"/>
|
||||
|
||||
<field name="preferred_communication" string="طريقة التواصل المفضلة"
|
||||
<field name="preferred_communication" string="Preferred Communication"
|
||||
attrs="{
|
||||
'invisible': ['|',
|
||||
'&', ('record_type','=','donation'), ('sponsor_or_donor_type','=','unknown'),
|
||||
|
|
@ -391,6 +391,13 @@
|
|||
<field name="total_donation_amount" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"
|
||||
readonly="1" force_save="1"/>
|
||||
<field name="payment_method_type" invisible="1"/>
|
||||
<field name="payment_method_display" widget="badge"
|
||||
decoration-success="payment_method_type == 'cash'"
|
||||
decoration-info="payment_method_type == 'bank'"
|
||||
decoration-danger="payment_method_type == 'direct_debit'"
|
||||
decoration-warning="payment_method_type == 'network'"
|
||||
decoration-muted="payment_method_type == 'check'"/>
|
||||
<button name="action_view_scheduling_lines"
|
||||
string="View Scheduling Lines"
|
||||
type="object"
|
||||
|
|
@ -488,6 +495,13 @@
|
|||
<field name="total_donation_amount" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"
|
||||
force_save="1"/>
|
||||
<field name="payment_method_type" invisible="1"/>
|
||||
<field name="payment_method_display" widget="badge"
|
||||
decoration-success="payment_method_type == 'cash'"
|
||||
decoration-info="payment_method_type == 'bank'"
|
||||
decoration-danger="payment_method_type == 'direct_debit'"
|
||||
decoration-warning="payment_method_type == 'network'"
|
||||
decoration-muted="payment_method_type == 'check'"/>
|
||||
<field name="donation_mechanism"
|
||||
attrs="{'column_invisible': [('parent.donation_mechanism','!=','with_conditions')]}"/>
|
||||
|
||||
|
|
@ -761,17 +775,25 @@
|
|||
<field name="name">takaful.sponsorship.tree</field>
|
||||
<field name="model">takaful.sponsorship</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Sponsorship List" decoration-danger="has_delay==True">
|
||||
<tree default_order="sponsorship_creation_date desc" js_class="takaful_dashboard">
|
||||
<field name="has_delay" invisible="1"/>
|
||||
<field name="code"/>
|
||||
<field name="create_uid"/>
|
||||
<field name="sponsorship_creation_date"/>
|
||||
<field name="record_type"/>
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="sponsor_or_donor_type"/>
|
||||
<field name="registered_type"/>
|
||||
<field name="sponsor_or_donor_type" optional="hide"/>
|
||||
<field name="registered_type" optional="hide"/>
|
||||
<field name="sponsor_id"/>
|
||||
<field name="sponsor_name" string="Unregistered Sponsor Name" optional="show"/>
|
||||
<field name="sponsor_name" string="Unregistered Sponsor Name" optional="hide"/>
|
||||
|
||||
<field name="payment_method_type" invisible="1"/>
|
||||
<field name="payment_method_display" widget="badge"
|
||||
decoration-success="payment_method_type == 'cash'"
|
||||
decoration-info="payment_method_type == 'bank'"
|
||||
decoration-danger="payment_method_type == 'direct_debit'"
|
||||
decoration-warning="payment_method_type == 'network'"
|
||||
decoration-muted="payment_method_type == 'check'"/>
|
||||
<field name="total_sponsorship_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="state" widget="badge"
|
||||
|
|
@ -814,6 +836,8 @@
|
|||
<field name="total_sponsorship_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="state"/>
|
||||
|
||||
<field name="payment_method_display"/>
|
||||
<separator/>
|
||||
<!-- State Filters -->
|
||||
<filter string="Draft" name="filter_draft" domain="[('state', '=', 'draft')]"/>
|
||||
|
|
@ -837,6 +861,10 @@
|
|||
<!-- Record Type Filters -->
|
||||
<filter string="Sponsorship" name="filter_sponsorship" domain="[('record_type', '=', 'sponsorship')]"/>
|
||||
<filter string="Donation" name="filter_donation" domain="[('record_type', '=', 'donation')]"/>
|
||||
<filter string="Conditional" name="filter_conditional" domain="[('record_type', '=', 'donation'), ('donation_mechanism', '=', 'with_conditions')]"/>
|
||||
<filter string="Unconditional" name="filter_unconditional" domain="[('record_type', '=', 'donation'), ('donation_mechanism', '=', 'without_conditions')]"/>
|
||||
<separator/>
|
||||
<filter string="My Documents" name="filter_my_documents" domain="[('create_uid', '=', uid)]"/>
|
||||
<separator/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter name="create_uid" context="{'group_by':'create_uid'}"/>
|
||||
|
|
@ -844,14 +872,17 @@
|
|||
<filter name="branch_custom_id" context="{'group_by':'branch_custom_id'}"/>
|
||||
<filter name="sponsor_or_donor_type"
|
||||
context="{'group_by':'sponsor_or_donor_type'}"/>
|
||||
<filter name="registered_type" context="{'group_by':'registered_type'}"/>
|
||||
<filter name="sponsor_id" context="{'group_by':'sponsor_id'}"/>
|
||||
<filter name="state" context="{'group_by':'state'}"/>
|
||||
<filter name="payment_method" string="Payment Method" context="{'group_by':'payment_method_display'}"/>
|
||||
</group>
|
||||
<separator/>
|
||||
<searchpanel>
|
||||
<field name="state" enable_counters="1"/>
|
||||
<field name="state" enable_counters="1"/>
|
||||
<field name="record_type" enable_counters="1"/>
|
||||
<field name="payment_method_display" icon="fa-credit-card" enable_counters="1"/>
|
||||
<field name="branch_custom_id" icon="fa-building" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
|
|
|
|||
|
|
@ -32,18 +32,51 @@
|
|||
<field name="name">partner.sponsor.tree</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Sponsors List" decoration-danger="active==False">
|
||||
<field name="name"/>
|
||||
<field name="company_type"/>
|
||||
<field name="mobile"/>
|
||||
<field name="id_number"/>
|
||||
<field name="city_id"/>
|
||||
<tree string="Sponsors List" decoration-danger="active==False" sample="1">
|
||||
<field name="name" decoration-bf="1"/>
|
||||
<field name="kafel_state" widget="badge" decoration-success="kafel_state == 'active'" decoration-danger="kafel_state == 'not_active'"/>
|
||||
<field name="kafalat_count"/>
|
||||
<field name="company_type" optional="hide"/>
|
||||
<field name="mobile" widget="phone" optional="show"/>
|
||||
<field name="email" widget="email" optional="show"/>
|
||||
<field name="id_number" optional="hide"/>
|
||||
<field name="city_id" optional="show"/>
|
||||
<field name="create_date" optional="hide"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="active" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="takaful_sponsor_search_view" model="ir.ui.view">
|
||||
<field name="name">res.partner.sponsor.search</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Sponsors">
|
||||
<field name="name" filter_domain="['|', '|', ('name', 'ilike', self), ('parent_id', 'ilike', self), ('ref', '=', self)]"/>
|
||||
<field name="mobile"/>
|
||||
<field name="email"/>
|
||||
<field name="id_number"/>
|
||||
<separator/>
|
||||
<filter string="Active Sponsors" name="active_sponsors" domain="[('kafel_state', '=', 'active')]"/>
|
||||
<filter string="Inactive Sponsors" name="inactive_sponsors" domain="[('kafel_state', '=', 'not_active')]"/>
|
||||
<separator/>
|
||||
<!-- <filter string="Has Kafalat" name="has_kafalat" domain="[('kafalat_count', '>', 0)]"/> Unsearchable non-stored field -->
|
||||
<separator/>
|
||||
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="City" name="group_by_city" context="{'group_by': 'city_id'}"/>
|
||||
<filter string="Sponsor State" name="group_by_state" context="{'group_by': 'kafel_state'}"/>
|
||||
<filter string="Company Type" name="group_by_type" context="{'group_by': 'company_type'}"/>
|
||||
</group>
|
||||
<searchpanel>
|
||||
<field name="kafel_state" icon="fa-users" enable_counters="1"/>
|
||||
<field name="city_id" icon="fa-building" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_takaful_sponsor_form" model="ir.ui.view">
|
||||
<field name="name">partner.sponsor.form</field>
|
||||
<field name="model">res.partner</field>
|
||||
|
|
@ -71,19 +104,6 @@
|
|||
<button class="oe_stat_button" type="object" name="action_open_benefit_records" icon="fa-users">
|
||||
<field string="Benefits" name="related_benefits_count" widget="statinfo"/>
|
||||
</button>
|
||||
<!-- <button class="oe_stat_button" name="_compute_contribution_count" type="action"
|
||||
icon="fa-money">
|
||||
<field string="Contributions" name="contribution_count" widget="statinfo"/>
|
||||
</button>
|
||||
|
||||
<button class="oe_stat_button" name="_compute_gift_count" type="action" icon="fa-gift">
|
||||
<field string="Gifts" name="gift_count" widget="statinfo"/>
|
||||
</button>
|
||||
|
||||
<button name="action_open_sponsor_operation" type="object" class="oe_stat_button" icon="fa-history">
|
||||
<field string=" Operations Records" name="operation_count" widget="statinfo"/>
|
||||
</button> -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -99,11 +119,11 @@
|
|||
|
||||
<group attrs="{'invisible': [('company_type', '!=', 'person')]}">
|
||||
<div class="o_row">
|
||||
<field placeholder="اللقب" name="title" class="oe_inline" nolabel="1" style="width: 20%;"
|
||||
<field placeholder="Title" name="title" class="oe_inline" nolabel="1" style="width: 20%;"
|
||||
domain="[('position', 'in', ['prefix','both'])]"
|
||||
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
||||
<field placeholder="الاسم" name="first_name" class="oe_inline" nolabel="1" style="width: 60%;" required="1"/>
|
||||
<field placeholder="العبارة الختامية" name="suffix_title_id" class="oe_inline" nolabel="1" style="width: 20%;"
|
||||
<field placeholder="Name" name="first_name" class="oe_inline" nolabel="1" style="width: 60%;" required="1"/>
|
||||
<field placeholder="Closing Statement" name="suffix_title_id" class="oe_inline" nolabel="1" style="width: 20%;"
|
||||
domain="[('position', 'in', ['suffix','both'])]"
|
||||
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
||||
</div>
|
||||
|
|
@ -113,12 +133,12 @@
|
|||
</group>
|
||||
<group name="group_top">
|
||||
<group name="group_main" colspan="2">
|
||||
<field name="mobile" string="رقم الجوال" widget="phone" placeholder="05xxxxxxxx" attrs="{'required': [('parent_id', '=', False)]}" />
|
||||
<field name="preferred_communication" string="طريقة التواصل المفضلة" required="1"/>
|
||||
<field name="mobile" string="Mobile Number" widget="phone" placeholder="05xxxxxxxx" attrs="{'required': [('parent_id', '=', False)]}" />
|
||||
<field name="preferred_communication" string="Preferred Communication" required="1"/>
|
||||
<field name="gender" attrs="{'required': [('company_type', '=', 'person')],'invisible': [('company_type', '!=', 'person')]}"/>
|
||||
<field name="street" attrs="{'invisible': [('company_type', '=', 'person')]}"/>
|
||||
<field name="zip" attrs="{'invisible': [('company_type', '=', 'person')]}"/>
|
||||
<field name="email"/>
|
||||
<field name="email" widget="email"/>
|
||||
<field name="id_number" attrs="{'invisible': [('company_type', '!=', 'person')]}"/>
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="city_id" invisible="1"/>
|
||||
|
|
@ -226,6 +246,7 @@
|
|||
<field name="res_model">res.partner</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('is_sponsor_portal', '=', True), ('company_type', '=', 'person')]</field>
|
||||
<field name="search_view_id" ref="takaful_sponsor_search_view"/>
|
||||
<field name="context">
|
||||
{
|
||||
'default_company_type': 'person',
|
||||
|
|
|
|||
Loading…
Reference in New Issue