[IMP] stock: float used use the correct decimal precision
bzr revid: sbh@tinyerp.com-20100923063718-s8dj60xcaplwwmry
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
import tools
|
||||
from osv import fields,osv
|
||||
import decimal_precision as dp
|
||||
|
||||
|
||||
class report_stock_move(osv.osv):
|
||||
@@ -45,9 +46,9 @@ class report_stock_move(osv.osv):
|
||||
'product_qty_in':fields.integer('In Qty',readonly=True),
|
||||
'product_qty_out':fields.integer('Out Qty',readonly=True),
|
||||
'value' : fields.float('Total Value', required=True),
|
||||
'day_diff2':fields.float('Delay (Days)',readonly=True, digits=(16,2), group_operator="avg"),
|
||||
'day_diff1':fields.float('Planned (Days)',readonly=True, digits=(16,2), group_operator="avg"),
|
||||
'day_diff':fields.float('Real (Days)',readonly=True, digits=(16,2), group_operator="avg"),
|
||||
'day_diff2':fields.float('Delay (Days)',readonly=True, digits_compute=dp.get_precision('Product UoM'), group_operator="avg"),
|
||||
'day_diff1':fields.float('Planned (Days)',readonly=True, digits_compute=dp.get_precision('Product UoM'), group_operator="avg"),
|
||||
'day_diff':fields.float('Real (Days)',readonly=True, digits_compute=dp.get_precision('Product UoM'), group_operator="avg"),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
@@ -135,8 +136,8 @@ class report_stock_inventory(osv.osv):
|
||||
'location_id': fields.many2one('stock.location', 'Location', readonly=True),
|
||||
'prodlot_id': fields.many2one('stock.production.lot', 'Lot', readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'product_qty':fields.float('Quantity', digits=(16,2), readonly=True),
|
||||
'value' : fields.float('Total Value', digits=(16,2), required=True),
|
||||
'product_qty':fields.float('Quantity', digits_compute=dp.get_precision('Product UoM'), readonly=True),
|
||||
'value' : fields.float('Total Value', digits_compute=dp.get_precision('Account'), required=True),
|
||||
'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True,
|
||||
help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\
|
||||
\nThe state is \'Waiting\' if the move is waiting for another one.'),
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
##############################################################################
|
||||
from osv import fields,osv
|
||||
import tools
|
||||
import decimal_precision as dp
|
||||
|
||||
class report_stock_picking(osv.osv):
|
||||
_name = "report.stock.picking"
|
||||
@@ -37,8 +38,8 @@ class report_stock_picking(osv.osv):
|
||||
'product_uos_qty': fields.float('# of Products', readonly=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', readonly=True),
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'avg_days_late': fields.float('Avg Due Days', digits=(16,2), readonly=True, group_operator="avg"),
|
||||
'avg_days_to_deliver': fields.float('Avg Days to Deliver', digits=(16,2), readonly=True, group_operator="avg",
|
||||
'avg_days_late': fields.float('Avg Due Days', digits_compute=dp.get_precision('Product UoM'), readonly=True, group_operator="avg"),
|
||||
'avg_days_to_deliver': fields.float('Avg Days to Deliver', digits_compute=dp.get_precision('Product UoM'), readonly=True, group_operator="avg",
|
||||
help="Number of Avg Days to deliver"),
|
||||
'state': fields.selection([('draft', 'Draft'),('auto', 'Waiting'),('confirmed', 'Confirmed'),('assigned', 'Available'),('done', 'Done'),('cancel', 'Cancelled')], 'State'),
|
||||
'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('delivery', 'Delivery')], 'Shipping Type', required=True),
|
||||
|
||||
@@ -21,12 +21,13 @@
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import decimal_precision as dp
|
||||
|
||||
class change_standard_price(osv.osv_memory):
|
||||
_name = "stock.change.standard.price"
|
||||
_description = "Change Standard Price"
|
||||
_columns = {
|
||||
'new_price': fields.float('Price', required=True,
|
||||
'new_price': fields.float('Price', required=True, digits_compute=dp.get_precision('Account'),
|
||||
help="If cost price is increased, stock variation account will be debited "
|
||||
"and stock output account will be credited with the value = (difference of amount * quantity available).\n"
|
||||
"If cost price is decreased, stock variation account will be creadited and stock input account will be debited."),
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
import decimal_precision as dp
|
||||
|
||||
class stock_split_into(osv.osv_memory):
|
||||
_name = "stock.split.into"
|
||||
_description = "Split into"
|
||||
_columns = {
|
||||
'quantity': fields.float('Quantity', digits=(16,2)),
|
||||
'quantity': fields.float('Quantity',digits_compute=dp.get_precision('Product UOM')),
|
||||
}
|
||||
_defaults = {
|
||||
'quantity': lambda *x: 0,
|
||||
|
||||
Reference in New Issue
Block a user