From 8ce729a37f6c18bff6539d722b76d4ef4780a030 Mon Sep 17 00:00:00 2001 From: Mohamed Eltayar Date: Tue, 11 Nov 2025 18:38:51 +0300 Subject: [PATCH] hotfix: add missing currency_id fields to resolve ValidationError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add currency_id field to payment.details.lines model (PaymentDetailsLines class) - Add currency_id field to refund.details.lines model (RefundDetailsLines class) - Fix ValidationError: Field 'currency_id' does not exist in model 'payment.details.lines' - Ensure all amount fields have corresponding currency_id in their models This resolves the Odoo validation error that occurs when upgrading the module: 'الحقل "currency_id" غير موجود في النموذج "payment.details.lines"' Critical fix for production deployment. --- odex25_ensan/odex_takaful/models/takaful_sponorship_model.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/odex25_ensan/odex_takaful/models/takaful_sponorship_model.py b/odex25_ensan/odex_takaful/models/takaful_sponorship_model.py index b5218990b..2cce09a4f 100644 --- a/odex25_ensan/odex_takaful/models/takaful_sponorship_model.py +++ b/odex25_ensan/odex_takaful/models/takaful_sponorship_model.py @@ -1747,6 +1747,8 @@ class RefundDetailsLines(models.TransientModel): related='sponsorship_id.sponsor_id' ) refund_amount = fields.Float(string='Refund Amount') + currency_id = fields.Many2one('res.currency', string='Currency', + default=lambda self: self.env.company.currency_id, readonly=True) refund_reason = fields.Many2one( 'refund.reasons', string='Refund Reason', @@ -1779,6 +1781,8 @@ class PaymentDetailsLines(models.Model): donation_amount = fields.Float(string='Donation Amount') remaining_amount = fields.Float(string='Remaining Amount') + currency_id = fields.Many2one('res.currency', string='Currency', + default=lambda self: self.env.company.currency_id, readonly=True) donation_date = fields.Date(string='Donation Date',default=lambda self: fields.Date.today(), readonly=True) payment_date = fields.Datetime(string='Payment Date', default=fields.Datetime.now) note = fields.Char(string='Note')