Reputation: 133
I want to migrate the database from one computer to another. I downloaded the backup and transferred all installed modules to this computer. But when I enter the database, I get an error:
raise QWebException("Error to render compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name) odoo.addons.base.models.qweb.QWebException: 'res.users' object has no attribute 'sidebar_type' Traceback (most recent call last): File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\qweb.py", line 346, in compiled_fn return compiled(self, append, new, options, log) File "", line 1, in template_178_234 File "", line 2, in body_call_content_233 AttributeError: 'res.users' object has no attribute 'sidebar_type' Error to render compiling AST AttributeError: 'res.users' object has no attribute 'sidebar_type' Template: 178 Path: /templates/t/t/t[4] Node:< t t-set="body_classname" t-value="'o_web_client mk_sidebar_type' + request.env.user.sidebar_type or 'large'"/> - - -
I looked at this place. This muk_web_theme module:
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="webclient_bootstrap" name="Web Client" inherit_id="web.webclient_bootstrap">
<xpath expr="//t[@t-set='body_classname']" position="after">
<t t-set="body_classname" t-value="'o_web_client mk_sidebar_type_' + request.env.user.sidebar_type or 'large'"/>
</xpath>
<xpath expr="//*[hasclass('o_main')]" position="attributes">
<attribute name="t-attf-class">o_main mk_chatter_position_#{request.env.user.chatter_position or 'normal'}</attribute>
</xpath>
</template>
</odoo>
from odoo import models, fields, api
class ResUsers(models.Model):
_inherit = 'res.users'
#----------------------------------------------------------
# Defaults
#----------------------------------------------------------
@api.model
def _default_sidebar_type(self):
return self.env.user.company_id.default_sidebar_preference or 'small'
@api.model
def _default_chatter_position(self):
return self.env.user.company_id.default_chatter_preference or 'sided'
#----------------------------------------------------------
# Database
#----------------------------------------------------------
sidebar_type = fields.Selection(
selection=[
('invisible', 'Invisible'),
('small', 'Small'),
('large', 'Large')
],
required=True,
string="Sidebar Type",
default=lambda self: self._default_sidebar_type())
chatter_position = fields.Selection(
selection=[
('normal', 'Normal'),
('sided', 'Sided'),
],
required=True,
string="Chatter Position",
default=lambda self: self._default_chatter_position())
#----------------------------------------------------------
# Setup
#----------------------------------------------------------
def __init__(self, pool, cr):
init_res = super(ResUsers, self).__init__(pool, cr)
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
type(self).SELF_WRITEABLE_FIELDS.extend(['sidebar_type'])
type(self).SELF_WRITEABLE_FIELDS.extend(['chatter_position'])
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
type(self).SELF_READABLE_FIELDS.extend(['sidebar_type'])
type(self).SELF_READABLE_FIELDS.extend(['chatter_position'])
return init_res
What could be the problem?
Upvotes: 0
Views: 789
Reputation: 1590
Check if modules are visible to odoo. Module versions should stay the same when you are migrating.
Try with empty base and see if there are any errors after initializing your database.
Try to install your modules to empty base.
Upvotes: 1