Commit Graph
2998 Commits
Author SHA1 Message Date
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Pierre Paridans caef16ee4e [REF] web,*: ControlPanel layout
This commit brings the ControlPanel into a single line with 3 main
sections:
- buttons & breadcrumb
- layout related actions (ie. the SearchBar in multirecord view or
  ButtonBox in formView)
- navigation (pager, switch view...)

Add new search bar menu, this is a merge of the following components
into one big component display in column:
* comparison_menu
* favorite_menu
* filter_menu
* group_by_menu

Also adapt navigation hook.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Elisabeth Dickinson b2ef35a431 [IMP] *: replace .bg-color by .text-bg-color on ribbons
Also remove unnecessary CSS on ribbons.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
Julien Alardot (jual) 8f9ca3e29e [IMP] hr_expense: Split outstanding lines per expense
When an expense sheet move is created, there is only one
outstanding line, but it is usual to pay separately.
That makes the reconciliation step harder.

This makes sure one outstanding line is created per
 invoice_line and then if only one payment is made
 it can go through the same process as a batch payment

Task-3292188

closes odoo/odoo#120450

Related: odoo/upgrade#4625
Signed-off-by: Laurent Smet <las@odoo.com>
2023-05-08 22:39:52 +02:00
flvr-odoo 30b283fe7d [FIX] hr_expense: prevent linking of expense with no perm
Previously, a user could link his own expenses to a expense sheet
of someone else.

This would not be allowed upon creation but was allowed when updating
the values of the expense.

This commit add a simple check at the beginning of the write()

closes odoo/odoo#120661

X-original-commit: 884510b1496e0a0eba7171f4ef4bb749856cb1bf
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-05-05 14:55:10 +02:00
Alexandre Kühn 9f115fce17 [FIX] mail,*: fix style in 1st column of activity view
Task-3290752

closes odoo/odoo#120189

X-original-commit: a97c86a2b962f56955e3c16b7ad99cabb0b13b9c
Related: odoo/enterprise#40564
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-03 17:24:58 +02:00
det 3cdec23ab3 [FIX] hr_expense: foreign currency rework
Bugprovemnts when multi-currency is enabled, alows to
enter expenses in activated currencies. The expense is
directly converted to the company currency using same day'
rate:

- do not reset amount on currency change

- rework of the views, to show currency and related amount only
when relevant.

- remove dead code: amount_residual on expense

closes odoo/odoo#114528

Task-id: 3191597
Related: odoo/upgrade#4443
Signed-off-by: Laurent Smet <las@odoo.com>
2023-04-28 16:04:08 +02:00
Bruno Boi f22961ad07 [FIX] web,*: repair root class attr
*: web + adaptations in base, fleet, hr, hr_expense, hr_recruitment,
   loyalty, lunch, mail, mass_mailing, note, project, stock, survey,
   web_tour

**Foreword**
Since d19037e141 the rootnode class attribute for form/list views was
copied two times:
- on the o_view_controller div
- and on the root node of the view renderer.

Examples:

<form class="foo">...</form>

    gives

<div class="o_view_controller o_form_view foo">
    <div class="o_control_panel">...</div>
    <div class="o_content">
        <div class="foo o_form_editable ...">...</div>
    </div>
</div>

and

<list class="foo">...</list>

    gives

<div class="o_view_controller o_list_view foo">
    <div class="o_control_panel">...</div>
    <div class="o_content">
        <div class="o_list_renderer foo ...">...</div>
    </div>
</div>

**Issue**
This could lead to confusion and also unexpected styling issues.
See this PR #119815 to read a message JS Framework team has received.
See also another a fix that had to be made for x2m fields: 980244fa8

**Introduced Changes**
- in the form compiler, the root node attributes are no more copied to
  the root div node of the compiled template the form renderer receives
- the root div node generated by the form compiler now has the
  "o_form_renderer" class, which was removed during the recent form view
  refactoring.
- the list renderer no more adds the root node class attribute to its
  "o_list_renderer" div
- the X2ManyFieldDialog has been adapted too
- since View, X2ManyField & X2ManyFieldDialog both need to compute view
  classnames derivated from the arch root node, an util has been
  introduced to avoid duplicating code
- the whole codebase has been checked and adapted.

Related: odoo/enterprise#40418
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-04-27 16:10:30 +02:00
Andrea Grazioso (agr-odoo) ff35bf57a7 [FIX] hr_expense: force company currency on company payment
Activate Multicurrency (USD company curr, EUR foreign currency, 1 EUR = 2 USD)
Have a Bank account in both currencies.
Create an expense of 100€, paid by company
Create report, set EUR journal as Bank Journal
Send To manager > Approve > Post Journal Entries
Open created payment

Issue:
- Payment amount is 200€
- In journal items, amount_currency and balance is 200$

Do the same with "Paid by employee".
Open the vendor bill

Issue:
- Invoice lines are expressed in the wrong currency

opw-3269009

closes odoo/odoo#119490

X-original-commit: 5eab4469d87a4d1ca80916ca5790691ffed68e38
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-04-24 23:49:12 +02:00
Renaud Thiry 87b0189ff1 [IMP] mail: remove default logo
Many templates use the company logo that is set by default on
database creation. As that logo is clearly a placeholder and the user
isn't necesserely prompted to update it. It's possible for a user to
inadvertently start sending emails with "your logo" placeholders
plastered all over.

This removes the default logo of the company and removes it from
templates conditionally.

The logo isn't simply replaced with a transparent PNG as the templates
set a fixed height for the logo, which would look weird.

task-3067315

Part-of: odoo/odoo#106307
2023-04-24 10:20:12 +02:00
william-andre 40967ac434 [FIX] account: computation of "Use in Tax Closing"
The computation of `use_in_tax_closing` was overlooked when refactoring[^1]
the CoA templates. Since it was using a `onchange` with an extra code in
`create` of the `account.tax.repartition.line.template`, it didn't work on
its own after the refactoring.

[^1]: 5125748616

closes odoo/odoo#119440

X-original-commit: e51ffcb01be3238338f23946b75f7e034032cf37
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-22 06:54:00 +02:00
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Pulinckx Pierre (PIPU) 614de86989 [REF] *: Replace underscore function by native JS
Replace _.isNumber(), _.filter(), _.reject(), _.unique(), _.indexOf(), _.lastIndexOf(), _.findIndex(), _.range()
_.keys(), _.values(), _.str.sprintf() and some _.each()

closes odoo/odoo#118003

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-13 16:40:11 +02:00
Martin Trigaux 69f911d994 [IMP] *: enforce usage of Markup in mail
When using message_post, the body format must be explicitly specified.
If html is expected, a Markup object should be used.
If text is given, the content will be escaped.

Before this PR:
message_post was unaware if the content of a message was HTML or
text. This lead to multiple situation where the content was
incorrectly considered as HTML and led to display errors.
In
  self.message_post(body="Hello %s!" % self.name)
if the name contained HTML, it would be evaluated.

In
  self.message_post(body="Contact Raoul <raoul@caramail.be>")
the email would not be displayed as considered as unknown HTML and
discarded by the sanitizer

Now each call must explict the type of content.
Use the escape() helper to properly combine Markup and translations.
It would also be acceptable to use Markup() to wrap a static
translation but escape is better as one can not guarantee the content
of a translation.

closes odoo/odoo#111850

Related: odoo/documentation#3612
Related: odoo/enterprise#36728
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-04-13 16:39:48 +02:00
dasz d832fcf0ce [IMP] hr_*: standardise UI displaying of employees accross all hr apps by using the widget avatar_user
Appraisal: done, fix  chat widget issue
Employee: done, removed unused view
Attendance: done
Expense: done
Time Off: done
Fleet: done
Payroll: done
Referall: done
Lunch: done

task-313272

closes odoo/odoo#111817

Related: odoo/enterprise#36663
Related: odoo/upgrade#4310
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-13 15:25:46 +02:00
det f3569d1c9c [FIX] hr_expense: amount in needed terms
Steps to reproduce:

- set early_pay_discount_computation on company to mixed.
- create an expense with taxes
- try to post entries from the expense
> traceback

This commit adds the missing key in the needed_terms computed
on in hr_expense. We could have bypassed the computation in the
case of expenses but simply adding the key sounds like a more
future-proof solution.

opw-3244294

closes odoo/odoo#118250

X-original-commit: 7922a7db0d840a33a3db54da1a359ac95e61cb7b
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Detry Thomas (det) <det@odoo.com>
2023-04-12 08:05:47 +02:00
Maximilien (malb) 41b39f2a57 [IMP] hr_expense: adding tooltip
Before this PR, the field tax_ids had no tooltip.
Since v16 we now allow the use of all taxes in the expenses module now. But, there is not much mention that price-excluded taxes will be used as price-included taxes.
In the release notes it just mentions that all taxes are usable, but there is no mention of anything else. This seems a bit confusing. Adding the tooltip will help users.

Also adding fresh exported .pot

closes odoo/odoo#117351

Task-id: 3252757
X-original-commit: df28d24699a6bfb4ea142fc07b10c1835d9d4323
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-04-05 15:11:17 +02:00
Michael (mcm) ff0d6dd580 [REF] *: replace odoo module by native one
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.

task id: 3162300

closes odoo/odoo#117305

Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-03 17:07:24 +02:00
Mahamadasif Ansari 02788e4076 [IMP] various: changes tips data due to changes in digest templates
With this PR, the `digest_data` template has been changed, so the `digest_tips`
is not compatible with the new changes.

This commit changes the `digest_tips` data to be compatible with the new changes.

Below are the modules affected:
 - account
 - crm
 - digest
 - hr_expense
 - hr_timesheet
 - im_livechat
 - mrp
 - project
 - purchase
 - sale_management
 - stock
 - website

task-2717426

Part-of: odoo/odoo#89549
2023-03-31 15:51:58 +02:00
det e54d633e5d [FIX] hr_expense: adding expenses to expense sheet error
Before this commit,
- create an expense
- click on create expense report button
- click on add expense in expense lines
- click on create
> the record does not exist error.

After, you can add expense to expense report via the lines without issue.
The (not yet existing) expense sheet is not part of the context anymore.

closes odoo/odoo#116544

Task-id: 3245816
X-original-commit: ee222533bedec6a1910723b28429c8f6c04d2169
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Detry Thomas (det) <det@odoo.com>
2023-03-25 04:10:23 +01:00
det 2bda33784d [IMP] hr_expense: edit account on expense sheet
Before this commit, the field account was readonly on the expense sheet and
the accountants have to go thourgh each expenses to change the account.

After, we allow changing the account on the expense sheet directly.

closes odoo/odoo#116439

Task-id: 3244925
X-original-commit: 3102ec4c3b108be18ccc6856c1c235b0b37d1e00
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Detry Thomas (det) <det@odoo.com>
2023-03-24 11:08:38 +01:00
Nicolas (vin) 783733cf33 [IMP] hr_expense: avoid adding wrong expense_line_ids
You cannot validate and expense report having expense_line_ids of
different payment mode.
But so far, it was possible to select these lines, and it would
be blocked upon saving.

We will improve this behavior by extending the domain on the
expense_line_ids field and disallowing to add lines that would lead to
an error later in the process.

It will also correctly handle the creation of new line via the expense
report form view, and add the paid by field as optional hidden in the
view in order to allow to find more easily the expense line that are
causing issues.

task id # 3221780

closes odoo/odoo#116077

X-original-commit: ec18bd414c831a9af67802dcd5d7181ef8d43049
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-23 08:01:08 +01:00
Nicolas (vin) 8259cf76ce [FIX] hr_expense: search panel categories fix
There is an issue with the search panel categories that has a limit=20;
It means it will only display the categories matching the expense
reports in the view if they are in the 20 first records fetched.

As this search field isn't really useful, it was decided to remove
it completely.

Task id # 3224719

closes odoo/odoo#116074

X-original-commit: 376e6aac2854f291c0b919451c34595b2c2d3060
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-22 08:19:00 +01:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00
det 043dadaa91 [FIX] hr_expense: currency and payable line discrepancy
Explanation:

A rework of hr_expense has been introduced in master and landed in 16.2.
https://github.com/odoo/odoo/commit/f79ff3fb374650670e89f231aaf17bb8d6596c25

There was a need to backport it to 16.0 then 16.1.
https://github.com/odoo/odoo/commit/90affb562962d0dc233526e3f15f5b60f383331d

During the backport;
- a computed fields 'journal_displayed_id' has been introduced and will need to be removed again in master.
- 2 bugs have been discovered:
-- the analytic.account were not created anymore (function not called)
-- the payment terms for expense paid by company could not be modified as a filter was missing

closes odoo/odoo#115650

X-original-commit: 672f4efd2c990ab6eef8f934c41625860b8ded46
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Detry Thomas (det) <det@odoo.com>
2023-03-17 15:02:46 +01:00
Thomas Lefebvre (thle) 3a982de28e [FIX] hr_expense: compute total amount if there is a unit price
Steps to reproduce:
Create an expense by sending an email.
Make sure the product has a zero cost.

Issue:
The expense has no total amount even if
a unit price is detected in the subject of the mail.

Solution:
Compute a total amount if we have a unit price.

opw-3128566

closes odoo/odoo#115620

X-original-commit: eb629fa82cbf592184ed60d0bf309a26a4465b70
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-16 22:53:59 +01:00
Joseph CaburnayandJulien Mougenot 3a798039d6 [REF] web_tour,*: convert web_tour to owl
* The tours are now run by the `MacroEngine` defined in `macro.js`.
  * This is accomplished by converting (at runtime) the user-defined tours to
    `Macro`s. See `tour_compilers.js` for the step (and tour-to-macro) compilation.
* API is kept the same as much as possible. Basically, declaring tours stayed
  the same with some exceptions:
  * `allowInvisible` can be provided in a step to allow consuming the trigger
    element even if it is invisible.
  * `isCheck` can now be used to replace the no operation `run` that is
    traditionally signals the runner to only perform a check.
  * Before, multiple `run`s can be called simultaneously. Now, each `run` method
    is awaited before proceeding to the next step.
* If the trigger element is `disabled`, the tour runner will *not* proceed on
  calling the `run` method and the runner will stay on current step until the
  trigger element becomes `enabled`.
  * However, the tour runner is okay with `disabled` trigger element if the step
    has `isCheck = true`. As long as the trigger element is found for `isCheck`
    step, the tour runner will happily move to the next step.
* Some tours are adjusted to properly run with this new tour runner.
* When the tour failed:
  * The dom string is not logged anymore.
  * However, a warning message containing the relative location of the step will
    be logged. This is better in helping the author in locating the failed step.

**Some guidelines learned during the development:**

* Each step may trigger a dom mutation. It's a good practice to insert an
  intermediate step that *checks* the existence of an element that result from
  the action of the previous step.
* Refrain from using the `run` method for assertions. `run`, in principle, is
  provided to perform actions that are not offered by the helper. Use the
  `trigger` for assertions.
* During dev, find `SHOW_POINTER_DURATION` and set it to `250`. This will show
  the pointer (pointing to the trigger element) for 250ms when watching the
  tour.

closes odoo/odoo#107618

Task-id: 3082036
Related: odoo/enterprise#37560
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2023-03-15 13:19:45 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
det a6988b4d54 [FIX] hr_expense: missing dependency
Before this commit, it was not possible to install hr_expense alone.
This commit enable the installation of standalone hr_expense by adding
missing dependency.

closes odoo/odoo#115140

Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-14 11:08:19 +01:00
Victor Feyens 24ccf7d9b0 [CLN] *: useless type info for actions
The type fields of actions already defaults to
the model name in the base model definition.

Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).

closes odoo/odoo#114539

Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 17:33:37 +01:00
Maximilien (malb) aa14ae958b [IMP] hr_expense: remove depends
Before this PR when uninstalling hr_contract, expense was uninstall automatically because of the depends, the purpose of this task is to remove the depends.

closes odoo/odoo#114120

Task-id: 3203717
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-07 18:02:47 +01:00
Jeremy Kersten 3eaca8ba16 [FIX] hr_rexpense: expense_sheet_id is not readable for portal user
Missing sudo for portal user on Invoice list.

When portal user go to his portal, to display the list of the invoices
we compute the url via get_portal_url that will call this method
`is_purchase_document` and got a traceback due to missing permission.

Now we call it with sudo to bypass the Access Right error without leaking
any extra information since it is casted as boolean later.

`get_portal_url` -> `record.access_url `-> `_compute_access_url`

account:account.move `def _compute_access_url` -> `filter(is_invoice)`

account:account.move `def is_invoice` -> `is_sale_document or is_purchase_document`

hr_expense:account.move `def is_purchase_document` -> `return bool(self.expense_sheet_id) or super()`

closes odoo/odoo#114424

X-original-commit: 01a91419f906bd8d9248e6376a0246b667218ca2
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-03-07 02:00:17 +01:00
Raphael Collet e962860c6f [IMP] core: introduce search_fetch() and fetch()
This fulfills the goal of searching and fetching fields in a single SQL
query.  We introduce the new method search_fetch() for that purpose.
Also introduce method fetch() to fetch some fields for a recordset if
they are not in cache yet.

The call graph is as follows:

    search()        calls   search_fetch()
    search_read()   calls   search_fetch() and _read_format()
    read()          calls   fetch() and _read_format()

    search_count()  calls   _search()
    search_fetch()  calls   _search() and _fetch_query()
    fetch()         calls   _search() and _fetch_query()

The methods _search() and _fetch_query() are usually the ones to
override to implement business-specific logic.  The method _search()
returns a Query object to retrieve the records that satisfy the given
domain and are accessible for reading.  The method _fetch_query() uses a
Query object to retrieve fields from the database and store them in
cache.

Also use search_fetch() to save one query in search_read() and the
reading of one2many fields.

Part-of: odoo/odoo#112126
2023-03-05 15:12:55 +01:00
Pierre-Yves Dufays 4cec1e12d8 [REF] various: apply main attachment mixin on models that use the feature
Add mail.thread.main.attachment in the inheritance chain of all models that
use the main attachment feature.

Note that we remove the main attachment from crm_case_15 of the demo data as
crm_lead doesn't use that feature.

Task-2648976

Part-of: odoo/odoo#110734
2023-03-02 12:32:11 +01:00
Bruno BoiandMathieu Duckerts-Antoine d19037e141 [IMP] web,*: better classes handling in view archs
**Before this commit**
- The optional "class" attribute set on the root node of a view arch
  is ignored, except for the kanban view which has a custom
  way of using it.
- The optional "js_class" attribute set on the root node of a view arch
  does not have any impact on the class names passed to its controller.

**After this commit**
The content of the optional attribute "class" set on the root node of an
arch like in

<list class="o_custom_class">
    ...
</list>

as well as an additionnal class derived [1] from the value of the
"js_class" attribute set on the root node of an arch like in

<list js_class="extended_list">
    ...
</list>

will both be found in the prop "className" of any view controller.

[1] a js_class value of "xyz" yields to the class "o_xyz_view"

**Note on this commit**
The kanban view was already appending the root node class attribute
to its renderer element. This is no longer the case and some styling
rules has been adapted.

closes odoo/odoo#113014

Related: odoo/enterprise#37265
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2023-03-01 17:01:03 +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
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
Victor Feyens be42e8178d [IMP] product,*: privatize price_compute method
This method is not used by rpc calls and wrongly allowed users to read the standard_price
field by calling the method through rpc.

Make it private to reduce its uses and avoid this potential leak of information.

closes odoo/odoo#113234

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-02-21 21:07:34 +01:00
Patrick Hoste aca7beb2e2 [FIX] hr_expense: fix alias_domain configuration
Before this commit, if hr_expense module was installed it was
impossible to configure alias_domain in the settings, the change
wasn't taken into account. This was due to the presence of the
field at two separate place and one of them having the readonly
parameter set.
This commit fix this issue that was introduced by :
5eca7b7378

Task-3127163

closes odoo/odoo#112443

X-original-commit: fc1c20cb5ce471b65120ec3eff7abd18ffd3a9fb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-10 19:53:06 +01:00
Aaron Bohy 49297bc7bb [REM] *: remove legacy basic views + some fields/widgets
This commit removes the legacy implementation of the form, kanban
and list views. It also removes the legacy view widget registry,
and all legacy widgets it contained. The legacy field registry
couldn't be removed yet as some fields are still used (e.g. in
client actions: FieldMany2One, FieldMany2ManyTags...), and
sometimes accessed from that registry (e.g. uom service). More
clean up will come later. Note that all tests using legacy views
have thus been removed, even though the tested feature might still
remain (e.g. FieldMany2One tests have been removed, but that field
is still there). However, those features are deprecated and
unlikely to evolve. They should be removed in the next saas, or the
one after.

Finally, this commit also removes the legacy view dialogs.

Task 3168640

Part-of: odoo/odoo#111809
2023-02-08 13:27:58 +01:00
hupo-odoo 44d4c9d090 [FIX] hr_expense: homepage tooltip
When opening the expense homepage without any demo data while the tooltip tour is activated, and the list view is shown, a visual bug occured (see task description for video). The issue occurs only in 16.0 and after.
The origin of the problem was that the tooltip tour placed the class o_tooltip_parent not at the right div and therefore added the attribute 'position:absolute ' which caused the css defect. Preventing the specific div to get the attribute o_tooltip_parent fixes the issue.

closes odoo/odoo#111824

Task: 3147125
X-original-commit: c84f2169f76921ed9226bb6c1a0b5500f9154c34
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-02-03 12:55:50 +01:00
Abdelouahab (abla) 77b0319241 [FIX] account: show amount in payment wizard with payment terms
To reproduce
============
- create a payment term with Balance of 3 months and a percent with 50 as value
- create a vendor bill using this payment term
- try to register a payment, the amount is not showing

Problem
=======
the amount field would be invisible if the Group Payment check box is checked,
and in this case it should be checked because it's one deadline.

Solution
========
the problem comes from the fact that the compute method that will check or uncheck
the group payment field, is called twice in same compute process but we only execute it
once because the record is protected and that's how ORM is expected to work to avoid infinite loops.

to solve the issue, `group_payment` was removed from `_get_batches` because it's not necessary.

opw-3103465

closes odoo/odoo#111710

X-original-commit: 5fd0dc7929156b193271679be90f1cbdf4e626b3
Signed-off-by: abla001 <abla@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-03 06:06:01 +01:00
Miquel Raïch 317463fb21 [IMP] *: Remove unnecessary view_type
closes odoo/odoo#110817

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-01-30 19:45:59 +01:00
Géry Debongnie b53f78e224 [REF] web_tour,*: use the registry in collecting the tours
This is a step closer to a goal of avoiding dependence on asynchronous
modules. Starting from this commit, new tour definition should be
registered to `registry.category("web_tour.tours")` registry.

So, instead of the following:

```js
import tour from "web_tour.tour";
tour.register(name, options, steps);
```

We now do:

```js
import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add(name, optionsWithSteps);
```

Notice the `options` and `steps` params are merged when registering
the tour definition. It should look something like so:

```js
registry.category("web_tour.tours").add("account_tour", {
  test: true,
  steps: [ ... ],
});
```

And if the `TourManager` instance is needed, one can get it from the
registry like so `registry.get("tourManager")`. Note however that
this instance is only available when the `TourManager` has been
instantiated -- so it's not available at top level of the module.

closes odoo/odoo#111103

Related: odoo/enterprise#36335
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-01-27 23:17:35 +01:00
det 42c1d2a6d3 [IMP] hr_expense: button to register payment on expense view
Before this commit, the user had to go over each expenses to
register a payment.
He now  has the possibility to do so from the expense report
tree view via the "register payment" button.

task-id: 3116195
[community](https://github.com/odoo/odoo/pull/109671)

closes odoo/odoo#109671

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-01-25 10:18:29 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Thibault Delavallée 4775bd93a2 [REF] mail: cleanup post with {view, template} wrappers
RATIONALE

Purpose of this commit is to cleanup main post helpers and have a more easy
and understandable way of calling them.

SUMMARY

We now have two main API methods, based on business flow: either posting
on documents, either sending a mass mailing. Indeed those two flows are
different

  * post: create message, then launch notification process by taking into
    account subtype, followers, ...
  * mail: create mails in batch with recipients being based on template or
    given partners. No notifications is involved, only maybe traces if a
    mass mailing is linked

Delegate QWeb rendering to the render mixin (i.e. _render_template_qweb_view)
in order to have a single point to forge evaluation context and re-use
existing rendering code.

SPECIFICATIONS

Main API helpers are now

  * ``message_post_with_source``: (batch) post on records, using an ir.ui.view
    (given a record or its xml id) or a mail.template record (given a record or
    its xml id). When using a template, a composer is called to post on each
    record (as batch post is not yet supported). When using a view, a direct
    call to message_post using the rendered bodies is done, one record at a
    time.
  * ``message_mail_with_source``: send a mass mailing on records, acting like
    invoking the mail composer in mass mode. Same arguments are valid, either
    a reference to a view, either a reference to a mail template.

Other helpers are

  * ``_message_log_with_view``: (batch) log on records, using an ir.ui.view
    to render the body using QWeb (no notification process);
  * ``_message_log(_batch)``: (batch) log on records (no notification process);
  * ``message_notify``: notify partners on records (creating notifications
    specifically for some people while message itself is not displayed in
    chatter);

Code migration

  * ``message_post_with_template`` in "mass mode": use ``message_mail_with_source``
    and set the template record as source;
  * ``message_post_with_template`` in "comment" mode: use ``message_post_with_source``
    and set the template record as source;
  * ``message_post_with_view``: its main usage was to post on a document, in which
    case it generally can be replaced by ``message_mail_with_source`` using
    the view reference as source;

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:34 +01:00
Thibault Delavallée 418761e344 [LINT] mail, various: use explicit subtype in message_post_{with_...}
RATIONALE

Purpose of this commit is to be explicit in subtype chosen when invoking the
message composer / calling message_post. As default value may not always be
clear, better be explicit in case the composer default value changes.

SPECIFICATIONS

Add explicit references to subtype when it is not obvious what will be the
final subtype, notably when using helpers (post_with_view or template which
uses the composer that is not crystal clear in its subtype management).

In this commit we also add support of XMLID-based subtype when invoking the
composer. A ``default_subtype_xmlid`` context key is transformed into a
``default_subtype_id``, to be used notably in JS where we cannot easily
use a ``ref``-like statement. Post API now also supports 'subytpe_xmlid'
argument allowing to give the xml id and ease calling the methods.

Use ``_xmlid_to_res_id`` to get directly the ID of subtypes in order to
avoid useless queries from ``ref`` that does an exists.

Also remove useless values given to post API, notably author_id that is by
default the current users' partner.

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:33 +01:00
lathuat1997 c1b826c495 [FIX] hr_expense: add employee_id to expense list on expense sheet form
Issue:
On expense sheet form:
- Choose an employee not like current user.
- Create an expense from expense list.
- Edit expense list and save expense sheet.
=> Error: "You cannot add expenses of another employee."

Purpose:
- Expense list has not `employee_id`.
- When save form, `employee_id` on expense list is current user.

Solution:
- Add `employee_id` on expense list.

closes odoo/odoo#109575

X-original-commit: 5558bfada8212106cee730357620000b726549cd
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-10 18:54:58 +01:00