RM-4145: Contributions
Overview
This development adds a new product type called Contribution as well as extending the Product model configuration through the addition of a Product Subtype. A Contribution can be defined as an extra charge associated with a product, e.g. an "Eco-tax" on a product that contains plastic. Contributions are primarily configured via their product subtype.
What's New
Application Dictionary
New & Modified Tables and Columns
Product Subtype
A record in Tables and Columns has been created for the Product Subtype model with the following configuration:
Table Name | DB Table | Data Package | Java Class | Data Access Level |
---|---|---|---|---|
ProductSubtype | M_Product_Subtype | org.openbravo.model.common.plm | ProductSubtype | Client/Organization |
Column Name | DB Column | Reference |
---|---|---|
Client | AD_Client_ID | TableDir |
linkedToProduct | Islinkedtoproduct | YesNo |
Organization | AD_Org_ID | TableDir |
Product Subtype | M_Product_Subtype_ID | ID |
Price Calculation | Pricecalculation | List |
Created By | Createdby | Search |
Name | Name | String |
Included In Product Price | Includedinproductprice | YesNo |
Description | Description | String |
Creation Date | Created | DateTime |
Search Key | Value | String |
Updated By | Updatedby | Search |
Quantity Rule | Quantity_Rule | List |
Updated | Updated | DateTime |
Active | Isactive | YesNo |
Allocation Type | Allocationtype | List |
Forced In Returns | Forcedinreturns | YesNo |
Product
A new column referencing the Product Subtype table has been added to the Product table with the following values:
Column Name | DB Column | Reference |
---|---|---|
Product Subtype | M_Product_Subtype_ID | TableDir |
New & Modified Windows, Tabs, and Fields
Product Subtype
A window has been created for the Product Subtype table with the following elements:
Window Name | Window Type |
---|---|
Product Subtype | Maintain |
Tab Name | Table | UI Pattern | Tab Level |
---|---|---|---|
Product Subtype | M_Product_Subtype | Standard | 0 |
Field Name | DB Column | Sequence Number | Displayed |
---|---|---|---|
Client | AD_Client_ID | No | |
Product Subtype | M_Product_Subtype_ID | No | |
Organization | AD_Org_ID | 10 | Yes |
Search Key | Value | 20 | Yes |
Name | Name | 30 | Yes |
Active | Isactive | 40 | Yes |
Description | Description | 50 | Yes |
Linkable To Products | Islinkedtoproduct | 60 | Yes |
Price Calculation | Pricecalculation | 70 | Yes |
Included In Product Price | Includedinproductprice | 80 | Yes |
Allocation Type | Allocationtype | 90 | Yes |
Forced In Returns | Forcedinreturns | 100 | Yes |
Quantity Rule | Quantity_Rule | 110 | Yes |
Product
The Product window has been modified with the addition of the following field for Product Subtype:
Field Name | DB Column | Sequence Number | Displayed |
---|---|---|---|
Product Subtype | M_Product_Subtype_ID | 115 | Yes |
The following elements' names have been changed:
Element Type | Previous Name | New Name |
---|---|---|
Tab | Products | Related Products |
Tab | Product Categories | Relate Product Categories |
Field Group | Service Product | Relatable Product |
In addition to the naming changes, several fields had some properties changed:
Field Name | Changes To |
---|---|
Quantity Rule |
|
Product Type |
|
Linked To Product |
|
Relate Products |
|
Relate Prod Categories |
|
Included Products |
|
Included Product Categories |
|
New Menu Item
A new menu entry has been created for the Product Subtype window.
New Message
The following message has been created:
Message Name | Text |
---|---|
M_PRODUCT_CONTRIBUTION_CHECK | If the product is a contribution, a product subtype must be selected. |
New & Modified References
Two new list references have been created with the following values:
List Name | Values |
---|---|
Product Subtype Price Calculation |
|
Product Subtype Allocation Type |
|
The following references have been modified:
List Name | Change |
---|---|
Quantity Rule | Description modified |
M_Product_ProductType | Added new list value: C - "Contribution" |
Data Model
M_PRODUCT_SUBTYPE
A model definition has been created for the Product Subtype model with the following columns:
Column Name | Required | Type | Size | Default |
---|---|---|---|---|
M_PRODUCT_SUBTYPE_ID (PK) | Y | VARCHAR | 32 | |
AD_CLIENT_ID (FK) | Y | VARCHAR | 32 | |
AD_ORG_ID (FK) | Y | VARCHAR | 32 | |
ISACTIVE | Y | CHAR | 1 | Y |
CREATED | Y | TIMESTAMP | 7 | SYSDATE |
CREATEDBY | Y | VARCHAR | 32 | |
UPDATED | Y | TIMESTAMP | 7 | SYSDATE |
UPDATEDBY | Y | VARCHAR | 32 | |
VALUE | Y | VARCHAR | 40 | |
NAME | Y | VARCHAR | 60 | |
DESCRIPTION | N | VARCHAR | 255 | |
ISLINKEDTOPRODUCT | Y | CHAR | 1 | Y |
PRICECALCULATION | Y | VARCHAR | 60 | L |
INCLUDEDINPRODUCTPRICE | Y | CHAR | 1 | N |
ALLOCATIONTYPE | Y | VARCHAR | 60 | M |
FORCEDINRETURNS | Y | CHAR | 1 | Y |
QUANTITY_RULE | Y | VARCHAR | 60 | PP |
The model includes the following foreign key constraints:
FK Constraint Name | Foreign Table | References | Local Key |
---|---|---|---|
M_PRODUCT_SUBTYPE_AD_CLIENT | AD_CLIENT | AD_CLIENT_ID | AD_CLIENT_ID |
M_PRODUCT_SUBTYPE_AD_ORG | AD_ORG | AD_ORG_ID | AD_ORG_ID |
The model includes a unique constraint defined as:
Unique Constraint Name | Columns |
---|---|
M_PRODUCT_SUBTYPE_VALUE |
|
The model includes the following checks:
Check Name | Condition |
---|---|
M_PROD_SUBTYPE_FRCDINRTRNS_CHK | FORCEDINRETURNS IN ('Y', 'N') |
M_PROD_SUBTYPE_INPRODPRICE_CHK | INCLUDEDINPRODUCTPRICE IN ('Y', 'N') |
M_PROD_SUBTYPE_LINKDTOPRODS_CHK | LINKEDTOPRODUCT IN ('Y', 'N') |
M_PRODUCT_SUBTYPE_ISACTIVE_CHK | ISACTIVE IN ('Y', 'N') |
M_PRODUCT
The Product model definition has been changed with the addition of the following elements:
Column Name | Required | Type | Size |
---|---|---|---|
M_PRODUCT_SUBTYPE_ID (PK) | Y | VARCHAR | 32 |
FK Constraint Name | Foreign Table | References | Local Key |
---|---|---|---|
M_PRODUCT_M_PRODUCT_SUBTYPE | M_PRODUCT_SUBTYPE | M_PRODUCT_SUBTYPE_ID | M_PRODUCT_SUBTYPE_ID |
Check Name | Condition |
---|---|
M_PRODUCT_CONTRIBUTION_CHECK | PRODUCTTYPE <> 'C' OR M_PRODUCT_SUBTYPE_ID IS NOT NULL |
Links
RM-4145
Jira:54623
Mantis:MRs:
- Core: !1135 (merged)
- Backoffice API: openbravo/ci/backoffice-api!67 (merged)
- WebPOS: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1466
- WebPOS2: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2478
- Business API: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/238
- WebPOS Sampledata: https://gitlab.com/openbravo/ci/modules/org.openbravo.test.mobile.sampledata/-/merge_requests/129
- Retail Sampledata: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sampledata/-/merge_requests/92
- Retail Automatic Tests Sampledata: https://gitlab.com/openbravo/ci/modules/org.openbravo.retail.testsampledata/-/merge_requests/91
- Coupons OTF: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf/-/merge_requests/49/edit
Docs:
Testing Performed
- try-backoffice (error due to API change -> openbravo/ci/backoffice-api!67 (merged))
- try-retail
- try-pos2
UX Approval
Backoffice Screenshots
Product Subtype window |
|
---|---|
Form view |
Grid view |
Help |
Product window |
---|
Form view |
Error message |