Merge pull request #5342 from expsa/feature/takaful-ui-improvements-20251111

🚀 Complete Takaful Module UI/UX Enhancement - Phase 2 (Comprehensive Fixes)
This commit is contained in:
Mohamed Eltayar 2025-11-11 18:30:32 +03:00 committed by GitHub
commit 5be981d770
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 70 additions and 40 deletions

View File

@ -16,6 +16,8 @@ class SchedulingLine(models.Model):
scheduled_date = fields.Date(string='Scheduled Date', help='Date when the payment should be automatically processed')
amount = fields.Float()
refunded_amount = fields.Float(string='Refunded Amount')
currency_id = fields.Many2one('res.currency', string='Currency',
default=lambda self: self.env.company.currency_id, readonly=True)
status = fields.Selection([
('unpaid', 'Unpaid'),
('paid', 'Paid'),

View File

@ -12,6 +12,8 @@ class DonationsItems(models.Model):
show_donation_item = fields.Boolean(string='Show Donation Item')
fixed_value = fields.Boolean(string='Is Fixed Value?')
fixed_donation_amount = fields.Float(string='Donation Amount')
currency_id = fields.Many2one('res.currency', string='Currency',
default=lambda self: self.env.company.currency_id, readonly=True)
account_id = fields.Many2one('account.account', string="Account",domain="[('user_type_id.id','=',13)]")
product_id = fields.Many2one('product.product', string="Product", domain="[('type', '=', 'service')]")
_quantity = fields.Float(default=0, store=True)

View File

@ -43,6 +43,8 @@ class TakafulContribution(models.Model):
string='Operation Type',
)
amount = fields.Float(string="Amount")
currency_id = fields.Many2one('res.currency', string='Currency',
default=lambda self: self.env.company.currency_id, readonly=True)
note = fields.Text(string='Note/Message')
date = fields.Datetime(string="Date", default=fields.Datetime.now)
entry_id = fields.Many2one('account.move', string="Entry")

View File

@ -129,6 +129,8 @@ class GrantBenefitInvoice(models.Model):
string='Target of Beneficiaries',
)
paid_amount = fields.Float(string='Paid Amount', readonly=True)
currency_id = fields.Many2one('res.currency', string='Currency',
default=lambda self: self.env.company.currency_id, readonly=True)
partner_id = fields.Many2one('res.partner', string='From',
store=True,
related='operation_invoice_id.partner_id')
@ -332,6 +334,8 @@ class SponsorshipBenefitArrears(models.Model):
related="sponsorship_id.code", store=True)
month_amount = fields.Float(string="Month Sponsorship Amount",
related="sponsorship_id.load_amount", store=True, readonly=True)
currency_id = fields.Many2one('res.currency', string='Currency',
default=lambda self: self.env.company.currency_id, readonly=True)
arrears_month_number = fields.Integer(string="Arrears Months Number")
arrears_total = fields.Float(string="Arrears Total")
date = fields.Date('Date', readonly=True, default=fields.Date.today())

View File

