Merge lp:~openbig/bigconsulting/new_branch_changes_sales_shop_stock_availablity into lp:bigconsulting

Proposed by gpa(OpenERP)
Status: Merged
Merged at revision: 21
Proposed branch: lp:~openbig/bigconsulting/new_branch_changes_sales_shop_stock_availablity
Merge into: lp:bigconsulting
Diff against target: 56 lines (+23/-4)
2 files modified
sales_shop_stock_availability/sales_shop_stock_availability.py (+22/-4)
sales_shop_stock_availability/sales_shop_stock_availability_view.xml (+1/-0)
To merge this branch: bzr merge lp:~openbig/bigconsulting/new_branch_changes_sales_shop_stock_availablity
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+27729@code.launchpad.net

Description of the change

changes in sales_shop_stock_availablity

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sales_shop_stock_availability/sales_shop_stock_availability.py'
2--- sales_shop_stock_availability/sales_shop_stock_availability.py 2010-06-10 10:03:25 +0000
3+++ sales_shop_stock_availability/sales_shop_stock_availability.py 2010-06-16 14:59:21 +0000
4@@ -31,18 +31,36 @@
5 res = {}
6 product_obj = self.pool.get('product.product')
7 shop = context.get('shop', False)
8- fields_name = ['qty_available']
9+ fields_name = ['qty_available','virtual_available']
10+
11 stock2 = product_obj._product_available(cr, uid, ids ,fields_name,context={})
12+
13 context.update({'shop':shop})
14 stock1 = product_obj._product_available(cr, uid, ids ,fields_name,context=context)
15+
16+ real_res = {}
17 for key,value in stock2.items():
18- res[key] = stock2[key]['qty_available'] - stock1[key]['qty_available']
19+ real_res[key] = stock2[key]['qty_available'] - stock1[key]['qty_available']
20+
21+ virtual_res = {}
22+ for key,value in stock2.items():
23+ virtual_res[key] = stock2[key]['virtual_available'] - stock1[key]['virtual_available']
24+
25+ for id in ids:
26+ res[id] = {}
27+ if 'qty_available_other_shop' in name:
28+ res[id].update({'qty_available_other_shop': real_res[id]})
29+ if 'virtual_qty_available_other_shop' in name:
30+ res[id].update({'virtual_qty_available_other_shop' : virtual_res[id]})
31 return res
32-
33+
34 _columns = {
35- 'qty_available_other_shop': fields.function(_product_available_other_shop, method=True, type='float', string='Other Shops', help="Current quantities of products in other stock location except selected shop in sale order."),
36+ 'qty_available_other_shop': fields.function(_product_available_other_shop, method=True, type='float', string='Real Other Stock', help="Current quantities of products in other stock location except selected shop in sale order.", multi='qty_available_other_shop'),
37+
38+ 'virtual_qty_available_other_shop': fields.function(_product_available_other_shop, method=True, type='float', string='Virtual Other Stock', help="Current virtual quantities of products in other stock location except selected shop in sale order.", multi='virtual_qty_available_other_shop'),
39 }
40
41+
42 product_product()
43
44 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
45
46=== modified file 'sales_shop_stock_availability/sales_shop_stock_availability_view.xml'
47--- sales_shop_stock_availability/sales_shop_stock_availability_view.xml 2010-06-10 10:03:25 +0000
48+++ sales_shop_stock_availability/sales_shop_stock_availability_view.xml 2010-06-16 14:59:21 +0000
49@@ -16,6 +16,7 @@
50 <field name="qty_available"/>
51 <field name="virtual_available"/>
52 <field name="qty_available_other_shop"/>
53+ <field name="virtual_qty_available_other_shop"/>
54 <field invisible="'partner_id' not in context" name="price"/>
55 <field name="lst_price"/>
56 <field name="standard_price"/>

Subscribers

People subscribed via source and target branches