Merge lp:~openerp-dev/openobject-addons/6.0-opw-51083-rha into lp:openobject-addons/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-51083-rha
Merge into: lp:openobject-addons/6.0
Diff against target: 98 lines (+12/-10)
4 files modified
sale/sale.py (+4/-2)
sale/sale_view.xml (+3/-3)
sale_layout/sale_layout_view.xml (+3/-3)
sale_margin/sale_margin.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-51083-rha
Reviewer Review Type Date Requested Status
Priyesh (OpenERP) Pending
Review via email: mp+85130@code.launchpad.net

Description of the change

Hello,

We sale products from particular Shop defined on any sales order.
But SO not checking stock available from warehouse of shop which is being dispatched from.

This fixes the problem.
Kindly check it and share your view on this.

Regards,
Rifakat

To post a comment you must log in.
4950. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4951. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4952. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4954. By nel

[FIX] copy note on invoice line when invoicing from pickings

4955. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4956. By Olivier Laurent (Open ERP)

[MERGE] opw 18473

4958. By nel

[FIX] stock: wizard invoice on shipping
propose more journals when location type is different from supplier and customer

4959. By nel

[fix] stock_invoice_directly: set right journal to invoice pickings

4960. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4961. By nel

Revert to revision before 4958
account_payment commited but not yet validated

4962. By nel

[FIX] stock: wizard invoice on shipping
propose more journals when location type is different from supplier and customer

4963. By nel

[MERGE]

4965. By Olivier Laurent (Open ERP)

[FIX] CRM : When you delete a 'crm.lead'. Associated 'mailgate.message' aren't cleaned(Ref: Case 50893)

4966. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4968. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4969. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4970. By Rifakat Husen (OpenERP)

[FIX] sale, sale_layout,sale_margin: passed context into product_id_change()

Unmerged revisions

4970. By Rifakat Husen (OpenERP)

[FIX] sale, sale_layout,sale_margin: passed context into product_id_change()

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 2011-09-22 10:28:12 +0000
3+++ sale/sale.py 2011-12-19 10:47:27 +0000
4@@ -1011,16 +1011,18 @@
5
6 def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
7 uom=False, qty_uos=0, uos=False, name='', partner_id=False,
8- lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False):
9+ lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None):
10 if not partner_id:
11 raise osv.except_osv(_('No Customer Defined !'), _('You have to select a customer in the sales form !\nPlease set one customer before choosing a product.'))
12 warning = {}
13+ if not context:
14+ context = {}
15 product_uom_obj = self.pool.get('product.uom')
16 partner_obj = self.pool.get('res.partner')
17 product_obj = self.pool.get('product.product')
18 if partner_id:
19 lang = partner_obj.browse(cr, uid, partner_id).lang
20- context = {'lang': lang, 'partner_id': partner_id}
21+ context.update({'lang': lang, 'partner_id': partner_id})
22
23 if not product:
24 return {'value': {'th_weight': 0, 'product_packaging': False,
25
26=== modified file 'sale/sale_view.xml'
27--- sale/sale_view.xml 2011-07-08 10:51:30 +0000
28+++ sale/sale_view.xml 2011-12-19 10:47:27 +0000
29@@ -128,12 +128,12 @@
30 <field colspan="4"
31 context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
32 name="product_id"
33- on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, parent.date_order, product_packaging, parent.fiscal_position, False)"
34+ on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, parent.date_order, product_packaging, parent.fiscal_position, False, {'shop':parent.shop_id})"
35 />
36 <field
37 context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
38 name="product_uom_qty"
39- on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position, True)"
40+ on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position, True, {'shop':parent.shop_id})"
41 />
42 <field groups="product.group_uos" name="product_uos_qty"/>
43 <field groups="product.group_uos" name="product_uos"/>
44@@ -142,7 +142,7 @@
45 <field
46 name="product_packaging"
47 context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
48- on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position, False)"
49+ on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position, False, {'shop':parent.shop_id})"
50 domain="[('product_id','=',product_id)]"
51 groups="base.group_extended"/>
52
53
54=== modified file 'sale_layout/sale_layout_view.xml'
55--- sale_layout/sale_layout_view.xml 2011-01-14 00:11:01 +0000
56+++ sale_layout/sale_layout_view.xml 2011-12-19 10:47:27 +0000
57@@ -22,13 +22,13 @@
58 context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
59 name="product_id"
60 attrs="{'readonly':[('layout_type','!=','article')]}"
61- on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, parent.date_order, product_packaging, parent.fiscal_position)"
62+ on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, parent.date_order, product_packaging, parent.fiscal_position, False, {'shop':parent.shop_id})"
63 select="1"/>
64 <field
65 context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
66 name="product_uom_qty"
67 attrs="{'readonly':[('layout_type','!=','article')]}"
68- on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position)"
69+ on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position, True, {'shop':parent.shop_id})"
70 select="1"/>
71 <field name="product_uom"
72 required="0"
73@@ -38,7 +38,7 @@
74 name="product_packaging"
75 attrs="{'readonly':[('layout_type','!=','article')]}"
76 context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
77- on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position)"
78+ on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position, False, {'shop':parent.shop_id})"
79 domain="[('product_id','=',product_id)]"
80 groups="base.group_extended"/>
81 <separator colspan="4" string="Manual Description" />
82
83=== modified file 'sale_margin/sale_margin.py'
84--- sale_margin/sale_margin.py 2011-07-19 07:23:29 +0000
85+++ sale_margin/sale_margin.py 2011-12-19 10:47:27 +0000
86@@ -25,10 +25,10 @@
87
88 def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
89 uom=False, qty_uos=0, uos=False, name='', partner_id=False,
90- lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False):
91+ lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None):
92 res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=qty,
93 uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id,
94- lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag)
95+ lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context)
96 if product:
97 price = self.pool.get('product.product').browse(cr, uid, product).standard_price
98 partner_pricelist = self.pool.get('res.partner').browse(cr, uid, partner_id).property_product_pricelist