Commit Graph
158790 Commits
Author SHA1 Message Date
Morgane (morm) f37e089c8a [IMP] web_editor: floating bar and commandbar scss review
Prior to this commit, there were functional issues for the floating toolbar
and design issues for the Powerbox in the web editor.

This commit fixes those issues, like alignement for the icons in the list
of the commandbar, box shadows, and the responsiveness of the floating
toolbar on mobile.

In commit [1], the toolbar dropdown had the display static added, but it
causes problems to the responsiveness.
This commit put the display back to dynamic on the dropdown and so, fixes
the dropdown not showing on mobile because of the overflow-x on auto.
The dynamic state also allows the dropdown to change direction (dropdown
to dropup) when there's not enough space for the content of the dropdown.

Would be nice to have : use display state on the all the editor
toolbars (frontend and backend) to modify the layout of the toolbar for
mobile, for a better behavior and design (ex: the different lists in a
dropdown).
For now, it's just a horizontal scroll.

[1]: 459d4e27a8

task-3087826

Part-of: odoo/odoo#110161
2023-02-24 18:16:04 +01:00
Anita (anko) 1d846c36d9 [IMP] payment(_*): allow specifying extra allowed states
Some providers require additional allowed states due to their refund or
transaction process justifying it. Until now, these extra states were
specified in the `payment` module, which was not ideal as it allowed
every provider in every flow to accept these additional states.

With this commit, additional states are now specified only in the
coresponding flow of a provider that requires them.

task-2869678

closes odoo/odoo#107110

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-24 18:16:00 +01:00
snd 4ab6f383e1 [FIX] mrp: translate blocking reason
Blocking reasons on workorders are not translatable, this fixes that.

closes odoo/odoo#113641

Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-02-24 17:13:13 +01:00
amdi-odoo deaf9939b5 [IMP] survey: add every question type filters
Purpose
=======
Improve the results page filter to allow the filtering
on questions of type text_box, char_box, numerical_box,
date and datetime.

Specifications
==============
Updating the URL filters representation to avoid passing the
question types directly in the URL parameters.

Answer matching per question type:
- char_box, text_box: 'ilike'
- numerical_box, date, datetime: '='
Adding a new filter restricts the current filter results.

Handling the filters depending on the 2 different answer models:
'survey.question.answer': matrix, simple_choice, multiple_choice
'survey.user_input.line': char_box, text_box, numerical_box, date,
datetime.
The filters can be combined but their query count doesn't add up
if their related answers data are stored in the same model.

Task-3138245

closes odoo/odoo#110252

Related: odoo/enterprise#36383
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-02-24 17:13:05 +01:00
Sébastien Geelen (sge) aa252adf4f [ADD] web,mail : new dynamicplaceholder tour
Add a tour that test the basics of the dynamic placeholder
dropdown functionality.

task-3081325

closes odoo/odoo#109326

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-24 16:09:45 +01:00
Sébastien Geelen (sge) eae20c47eb [REF] web,web_editor,mail : dynamicplaceholder hook
Refactor the Dynamic Placeholder hook to have better
separation of concern from the Field that need it.

task-3081325

Part-of: odoo/odoo#109326
2023-02-24 16:09:45 +01:00
Sébastien Geelen (sge) 3e5d16967f [FIX] web_editor: strip history ids in isDirty
The presence of the history ids in the html resulted in false
positive in the  `_isDirty()` comparison. This lead to unwanted
writes when switching records, even when no change were made.

task-3186072

closes odoo/odoo#113633

X-original-commit: dcd3a538ecd4d7dc35bd7de6a8e2655e7392660a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2023-02-24 14:20:41 +01:00
Julien Van Roy 6938ff40d0 [FIX] account_edi_ubl_cii: float_repr should not be used for rounding
The `format_float` function is calling `float_repr`, which should not be
used for rounding operation (see its docstring). Instead, we should use
the `float_round` function.

opw-3171987

closes odoo/odoo#113631

X-original-commit: 0267c0d11ad1a5882aa5520bbf9455156b83149c
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
2023-02-24 14:20:38 +01:00
Mathieu Duckerts-Antoine 965fed0cd6 [REF] *: add dialogService in setupControlPanelServiceRegistry
From a practical point of view, it seems better to also add the
dialog service in the service registry when calling
setupControlPanelServiceRegistry.

closes odoo/odoo#113610

Related: odoo/enterprise#37510
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-24 14:20:30 +01:00
Benoit Socias dafb99681d [FIX] website, website_sale: prevent Chrome from selecting hidden tabs
When selecting the content of a tab with Chrome, if the selection
reaches the end of the tab content and there is additional content after
the Tabs snippet, the selected range also includes the next inactive
tabs that are hidden. Because of this, when replacing that selection,
the next inactive tabs are removed, and the Tabs snippet is corrupted.

This commit avoids this by including the `.tab-pane`s in the read-only
areas while including its `.oe_structure` in the content-editable areas.
This makes the selection adjustment mechanism stop within the active
tab pane.

Steps to reproduce:
- Use Chrome.
- Drop two Tabs blocks inside a web page.
- Select the first tab of the first one.
- Select the last word, including the dot. (Double-click the word and
  drag beyond the dot before releasing the mouse button.)
- Change the selected text's color.
=> The content of the second and third tab also had the chosen color.

- Select the text in the first tab with a triple click.
- Type something to replace the text.
=> The content of the second and third tab were removed and clicking
on the tab's header did therefore not reach them anymore.

opw-3117305

closes odoo/odoo#113624

X-original-commit: fd57dae13179c286da99749e77a3b26efd2f73f2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-24 13:17:06 +01:00
Thomas Lefebvre (thle) 5b709043af [FIX] hr_expense: add label for total amount company field
Steps to reproduce:
Create an expense with a product which has a cost.

Issue:
There is no label that explains the amount displayed.

Solution:
Correct the label display.

opw-3132937

closes odoo/odoo#113623

X-original-commit: e1a90c39111a0210d043d6708fd283af720bd128
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-02-24 13:17:04 +01:00
Frédéric Garbely 2cfdbef535 [CLA] Clean-up of the CLA for brain-tec AG.
Renamed brain-tec.md to braintec-group.md and removed the contributors who never contributed.
Created a new file braintec.md and added the currently needed contributors there.
Due to our rebranding and the associated change of the domain, this adjustment was necessary.

closes odoo/odoo#113619

X-original-commit: a1dab0536744086297d5d7407dc9ba873c8e8117
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-24 13:17:01 +01:00
Noe Antoine a547f73df7 [IMP] crm_iap_mine: clean views from lead generation button
Remove the "generate leads" buttons from most crm lead views:
we do not show buttons if active_model is set to something else
than crm.lead. It is both done in the kanban and in the list views.

Some create are also set to False.

Task-3107232

closes odoo/odoo#108445

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-02-24 13:16:56 +01:00
Victor Feyens aefbb3d17c [CLN] product: style pass on split files
closes odoo/odoo#113612

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-02-24 12:14:45 +01:00
Victor Feyens efbe5d837e [MOV] product: split product_attribute.py
Part-of: odoo/odoo#113612
2023-02-24 12:14:44 +01:00
Jinjiu Liu a211b7bf02 [FIX] web: don't reset column size in list view after resizing
Reproduction:
1. Install Sales
2. Go to the quotations
3. Drag the column “name” and change the size
4. Check any sale order in checkbox
5. The column size is reset to default

Reason: the keepColumnWidths parameter isn’t set to True after changing
the size. This happens to all the list views

Fix: we freeze the list after resizing the columns. Remove the extra
keepColumnWidths setting in reordering since it's already set to true
after resizing. Also added tests to check the column size is kept after
toggling the checkboxes

A similar fix is here: https://github.com/odoo/odoo/pull/10902

opw-3113822

closes odoo/odoo#113607

X-original-commit: 30a346a90b633dd73fa823de2cdaf37a0e52c526
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Liu Jinjiu (jili) <jili@odoo.com>
2023-02-24 12:14:41 +01:00
xO-Txandqsm-odoo 1096ed7b5a [FIX] web_editor: prevent async code on link tools update
Starting from [1], the `_updateColorpicker` method was added on the
"link tools" widget to update colorpickers with the selected link colors
(and it will create the colorpicker for each CSS property on widget
`start`).

Following this update, the code on [2] and [3] added some fixes to
handle the async parts of `_updateColorpicker`. [3] was done very
recently, more than one year later after the introduction of [1]. It
turned a synchronous method into an asynchronous one (rightfully
considering the async calls to `_updateColorpicker` that were inside).
As a fix, this commit will try to re-made it a synchronous method, and
other parts related to `_updateColorpicker` too.

The goal of this commit is to separate the link tools colorpicker
"creation" code (`_addColorPicker` now) from colorpicker's "update"
code. These changes are supposed to fix a race condition issue that
appeared on 16.0, but since the code is the same on 15.0 and subject to
the same issues, we target 15.0 with this fix. Hopefully, this prepares
for an easier refactoring in master.

[1]: https://github.com/odoo/odoo/commit/26d37812f0217ae913c8ddf761bcb26b5c44bff5
[2]: https://github.com/odoo/odoo/pull/78301/commits/6f1a6b76642db2e4f81cf3474ad0ec745a4bb3c9
[3]: https://github.com/odoo/odoo/commit/d15fdca644ef9ed1dfb011d3790f403e0157f55b

runbot-5753

closes odoo/odoo#113510

X-original-commit: 2d4a3efe0d7c9618c388575b4bb652a26913fe68
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2023-02-24 12:14:35 +01:00
Andro Gvivradze 385721586e [IMP] website_slide: add slide count and completion time to categories
This commit intends to add information about the number of slides,
as well as the time needed to finish said slides to the slide sections.

We now also round completion time values up to minute when getting said values
from youtube, google drive or vimeo.

In addition, we add responsible, course and tags options in the search bar.

Task-3054391

closes odoo/odoo#107507

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-02-24 12:14:32 +01:00
Martin Trigaux a17e44aad3 [I18N] l10n_it_edi: correct translation
Courtesy of Marianna (cima)

closes odoo/odoo#113595

X-original-commit: b8f65c0ecb1680c3f30c007454f92b6d135f585f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-24 11:11:43 +01:00
Martin Trigaux cd10bee519 [FIX] transifex: still support old .tx/config format
If one of the theme was not migrated to the new tx api, still support
the previous notation.
Happened on the design-theme repository

closes odoo/odoo#113571

X-original-commit: a8355ba3dddb5f3c8a8e8e777aff85d558410971
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-24 11:11:40 +01:00
Xavier-Do 723c0c24f6 [FIX] models: remove set iteration
A set iteration was creating a random number of queries on some tests.
This was noticed in TestEventPerformance were a random additionnal query
 could appear in default_get depending on _get_description and
_get_default_stage_id order.

This commit uses a list to get a deterministic order. It looks like
the set was not useful anyway.

closes odoo/odoo#113563

X-original-commit: 13572df256ccc6351588851d385c381ace155e0d
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-02-24 11:11:37 +01:00
Aaron Bohy 9374a6f2b7 [REF] *: js fields: extractProps receives fieldInfo
This commit is part of the preliminary work to rewrite the form,
list and kanban model. We want this new Model to only be aware of
field related information it needs (whereas in its current
implementation, the model stores all the information extracted
from the field node in the arch). This would allow to properly
manage multiple occurrences of the same field in views, that is,
each occurrence would be represented by a field component (if
visible of course), and that field component would use the field
information of the arch node it represents. To this end, we want
fields from not using anymore information stored in activeFields
in the record datapoint. Instead, we now call extractProps with
the whole fieldInfo (the information extracted from the arch), s.t.
each field can generate the props it needs from those information
(e.g. sub views for x2manys).

This commit doesn't remove the use of record.activeFields in
concrete fields (this will come later), but reworks the fieldInfo
object generated by parseFieldNode, and provide it to the calls of
extractProps. In fieldInfo, the `options` key is no longer inside
`attrs`, as it is now top-level, alongside several other generic
keys that have been processed (like on_change, modifiers...). For
that reason, a lot of extractProps definitions had to be adapted.

Part of task 3179751

closes odoo/odoo#113092

Related: odoo/enterprise#37266
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-02-24 11:11:32 +01:00
Victor Piryns (pivi) 8401192620 [FIX] snailmail: don't delete letter we trying to resend
Current behaviour:
When trying the resend a snailmail that had a format error, by
adding a cover we get an error that a record we trying to access is
deleted.

Expected behaviour:
We shouldn't delete the letter that we are trying to resend.

Steps to reproduce:
- Install Invoicing
- Add an IAP account with some credits
- Create a contact with a reallllyyyy long address, to overfill the
  fields.
- Create an invoice for that customer, try to print/send a snailmail
- It should fail without a message, then scroll down to the red
  paperplane, add the cover and update resend, you get an error
  about the missing record.

Reason for the problem:
This legacy code, so maybe in the past it used to work a bit
differently. When trying to resend the letter, we are unlinking it's
attachment (reasons for that are unknown to me), which is linked
with a `Many2One` with letter with a cascading delete, so we end up
deleting the `snailmail_letter` that we are iterating over, then
when trying to write, it throws the error.

Fix:
Remove the link between the attachment and the letter before the deletion
of the `attachment_id`, so the letter is not being deleted.

Affected versions:
- 14.0
- 15.0
- saas-15.2
- 16.0
- saas-16.1
- master

opw-3111774

closes odoo/odoo#113596

X-original-commit: 5cfbfa8e1103081dab89a3114b20edfe9c724c26
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-02-24 10:06:32 +01:00
Fabien Pinckaers adb66027b1 [IMP] website blog: cleaning up ugly CSS classes, to keep standard
closes odoo/odoo#113594

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2023-02-24 10:06:30 +01:00
David MonjoieandOlivier Dony db295685ad [FIX] web_editor: better history divergence regexp
Using a lazy `?` quantifier lead to poor matching performances and
was not needed technically.

Using `*` instead of `+` lead to a lot of false positives when trying
to write records with an empty value for `data-last-history-steps`.

It is currently unclear how to reach such a case but in the meantime
it is better to allow people to write the record as such rather than
being completely locked with no possibility of saving.

closes odoo/odoo#113540

X-original-commit: 0a370758972e6a0c399471f9982f3898da92ef68
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Olivier Dony <odo@openerp.com>
2023-02-24 10:06:27 +01:00
David Monjoie 862932d286 [FIX] web_editor: do not traceback on null selection
Because the `selectionchange` event is async, the selection can
be null if the node has been removed between the moment the
selection was moved and the moment the event is triggered.

X-original-commit: 3232edb1ccb196c992f75858fe81d08a5af58ab9
Part-of: odoo/odoo#113540
2023-02-24 10:06:27 +01:00
Aaron Bohy fa11f330b8 [FIX] web: form view: restrict context sent to read data
The form view currently reads its data as follows:
 1) read the main record, which returns [id1, id2...] for x2manys
    and [id, display_name] for many2ones.
 2a) read x2manys records, with the context set on the x2many field
     node, which returns records like 1)
 2b) call name_get for many2ones with option "always_reload" set to
     true, with the context set on the many2one field node
 3) same as 2), but for records returned by 2a)

The context set on a field node is a string, and needs to be
evaluated (some placeholder values need to be replaced by actual
values), e.g. "{'partner': partner_id}" -> { partner: 4 }.

For 2a and 2b, the context sent is evaluated with the main record
as eval context. For 3, there an additional key "parent" in the
eval context which contains the values of the parent record.

The rationale of this commit is that those data related keys in the
eval context are useless for read-like rpcs.

In the future, the data of the form view will be fetched with a
single rpc, returning the main record and its related records, with
all the values required by the UI. To achieve that, we must ensure
that sub records are never read with a dynamic context depending
on the parent record.

This commit thus directly imposes the limitation, by removing from
the eval context the record related data when it is used to evaluate
the context to send to read-like rpcs.

Part of tasks 3171453 and 3179751

closes odoo/odoo#113527

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2023-02-24 10:06:23 +01:00
std-odoo 4ab81c7f5e [FIX] web: fix the Reference field in list view with a default value
Bug
===
If the Reference field is in a list view, and has a default value, an
error is raised if we create a new record without editing the reference
value. This is because the ORM return a string "model,id" in the
onchange method and this value is wrongly parsed in that case.

Task-2234179

closes odoo/odoo#113392

X-original-commit: b1a35d1b95612bc449b68ed38749d8b3755287ed
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-02-24 10:06:21 +01:00
Maximilien (malb) d1b04bdf7e [IMP] l10n_ar: 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#112803

Task-id: 3179209
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-02-24 10:06:18 +01:00
Maximilien (malb) dae0b7ae9f [IMP] l10n_latam_invoice_document: removing duplicated code
Before this commit, the name and report name of document type for latam localization had been added in each latam localization. Since they depend on l10n_latam, we decided it would be better to just add translate=True to already existing field (name and report_name) instead of adding new field in those module. This commit corrects that.

