diff options
| author | Ajay Chauhan (OpenERP) <cha@tinyerp.com> | 2013-02-15 14:14:28 +0530 |
|---|---|---|
| committer | Ajay Chauhan (OpenERP) <cha@tinyerp.com> | 2013-02-15 14:14:28 +0530 |
| commit | 98e8e12ffc5f659aba5748d7c9092e3c8fcefcff (patch) | |
| tree | 71f9d66485baaa685ef14ebdcbac5ea5b7152ce6 | |
| parent | c207c7c21bf9cb41955660bf7c29cdd8ef26afe6 (diff) | |
[IMP] made changes in code
bzr revid: cha@tinyerp.com-20130215084428-s1sxky78rk0tevak
| -rw-r--r-- | addons/sale/sale.py | 13 | ||||
| -rw-r--r-- | addons/sale/sale_view.xml | 4 | ||||
| -rw-r--r-- | addons/sale_stock/sale_stock_view.xml | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/addons/sale/sale.py b/addons/sale/sale.py index a9c12f7e388..a53d6d1fca6 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -56,7 +56,7 @@ class sale_order(osv.osv): }, } - def onchange_shop_id(self, cr, uid, ids, shop_id, partner_id, context=None): + def onchange_shop_id(self, cr, uid, ids, shop_id, context=None): v = {} if shop_id: shop = self.pool.get('sale.shop').browse(cr, uid, shop_id, context=context) @@ -64,9 +64,10 @@ class sale_order(osv.osv): v['project_id'] = shop.project_id.id if shop.pricelist_id.id: v['pricelist_id'] = shop.pricelist_id.id - partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) - sale_note = self.get_sale_note(cr, uid, ids, partner, shop_id, context=context) - v.update({'note': sale_note}) + if context['partner_id']: + partner = self.pool.get('res.partner').browse(cr, uid, context['partner_id'], context=context) + sale_note = self.get_sale_note(cr, uid, ids, partner, shop_id, context=context) + v.update({'note': sale_note}) return {'value': v} def copy(self, cr, uid, id, default=None, context=None): @@ -320,7 +321,7 @@ class sale_order(osv.osv): sale_note = self.pool.get('sale.shop').browse(cr, uid, shop_id, context=context_lang).company_id.sale_note return sale_note - def onchange_partner_id(self, cr, uid, ids, part, shop_id, context=None): + def onchange_partner_id(self, cr, uid, ids, part, context=None): if not part: return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'payment_term': False, 'fiscal_position': False}} @@ -343,7 +344,7 @@ class sale_order(osv.osv): } if pricelist: val['pricelist_id'] = pricelist - sale_note = self.get_sale_note(cr, uid, ids, part, shop_id, context=context) + sale_note = self.get_sale_note(cr, uid, ids, part, context['shop_id'], context=context) val.update({'note': sale_note}) return {'value': val} diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 1a88584c0e2..57f4c0016af 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -153,14 +153,14 @@ </h1> <group> <group> - <field name="partner_id" on_change="onchange_partner_id(partner_id, shop_id, context)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/> + <field name="partner_id" on_change="onchange_partner_id(partner_id, context)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1, 'shop_id': shop_id}" options='{"always_reload": True}'/> <field name="partner_invoice_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'invoice'}"/> <field name="partner_shipping_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}"/> <field name="project_id" context="{'partner_id':partner_id, 'pricelist_id':pricelist_id, 'default_name':name, 'default_type': 'contract'}" groups="sale.group_analytic_accounting" domain="[('type','in',['view','normal','contract'])]"/> </group> <group> <field name="date_order"/> - <field name="shop_id" groups="base.group_no_one" on_change="onchange_shop_id(shop_id, partner_id, context)" widget="selection"/> + <field name="shop_id" groups="base.group_no_one" on_change="onchange_shop_id(shop_id, context)" context="{'partner_id': partner_id}" widget="selection"/> <field name="client_order_ref"/> <field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist" on_change="onchange_pricelist_id(pricelist_id,order_line)"/> <field name="currency_id" invisible="1"/> diff --git a/addons/sale_stock/sale_stock_view.xml b/addons/sale_stock/sale_stock_view.xml index b4bcf67281c..4a7da0f3d53 100644 --- a/addons/sale_stock/sale_stock_view.xml +++ b/addons/sale_stock/sale_stock_view.xml @@ -49,7 +49,7 @@ <field name="state" widget="statusbar" statusbar_visible="draft,sent,progress,invoiced,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/> </field> <field name="shop_id" position="replace"> - <field name="shop_id" on_change="onchange_shop_id(shop_id, partner_id, context)" widget="selection" groups="stock.group_locations"/> + <field name="shop_id" on_change="onchange_shop_id(shop_id, context)" context="{'partner_id': partner_id}" widget="selection" groups="stock.group_locations"/> </field> <field name="product_id" position="replace"> <field name="product_id" |
