This commit moves some handler methods from components to models,
as a step closer to having most of business code in models.
Having business code in models is desirable so that the code is much more maintainable:
easier to change and more robust code.
Task-2579306
closesodoo/odoo#88878
Related: odoo/enterprise#26277
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, the tab labels of the colorpickers were too long
in some languages (e.g. German) making them overflow and making the UI
impossible to use in some cases. Indeed, the bug was different depending
on where the colorpicker was:
- In the text tools, the colorpicker overflew the whole panel, making it
impossible to use
- In the snippet options, the colorpicker buttons were cropped without
ellipsis making them impossible to read
- In the backend, as the toolbar is floating, it was ok but the code was
quite dependent of the other colorpicker-related scss
This commit solves those problems and unifies the way colorpickers look
independently of their position (always full width, the buttons fill the
available space, if the buttons are too long they are cropped with
ellipsis, they have a title on hover and are always aligned on the
left of the tabs area).
opw-2786778
closesodoo/odoo#88844
X-original-commit: a4755218f239e5c00e9c6a23321654a3ab029470
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit fixes the timer that was cropped out when taking a
survey having a time limit on mobile devices.
Task-2810299
closesodoo/odoo#88910
X-original-commit: 6c7f8eeb275d8de9e06fe70cde293e18beb8fc01
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In v15, the rule `hr_leave_rule_employee_unlink` has been modified.
Because of that, during an upgrade to v15, the rule is reloaded from the
security xml.
If the rule had been edited and `perm_unlink` was set to False, since its
value is not explicitly stated in the xml, the upgrade will fail by
violating the constraint `ir_rule_no_access_rights`.
Related:
https://github.com/odoo/upgrade/pull/2127https://github.com/odoo/odoo/pull/65361closesodoo/odoo#88908
X-original-commit: b3994a0277a165ceedd2e8df1f31da7044b8d33e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
To reproduce:
1. Start a meeting in Discuss or start a group conversation of V15, then try to leave this channel by clicking channel's x button in the page's left side `DIRECT MESSAGES` list.
2. After clicking `Leave` button in Confirmation dialog you will get Access Error prompt: Due to security restrictions, you are not allowed to delete 'Listeners of a Channel' (mail.channel.partner) records.
Cause and Solution: the computed field value:
Since in the middle of process, outdated.channel_id.channel_partner_ids doesn't contain current env.user, to bypass access rule restriction we need to use sudo().unlink()
closesodoo/odoo#88897
X-original-commit: b3d371a4380305a2ea8fd14c30432e6ddbd9cb35
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
There is an issue where we redirect to a list view/form view of
res.partner but with id's from res.partner.bank, thus redirecting to
the wrong views.
closesodoo/odoo#88865
X-original-commit: a1cce790fcd2d1823fb9e3d5c3c3e916d34568e5
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
- The dashboard list view is replaced by a kanban view.
- When you have a time off with a joined document when you click on it, the attachment view is now kanban and not list. The dropdown in the kanban card allows to download the file.
taskID #2658415 [Time Off] Mobile experience
closesodoo/odoo#84667
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Additional resources of a lesson content are displayed twice, once as a
link and an other time as a file
Steps to reproduce:
1. Install eLearning app
2. Go to the website
3. Go to Courses and open course 'Basics of Gardening'
4. Open the first chapter 'Gardening: The Know-How'
5. Exit fullscreen (on the top right)
6. In the course content, the file 'Document' is displayed two times and
the link doesn't work
Solution:
Display the resource as a link or file depending of its type
opw-2811279
closesodoo/odoo#88879
X-original-commit: 924c3e849f9f5b2408cefc913ee1d72243417feb
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
Follow-up of: https://github.com/odoo/odoo/pull/87597
This is the 2nd and final step of splitting public_livechat.js
into several files.
This is part of refactoring public livechat so that it uses
essentially the same codebase as discuss in the web client.
Splitting in smaller files helps following steps to refactor
the code.
Task-2818675
Part of Task-2212347
closesodoo/odoo#88654
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Observed Behaviour
When using a pricelist with a fixed price for all products with a different
currency than the one of the company, adding shipping cost in a sale order
using this pricelist will give a wrong value of the shipping cost
Expect Behaviour
The computed shipping cost added in the sale order should be the same as the
fixed price defined in the pricelist
Reproducibility
This issue can be reproduced using the following steps :
1. Define a pricelist PL1 with a fixed price for all products and a different
currency than the one used in the company (eg fixed price to 15KR)
2. Create a sale order and select PL1 as pricelist
3. Add a product and add a shipping cost
The shipping cost should be the defined fixed price (15KR) but it gives
another value, depending of the company currency
Fix Description
This fix remove a useless currency conversion coming from the fact that since
https://github.com/odoo/odoo/pull/86484 we get the delivery price from the SO
priceliste (using pricelist.get_product_price) giving us a price that is
already converted to the correct currency
Related issue/PR
opw-2810506
closesodoo/odoo#88861
X-original-commit: 25e2f403e88172d67ea6ce382ac1e3f5e0e37835
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Hendrickx Anthony (anhe) <anhe@odoo.com>
When setting acc_holder_name on the bank account receiving the payment of a QR-bill, acc_holder_name was used instead of the company's name inside the QR-code, but not on the summary text displayed next to it. This fix replaces the company name there as well. The behavior is unchanged when acc_holder_name isn't set.
closesodoo/odoo#88804
X-original-commit: e37d43d52d56e55291f9deb0eb76b5cd3863739e
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
This PR introduces multiple changes to improve potential inheritance regarding
products.
Purpose
======
Be able to sale products on eCommerce that have some specificities regarding
their price computation. For example, accommodation price depends on the duration
of stay, or rental product price depends on the duration of the rental.
Specifications
===========
This PR introduces some hooks or methods as :
- Add kwargs to price compute methods in order to give some additional parameters
- Allow adding optional parameters to product/cart rpc to give additional information
concerning product.
- Make the cart-quick-add button displayable with a given condition on the product.
- Regarding stock on eCommerce, improve the inheritance of the cart quantity and
the free quantity computation (which may depend on the temporality). It also allows
to increase the inheritance potential of the computation of the max quantity of products
that can be added to cart.
- The stock warning field is now added in the eCommerce module to allow other
eCommerce modules to take advantage of this message prompt.
task-2382027
See also https://github.com/odoo/enterprise/pull/23741
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#83359
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
SPECIFICATION
Before this commit when setting a forum which was already selected
by another course one got an error message when saving.
This commit avoid this error message by only displaying the forum
which have no course attached to them.
LINKS
Task-2791247
PR : odoo/odoo#86584
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps :
Install modules hr_holidays and google_calendar;
Log into Odoo with two different users, one manager and one employee (subordinated): f.e. Admin e Demo;
Set Google Client ID and Google Secret with a OAuth2.0;
Check if in Odoo's Calendar the Synched with Google tag compares on the right (with manager);
From employee user, go to Time Off -> My Time Off -> My Time Off Requests and Create with a date;
From manager user, go to Time Off -> Managers -> Time Off and accept the time off created;
Go to manager's Google Calendar.
Current behavior:
Google event is created and visible for manager, employee has an event since is an attendee of the first.
Expected behavior:
Google event is created and visible for employee, manager is not involved.
Fix:
Group the leaves with user and create events with this user.
We could not modify easily the behavior of the calendar sync modules.
The following approach was tested: odoo/odoo#86385
But it has some side effects on recurring events, oultier events
(events not following the recurrence) and could bring performance issues.
The solution of this fix was chosen because it is less intrusive.
opw-2761158
closesodoo/odoo#88607
X-original-commit: ce96dd4f7488ce66d3fda5fd09a4566424c52bd2
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Onockx Audric (auon) <auon@odoo.com>
Steps to reproduce:
- Set a new DB without demo data
- Install Ecommerce
- Switch language to Arabic
- Try to open website module
Issue:
Traceback raised.
Cause:
When generating random sample data for website dashboard, it will use
the current local to generate dates (in the given format), who in this
case have a non-latin numbering system, and therefore will break when
trying to parse field value.
Solution:
Use `serializeDate` or `serializeDateTime` to format datetime (with
`latn` as `numberingSystem`).
opw-2743243
closesodoo/odoo#88840
X-original-commit: 5597912ad65e0b98c498f95ba884b9581a737211
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
Co-authored-by: Nasreddin Boulif (bon)<bon@odoo.com>
Before this commit, the internal user can access to all milestones
created in Project app even if he has no access to the project related.
This commit adds the rules for the project.milestone to filter the
records when the user is not a Project Manager.
closes odoo/odoo#88819
X-original-commit: 6438d8e690229b27ab08ecac436e54a85096eb0f
Forward-port-of: #88546
Forward-port-of: #88509
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
Before this commit, the portal user can read the `project.update`
and `project.milestone` records but there is no reason to grant this
access for those models.
This commit removes the read access for thoses models since we don't
show the data in its portal.
X-original-commit: f0331531826974ddaab5dff28739115c37a351c0
Forward-port-of: #88546
Forward-port-of: #88509
Part-of: odoo/odoo#88819
The Credit Limit group on the res.partner record
doesn't appear until you save the record.
This means you have to perform extra clicks
if you want to edit this value.
The goal is to show the `credit` field on the accounting tab
on creation if `res.partner` is a company and
Credit Limit setting is activated.
task-2817650
closesodoo/odoo#88830
X-original-commit: 0ac5f58d4d4786a0b86bf0b71406d7d2c5d470bf
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: John Laterre <jol@odoo.com>
Instead of doing the difference between output tax and input tax, the tax report was doing the sum.
This commit fixes this computation without revamping the rest of the report
closesodoo/odoo#88774
X-original-commit: df0372a168db184c03fd901359fec6abd08f5bdd
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
Steps :
Create a Time Off Type T.
Create 2 Allocations :
> Type : T
> Start date : monday D
> End date : /
> Number of days : resp 4 and 1
> Employee : Admin
Create 2 Time Off Requests :
> Type : T
> Dates : resp monday D to thursday and friday to friday.
Validate both.
Issue :
Allocation's days taken are resp 5.0/4.0 and 0.0/1.0.
Cause :
We set allocation to leave before validating.
To do so, we take the alloc with max allocated days.
Fix :
Take the alloc with max days left = allocated - taken.
Recompute the allocation before validating,
to check that enough days are left.
opw-2812534
closesodoo/odoo#88773
X-original-commit: b0bace129e3f9a4876c2cefb2c24cbcb76d8b0c6
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Fix two issues linked to payment methods and their journal link.
SEPA Credit Transfer was marked as only available on EUR journals, but
from what we have been told, and we have seen, it should also be made
available for other currencies (CHF/SEK).
So we are changing the rule used to determine if SEPA Credit Transfer
is available on a journal to allow to use it on journals using CHF or
SEK as a currency.
There is another issue, where the filtering is done differently at the
journal creation and when the user add the payment method manually in
the lists.
The filter rules were not respected at the journal creation, which
would lead to incorrect default inbound and outbound payment method list.
For example, a new journal would have the company currency (let's say,
USD) but still have SEPA Credit Transfer (EUR,CHF,SEK) added on it by
default while it should not be available there.
opw-2777522
X-original-commit: 0ad8faf3bfc7b28e5668c3445fcc06c24ad98354
[FIX] account_*: payment method journal filter
Fix two issues linked to payment methods and their journal link.
SEPA Credit Transfer was marked as only available on EUR journals, but
from what we have been told, and we have seen, it should also be made
available for other currencies (CHF/SEK).
So we are changing the rule used to determine if SEPA Credit Transfer
is available on a journal to allow to use it on journals using CHF or
SEK as a currency.
There is another issue, where the filtering is done differently at the
journal creation and when the user add the payment method manually in
the lists.
The filter rules were not respected at the journal creation, which
would lead to incorrect default inbound and outbound payment method list.
For example, a new journal would have the company currency (let's say,
USD) but still have SEPA Credit Transfer (EUR,CHF,SEK) added on it by
default while it should not be available there.
opw-2777522
closesodoo/odoo#88677
X-original-commit: e2cd91ad8339f73b2547bc839e675443528f3adf
Related: odoo/enterprise#26172
Signed-off-by: Florian Gilbert <flg@odoo.com>
This commit adds hooks to give more flexibility and modularity.
It allows inherited modules to give their own definition of the cart
quantity and free quantity, which may be business specific (like for
rentals).
It also takes advantage of the definition of shop_warning in the
website_sale module.
This commit fixes a glitch when the wishlist message is displayed too
fast, faster than the stock message. The message is removed by the
promise in VariantMixin, _onCombinationChangeStock.
task-2382027
This commit adds hooks to give more flexibility on cart updates. It
allows to add parameters when a product is added to a cart. It gives a
method to disable the quick add and multiple hooks for further smooths
developments.
task-2382027
This commit adds an higher flexibility to pass optional args through the
price computation methods.
Those optional kwargs offer the opportunity to tune the price
computation, especially to tune the price_compute method on
ProductProduct and ProductTemplate.
On sale order line models, one can define some fields that should be
passed to the price_compute method in order to tune it.
task-2382027
Co-authored-by: Victor Feyens <vfe@odoo.com>
Current behavior:
When adding a "Heading" in the first 200 characters of a blog with
/Heading, the short description of the blog preview would have
unwanted stars (*) around the heading
Steps to reproduce:
- Create a blog article
- In the first 200 characters of the blog use a heading (e.g. /Heading1)
- Go back to the blog list, the description of the new article contains
unwanted stars (*)
opw-2798595
closesodoo/odoo#88352
X-original-commit: 6cb57d2f1ffb0adceaa3199cc0bf5140589d9328
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Before this commit, updating the voice activation threshold in one tab
would not affect the other tabs as the localStorage was only read when
discuss was initialized.
This commit fixes this issue.
task-2679234
closesodoo/odoo#88154
X-original-commit: 80c81c70787952eb4fdc4b81210bdf2893210e1a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
With l10n_nl, create a purchase journal -> traceback
Ids was appended to ORM command list, instead of the ids list.
Moreover, it was filled even if there were no missing value.
opw-2801012
closesodoo/odoo#88732
X-original-commit: 2d6d6e81f53239942f549b16b11faf1b8f77cf41
Signed-off-by: Florian Gilbert <flg@odoo.com>
Commit e834173314f00e36cb3a1f99690d9f220584682c fixed an issue where editable
elements could not be removed if they were nested in a non-editable element,
because the editor considered them to be an editable root.
However, the same logic also applied when doing a history step after adding
such an element. Adding a nested editable element would make the history step
invalid and result in a rollback.
Such a situation can be encountered when adding a recaptcha legal notice to a
website form. The footer of the form is a non-editable paet of the document,
however the legal notice can still be updated by the user. This commit adds a
separate test for the addition of such editable elements that were previously
considered unremovable.
opw-2723017
closesodoo/odoo#88733
X-original-commit: f693e8ed27f753a728d903dfe4d7d10ae1334526
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Prior to this change, if a contenteditable=true element was a child of a
contenteditable=false element, it was always flagged as unremovable=true.
In fact what should happen is that this.editable should be unremovable, but one
of its subchildren can be contenteditable=true while having a parent
contenteditable=false and not be unremovable.
Task-id: 2794990
X-original-commit: 72e2fd7439a0d6e44b5082def35079019371a3b7
Part-of: odoo/odoo#88733
Since [1] when the blog layout was refactored between 12.0 and 13.0, a
negative word spacing was introduced in the blog post snippet with the
big pictures layout.
This commit removes this negative word spacing.
[1]: https://github.com/odoo/odoo/commit/bb0cdec4594fab8c22265ed8af0c2d431a263b72
task-2822436
closesodoo/odoo#88729
X-original-commit: c0e86be9074a0d72e6119801c7992232e9e32068
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Steps to reproduce:
• Create Record: Product Category
- Costing Method: Average
- Inventory Valuation: Automated
- Specify a price difference account (may create new account).
- Ensure Stock Interim (Received) account is reconcilable.
• Create Record: Product
- Product Type: Storable
- Cost Price: 1.01
- Product Category: New Product Category
• Create bill with this product, for a quantity of 10.5
-> The is price difference of 0.1
Issue comes from this commit 286ea6b681e9ba77357f91b546052449f6342f20
which doesn't round if there is a discount.
With this commit we isolate the latter case in order to keep the
price unit rounded if there is no discount.
closesodoo/odoo#88734
X-original-commit: 643d91ef5ebfb29fde142294ced82c470d42c136
Signed-off-by: Florian Gilbert <flg@odoo.com>
Steps to reproduce:
- Install eCommerce module
- Select company A and set only one pricelist with:
- company = company A
- website = website of company A
- Select company B and set multiple pricelist.
- Switch to company B
- Archive a pricelist
Issue:
Error: "With this action, "Website of company A" website would not
have any pricelist available".
Solution:
Use sudo() when searching websites to don't use multi-company
compliant ir.rule `product_pricelist_comp_rule` (in website_sale) when
getting pricelist_ids (and therefore allow checking all pricelists for
all websites in all companies).
opw-2759069
closesodoo/odoo#88703
X-original-commit: 4b3404087f4541cf52b84ef668da4055da5ad9e2
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
When creating a global time off in one resource.calendar A , it will be
propagated on any new resource.calendar B.
However the reverse is not true, if I delete the global time off in
calendar A it will not be deleted in calendar B.
During the work entry generation this is not taken into account, a
contract using calendar A will generate leave work entries because of
the global time off in calendar B.
This is due to a change in PR odoo/enterprise#15091.
The domain is now correct and will only fetch the right leaves.
TaskId-2627378
closesodoo/odoo#88725
X-original-commit: 0bac1d33a25e37ebece69de030b9fd72caa43a02
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
A field order_id has been introduce on account.analytic.line
in https://github.com/odoo/odoo/commit/dc9ef81ab21cbbf232eca1771ab94dd5a54e9345
to allow to group by order
This field was introduce as related readonly=False.
It has the side effect of modifying the order_id on the sale.order.line
each time a timesheet is created and thus trigger computed field that
are based on that field.
Since the field is only declared for a group by it's pointless to
make it modifiable, it will save a lot a useless computation and avoid
some issue with computed field wrongly triggered
closesodoo/odoo#88714
X-original-commit: 6916e541d272fea64fbc49e451f065b9cd614134
Signed-off-by: Thibault Francois <tfr@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
This commit moves some handler methods from components to models,
as a step closer to having most of business code in models.
Having business code in models is desirable so that the code is much more maintainable:
easier to change and more robust code.
Task-2579306
closesodoo/odoo#88692
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit
At each iteration, the `loop_cycle_number` was reset to 0.
This caused the cycle condition to always be the same.
After this commit
The cycle condition will properly make the style cycle.
closesodoo/odoo#88686
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
On mass_mailing, the button does not have a specifc width.
Defining a width to the button makes the styling more predictible.
Task-2781002
closesodoo/odoo#88679
X-original-commit: 5f5b806559e06aad7f67b66c8da96d15516fcd52
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The overflow: auto on the container in mass mailing generated a
scrollbar whenever the drag and drop of snippets because
of the drop zones.
Task-2781002
X-original-commit: 2af04ad4798e11bb2c08798dddb04ed32c42992e
Part-of: odoo/odoo#88679
Reduce the content of the title to make sure it fits in a single line.
Task-2781002
X-original-commit: 2b87e5617c4cb25c6593df03b752f0c90814a7ff
Part-of: odoo/odoo#88679
A mechanism is provided by the OdooEditor to circumvent certain problems while
editing links. More specifically, editable zones are patched when editing a
link. This avoids the cursor ending up outside the link whenever the link tag
is emptied.
However, the mechanism does not check if the link is also in the editable zone
before doing so. In translation mode, the editable zones correspond to the
individual translation strings. When translating link texts, this means the
anchor tag containing the translation string is outside the editable zone. The
patching mechanism still applies, resulting in the anchor tag becoming editable
as well.
This causes problems while translating links, for example oDeleteBackward
commands are being rolled back. Checking if the anchor tag is inside the
editable zone resolves the problem.
opw-2780312
closesodoo/odoo#88674
X-original-commit: 99050b26446bbbe949e1fa797210c2a8a68d94cd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>