Before this commit the latest posts snippet implemented the lookup for
its templates and its rendering procedure.
After this commit a new blog posts snippet is introduced which relies on
the dynamic snippet mechanisms.
task-2477207
https://github.com/odoo/odoo/pull/67334
When opening the visitor view, if user is not website designer, there was an
access error as only website editor can read website.page model.
This commit applies the website_designer group to page_ids field to avoid crash.
There are no viable solution to show the visited page in stable without changing
the model definition. Hide the info is then the better solution.
Task ID-2301261
PR odoo/odoo#60549
X-original-commit: 69cc2911b52fd17b37fb71544574f63cf09dd17e
Before this commit the recently viewed products were handled differently
from the dynamic product snippet.
After this commit the dynamic product snippet supports the functionality
of the recently viewed products snippet:
- its template used to show each product
- its filter of displayed products
- its "Add to cart" feature (with the animation)
- its "Forget" feature (only applicable when viewing recently viewed)
Also added "Accessories" and "Recently Sold With" filterings.
Several kinds of filtering can be combined.
- Products can be restricted to a given category
- Pseudo categories for all products or current category can be used
- Products can be restricted to matching names
- Products can be obtained from one of the following:
- Newest
- Latest sold: ordered by descending frequency in last 8 orders
- Latest viewed
- Accessories (of the current product)
- Recently sold with (the current product)
Accessories and recently sold with are only available in product pages.
Also, generic templates have been considered useless and the whole
mechanism allowing them has been removed (this includes the
pre-rendering mechanism for the fields specified in the filter).
task-2453416
https://github.com/odoo/odoo/pull/65554
The core website behavior is the COW (copy on write) which makes it possible to
handle multiple websites on a single database.
When you do a CRUD operation on an `ir.ui.view` in a website context, the ORM
normal behavior is bypass to perform special stuff, such as:
- Write: if the view is generic (no `website_id`), we bifurcate the write on
the specific view (same `key` but with `website_id` set). If that
view doesn't exist, we create it and fork its whole descending
hierarchy. This write behavior is known as COW.
- Create: we ensure that view is created only for the website and no other.
Basically we just add a `website_id` to that view, but it might
also be about setting the correct `inherit_id` by finding the
specific view among multiple views with the same `key`.
- Unlink: if the view is generic, we will unlink that view but also create a
copy of that view for every other websites so they remain
unmodified: this is known as COU (copy on unlink).
All those behavior aims to satisfy to the multi website holy grail:
-- Any modification in a website context should never impact another website --
Because of those uncommon behaviors, it is sometimes hard to understand or
investigate a database, as views might be copied, up to the point where there
is multiple whole view hierarchies.
This commit attempts to create an user interface to easily figure what's going
on in a database at an `ir.ui.view` level.
The mains advantages of that new `ir.ui.view` Qweb view is to:
- easily figure which views are COW'd on which website
- easily detect which views have a real `arch` modification
- easily see that `arch` change
Closes#63040
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: web_editor
All theme specific color palettes have been moved into website.
It allows to access them without having to install theme modules and
this is a preparation for our website configuration screen task.
Lists of palettes have been replaced by maps with palette names as keys.
Those names are composed of the palette's original theme name ('generic'
or 'base' for palettes not specific to a theme) and of an index
(ex: 'anelusia-2'), for compatibility.
To keep compatibility with previous version we also convert old color
palettes number to color palette name, specifically for each theme.
A side effect of this change is that we got rid of all gray palettes
which existed in some themes. Those were not fitting the new possibility
of gray customization in the third panel and were not always really a
good customization of the default grays (they still were there mainly
for historical purposes). Unfortunately, this may have some side effect
for old websites which used those grays but the new gray palettes (left
to the default one) should most of the time come as an improvement of
the old ones, and they are now customizable by the user. In the future,
we may associate a perfectly-chosen default gray palette, fitting the
customization system, for each color palette.
PR: https://github.com/odoo/odoo/pull/67488
task-2451965
closesodoo/odoo#67488
Related: odoo/design-themes#455
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_editor
The purpose of this commit is to control the hue and the saturation of
the gray palette.
task-2362091
closesodoo/odoo#66428
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Previous default website logo of the 'website' module ('YourLogo'
image) looked like a text and not like a proper logo, so it has been
replaced by a more stylised, gray-coloured, version, as a svg.
--
task-2448746
closesodoo/odoo#68075
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit a cookie policy page was created every time the
website settings were saved with the "Cookies Bar" option enabled.
After this commit the policy page is created only if it does not already
exist for the website.
task-2454424
https://github.com/odoo/odoo/pull/67217closesodoo/odoo#67370
X-original-commit: 2f920e0023d29545d2957e5d6ca1619068af893b
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Call _get_filter_meta_data when needed instead to compute it only once and
give it from function to function, it is really trivial to compute and the
api of functions are simple from this way.
Avoid to use h4/h5 taf for styling bug use bootstrap feature for it.
The semantic of <div class='h4'/> vs <h4/> is not the same for SEO
Don't make call_to_action_url required
+ small typo
task-2446024
https://github.com/odoo/odoo/pull/65176
Before this commit the filtering code for the Dynamic Products snippet
was rendering all its values.
After this commit the filtering code for the Dynamic Products snippet
mostly returns the values to be rendered.
Because the list_price still needs to be rendered with the correct
currency, the general rendering mechanism is being informed through the
field meta-data that the escaping was already done.
task-2446024
https://github.com/odoo/odoo/pull/65176
Before this commit the rendering data structure had to be handled both
when rendering a data sample and when rendering actual records.
After this commit the rendering data structure is generated in the same
way in both situations.
task-2446024
https://github.com/odoo/odoo/pull/65176
Before this commit when a dynamic snippet was fully configured but
returned no data, the rendered section remained empty in edit mode.
After this commit when a dynamic snippet is fully configured but has no
data to display, some sample data is generated in edit mode to give a
feel of how the page will look like when data will be available.
task-2446024
https://github.com/odoo/odoo/pull/65176
Before this commit, only whitelisted fields would be updated on cow views
during a module update.
A field would be whitelisted if he had the same value than the original view,
see it as a heuristic to not write on modified fields.
But `inherit_id` is not that simple, even if the cow view has a different value
than its original view, it doesn't mean it was modified by the user, it is just
because of the cow mechanism that assigned a copied view as inherit_id, which
is just a copy ofthe original one.
We can thus consider `inherit_id` as unchanged and whitelist it if the `key` is
the same.
In practice, it means that cow'd views did not receive the `inherit_id` updates
as in commit https://github.com/odoo/odoo/commit/c8577568a1e39f6692889b3e21652fa3b8df06b2#diff-823e5db841dca1798ff1300e243059a4e1c93343598d2be5a1d1dcd1d2d0c273R537
where `portal.my_account_link` had its `inherit_id` changed from
`portal.frontend_layout` to `portal.user_dropdow`, see https://github.com/odoo/upgrade/pull/2059:
Considering a module update changing `inherit_id` of D from A to B, the
following use cases are expected. Without this fix, D' never move:
CASE 1
A A' B A A' B
| | => / \
D D' D D'
CASE 2
A A' B B' A A' B B'
| | => | |
D D' D D'
CASE 3
A B A B
/ \ => / \
D D' D D'
CASE 4
A B B' A B B'
/ \ => | |
D D' D D'
Opw: 2422773
Opw: 2422727
Opw: 2422770
Opw: 2423406
Opw: 2423859
X-original-commit: ff69f11e9c97d63d9319a8094a87af93984aba38
Because of the way Odoo works at its core, we do not know before hand
which files will be loaded as an asset in the browser, because it
depends on the installed Odoo addons. This is why it is historically
difficult to integrate Odoo with standard JS tooling, and this is why
Odoo needs to use a custom javascript module system.
However, there is a way to use native JS modules (and gain all the
benefits from it: IDE autocompletion, ease of refactoring, intellisense,
...): we can write JS as native JS modules, but convert them at runtime
into Odoo custom modules. This is exactly the strategy applied by this
PR.
This has a lot of benefits, but there is a downside: we can no longer
serve statically JS files in debug=assets. This would be a dealbreaker,
if we did not have sourcemaps (implemented in the next commit).
This commit introduces the python code that will transpile native JS
modules into odoo JS modules.
Task ID: 2414902
PR: 63177
Co-authored-by: Francois (fge) <fge@odoo.com>
Previously, since the group name was wrong, nobody can access this.
Now we let group_website_publisher read it...
Change is not critical, since previous typo make it unreadable for
all.
closesodoo/odoo#66061
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, a 308 on a route with a modelconverter for a model
that have a seo_name field will crash with an exception:
Cannot iterate on RequestUID
Another simplest solution was to use a with_user(SUPERUSER_ID) but in this case
it bypass the security set and display the name of the record even if not yet
published.
How to reproduce:
Create a 308 from /shop/<product> to /mag/<product>
Unpublish product 10
Try to access /shop/product-10
You have an unmanaged '500 internal error"
because slug_matching -> build -> to_url -> slug with a record with Requestuid
as env._uid.
X-original-commit: 4ac2cab96655a3c5e673b0a04be5599dba507850
Before this commit, routes were prevented to be accessed if the route model was
not accessible from the current website, eg you couldn't access blog1 which is
set to website2 from website 1.
That would raise a 404 even from admin/editor.
This commit introduce that behavior at a lowel level in a generic way, instead
of having to write it on every route.
Note that routes without a model converter won't benefit from this.
Closes#63499closesodoo/odoo#64313
Related: odoo/enterprise#15688
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Issue
- Install "Ecommerce" app
- Go to 'Shop' page and edit it
- Add a "Dynamic Products" block
- Click on it to edit it :
- Select any template
- Select `Desks` as product category
- Save
- Go to "Website -> Configuration -> eCommerce Categories"
- Delete the "Desks" category
- Go back to Shop page
Error : "Record does not exist or has been deleted".
Cause
The search domain is looking for child categories of dataset.productCategoryId
(who does not exist anymore in the above case).
`child_of` do a browse() to fetch the records, and therefore generate
an error if category not found.
Solution
Log warning message if unexptected domain and return empty records set instead.
This commit also reverts commit 0de069b8ca9fb005ba5b076984f5677de25889ee that generated the issue.
opw-2440917
closesodoo/odoo#64947
X-original-commit: e452d30f739db39a088248a3109c8c49cff9d49f
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Steps:
- As admin, go to "Contact us" or any other page on the website (1)
- Go to Pages > Page Properties > Publish
- Change the visibility to Signed In
- Save
- As demo, go to (1)
Bug:
The user "demo" is signed in but is returned a 403 Forbidden
Explanation:
When landing on a page with visibility: 'connected', the only way to see
the page is to have a group matching the groups of the page as seen
here: https://github.com/odoo/odoo/blob/28b748a559e1ffb5fb7c3631bf77adba121b2ebf/odoo/addons/base/models/ir_ui_view.py#L625-L626
This fix lets any connected users see the page.
opw:2431700
closesodoo/odoo#64720
X-original-commit: b02a99bec709b5a6dc4dabb6cb81435dadc24e7e
Signed-off-by: backspac <backspac@users.noreply.github.com>
SOC for ir.ui.view creation. If a view is created without a website_id,
it should get one if one is present in the context. Also check that
an explicit website_id in create values matches the one in the context.
Note: it was already the case but kinda by chance and not entirely
correct. Most of the time, the 'arch' field was specified as a creation
value... and as it is a computed field with an inverse method, a COW
was triggered. But this had also the inconvenient of creating an extra
generic view without any arch.
closesodoo/odoo#43245
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In the context of bug #43365, the fix merged in #48031 introduced an
override of `ir.translation._load_module_terms()`, which calls `super()`
then does some extra stuff.
This was forward-ported to later versions, unfortunately the
forward-ports missed the fact that the method signature changed at some
point (circa saas-13.2) and the `overwrite` flag which used to be passed
in the `context` had become an explicit method argument.
As a result, that argument is lost in the `super()` call and the
`website` module entirely disables the "overwrite" mode for the
translation loading wizard.
The fwd-port that seems to introduce the issue is odoo/odoo#50477 (998987f8ee148235f4025eb97a424e838ac6fc9f)
closesodoo/odoo#64251
X-original-commit: 26355a6bf83a194c2e398e859e49920da1f415b8
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
*: web_editor, website
In stable versions, [1] was made as a fix to allow access to read
the colorpicker template for mass mailing users when they do not have
the read access right on ir.ui.view records.
This commit, for master, remove the need of using the confusing
read_template method by using render_public_asset instead (thus turning
the read into a render, which is the same for our colorpicker but might
be a change for potential custo). At the same time, this allows to
remove the read_template public method entirely.
Related to task-2412544
[1]: 8af75e00bdcda3d5ff4facd2f5f146e1d6bf79e4
closesodoo/odoo#64100
Related: odoo/enterprise#15580
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Themes define records which are used as templates for the creation of
base model records on theme installation on a website.
E.g. a "theme.ir.attachment" record's purpose is to be a template for an
"ir.attachment" record creation on theme installation on a website.
Those final records have extra fields to indicate from which theme
template they come from. If those records are ever to be duplicated,
they should not duplicate those links to the theme templates otherwise
it may cause issues when uninstalling/updating a theme (you want the
records linked to the theme to be deleted/updated but not the duplicated
ones, which do not act differently from user created ones).
Duplicate ones will be linked to the website anyway (just like "normal"
user created ones) and should only be automatically removed if that
website is deleted.
The issue is more visible from 14.0 where applying some modifications to
images via the editor (crop / filter / optimization / ...) will
duplicate the original image before modifying it.
closesodoo/odoo#63951
X-original-commit: 890935bbdf924b06b7dabd89802f6dd824159a4b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Because there is a trailing comma, the code crashes and the domain becomes a
tuple.
Cherry-pick of 82df14554e0e8
closesodoo/odoo#62409
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
PURPOSE
Make various changes to the website.visitor views to improve readability and
ease marketing analysis.
SPECS
The changes include notably:
- Add/rename/move fields/filters elements
- Remove some unnecessary information or put it in optional="hide" in tree view
- Add website_id information (with the multi-website group)
- Slightly rework layouts (new widgets / spacing / images / buttons / ...)
- Move some technical information into the "debug mode"
LINKS
Task 2092302
ENT PR odoo/enterprise#14611
UPG PR odoo/upgrade#1902closesodoo/odoo#61417
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit the navigation toolbar was accessible after selecting
a theme before the editor was opened, which on slow connections made it
possible for users to leave the screen and miss the tour
After this commit the loader animation of the theme installation is
blocking the access to the screen until the editor is opened thus
preventing user to navigate elsewhere before seeing the tour
task-2387608
closesodoo/odoo#62029
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Steps to reproduce the bug:
- Delete the current website
- Go to homepage
Bug:
An error 500 was displayrd
opw:2381929
closesodoo/odoo#61959
X-original-commit: ae6515a5fb849a4b561b87eaa5c78035771a17b8
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Homepage tour starts with a very generic step 'drop snippet'
So, you can be in the middle of another tour and see the step of homepage tour.
This doesn't fix all cases, but make conflict less frequent.
E.g.
go to step 4 of tour event
click on save (before doing the step 5)
click on edit
Element is no more dirty (because save before step 5) so the step 5 not visible,
Tour with higher sequence (== lower priority) become visible. (e.g.: homepage)
Forward-Port of bca6cf2693d38c76b1af08398a3125bb16b59c15
closesodoo/odoo#61157
Related: odoo/design-themes#416
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Each time the function is called, we append to the same persistent object.
closesodoo/odoo#60808
X-original-commit: d8790cce3e4a23d2b6b1c32d48d5df14fbdcfd33
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit adapts the business code in which
class/module/function/method redefinition took place so that it no
longer happens and the pylint test passes.
Made the website_id non mandatory on website snippet filters and adapted
the fetching route so that it interprets an unspecified website_id as
the filter being available on any website.
Before this commit website snippet filters had to be limited to one
single website.
After this commit website snippet filters can be made available on all
websites by setting their website_id to no value (this is the new
default of the pre-defined filters).
https://github.com/odoo/odoo/pull/59831
task-2355369
closesodoo/odoo#59831
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Issue
To do on Community:
- Install website_sale (eCommerce)
- Go into Website app
- Navigate through Product/Products
- Edit 'Customizable Desk (CONFIG)' and add '&' and/or '<' and/or '>'
characters into the name
- Save
- Go to the Website app Dashboard and click on 'Go to Website'
- Click on 'Edit' button
- Drag and drop the 'Dynamic Product' snippet into the website
- Click on the block 'Your Dynamic Snippet wil be ...'
- In the right panel, in the 'Dynamic Product' snippet options,
chose a 'Template' and a 'Product Category'
A traceback is shown
Cause
the '&' character crashes lxml.etree.fromstring
Solution
ensure no '&' is sent to lxmx.etree.fromstring by using
odoo.tools.html_escape (in order to ensure no other problematic
characters are sent to the front) on the field values except when
not applicable (widget rendering with record_to_html should not be
escaped).
It is important to note here that this is applicable
to action servers that are used by the dynamic filter.
opw-2357027
closesodoo/odoo#59805
X-original-commit: f91422115c09be484f2868347566b6392ed0effd
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Since tz is now (from 6eb4762fee) added to the client cookie,
visitor timezone can directly be set when creating the visitor, using the
request.
Jstz can be removed as even for module in ENT that used this lib,
we can get the timezone using Intl lib instead.
This will also reduce the number of request made only to get visitor's
timezone.
This commit reverts part of 17e8402523
Linked ENT PR: 12963
Task ID: 2333825
closesodoo/odoo#59501
X-original-commit: 3d9a2de3575777c87327691319d89f9de6b8eada
Related: odoo/enterprise#13918
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Since 3d65424708d, if the homepage does not exists (no page with '/' as URL,
no page set as homepage), it would loop between / controller and _serve_page.
task-2250381
closesodoo/odoo#59548
X-original-commit: 07b701c581bd960bed42fcf97fae0dfed0332656
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
And other reported English mistakes in source string
Courtesy of Transifex translators
And remove leftover from gengo
closesodoo/odoo#59022
X-original-commit: 26efc84c5cac47a2cc83d7b084f8b71528fec6c7
Related: odoo/enterprise#13781
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
After this commit, if an url with trailing slash is not found we fallback
to the url without the slash with a redirect to respect seo.
With this change we have the same behavior that controllers.
We continue to support trailing slash if page explicitely created with /
via backend e.g. and for retrocompatibility.
task-2346185
closesodoo/odoo#58603
X-original-commit: 3d65424708d1623654756d58d78cec5f8d71276f
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
* Prior to this commit, images were only managed when being an image
field. No widget were used either.
* After this commit, image stored in model as url (as res.country.image_url)
can be used when specifying ':image' after the field name. The fields are
now rendered using their corresponding default widget. If there is a need
to force another widget and if the developer is sure that it is compatible,
he/she can specify it using the notation: 'field_name:widget_name'.
closesodoo/odoo#57645
X-original-commit: 18d4e3327c7152b4c3a86ba377e3357f213b703c
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit redirect the user to the website in the edit mode once a theme has
been selected.
task-2172208
X-original-commit: f474eac4543712ae5b1c7d614f9eff9367445107
1) Avoid the storage of all country flags as ir_attachment (230+
ir_attachment in a new db) to reduce the filestore of databases.
The country flags are nearly static and not expected to be modified on
Odoo instances.
This change is based on the new "image_url" widget logic (see previous commits).
2) Extend the flag coverage for countries
Add the missing country flags & specify a mapping to provide flags
for overseas administrated countries/territories.
PURPOSE
Clean code. Be more performance oriented.
SPECIFICATIONS
Improvements applied in this commit
* not all() --> any(not) for earlier returns;
* all([generator]) --> all(generator) to avoid unnecessary list casting.
This code construct is better managed by all;
This commit will probably not have a big performance effect on standard
production databases. However each performance and cleaning improvement
is welcomed.
LINKS
Task ID-2328619
closesodoo/odoo#56810
X-original-commit: 1cc6bb1231401ea7f501d2f5b5e9641ec8734850
Related: odoo/enterprise#12802
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
To avoid to manually invalid the lru cache and probably miss some place
(assets, website menu, qweb view, website, company, ...) we use the classic
cache.
Courtesy of @rco-odoo for the help and review
closesodoo/odoo#56744
X-original-commit: 98e12901c97a67dc87f21647473754cd6f384d4a
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: website_sale, website_sale_wishlist
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: 77d82cfbddb64cc7302672c7741eb65c9fc4a125