Commit Graph
144062 Commits
Author SHA1 Message Date
Aaron Bohy ff6e89052d [REF] web,*: regroup custom hooks in core/utils/hooks
*base_automation,iap,im_livechat,point_of_sale

This commit introduces a new file in core/utils: hooks.js
This file contains custom hooks (useEffect, useService, useBus...).

The useHotkey hook is tightly related to hotkeys, so it has been
moved to core/hotkeys.

closes odoo/odoo#74535

Related: odoo/enterprise#20003
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-02 11:13:52 +00:00
Samuel Degueldre 5ffdd92034 [FIX] web: make polling restart correctly when server is killed
Previously, when killing the server, the longpolling bus stopped but
didn't start polling again after a few seconds, this was caused by the
fact that ConnectionLostError wasn't treated like a legacy error and
remapped to an object with a message, meaning it didn't trigger
guardedCatch callbacks.

Since ConnectionLostErrors should be handled much the same way as
RPCError when interacting with legacy code this commit simply adds
ConnectionLostError in the same places we already have RPCError during
error handling of legacy errors, but delegates behaviour to the new
lostConnectionHandler when appropriate.

closes odoo/odoo#74530

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-02 11:45:55 +00:00
OdooJeel 810db9794c [CLA] signature for jeelkhanpara
closes odoo/odoo#74531

X-original-commit: bd2d72c0a82d51652fa4b43447ade305843a4ef8
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-08-02 07:53:17 +00:00
Swapnesh Shah d7b9363361 [IMP] purchase: allow to change price if not invoiced
Steps to reproduce:

- Create Bill from Purchase order
- Raise Refund for the Same Bill

Current Behavior before commit:

Field Unit Price is readonly in PO line as invoice is already created.

Expected behavior:

Price should be editable as Qty Invoiced is Zero after Refund.

With this commit, Price unit will be readonly based on `qty_invoiced`

closes odoo/odoo#74526

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-07-31 12:54:20 +00:00
Andrea Grazioso (agr-odoo) 410efa6012 [FIX] product_email_template: avoid traceback when referring to "object"
1. Activate 'Deliver Content by Email' in the Sales>Configuration>Settings
2. Create a mail template with Product Template for 'Applies to' and
a dynamic field (e.g. ${object.company_id.name}) in the body
3. Add this mail template on a [DEMO] product 'Automatic Email at
Invoice' field, in the Sales tab
4. Create an invoice with [DEMO], confirm it.
5. If the ID of the invoice does not exist as a product.product, you get a
traceback

The reason is that the model used for the template rendering is the
one specified on the template, but the res_id given to the composer
is the one from the invoice.

opw-2476169

closes odoo/odoo#74519

X-original-commit: 67bdd9cada7b06bc73d7bebedb7f10547e425055
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-07-30 18:30:32 +00:00
desdelinux b201ac6649 [IMP] l10n_pe: New identification types requested by the SUNAT
By Sunat regulations from 08/01/2021 two new types of identity documents
will be accepted: Temporary Residence Permit and Safe Passage.

Legal ref:

Website: https://cpe.sunat.gob.pe/node/88
Document with Catalog Update No. 8:
https://cpe.sunat.gob.pe/sites/default/files/inline-files/AjustesValidacionesCPEv20210727%20%28ultimo%29.xlsx

Replaces #74342

closes odoo/odoo#74506

X-original-commit: d7a701910520c22d963e21e3a9cc6d4122ead003
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-07-30 14:15:43 +00:00
Antoine Vandevenne (anv) e9ee1d2cb4 [REM] payment_ogone: remove unused Flexcheckout views
Commit 3d90d02 removed the integration with the Flexcheckout API but the
dedicated views were left behind, as it was not possible to remove them
in stable version.

This commit removes the unused views in master.

task-2494916

closes odoo/odoo#74505

Related: odoo/upgrade#2699
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-07-30 14:11:54 +00:00
Laurent Smet 17b42902ae [IMP] account: Remove 'Take money in/out' button
closes odoo/odoo#73708

Task: 2596069
Signed-off-by: William André (wan) <wan@odoo.com>
2021-07-14 12:13:13 +00:00
Ahmad Khan 71f0779d75 [CLA] signature for aims-khan
closes odoo/odoo#74470

X-original-commit: d3508a9ec22f8775e0f1df36455526df0e3b9350
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-29 18:18:03 +00:00
odoomates ba27bb3a3f [CLA] Odoo Mates
closes odoo/odoo#74464

X-original-commit: 2c969004e57a7321315d4bfda8dbcf90c76b6d29
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-29 17:29:50 +00:00
Dishon Kadoh d5d38a149f [CLA] Dishon Kadoh
closes odoo/odoo#74463

X-original-commit: 84e2ec4011ca7d277404d862e2d547df09bbe474
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-29 17:28:16 +00:00
Lucas Perais (lpe) 70353a2063 [REF] web: action_service: dialog is null when absent
Before this commit, the current dialog (in the action service's state) was either an empty object
when there was no dialog, and a filled object when the dialog was present.

After this commit, when there is no dialog, the dialog state is null.

closes odoo/odoo#74442

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-08-02 07:58:09 +00:00
Lucas Perais (lpe) 83eb9f9ebd [FIX] web: action_service: onClose callback can execute history-back
Have an action in the breadcrumb (A)

Do an action (B) that has a button which spawns a dialog with a onClose callback executing an`history-back` event.
This may be useful when the action (B) acts as a selection buffer between (A) and the dialog.
(e.g. stock_barcode: execute `stock_barcode_client_action` from a picking)

Before this commit, the history-back event just closed the dialog without going back to the action (A)
This was because the wrong condition was used to determine if the dialog was still alive or not.

After this commit, the action (A) is displayed when closing the dialog from any point.
2021-08-02 07:55:52 +00:00
Habib (ayh) b0de4f7cef [IMP] account: make account move chatter log more odoo standard
Remove the custom messages and replace with the default odoo tracking message that uses tracking_value_ids as parameters
Journal Items will log all changes of tracked fields in the chatter of the associated Entry - including one2many and many2many fields (by overriding _mail_track)

references original task 2061399
closes task 2469621

closes odoo/odoo#72023

Signed-off-by: William André (wan) <wan@odoo.com>
2021-07-27 16:45:09 +00:00
Benjamin Vray 00025dd406 [FIX] web, web_editor: disable horizontal scroll when dragging snippet
This commit adds an option to disable horizontal scrolling in the
smoothScrollOnDrag feature options and use it when dragging and
dropping a snippet into the editor to prevent the wrapwrap from
scrolling horizontally when an element overflow the page (e.g. an
animated element).

task-2215118

closes odoo/odoo#74518

X-original-commit: fdbc109780f336c4b7dcac31585beaad682e029a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-30 18:18:35 +00:00
Benjamin Vray da22414233 [FIX] website, *: prevent bottom fixed elements from hiding buttons
*: web, website_livechat, website_sale_comparison

Before this commit, bottom fixed elements (e.g. the livechat button)
hid the buttons to go to the next step in website sale when these
buttons are located at the bottom of the page, on some screen sizes.

After this commit,

- A bottom fixed element is hidden if this element hides a button at
the bottom of the page.

- Bottom fixed elements are hidden if a modal is open
to prevent it to hide buttons or any important part of the modal.

task-2501400

closes odoo/odoo#74515

X-original-commit: a851db9495fe9d8c1951f218a71e4d4a427cf96d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-30 17:24:48 +00:00
Odoo's Mergebot 0d9e21dfe7 [IMP] website: configurator organizes links in menu and footer
The configurator takes care of the organization of the links to the different
pages. Some links are put in the menu and some are put in the footer. The order
is predefined. If too many links are present in the menu then a sub-menu 'Company'
is created and some links are put in it. For the 'News' and 'Succes Stories' features
a website specific blog is created.

Links have the following order in the menu and are present only if their corresponding
website.configurator.feature has been selected in the configurator excepted for the 'Home'
and 'Contact us' links which are default links:
- 'Home'
- 'Shop'
- 'Event'
- 'Courses'
- 'Services'
- 'Pricing'
- 'Company': if more than 8 links in menu and more than 1 item in this submenu
             otherwise the three following links are in the top menu.
  - 'News'
  - 'Success Stories'
  - 'About us'
- 'Appointment'
- 'Contact us'

Links in footer:
- 'Privacy Policy'
- 'Help': if website_helpdesk installed. This is not a website.configurator.feature.
- 'Forum'

Community: https://github.com/odoo/odoo/pull/71993
Enterprise: https://github.com/odoo/enterprise/pull/18930
Upgrade: https://github.com/odoo/upgrade/pull/2682
task-2518565

closes odoo/odoo#71993

Related: odoo/enterprise#18930
Related: odoo/upgrade#2700
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-31 04:14:42 +02:00
Romain Derie 7329b5dc78 [ADD] test_website_modules: new website test module
The goal of this module is to be able to write tests that run and test the
`website` module business code with all the website modules installed (like
website_blog, website_sale etc).

This is, among other things, useful to test the configurator behavior.
Testing the configurator inside the `website` module would require the tour to
install modules, which is against our testing suite policy.
Such tests end up in `@standalone` testing suite, run only in nightly, meaning
anyone can break stuff without knowing. Such tests are way, way less efficient.

Community: https://github.com/odoo/odoo/pull/71993
Enterprise: https://github.com/odoo/enterprise/pull/18930

task-2518565
2021-07-30 22:03:18 +00:00
Benjamin Frantzen (bfr) 3416c596d9 [IMP] account: auto_install l10n_it_edi_sdicoop if main company is Italian
Task ID: 2613031

closes odoo/odoo#74508

X-original-commit: a7a4552b6cd9d1992d854c7f79e12ea172f98d81
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-07-30 15:06:19 +00:00
Sébastien Theys 810d5fd8aa [IMP] mail, im_livechat: add new UI for inviting members on channels
Opportunity is taken to clean the various follow/join/invite methods into only
one `add_members` method.

Part of task-2360169

closes odoo/odoo#74425

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-07-30 15:52:33 +00:00
xO-Tx eb1262960f [IMP] web_editor: allow adding a shape-on-image via custom URL (themes)
The goal of this commit is to add a "Python version" of the
shape-on-image feature using a controller.

Since the whole logic to apply shapes on image is JS-based, we need
to use this URL (just like for background shapes) when we want to add
a shape by default on images in themes. When the configurator replaces a
snippet image (which the theme defines to have a shape), the shape
option should still be applied on the new image.

On the JS side, loadImageInfo() is overridden in order to mark
images (with theme default shapes) with corresponding attachment
data (original-id, original-src, mimetype).

Here is an example of the minimum xpath required to add a shape on a
snippet image in a theme:

```
<template id="s_image_text" inherit_id="website.s_image_text">
    <xpath expr="//img" position="attributes">
        <attribute name="src">/web_editor/image_shape/website.s_image_text_default_image/web_editor/solid/blob_1_solid_rd.svg?c2=o-color-1</attribute>
        <attribute name="data-shape">web_editor/solid/blob_1_solid_rd</attribute>
        <attribute name="data-original-mimetype">image/jpeg</attribute>
        <attribute name="data-file-name">s_image_text.svg</attribute>
        <attribute name="data-shape-colors">;o-color-1;;;</attribute>
    </xpath>
</template>
```

task-2593454

closes odoo/odoo#73938

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-30 17:35:19 +00:00
15aae7ea34 [IMP] website: organize links in menu & footer on configurator apply
The configurator takes care of the organization of the links to the different
pages. Some links are put in the menu and some are put in the footer. The order
is predefined. If too many links are present in the menu then a sub-menu 'Company'
is created and some links are put in it. For the 'News' and 'Succes Stories' features
a website specific blog is created.

Links have the following order in the menu and are present only if their corresponding
website.configurator.feature has been selected in the configurator excepted for the 'Home'
and 'Contact us' links which are default links:
- 'Home'
- 'Shop'
- 'Event'
- 'Courses'
- 'Services'
- 'Pricing'
- 'Company': if more than 8 links in menu and more than 1 item in this submenu
             otherwise the three following links are in the top menu.
  - 'News'
  - 'Success Stories'
  - 'About us'
- 'Appointment'
- 'Contact us'

Links in footer:
- 'Privacy Policy'
- 'Help': if website_helpdesk installed. This is not a website.configurator.feature.
- 'Forum'

Community: https://github.com/odoo/odoo/pull/71993
Enterprise: https://github.com/odoo/enterprise/pull/18930

task-2518565

Co-authored-by: Sébastien Mottet (oms) <oms@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2021-07-30 13:51:33 +00:00
Romain Derie 59098dbc60 [FIX] website: avoid commit, reset env, reload registry for no reason
Before this commit, if the configurator was applied without a module to install
it would still go through `_button_immediate_function()` which does

```
self._cr.commit()
api.Environment.reset()
modules.registry.Registry.new(self._cr.dbname, update_module=True)
```

for no reason, even if `self` is an empty module recordset.

This code is taking ~5 seconds.

This flow will occur when you either:
- Create a new website when selecting only page feature
- Create a new website when some modules feature are already installed

Community: https://github.com/odoo/odoo/pull/71993
Enterprise: https://github.com/odoo/enterprise/pull/18930

task-2518565
2021-07-30 13:51:25 +00:00
Romain Derie 460d5ecb92 [IMP] website: add tests for all snippets (drag and drop)
Image gallery snippet when dropped is throwing a traceback.
This lead to the editor not usable anymore, as any JS error will prevent any
further action (no JS will work anymore).

This introduce a test that will drag and drop every snippet in a page and click
on it to load its settings in the right panel.

Note that it will remove the snippet before drag & dropping the next one, as
having too many snippet will impact the perf, even killing the browser entirely
if there is a lot.

task-2604383

closes odoo/odoo#74135

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-30 13:43:24 +00:00
Arthur Detroux (ard)andqsm-odoo 1c442782f8 [IMP] website, *: add visibility options on sections
*: web_editor

Provide the user with an option to hide or display a section tag
depending on the visitor's location (if geoip enabled), language,
utm_medium, utm_source and utm_campaign.

Users can use a M2M widget to select different records. These will be
used to create a CSS selector on save that will hide the section tag
depending on the various options they selected.
This CSS selectors will be applied, as well as various data attributes
when the page loads to hide the targeted tag. All of these operations
are handled client side.

The geoip country had to be added to the session for the feature to work
with countries.

Part of https://github.com/odoo/odoo/pull/67140
task-2381049

closes odoo/odoo#67140

Related: odoo/enterprise#19907
Related: odoo/upgrade#2658
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-07-30 14:03:42 +00:00
Arthur Detroux (ard) 3a23891fa1 [IMP] website_forum: change welcome message sanitization
This commit changes the sanitization of the welcome_message to be on par
with other modules that take advantage of web_editor.

Part of https://github.com/odoo/odoo/pull/67140
task-2381049
2021-07-30 12:52:30 +00:00
qsm-odoo f14bbf1bdc [REF] web, *: move cookie utils out of legacy core utils
*: im_livechat

Cookie utils will be required on the frontend side but before the lazy
loading. This commit splits them out of default utils to achieve that.

Note: kept as "legacy" utils anyway, we'll handle that when the time is
right...

Part of https://github.com/odoo/odoo/pull/67140
task-2381049
2021-07-30 12:52:30 +00:00
sofiagvaladze 08ed9a0ebb [IMP] hr_recruitment: UX improvements
Multi-Application Management and UX improvements.

Improve in Recruitment app Job Positions Kanban view;
It is more intuitive if list is applications default view; improve the applications form;

Task - 2404610

closes odoo/odoo#63946

Related: odoo/enterprise#15750
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-30 13:15:02 +00:00
Samuel Degueldre 4629caa530 [FIX] web: remove expensive @extend rules
These rules cause the scss compilation to increase dramatically in both
time and volume of the compiled file (for assets backend with no modules

closes odoo/odoo#74480

Installed: 1s -> 3s, 900kB -> 1.5MB)
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-30 11:10:07 +00:00
Samuel Degueldre c59c92c7ec [FIX] base: avoid compiling css assets twice while in debug=assets 2021-07-30 09:52:27 +00:00
Xavier-Do e27340066b [IMP] core: enforce explicit license in all manifest
The license was missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.

The missing licenses were add in all version starting from
12.0 in repos odoo, enterprise and design-themes.

Starting from this commit, when a license is not defined,
a warning will be triggered.

closes odoo/odoo#74347

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-30 12:34:11 +00:00
Pratima Gupta e470cf945f [IMP] purchase_stock, mrp: improved the log note of replenishment report
mrp - when a MO is generated from replenishment report, a log note is added
to chatter with the link of replenishment report, as this report got deleted
when to to qty is 0.0 then link dost not work. Hence added the simple text
for Relenishment report.

purchase_stock - When click on the order once button of replenishment report,
if vendor is not added on product then, added a new wizard with functionality
to directly jump on the edit product.

Added log note to the PO if po lines are generated through the Replenishment
report.

TaskId - 2427738

[IMP] stock: split method to create new or unlink unused OP

As, server action was added to the Replenishment menu, unless
until user clicks on the menu, new order point will not get
generate. Hence splitted the method and added to auto vaccum for
this.

TaskId - 2427738

closes odoo/odoo#66130

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-07-30 12:20:39 +00:00
Arnold Moyaux d21ab73d79 [FIX] stock: prevent to copy reservation on stock.move.line
Usecase:
- Product A 10 units in stock
- Do a planned transfer of 7 units to customer
- Reserve
- Do an rpc or execute code to call copy on the stock.move.line

It will result with 2 sml that have 14 units reserve and 7 units
reserved on stock.quant

It's the same result if you create twice the stock.move.line without
updating the stock.quant at the same time. However in stable we
try to only use _update_reserved_quantity on stock.move or some
override in create/write method for 'done' stock.move.line in unlock
cases.

So we never use the copy in stable and define the basic behavior as
'we don't copy the reservation' could prevent some usecase where
the update on the stock.quant is forgotten after.

closes odoo/odoo#74489

X-original-commit: e5041ee1d9b5036cab55f4332977aeb818a3b1e1
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-07-30 11:35:05 +00:00
Simon Genin (ges) 7719f39e68 [FIX] web: fix readonly mode for url widget
The readonly would not clear the old content when new content was put
through an onchange.

closes odoo/odoo#74476

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-30 10:26:06 +00:00
Odoo's Mergebot bbf8255bbb [MERGE] event_*: refactor and improve badge reporting
PURPOSE

Rework the existing badge report to ease its override and make it look better
and introduce a new ticket report that contains more detailed information.

SPECS

Improve the existing badge report
Change the event badge report to create a proper action report so that it
shows accordingly on form (and other) views.
Remove the duplicate template for event badges and unify into one template
The "event badges" report can be printed from 2 different sources, from the
event.event itself as a preview and from the event.registration as an actual
badge for a specific attendee.
Improve the general layout of the report and remove unnecessary fields.
Introduce a new badge report with the A4 format.

This report is meant to be printed for the attendee and contains more
detailed information that the existing "badge report", which is only meant to
be folded and used as a badge.

We also introduce a new field that allows easily customizing these reports by
adding "extra instructions".

See underlying commits for more details.

LINKS

ENT PR odoo/enterprise#19349
UPG PR odoo/upgrade#2599
Task-2120259

closes odoo/odoo#72935

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-30 14:50:25 +02:00
Benjamin Vray 81f0f0840c [IMP] website_sale, *: review prices to be more realistic
*: product, purchase, purchase_stock, sale, sale_stock, web

PR-69971

task-2501400

closes odoo/odoo#69971

Related: odoo/enterprise#19974
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-30 10:39:44 +00:00
Benjamin Vray 6aa85001cb [IMP] website_sale: add a website description for customizable desk
PR-69971

task-2501400
2021-07-30 10:39:44 +00:00
Benjamin Vray 6ba77a583f [IMP] website_sale: add options in the sort by in the shop page
PR-69971

task-2501400
2021-07-30 10:39:43 +00:00
Benjamin Vray 43738af29a [IMP] website_sale: add an image for warranty product
PR-69971

task-2501400
2021-07-30 10:39:43 +00:00
Jeremy Kersten efe897f6ab [FIX] website_sale: fix tour when redirect to backend is too slow
We increase the time (if we can call this a fix) while the switch from frontend
to backend become faster. It seems to be a problem of (useless?) regeneration of
assets + a slow refactoring of scss in backend which use extend that is slow...

closes odoo/odoo#74477

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-30 09:21:23 +00:00
Aurélien Warnon eb06e10f56 [IMP] event_sale: slightly improve event.registration form view
This commit simply makes the "Sale Order" stat button on the Event form only
visible when there is actually a sale order to access.

Task-26779
2021-07-30 09:02:55 +00:00
Aurélien Warnon 8bae36bc1a [FIX] event: fix savepoint issue with event mail scheduler
This commit removes a savepoint call when running the event mail scheduler.

Indeed, this save point registration was colliding with the fact that we commit
the assets bundle during the reporting process, see 'commit_assetsbundle'
context key.

Since the transaction was commit during the report generation, when reaching
the end of the savepoint block, the system was trying to release a savepoint
that was no longer existing.

Indeed, committing removes all savepoints, since (quoting the Postgres doc)
"Savepoints can only be established when inside a transaction block.", which
makes total sense.

This was leading to a:
bad query: RELEASE SAVEPOINT "669516d2915811eba8d2b4d5bde7cdcc"
Aborting the whole event mail scheduler process.

As it's rather unclear why this savepoint was introduced in the first place,
we attempt to remove it. This change is done in a singular commit to be easily
revertable if ever necessary.

Task-26779
2021-07-30 09:02:54 +00:00
Aurélien Warnon 44b55dc883 [IMP] [website_]event: add a new full page format badge report
This commit introduces a new badge report displayed on a full A4 page.

This report is meant to be printed for the attendee and contains more
detailed information that the existing "badge report", which is only meant to
be folded and used as a badge.

We use a lot of custom layout and classes to create a "ticket-feeling" to the
report and make it look good visually.

We also introduce a new field that allows easily customizing (outside of
studio) this report by adding "extra instructions" (how to use your ticket /
directions on how to get to the event / ...).

Side note: scss disclaimer

As the reporting engine does not allow complex class/rules building, we had to
implement this nice layout using very well placed background-image and
"pixel perfect" sized elements.

LINKS

ENT PR odoo/enterprise#19349
UPG PR odoo/upgrade#2599
Task-26779
2021-07-30 09:02:53 +00:00
Aurélien Warnon 1b66782dca [REF] event_*: refactor the event foldable registration badge
PURPOSE

The event foldable badge is currently not very user-friendly in terms of usage
and style.
This commit aims to re-work it visually as well as getting rid of multiple
technical flows (unnecessary fields / no studio anchors / ...).

SPECS

Preliminary cleaning : Unify both foldable badge templates into one.

The "event badges" report can be printed from 2 different sources, from the
event.event itself as a preview and from the event.registration as an actual
badge for a specific attendee.

The implementation was done using two different templates, leading to a lot of
duplicated code and potential issues when editing one template that would not
modify the other accordingly.

This commit unifies both templates into one.
When the report is printed from the event as a "preview", we simply check that
the attendee variable is missing and print placeholders instead.

Main changes : Rework the whole foldable badge template

1. Get rid of unnecessary fields

The foldable badge template used several fields on the event.event model itself
that would allow customizing the report per event.
However, there were actually no way for the user to access and edit those
fields, as they are not part of any views.

We therefore removed them (badge_front, badge_back, badge_innerleft,
badge_innerright, event_logo).

And instead offer a single new field (ticket_extra_instructions), available on
the form view of the event, that allows to easily customize the foldable badge
and adding instructions specific to this event (how to come / what to bring /
...).

2. Visual changes

The report was re-worked to make it look a bit more recent, as the previous
look was very basic and was not very attractive.

This was done using a specific scss file that allows defining rules without
bloating the template with long style attributes.

In addition, we added some pictures that help the attendee understanding how to
correctly fold the printed A4 sheet into a badge and slide it into the holder.

All the information that were previously on the report should still be there.

3. Relocate action from website_event to event

As a bonus, we moved the reporting action from website_event to event, in order
to have everything that is related to this foldable badge in the same module.

Side note: scss disclaimer

As the reporting engine does not allow complex class/rules building, we had to
implement this nice layout using very well placed background-image and
"pixel perfect" sized elements.

You will see a lot of hardcoded numbers, mainly on heights, but it can't be
helped.

LINKS

ENT PR odoo/enterprise#19349
UPG PR odoo/upgrade#2599
Task-26779
2021-07-30 09:02:52 +00:00
Guillaume (guva) 20a82cf35a [FIX] mrp : MO set to close before finished
Step to reproduce :

- Create a Manufacturing Order for several pieces of a product with a
work center routing
- Open the Work Order which has been created
- The Manufacturing Order is set to 'to close', instead of 'in progess'

Cause of the issue

The state of the MO was never computed based on WO status.

Solution

The state of a MO is set to 'to close' when a WO is set as 'done'
or 'cancel'

opw-2584446

closes odoo/odoo#74411

X-original-commit: c237c9c3214b58d303a8597df2c836872c5e522c
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: guva-odoo <guva-odoo@users.noreply.github.com>
2021-07-30 09:02:43 +00:00
Francois (fge) bfa2d9c205 [IMP] web: refactor Command palette
The purpose of this commit is to make the palette command customizable.

From now, it will be possible to add spaceNames to modify the commands
displayed in the command palette.
For example, if I add the spaceName '@' and associate a provide function
with it, then when I type "@" in the search bar of the command palette,
the commands generated by provide will be displayed.

const commandProviderRegistry = registry.category("command_provider");
commandProviderRegistry.add("example", {
	nameSpace: "@" ,
    provide: (env, options = {}) => {
        return [{name: "myCommand", action: () => ()}]
    },
});

It will be possible to define several provide functions for the same
namespace. This will make it easy to add new commands when installing
a new addon.

Now it is possible to define commands that modify the state of the
command palette. This allows a command to change the placeholder
and commands displayed in the command palette.

closes odoo/odoo#73750

Related: odoo/enterprise#19970
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-30 08:26:09 +00:00
Francois (fge) 235fc69280 [IMP] web: replace fuzzy lib 2021-07-30 07:27:02 +00:00
Jeremy KerstenandOkan SUMER be43710ab8 [IMP] tools: xpath - support mode inner for position replace
This commit adds a new attribute mode for position 'replace' to the xpath feature.

This mode can take 2 values:

- 'outer' (default mode if not provided) that will replace the sibling target
- 'inner' that will preserve the sibling target

If base arch is:
```html
<p>
   <field name='x'>yyy</field>
</p>
```

`<field name='x' position="replace" (mode="outer")>zzz</field>`
```html
<p>
   zzz
</p>
```

`<field name='x' position="replace" mode="inner">zzz</field>`
```html
<p>
   <field name='x'>
      zzz
   </field>
</p>
```

Mode inner is useful for theme or render flat content, but not recommanded to
be used in page editable since we ignore the inherit-branding part until now.

task-2172208

closes odoo/odoo#48679

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Okan SUMER (osu) <osu@odoo.com>
Co-authored-by: Jérémy Kersten <jke@odoo.com>
2021-07-29 07:04:55 +00:00
Gorash 73a821abf6 [FIX] website: avoid traceback when going to options of some themes
Issue: traceback when website editor is entered and theme options are
clicked on themes using an unknown-to-the-editor font family (see for
the theme repo fix for such an example).

opw-2559735

closes odoo/odoo#74423

X-original-commit: c664cf1a1fb4b6781fe2802e66c993cfa1a4a028
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-29 11:34:01 +00:00
Samuel Degueldre 4c7ef96974 [REF] web: refactor debug menu to use context in env instead of service
This makes the debug menu more natural to use, and makes the difference
between the "in-dialog" and "out-of-dialog" debug contexts explicit.

closes odoo/odoo#74346

Related: odoo/enterprise#19967
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-30 06:01:42 +00:00