narigao / magento-openerp-smile-synchro

Automatically exported from code.google.com/p/magento-openerp-smile-synchro
0 stars 0 forks source link

Package OpenERP extra numeric precision as ALTER COLUMN inside int modul method #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
As said in the FAQ, OpenERP require more precision on some fields to adapt
the Magento discount/tax system.

Instead of having to do this after module installtion via SQL or PGAdmin,
it would be nice to automatically fire the ALTER COLUMN inside the init
module method, just like regular SQL view creations in OpenERP reporting
modules.
Should be very easy.

Raphaël Valyi

Original issue reported on code.google.com by rva...@gmail.com on 11 Dec 2008 at 11:53

GoogleCodeExporter commented 9 years ago
This snippet is from an other project, but similar code should be use:

def init(self, cr):
     cr.execute("alter table sale_order_line alter column discount type 
numeric(16,7);")

_columns = {
         'discount'        : fields.float('Discount (%)', digits=(16,7)),
}

Original comment by rva...@gmail.com on 19 Dec 2008 at 5:18