Task-id: 3179209
Part-of: odoo/odoo#112803
2023-02-24 10:06:18 +01:00
Christophe Monniez cf565652c6 [FIX] website_sale: wait for the editor to be loaded
As the tour `shop_editor` is very small, it finishes before the editor
itself is fully loaded.

As a consequence, some threads are remaining on the server side and can
lead to a complete failure of the test.

This seems to particularly affects builds on Bookwork with werkzeug
2.2.2 and python 3.11 as it leads to werkzeug requests timeout.

With this commit, a step is added at the beginning of the test to ensure
that the editor is loaded before beginning the test by itself.

closes odoo/odoo#112698

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-24 10:06:14 +01:00
det f79ff3fb37 [IMP] hr_expense: do not create purchase.receipt
Rework of the hr.expense workflow so that:
- expenses paid by employee generate purchase.order
- expenses paid by company generate entry that look like payments

Main reason being that purchase.receipt are not active by default.
That makes the entry hard to find, holes in sequences, inconsitency
with payment states.

It also remove the refusal of expenses as this was dead / inaccessible code, only reports can be refused.

task-id: 3126550
[community](https://github.com/odoo/odoo/pull/110518)
[enterprise](https://github.com/odoo/enterprise/pull/36090)

closes odoo/odoo#110518

Related: odoo/upgrade#4266
Related: odoo/enterprise#36090
Signed-off-by: Laurent Smet <las@odoo.com>
2023-02-24 10:06:06 +01:00
Yolann Sabaux 3a177c448d [FIX] models: use localized first day of the week when grouping by week
Steps to reproduce:
- Make sure language preference is 'en_US'
- In accounting, in the dashboard click on bills
- Filter 'due_date' by week

Issue: The start day is Monday and should be, for 'en_US', Sunday as it
is the case in the dashboard view in accounting (see appendix).

Cause: The query uses the `date_trunc('week', date)` which in Postgres
retrieves the first day of the week as Monday (ISO week).

Solution: Create an offset in the query depending on the first day of
the locale variable.

Note: the `web/tests/test_read_progress_bar.py` has been modified: since
the default language is 'en_US' there will be an offset of one day.  To
make it less confusing, I used only two anglo-saxons countries so the
day offset is not the variable tested.  (for this matter, pleaser refer
to `test_read_group/tests/test_read_group_process_groupby.py`)

Appendix:
Language (english-US)

		VIEW (per week)			|		DASHBOARD
	___________________________________________________________________
	W23		->	06/05		|	05/29	->	06/04
	W24	06/06	->	06/12		|	06/05 	->	06/11
	W25	06/13	->			|	06/12	->	06/18

		(Monday - Sunday)			(Sunday - Saturday)

Language (french-BE)

		VIEW (per week)			|		DASHBOARD
	___________________________________________________________________
	W22		->	06/05		|	05/30	->	06/05
	W23	06/06	->	06/12		|	06/06 	->	06/12
	W24	06/13	->			|	06/13	->	06/19

		(Monday - Sunday)			(Monday - Sunday)

opw-2747066

closes odoo/odoo#93053

Related: odoo/enterprise#29539
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-02-24 10:05:58 +01:00
luvi 0ef798a3db [IMP] web: StateSelectionField: add current value in the dropdown
This commit revamps the UX of the StateSelection field widget. Now, instead
of filtering the options by removing the current selected value, the field
displays the entire list in the dropdown, and the selected item has a
checkmark to indicate its status.

This allows us to remove the tooltip, since its presence was not useful
anymore, and was unintuitive to use. This changes required to adapt some
tests asserting its presence, as well as the number of items shown in the
dropdown menu.

task #3177182

closes odoo/odoo#113203

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-24 09:10:46 +01:00
Martin Trigaux 93af90cc1d [IMP] hr: better log message
Before this commit the message was only containing a message 'Personal
information update.' but it was not clear why the person was receiving
this message nor why he was receiving it.

closes odoo/odoo#113550

X-original-commit: de0061326bbd9e2fc5319c05448395afa5b71afe
Related: odoo/enterprise#37492
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-24 08:12:04 +01:00
Stefan-Calin Crainiciuc (stcc) 0642264a36 [FIX] mrp: save qty_producing in tablet view
This commit only adds the missing test from the original PR
since the feature was added back in without the test

opw-3032052

closes odoo/odoo#113562

X-original-commit: 542516b6b07c44e08b21271fbc9129c446e12c1b
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Stefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
2023-02-23 22:53:18 +01:00
uso-odoo 83082d7ee7 [FIX] hr: use correct close tag
There was an error in the XML template of the 'department_chart', the
opening tag was a <div> but closed with a </t>

sentry-3951803776

closes odoo/odoo#113543

X-original-commit: 2ea1efb20861c1cbd1d3a19ef9b4ef54385effed
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-02-23 18:29:19 +01:00
Harsh Modi 1f662b4033 [FIX] account: fixed the decimal bug in account_payment_term
In one of the previous commits from v15.5 the account code was improved but it
created a bug for Account Payment Terms .As we know odoo has defined default
Decimal Accuracy for Payment Terms is 6 and even on changing the decimal
accuracy for Payment Terms. The field Value in account_payment_term only
showed 2 decimal points because of the changes made in a previous commit.
We have fixed it by removing the digits attribute from the
account_payment_term view

Commit link-
https://github.com/odoo/odoo/commit/3dad4b3cb1cb823ae6ccbf56b990012ceca61d99

opw-3200888

closes odoo/odoo#113542

X-original-commit: 049c628945278477b35984864cfb19128892142f
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-02-23 18:29:16 +01:00
Martin Trigaux e130d8a1db [FIX] *: stop importing tests code
When loading a module, the code in the tests directories should not be
loaded.
One does not need freezegun on a server without running the tests.

closes odoo/odoo#113536

X-original-commit: 705c5d5dd9b76850638bd5d36b8395314ba78248
Related: odoo/enterprise#37481
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-23 18:29:11 +01:00
aliya 141bed9360 [FIX] sale: fix currency conversion in sale report
Sale Analysis report shows prices in company currency, converting foreign currency into the company currency according to the currency exchange rate.
Currently, the currency conversion is done incorrectly.

For example let's say 1 EUR = 25 CZK OR 1 CZK = 0.04 EUR.
Sales order: 39 EUR = 975 CZK.
Sales Analysis report shows 1.56.

This is because we are trying to multiply the order amount by 0.04, while it should be divided.
It used to be divided up until 16.0.

This commit changes the operator to convert the currency correctly.

opw-3167522

closes odoo/odoo#113525

X-original-commit: ef57d53866dc1d404138809132176c79d60a3b51
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-02-23 18:29:02 +01:00
Thibault Delavallée 3121454e9d [IMP] mail: move composer 'email_add_signature' field to computed
RATIONALE

Remove _onchange_template_id / defaults usage for composer fields. It
lacks control and make value computation hard to understand and predict.

PURPOSE

Split _onchange_template_id + default_get + get_record_data usage into editable
computed stored fields. Each field should have its own method with its triggers
(template, composition mode, ...).

SPECIFICATIONS

Improve composer to correctly compute field ``email_add_signature`` in
compute method.

When having a template, consider it defines completely body and do not add
signature. Without template, add signature by default in comment due to post
processing for notification emails. Mailing mode does not handle signature.

Followup of odoo/odoo#107356

Task-2088884 (Mail: Use editable computed stored fields in composer)

closes odoo/odoo#113522

Related: odoo/enterprise#37478
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-23 18:28:59 +01:00
Thibault Delavallée 1a2a8d82fe [FIX] mail: do not subscribe inactive users creating records
Inactive users should not be added in followers of records, especially using
automated subscription. Indeed they mainly generate noise in notification
process and are generally skipped.

Few use case exists of inactive users creating records. One use case is the
mailgateway running as root but a context key 'mail_create_nosubscribe' is
used to avoid it. Other use cases include automated action for example who
are also generally protected.

Anyway better be sure and consider this is a standard use case. To extend
this rationale, inactive people are currently not added when posting. It
therefore makes sense to keep this behavior coherent through the mail stack.

Task-3046371 (Mail: Better Language Support in Composer)

Part-of: odoo/odoo#113522
2023-02-23 18:28:59 +01:00
Thibault Delavallée 3fea6d05fa [IMP] test_mail: add a test about inactive user creating records
Currently an inactive user that creates records is added in followers. Standard
use case is the mailgateway but it has the 'mail_create_nosubscribe' context
key that avoids the mailgateway user to be added in followers automatically.

A test is added without the context key that shows that inactive users are
added as follower when creating a record. This is due to the direct call
to '_insert_followers' that does not perform any filtering on inactive users.

Task-3046371 (Mail: Better Language Support in Composer)

Part-of: odoo/odoo#113522
2023-02-23 18:28:59 +01:00
Thibault Delavallée b915617569 [IMP] (test_)mail: improve test tooling
Allow to return <mail.mail> records and found outgoing emails when using
asserts. It eases doing checks in some specific tests e.g. checking
notification layout usage in emails. Indeed this is quite low level and
does not really deserves its own assert tooling methods.

Task-3046371 (Mail: Better Language Support in Composer)

Part-of: odoo/odoo#113522
2023-02-23 18:28:59 +01:00
ren-odoo 55b4df5515 [IMP] base: add vat_label to Chile and Peru
VAT in Chile is called RUT. This document is used by companies, individuals are identified with the RUN (Unique national registration), this identification is being handled with the module l10n_latam_base.
Reference: https://www.sii.cl/destacados/erut/paraque_sirve.html

VAT in Peru is called RUC. This document is used by companies, individuals are identified with the DNI (National Identification Document), this identification is being handled with the module l10n_latam_base.

closes odoo/odoo#113323

Reference: https://ww3.sunat.gob.pe/ol-ti-itinsrucsol/iruc001Alias#:~:text=El%20Registro%20%C3%9Anico%20de%20Contribuyentes,relevante%20de%20los%20 sujetos%20 inscritos
X-original-commit: 64a55adbabc0d3d525274aff45ad2ccc66c7cfbc
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-02-23 18:28:52 +01:00
Abderraouf Ghrissi (abgh) a424cf481c [IMP] project: delete useless fields
In this commit:
- project tasks kanban view: if partner_is_company, we display partner_id
else commercial_partner_id -> this information is useless so we decided to
display partner_id in both cases.
- manager_id is not used in any view -> drop the field
- when creating a task by mail, email_from is set to the sender email then will
be changed depending on partner_id and parent_id, the field name is not significant
as it change and no more contain the original email sender, it's also a duplicated
information that can be got from partner / parent -> delete the field and create
a new partner if no one already exist with the same email.
- when project.analytic_account_id is changed, only tasks that have the same old
analytic_account_id will follow the name value -> we decided to change the behavior
and apply the new value for all tasks.
- project_analytic_account_id not used in any view and in only place in python
-> delete field
- project.project: partner_email, partner_phone are not used in any view ->
delete field
- project.task: partner_email not used -> delete field
- ancestor_id is no more used in any view or python reference as it's a complicated
field to understand by users -> remove ancestor_id from project.task and remove also
ancestor_task_id that is related it to it in timesheet context and replace it with
parent_task_id which is more simpler to understand by users.

task-3103701

closes odoo/odoo#110101

Related: odoo/enterprise#37246
Related: odoo/upgrade#4269
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-23 18:28:45 +01:00
FrancoisGe 94c49cfdee [REF] *: fieldDependencies to Array
As with fieldsToFetch in commit 25bf5a3fabfa9da5367e82d1c5713425c77bc373,
we will convert fieldDependencies into an array of fields.
We did it because it's easier to use and more natural to has an array.

Part of task 3179751

closes odoo/odoo#113482

Related: odoo/enterprise#37449
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-23 16:08:42 +01:00
clesgow 5da90dfc4e [FIX] web,stock,mrp: check if viewSwitcherEntries exists
When using the ControlPanel's bottom-right slot in another component, if
`viewSwitcherEntries` wasn't defined in `env.config` it would raise a
traceback, as the template would try to check an `undefined`'s length.

Removed the workaround that added an empty `viewSwitcherEntries` in the
forecast report and the bom overview report since it's no longer
necessary.

closes odoo/odoo#112415

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-23 16:08:33 +01:00
Yannick Tivisse 3a10ef856d [IMP] l10n_mx: Add additional accounts to manage payroll
closes odoo/odoo#112916

Taskid: 3062275
Related: odoo/enterprise#36833
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-02-23 16:08:26 +01:00
Thomas Josse (thjo) 6774024e0e [IMP] survey: add fa-pen icon to sections in question ListView
This commit adds an icon on hover of sections inside the questions ListView
to indicate more clearly to the user that they can edit these lines.

task-2988062

closes odoo/odoo#108731

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-23 16:08:23 +01:00