Skip to content

[19.0][ADD] sale_order_line_section#4260

Open
santostelmo wants to merge 1 commit intoOCA:19.0from
camptocamp:19.0-add-sale_order_line_section
Open

[19.0][ADD] sale_order_line_section#4260
santostelmo wants to merge 1 commit intoOCA:19.0from
camptocamp:19.0-add-sale_order_line_section

Conversation

@santostelmo
Copy link
Copy Markdown
Contributor

This module allows organizing and managing sale order lines by section.

It computes a Section field on each sale order line so that non-section
lines are linked to the nearest previous section line in the order
sequence.

This makes it easier to group, filter, and analyze sale order lines by
section.

@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
_logger = logging.getLogger(__name__)


def _column_exists(cr, table_name, column_name):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can use from odoo.tools.sql import column_exists

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you're right. I updated the code to use odoo.tools.sql

@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). 🤖

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.

6 participants