← Back to team overview

openerp-expert-production team mailing list archive

[Bug 794207] Re: MRP operations time precission to seconds

 

OK, this was bugging me:

# Test float to time
def float_time_convert(float_val):

        hours = math.floor(abs(float_val))

        mins = abs(float_val)%1
        mins = mins * 60
        mins = round(mins + 0.0001,4)
        if mins >= 60:
            hours = hours + 1
            mins = 0

        secs = abs((mins)%1)
        secs = secs * 60
        secs = round(secs + 0.0001,4)
        if secs >= 60:
            mins = mins + 1
            secs = 0

        float_time = '%02d:%02d:%02d' % (hours,mins,secs)
        return float_time


for i in range(24):
    for j in range(60):
        for k in range(60):
            input_time = '%02d:%02d:%02d' % (i,j,k)
            float_val = round(int(input_time.split(':')[0]) + int(input_time.split(':')[1]) / 60.0 + int(input_time.split(':')[2]) / 60.0 / 60.0, 8)
            output_time = float_time_convert(float_val)

            if output_time != input_time:
                print "input_time (%s) != output_time (%s)" % (input_time, output_time)


Mmmm. Need to fix the web dispaly also.
Is anyone interested in the fix when it is done?

-- 
You received this bug notification because you are a member of OpenERP
Manufacturing Experts, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/794207

Title:
  MRP operations time precission to seconds

Status in OpenERP Addons (modules):
  Opinion

Bug description:
  MRP operations time precision to seconds

  In our industry we need to estimate time for one cycle in seconds, in
  fact we do have several operations for one second.

  Please make possible to use time with seconds in all manufacture
  process.

  I would gladly help if I knew how.
  I tried to make the field nbr_hours in work center definition as field.time, it does display seconds but then it does not compute.

  I need help please,

  Thanks
  Mihai

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/794207/+subscriptions