Skip to Content
Menu
This question has been flagged
1 Reply
4785 Views

Hi Everyone

I'm new to Odoo, currently running a custom module on odoo 11 that works perfectly in Community edition but when uploaded to the Enterprise edition, it doesn't work for some reason.

I've also notice that some manifest metadata is empty from the module view page, metadata like the Dependencies, and Category even though the module is install successfully.

Module has one Model that add attributes to HTML head script tags using lxml

Any form of assistance is highly appreciated

__manifest__.py
{
'name': "Script Mod",
'summary':'Script attributes',
'description': 'Add attributes to script tags',
'website':'',
'author': 'jhon-117',
'category': 'Website',
'version': '11.0.1.0.0',
'depends': ['base', 'website'],
'data': [],
'installable': True
}
models/scriptmodel.py
from odoo import api, models
import lxml


class Scriptmodel(models.Model):
_inherit = 'ir.ui.view'

@api.model
def render_template(self, template, values=None, engine='ir.qweb'):
res = super(ScriptModel, self).render_template(template, values, engine)
website_id = self.env.context.get('website_id')
if website_id and not self.env['website'].browse(website_id).is_publisher():
html = lxml.html.fromstring(res.decode('UTF-8'))
head = html.find('.//head')
scripts = html.xpath('//head//script[@src]')

for script in scripts:
src = script.attrib['src']
script.attrib['async'] = 'async'

res = lxml.etree.tostring(html, method='html', encoding='UTF-8')
return res
Avatar
Discard
Best Answer

Hi,

There is no difference in module development in Odoo enterprise and in community. Here in your case, you are not seeing the details about the developed modules in the apps page might be due to debug mode is not activated. You will see same for all other modules like this itself. The Module details will be shown only if the debug mode is activated.

So while checking in the enterprise database, you might not activated the debug/developer mode.

1. How to activate the developer mode: https://www.youtube.com/watch?v=sRc4xYPza7g

Thanks

Avatar
Discard
Related Posts Replies Views Activity
1
Jul 22
1575
1
Oct 15
3202
3
Mar 24
1912
1
Jul 23
518
1
Sep 22
1370