Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0009075Openbravo ERPA. Platformpublic2009-05-18 17:172009-06-08 00:00
AinhoaPagola 
mtaal 
normalmajorhave not tried
closedfixed 
20Ubuntu 8.4
main 
2.50MP2 
Core
No
0009075: DAL - setting an attribute of an object updated them all
When an object is created and some of its attributes are set, it seems that the update generated when an attribute is set updated every attribute of the object.

In my example:

I have created an order and set some of the attributes.
I complete the order.
Once an order is been posted most of the attributes can not be updated, but some can. If I try to set any of those values, I get an error. In the postgres log I can see the error which suggests that every field has being updated, this action fires a trigger.

2009-05-18 13:41:44 CEST ERROR: Document processed/posted

2009-05-18 13:41:44 CEST STATEMENT: update C_Order set AD_Client_ID=$1, AD_Org_ID=$2, IsActive=$3, Created=$4, CreatedBy=$5, Updated=$6, UpdatedBy=$7, IsSOTrx=$8, DocumentNo=$9, DocStatus=$10, DocAction=$11, Processing=$12, Processed=$13, C_DocType_ID=$14, C_DocTypeTarget_ID=$15, Description=$16, IsDelivered=$17, IsInvoiced=$18, IsPrinted=$19, IsSelected=$20, SalesRep_ID=$21, DateOrdered=$22, DatePromised=$23, DatePrinted=$24, DateAcct=$25, C_BPartner_ID=$26, BillTo_ID=$27, C_BPartner_Location_ID=$28, POReference=$29, IsDiscountPrinted=$30, C_Currency_ID=$31, PaymentRule=$32, C_PaymentTerm_ID=$33, InvoiceRule=$34, DeliveryRule=$35, FreightCostRule=$36, FreightAmt=$37, DeliveryViaRule=$38, M_Shipper_ID=$39, C_Charge_ID=$40, ChargeAmt=$41, PriorityRule=$42, TotalLines=$43, GrandTotal=$44, M_Warehouse_ID=$45, M_PriceList_ID=$46, IsTaxIncluded=$47, C_Campaign_ID=$48, C_Project_ID=$49, C_Activity_ID=$50, Posted=$51, AD_User_ID=$52, CopyFrom=$53, DropShip_BPartner_ID=$54, DropShip_Location_ID=$55, DropShip_User_ID=$56, IsSelfService=$57, AD_OrgTrx_ID=$58, User1_ID=$59, User2_ID=$60, Deliverynotes=$61, C_Incoterms_ID=$62, Incotermsdescription=$63, Generatetemplate=$64, Delivery_Location_ID=$65, CopyFromPO=$66 where C_Order_ID=$67

The column I want to update is "porreference". It can be updated in the database with no problem:

update c_order
set poreference = 'Hello';

I attach the code I am developing where the error occurs.
// Create an order
final Order order = OBProvider.getInstance().get(Order.class);

// Set the necessary attributes:
order.set....

//Complete the order calling c_order_post

//Try to set a porreference attribute:
o.setOrderReference("");
No tags attached.
? DownloadSalesOrders.java (17,908) 2009-05-18 17:17
https://issues.openbravo.com/file_download.php?file_id=1319&type=bug
Issue History
2009-05-18 17:17AinhoaPagolaNew Issue
2009-05-18 17:17AinhoaPagolaAssigned To => mtaal
2009-05-18 17:17AinhoaPagolaFile Added: DownloadSalesOrders.java
2009-05-18 17:17AinhoaPagolaRegression testing => No
2009-05-19 11:22hgbotCheckin
2009-05-19 11:22hgbotNote Added: 0016453
2009-05-19 11:22hgbotStatusnew => resolved
2009-05-19 11:22hgbotResolutionopen => fixed
2009-05-19 11:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/10ccecc75dfcdcd4708e9d0d50af2fc09145a862 [^]
2009-06-06 20:24psarobeStatusresolved => closed
2009-06-06 20:24psarobeFixed in Version => 2.50MP2
2009-06-08 00:00anonymoussf_bug_id0 => 2802642

Notes
(0016453)
hgbot   
2009-05-19 11:22   
Repository: erp/devel/pi
Changeset: 10ccecc75dfcdcd4708e9d0d50af2fc09145a862
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue May 19 11:21:15 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/10ccecc75dfcdcd4708e9d0d50af2fc09145a862 [^]

fixes issue 9075: DAL - setting an attribute of an object updated them all

---
M src/org/openbravo/dal/core/template.hbm.xml
---