Skip to content

RM-4145: Contributions

Frank González requested to merge openbravo/devel/openbravo:fr/54623 into master

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
  • description
Product Type
  • description
Linked To Product
  • description
Relate Products
  • description
  • help
  • display logic
Relate Prod Categories
  • description
  • help
  • display logic
Included Products
  • display logic
Included Product Categories
  • display logic

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
  • L - "As listed in price list"
  • W - "By product weight"
Product Subtype Allocation Type
  • M - "Mandatory"

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
  • VALUE
  • AD_ORG_ID
  • AD_CLIENT_ID

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

Jira: RM-4145

Mantis: 54623

MRs:

Docs:

Testing Performed

UX Approval

Backoffice Screenshots

Product Subtype window

Form view

localhost_8080_openbravo<span data-escaped-char><span data-escaped-char><span data-escaped-char>_</span></span></span>(Landscape) (14).png

Grid view

localhost_8080_openbravo<span data-escaped-char><span data-escaped-char><span data-escaped-char>_</span></span></span>(Landscape) (15).png

Help

Product_Subtype_Help.png

Product window

Form view

Product<span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char><span data-escaped-char>_</span></span></span></span></span></span></span></span></span></span></span></span></span></span>(Form).png

Error message

M_PRODUCT_CONTRIBUTION_CHECK.png

Edited by Frank González

Merge request reports