Amit Dodiya (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.1-opw-574481-ado into
lp:openobject-addons/6.1.
Requested reviews:
Xavier ALT (OpenERP) (xal-openerp)
Naresh(OpenERP) (nch-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574481-ado/+merge/104673
Hello,
"FIX] rounding issue with same uom in partial picking wizard"
When validating certain receptions with a specific number. eg. 27.4 with eg.
Meter and linear meter which has a precision rounding of 0.01, an warning
occurs reading: *The uom rounding does not allow you to ship "27.4 m", only
roundings of "0.01 m" is accepted by the uom.
Steps :
1). Create a purchase order for product = Wood 2mm with quantity = 27.400
2). Confirm the purchase order , Goto reception and try to process & validate
the 27.400 quantity in wizard.
The warning message is appeared.
Regards,
Amit
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574481-ado/+merge/104673
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.1-opw-574481-ado.
=== modified file 'stock/wizard/stock_partial_picking.py'
--- stock/wizard/stock_partial_picking.py 2012-04-25 07:20:05 +0000
+++ stock/wizard/stock_partial_picking.py 2012-05-04 05:47:22 +0000
@@ -141,7 +141,11 @@
raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
#Compute the quantity for respective wizard_line in the line uom (this jsut do the rounding if necessary)
- qty_in_line_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, line_uom.id)
+
+ if line_uom <> wizard_line.move_id.product_uom:
+ qty_in_line_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, line_uom.id)
+ else:
+ qty_in_line_uom = wizard_line.quantity
if line_uom.factor and line_uom.factor <> 0:
if qty_in_line_uom <> wizard_line.quantity:
@@ -153,8 +157,12 @@
#=> result= refused, as the qty left on picking would be 0.747kg and only 0.75 is accepted by the uom.
initial_uom = wizard_line.move_id.product_uom
#Compute the quantity for respective wizard_line in the initial uom
- qty_in_initial_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, initial_uom.id)
+ if initial_uom <> line_uom :
+ qty_in_initial_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, initial_uom.id)
+ else :
+ qty_in_initial_uom = wizard_line.quantity
without_rounding_qty = (wizard_line.quantity / line_uom.factor) * initial_uom.factor
+
if qty_in_initial_uom <> without_rounding_qty:
raise osv.except_osv(_('Warning'), _('The rounding of the initial uom does not allow you to ship "%s %s", as it would let a quantity of "%s %s" to ship and only roundings of "%s %s" is accepted by the uom.') % (wizard_line.quantity, line_uom.name, wizard_line.move_id.product_qty - without_rounding_qty, initial_uom.name, initial_uom.rounding, initial_uom.name))
else:
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp