Merge lp:~openerp-dev/openobject-addons/trunk-bug-1092022-cga into lp:openobject-addons

Proposed by Chandni Gandhi(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1092022-cga
Merge into: lp:openobject-addons
Diff against target: 72 lines (+8/-7)
2 files modified
stock/stock.py (+3/-6)
stock_invoice_directly/wizard/stock_invoice.py (+5/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1092022-cga
Reviewer Review Type Date Requested Status
Atul Patel(OpenERP) (community) Approve
OpenERP Core Team Pending
Review via email: mp+141545@code.launchpad.net

Description of the change

Hello,

Put correct uos qty for partial picking to correct invoice.
Pass backorder_id to create invoice for partial picking.

Thanks

To post a comment you must log in.
8488. By Chandni Gandhi(OpenERP)

[IMP]: pass backorder id into context in invoice directly wizard

Revision history for this message
Atul Patel(OpenERP) (atp-openerp) wrote :

hello,

it's work

THanks

review: Approve
8489. By Chandni Gandhi(OpenERP)

[MERGE]:With latest code

Unmerged revisions

8489. By Chandni Gandhi(OpenERP)

[MERGE]:With latest code

8488. By Chandni Gandhi(OpenERP)

[IMP]: pass backorder id into context in invoice directly wizard

8487. By Chandni Gandhi(OpenERP)

[FIX]: Add product qty with UOS Coeff and pass backorder id in partial picking for invoice

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-12-21 16:48:08 +0000
3+++ stock/stock.py 2013-02-07 09:17:26 +0000
4@@ -1251,7 +1251,6 @@
5 too_few.append(move)
6 else:
7 too_many.append(move)
8-
9 # Average price computation
10 if (pick.type == 'in') and (move.product_id.cost_method == 'average'):
11 product = product_obj.browse(cr, uid, move.product_id.id)
12@@ -1285,7 +1284,6 @@
13 {'price_unit': product_price,
14 'price_currency_id': product_currency})
15
16-
17 for move in too_few:
18 product_qty = move_product_qty[move.id]
19 if not new_picking:
20@@ -1303,7 +1301,7 @@
21 if product_qty != 0:
22 defaults = {
23 'product_qty' : product_qty,
24- 'product_uos_qty': product_qty, #TODO: put correct uos_qty
25+ 'product_uos_qty': product_qty * (move.product_id.uos_id and move.product_id.uos_coeff or 1), #TODO: put correct uos_qty
26 'picking_id' : new_picking,
27 'state': 'assigned',
28 'move_dest_id': False,
29@@ -1317,7 +1315,7 @@
30 move_obj.write(cr, uid, [move.id],
31 {
32 'product_qty': move.product_qty - partial_qty[move.id],
33- 'product_uos_qty': move.product_qty - partial_qty[move.id], #TODO: put correct uos_qty
34+ 'product_uos_qty': (move.product_qty - partial_qty[move.id])* (move.product_id.uos_id and move.product_id.uos_coeff or 1), #TODO: put correct uos_qty
35 'prodlot_id': False,
36 'tracking_id': False,
37 })
38@@ -1333,7 +1331,7 @@
39 product_qty = move_product_qty[move.id]
40 defaults = {
41 'product_qty' : product_qty,
42- 'product_uos_qty': product_qty, #TODO: put correct uos_qty
43+ 'product_uos_qty': product_qty * (move.product_id.uos_id and move.product_id.uos_coeff or 1), #TODO: put correct uos_qty
44 'product_uom': product_uoms[move.id]
45 }
46 prodlot_id = prodlot_ids.get(move.id)
47@@ -1361,7 +1359,6 @@
48
49 delivered_pack = self.browse(cr, uid, delivered_pack_id, context=context)
50 res[pick.id] = {'delivered_picking': delivered_pack.id or False}
51-
52 return res
53
54 # views associated to each picking type
55
56=== modified file 'stock_invoice_directly/wizard/stock_invoice.py'
57--- stock_invoice_directly/wizard/stock_invoice.py 2012-12-06 14:56:32 +0000
58+++ stock_invoice_directly/wizard/stock_invoice.py 2013-02-07 09:17:26 +0000
59@@ -31,8 +31,12 @@
60 if context is None: context = {}
61 result = super(invoice_directly, self).do_partial(cr, uid, ids, context)
62 partial = self.browse(cr, uid, ids[0], context)
63+ if partial.picking_id.backorder_id.id:
64+ active_ids = [partial.picking_id.backorder_id.id]
65+ else:
66+ active_ids = [partial.picking_id.id]
67 context.update(active_model='stock.picking',
68- active_ids=[partial.picking_id.id])
69+ active_ids = active_ids)
70 if partial.picking_id.invoice_state == '2binvoiced':
71 return {
72 'name': 'Create Invoice',

Subscribers

People subscribed via source and target branches

to all changes: