Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023629Openbravo ERP03. Procurement managementpublic2013-04-24 17:062013-05-02 11:26
VictorVillar 
jonalegriaesarte 
urgentmajoralways
closedfixed 
5
pi 
3.0MP23 
VictorVillar
Core
No
0023629: currency order lines does not update its value regarding currency order header
currency order lines does not update its value regarding currency order header
As Admin role,
Go to Purchase order window,
 Create a new register
 business partner: Bebidas Alegres
 Price list: Tarifas Bebidas Alegres
Save it, realise currency= EUR

  Lines tab:
    Create a new register
Save it.

Go to Price List window,
   Select Tarifa Bebidas Alegres
   Currency: USD
Save it

Go to the Purchase order created before, select again the Price List and save the header. Realise that the order now is in USD, but you can check via database that the lines linked are in EUR yet.
in the c_order_chk_restriction_trg() add the

COALESCE(old.C_Currency_ID, '0') <> COALESCE(NEW.C_Currency_ID, '0')

to the following IF condition:

IF (COALESCE(OLD.C_BPartner_ID, '0')!=COALESCE(NEW.C_BPartner_ID, '0')) OR (COALESCE(OLD.M_PriceList_ID,'0') != COALESCE(NEW.M_PriceList_ID,'0'))
THEN
      SELECT COUNT(*)
        INTO v_n
        FROM C_ORDERLINE
       WHERE C_Order_ID = NEW.C_Order_ID;

       IF v_n>0 THEN
         RAISE EXCEPTION '%', '@20502@' ; --OBTG:-20000--
       END IF;
END IF;

This could be an option
No tags attached.
Issue History
2013-04-24 17:06VictorVillarNew Issue
2013-04-24 17:06VictorVillarAssigned To => dmiguelez
2013-04-24 17:06VictorVillarModules => Core
2013-04-24 17:06VictorVillarResolution time => 1369346400
2013-04-24 17:06VictorVillarTriggers an Emergency Pack => No
2013-04-24 17:06VictorVillarIssue Monitored: networkb
2013-04-24 17:20VictorVillarProposed Solution updated
2013-04-24 17:31dmiguelezAssigned Todmiguelez => jonalegriaesarte
2013-04-29 18:10hgbotCheckin
2013-04-29 18:10hgbotNote Added: 0058307
2013-04-29 18:10hgbotStatusnew => resolved
2013-04-29 18:10hgbotResolutionopen => fixed
2013-04-29 18:10hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/aae254b2941b185e4181cca708b83138e304adae [^]
2013-04-30 21:05hudsonbotCheckin
2013-04-30 21:05hudsonbotNote Added: 0058385
2013-05-02 11:26VictorVillarReview Assigned To => VictorVillar
2013-05-02 11:26VictorVillarNote Added: 0058403
2013-05-02 11:26VictorVillarStatusresolved => closed

Notes
(0058307)
hgbot   
2013-04-29 18:10   
Repository: erp/devel/pi
Changeset: aae254b2941b185e4181cca708b83138e304adae
Author: Jon Alegría <jon.alegria <at> openbravo.com>
Date: Mon Apr 29 18:10:06 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/aae254b2941b185e4181cca708b83138e304adae [^]

Fixes issue 0023629: currency order lines does not update its value regarding
currency order header

---
M src-db/database/model/triggers/C_ORDER_CHK_RESTRINCTIONS_TRG.xml
---
(0058385)
hudsonbot   
2013-04-30 21:05   
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/3ea22ca7a348 [^]

Maturity status: Test
(0058403)
VictorVillar   
2013-05-02 11:26   
Verified