Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030926Openbravo ERP01. General setuppublic2015-09-24 17:562015-10-01 03:36
maite 
vmromanos 
urgentmajoralways
closedfixed 
5
 
3.0PR15Q4 
dmiguelez
Core
No
0030926: Price list version defined for España organization not available when registering product for * organization
Price list version defined for España organization not available when registering product for * organization
1. Access Product window and create new register for * organization
2. Access Price tab, create new register and realize that only pricelist version defined for "España" org are shown, when pricelist version for "US" should also be available
Problem is that the organization field is hidden. The system automatically assigns an organization to this field, and the standard validations hide pricelists not accessible by that organization.

Proposed solution is to display organization field in form and grid view (the organization field should be shown the first one in both views). Thus the user could select first the organization so the price list version combo is automatically refreshed.

We should avoid inconsistencies when a user selects a price list and after that he changes the organization. Try to implement this adding a validation to the pricelist version similar to this one (not tested yet!):
EXISTS (SELECT 1
        FROM AD_ROLE_ORGACCESS A_R_O
        INNER JOIN ad_role r ON (A_R_O.AD_ROLE_ID = r.AD_ROLE_ID)
        WHERE A_R_O.ISACTIVE = 'Y'
        AND r.ISACTIVE = 'Y'
        and r.ad_role_id = @#AD_Role_ID@
        AND (A_R_O.AD_ORG_ID = td0.AD_Org_ID
             OR (SUBSTR(TO_CHAR(r.USERLEVEL), 2, 1) = 'C' AND td0.AD_ORG_ID = '0')
             )
        )
AND AD_ISORGINCLUDED(@AD_Org_ID@, td0.AD_Org_ID, td0.AD_Client_ID) <> -1
No tags attached.
related to defect 00307973.0PR15Q4 closed alostale Validation rule automatically adds wrong organization list to the where clause 
related to defect 0030735 closed AtulOpenbravo All price lists are displayed without check the organization role 
related to feature request 0030985 new Triage Omni OMS Purchase Price List versions should not be shown for a product in case it is marked as Purchase = No 
Issue History
2015-09-24 17:56maiteNew Issue
2015-09-24 17:56maiteAssigned To => Triage Finance
2015-09-24 17:56maiteModules => Core
2015-09-24 17:56maiteResolution time => 1444428000
2015-09-24 17:56maiteTriggers an Emergency Pack => No
2015-09-24 18:24maiteIssue Monitored: networkb
2015-09-25 08:44vmromanosProposed Solution updated
2015-09-25 08:49vmromanosRelationship addedrelated to 0030797
2015-09-25 08:50vmromanosRelationship addedrelated to 0030735
2015-09-25 15:02vmromanosProposed Solution updated
2015-09-28 11:15vmromanosTarget Version3.0PR15Q4 => 3.0PR16Q1
2015-09-29 18:24vmromanosStatusnew => scheduled
2015-09-29 18:24vmromanosAssigned ToTriage Finance => vmromanos
2015-09-29 18:36vmromanosNote Added: 0080721
2015-09-29 18:40vmromanosNote Edited: 0080721bug_revision_view_page.php?bugnote_id=0080721#r9527
2015-09-29 19:13vmromanosNote Edited: 0080721bug_revision_view_page.php?bugnote_id=0080721#r9528
2015-09-30 09:50psanjuanNote Edited: 0080721bug_revision_view_page.php?bugnote_id=0080721#r9529
2015-09-30 09:56psanjuanNote Edited: 0080721bug_revision_view_page.php?bugnote_id=0080721#r9530
2015-09-30 09:57psanjuanNote Edited: 0080721bug_revision_view_page.php?bugnote_id=0080721#r9531
2015-09-30 09:58psanjuanNote Edited: 0080721bug_revision_view_page.php?bugnote_id=0080721#r9532
2015-09-30 10:00psanjuanNote Edited: 0080721bug_revision_view_page.php?bugnote_id=0080721#r9533
2015-09-30 10:03psanjuanNote Edited: 0080721bug_revision_view_page.php?bugnote_id=0080721#r9534
2015-09-30 10:05psanjuanNote Edited: 0080721bug_revision_view_page.php?bugnote_id=0080721#r9535
2015-09-30 10:12psanjuanNote Added: 0080734
2015-09-30 10:14psanjuanNote Added: 0080735
2015-09-30 10:16psanjuanNote Edited: 0080735bug_revision_view_page.php?bugnote_id=0080735#r9537
2015-09-30 10:22psanjuanRelationship addedrelated to 0030985
2015-09-30 12:51dmiguelezTarget Version3.0PR16Q1 => 3.0PR15Q4
2015-09-30 12:52hgbotCheckin
2015-09-30 12:52hgbotNote Added: 0080742
2015-09-30 12:52hgbotStatusscheduled => resolved
2015-09-30 12:52hgbotResolutionopen => fixed
2015-09-30 12:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d3254c0fd9664ac5bf94a27d6f587a963334065d [^]
2015-09-30 12:52dmiguelezReview Assigned To => dmiguelez
2015-09-30 12:52dmiguelezNote Added: 0080743
2015-09-30 12:52dmiguelezStatusresolved => closed
2015-09-30 15:04hgbotCheckin
2015-09-30 15:04hgbotNote Added: 0080751
2015-10-01 03:36hudsonbotCheckin
2015-10-01 03:36hudsonbotNote Added: 0080767
2015-10-01 03:36hudsonbotCheckin
2015-10-01 03:36hudsonbotNote Added: 0080768

