Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029531Openbravo ERP05. Production managementpublic2015-04-08 18:532015-05-07 22:17
VictorVillar 
jorge-garcia 
urgentmajoralways
closedfixed 
5
pi 
3.0PR15Q33.0PR15Q3 
Sandrahuguet
Core
No
0029531: Not possible to create standards if a toolset is defined as Discard
Not possible to create standards if a toolset is defined as Discard
As group admin role,
(create every register for España organization)
Go to Toolset window,
  create a new one: Cutter
  Toolset tab:
     Search key: Cutter
     Discard: YEs
     Storage Bin: RN-0-0-0
     
Go to Work Center,
   create a new one.
      Activity tab:
        create a new one. name = Production
       Toolset tab: cutter - Utilization Coefficient: 10
   Machine tab: select a machine (Create a new one)

Go to Manufacturing Cost Center
   create a new one with a valid version and the machine created before


Go to Activity window:
 create a new one. Name: Actividad
    select the Cost center created before and the Work Center created before.
  Toolset: cutter - Utilization Coefficient: 10

   Go To process plan
      Include Operations when inserting = Yes
      Name: Process Plan
     Version tab: Starting date: 01/01/2012
                  Ending date: 31/12/9999
     Operation tab: name: S1
       Activity: select the one created before
       Create Standards: Yes
  I/O Products:
     select one P- and one P+ (create two products defined as Production)

Go to Work Requirement window,
   select the process plan created before
   qty: 1
 Process the work requirement
 Click on 'Create Work Effort'

Realise that the following error appears: ma_toolset_id can not be null.

The problem: ma_productionrun_standard function
 


  --Insert toolsets if necessary
      v_ResultStr:='ToolsetProcess Processing';
      FOR Cur_ToolsetProcess IN
        (SELECT MA_Toolset_Type_ID, UseCoef
        FROM MA_ToolsetProcess
        WHERE MA_Process_ID=v_Process_ID)
      LOOP
        DECLARE
          Cur_MAToolSet RECORD;
        BEGIN
          --It's taken the toolset with higher number of uses
          FOR Cur_MAToolSet IN
            (SELECT MA_Toolset_ID AS Toolset_ID
            FROM MA_Toolset
            WHERE MA_Toolset_Type_ID=Cur_ToolsetProcess.MA_Toolset_Type_ID
              AND Discarded='N'
            ORDER BY NumberUses DESC
            )
          LOOP
            v_Toolset_ID:=Cur_MAToolSet.Toolset_ID;
            EXIT;
          END LOOP;
        END;
        SELECT * INTO v_ToolsetUsed_ID FROM Ad_Sequence_Next('MA_ToolsetUsed', v_Client_ID) ;
        INSERT
        INTO MA_ToolsetUsed
          (
            MA_ToolsetUsed_ID, AD_Client_ID, AD_Org_ID, Created,
            Createdby, Isactive, M_ProductionPlan_ID, MA_Toolset_ID,
            Updated, Updatedby, Used
          )
          VALUES
          (
            v_ToolsetUsed_ID, v_Client_ID, v_PlanOrg_ID, TO_DATE(NOW()),
            v_User_ID, 'Y', v_Record_ID, v_Toolset_ID,
            TO_DATE(NOW()), v_User_ID, Cur_ToolsetProcess.UseCoef*v_DoneQuantity
          );
      END LOOP;

It seems that it is not taking into account when v_Toolset_ID is null
No tags attached.
Issue History
2015-04-08 18:53VictorVillarNew Issue
2015-04-08 18:53VictorVillarAssigned To => Sandrahuguet
2015-04-08 18:53VictorVillarModules => Core
2015-04-08 18:53VictorVillarResolution time => 1430949600
2015-04-08 18:53VictorVillarTriggers an Emergency Pack => No
2015-04-08 18:53VictorVillarIssue Monitored: networkb
2015-04-14 12:48Triage FinanceAssigned ToSandrahuguet => Triage Finance
2015-04-16 18:18jorge-garciaStatusnew => scheduled
2015-04-17 13:46jorge-garciaNote Added: 0076606
2015-04-30 18:12SandrahuguetAssigned ToTriage Finance => jorge-garcia
2015-04-30 18:12SandrahuguetReview Assigned To => Sandrahuguet
2015-05-04 12:47hgbotCheckin
2015-05-04 12:47hgbotNote Added: 0076933
2015-05-04 12:47hgbotStatusscheduled => resolved
2015-05-04 12:47hgbotResolutionopen => fixed
2015-05-04 12:47hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/360ce267780f1ac57ef62f6e80242f2a7ef24607 [^]
2015-05-04 12:47SandrahuguetNote Added: 0076934
2015-05-04 12:47SandrahuguetStatusresolved => closed
2015-05-04 12:47SandrahuguetFixed in Version => 3.0PR15Q3
2015-05-07 22:17hudsonbotCheckin
2015-05-07 22:17hudsonbotNote Added: 0077197

Notes
(0076606)
jorge-garcia   
2015-04-17 13:46   
Test Plan:

As group admin role,
(create every register for España organization)
Go to Toolset window,
  create a new one: Cutter
  Toolset tab:
     Search key: Cutter
     Discard: YEs
     Storage Bin: RN-0-0-0
     
Go to Work Center,
   create a new one.
      Activity tab:
        create a new one. name = Production
       Toolset tab: cutter - Utilization Coefficient: 10
   Machine tab: select a machine (Create a new one)

Go to Manufacturing Cost Center
   create a new one with a valid version and the machine created before


Go to Activity window:
 create a new one. Name: Actividad
    select the Cost center created before and the Work Center created before.
  Toolset: cutter - Utilization Coefficient: 10

   Go To process plan
      Include Operations when inserting = Yes
      Name: Process Plan
     Version tab: Starting date: 01/01/2012
                  Ending date: 31/12/9999
     Operation tab: name: S1
       Activity: select the one created before
       Create Standards: Yes
  I/O Products:
     select one P- and one P+ (create two products defined as Production)

Go to Work Requirement window,
   select the process plan created before
   qty: 1
 Process the work requirement
 Click on 'Create Work Effort' and check that the Work Effort is created

**OPTIONAL**
Delete the Work Effort just created
Go to Toolset Window and in the Toolset tab set Discard = 'N'
Go to Work Requirement window and click on 'Create Work Effort'
Check that the Work Effort is created and the Toolset appears in the Toolset tab
(0076933)
hgbot   
2015-05-04 12:47   
Repository: erp/devel/pi
Changeset: 360ce267780f1ac57ef62f6e80242f2a7ef24607
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Fri Apr 17 13:40:09 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/360ce267780f1ac57ef62f6e80242f2a7ef24607 [^]

Fixed issue 29531: Not possible to create standards with a discarded toolset

Not possible to create standards if a toolset is defined as Discard.

The problem occurs when, in the ma_productionrun_standard function, insert
a null ma_toolset_id. This happens when only discard toolsets are available.

The solution is to avoid the insert of a null ma_toolset_id in the function.

Now, it is possible to create a Work Effort with a discarded toolset. In the
Work Effort window, the discarded toolset doesn't appear in the Toolset tab.

---
M src-db/database/model/functions/MA_PRODUCTIONRUN_STANDARD.xml
---
(0076934)
Sandrahuguet   
2015-05-04 12:47   
Code review + testing OK
(0077197)
hudsonbot   
2015-05-07 22:17   
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/a1817f84bd8b [^]
Maturity status: Test