[REF] product_origin_char: simplify to template-based origin

- Move origin_text field from product.supplierinfo to product.template
- Add related field in product.product for variant access
- Remove dependency on product_main_seller
- Update views to show field near category (editable)
- Rewrite tests for new architecture
- Update all documentation (README, readme/ fragments)
- Bump version to 18.0.2.0.0
This commit is contained in:
snt 2026-03-06 17:43:20 +01:00
parent e2ced75ecd
commit 5efe57dc19
15 changed files with 180 additions and 402 deletions

View file

@ -1,4 +1,4 @@
No configuration is needed. The module works automatically after installation.
The origin text displayed on a product is based on the **main vendor** as determined
by ``product_main_seller`` (the first supplier in the vendors list).
The origin field appears in the product form view (next to category) and can be
enabled as an optional column in list views.

View file

@ -1,5 +1,4 @@
This module replaces the structured country/state origin fields from ``product_origin``
with a flexible free-text field that can be defined per supplier.
This module adds a simple free-text ``origin_text`` field to products.
**Problem:**
@ -17,18 +16,15 @@ These free-form descriptions don't fit into structured country/state fields.
**Solution:**
This module adds a translatable ``origin_text`` field to ``product.supplierinfo`` that:
This module adds a simple ``origin_text`` field to ``product.template`` that:
* Allows free-form text to describe product origin
* Is stored per supplier (different suppliers may have different origin info)
* Is translatable (can be described differently in each language)
* Is automatically displayed on the product based on the main vendor
(from ``product_main_seller`` module)
* Is accessible from product variants via related field
* Works with any product workflow
**Features:**
* Free-text ``Origin`` field in supplier info (Purchase tab of product)
* Computed ``Origin`` field in product form (shows main vendor's origin)
* Field is visible in product list view (optional column)
* Full translation support for multiple languages
* Compatible with existing supplier management workflows
* Free-text ``Origin`` field in product form
* Field visible in product list views (optional column)
* Variants share the same origin as their template
* Editable from both template and variant views

View file

@ -1,7 +1,6 @@
This module depends on:
* ``product`` - Base product management
* ``product_main_seller`` - To determine the main vendor for products
To install:

View file

@ -1,26 +1,18 @@
**To add origin information to a product:**
#. Go to a product form
#. Open the **Purchase** tab
#. In the **Vendors** section, select a supplier line
#. Fill in the **Origin** field with free-form text describing the origin
(e.g., "Valencia, Huerta de..., Spain")
#. Find the **Origin** field (near the product category)
#. Fill in the origin with free-form text
(e.g., "Valencia, Spain", "Local producer - Basque Country")
#. Save the product
**To view origin information:**
**To view origin information in lists:**
* The **Origin** field will be automatically displayed on the product form
(below the **Main Vendor** field in the Purchase tab)
* The origin shown is from the **main vendor** (first supplier in the list)
* You can also add the Origin column to product list views
* In product list views, enable the optional "Origin" column
* The origin is shown for both product templates and variants
**To change the displayed origin:**
**Product variants:**
* Reorder the vendors list to change which is the main vendor
* The origin text will automatically update to show the new main vendor's origin
**Multi-language support:**
* The origin text is translatable
* Switch to another language and edit the supplier info to provide a translation
* Each language can have a different description of the origin
* All variants of a product template share the same origin
* Updating the origin on any variant updates the template
* This ensures consistency across all variants