Notes
(0080721)
vmromanos   
2015-09-29 18:36   
(edited on: 2015-09-30 10:05)
Test plan:

As Openbravo Admin.
 Go to Price List window.
  Create a record for * org, called Asterisk
  Go to Price List Version window
   Create a record for * org, called Asterisk

 Go to Price List window.
  Create a record for FB Group org, called Group
  Go to Price List Version window
   Create a record for FB Group org, called Group

 Go to Price List window.
  Create a record for FB España, called Spain
  Go to Price List Version window
   Create a record for FB España, called Spain

 Go to Price List window.
  Create a record for España región norte org, called North Region
  Go to Price List Version window
   Create a record for España región norte, called North Region

 Go to Price List window.
  Create a record for F&B US org, called US
  Go to Price List Version window
   Create a record for F&B US org, called US

 Go to Price List window.
  Create a record for F&B US East Cost org, called US East Cost
  Go to Price List Version window
   Create a record for F&B US East Cost org, called US East Cost


All of the above should be "Purchase" Price List, valid from at least 01-01-2015

 Go to Product window
  Create a new record for * org and move to Price tab
  Enter a new record. Verify all the Price list versions are shown (Asterisk, Group, US, US East Cost, Spain, North Region). Select any of them
  Save the record.
  Verify price list version is read only

 Go to Product window
  Create a new record for FB Group org and move to Price tab
  Enter a new record. Verify all the Price list versions are shown (Asterisk, Group, US, US East Cost, Spain, North Region). Select any of them
  Save the record.
  Verify price list version is read only

 Go to Product window
  Select any record belonging to FB España and move to Price tab
  Verify only Price list versions belonging to Spain, FB Group, * and región norte are shown
  Save the record.
  Verify price list version is read only

 Go to Product window
  Select any record belonging to FB US and move to Price tab
  Verify only Price list versions belonging to US, US East Cost, FB Group and * are shown
  Save the record.
  Verify price list version is read only

 Go to Product window
  Create a new record for España Región norte org and move to Price tab
  Enter a new record. Verify only Price list versions belonging to Spain, FB Group, * and región norte are shown
  Save the record.
  Verify price list version is read only

 Go to Product window
  Create a new record for España Región sur org and move to Price tab
  Enter a new record. Verify only Price list versions belonging to Spain, FB Group and * are shown
  Save the record.
  Verify price list version is read only

In database (or displaying the organization field), verify that each time you save a Product Price, the organization is automatically set to the Price List version organization.

(0080734)
psanjuan   
2015-09-30 10:12   
Test Plan above verified.
Issue can be closed.
(0080735)
psanjuan   
2015-09-30 10:14   
(edited on: 2015-09-30 10:16)
New issue opened. See issue related because below scenario.

Go to Product window
  Create a new record for F&B España. Remove the check-box "Purchase"
  Save
  Go to price tab and create a new record
  Realize that all price list created for testing this issue, do not marked
  as sales but purchase price list are still shown, and that should not be the
  case.

Same would apply in case of removing check-box "Sales" in regards to sales price list versions.

(0080742)
hgbot   
2015-09-30 12:52   
Repository: erp/devel/pi
Changeset: d3254c0fd9664ac5bf94a27d6f587a963334065d
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Sep 29 19:17:02 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d3254c0fd9664ac5bf94a27d6f587a963334065d [^]

Fixed bug 30926: Price List Version in Product | Price tab

The SL_ProductPrice_PriceListVersion callout overwrote the Product Price organization with the price list version organization to ensure the new record had the right organization. However, since the organization field is not shown in that tab, this behavior created a problem because it changed the organization field with the organization of the first price list version in alphabetic order (which was automatically set in the price list version selector). Thus, if the user wanted to select another pricelist from the list, the automatic validation only showed the ones belonging to the selected organization.

The solution is to remove that callout, and to implement the same logic in an EventObserver. Thus the default organization in the Product Price is set to the organization in the Product (as any other child tab in the system), and the ProductPriceObserver ensures the new record belongs to the price list organization when inserting/updating the record.

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src/org/openbravo/erpCommon/ad_callouts/SL_ProductPrice_PriceListVersion.java
A src/org/openbravo/event/ProductPriceObserver.java
---
(0080743)
dmiguelez   
2015-09-30 12:52   
Code Review + Testing Ok
(0080751)
hgbot   
2015-09-30 15:04   
Repository: erp/devel/pi
Changeset: f1da6d42debed3bfc49ed697b38d95d3e6a16098
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Wed Sep 30 15:04:21 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f1da6d42debed3bfc49ed697b38d95d3e6a16098 [^]

Related to issue 30926: code review improvements
Renamed variable to make it clear

---
M src/org/openbravo/event/ProductPriceObserver.java
---
(0080767)
hudsonbot   
2015-10-01 03:36   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/f63a11a49473 [^]
Maturity status: Test
(0080768)
hudsonbot   
2015-10-01 03:36   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/f63a11a49473 [^]
Maturity status: Test