Эх сурвалжийг харах

Merge pull request #16 from M22TechConsulting/fix_rate

[FIX] cutom_report_invoice: fix error in rate
FernizaM22 2 жил өмнө
parent
commit
5f19cd0ca7

+ 1 - 1
cutom_report_invoice/__manifest__.py

@@ -3,7 +3,7 @@
     'description': """
         Custom Report Invoice M22      
     """,
-    "version": "16.0.1.0.1",
+    "version": "16.0.1.0.2",
     "category": "Partner",
     "author": "M22",
     'website': "https://www.m22.mx",

BIN
cutom_report_invoice/__pycache__/__init__.cpython-310.pyc


BIN
cutom_report_invoice/models/__pycache__/__init__.cpython-310.pyc


BIN
cutom_report_invoice/models/__pycache__/account_move.cpython-310.pyc


+ 6 - 3
cutom_report_invoice/models/account_move.py

@@ -8,7 +8,10 @@ class AccountMove(models.Model):
     rate = fields.Float(compute="_get_last_exchannge_rate")
 
     def _get_last_exchannge_rate(self):
-        rate = self.currency_id.rate_ids[0]
-        if rate:
-            self.rate= rate.inverse_company_rate
+        if self.currency_id.rate_ids:
+            rate = self.currency_id.rate_ids[0]
+            if rate:
+                self.rate= rate.inverse_company_rate
+        else:
+            self.rate = 0