-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[19.0][ADD] sale_section_stock_move #4261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
santostelmo
wants to merge
1
commit into
OCA:19.0
Choose a base branch
from
camptocamp:19.0-add-sale_section_stock_move
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| .. image:: https://odoo-community.org/readme-banner-image | ||
| :target: https://odoo-community.org/get-involved?utm_source=readme | ||
| :alt: Odoo Community Association | ||
|
|
||
| ======================= | ||
| sale_section_stock_move | ||
| ======================= | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:1a15957a7c317b5ac5c3812ac5ec0227e3470b1cacc0023c2c642ac5178c10a9 | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |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/license-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%2Fsale--workflow-lightgray.png?logo=github | ||
| :target: https://github.com/OCA/sale-workflow/tree/19.0/sale_section_stock_move | ||
| :alt: OCA/sale-workflow | ||
| .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
| :target: https://translation.odoo-community.org/projects/sale-workflow-19-0/sale-workflow-19-0-sale_section_stock_move | ||
| :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/sale-workflow&target_branch=19.0 | ||
| :alt: Try me on Runboat | ||
|
|
||
| |badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
|
||
| This module propagates sale order section information to stock | ||
| operations. | ||
|
|
||
| It adds a Sale Section on stock moves from the related sale order line | ||
| section, and exposes the section name on stock moves and stock move | ||
| lines. | ||
|
|
||
| The section information is available in stock move and stock move line | ||
| list views, search filters, group by options, and in the Operations tab | ||
| of stock pickings. | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/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/sale-workflow/issues/new?body=module:%20sale_section_stock_move%0Aversion:%2019.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 | ||
| ------- | ||
|
|
||
| * Camptocamp | ||
|
|
||
| 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/sale-workflow <https://github.com/OCA/sale-workflow/tree/19.0/sale_section_stock_move>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Copyright 2026 Camptocamp SA | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
|
||
|
|
||
| { | ||
| "name": "sale_section_stock_move", | ||
| "summary": "Sale section on stock moves", | ||
| "version": "19.0.1.0.0", | ||
| "category": "Sale", | ||
| "website": "https://github.com/OCA/sale-workflow", | ||
| "author": "Camptocamp, Odoo Community Association (OCA)", | ||
| "license": "AGPL-3", | ||
| "application": False, | ||
| "installable": True, | ||
| "depends": [ | ||
| "sale_stock", | ||
| "sale_order_line_section", | ||
| ], | ||
| "data": [ | ||
| "views/stock_picking_views.xml", | ||
| ], | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * sale_section_stock_move | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 19.0+e\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "POT-Creation-Date: 2026-04-08 11:50+0000\n" | ||
| "PO-Revision-Date: 2026-04-08 11:50+0000\n" | ||
| "Last-Translator: \n" | ||
| "Language-Team: \n" | ||
| "Language: fr\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: 8bit\n" | ||
| "Plural-Forms: nplurals=2; plural=(n > 1);\n" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move__display_name | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move_line__display_name | ||
| msgid "Display Name" | ||
| msgstr "Nom Affiche" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move__id | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move_line__id | ||
| msgid "ID" | ||
| msgstr "ID" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model,name:sale_section_stock_move.model_stock_move_line | ||
| msgid "Product Moves (Stock Move Line)" | ||
| msgstr "Mouvements Produit (Ligne Mouvement Stock)" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.stock_move_line_view_search | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.view_move_search | ||
| msgid "Sale Order" | ||
| msgstr "Commande Client" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move__sale_section_id | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move_line__sale_section_id | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.stock_move_line_view_search | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.view_move_search | ||
| msgid "Sale Section" | ||
| msgstr "Section Vente" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.stock_move_line_view_search | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.view_move_search | ||
| msgid "Section" | ||
| msgstr "Section" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move__sale_section_name | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move_line__sale_section_name | ||
| msgid "Section Name" | ||
| msgstr "Nom Section" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model,name:sale_section_stock_move.model_stock_move | ||
| msgid "Stock Move" | ||
| msgstr "Mouvement Stock" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * sale_section_stock_move | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 19.0+e\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "POT-Creation-Date: 2026-04-08 11:50+0000\n" | ||
| "PO-Revision-Date: 2026-04-08 11:50+0000\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: sale_section_stock_move | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move__display_name | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move_line__display_name | ||
| msgid "Display Name" | ||
| msgstr "" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move__id | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move_line__id | ||
| msgid "ID" | ||
| msgstr "" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model,name:sale_section_stock_move.model_stock_move_line | ||
| msgid "Product Moves (Stock Move Line)" | ||
| msgstr "" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.stock_move_line_view_search | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.view_move_search | ||
| msgid "Sale Order" | ||
| msgstr "" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move__sale_section_id | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move_line__sale_section_id | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.stock_move_line_view_search | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.view_move_search | ||
| msgid "Sale Section" | ||
| msgstr "" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.stock_move_line_view_search | ||
| #: model_terms:ir.ui.view,arch_db:sale_section_stock_move.view_move_search | ||
| msgid "Section" | ||
| msgstr "" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move__sale_section_name | ||
| #: model:ir.model.fields,field_description:sale_section_stock_move.field_stock_move_line__sale_section_name | ||
| msgid "Section Name" | ||
| msgstr "" | ||
|
|
||
| #. module: sale_section_stock_move | ||
| #: model:ir.model,name:sale_section_stock_move.model_stock_move | ||
| msgid "Stock Move" | ||
| msgstr "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| from . import stock_move | ||
| from . import stock_move_line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Copyright 2026 Camptocamp SA | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class StockMove(models.Model): | ||
| _inherit = "stock.move" | ||
|
|
||
| sale_section_id = fields.Many2one( | ||
| comodel_name="sale.order.line", | ||
| string="Sale Section", | ||
| related="sale_line_id.section_id", | ||
| store=True, | ||
| readonly=True, | ||
| index="btree_not_null", | ||
| ) | ||
| sale_section_name = fields.Text( | ||
| string="Section Name", | ||
| related="sale_section_id.name", | ||
| store=True, | ||
| readonly=True, | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Copyright 2026 Camptocamp SA | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class StockMoveLine(models.Model): | ||
| _inherit = "stock.move.line" | ||
|
|
||
| sale_section_id = fields.Many2one( | ||
| comodel_name="sale.order.line", | ||
| string="Sale Section", | ||
| related="move_id.sale_section_id", | ||
| store=True, | ||
| readonly=True, | ||
| index="btree_not_null", | ||
| ) | ||
| sale_section_name = fields.Text( | ||
| string="Section Name", | ||
| related="sale_section_id.name", | ||
| store=True, | ||
| readonly=True, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [build-system] | ||
| requires = ["whool"] | ||
| build-backend = "whool.buildapi" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * Telmo Santos <telmo.santos@camptocamp.com> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| This module propagates sale order section information to stock operations. | ||
|
|
||
| It adds a Sale Section on stock moves from the related sale order line section, | ||
| and exposes the section name on stock moves and stock move lines. | ||
|
|
||
| The section information is available in stock move and stock move line list views, | ||
| search filters, group by options, and in the Operations tab of stock pickings. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this relevant for ALL moves and move lines? 🤔
A change on so line section might have a big perf impact. no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this relevant for ALL moves and move lines?
The fields are added on stock.move and stock.move.line, so the columns exist for all records, but they’ll only be filled (non-null) for moves/move lines that come from a sale order line (sale_line_id) and where that sale line has a section (section_id). For other moves (inventory, manufacturing, purchase, etc.) it stays empty.
A change on so line section might have a big perf impact. no?
It can, yes.
Because sale_section_id / sale_section_name are stored related fields, if you change the section on a sale order line, Odoo may need to recompute + write the stored value on all dependent records:
So if someone bulk-updates sections on confirmed orders with lots of moves/move lines, that can trigger a large cascade of writes (and be noticeable on big DBs).
If section changes are rare, the impact is usually limited.
Another option:
Make sale_section_* non-stored computed/related fields.