Skip to content

[19.0][ADD] sale_order_line_section#4260

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
camptocamp:19.0-add-sale_order_line_section
May 6, 2026
Merged

[19.0][ADD] sale_order_line_section#4260
OCA-git-bot merged 1 commit into
OCA:19.0from
camptocamp:19.0-add-sale_order_line_section

Conversation

@santostelmo
Copy link
Copy Markdown
Contributor

@santostelmo santostelmo commented Apr 8, 2026

This module adds a stored Section field on sale order lines.

In standard Odoo, the relation between a line and its section is only implicit:
a line belongs to the nearest previous section according to the order sequence.
This is inconvenient for domains, grouping, reporting, or custom business logic
because there is no direct field to use.

With this module, each non-section sale order line is linked to its nearest
previous section line.

Typical use cases include:

  • grouping sale order lines by section in tree views, exports, or reports;
  • filtering all lines that belong to a given section without recomputing the
    relation from the sequence;

@santostelmo santostelmo force-pushed the 19.0-add-sale_order_line_section branch 2 times, most recently from 10bc92a to b9f0288 Compare April 8, 2026 12:06
@santostelmo santostelmo changed the title [ADD] sale_order_line_section [19.0][ADD] sale_order_line_section Apr 8, 2026
Comment thread sale_order_line_section/models/sale_order_line.py Outdated
@santostelmo santostelmo force-pushed the 19.0-add-sale_order_line_section branch 2 times, most recently from c960e20 to d936145 Compare April 8, 2026 12:54
@cyrilmanuel
Copy link
Copy Markdown

hi @pedrobaeza could you merge this pr please :)

Copy link
Copy Markdown

@Ricardoalso Ricardoalso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably need a migration script to compute section_id for all existing records

@pedrobaeza pedrobaeza added this to the 19.0 milestone Apr 9, 2026
@pedrobaeza
Copy link
Copy Markdown
Member

More than a migration script, it should be a pre-init hook for avoiding a big delay installing the module in a populated DB with lots of sale.order.line.

@santostelmo santostelmo force-pushed the 19.0-add-sale_order_line_section branch from d936145 to a4f04ae Compare April 9, 2026 07:48
@santostelmo
Copy link
Copy Markdown
Contributor Author

@Ricardoalso @pedrobaeza pre-init hook added to create column and populate stored field values via sql

Comment thread sale_order_line_section/hooks.py Outdated
@santostelmo santostelmo force-pushed the 19.0-add-sale_order_line_section branch from a4f04ae to eb6942b Compare April 9, 2026 08:06
@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link
Copy Markdown
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure to understand what is the purpose of this module 🤔
Is it to have a different report? To view lines grouped in a search view?
The description might benefit from real use case examples.

Comment thread sale_order_line_section/models/sale_order_line.py
Comment thread sale_order_line_section/tests/test_sale_order_line_section.py
Comment thread sale_order_line_section/tests/test_sale_order_line_section.py Outdated
@santostelmo
Copy link
Copy Markdown
Contributor Author

I'm not sure to understand what is the purpose of this module 🤔 Is it to have a different report? To view lines grouped in a search view? The description might benefit from real use case examples.

I improved the description to better explain the use case of this module

Comment thread sale_order_line_section/models/sale_order_line.py
Comment thread sale_order_line_section/models/sale_order_line.py Outdated
@santostelmo santostelmo force-pushed the 19.0-add-sale_order_line_section branch from 0bba2d8 to b069029 Compare May 6, 2026 04:57
@santostelmo santostelmo requested a review from simahawk May 6, 2026 04:59
@santostelmo
Copy link
Copy Markdown
Contributor Author

@simahawk can you please have a look. Still any blocking point ?

@@ -0,0 +1,15 @@
This module adds a stored Section field on sale order lines.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@simahawk
Copy link
Copy Markdown
Contributor

simahawk commented May 6, 2026

/ocabot merge nobump

@OCA-git-bot
Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 19.0-ocabot-merge-pr-4260-by-simahawk-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 38cf273. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit d8d10cf into OCA:19.0 May 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants