Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013357Openbravo ERP05. Production managementpublic2010-05-18 09:572010-05-20 11:15
networkb 
sivaraman 
immediatemajoralways
closedfixed 
20Community Appliance
2.50MP17 
2.50MP18 
Core
No
0013357: "create standard" process does not work in "production run" tab
when you run the process "create standard" in "work effort || Production run", error is returned:
    
Error:
record "old" is not assigned yet

The errors could be generated in ticket https://issues.openbravo.com/view.php?id=12387&nbn=4 [^]
In this ticket, there are changes to others triggers with the same problem
. Production Management || Setup || Section || Section
  new record
   name: test

. Production Management || Setup || Work Center || Work Center
  new record
   search key: test
   name: test
   section: test

.Production Management || Setup || Activity || Activity
  new record
   search key: test
   name: test
   cost center: assembly
   work center: test

. Production Management || Transactions || Process Plan || Process Plan
 new record
  search key: test
  name: test
  Include Phases when inserting: selected

. Production Management || Transactions || Process Plan || Process Plan >> Version
 new record
  starting date: 01/01/2000
  end date: 31/12/2010

. Production Management || Transactions || Process Plan || Process Plan >> Version >> Operation
 new record
  search key: test
  name: test
  activity: test
  Cost Center Use Time: 1
  Preparation Time: 1
  Multiplier: 1

. Production Management || Transactions || Process Plan || Process Plan >> Version >> Operation >> I/O Products
 new record
  product: Wooden Back
  production type: P-
  decrease: 1
  rejected: 1
  quantity: 1

 new record
  product: Block of Wood
  production type: P+
  Component Cost: 1
  decrease: 1
  rejected: 1
  quantity: 1

. Production Management || Transactions || Work Requirement || Header
 new record
  process plan: test
  Quantity: 1
  Process Quantity: 1
  WR Creation Date: 18/05/2010
  Starting date: 18/05/2010
  End date: 18/05/2010
 run "process work requirement"

. Production Management || Transactions || Work Effort || Work Effort
 new record
  movement date 18-05-2010
  ending time: 23:59:59

. Production Management || Transactions || Work Effort || Work Effort >> Production Run
 new record
  WR Phase: 1000005 - 18/05/2010 - 10 - test
  cost center version: 1000010 - Assembly - 01/01/2007
  completed quantity: 1
  rejected quantity: 1
  cost center use: 1
 run "create standard" process

error is returned.
Regression
related to defect 00123872.50MP17 closed sivaraman It is possible to add some records when a Work effort is processed 
Issue History
2010-05-18 09:57networkbNew Issue
2010-05-18 09:57networkbAssigned To => adrianromero
2010-05-18 11:12psarobeTag Attached: Regression
2010-05-18 11:14psarobeNote Added: 0027406
2010-05-18 12:28adrianromeroRelationship addedrelated to 0012387
2010-05-18 12:28adrianromeroStatusnew => scheduled
2010-05-18 12:28adrianromerofix_in_branch => pi
2010-05-18 12:30adrianromeroNote Added: 0027412
2010-05-18 14:08sivaramanAssigned Toadrianromero => sivaraman
2010-05-18 14:20hgbotCheckin
2010-05-18 14:20hgbotNote Added: 0027426
2010-05-18 14:20hgbotStatusscheduled => resolved
2010-05-18 14:20hgbotResolutionopen => fixed
2010-05-18 14:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c2c3302e89515230a6489a894d9a583cb28c789e [^]
2010-05-18 14:22sivaramanNote Added: 0027427
2010-05-18 15:57psarobeNote Added: 0027438
2010-05-18 16:05psarobeNote Edited: 0027438bug_revision_view_page.php?bugnote_id=0027438#r382
2010-05-18 18:29psarobeNote Added: 0027448
2010-05-19 08:00arunkumarNote Added: 0027539
2010-05-19 08:00arunkumarStatusresolved => closed
2010-05-20 00:00anonymoussf_bug_id0 => 3004342
2010-05-20 11:15hudsonbotCheckin
2010-05-20 11:15hudsonbotNote Added: 0027593

Notes
(0027406)
psarobe   
2010-05-18 11:14   
Regression introduced by https://issues.openbravo.com/view.php?id=12387 [^]
(0027412)
adrianromero   
2010-05-18 12:30   
The following triggers have to be reviewed and fixed. Take into account that has to be verified properly in PostgreSQL and Oracle.

src-db/database/model/triggers/MA_PL_EMPLOYEE_TRG.xml
src-db/database/model/triggers/MA_PL_IC_TRG.xml
src-db/database/model/triggers/MA_PL_INVOICELINE_TRG.xml
src-db/database/model/triggers/MA_PL_MACHINE_TRG.xml
src-db/database/model/triggers/MA_TOOLSETUSED_TRG.xml
(0027426)
hgbot   
2010-05-18 14:20   
Repository: erp/devel/pi
Changeset: c2c3302e89515230a6489a894d9a583cb28c789e
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Tue May 18 17:48:39 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/c2c3302e89515230a6489a894d9a583cb28c789e [^]

Fixes issue 13357: \"create standard\" process does not work in \"production run\" tab

TRIGGERS are trying to retrieve old data for INSERT operation, which is invalid and causes error. In order to fix it, new and old data assignment has been moved into their IF and ELSE block respectively.

---
M src-db/database/model/triggers/MA_PL_EMPLOYEE_TRG.xml
M src-db/database/model/triggers/MA_PL_IC_TRG.xml
M src-db/database/model/triggers/MA_PL_INVOICELINE_TRG.xml
M src-db/database/model/triggers/MA_PL_MACHINE_TRG.xml
M src-db/database/model/triggers/MA_TOOLSETUSED_TRG.xml
---
(0027427)
sivaraman   
2010-05-18 14:22   
Issue is fixed. Please verify in the next build.

Steps to test: Kindly follow all the steps as given in the 'Steps To Reproduce' section
(0027438)
psarobe   
2010-05-18 15:57   
(edited on: 2010-05-18 16:05)
I don't agree with the steps that you say we have to follow (Steps to reproduce section).

Whenever a developer changes or creates a new trigger he should follow these steps:

1. Identify the table where the trigger belongs to
2. Identify the tab where the table belongs to
3. Identify the window where the tab belongs to
4. Identify the window in the menu
5. Login into the application and go to the window/tab
6. Create one record and save
7. Modify the record and save
8. Delete the record

Everything done in Postgres and Oracle.

For this particular case and following what described above:

1. MA_PL_EMPLOYEE_TRG belongs to MA_PL_EMPLOYEE table and its corresponding tab is Employee
2. MA_PL_IC_TRG belongs to MA_PL_IC table and its corresponding tab is Indirect cost
3. MA_PL_INVOICELINE_TRG belongs to MA_PL_INVOICELINE table and its corresponding tab is Outsourced
4. MA_PL_MACHINE_TRG belongs to MA_PL_MACHINE table and its corresponding tab is Machine
5. MA_TOOLSETUSED_TRG belongs to MA_TOOLSETUSED table and its corresponding tab is Toolset

All of them belong to window Work effort.

How to know its corresponding tab and window? Executing this query:

select ad_window.name as window, ad_tab.name as tab
from ad_window, ad_tab, ad_table
where ad_window.ad_window_id = ad_tab.ad_window_id
and ad_tab.ad_table_id=ad_table.ad_table_id
and upper(ad_table.tablename)='name of the table';

And then after all, you follow the "steps to reproduce"

(0027448)
psarobe   
2010-05-18 18:29   
Tested in Postgres. Works fine
(0027539)
arunkumar   
2010-05-19 08:00   
Testes in oracle.working fine
(0027593)
hudsonbot   
2010-05-20 11:15   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/c2c3302e8951 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/a7901e097e1a [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17407.obx [^]