diff --git a/maintenance_request_purchase/models/maintenance_request.py b/maintenance_request_purchase/models/maintenance_request.py index 934fa318a..7a7a276ae 100644 --- a/maintenance_request_purchase/models/maintenance_request.py +++ b/maintenance_request_purchase/models/maintenance_request.py @@ -59,7 +59,10 @@ def _compute_total_purchase_amount(self): po.currency_id._convert( po.amount_total, company_currency, - record.company_id, + # maintenance.request.company_id is optional; use each + # purchase order's own company (always set) so the rate + # context is deterministic and never empty. + po.company_id, date, ) for po in record.purchase_order_ids.filtered( diff --git a/maintenance_request_purchase/readme/CONTRIBUTORS.rst b/maintenance_request_purchase/readme/CONTRIBUTORS.rst index 0c8996032..98e5e2917 100644 --- a/maintenance_request_purchase/readme/CONTRIBUTORS.rst +++ b/maintenance_request_purchase/readme/CONTRIBUTORS.rst @@ -2,3 +2,7 @@ * Jaime Arroyo * Olga Marco * NĂºria Sancho + +* `NuoBiT `__: + + * Eric Antones