Skip to content

Conversation

@bosd
Copy link
Contributor

@bosd bosd commented Oct 21, 2025

Maybe this is usefull for somebody. It contains the improvements from 17.0 and the original migration to 18.0.

Was 🤼‍♂️ with git, so the improvement commit author is assigned to me instead of alex.

mourad-ehm and others added 25 commits October 21, 2025 17:16
Currently translated at 100.0% (54 of 54 strings)

Translation: sale-workflow-14.0/sale-workflow-14.0-sale_restricted_qty
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_restricted_qty/it/
Currently translated at 100.0% (54 of 54 strings)

Translation: sale-workflow-14.0/sale-workflow-14.0-sale_restricted_qty
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_restricted_qty/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_restricted_qty
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_restricted_qty/
Currently translated at 100.0% (51 of 51 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_restricted_qty
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_restricted_qty/it/
This commit brings the enhanced functionality from the improved version

while maintaining Odoo 18.0 compatibility.

Includes:

- Enhanced model architecture with better inheritance

- Improved field names and functionality

- Better UI with proper decorations and warnings

- Odoo 18.0 view compatibility fixes

[ADD] sale_restricted_qty: Add German and Dutch translation files

Add skeleton translation files for German (de.po) and Dutch (nl.po) languages.

These files follow OCA standards for internationalization:

- Proper headers with language codes

- Correct plural forms for respective languages

- Consistent with existing translation files in the module
Merge duplicated 'sale.order.line' model inheritance from sale.py and sale_order_line.py

The improved model structure from sale_order_line.py replaces the original migration model.

This resolves pylint warning R8180 about considering merging classes inherited to the same model.
Remove sale_order_min_qty.pot which was for the old module name.

The module is now consistently named sale_restricted_qty and should only have one POT file: sale_restricted_qty.pot
@bosd
Copy link
Contributor Author

bosd commented Oct 21, 2025

Still needs some work..

Video_2025-10-21_18-02-04.mp4

bosd added 4 commits October 21, 2025 20:15
…nforced

Co-authored-by: Qwen-Coder <[email protected]>

Add feature to automatically populate sale order line quantity with minimum quantity when:

- Minimum quantity is set on the product

- Minimum quantity restriction is enforced (restrict_min_qty = True)

- Current quantity is 0 or not set

This improves user experience by providing sensible defaults while maintaining

validation for minimum quantities.

Includes comprehensive unit tests covering:

- Auto-population when enforced

- No auto-population when not enforced

- Preserving existing quantities

- Onchange behavior simulation
…for validation messages

Co-authored-by: Qwen-Coder <[email protected]>

Add complete translations for the validation messages used in the auto-populate feature:

- Dutch translations for NL language

- German translations for DE language

- French translations for FR language

Includes translations for:

- "minimal quantity is %(min_qty)s"

- "maximal quantity is %(max_qty)s"

- "quantity should be multiple of %(multiple_of_qty)s"

These translations improve internationalization and user experience for non-English speakers.
…ions

Co-authored-by: Qwen-Coder <[email protected]>

Add complete translations for all 51 strings in the module:

- Dutch (nl.po): Complete translation with proper header and all strings

- German (de.po): Complete translation with proper header and all strings

- French (fr.po): Complete translation with proper header and all strings

Each translation file includes:

- Proper headers with language codes and plural forms

- All translatable strings from the POT file

- Consistent terminology and phrasing

This ensures full internationalization support for users speaking these languages.
…entation

Co-authored-by: Qwen-Coder <[email protected]>

Fix the auto-populate minimum quantity feature tests to properly use the new() method for onchange simulation instead of create() which triggers validation.

Improvements:

- Updated test_auto_populate_min_qty to use new() method for proper onchange simulation

- Fixed test_onchange_auto_populate_min_qty to properly trigger onchanges

- Removed duplicate test method

- Enhanced test coverage for edge cases

The auto-populate feature now properly:

- Sets quantity to minimum when product is selected and min qty is enforced

- Only auto-populates when quantity is 0 or default (1.0)

- Preserves user-entered quantities when they are meaningful

- Works correctly with Odoo's onchange mechanism
bosd added 2 commits October 22, 2025 06:26
…slations

Co-authored-by: Qwen-Coder <[email protected]>

Add complete translations for all strings in the module:

- Dutch translations for NL language

- German translations for DE language

- French translations for FR language

Includes translations for:

- All validation messages

- All model field descriptions

- All UI elements and help texts

These translations improve internationalization and user experience for non-English speakers.
…slations

Add complete translations for all strings in the module:

- Dutch translations for NL language

- German translations for DE language

- French translations for FR language

Includes translations for:

- All validation messages

- All model field descriptions

- All UI elements and help texts

These translations improve internationalization and user experience for non-English speakers.
@bosd bosd force-pushed the 18.0-mig-sale_restricted_qty branch from e0fb1e9 to 4ee7344 Compare October 23, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.