[MERGE] forward port of branch 9.0 up to 052da3e
This commit is contained in:
@@ -82,12 +82,14 @@
|
||||
<field name="target">self</field>
|
||||
</record>
|
||||
|
||||
<data noupdate="0">
|
||||
<record id="menu_website" model="ir.ui.menu">
|
||||
<field name="name">Website</field>
|
||||
<field name="sequence" eval="200"/>
|
||||
<field name="web_icon">website,static/description/icon.png</field>
|
||||
<field name="action" ref="action_website"/>
|
||||
</record>
|
||||
</data>
|
||||
<record id="base.open_menu" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_website_tutorial"/>
|
||||
<field name="state">open</field>
|
||||
|
||||
@@ -139,8 +139,8 @@ class website(orm.Model):
|
||||
|
||||
def _get_pricelist_id(self, cr, uid, ids, name, args, context=None):
|
||||
res = {}
|
||||
pricelist = self.get_current_pricelist(cr, uid, context=context)
|
||||
for data in self.browse(cr, uid, ids, context=context):
|
||||
pricelist = self.get_current_pricelist(cr, uid, context=dict(context, website_id=data.id))
|
||||
res[data.id] = pricelist.id
|
||||
return res
|
||||
|
||||
@@ -198,11 +198,18 @@ class website(orm.Model):
|
||||
|
||||
:returns: pricelist recordset
|
||||
"""
|
||||
website = request.website
|
||||
if not request.website:
|
||||
if context.get('website_id'):
|
||||
website_id = context['website_id']
|
||||
else:
|
||||
website_id = self.search(cr, uid, [], context=context)
|
||||
website = self.browse(cr, uid, website_id, context=context)
|
||||
isocountry = request.session.geoip and request.session.geoip.get('country_code') or False
|
||||
pl_ids = self._get_pl(cr, uid, isocountry, show_visible,
|
||||
request.website.user_id.sudo().partner_id.property_product_pricelist.id,
|
||||
website.user_id.sudo().partner_id.property_product_pricelist.id,
|
||||
request.session.get('website_sale_current_pl'),
|
||||
request.website.website_pricelist_ids)
|
||||
website.website_pricelist_ids)
|
||||
return self.pool['product.pricelist'].browse(cr, uid, pl_ids, context=context)
|
||||
|
||||
def is_pricelist_available(self, cr, uid, pl_id, context=None):
|
||||
|
||||
@@ -95,6 +95,7 @@ class lang(osv.osv):
|
||||
format = format.replace(pattern, replacement)
|
||||
return str(format)
|
||||
|
||||
conv = locale.localeconv()
|
||||
lang_info = {
|
||||
'code': lang,
|
||||
'iso_code': iso_lang,
|
||||
@@ -103,8 +104,9 @@ class lang(osv.osv):
|
||||
'translatable': True,
|
||||
'date_format' : fix_datetime_format(locale.nl_langinfo(locale.D_FMT)),
|
||||
'time_format' : fix_datetime_format(locale.nl_langinfo(locale.T_FMT)),
|
||||
'decimal_point' : fix_xa0(str(locale.localeconv()['decimal_point'])),
|
||||
'thousands_sep' : fix_xa0(str(locale.localeconv()['thousands_sep'])),
|
||||
'decimal_point' : fix_xa0(str(conv['decimal_point'])),
|
||||
'thousands_sep' : fix_xa0(str(conv['thousands_sep'])),
|
||||
'grouping' : str(conv.get('grouping', [])),
|
||||
}
|
||||
lang_id = False
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user