From a4144c75f1b88963d466278e1c9b1d33961f4947 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?=
Date: Fri, 28 Jun 2024 08:46:45 +0200
Subject: [PATCH 1/2] [FIX] rma: Make the quantity comparison correctly (with
precision_digits)
Fixes https://github.com/OCA/rma/issues/398
---
rma/models/stock_move.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/rma/models/stock_move.py b/rma/models/stock_move.py
index 8d992561..10cf0c8c 100644
--- a/rma/models/stock_move.py
+++ b/rma/models/stock_move.py
@@ -3,6 +3,7 @@
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
+from odoo.tools import float_compare
class StockMove(models.Model):
@@ -59,7 +60,18 @@ class StockMove(models.Model):
"""
for move in self.filtered(lambda r: r.state not in ("done", "cancel")):
rma_receiver = move.sudo().rma_receiver_ids
- if rma_receiver and move.quantity_done != rma_receiver.product_uom_qty:
+ qty_prec = self.env["decimal.precision"].precision_get(
+ "Product Unit of Measure"
+ )
+ if (
+ rma_receiver
+ and float_compare(
+ move.quantity_done,
+ rma_receiver.product_uom_qty,
+ precision_digits=qty_prec,
+ )
+ != 0
+ ):
raise ValidationError(
_(
"The quantity done for the product '%(id)s' must "
From a2c3b27149d553a7bd09ce7e2e9b2738418a06bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?=
Date: Fri, 28 Jun 2024 08:50:26 +0200
Subject: [PATCH 2/2] [FIX] rma: Change to the correct maintainer
---
rma/README.rst | 8 ++++----
rma/__manifest__.py | 2 +-
rma/static/description/index.html | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/rma/README.rst b/rma/README.rst
index 107d9bfd..bee9f043 100644
--- a/rma/README.rst
+++ b/rma/README.rst
@@ -179,13 +179,13 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-.. |maintainer-chiendandalu| image:: https://github.com/chiendandalu.png?size=40px
- :target: https://github.com/chiendandalu
- :alt: chiendandalu
+.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px
+ :target: https://github.com/chienandalu
+ :alt: chienandalu
Current `maintainer `__:
-|maintainer-chiendandalu|
+|maintainer-chienandalu|
This module is part of the `OCA/rma `_ project on GitHub.
diff --git a/rma/__manifest__.py b/rma/__manifest__.py
index 0dbac08d..50ba4834 100644
--- a/rma/__manifest__.py
+++ b/rma/__manifest__.py
@@ -8,7 +8,7 @@
"category": "RMA",
"website": "https://github.com/OCA/rma",
"author": "Tecnativa, Odoo Community Association (OCA)",
- "maintainers": ["chiendandalu"],
+ "maintainers": ["chienandalu"],
"license": "AGPL-3",
"depends": ["stock_account"],
"data": [
diff --git a/rma/static/description/index.html b/rma/static/description/index.html
index 48bf9f1e..8683d5f0 100644
--- a/rma/static/description/index.html
+++ b/rma/static/description/index.html
@@ -528,7 +528,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
mission is to support the collaborative development of Odoo features and
promote its widespread use.
Current maintainer:
-
+
This module is part of the OCA/rma project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.