[IMP] Performance improvement: improved cache with context, better get_object
bzr revid: fp@tinyerp.com-20131130154659-uqis34x2cemmocly
This commit is contained in:
parent
56eb2c0607
commit
ed7623fc45
|
@ -260,10 +260,9 @@ class res_users(osv.Model):
|
||||||
# send email to users with their signup url
|
# send email to users with their signup url
|
||||||
template = False
|
template = False
|
||||||
if context.get('create_user'):
|
if context.get('create_user'):
|
||||||
try:
|
|
||||||
template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'set_password_email')
|
template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'set_password_email')
|
||||||
except ValueError:
|
if not template.exists():
|
||||||
pass
|
template = False
|
||||||
if not bool(template):
|
if not bool(template):
|
||||||
template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'reset_password_email')
|
template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'reset_password_email')
|
||||||
assert template._name == 'email.template'
|
assert template._name == 'email.template'
|
||||||
|
|
|
@ -55,7 +55,7 @@ class res_partner(osv.osv, EDIMixin):
|
||||||
res_partner_bank_type = self.pool.get('res.partner.bank.type')
|
res_partner_bank_type = self.pool.get('res.partner.bank.type')
|
||||||
try:
|
try:
|
||||||
return self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'bank_normal', context=context).code
|
return self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'bank_normal', context=context).code
|
||||||
except ValueError:
|
except:
|
||||||
pass
|
pass
|
||||||
# second option: create a new custom type for EDI or use it if already created, as IBAN type is
|
# second option: create a new custom type for EDI or use it if already created, as IBAN type is
|
||||||
# not always appropriate: we need a free-form bank type for max flexibility (users can correct
|
# not always appropriate: we need a free-form bank type for max flexibility (users can correct
|
||||||
|
|
|
@ -461,9 +461,8 @@ class mail_thread(osv.AbstractModel):
|
||||||
|
|
||||||
posted = False
|
posted = False
|
||||||
for subtype in subtypes:
|
for subtype in subtypes:
|
||||||
try:
|
|
||||||
subtype_rec = self.pool.get('ir.model.data').get_object(cr, uid, subtype.split('.')[0], subtype.split('.')[1], context=context)
|
subtype_rec = self.pool.get('ir.model.data').get_object(cr, uid, subtype.split('.')[0], subtype.split('.')[1], context=context)
|
||||||
except ValueError, e:
|
if not subtype_rec.exists():
|
||||||
_logger.debug('subtype %s not found, giving error "%s"' % (subtype, e))
|
_logger.debug('subtype %s not found, giving error "%s"' % (subtype, e))
|
||||||
continue
|
continue
|
||||||
message = format_message(subtype_rec.description if subtype_rec.description else subtype_rec.name, tracked_values)
|
message = format_message(subtype_rec.description if subtype_rec.description else subtype_rec.name, tracked_values)
|
||||||
|
|
|
@ -94,13 +94,11 @@ class publisher_warranty_contract(osv.osv):
|
||||||
# old behavior based on res.log; now on mail.message, that is not necessarily installed
|
# old behavior based on res.log; now on mail.message, that is not necessarily installed
|
||||||
IMD = self.pool['ir.model.data']
|
IMD = self.pool['ir.model.data']
|
||||||
user = self.pool['res.users'].browse(cr, SUPERUSER_ID, SUPERUSER_ID)
|
user = self.pool['res.users'].browse(cr, SUPERUSER_ID, SUPERUSER_ID)
|
||||||
try:
|
|
||||||
poster = IMD.get_object(cr, SUPERUSER_ID, 'mail', 'group_all_employees')
|
poster = IMD.get_object(cr, SUPERUSER_ID, 'mail', 'group_all_employees')
|
||||||
except ValueError:
|
|
||||||
# Cannot found group, post the message on the wall of the admin
|
|
||||||
poster = user
|
|
||||||
if not poster.exists():
|
if not poster.exists():
|
||||||
|
if not user.exists():
|
||||||
return True
|
return True
|
||||||
|
poster = user
|
||||||
for message in result["messages"]:
|
for message in result["messages"]:
|
||||||
try:
|
try:
|
||||||
poster.message_post(body=message, subtype='mt_comment', partner_ids=[user.partner_id.id])
|
poster.message_post(body=message, subtype='mt_comment', partner_ids=[user.partner_id.id])
|
||||||
|
|
|
@ -87,12 +87,9 @@ Example: 10% for retailers, promotion of 5 EUR on this product, etc."""),
|
||||||
user = self.pool.get('res.users').browse(cr, uid, uid, context)
|
user = self.pool.get('res.users').browse(cr, uid, uid, context)
|
||||||
res['time_unit'] = user.company_id.project_time_mode_id.id
|
res['time_unit'] = user.company_id.project_time_mode_id.id
|
||||||
else:
|
else:
|
||||||
try:
|
|
||||||
product = ir_model_data.get_object(cr, uid, 'product', 'product_product_consultant')
|
product = ir_model_data.get_object(cr, uid, 'product', 'product_product_consultant')
|
||||||
|
if product.exists():
|
||||||
res['time_unit'] = product.uom_id.id
|
res['time_unit'] = product.uom_id.id
|
||||||
except ValueError:
|
|
||||||
# keep default value in that case
|
|
||||||
_logger.warning("Product with xml_id 'product.product_product_consultant' not found")
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _get_default_time_unit(self, cr, uid, context=None):
|
def _get_default_time_unit(self, cr, uid, context=None):
|
||||||
|
@ -108,10 +105,10 @@ Example: 10% for retailers, promotion of 5 EUR on this product, etc."""),
|
||||||
wizard = self.browse(cr, uid, ids)[0]
|
wizard = self.browse(cr, uid, ids)[0]
|
||||||
|
|
||||||
if wizard.time_unit:
|
if wizard.time_unit:
|
||||||
try:
|
|
||||||
product = ir_model_data.get_object(cr, uid, 'product', 'product_product_consultant')
|
product = ir_model_data.get_object(cr, uid, 'product', 'product_product_consultant')
|
||||||
|
if product.exists():
|
||||||
product.write({'uom_id': wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id})
|
product.write({'uom_id': wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id})
|
||||||
except ValueError:
|
else:
|
||||||
_logger.warning("Product with xml_id 'product.product_product_consultant' not found, UoMs not updated!")
|
_logger.warning("Product with xml_id 'product.product_product_consultant' not found, UoMs not updated!")
|
||||||
|
|
||||||
if wizard.module_project and wizard.time_unit:
|
if wizard.module_project and wizard.time_unit:
|
||||||
|
|
|
@ -27,8 +27,10 @@ class stock_fill_inventory(osv.osv_memory):
|
||||||
_description = "Import Inventory"
|
_description = "Import Inventory"
|
||||||
|
|
||||||
def _default_location(self, cr, uid, ids, context=None):
|
def _default_location(self, cr, uid, ids, context=None):
|
||||||
try:
|
|
||||||
location = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock')
|
location = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock')
|
||||||
|
if not location.exists():
|
||||||
|
return False
|
||||||
|
try:
|
||||||
location.check_access_rule('read', context=context)
|
location.check_access_rule('read', context=context)
|
||||||
location_id = location.id
|
location_id = location.id
|
||||||
except (ValueError, orm.except_orm), e:
|
except (ValueError, orm.except_orm), e:
|
||||||
|
|
|
@ -25,7 +25,7 @@ class ir_http(orm.AbstractModel):
|
||||||
def _auth_method_public(self):
|
def _auth_method_public(self):
|
||||||
if not request.session.uid:
|
if not request.session.uid:
|
||||||
request.uid = request.registry['website'].get_public_user(
|
request.uid = request.registry['website'].get_public_user(
|
||||||
request.cr, openerp.SUPERUSER_ID, request.context).id
|
request.cr, openerp.SUPERUSER_ID, request.context)
|
||||||
else:
|
else:
|
||||||
request.uid = request.session.uid
|
request.uid = request.session.uid
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,10 @@ def urlplus(url, params):
|
||||||
))
|
))
|
||||||
|
|
||||||
class website(osv.osv):
|
class website(osv.osv):
|
||||||
|
def _get_public_user(self, cr, uid, ids, name='public_user', arg=(), context=None):
|
||||||
|
ref = self.get_public_user(cr, uid, context=context)
|
||||||
|
return dict( map(lambda x: (x, ref), ids) )
|
||||||
|
|
||||||
_name = "website" # Avoid website.website convention for conciseness (for new api). Got a special authorization from xmo and rco
|
_name = "website" # Avoid website.website convention for conciseness (for new api). Got a special authorization from xmo and rco
|
||||||
_description = "Website"
|
_description = "Website"
|
||||||
_columns = {
|
_columns = {
|
||||||
|
@ -82,9 +86,9 @@ class website(osv.osv):
|
||||||
'social_linkedin': fields.char('LinkedIn Account'),
|
'social_linkedin': fields.char('LinkedIn Account'),
|
||||||
'social_youtube': fields.char('Youtube Account'),
|
'social_youtube': fields.char('Youtube Account'),
|
||||||
'social_googleplus': fields.char('Google+ Account'),
|
'social_googleplus': fields.char('Google+ Account'),
|
||||||
|
'public_user': fields.function(_get_public_user, relation='res.users', type='many2one', string='Public User', store=True)
|
||||||
}
|
}
|
||||||
|
|
||||||
public_user = None
|
|
||||||
def new_page(self, cr, uid, name, template='website.default_page', ispage=True, context=None):
|
def new_page(self, cr, uid, name, template='website.default_page', ispage=True, context=None):
|
||||||
context=context or {}
|
context=context or {}
|
||||||
# completely arbitrary max_length
|
# completely arbitrary max_length
|
||||||
|
@ -133,11 +137,8 @@ class website(osv.osv):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_public_user(self, cr, uid, context=None):
|
def get_public_user(self, cr, uid, context=None):
|
||||||
if not self.public_user:
|
|
||||||
uid = openerp.SUPERUSER_ID
|
uid = openerp.SUPERUSER_ID
|
||||||
ref = self.pool['ir.model.data'].get_object_reference(cr, uid, 'website', 'public_user')
|
return self.pool['ir.model.data'].get_object_reference(cr, uid, 'website', 'public_user')[1]
|
||||||
self.public_user = self.pool[ref[0]].browse(cr, uid, ref[1])
|
|
||||||
return self.public_user
|
|
||||||
|
|
||||||
def get_current_website(self, cr, uid, context=None):
|
def get_current_website(self, cr, uid, context=None):
|
||||||
# TODO: Select website, currently hard coded
|
# TODO: Select website, currently hard coded
|
||||||
|
@ -147,7 +148,6 @@ class website(osv.osv):
|
||||||
def redirect(url):
|
def redirect(url):
|
||||||
return werkzeug.utils.redirect(url_for(url))
|
return werkzeug.utils.redirect(url_for(url))
|
||||||
request.redirect = redirect
|
request.redirect = redirect
|
||||||
is_public_user = request.uid == self.get_public_user(cr, uid, context).id
|
|
||||||
|
|
||||||
user = self.pool['res.users'].browse(cr, uid, uid, context=context)
|
user = self.pool['res.users'].browse(cr, uid, uid, context=context)
|
||||||
website_publisher_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'group_website_publisher')[1]
|
website_publisher_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'group_website_publisher')[1]
|
||||||
|
@ -156,10 +156,9 @@ class website(osv.osv):
|
||||||
lang = request.context['lang']
|
lang = request.context['lang']
|
||||||
is_master_lang = lang == request.website.default_lang_id.code
|
is_master_lang = lang == request.website.default_lang_id.code
|
||||||
request.context.update({
|
request.context.update({
|
||||||
'is_public_user': is_public_user,
|
|
||||||
'is_master_lang': is_master_lang,
|
'is_master_lang': is_master_lang,
|
||||||
'editable': is_website_publisher,
|
'editable': is_website_publisher,
|
||||||
'translatable': not is_public_user and not is_master_lang,
|
'translatable': not is_master_lang,
|
||||||
})
|
})
|
||||||
|
|
||||||
def get_template(self, cr, uid, ids, template, context=None):
|
def get_template(self, cr, uid, ids, template, context=None):
|
||||||
|
@ -333,7 +332,7 @@ class website(osv.osv):
|
||||||
"""
|
"""
|
||||||
router = request.httprequest.app.get_db_router(request.db)
|
router = request.httprequest.app.get_db_router(request.db)
|
||||||
# Force enumeration to be performed as public user
|
# Force enumeration to be performed as public user
|
||||||
uid = self.get_public_user(cr, uid, context=context).id
|
uid = self.get_public_user(cr, uid, context=context)[1].id
|
||||||
for rule in router.iter_rules():
|
for rule in router.iter_rules():
|
||||||
if not self.rule_is_enumerable(rule):
|
if not self.rule_is_enumerable(rule):
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -215,10 +215,10 @@
|
||||||
|
|
||||||
<!-- Options: Blog Post: user can reply -->
|
<!-- Options: Blog Post: user can reply -->
|
||||||
<template id="opt_blog_post_complete_comment" name="Allow Comments"
|
<template id="opt_blog_post_complete_comment" name="Allow Comments"
|
||||||
inherit_option_id="website_blog.blog_post_complete" inherit_id="website_blog.blog_post_complete">
|
inherit_option_id="website_blog.blog_post_complete" inherit_id="website_blog.blog_post_complete"
|
||||||
|
groups="website_mail.group_comment">
|
||||||
<xpath expr="//ul[@id='comments-list']" position="after">
|
<xpath expr="//ul[@id='comments-list']" position="after">
|
||||||
<t t-if="not is_public_user">
|
<section class="mb32">
|
||||||
<section groups="group_website_blog_reply" class="mb32">
|
|
||||||
<form id="comment" t-attf-action="/blogpost/#{blog_post.id}/#{ path_filter }/comment"
|
<form id="comment" t-attf-action="/blogpost/#{blog_post.id}/#{ path_filter }/comment"
|
||||||
method="POST">
|
method="POST">
|
||||||
<img class="img pull-left img-rounded" t-att-src="'/website/image?model=res.partner&field=image_small&id='+str(user_id.partner_id.id)" style="width: 50px; margin-right: 10px;"/>
|
<img class="img pull-left img-rounded" t-att-src="'/website/image?model=res.partner&field=image_small&id='+str(user_id.partner_id.id)" style="width: 50px; margin-right: 10px;"/>
|
||||||
|
@ -229,7 +229,6 @@
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
<div class="clearfix"/>
|
<div class="clearfix"/>
|
||||||
</t>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,6 @@ class WebsiteCrmPartnerAssign(http.Controller):
|
||||||
|
|
||||||
# format displayed membership lines domain
|
# format displayed membership lines domain
|
||||||
base_partner_domain = [('is_company', '=', True)]
|
base_partner_domain = [('is_company', '=', True)]
|
||||||
if request.context['is_public_user']:
|
|
||||||
base_partner_domain += [('website_published', '=', True)]
|
|
||||||
partner_domain = list(base_partner_domain)
|
partner_domain = list(base_partner_domain)
|
||||||
if grade_id and grade_id != "all":
|
if grade_id and grade_id != "all":
|
||||||
partner_domain += [('grade_id', '=', int(grade_id))] # try/catch int
|
partner_domain += [('grade_id', '=', int(grade_id))] # try/catch int
|
||||||
|
@ -93,9 +91,6 @@ class WebsiteCrmPartnerAssign(http.Controller):
|
||||||
@website.route(['/partners/<int:partner_id>/'], type='http', auth="public", multilang=True)
|
@website.route(['/partners/<int:partner_id>/'], type='http', auth="public", multilang=True)
|
||||||
def partners_ref(self, partner_id=0, **post):
|
def partners_ref(self, partner_id=0, **post):
|
||||||
partner_obj = request.registry['res.partner']
|
partner_obj = request.registry['res.partner']
|
||||||
if request.context['is_public_user']:
|
|
||||||
partner_ids = partner_obj.search(request.cr, request.uid, [('website_published', '=', True), ('id', '=', partner_id)], context=request.context)
|
|
||||||
else:
|
|
||||||
partner_ids = partner_obj.search(request.cr, request.uid, [('id', '=', partner_id)], context=request.context)
|
partner_ids = partner_obj.search(request.cr, request.uid, [('id', '=', partner_id)], context=request.context)
|
||||||
if not partner_ids:
|
if not partner_ids:
|
||||||
return self.members(post)
|
return self.members(post)
|
||||||
|
|
|
@ -26,11 +26,6 @@ class google_map(http.Controller):
|
||||||
domain_public = domain + [('website_published', '=', True)]
|
domain_public = domain + [('website_published', '=', True)]
|
||||||
partner_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID,
|
partner_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID,
|
||||||
domain_public, context=request.context)
|
domain_public, context=request.context)
|
||||||
if not request.context['is_public_user']:
|
|
||||||
partner_ids += partner_obj.search(request.cr, request.uid, domain,
|
|
||||||
context=request.context)
|
|
||||||
partner_ids = list(set(partner_ids))
|
|
||||||
|
|
||||||
return partner_obj.google_map_json(request.cr, openerp.SUPERUSER_ID,
|
return partner_obj.google_map_json(request.cr, openerp.SUPERUSER_ID,
|
||||||
partner_ids, request.context)
|
partner_ids, request.context)
|
||||||
|
|
||||||
|
@ -42,7 +37,6 @@ class google_map(http.Controller):
|
||||||
latitude = post.get('latitude') and float(post['latitude'])
|
latitude = post.get('latitude') and float(post['latitude'])
|
||||||
longitude = post.get('longitude') and float(post['longitude'])
|
longitude = post.get('longitude') and float(post['longitude'])
|
||||||
|
|
||||||
if not request.context['is_public_user'] and partner_id and (latitude or longitude):
|
|
||||||
values = {
|
values = {
|
||||||
'partner_latitude': latitude,
|
'partner_latitude': latitude,
|
||||||
'partner_longitude': longitude,
|
'partner_longitude': longitude,
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
'depends': ['website', 'mail'],
|
'depends': ['website', 'mail'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/website_mail.xml',
|
'views/website_mail.xml',
|
||||||
|
'security/website_mail.xml',
|
||||||
],
|
],
|
||||||
'css': [
|
'css': [
|
||||||
'static/src/css/website_mail.css',
|
'static/src/css/website_mail.css',
|
||||||
|
|
|
@ -32,7 +32,7 @@ class WebsiteMail(http.Controller):
|
||||||
partner_obj = request.registry['res.partner']
|
partner_obj = request.registry['res.partner']
|
||||||
user_obj = request.registry['res.users']
|
user_obj = request.registry['res.users']
|
||||||
partner_ids = []
|
partner_ids = []
|
||||||
if request.context['is_public_user'] and email and email != u'false': # post contains stringified booleans
|
if email and email != u'false': # post contains stringified booleans
|
||||||
partner_ids = partner_obj.search(request.cr, SUPERUSER_ID, [("email", "=", email)], context=request.context)
|
partner_ids = partner_obj.search(request.cr, SUPERUSER_ID, [("email", "=", email)], context=request.context)
|
||||||
if not partner_ids:
|
if not partner_ids:
|
||||||
partner_ids = [partner_obj.name_create(request.cr, SUPERUSER_ID, email, request.context)]
|
partner_ids = [partner_obj.name_create(request.cr, SUPERUSER_ID, email, request.context)]
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<openerp>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<record id="group_comment" model="res.groups">
|
||||||
|
<field name="name">Website Comments</field>
|
||||||
|
<field name="comment">Allows website visitors to post comments on blogs, etc.</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="base.group_user" model="res.groups">
|
||||||
|
<field name="implied_ids" eval="[(4, ref('website_mail.group_comment'))]"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</openerp>
|
|
@ -31,9 +31,7 @@ class TestControllers(TestMail):
|
||||||
# print request
|
# print request
|
||||||
|
|
||||||
cr, uid = self.cr, self.uid
|
cr, uid = self.cr, self.uid
|
||||||
# context = {
|
# context = { }
|
||||||
# 'is_public_user': True,
|
|
||||||
# }
|
|
||||||
# email = 'Marcel Dupuis <marcel.dupuis@example.com>'
|
# email = 'Marcel Dupuis <marcel.dupuis@example.com>'
|
||||||
# website_mail = WebsiteMail()
|
# website_mail = WebsiteMail()
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<div class="input-group js_follow" t-att-data-id="object.id"
|
<div class="input-group js_follow" t-att-data-id="object.id"
|
||||||
t-att-data-object="object._name"
|
t-att-data-object="object._name"
|
||||||
t-att-data-follow="object.id and object.message_is_follower and 'on' or 'off'">
|
t-att-data-follow="object.id and object.message_is_follower and 'on' or 'off'">
|
||||||
<input t-if="is_public_user"
|
<input
|
||||||
type="email" name="email"
|
type="email" name="email"
|
||||||
class="js_follow_email form-control"
|
class="js_follow_email form-control"
|
||||||
t-att-value="email or ''"
|
t-att-value="email or ''"
|
||||||
|
|
|
@ -312,10 +312,12 @@ class Ecommerce(http.Controller):
|
||||||
fill_hole = product_obj.search(request.cr, request.uid, domain, limit=step, offset=pager['offset']+step, order=self._order, context=request.context)
|
fill_hole = product_obj.search(request.cr, request.uid, domain, limit=step, offset=pager['offset']+step, order=self._order, context=request.context)
|
||||||
|
|
||||||
styles = []
|
styles = []
|
||||||
if not request.context['is_public_user']:
|
try:
|
||||||
style_obj = request.registry.get('website.product.style')
|
style_obj = request.registry.get('website.product.style')
|
||||||
style_ids = style_obj.search(request.cr, request.uid, [], context=request.context)
|
style_ids = style_obj.search(request.cr, request.uid, [], context=request.context)
|
||||||
styles = style_obj.browse(request.cr, request.uid, style_ids, context=request.context)
|
styles = style_obj.browse(request.cr, request.uid, style_ids, context=request.context)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
values = {
|
values = {
|
||||||
'Ecommerce': self,
|
'Ecommerce': self,
|
||||||
|
@ -520,7 +522,7 @@ class Ecommerce(http.Controller):
|
||||||
checkout = values['checkout']
|
checkout = values['checkout']
|
||||||
error = values['error']
|
error = values['error']
|
||||||
|
|
||||||
if not context['is_public_user']:
|
if not request.uid == self.pool.get('website').get_public_user(cr, uid, context):
|
||||||
partner = orm_user.browse(cr, uid, uid, context).partner_id
|
partner = orm_user.browse(cr, uid, uid, context).partner_id
|
||||||
partner_info = info.from_partner(partner)
|
partner_info = info.from_partner(partner)
|
||||||
checkout.update(partner_info)
|
checkout.update(partner_info)
|
||||||
|
@ -596,7 +598,7 @@ class Ecommerce(http.Controller):
|
||||||
billing_info = dict(checkout)
|
billing_info = dict(checkout)
|
||||||
billing_info['parent_id'] = company_id
|
billing_info['parent_id'] = company_id
|
||||||
|
|
||||||
if not context['is_public_user']:
|
if not request.uid == self.pool.get('website').get_public_user(cr, uid, context):
|
||||||
partner_id = orm_user.browse(cr, uid, uid, context=context).partner_id.id
|
partner_id = orm_user.browse(cr, uid, uid, context=context).partner_id.id
|
||||||
orm_parter.write(cr, uid, [partner_id], billing_info, context=context)
|
orm_parter.write(cr, uid, [partner_id], billing_info, context=context)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue