Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0008739Openbravo ERP05. Production managementpublic2009-04-23 13:212009-05-05 00:00
jtarbal 
rajagopal 
urgentmajoralways
closedfixed 
5
2.50 
2.50MP1 
Core
No
0008739: Error when validating a Work Effort document
When validating a Work Effort document the following error appears:
invalid input syntax for type numeric: "2C9820482F7311DE99DF000C2966C57D".

In order to reproduce this error, please follow the following steps:
Previous requirements: the following documents need to be created first: Process Plan and Work Requirement. Once they are created, follow the next steps:
1.- Create a new Work Effort document
2.- Go to Production Run tab and create a new record selecting an operation that is pending to be manufactured.
3.- Specify the quantity to produce (or the number of times that the operation will be executed)
4.- Go to the Work Effort header and press the button "Validate Work Effort".
5.- See the error mentioned above.
The solution has been identified. The error is in DB process MA_PRODUCTION_COST. At the end of this process, the following query is executed:

SELECT COUNT(*), MAX(pl.M_ProductionLine_ID) INTO v_count, v_count2
      FROM M_PRODUCTIONLINE pl, M_PRODUCTIONPLAN pp
      WHERE pp.M_PRODUCTION_ID=p_Production_ID
        AND pp.M_PRODUCTIONPLAN_ID = pl.M_PRODUCTIONPLAN_ID
        AND pl.CALCULATED='N';

This query throws an error as the variable v_count2 is NUMERIC and MAX(pl.M_ProductionLine_ID) is CHARACTER VARYING.

In order to solve the error:
1.- Create a new variable v_count3
2.- Replace the new variable for v_count2 only in the query above and in the next appearance
250MP1
Issue History
2009-04-23 13:21jtarbalNew Issue
2009-04-23 13:21jtarbalAssigned To => rafaroda
2009-04-23 13:28psarobeAssigned Torafaroda => gorkaion
2009-04-23 13:28psarobePrioritynormal => urgent
2009-04-23 13:28psarobeStatusnew => scheduled
2009-04-23 13:28psarobefix_in_branch => pi
2009-04-23 13:51rafarodaAssigned Togorkaion => rajagopal
2009-04-23 16:04psarobeTag Attached: 250MP1
2009-04-28 17:49hgbotCheckin
2009-04-28 17:49hgbotNote Added: 0015874
2009-04-28 17:49hgbotStatusscheduled => resolved
2009-04-28 17:49hgbotResolutionopen => fixed
2009-04-28 17:49hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/5dc324b8fb7d61f5690a48772b1ca80d56cb31f5 [^]
2009-05-04 19:47psarobeRegression testing => No
2009-05-04 19:47psarobeStatusresolved => closed
2009-05-05 00:00anonymoussf_bug_id0 => 2786918

Notes
(0015874)
hgbot   
2009-04-28 17:49   
Repository: erp/devel/pi
Changeset: 5dc324b8fb7d61f5690a48772b1ca80d56cb31f5
Author: Rajagopal Baskaran <rajagopal.baskaran <at> openbravo.com>
Date: Tue Apr 28 21:15:32 2009 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/5dc324b8fb7d61f5690a48772b1ca80d56cb31f5 [^]

Fixes bug 8739: Error when validating a Work Effort document has been fixed.

---
M src-db/database/model/functions/MA_PRODUCTION_COST.xml
---