Merge lp:~openerp-dev/openobject-addons/6.1-opw-574049-rgo into lp:openobject-addons/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-574049-rgo
Merge into: lp:openobject-addons/6.1
Diff against target: 37 lines (+27/-0)
1 file modified
sale/sale.py (+27/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-574049-rgo
Reviewer Review Type Date Requested Status
Hennie Poley (community) Needs Resubmitting
Naresh(OpenERP) Pending
Review via email: mp+104885@code.launchpad.net

Description of the change

Hello,

There is an issue when delivering the SO partially, invoice is created with undelivered quantity,

Steps to Reproduce the issue:

1) create a so with a product: say for example PC1 with quantity=10 with below policies and confirm it. A picking is created.

Picking Policy: Deliver each product when available
Invoice Policy: Deliver & invoice on demand
Invoice On: Shipped Quantities

2) Now, deliver 3 products from created picking, go to SO created and click on "Create Final Invoice", invoice will be created with quantity 7(undelivered quantity).

This MP contains fix for this issue, Kindly review it.

Thanks.

To post a comment you must log in.
Revision history for this message
Hennie Poley (m-hennie) wrote :

Hi

we are experiencing the same error and have tried the fix, but it doesn't work?

any new feedback?

thanks

review: Needs Resubmitting
Revision history for this message
Ravi Gohil (OpenERP) (rgo-openerp) wrote :

Hello Hennie,

This fix is intended for another bug which is different from the one you reported at https://bugs.launchpad.net/openobject-addons/+bug/1011607. Comment #: 4 on your bug report by Amit confirms this. That's why applying this fix at your end didn't work for you.

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6789. By Ravi Gohil (OpenERP)

[FIX] sale: partially delivered SO creates invoice with wrong quantity: (Maintenance Case : 574049)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale/sale.py'
2--- sale/sale.py 2012-02-16 16:52:53 +0000
3+++ sale/sale.py 2012-05-07 10:38:20 +0000
4@@ -912,6 +912,33 @@
5 return False
6 sale_order()
7
8+class procurement_order(osv.osv):
9+ _inherit = 'procurement.order'
10+
11+ def _quantity_compute_get(self, cr, uid, proc, context=None):
12+ """ Computes only quantity of product that were Delivered and also computes the quantity of returned products.
13+ @param proc: Current procurement.
14+ @return: Quantity or False.
15+ """
16+ if proc.product_id.type == 'product' and proc.move_id:
17+ move_obj = self.pool.get('stock.move')
18+ sale_id = proc.move_id.picking_id.sale_id.id
19+ picking_ids = self.pool.get('stock.picking').search(cr, uid, [('sale_id', '=', sale_id), ('state', '=', 'done'), ('type', '=', 'out')], context=context)
20+ returned_picking_ids = self.pool.get('stock.picking').search(cr, uid, [('sale_id', '=', sale_id), ('state', '=', 'done'), ('type', '=', 'in')], context=context)
21+ qty_uos = 0
22+ for returned_picking_id in returned_picking_ids:
23+ move_ids = move_obj.search(cr, uid, [('picking_id', '=', returned_picking_id)], context=context)
24+ qty_uos += move_obj.browse(cr, uid, move_ids, context=context)[0].product_uos_qty
25+ qty_uos = -qty_uos
26+ for picking_id in picking_ids:
27+ move_ids = move_obj.search(cr, uid, [('picking_id', '=', picking_id)], context=context)
28+ qty_uos += move_obj.browse(cr, uid, move_ids, context=context)[0].product_uos_qty
29+ return qty_uos
30+ return False
31+
32+procurement_order()
33+
34+
35 # TODO add a field price_unit_uos
36 # - update it on change product and unit price
37 # - use it in report if there is a uos