Merge lp:~openerp-dev/openobject-addons/trunk-opw-581120-port-mma into lp:openobject-addons

Proposed by Mayur Maheshwari(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-opw-581120-port-mma
Merge into: lp:openobject-addons
Diff against target: 19 lines (+4/-2)
1 file modified
stock/stock.py (+4/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-opw-581120-port-mma
Reviewer Review Type Date Requested Status
Mayur Maheshwari(OpenERP) (community) Needs Resubmitting
Fabien (Open ERP) Disapprove
Review via email: mp+133230@code.launchpad.net

Description of the change

Hello,

step to reproduce:

1] There are 2 UOM
  -kg ( reference unit)
 - gm (Smaller than the reference UoM and ratio 1000)
2] Make a product like "test product" with purchase unit = g and uom = g
3] From incoming shipment process 500 gram "test product" to stock location and make lot like "00001"
4] Now from internal move change location stock to self -1 and apply lot as already create "00001"
   so here raise a warning message

    Insufficient Stock in Lot !
    You are moving 500gm products but only 0.50 gm available in this lot.

For better understanding of the issue, please refer to the video attached to the comment #3 of lp:1068152.

This branch fixes this issue
code is forward port from 6.1

Thanks,
Mayur

To post a comment you must log in.
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

The fix is not clean. There reference UoM may not exist. It's not a good practice to search on this. You should just multiply or divise by the rate of the product UoM.

review: Disapprove
Revision history for this message
Mayur Maheshwari(OpenERP) (mma-openerp) wrote :

Hello ,

    I have Improve onchange and make qty of multiply with its factor

Thanks

review: Needs Resubmitting

Unmerged revisions

7965. By Mayur Maheshwari(OpenERP)

[IMP]stock: improve a code of onchage and make qty of multiply with its factor

7964. By Ravi Gohil (OpenERP)

[FIX]account_voucher : If we have a product configured with a default UoM whose UoM type is set to other than reference uom, and when creating production lot for this product, it shows QTY in reference UoM and not in default UoM, this causes wrong warning message when assigning lot while creating picking

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2012-11-06 15:04:31 +0000
3+++ stock/stock.py 2012-11-07 12:23:24 +0000
4@@ -1881,11 +1881,13 @@
5 ctx.update({'raise-exception': True})
6 uom_obj = self.pool.get('product.uom')
7 product_obj = self.pool.get('product.product')
8- product_uom = product_obj.browse(cr, uid, product_id, context=ctx).uom_id
9+ product_uom_categ = product_obj.browse(cr, uid, product_id, context=ctx).uom_id.category_id.id
10+ product_ref_uom_id = uom_obj.search(cr, uid, [('category_id', '=', product_uom_categ), ('uom_type', '=', 'reference')], context=ctx)[0]
11+ product_ref_uom = uom_obj.browse(cr, uid, product_ref_uom_id, context=ctx)
12 prodlot = self.pool.get('stock.production.lot').browse(cr, uid, prodlot_id, context=ctx)
13 location = self.pool.get('stock.location').browse(cr, uid, loc_id, context=ctx)
14 uom = uom_obj.browse(cr, uid, uom_id, context=ctx)
15- amount_actual = uom_obj._compute_qty_obj(cr, uid, product_uom, prodlot.stock_available, uom, context=ctx)
16+ amount_actual = uom_obj._compute_qty_obj(cr, uid, product_ref_uom, prodlot.stock_available, uom, context=ctx)
17 warning = {}
18 if (location.usage == 'internal') and (product_qty > (amount_actual or 0.0)):
19 warning = {

Subscribers

People subscribed via source and target branches

to all changes: