Commit Graph
143505 Commits
Author SHA1 Message Date
Francois (fge) f1fccbe3c7 [FIX] web: style issue with o_field_many2one_avatar
closes odoo/odoo#73285

X-original-commit: 1cd6348b6524c09f8ede88d3e7fd9399a8344b93
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-06 10:34:09 +00:00
Goffin Simon eafbae34ab [FIX] point_of_sale: Scanning Barcode EAN-13 with price
Steps to reproduce the bug:

- Let's consider a product P with sale price = 0€
- P is available in the POS
- Set a barcode to P, 2312345000002 (meaning price = 0€ with check digit = 2)
- Open a session in the POS and scan 2312345003003 (meaning price = 3€ with check digit = 3)

Bug:

A line was added with P but its price was 0€ instead of 3€

PS: Function _getAddProductOptions always sets price_extra to 0€

opw:2566502

closes odoo/odoo#73245

X-original-commit: ee567231a16b12031c234400a6a37bb5b7898cec
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-07-05 15:01:40 +00:00
William Braeckman dddb10df25 [IMP] hr_recruitment: update job source kanban view
Gives a bit more space to the job source name to prevent text from
cutting.

Task ID: 2575483

closes odoo/odoo#72425

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-06-21 11:23:44 +00:00
Sébastien Mottet (oms) 3b3ab08c3c [FIX] website: set id in xml for carousel rendered by configurator
Carousels (carousel and quotes_carousel snippets) in pages created by the
configurator are not added through a drag'n'drop. onBuilt and _assignUniqueId
are thefore not called. We set the unique id directly in the xml to make
the carousel slides also work when these snippets are added by the configurator.

task-2518565

closes odoo/odoo#73256

X-original-commit: 36387994d0a3038c87a754d4c27a6d34b30137e3
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-06 08:36:44 +00:00
Adrien Widart 92e41b6ca6 [FIX] event_sale: recompute seats on SO deletion
When deleting a SO with an event ticket, the number of attendees becomes
incorrect

To reproduce the error:
1. In Settings, enable "Tickets"
2. On website, register an attendee to event E
3. In module Events, open E

Error: The number of attendees (X) is incorrect. If the user clicks on
it, there are X-1 attendees: the one added on step 2 has been deleted
but the number is not updated

When deleting a SO or a SO line, the associated registration is deleted:
https://github.com/odoo/odoo/blob/3fd3fc5f782f1422f578ad38e3fad444130273a8/addons/event_sale/models/event.py#L197-L198
This is the problem: it won't trigger the `compute` methods.

In the case above, this method won't be called:
https://github.com/odoo/odoo/blob/72ce1b867dc81672e6a73a586542b20216388a05/addons/event/models/event.py#L176
So the number of seats won't be updated

This fix suggests deleting the registrations from the ORM in order to
trigger the `compute` methods.

Note: Writing the tests revealed another problem. When deleting the SO,
if a wizard `registration.editor` exists and is linked to the SO, the
deletion will trigger an SQL constraint. This is the reason why the
`ondelete` has been added to the field `sale_order_id`

OPW-2452760

closes odoo/odoo#73260

X-original-commit: 89ddb7533b82160f09b7815a292c209f8d39ece5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-07-05 17:52:19 +00:00
Nasreddin Boulif (bon) 88ae867203 [FIX] product: reset Based on on change pricelist Compute Price
Steps to reproduce:

  - Create a new pricelist;
  - In the Price Computation, select "Formula" then
    change it to "Based on Cost";
  - Change the price computation back to "Percentage (discount);
  - Create a sale and set this new pricelist.

Issue:

  Price discount made on the cost of the product instead to get back
  to sale price as default

Cause:

  When switching `Compute Price` and != 'formula', not setting back
  `Based on` (base) to `Public Price` (list_price).

Solution:

  If compute_price is changed and new value != 'formula'; set
  pricelist `Based on` to `Public Price`.

opw-2587295

closes odoo/odoo#73263

X-original-commit: 3f409c08723827766db4b3f40d7777f485e78230
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-07-05 18:52:17 +00:00
Paul Morelle 37e9dda232 [FIX] digest: avoid exception on user creation
Scenario to reproduce the issue on runbot 12.0 Community:
- Go to Settings > Technical > Email > Digest Emails
- Select the Weekly Digest
- Click on Action > Delete
- Click on OK
- Go to Settings > Users & Companies > Users
- Click on Create
- Fill the Name and the Email Address
- Save
- Odoo Server Error - Missing Record

Some users seem to delete this record to stop receiving the digest for
everyone, including for future users.  The problem is that, even if the
digest has been deleted, the config parameters are still referencing it.

This commit prevents the exception by having an empty recordset if the
digest does not exist.

closes odoo/odoo#73237

X-original-commit: 2910bd24f410e882b9745337f918a206b25925f7
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2021-07-05 14:18:07 +00:00
Nasreddin Boulif (bon) 65ba78a9eb [FIX] sale: add date label to quotation preview at 'sent' stage
Steps to reproduce :

  - Install 'Accounting'
  - Create a quotation then send it (without confirming it)
  - Click on Preview

Issue :

  `Date` field is not preceded by a label.

Solution :

  Display "Quotation Date:" label if quotation is not in one of this states :
  `sale`, `done` or `cancel`.

opw-2585000

closes odoo/odoo#73181

X-original-commit: b35b8938c5fea82d27d29601b7d7a04bfc67eb66
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-07-05 12:43:28 +00:00
Wolfgang Taferner 3050e78ee2 [FIX] sale: make sure that bulk invoice creation is not blocked and those orders are skipped instead
In case you have installed sale_timesheet and try to do a bulk invoice creation you will be blocked if one order does not have invoiceable lines instead of skipping this specific order.

closes odoo/odoo#73261

X-original-commit: 3e03fe467b9fd459223113e477bc31811fbd35ed
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Wolfgang Taferner <wtaferner@users.noreply.github.com>
2021-07-05 17:54:54 +00:00
Géry Debongnie 2063b26b09 [FIX] web: add context in pyeval context
When the owl refactoring landed, we rewrote the pyjs evaluation system.
Then, we used the new system in the new code. In particular, the action
service uses it to evaluate the action domain.

But the previous code had a subtle behaviour in the special case of
evaluating domain: it added the context as a pydict object in itself, so
one could evaluate expression such as `context.get('a', 14)` to read the
value of a key in the context with a fallback.

With this commit, we uniformize this behaviour across all python
expression: the `context` key is now reserved, and used to access
anything in the current evaluation context.

closes odoo/odoo#73227

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-05 12:53:44 +00:00
Simon Genin (ges) 9583c74e5f [FIX] web: make js tooling safe with paths with spaces
If $basepath in the tooling contained spaces, it could have dramatic
consequences on the rm -rf command.
We simply escape everything to avoid the problem.

closes odoo/odoo#73222

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-05 13:07:48 +00:00
Brice bib Bartoletti 8524991da3 [FIX]stock_account: copy_data safer access to prop
In l10n_latam, creating a debit note with stock_account installed ends
up in stock account checking for a property in a dictionnary that may
not exist.

Using the get property will solves this issue by providing a value.

closes odoo/odoo#73221

Ticket: opw-2580992
Bug-fix: opw-2588504
X-original-commit: 423d2d4ec62312da96c66d000eaabeac4920f68f
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Brice Bartoletti <Levizar@users.noreply.github.com>
2021-07-05 11:37:13 +00:00
lejeune quentin 5abdce0982 [FIX] point_of_sale: Specify max cron for IoT
By default max cron threads is setted to 2.
But this value must be setted to 0 in the IoT
This parameter is added to odoo.conf of the IoT

closes odoo/odoo#73218

X-original-commit: 3d33b7f057f08cf1a51c59c9749996059a4983cb
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2021-07-05 10:50:04 +00:00
Joren Van Onder 6bab271c85 [FIX] payment_authorize: make transaction request parameters extendable
This makes it possible to patch only _prepare_transaction_request in
case parameters need to be added.

closes odoo/odoo#73215

X-original-commit: 35a6c1867d8edc9b58c002a6ff6a63c35a0fc708
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-07-05 10:03:23 +00:00
William Henrotin 2d6fd0e7b9 [FIX] purchase_stock: add sequence to new view
The commit 6eaa4a2ae3 introduced a new
view on model supplier info. The issue is that this new view is meant to
be used on supplier info as One2Many on stock.orderpoint and so contains
some `parent.` relation.

As no sequence has been set. This view replaced the original one in the
Purchase Configuration menu. Leading to some error as `parent.` in not
defined for standalone tree view.

This commit set a sequence on this new view to ensure it is used only on
the orderpoint form view.

closes odoo/odoo#73212

Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-07-05 09:53:58 +00:00
Aurélien (avd) 8ccacf58af [FIX] stock: improve move_line._free_reservation performances
Move candidate.unlink out of the for loop to unlink
records in batch.

Remove to_unlink_candidates.move_id from move_to_recompute as
move_line.unlink() will trigger recompute of their move's state.

---

opw-2585598

closes odoo/odoo#73160

X-original-commit: e2e51c15d082ec17743b73ad1422e4a223268be9
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-07-02 13:41:07 +00:00
Géry Debongnie f8ffa757c8 [IMP] web: optimize read/unlink when id list is empty
With this commit, we can simply skip performing a rpc when we know that
the id list given to read/unlink is empty.

closes odoo/odoo#73063

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-05 14:17:58 +00:00
Géry Debongnie 3e8ee3aedc [IMP] web: add some validation in orm service
Before this commit, orm service calls had no validation whatsoever,
which means that the requests would fail serverside, then display a
python traceback. This makes it harder for developers to find the cause
of the issue.  Also, it is easy to perfom some really basic validation
anyway.
2021-07-05 13:57:54 +00:00
Lucas Perais (lpe) 3e4c37ec6b [FIX] point_of_sale: correctly block ui when sending RPC
Before this commit, the block UI component was not visible so the interface
was not blocked when sending RPC (at least).

After this commit, the block UI works correctly

closes odoo/odoo#72727

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-24 14:30:14 +00:00
Mohammed Shekha 234832d95e [IMP] project: show share button edit mode
Before this commit: share button inside project was displayed only in
readonly mode.

After this commit: share button inside project will be displayed in
edit mode as well.

task-2513815

closes odoo/odoo#70441

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-05-06 06:55:10 +00:00
Mohammed Shekha d8134350b8 [IMP] base,stock,web,website_sale: replace create_text with add-label
before this commit: create_text was passed in node options and due to which it
was not parsed by translate.py, pass add-label as attribute on field so that
translate.py parse it and it is translated.

after this commit: create_text will be passed as field attribute instead of
node options.

task-1923433

closes odoo/odoo#59713

Related: odoo/enterprise#19418
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-05 11:11:21 +00:00
Mohammed Shekha a65493fb83 [IMP] web: do not close column quick create on first column
Before this commit: When there are no columns in kanban and user is
creating very first column then it will display column + examples
clicking out closes quick create of column and due to which mockup
column also disappeared.

After this commit: Quick create of column will not discard if there
are no columns and user is creating very first column, clicking
outside will discard quick create of column if there is atleast one
column exist.

task-2517684

closes odoo/odoo#70220

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-05 08:36:17 +00:00
Stéphane Bidoul 9a131b2f78 [FIX] base: do not check dependencies of uninstallable addons
When an installed module is not installable, we don't want
to check its dependencies because they may not be available.
Erroring out on such dependencies is not needed because
the module will not be loaded anyway. On the contrary, such
errors prevent starting a database which would otherwise
function normally.

Such errors occur when doing incremental migrations where
it happen that addons are installed (from the previous version)
but not migrated yet and therefore not installable.
When we migrate lower level dependencies Odoo marks
higher level addons as "to upgrade" even if they are not installable.
That is usually harmless, except when such addons have
dependencies that are themselve not available.
This PR fixes that.

closes odoo/odoo#73206

X-original-commit: a11e8a32883b0d0deaeb2497daa585eb3d3c686e
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2021-07-05 08:45:13 +00:00
Sébastien Mottet (oms) 44db2dfc90 [IMP] website: use sessionstorage for configurator
We are now using the sessionstorage to make the data the user enters when
he completes the configurator persistant during the whole session. Which
means that these data are not lost anymore on page refresh.

task-2518565

closes odoo/odoo#73101

X-original-commit: 74cc69f3908a3b1b5bfc76bb362690f72e514b00
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-01 16:58:34 +00:00
Sébastien Mottet (oms) a7ffa0069b [FIX] website: move back skip button to initial place
Finally we don't want to change the position of this button (PR #72138).
This commit moves it back to its initial place.

closes odoo/odoo#73103

X-original-commit: 60657db80248714a9b3b7269b70e8c8b25cdce11
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-01 17:02:53 +00:00
nounoubensebia 89d72df22b [IMP] *_event_*: revamp event template form
This commit revamps the event template form to be similar to the event form
itself and removes unnecessary fields, purpose is to give more clarity to the
user.

It also fixes the order of the fields in the event form to be exactly
the same as in the front-end, so that the user don't get confused.

Task-2541208

closes odoo/odoo#71856

Ent-pr: https://github.com/odoo/enterprise/pull/19128
Upg-pr: https://github.com/odoo/upgrade/pull/2516
Related: odoo/enterprise#19128
Related: odoo/upgrade#2516
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-01 09:37:41 +00:00
Julien Banken e17e07030d [IMP] website_event_exhibitor: use a POST method to set the tag filters
PURPOSE

It has been reported that the page showing the exhibitors is slow because of the
partner table used behind the scene. It turns out that the page can generate many
links for the filters which can trick the crawlers to explore them all. As the
page is slow, the crawlers can put a high pressure on the server by exploring
those links.

SPECS

- Use a POST method to set the tag filters.

By using a POST method, the page will not longer generate links and the crawlers
will no longer explore them. This technique is actually more reliable than simply
defining a `rel="nofollow"` rule on the links.

LINKS

Task id: 2466072

closes odoo/odoo#68192

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-05 07:46:49 +00:00
Russell Briggs dfbe4ab655 [IMP] CLA signature
closes odoo/odoo#73196

X-original-commit: 8166e1ec1f134aa7d3538c82ed144d52e44f71ef
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-04 20:00:10 +00:00
Benoit Socias 2ff8b4ac53 [FIX] website: make map snippet cleaner
Follow-up of [1]

Before this commit the map snippet had life-cycle and naming issues.

Also avoid partially reusing the color picker intended for background
images for the color filter overlay.
The height adjustment has also been removed, the standard top and
bottom padding can be adjusted to achieve a similar result.

[1]: https://github.com/odoo/odoo/pull/66766#pullrequestreview-685976812

Related to task-2464422

closes odoo/odoo#73180

X-original-commit: 8b9225ffd133332630097f29db9522abace7ba09
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-02 18:08:20 +00:00
Xavier Morel 814d712d13 [FIX] website_rating: display layout of publisher comment
Avoid website_publisher unwittingly breaking portal page layouts where
publisher_comment is enabled.

closes odoo/odoo#73167

X-original-commit: 72357c94b05437ef70d96840be5317e9512504e2
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-07-02 14:17:38 +00:00
Prakash Prajapati 15a0a0d18c [IMP] base, l10n_(ar, cl): update currency data with ISO 4217 standard
This commit updates the res.currency data files to be compliant with
the ISO 4217 standard:

Add existing currencies missing from Odoo.
Remove currencies deprecated since at least 10 years.
Update incorrect currency names and rounding values.

task-2501384

closes odoo/odoo#69356

Related: odoo/upgrade#2400
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-07-02 10:16:57 +00:00
Bruno Zanotti (ADHOC) a59e2d6225 [FIX] l10n_ar: show CBU in electronic debit notes
According to Argentinean law 27440, Art. 5º it is mandatory to show the
CBU on the report for electronic invoices and electronic debit notes.
Before this commit, we were showing only in FCE (MiPyMEs), and here we
add it for NDE (MiPyMEs) on invoices reports.

closes odoo/odoo#73108

X-original-commit: d5f3e1ddff72ba05af3b8d20888b92799c7d532c
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-07-01 19:10:24 +00:00
lejeune quentin 1a28801a00 [FIX] point_of_sale: Move parameter in odoo.conf
Move the odoo server parameters into the odoo.conf file
instead of being placed as the service command line argument

closes odoo/odoo#73143

X-original-commit: 8943ed4fdd01817a86e6a8abf6463e078182f584
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2021-07-02 11:37:50 +00:00
oco-odoo 9e503fa5d8 [FIX] account: tags form view: make country readonly only when necessary
https://github.com/odoo/odoo/pull/71872 made country_id readonly in every circumstance. This made it impossible to create an account.account.tag targetting taxes from scratch in the UI. We only want to prevent edition of this field when the tag has been generated by a tax.report.line.

closes odoo/odoo#73142

X-original-commit: 8f0ae54cd24e9a6299d86c47ed37aea2a7fa4ad8
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-07-02 11:36:31 +00:00
oco-odoo c40be3c5c7 [IMP] l10n_eu_service: make compute api.multi
closes odoo/odoo#73078

closes odoo/odoo#73141

X-original-commit: 12b4d94eec431710c9b47af145ebfd01391ee0e0
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-07-02 11:32:49 +00:00
oco-odoo c79cdf717b [FIX] l10n_eu_service: don't duplicate OSS taxes on refresh of an existing rate
To reproduce:

1) Install an European CoA and make sure the OSS mapping for its taxes has been generated (either installing l10n_eu_service before, or clikcing the "refresh tax mapping" button, in the settings)

2) Create a new tax with the same rate as one of your original taxes

3) Click on "refresh tax mapping"

===> Instead of reusing the OSS tax mapped with the other tax having the same rate, a new tax with the same name has been created.

X-original-commit: 6f6386ed0374cea143541add69c269f44b098050
2021-07-02 11:32:47 +00:00
Younn Olivier d2189dc3bf [FIX] web_editor: correctly display selected basic color
When selecting a "basic" color from the color picker, it was displayed
as a custom color.

It was due to the fact that the basic colors were not correctly computed
to build the existing colors: the array of the rows was used instead of
the array of the colors.

Part of https://github.com/odoo/odoo/pull/72978
task-2476601

closes odoo/odoo#73139

X-original-commit: 23b182ab1bce9a00cb75d12b0d0c504d1fe19e2f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-02 11:26:12 +00:00
Younn Olivier e7f497b027 [FIX] web_editor: reintroduce request_editable event
The commit fixes the display of custom colors in the color picker.

It improves previous fix from #72294, which was not returning all
editables from the editor, thus only the custom colors of the target
were displayed.
For that the request_editable event is reintroduced at the SnippetsMenu
level.

Part of https://github.com/odoo/odoo/pull/72978
task-2476601

X-original-commit: 68d7d42cce012269342e18373a30970e2c582ba3
2021-07-02 11:26:10 +00:00
Simon Genin 063e38c4fd [IMP] web,mail: add resetLocalState to rendererWrapper
add resetLocalState method to rendererWrapper and test activity view is not
crashed on on_destroy_callback

task-2466057

closes odoo/odoo#73022

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-02 12:48:52 +00:00
Mohammed Shekha afa4ac684d [FIX] web: reset renderer local state when switching view
before this commit: when switching to form view from listview using Create
button and then activate some other tab and Discard that record which will
move back user to list view now again clicking Create button opens form view
but active tab is last activated form tab instead of first one, this is because
of local state is not cleared.

after this commit: when form view is switched back to list view using Discard
button, local state will be cleared, here we are explicitly removing 'active'
class from all tab and pages of all notebooks.

task-2466057

X-original-commit: ff0e5694e28a46287dc54ab440364e11e8e9c832
2021-07-02 12:48:45 +00:00
Nasreddin (bon) ad434daf0f [FW][FIX] mail: display desired company logo in email + test
Steps to reproduce:

  - Install 'Accounting' module
  - Switch to "My Company (Chicago)"
  - Create an invoice
  - Set Invoice date to 1/1/21 and
  - Set Due date to 1/3/21
  - Add any product and 'Confirm' invoice
  - Go to customer profile
  - Click on 'Due' stat button
  - Click on 'Send by mail'

Issue

  In received email, logo displayed is of "My Company (San Francisco)".

Cause

  Env company not used.
  Instead, logo of customer.company_id is used if mail type have
   company_id field,
  else will fallback on user.company_id
  Also, if customer.company_id is null, it will fallback on '0':
  /logo.png?company=%s' % (company.id or 0)

Solution

  If mail record have NOT a company_id field or is not set,
  set company to self.env.company.
  Else, set company to record.company_id.

opw-2474114

closes odoo/odoo#73099

X-original-commit: 316b5956844d6f77f6fef1efeb5a8a8505e36e8e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-01 16:23:46 +00:00
Jose Lopez 95daf4d37c [IMP] base: Honduras vat label
closes odoo/odoo#73069

X-original-commit: bd03ed8a7563ad032a8470b3ef53198624df13b5
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-07-02 08:12:15 +00:00
Jose Lopez e7219419df [IMP] base: Honduras correct currency position and label
X-original-commit: a51dc5ef43b08b9fb0f9f4156c4c008dedc4c1b7
2021-07-02 08:12:15 +00:00
Rémy Voet (ryv) c19ac9e30a [FIX] purchase: fix forbidden access of partner
Issue:
For purchase user, which doesn't have the "Contact Creation" can't
create a purchase, get a AccessError.

The fields `receipt_reminder_email` and `reminder_date_before_receipt`
should be writable also for purchase user which doesn't have access
to write and create `res.partner`.

close odoo/odoo#64135

closes odoo/odoo#73131

X-original-commit: f29b1e81e6adf8532ecf90f9ecb675ec56eb4c61
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-07-02 10:27:23 +00:00
Fernanda Hernández beec2f9ccf [FIX] website_sale: use sudo to search account.fiscal.position to public user
Currently if public user has country_id, following traceback is raise
when /shop URL is opened:

Traceback (most recent call last):
File "/.repo_requirements/odoo/odoo/addons/base/models/qweb.py", line 331, in _compiled_fn
return compiled(self, append, new, options, log)
File "<template>", line 1, in template_website_sale_products_item_306
File "/.repo_requirements/odoo/addons/website_sale/models/product.py", line 294, in _get_combination_info
fpos = self.env['account.fiscal.position'].get_fiscal_position(partner.id).sudo()
File "/.repo_requirements/odoo/addons/account/models/partner.py", line 184, in get_fiscal_position
fp = self._get_fpos_by_region(delivery.country_id.id, delivery.state_id.id, delivery.zip, vat_required)
File "/.repo_requirements/odoo/addons/account/models/partner.py", line 141, in _get_fpos_by_region
fpos = self.search(domain_country + state_domain + zip_domain, limit=1)
File "/.repo_requirements/odoo/odoo/models.py", line 1708, in search
res = self._search(args, offset=offset, limit=limit, order=order, count=count)
File "/.repo_requirements/odoo/odoo/models.py", line 4485, in _search
model.check_access_rights('read')
File "/.repo_requirements/odoo/odoo/models.py", line 3331, in check_access_rights
return self.env['ir.model.access'].check(self._name, operation, raise_exception)
File "<decorator-gen-33>", line 2, in check
File "/.repo_requirements/odoo/odoo/tools/cache.py", line 90, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/.repo_requirements/odoo/odoo/addons/base/models/ir_model.py", line 1792, in check
raise AccessError(msg)
odoo.exceptions.AccessError: You are not allowed to access 'Fiscal Position' (account.fiscal.position) records.

This operation is allowed for the following groups:
- Accounting/Advisor
- User types/Internal User
- User types/Portal

Contact your administrator to request access if necessary.

Error to render compiling AST
AccessError: You are not allowed to access 'Fiscal Position' (account.fiscal.position) records.

This operation is allowed for the following groups:
- Accounting/Advisor
- User types/Internal User
- User types/Portal

Contact your administrator to request access if necessary.
Template: website_sale.products_item
Path: /t/t[2]
Node: <t t-set="combination_info" t-value="product._get_combination_info(only_template=True, add_qty=add_qty or 1, pricelist=pricelist)"/>

Above was tested and reproduced in an instance of odoo runbot v14.0:

https://youtu.be/GgUnyna_EX8

That is due to public user has not permission to read model
account.fiscal.position and in fact in ACL, permission contains
'public' but is setting group_portal.

closes odoo/odoo#73117

X-original-commit: 53dc9f62b6d4c362292bf48df54b11c4852f6006
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-02 08:27:07 +00:00
Francois (fge) 1e5a0dfc0a [FIX] web: display shortcuts correctly on the command palette
closes odoo/odoo#73048

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-01 11:37:45 +00:00
Younn Olivier e69633cf2d [FIX] web_editor: close widgets when clicking on dropdown buttons
The commit fixes an issue with the editor toolbars dropdowns, that would
not close already opened widgets. For example, when the widget color
picker for snippets background was open, opening the one from the editor
toolbar for the font would only close it for the first click, but not
for the ones after.

The issue was coming from Bootstrap, which stops the propagation of
click events for dropdowns. As a result, the click event on these
'.dropdown-toggle' elements was not processed by the listener at the
SnippetsMenu level, in charge of closing the widgets that were already
open in this context. It was the case only for the first click that was
instancing a Dropdown, but not for the ones after.
https://github.com/odoo/odoo/blame/cd9c071c9357cef14635ef094a9f14fc5431956c/addons/web/static/lib/bootstrap/js/dropdown.js#L308-L314

A solution would be to update bootstrap:
https://github.com/twbs/bootstrap/blame/688bce4fa695cc360a0d084e34f029b0c192b223/js/src/dropdown.js#L232-L237

The fix can be to listen to mouseup events on such '.dropdown-toggle'
elements while waiting for a bootstrap update.

Part of https://github.com/odoo/odoo/pull/72539
task-2476601

closes odoo/odoo#73032

X-original-commit: 048a329fc514b2c98cf7e6af7279f90fce53eb09
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-30 18:21:24 +00:00
Younn Olivier 8f62471ef6 [FIX] web_editor: close text color palettes when opening option ones
When the color palette for the text was open, opening the background
color options was not closing it.
The click event was stopped at the snippet option level for all events,
where it should only be the case if the click was done inside the
colorpicker.

Part of https://github.com/odoo/odoo/pull/72539
task-2476601

X-original-commit: 888f1bd44d0aa431d3d89ee3c913c6eb64c3d54d
2021-06-30 18:21:23 +00:00
Younn Olivier 168943d915 [FIX] web_editor: fix snippets custom colors display on color palette
After the new editor was merged, custom event 'request_editable'
triggered by the ColorPaletteWidget to retrieve custom colors from the
editable was not processed.

Now, we pass the editable in the options when we init the
ColorPaletteWidget.

task-2476601

closes odoo/odoo#72959

X-original-commit: 3d98268cf93087516743e3f0a2f3af950d4feb6a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-02 08:31:39 +00:00
Swapnesh Shah 0f936c68ba [IMP] mail: failure_reason should not be copied
Before this commit, failure_reason was also copied when user duplicate email.
Which is not correct since the Mail is never sent not failed.

With this commit, failure_reason will not be copied when user duplicate email.

closes odoo/odoo#71690

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-01 18:01:16 +00:00