Contributors mailing list archives
Re: Proposal: split of some website modules in _backend and _frontendby
Camptocamp SA, Simone Orsi
I agree with Pedro and Oscar: you can customize it using "customize_show" or by enabling / disabling views by code like:
<record id="external_module.some_template" model="ir.ui.view">
<field name="active" eval="0" />
and you can document this properly in your module.
If you override std css/js you can replace them with your custom stuff or if you like more control you can load them conditionally with some "t-if" + system parameters.
On Thu, Dec 8, 2016 at 11:53 AM, Pedro M. Baeza (Tecnativa) <firstname.lastname@example.org> wrote:
We make the same, but CSS modifying is the trick, or as said by Óscar, putting customize_show option. JS is still loaded (until v10), but you don't put too much JS in your website views normally, and if so, you can use for your custom views the same JS API as in the standard one.I'm still thinking the same, sorry.Regards.2016-12-08 11:38 GMT+01:00 Leonardo Donelli <email@example.com>:On 7 December 2016 at 18:22, Pedro M. Baeza (Tecnativa) <firstname.lastname@example.org> wrote: > The module you mentioned has no sense to be decoupled, as recently viewed > products are for the website part, not for any backend. My point is that a lot of users, if not most, using the module would completely redefine the UI because e-commerce tend to be heavily customised, so they would like to have the functionality (models, controllers) but not the UI (templates, static js and css). Having completely unused JS, CSS and templates (less so in v10 I guess?) only makes the response time slower (and heavier) For example, we are implementing an e-commerce where we use several modules in this way: we care about the functionality, but want our completely custom UI and qweb/html: * website_sale_recently_viewed_p
roducts (5 templates, 1 js file, 1 css file) * website_sale_cart_preview (11 templates, 2 js files) * website_sale_wishlist (3 templates, 1 js file, 1 css file) For a total of 19 templates, 4 js files, and 2 css files that have to be elaborated, template inheritance applied, js and css bundled and checked at every request, only to be completely discarded and have absolutely no effect in the end. The customize_show option mentioned by Oscar could work at least for the templates part, I have not looked into it, but I assume that if set to False Odoo doesn't load and evaluate the templates?