[IMP] sale, sale_stock: remove shop_id concept from sale_condition feature

bzr revid: cha@tinyerp.com-20130225090236-k9im6bebl5k5s0wa
This commit is contained in:
Ajay Chauhan (OpenERP) 2013-02-25 14:32:36 +05:30
parent b183a34341
commit 5c202a8ba2
3 changed files with 6 additions and 13 deletions

View File

@ -64,10 +64,6 @@ 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_id = context.get('partner_id',False)
if partner_id:
sale_note = self.get_salenote(cr, uid, ids, partner_id, shop_id, context=context)
v.update({'note': sale_note})
return {'value': v}
def copy(self, cr, uid, id, default=None, context=None):
@ -315,14 +311,12 @@ class sale_order(osv.osv):
}
return {'warning': warning, 'value': value}
def get_salenote(self, cr, uid, ids, partner_id, shop_id, context=None):
def get_salenote(self, cr, uid, ids, partner_id, context=None):
context_lang = context.copy()
if partner_id:
partner_lang = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context).lang
context_lang.update({'lang': partner_lang})
if shop_id:
return self.pool.get('sale.shop').browse(cr, uid, shop_id, context=context_lang).company_id.sale_note
return self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.sale_note
return self.pool.get('res.users').browse(cr, uid, uid, context=context_lang).company_id.sale_note
def onchange_partner_id(self, cr, uid, ids, part, context=None):
if not part:
@ -347,8 +341,7 @@ class sale_order(osv.osv):
}
if pricelist:
val['pricelist_id'] = pricelist
shop_id = context.get('shop_id',False)
sale_note = self.get_salenote(cr, uid, ids, part.id, shop_id, context=context)
sale_note = self.get_salenote(cr, uid, ids, part.id, context=context)
val.update({'note': sale_note})
return {'value': val}

View File

@ -153,14 +153,14 @@
</h1>
<group>
<group>
<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_id" on_change="onchange_partner_id(partner_id, context)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" 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, context)" context="{'partner_id': partner_id}" widget="selection"/>
<field name="shop_id" groups="base.group_no_one" on_change="onchange_shop_id(shop_id, context)" 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"/>

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, context)" context="{'partner_id': partner_id}" widget="selection" groups="stock.group_locations"/>
<field name="shop_id" on_change="onchange_shop_id(shop_id)" widget="selection" groups="stock.group_locations"/>
</field>
<field name="product_id" position="replace">
<field name="product_id"