Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions rma_sale_stock_picking_group_by_partner_by_carrier/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
==================================================
RMA Sale Stock Picking Group By Partner By Carrier
==================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5b15b6fe815b67e8c48bcf227379738fc6fa7d0f8e9fd78469bc3a58ce02a073
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/18.0/rma_sale_stock_picking_group_by_partner_by_carrier
:alt: OCA/rma
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/rma-18-0/rma-18-0-rma_sale_stock_picking_group_by_partner_by_carrier
: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=18.0
:alt: Try me on Runboat

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

When ``stock_picking_group_by_partner_by_carrier`` is installed, sale
order pickings are linked via a ``Many2many`` field (``sale_ids``) on
the procurement group instead of the standard ``Many2one``
(``sale_id``).

The ``rma_sale`` module only populates ``sale_id`` when creating the RMA
procurement group. As a result, RMA return pickings become invisible
from the sale order's "Deliveries" button.

This glue module bridges ``sale_id`` → ``sale_ids`` on the procurement
group so that RMA return pickings remain visible from the sale order.

**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_sale_stock_picking_group_by_partner_by_carrier%0Aversion:%2018.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

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

- Souheil Bejaoui - ACSONE SA/NV souheil.bejaoui@acsone.eu

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.

.. |maintainer-sbejaoui| image:: https://github.com/sbejaoui.png?size=40px
:target: https://github.com/sbejaoui
:alt: sbejaoui

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sbejaoui|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions rma_sale_stock_picking_group_by_partner_by_carrier/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "RMA Sale Stock Picking Group By Partner By Carrier",
"summary": "Bridge RMA sale procurement groups with grouped pickings",
"version": "18.0.1.0.0",
"development_status": "Beta",
"category": "RMA",
"website": "https://github.com/OCA/rma",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"maintainers": ["sbejaoui"],
"license": "AGPL-3",
"installable": True,
"auto_install": True,
"depends": [
"rma_sale",
"stock_picking_group_by_partner_by_carrier",
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import rma
24 changes: 24 additions & 0 deletions rma_sale_stock_picking_group_by_partner_by_carrier/models/rma.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import Command, models


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

def _prepare_procurement_group_vals(self):
# Bridge sale_id (M2O) → sale_ids (M2M) on the procurement group.
# stock_picking_group_by_partner_by_carrier computes
# stock.picking.sale_ids from move_ids.group_id.sale_ids (M2M),
# but rma_sale only sets sale_id (M2O). Without this bridge,
# RMA return pickings are invisible from the SO "Deliveries" button.
vals = super()._prepare_procurement_group_vals()
sale_id = vals.get("sale_id")
sale_ids = vals.get("sale_ids")
if sale_id:
if sale_ids:
sale_ids.append(Command.link(sale_id))
else:
vals["sale_ids"] = [Command.link(sale_id)]
return vals
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Souheil Bejaoui - ACSONE SA/NV <souheil.bejaoui@acsone.eu>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
When ``stock_picking_group_by_partner_by_carrier`` is installed, sale order
pickings are linked via a ``Many2many`` field (``sale_ids``) on the procurement
group instead of the standard ``Many2one`` (``sale_id``).

The ``rma_sale`` module only populates ``sale_id`` when creating the RMA
procurement group. As a result, RMA return pickings become invisible from the
sale order's "Deliveries" button.

This glue module bridges ``sale_id`` → ``sale_ids`` on the procurement group so
that RMA return pickings remain visible from the sale order.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading