[IMP] made changes in code

bzr revid: cha@tinyerp.com-20130215084428-s1sxky78rk0tevak
This commit is contained in:
Ajay Chauhan (OpenERP)
2013-02-15 14:14:28 +05:30
parent c207c7c21b
commit 98e8e12ffc
3 changed files with 10 additions and 9 deletions
+7 -6
View File
@@ -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}
+2 -2
View File
@@ -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"/>
+1 -1
View File
@@ -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"