Skip to content

Commit

Permalink
Merge PR #431 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by rousseldenis
  • Loading branch information
OCA-git-bot committed Oct 23, 2024
2 parents 26ef1d1 + 5d2f897 commit d462d2c
Show file tree
Hide file tree
Showing 16 changed files with 810 additions and 0 deletions.
96 changes: 96 additions & 0 deletions rma_lot/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
=======
Rma Lot
=======

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:179ae979736d64a8afa520769acb7d060690a304e812587c70bf43b4542d2ea6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frma-lightgray.png?logo=github
:target: https://github.com/OCA/rma/tree/17.0/rma_lot
:alt: OCA/rma
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/rma-17-0/rma-17-0-rma_lot
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/rma&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Tracking returned products by lot or serial number is crucial for
businesses that require precise monitoring, especially in industries
where quality control, compliance, and inventory accuracy are critical.
By enabling returns to be tracked by lot or serial numbers, this module
ensures that each returned item is handled correctly, reducing the risk
of errors, fraud, or compliance issues.

This level of detail is essential for maintaining the integrity of
inventory records, meeting regulatory requirements, and providing
excellent customer service.

The module extends the existing RMA functionality by adding a lot field
to the RMA model, allowing users to associate returns with specific lot
or serial numbers. This enhancement enforces stricter controls over
return processes, ensuring that only the correct items are accepted
during a return and that inventory records remain accurate.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/rma/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/rma/issues/new?body=module:%20rma_lot%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ACSONE SA/NV
* BCIM

Contributors
------------

- Jacques-Etienne Baudoux - BCIM [email protected]
- Souheil Bejaoui - ACSONE SA/NV [email protected]
- `APSL-Nagarro <https://apsl.tech>`__:

- Antoni Marroig [email protected]

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/17.0/rma_lot>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions rma_lot/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
15 changes: 15 additions & 0 deletions rma_lot/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Rma Lot",
"summary": """
Manage lot in RMA""",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,BCIM,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/rma",
"depends": ["rma", "stock_picking_return_lot"],
"data": ["views/rma.xml"],
"demo": [],
}
34 changes: 34 additions & 0 deletions rma_lot/i18n/rma_lot.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * rma_lot
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: rma_lot
#: model:ir.model.fields,field_description:rma_lot.field_rma__lot_id
msgid "Lot/Serial Number"
msgstr ""

#. module: rma_lot
#: model:ir.model.fields,field_description:rma_lot.field_rma__lots_visible
msgid "Lots Visible"
msgstr ""

#. module: rma_lot
#: model:ir.model,name:rma_lot.model_rma
msgid "RMA"
msgstr ""

#. module: rma_lot
#: model:ir.model,name:rma_lot.model_stock_return_picking_line
msgid "Return Picking Line"
msgstr ""
1 change: 1 addition & 0 deletions rma_lot/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import rma
40 changes: 40 additions & 0 deletions rma_lot/models/rma.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2024 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class Rma(models.Model):
_inherit = "rma"

lot_id = fields.Many2one(
comodel_name="stock.lot",
string="Lot/Serial Number",
domain="[('product_id', '=?', product_id)]",
compute="_compute_lot_id",
store=True,
readonly=False,
)
lots_visible = fields.Boolean(compute="_compute_lots_visible")

@api.depends("product_id.tracking")
def _compute_lots_visible(self):
for rec in self:
rec.lots_visible = rec.product_id.tracking != "none"

def _prepare_reception_procurement_vals(self, group=None):
vals = super()._prepare_reception_procurement_vals(group=group)
vals["restrict_lot_id"] = self.lot_id.id
return vals

@api.depends("move_id", "lot_id")
def _compute_product_id(self):
res = super()._compute_product_id()
for rec in self:
if not rec.move_id and rec.lot_id:
self.product_id = rec.lot_id.product_id
return res

@api.depends("product_id")
def _compute_lot_id(self):
self.update({"lot_id": False})
3 changes: 3 additions & 0 deletions rma_lot/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions rma_lot/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Jacques-Etienne Baudoux - BCIM <[email protected]>
- Souheil Bejaoui - ACSONE SA/NV <[email protected]>
- [APSL-Nagarro](<https://apsl.tech>):
- Antoni Marroig <[email protected]>
15 changes: 15 additions & 0 deletions rma_lot/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Tracking returned products by lot or serial number is crucial for businesses
that require precise monitoring, especially in industries where quality control,
compliance, and inventory accuracy are critical.
By enabling returns to be tracked by lot or serial numbers, this module ensures
that each returned item is handled correctly, reducing the risk of errors,
fraud, or compliance issues.

This level of detail is essential for maintaining the integrity of inventory
records, meeting regulatory requirements, and providing excellent customer service.

The module extends the existing RMA functionality by adding a lot field to the
RMA model, allowing users to associate returns with specific lot or serial numbers.
This enhancement enforces stricter controls over return processes,
ensuring that only the correct items are accepted during a return and that
inventory records remain accurate.
Binary file added rma_lot/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d462d2c

Please sign in to comment.