@ -22,6 +22,8 @@ class MonthPayment(models.Model):
account_id = fields.Many2one('account.account', )
date = fields.Date(string="Date", default=fields.Datetime.now)
amount = fields.Float(string="Total Amount", compute='_compute_payment_total', store=True)
currency_id = fields.Many2one('res.currency', string='Currency',
default=lambda self: self.env.company.currency_id, readonly=True)
count = fields.Integer(string="Count", compute='_compute_payment_total', store=True)
user_id = fields.Many2one('res.users', string="Issued By", default=lambda self: self.env.user)
company_id = fields.Many2one('res.company', string="Company", default=lambda self: self.env.user.company_id)
@ -210,6 +212,8 @@ class MonthPaymentLine(models.Model):
state = fields.Selection(related="month_id.state", store=True)
code = fields.Char(related="month_id.code", store=True)
amount = fields.Float(string="Amount")
currency_id = fields.Many2one('res.currency', string='Currency',
default=lambda self: self.env.company.currency_id, readonly=True)
"""
@api.model

View File

@ -29,6 +29,8 @@ class SponsorshipPayment(models.Model):
payment_month_number = fields.Integer(string="Sponsorships Number To Pay")
month_amount = fields.Float(string="Sponsorship Amount", related="sponsorship_id.contribution_value",store=True, readonly=True)
amount = fields.Float(string="Total Amount", compute="get_amount_month", store=True)
currency_id = fields.Many2one('res.currency', string='Currency',
default=lambda self: self.env.company.currency_id, readonly=True)
iban = fields.Char(string='IBAN / Account Number', tracking=True)
transfer_receipt = fields.Binary(string='Transfer Receipt')
bank_id = fields.Many2one('res.bank', string="Bank Name")

View File

@ -31,7 +31,9 @@
<field name="direct_debit_end_date" attrs="{'invisible': [('payment_method','!=','direct_debit')]}"/>
<field name="donation_date"/>
<field name="charity_journal_id" attrs="{'invisible': [('payment_method','!=','card'),('payment_method','!=','credit_card')]}"/>
<field name="donation_amount" readonly="1" force_save="1"/>
<field name="currency_id" invisible="1"/>
<field name="donation_amount" widget="monetary"
options="{'currency_field': 'currency_id'}" readonly="1" force_save="1"/>
<field name="sponsorship_id" invisible="1" readonly="1" force_save="1"/>
<field name="account_payment_method" attrs="{'invisible': [('payment_method','!=','card'),('payment_method','!=','credit_card')]}"/>
<field name="note"/>

View File

@ -32,17 +32,11 @@
<field name="has_bank_account" attrs="{'invisible': [('payment_method', '=', 'cash')]}" style="margin-bottom:10px;"/>
<label for="month_amount"/>
<div>
<field name="month_amount" force_save="1" class="oe_inline" style="margin-right:50px; margin-bottom:20px;"/>
<span class="oe_inline text-muted"> Riyal</span>
</div>
<label for="amount" />
<div>
<field name="amount" readonly="1" class="oe_inline" style="margin-right:50px;"/>
<span class="oe_inline text-muted"> Riyal</span>
</div>
<field name="currency_id" invisible="1"/>
<field name="month_amount" widget="monetary"
options="{'currency_field': 'currency_id'}" force_save="1"/>
<field name="amount" widget="monetary"
options="{'currency_field': 'currency_id'}" readonly="1"/>
</group>
<group name="group_right" attrs="{'invisible': [('payment_method', '=', 'cash')]}">
@ -73,8 +67,9 @@
<tree string="Payments List" decoration-danger="state=='financial'" decoration-success="state=='paid'">
<field name="sponsor_id"/>
<field name="code"/>
<field name="amount" sum="Total Payments" widget="monetary"/>
<field name="date"/>
<field name="amount" sum="Total Payments" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" invisible="1"/>
<field name="date" widget="date"/>
<field name="state"/>
</tree>
</field>

View File

@ -11,7 +11,10 @@
<field name="name" required="1"/>
<field name="donation_type" required="1"/>
<field name="fixed_value"/>
<field name="fixed_donation_amount" attrs="{'invisible': [('fixed_value', '=', False)],'required': [('fixed_value', '=', True)]}"/>
<field name="currency_id" invisible="1"/>
<field name="fixed_donation_amount" widget="monetary"
options="{'currency_field': 'currency_id'}"
attrs="{'invisible': [('fixed_value', '=', False)],'required': [('fixed_value', '=', True)]}"/>
</group>
<group>
<field name="branch_custom_id" required="1"/>

View File

@ -30,7 +30,9 @@
<field name="benefit_id" attrs="{'invisible': [('benefit_ids','=', False)]}"/>
<field name="benefit_ids" attrs="{'invisible': [('benefit_id','!=', False)]}"/>
<field name="operation_type"/>
<field name="amount"/>
<field name="currency_id" invisible="1"/>
<field name="amount" widget="monetary"
options="{'currency_field': 'currency_id'}"/>
<field name="note"/>
<field name="date"/>
<field name="entry_id" invisible='1'/>
@ -49,8 +51,9 @@
<field name="name"/>
<field name="sponsor_id"/>
<field name="operation_type"/>
<field name="amount"/>
<field name="date"/>
<field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" invisible="1"/>
<field name="date" widget="datetime"/>
</tree>
</field>
</record>
@ -64,8 +67,8 @@
<field name="name"/>
<field name="sponsor_id"/>
<field name="operation_type"/>
<field name="amount"/>
<field name="date"/>
<field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="date" widget="datetime"/>
</search>
</field>
</record>

View File

@ -69,8 +69,10 @@
<field name="due_date" />
<field name="journal_id" readonly="1" />
<field name="paid_amount" readonly="1" />
<field name="payment_date" readonly="1" />
<field name="currency_id" invisible="1"/>
<field name="paid_amount" widget="monetary"
options="{'currency_field': 'currency_id'}" readonly="1" />
<field name="payment_date" widget="date" readonly="1" />
<field name="benefit_target" readonly="1" />
<field name="note" readonly="1" />
@ -106,9 +108,10 @@
<field name="benefit_target" />
<field name="benefit_ids" widget="many2many_tags" />
<field name="partner_id" />
<field name="due_date" />
<field name="payment_date" />
<field name="paid_amount" />
<field name="due_date" widget="date"/>
<field name="payment_date" widget="date"/>
<field name="paid_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" invisible="1"/>
<field name="is_recorded" />
</tree>
</field>
@ -160,16 +163,21 @@
<field name="benefit_id" required="1" />
<field name="benefit_type" readonly="1" />
<field name="month_amount" readonly="1" />
<field name="currency_id" invisible="1"/>
<field name="month_amount" widget="monetary"
options="{'currency_field': 'currency_id'}" readonly="1" />
<field name="arrears_month_number" readonly="1" />
<field name="arrears_total" readonly="1" />
<field name="date" readonly="1" />
<field name="arrears_total" widget="monetary"
options="{'currency_field': 'currency_id'}" readonly="1" />
<field name="date" widget="date" readonly="1" />
</group>
<group string="Payment Information">
<field name="arrears_amount" readonly="1" />
<field name="paid_amount" readonly="1" />
<field name="arrears_amount" widget="monetary"
options="{'currency_field': 'currency_id'}" readonly="1" />
<field name="paid_amount" widget="monetary"
options="{'currency_field': 'currency_id'}" readonly="1" />
<field name="invoice_ids" widget="one2many" />
</group>
</sheet>
@ -188,11 +196,12 @@
<field name="sponsor_id" />
<field name="benefit_id" />
<field name="benefit_type" />
<field name="date" />
<field name="date" widget="date"/>
<field name="arrears_month_number" />
<field name="arrears_total" />
<field name="arrears_amount" />
<field name="paid_amount" />
<field name="arrears_total" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="arrears_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="paid_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" invisible="1"/>
</tree>
</field>
</record>
@ -206,11 +215,11 @@
<field name="sponsor_id" />
<field name="benefit_id" />
<field name="benefit_type" />
<field name="date" />
<field name="date" widget="date"/>
<field name="arrears_month_number" />
<field name="arrears_total" />
<field name="arrears_amount" />
<field name="paid_amount" />
<field name="arrears_total" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="arrears_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="paid_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</search>
</field>
</record>

View File

@ -49,10 +49,12 @@
<group col="4" colspan="2">
<field name="date" attrs="{'readonly':[('state','!=','draft')],'required':True}"/>
<field name="date" widget="date" attrs="{'readonly':[('state','!=','draft')],'required':True}"/>
<field name="user_id" readonly="1" force_save="1"/>
<field name="entry_id" readonly="1" force_save="1"/>
<field name="amount"
<field name="currency_id" invisible="1"/>
<field name="amount" widget="monetary"
options="{'currency_field': 'currency_id'}"
attrs="{'readonly':[('state','!=','draft')],'required':True}"/>
</group>