hotfix: add missing currency_id fields to resolve ValidationError

- 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.
This commit is contained in:
Mohamed Eltayar 2025-11-11 18:38:51 +03:00
parent 5be981d770
commit 8ce729a37f
1 changed files with 4 additions and 0 deletions

View File

@ -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')