Comment 5 for bug 511193

Revision history for this message
Ana Juaristi Olalde (ajuaristio) wrote : Re: [Bug 511193] Re: unit factor is limited to 5 zeros

Jay... sorry. I don't think this is the correct way to make thinks. This bug
is causing that I can't define 1kg like the unit master and a mg like
refactored unit. I think it should be changed on affected module not to be
happen again just like another bug it it's not related to python code.

Thank you for sending me the querys.

2010/2/4 Jay (Open ERP) <email address hidden>

> Hello Ana,
>
> If you sense risk on upgrading the module after this change in class
> definition.
>
> Follow this on postgresql:
> You need to run these queries:
> First check \d product_uom and observe the size of factor column.
>
> 1. alter table product_uom rename column factor to temp_column; (renaming
> factor to temp_column)
> 2. alter table product_uom add column factor numeric(16,6);(Adding our own
> column)
> 3. update product_uom set factor=temp_column;(Coying data back to factor
> column from temp_column)
> 4. alter table product_uom drop column temp_column cascade;(Remove
> temp_column)
> 5. \d product_uom; Observe the difference.
>
> Hope this helps.
>
> I am invalidating this bug as this is not a bug,this is a limitation of
> factor set in generic.
>
> Thanks.
>
>
> ** Changed in: openobject-addons
> Status: New => Invalid
>
> --
> unit factor is limited to 5 zeros
> https://bugs.launchpad.net/bugs/511193
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in OpenObject Addons Modules: Invalid
>
> Bug description:
> I have got a category measure unit size.
>
> The master unit is meter, but I need having m2, m3 and related measure
> units like mm, mm2, mm3, micrometer
>
> so 1m = 1000mm
> but 1m = 1000000micrometer
>
> If I try including a conversion factor where I need more than 5 zeros,
> system crashes showing this error:
>
> Environment Information :
> System : Windows-XP-5.1.2600-SP3
> OS Name : nt
> Operating System Release : XP
> Operating System Version : 5.1.2600
> Operating System Architecture : 32bit
> Operating System Locale : es_ES.cp1252
> Python Version : 2.5.2
> OpenERP-Client Version : 5.0.6
> Last revision No. & ID :Bazaar Package not Found !Traceback (most recent
> call last):
> File "/home/xabier/openerp-server/server/bin/netsvc.py", line 244, in
> dispatch
> result = LocalService(service_name)(method, *params)
> File "/home/xabier/openerp-server/server/bin/netsvc.py", line 73, in
> __call__
> return getattr(self, method)(*params)
> File
> "/home/xabier/openerp-server/server/bin/addons/base_module_record/base_module_record.py",
> line 38, in execute
> res = super(recording_objects_proxy, self).execute(*args, **argv)
> File "/home/xabier/openerp-server/server/bin/service/web_services.py",
> line 583, in execute
> res = service.execute(db, uid, object, method, *args)
> File "/home/xabier/openerp-server/server/bin/osv/osv.py", line 59, in
> wrapper
> return f(self, dbname, *args, **kwargs)
> File "/home/xabier/openerp-server/server/bin/osv/osv.py", line 118, in
> execute
> res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
> File "/home/xabier/openerp-server/server/bin/osv/osv.py", line 110, in
> execute_cr
> return getattr(object, method)(cr, uid, *args, **kw)
> File "/home/xabier/openerp-server/server/bin/osv/orm.py", line 2458, in
> write
> 'where id in ('+ids_str+')', upd1)
> File "/home/xabier/openerp-server/server/bin/sql_db.py", line 76, in
> wrapper
> return f(self, *args, **kwargs)
> File "/home/xabier/openerp-server/server/bin/sql_db.py", line 120, in
> execute
> res = self._obj.execute(query, params)
> ProgrammingError: numeric field overflow
> DETAIL: A field with precision 12, scale 6 must round to an absolute value
> less than 10^6.
>
> This is limiting the possibility of having all posible and needed
> conversion factors on measure units, so I think it could be considered a bug
> or maybe wishlist
>
> Thank you!!
>
> Ana
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/openobject-addons/+bug/511193/+subscribe
>

--
Ana Juaristi Olalde
Consultor Freelance OpenERP
www.anajuaristi.com
www.openerpsite.com
www.avanzosc.com
677 93 42 59 - 943 85 06 25