Example - Using Product Attributes

From ADempiere
Revision as of 04:54, 21 July 2013 by MJMcKay (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
Note.gif Note:

This page describes features not yet incorporated. Some of the features described here are part of the changes in ADEMPIERE-72 - fixes to the info windows and lookup/search fields. In version 3.8 and earlier, product attributes and instance attributes can not co-exist.

Fertilizer in Garden World

Attribute setup

Garden World sells lawn fertilizer in 50 and 70kg bags. They want to expand this to a variety of formats (50 or 70 Kg bags, cubic yards), chemical specifications, and base compost (chemical, manure, mushroom, peat). Each product has a lot number and a guarantee date. Each of these things represents an attribute of the fertilizer product. Collectively, they represent an attribute set and, with a specific lot and guarantee date defined, they represent an instance of the attribute set.

The demo database has an attribute set defined for Fertilizer Lot and that needs to be expanded to include the format, chemical specs and base compost. This is done by defining attributes for each of these items as follows:

  • Open the {{#if: Attribute|Attribute|Attribute }} Window window and create new attributes as follows:
    • New Attribute - Package
      • Name: Pkg
      • Description: Fertilizer Package
      • Attribute Value Type: List
      • Instance Attribute: checked
      • Attribute values
        • New Value - 50Kg
          • Key: 50Kg
          • Name: 50Kg
          • Description: 50 Kilogram bag
        • New Value - 70Kg
          • Key: 70Kg
          • Name: 70Kg
          • Description: 70 Kilogram bag
        • New Value - Cubic Yard
          • Key: CY
          • Name: CY
          • Description: Cubic Yard
    • New Attribute - Chemical - Nitrogen
      • Name: N
      • Description: Nitrogen
      • Attribute Value Type: Number
      • Instance Attribute: unchecked
    • New Attribute - Chemical - Phosphorous
      • Name: P
      • Description: Phosphorous
      • Attribute Value Type: Number
      • Instance Attribute: unchecked
    • New Attribute - Chemical - Potassium
      • Name: K
      • Description: Potassium
      • Attribute Value Type: Number
      • Instance Attribute: unchecked
    • New Attribute - Base
      • Name: Base
      • Description: Base Component
      • Attribute Value Type: List
      • Instance Attribute: unchecked
      • Attribute values
        • New Value - Chemical
          • Key: Chem
          • Name: Chem
          • Description: Chemical
        • New Value - Manure
          • Key: Man
          • Name: Manure
          • Description: Manure
        • New Value - Mushroom
          • Key: Mus
          • Name: Mushroom
          • Description: Mushroom
        • New Value - Peat
          • Key: Peat
          • Name: Peat
          • Description: Peat

Next, open the {{#if: Attribute Set|Attribute Set|AttributeSet }} Window and find the attribute set "Fertilizer Lot". Note that the attribute set contains a lot number and a guarantee date. Add the new attributes to this attribute set.

Clear the cache or log out and in before continuing.

Assigning Attributes to Products

Now, open the {{#if: Product|Product|Product }} Window and find the Fertilizer #50 product. Note that the attribute set is already defined as Fertilizer Lot. Click on the button in the Attribute Set Instance field to open the Product Attribute Dialog and set the product attributes for the Fertilizer #50 product. Specifically, set these as shown:

Product asi example.png

Note that the lot and guarantee dates do not appear on this window. They will be set later.

Repeat this process for the Fertilizer #70 product: find the product, assign the attribute set then assign the product attributes. For Fertilizer #70, use the 70Kg package.

Now we have to make some fertilizer that meets these specs. We will do this with the {{#if: Production|Production|Production }} Window window. Create a new production header and save it. Then move to the {{#if: Production Plan|Production Plan|ProductionPlan }} Tab and select Fertilizer #50 as the product and a quantity of 40. Set the Locator to Fertilizer and save the record. Create a second record and repeat this step with the Fertilizer #70 product. Move back to the {{#if: Production Header|Production Header|ProductionHeader }} Tab and click the "Create/Post Production" button. This will pull the BOM from the product window and fill the {{#if: Production Line|Production Line|ProductionLine }} Tab.

Move to the {{#if: Production Line|Production Line|ProductionLine }} Tab and find the Fertilizer #50 product. Note that the Attribute Set Instance field is blank. Click the Attribute Set Instance button and the Product Attribute Dialog will appear again.

Production asi.png

The form is a copy of the attribute set instance template created in the product window and now the instance attributes are visible. In this dialog, the lot number and guarantee date can be set manually or you can click on the New Record button to calculate the next lot number or the guarantee date based on the attribute set information. The logical place to do this is in the production process.

Close the Product Attribute Dialog and note that the Attribute Set Instance field is filled in. Save the record. If you click on the Attribute Set Instance button again, you can see the values of the attributes. Repeat this with the Fertilizer #70 Production Plan.

Back on the {{#if: Production Header|Production Header|ProductionHeader }} Tab and click the "Create/Post Production" button again to complete the process. The new product will appear in the Fertilizer locator.

Open the Product Info window to see the attributes available.

Productinfo fert50.png

Select or search for the Fertilizer #50 product. The Warehouse tab shows 40 in stock. If you click on that line in the Warehouse tab and then click on the Available to Promise tab, and the Show Detail check box, you will see the instance attribute information. In this case, (<<120>> 2013-06-30).

To see the Product attribute info for the Fertilizer #50 product, click on the Product Attribute tab. It will list the product attributes as

***  Product Attribute  ***
 Pkg: 50Kg
 N: 10
 P: 20
 K: 15
 Base: Chem