Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] I. Performanceminorhave not tried2014-02-07 07:492014-02-19 11:59
ReportershuehnerView Statuspublic 
Assigned Todmiguelez 
PrioritynormalResolutionfixedFixed in Version3.0PR14Q2
StatusclosedFix in branchpiFixed in SCM revision4ddcfa6e2e4c
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product Version3.0MP22.2SCM revision 
Review Assigned Toshuehner
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0025683: c_order_trg is doing updates to c_invoice when not needed

DescriptionThe logic in c_order_trg is executing the updates to the c_invoice table when it is not needed.

The trigger has some code for checking that some fields changed, but they seem to be too wide.

Example, not processed order, if c_bpartner_id (only this) changes we do update c_invoice even if that update does not use that columns.
Steps To ReproduceRead trigger code
Proposed SolutionChange logic in trigger:
Put the if.processed='Y' first as top level if

Then put 2nd top-level if with just checking if description or poreference change as check if to update c_invoice or not.

NOTE: this assume that we only want to update the c_invoice if one of the fields mentioned in the update statement are changed.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0025682 closedshuehner Missing index for c_invoice table c_order_id column makes at least c_order_trg + c_order_trg2 slow 

-  Notes
hgbot (developer)
2014-02-07 12:32

Repository: erp/devel/pi
Changeset: b4367a3c856cf6ae8d2c7f2d4c58ce2cd0ecdef6
Author: Eduardo Argal Guibert <eduardo.argal <at>>
Date: Fri Feb 07 12:31:59 2014 +0100
URL: [^]

Fixes bug 25683: trigger performance improvement

M modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_BANKSTATEMENT.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_FINANCIAL_ACCOUNT.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_BNKSTM_LINE_CHECK_TRG.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_FIN_RECON_CHECK_TRG.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_AUXILIARINPUT.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MENU.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS_PARA.xml
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TREENODE.xml
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
M src-db/database/model/tables/FACT_ACCT.xml
M src-db/database/model/triggers/C_ORDER_TRG.xml
M src-db/database/sourcedata/AD_AUXILIARINPUT.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
hgbot (developer)
2014-02-07 12:54

Repository: erp/devel/pi
Changeset: 4ddcfa6e2e4c33124ef23c3b47c22eddf592bdf9
Author: Eduardo Argal Guibert <eduardo.argal <at>>
Date: Fri Feb 07 12:53:48 2014 +0100
URL: [^]

Fixes bug 25683: c_order_trg is doing updates to c_invoice when not needed

M src-db/database/model/triggers/C_ORDER_TRG.xml
hudsonbot (developer)
2014-02-12 18:30

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test
hudsonbot (developer)
2014-02-12 18:30

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test
shuehner (administrator)
2014-02-19 11:59

Reviewed and test on oracle/pgsql.
If changing either poreference or description columns of an c_order the attached c_invoice (if there is one) will get those two fields updates.

However small behavior change:
Before those columns were updated in invoice on any change to attached order.

Now they will only be updated if they have been modified.

So in following case behavior is different
- Have c_order with attached c_invoice
- edit order description, it will get sync to invoice.
- edit invoice description to be different
- edit order payment term -> now description in invoice will not be reverted back to be order description.

After discussing change with EAR deemed reasonable.

- Issue History
Date Modified Username Field Change
2014-02-07 07:49 shuehner New Issue
2014-02-07 07:49 shuehner Assigned To => AugustoMauch
2014-02-07 07:49 shuehner Modules => Core
2014-02-07 07:49 shuehner Triggers an Emergency Pack => No
2014-02-07 07:49 shuehner Relationship added related to 0025682
2014-02-07 08:02 alostale Tag Attached: Performance
2014-02-07 08:03 alostale Assigned To AugustoMauch => dmiguelez
2014-02-07 12:31 eduardo_Argal Status new => scheduled
2014-02-07 12:31 eduardo_Argal fix_in_branch => pi
2014-02-07 12:32 hgbot Checkin
2014-02-07 12:32 hgbot Note Added: 0064014
2014-02-07 12:32 hgbot Status scheduled => resolved
2014-02-07 12:32 hgbot Resolution open => fixed
2014-02-07 12:32 hgbot Fixed in SCM revision => [^]
2014-02-07 12:54 hgbot Checkin
2014-02-07 12:54 hgbot Note Added: 0064015
2014-02-07 12:54 hgbot Fixed in SCM revision [^] => [^]
2014-02-12 18:30 hudsonbot Checkin
2014-02-12 18:30 hudsonbot Note Added: 0064172
2014-02-12 18:30 hudsonbot Checkin
2014-02-12 18:30 hudsonbot Note Added: 0064173
2014-02-19 11:59 shuehner Review Assigned To => shuehner
2014-02-19 11:59 shuehner Note Added: 0064349
2014-02-19 11:59 shuehner Status resolved => closed
2014-02-19 11:59 shuehner Fixed in Version => 3.0MP32

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker