Commit Graph
158467 Commits
Author SHA1 Message Date
Mathieu Duckerts-AntoineandMathieu Duckerts-Antoine f3dfd9b651 [REF] web: Move orderByToString to views/utils.js
This commit moves the 'orderByToString' helper to views/utils.js.

Part-of: odoo/odoo#110819
Co-authored-by: Mathieu Duckerts-Antoine <dam@dooo.com>
2023-02-14 17:09:05 +01:00
a3dd93194f [IMP] web: introduce useVirtual hook
This commit introduces a hook named "useVirtual" which allows to filter
a given list of objects and return only those that are visible in the
current viewport. This effectively allows to use virtualization in lists.

The hook will trim down the list of objects it received to those that fit
in the current viewport (with a fixed margin above and under to allow
smoother transitions on scroll).

The following requirements must be met to use this feature:

- the scrollable area has a fixed height
- along with the list of items, a "getItemHeight" getter must be
provided to determine the actual height of each individual item;
- the items are rendered with a proper offset inside the scrollable area.
  This can be achieved e.g. with a css grid or an absolute positioning.

Part-of: odoo/odoo#110819
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-14 17:09:04 +01:00
Julien Mougenot 48bc5315da [IMP] web: Improve mockCopy and mockServer logging
This commit handles 2 things:

1. bring the mock server "copy" handler closer to its actual
implementation, supporting a second argument which is a dictionnary of
default values to be applied to the copied record;

2. make the mock server debug logs more readable, with a nice color code
(blue for requests, orange for responses) so that debug info are easier
to read in the console.

Part-of: odoo/odoo#110819
Co-authored-by: Julien Mougenot <jum@odoo.com>
2023-02-14 17:09:04 +01:00
Julien MougenotandMathieu Duckerts-Antoine d96b56f670 [IMP] web: Improve mockRead performance
This commit improves the performances of the mock server "read" handler
by reducing the amount of iterations performed on the current set of
records.

This was needed as some tests (namely: gantt manual performance tests)
mocked huge amounts of records and the main bottleneck was the mock
server, while the actual impact was supposed to be measured on the
rendering process.

Part-of: odoo/odoo#110819
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-14 17:09:04 +01:00
Audric Onockx (auon) aa250d3245 [IMP] project: improve and create task template for recurrence
The goal of this task is to ease the deletion/archiving of recurrent
tasks by giving the user the option to either continue
or stop the recurrence. The two main use-cases are:

\- You have a recurring task for a weekly meeting.
Next week, the user will be on time off. You are thus deleting the task.
However, you would still like tasks generated for the following meetings
and to keep track of the previous meetings.

\- You have a recurring task for a weekly meeting with an employee
that has just been fired. You are thus deleting the task and
you won't need this recurrence anymore.
(You may or may not want to keep track of the previous meetings.)

The main issue we are currently facing is that we need a task that acts
as a template for the recurrence to continue. This means that a user
cannot delete all of his tasks without breaking their recurrence.

Consequently, we will be using a "task template" for each recurrence,
which will only serve technical purposes and be invisible to the users.
When the recurrence is stopped, the task template is deleted.
This simplifies the technical and functional implementation as the user
won't be able to modify the template themselves.

\- Added task templates to recurrences in the data.
\- Deleted "all tasks" option form recurence update and changed "this
and following tasks" to "this and future tasks". Most of the time, the
user is going to update the most recent task, and it doesn't make
any functional sense to update past ones.
\- Same options for delete and archive.
\- No recurrent subtasks allowed anymore.
\- `date_deadline` is copied. We compute it by adding the delta between
the create date and the `date_deadline` of the template to the next
recurrence date.
\- Added filter to several view not to display task templates.

task-2937565

closes odoo/odoo#98088

Related: odoo/upgrade#4232
Related: odoo/enterprise#30416
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-14 17:08:49 +01:00
Kevin Baptiste 901e3814fc [IMP] hr: allow users to manage plan activities
When starting an onboarding/offboarding plan on an employee, activities
were only created for the users that were part of the HR Officer group.

Regular users can't access the `hr.employee` model and it's not possible
to have activities on `hr.employee.public`.

A new model has been created to manage those activities and is only
accessible to the user and their manager.

task-3151758

closes odoo/odoo#111505

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-14 15:52:03 +01:00
Maruan Aguerdouh (magm) c3ee7c8780 [FIX] sale_timesheet: description field of timesheet line fits to parent
Steps to reproduce:

- Install Sales, Project, Timesheets.
- Go to a task inside Project, and to the Timesheets tab.
- Create or modify a timesheet line, and write a very long description.

Issue:

The description field of the timesheet line is not fitting to the parent
instead is fitting for the content inside description making the table
bigger than it should.

Solution:

We have a custom widget for timesheet_ids field when we have
sale_timesheet and the widget is missing the `o_field_one2many` class.
So we add the proper class to the component with `TimesheetsOne2ManyField`

opw-3145298

closes odoo/odoo#112631

X-original-commit: e73d7c4c3cddabdbb5d175681cbfe3789d846239
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
2023-02-14 14:37:54 +01:00
FrancoisGe 45ef57bedc [REF] web: convert Record.formattedRecord to utils
To evaluate the KanbanRecord and the ActivityRecord, a formattedRecord is passed.

What is a formattedRecord:

Before this commit:
The base record + all its fields with the keys value and raw_value.
formattedRecord = {
    ...Record(),
    field1: {
        value: ...,
        raw_value: ...,
    }
}

After this commit:
All its fields with the value and raw_value keys.
formattedRecord = {
    field1: {
        value: ...,
        raw_value: ...,
    }
}

This modification avoids giving access to the functionality of the Record
class directly in the arch. The arch should never have access to the
internals of the Record.

closes odoo/odoo#112618

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-14 14:37:51 +01:00
FrancoisGe d4c60f233c [IMP] web: aggregate value for displayed columns
The purpose of this commit is to no longer calculate the aggregated
value of columns that are not displayed in the list view.

Before this commit, we always calculated the aggregate value of optional
columns that are hidden.

closes odoo/odoo#112542

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-14 14:37:48 +01:00
Antoine Guenet a8581ddca6 [FIX] web_editor: fix triple click on block followed by empty block
Triple click correction failed whenever the triple-click-selected block
was followed by an empty block. The reason is that `getDeepestPosition`
prevents the selection from being placed within a line break (`<br>`)
and therefore returns the block itself (`<p>[]<br></p>` will be
expressed as `(p, 0)`), so the heuristic to determine if triple click
correction in needed in `getDeepRange` would fail as it assumed the
`end` node was a leaf where it wasn't. This fixes the issue by applying
the heurstic to the first leaf of the `end` node instead, and making the
correction for there as well.

task-3180922

closes odoo/odoo#112637

X-original-commit: 81653c320a1e431e4b9ae831bf0b8522588368e6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-14 13:14:04 +01:00
Aaron Bohy dad8de3863 [REF] base: remove checks on non existent context keys
Those keys have no match in the codebase.

closes odoo/odoo#112613

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2023-02-14 13:14:01 +01:00
Bruno Boi b8b42d5a49 [FIX] web: pivot,graph: usesamplemodel to false
After a model in sample mode has fetched sample data, its orm is reset
to be the "true" orm (standard orm service using the real server (prod)
or the mock server (test)). Thus any change in the view parameters that
imply to fetch data will lead to fetch "true" data (possibly none) and
thus present "true" data in the view. The problem is that the graph and
pivot views did keep the class .o_view_sample_data in that case.
Here, we make sure that that class is removed at an appropriate time.

closes odoo/odoo#112612

X-original-commit: ae6ec8dcfb24b86743e3ee14ae2526b4f8b681b9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-14 13:13:58 +01:00
niyasraphy b0c7d888c5 [IMP] fleet: add form view for fleet.vehicle.cost.report model
before this commit, form view for the model fleet.vehicle.cost.report model was not defined, thus on opening the form view of this model shows odoo generated form view.

after this commit, as the form view is added for the model, on opening the form, clean form will be displayed.

also in the file, there is a record with wrongly aligned corrected that and set create="0" attribute in tree to hide the new/create button.

closes odoo/odoo#110450

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-14 13:13:53 +01:00
Jordan D. (Joda) 1d1e8e4ae2 [FIX] account: set default value on journal_id in accrued order wizard
When creating an accrued revenue entry, the same journal will always be
selected by the model (by default: Miscellaneous Operations) even after
selecting and confirming another journal in the view form. This is due
to the computed field that always take the same journal. Converting the
computed function to a default function resolve the issue.

related PR: #109058

opw-3076067

closes odoo/odoo#109516

Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-14 13:13:50 +01:00
jbw-odoo a11f402d6b [IMP] sale: down payment tax breakdown
Break down payments down per tax. When creating a down payment for a sale order, create one line per tax instead of one line for the enire order.

[Sale Order]
Product    Qty  Unit price    Tax   Subtotal
Product1   1    1000          10%   1000
Product2   1    1000          5%    1000
                                    ====
                            Untaxed 2000
                                Tax 150
                                    ====
                              Total 2150

Make a 50% (1000) down payment :

[BEFORE]
Product    Qty  Unit price    Tax   Subtotal
Product1   1    1000          10%   1000
Product2   1    1000          5%    1000
Down pay   1    1075                0
                                    ====
                            Untaxed 2000
                                Tax 150
                                    ====
                              Total 2150

[AFTER]
Product    Qty  Unit price    Tax   Subtotal
Product1   1    1000          10%   1000
Product2   1    1000          5%    1000
Down pay   1    500           10%   0
Down pay   1    500           5%    0
                                    ====
                            Untaxed 2000
                                Tax 150
                                    ====
                              Total 2150

closes odoo/odoo#105177

Task: 2678531
Related: odoo/enterprise#36331
Signed-off-by: Laurent Smet <las@odoo.com>
2023-02-14 13:13:47 +01:00
jbw-odoo 7510dc477d [IMP] sale: alert if draft inv on make invoice wizard
Show alert on make invoice wizard if any invoice is still in draft state as draft invoices (and downpayments) will be taken into account into the computing of the amount when creating a new invoice

Task: 2678531
Part-of: odoo/odoo#105177
2023-02-14 13:13:47 +01:00
jbw-odoo bae9382896 [IMP] sale: downpayment is always % of total
When computing a downpayment amount with "percentage" method, always compute the % from the total amount.
See https://github.com/odoo/odoo/pull/64706#pullrequestreview-571089596

Task: 2678531
Part-of: odoo/odoo#105177
2023-02-14 13:13:46 +01:00
Rodopho Cammarosano de Lima (rcdl) 0a77f3279f [FIX] web_editor: fix unbreakable rollback upon column number change
When wrapping the contents of a paragraph into a newly created div, the
nodes' ouid (unbreakable id) must be reset in order to prevent a
"unbreakable" rollback.

This commit makes such property reset and fixes errors related to changing
the number of columns of a text snippet.

task-3165895
opw-3137951

closes odoo/odoo#112521

X-original-commit: e33b802b05b41df20e13ebc44bc5b78edae50bb8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-14 12:13:49 +01:00
Aungkokolin1997 d5e0475097 [IMP] purchase: display description of tax in purchase report
closes odoo/odoo#112431

X-original-commit: 57f6ec7b9fd1497cb4296539dbfa253c1c876bdc
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-02-14 11:08:48 +01:00
Jordan D. (Joda) b12e8fd338 [FIX] base: fix write deny while creating new contact
How to reproduce
================

1. Create a user with lower privileges then admin
2. Add a new company and a new contact of that company in the contact
   app at the sametime
3. Manually save

This will result in a write access denied

opw-3127591

closes odoo/odoo#112595

X-original-commit: 93a37df79fc30c2f9ac31d60dc897452851fd5bd
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-02-14 10:02:30 +01:00
niyasraphy c7360ebcab [FIX] sale: remove quick_add from sales calendar view
before this commit, on clicking the sales calendar view, it allows the quick adding from the calendar view and entered value is going to the name field of sale.order model.

after this commit, quick adding will be disable and on clicking form will be opened with selected date.

closes odoo/odoo#112587

X-original-commit: b82c59bdaffb731172eeb36954e5e46907ac9fcc
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-02-14 10:02:28 +01:00
Rodopho Cammarosano de Lima (rcdl) f60e8faaca [FIX] web_editor: fix issues caused by textContent
Issue #1: reading textContent

When reading the textContent property of an element, its does not take into
account line breaks introduced by <br> and block elements, whilst innerHtml
does.

This commit solves the issue of updating a link's href to a non-sense url
upon label change. Before this commit, "www.abc.com <br> www.xyz.com" was
being incorrectely parsed as "www.abc.comwww.xyz.com".

Issue #2: setting textContent

When setting the textContent property of an element, all of its child nodes are
removed and replaced by a single text node. While this is fine when the
element contains a single text node, it might not be the desired result when
the element contains other children.

This commit solves the issue obtained when pasting html such as
"link.com<br>link.be" inside an empty inline element such as STRONG or A,
in which cleanForSave was changing its content (removing the line-break) due
to misuse of textContent, when the intended effected was simply removing
ZeroWidthSpace characters. A safer alternative for removing ZeroWidthSpace is
thus provided.

task-3081254

closes odoo/odoo#112579

X-original-commit: 9ff7c2ccff5f959f2a1cd7334c42b7bf0134f5d2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-14 10:02:24 +01:00
Aaron Bohy 0639a99a9a [FIX] web: fix typo in X2ManyField props definition
Before this commit, the "addLabel" and "editable" props type was
not really tested.

closes odoo/odoo#112583

X-original-commit: bb060d012ff9dfe07fa75c851feafc0af2bfc0b5
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-14 09:00:56 +01:00
aliya a105af636f [IMP] l10n_br: translate the module into English
This commit replaces terms in Portuguese with English translations,
and moves the original Portuguese terms into pt.po translation files.
This makes it easier to maintain the module.

task-3116558

closes odoo/odoo#109205

Related: odoo/enterprise#35473
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-02-14 09:00:49 +01:00
Christophe Monniez 7255819659 [FIX] mass_mailing: use a sequence for random sampling
Since Python 3.11, sampling from a set deprecated, the population must
be a sequence.

This commit applies the suggested fix.

Also, the filtering of the deprecation warning about sampling from set
can be disabled when the python version is not 3.9. This warning was
wrongly triggered since 3.9 because recordsets are bot a sequence and a
set.
This was fixed in python 3.10, see https://bugs.python.org/issue42470

closes odoo/odoo#112450

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-14 08:03:24 +01:00
Christophe Monniez 56bb6d5b32 [FIX] base: allow patching of config.options for 3.11
Since python/cpython#18544, unittest mock is not able to properly find
the "odoo.tools.config".

When trying to patch the `options` dictionnary, it leads to
`AttributeError: module 'odoo.tools.config' has no attribute 'options'`

In order to have the tests
working in python <= 3.11, we have to import the config module and patch
the options in place.

Part-of: odoo/odoo#112450
2023-02-14 08:03:23 +01:00
Christophe Monniez a3dffa86f5 [FIX] base, tools: use getlocale vs deprecated getdefaultlocale
As getdefaultlocale is deprecated in 3.11 in favor of getlocale which is
available since at least 3.0.

Part-of: odoo/odoo#112450
2023-02-14 08:03:23 +01:00
Pierre Masereel 1e35315399 [FIX] odoo,base: new Python 3.11 opcodes
When python expression is evaluated in odoo form an action or qweb, we
are checking the opcodes generated by the evaluation of this code. We do
such a verification, because the code from actions and templates can be
written by someone having not access to the server and we don't want to
let them perform actions out of the scope of their database.

In python 3.11, some opcodes from previous versions of Python have been
renamed, grouped or sepcified. There are also new ones that have been
introduce.

In this PR, we are whitelisting the new ones that are needed by odoo to
properly work in this version of Python.

Part-of: odoo/odoo#112450
2023-02-14 08:03:23 +01:00
Dylan Kiss (dyki) 8095e3f1e2 [FIX] base: change US tax id label
Since 16.0 the `Tax ID` field label is dependant on the company country.
For the US we chose `EIN` as the label.
Since there are multiple sources of tax ids in the US, it is better to leave it as the default: `Tax ID`.

task-3162675

closes odoo/odoo#112561

X-original-commit: f6846f5b9dcae6a0a9e26f3b847593a2e8a3222b
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-14 00:43:00 +01:00
Abdelouahab (abla) 82e17cff03 [FIX] account: print image in pdf
To Reproduce
============
- create a vendor bill and add an image as attachment
- print Original Bill -> the generated pdf can't be loaded

Problem
=======
when trying to add an image attachment to pdf report, the image needs
a special process.

Solution
========
add the image processing when printing pdf
fix inspired from 15 [commit](https://github.com/odoo/odoo/commit/b82a6cdea21a66588ddcafcdfb5026ec22546745)

opw-3127535

closes odoo/odoo#112596

X-original-commit: 41c79f66cfb5cdb558110d32842198157932397e
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-13 23:42:06 +01:00
Thibault Delavallée 03aa01aff7 [FIX] portal: fix recipients computation override
Portal defines the 'portal.mixin' that overrides a method from 'mail.thread'.
However no explicit inheritance is given between those two mixin. Some Odoo
models notably inherit from 'portal.mixin' and not from 'mail.thread'. It
makes no sense to override a method the model does not explicitly inherit.

In this commit we move the override on 'mail.thread' by checking the model
also inherits from 'portal.mixin' before doing portal-specific computation.
This fixes tests introduced previously.

Task-3175768 (Mail: check inheritances / overrides)

closes odoo/odoo#112573

Related: odoo/enterprise#37039
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-13 22:46:42 +01:00
Thibault Delavallée c70662b6c6 [IMP] test_mail_full: add tests for portal inheritance of thread features
Purpose is to add tests as there are some broken overrides in mail.thread
inheritance mechanism.

We see notably that bad override in portal make some override not being
called correctly.

Task-3175768 (Mail: check inheritances / overrides)

Part-of: odoo/odoo#112573
2023-02-13 22:46:41 +01:00
Julien Castiaux 36ef9cb30f [FIX] core: WatchedFileHandler compat for 3.7
Fine tuning of 8eaac97, the `errors` attribute was added in py38[^1]

[^1]: python/cpython@ca7b504a4d

closes odoo/odoo#112588

X-original-commit: c6c19ff6a3093fe64035d9f970ab35522f8080f5
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-02-13 21:28:15 +01:00
Ivan Yelizariev fa60348883 [FIX] web: properly handle error on copying link to clipboard
Promise error cannot be caught by try-catch, because execution doesn't happen
immedialty. Instead, `Promise.catch` must be used.

STEPS:

* Login native app
* Sales -> Quotation -> Open any quotation
* Action Button (cog icon) -> Share
* Click on Copy Button -> a Traceback appeared

opw-3077859

closes odoo/odoo#112584

X-original-commit: 9cdcd1c1f7219030386d2c90205ea083eb835a13
Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-02-13 21:28:11 +01:00
luvi 48b8242d6f [FIX] web: fix placement of add icon in ExportDialog
This commit fixes the placement of the add icon that could be on top
of the next line in the export dialog, when the name of the field was
too long. This overlapping prevented to press the button of the next
line. This is due to a fix made in commit (1). Now, it is correctly
displayed without overlaying, both in ltr and rtl directions.

Also, because there was not enough padding and some browsers are using
overlay scrollbars on top of the buttons, it was in some occasions not
possible to press the buttons, because the scrollbar was covering the
whole area. In the list of fields, only the first level of elements has
the padding, to avoid having a cascade style when unfolding items.

Static props have also been added to the component, as the component was
introduced without them.

(1): https://github.com/odoo/odoo/commit/f10a4886d2c2bfc0d4643e0e4597e62c2ba4f94e

closes odoo/odoo#112570

X-original-commit: 66207b9ffc353bd52993622cc528494b49eedc27
Related: odoo/enterprise#37037
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-02-13 21:28:08 +01:00
Pierre Rousseau ac6db52173 [FIX] web: pivot view: use correct label for headers
Before this revision, the pivot view used the wrong label for the
headers in the case of the group by value was "0". This was due to
the use of the falsy value of the group by value to determine if
the label should be used or if the label should be "Total".

closes odoo/odoo#112571

X-original-commit: 97db8c975643bb79e95f7506da03c7142651a3cf
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-02-13 20:13:04 +01:00
Tommy (tong) d837d0b4e2 [IMP] hr_work_entry: allow change initial date to view work entries
- Add a new variable to view the initial date in calendar view.

closes odoo/odoo#112548

X-original-commit: e63993764d7e7206ed0bb97de30964b4776d6adb
Related: odoo/enterprise#37031
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-13 19:17:13 +01:00
Antoine Guenet 056af045be [FIX] web_editor: properly copy tables
A syntax error sometimes caused a traceback when copying a table.

opw-3166159

closes odoo/odoo#112562

X-original-commit: 7fdeced319902e26ce33b5ffd0dd08957c484eb4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-13 17:26:16 +01:00
amdi-odoo 2e6ae86c58 [FIX] website_slides: prevent stat button action
Purpose
=======
Prevent the 'Visits' stat button of the Course to
open any content action.

Task-3163777

closes odoo/odoo#112560

X-original-commit: ed064682a1e4aa8131665194a516a0a6652b74f9
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-02-13 17:26:11 +01:00
Audric Onockx (auon) cb459faa3b [FIX] project: allow computation of recurrence message when yearly
Steps:
Enable recurrence feature.
Go to Project > Office Design > Customer Review.
Enable recurrence on this task > Change month to year.

Issue:
Crash.

Cause:
`_get_next_recurring_dates` is called without a `repeat_month` arg.
Is is supposed to be a string which is going to be found in MONTHS keys.
Except it is False and so it is not in the list.

Fix:
If we don't receive it, deduce it from `date_start` arg.

closes odoo/odoo#112506

X-original-commit: 566c4904129dc7e81458871656d9b20b19b36246
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Audric Onockx (auon) <auon@odoo.com>
2023-02-13 17:25:54 +01:00
aliya b305899880 [IMP] account: improve expected payment dates with payment terms
Changing the expected payment date for an invoice with several installments is unclear, as there's no clear indication of what is expected when, except in the aged report.
This commit:
- Changes the default label of journal items if there is a payment term that splits it into several installments. Each journal item will now have "installment #<number>" appended to it.
- The installment label is added on all types of moves.

task-3137957

closes odoo/odoo#110955

Related: odoo/enterprise#36266
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-13 17:25:50 +01:00
Patrick Hoste 3e5f84cff3 [IMP] website_slides: add sanitize_overridable to html_content field
Following this PR odoo/odoo#97398 website_slides module was forgotten
This commit add 'sanitize_overridable' parameter to the html_content
field. This will allow one to use the embed snippet in an article
type slide.

Task-3134690

closes odoo/odoo#112534

X-original-commit: 627833e77eb8f7ef7850f1fdeeb115ee8870c7f9
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-02-13 16:20:56 +01:00
Maximilien (malb) c9e26ac79a [IMP] l10n_cl: translation
Before this PR, all this localisation was written in Spanish, but all the localisation have to be written in english and then translated back in the native language. This PR correct that.

closes odoo/odoo#112160

Task-id: 3166093
Related: odoo/enterprise#36801
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-13 16:20:52 +01:00
Arnold Moyaux a022fefbaf [FIX] purchase, purchase_stock: add price difference account
Version 16.0 removed the price different account following this pull request #99411

This decision has been made because it was only used anymore by standard cost method and real time valuation.
We thought that standard was not a valid accounting method and we didn't want to maintain code for it.

But:
- Standard could be valid if you manualy complete the accounting entries
by yourself (e.g. employees/machines cost in mrp).
- It's also valid if you record the difference between standard price and
vendo price (price diff)

If you want to have an estimation of your cogs (benefits and loss) during an
accounting period. People just do a manual correction at the end but they have
a real time reporting on the situation.

It's a too big regression to be acceptable. We apologize and reintroduce it for
16.0 and future version.

This PR reintroduce the fields in purchase and the fix module in 16.0 is
not needed anymore.

closes odoo/odoo#109924

Related: odoo/upgrade#4315
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-13 15:15:34 +01:00
svs-odoo 1547d66585 [IMP] stock_dropshipping: new picking type code
Adds a new picking type code, 'dropship', and adds a new action/menu
item to display only the dropshipping's operations.

task-3076044

closes odoo/odoo#109511

Related: odoo/enterprise#35613
Related: odoo/upgrade#4252
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-02-13 15:15:10 +01:00
svs-odoo 5f9ff7d442 [IMP] product_expiry, stock: toggle tracking
In the Inventory's Configuration, the option to enable expiration dates
depends of the activation of lot and serial numbers.
But if the user disables the tracking and the expirations dates were
enabled, they still are.
Also, if the module `product_expiry` is installed directly, the tracking
numbers aren't enabled alongside.

To fix that, this commit modifies the `res.config.settings` onchange
`_onchange_group_stock_production_lot` to disable automatically
expiration dates when tracking is disabled, and this commit also adds a
hook in the `product_expiry` init to enable tracking numbers at the
installation.

Part-of: odoo/odoo#109511
2023-02-13 15:15:09 +01:00
svs-odoo ae5ccb6ffc [IMP] stock: update product quantity on hand
Now, the button "Update Quantity" and the stat button "Qty. On Hand" on
the product's form view will both call `action_update_quantity_on_hand`,
which who can call `action_open_quants` is an advance option is enable
(multilocation, owner or package) or if the product is tracked by lot or
serial numbers.

Also, displays the product's UoM in the `stock.change.product.qty`
wizard and changes its style so labels have more space.

task-3076044

Part-of: odoo/odoo#109511
2023-02-13 15:15:09 +01:00
svs-odoo 0e71e350e3 [IMP] product,stock: packaging product id
Makes the `product.packaging` `product_id` required in the model instead
of the view only, since a packaging is supposed to always be relative to
a product.
Edits some views to add the default product in the context and makes the
field readonly if there is no `product_id` (that way, the user can't
no more create packaging without product).
Also, removes the domain in the action to display the packaging list
view so the user can see if there are some packagings without product
and can eventually delete them.

task-3076044

Part-of: odoo/odoo#109511
2023-02-13 15:15:09 +01:00
svs-odoo 4c4e18091b [IMP] barcodes: remove rule name size limit
task-3076044

Part-of: odoo/odoo#109511
2023-02-13 15:15:08 +01:00
svs-odoo 656d8ace87 [IMP] stock: backorder confirmation
In `_check_backorder`, changes the condition so it checks if the qty
done is enough compared to the actual reserved quantity (instead of the
demand).
Also, removes an unused bloack of code and makes minor visual changes.

task-3076044

Part-of: odoo/odoo#109511
2023-02-13 15:15:08 +01:00