Commit Graph
385 Commits
Author SHA1 Message Date
Thomas Becquevort (thbe) a2963d689d [IMP] hr_expense, sale_expense: category on product form view
Prior to this PR, when creating a new product.product model, a product.category
is allocated. As it is not shown on the product.expense.form view, the user
might make mistakes  if he did not set  the product.category himself.
This can be fixed by adding the product.category field on the view to allow
the user to modify it.

Also, some design changes are made at the same time to improve the form view.

This PR improves the product.product.expense.form view by adding the
product.category field so the user can modify it and also by modifying the
general layout of the view.

The view is modified adding the field, aligning the two first fields and
removing the notebook page for the notes and placing it in the continuity of
the view as it is the only page in the notebook

task-3413267

closes odoo/odoo#130065

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-08-21 14:14:57 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
SaddemAmine 5bd4120928 [IMP] hr_expense,project_sale_expense: Clarifying user error when partner is missing
When the partner is missing, the error message is not clear enough.
This commit adds a new error message to clarify the issue.

Task ID: 3438559

closes odoo/odoo#132029

X-original-commit: 5be853ebb6da19a4f0a147944995583e234bf1b9
Related: odoo/enterprise#45779
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Naceur Amine Saddem (sana) <sana@odoo.com>
2023-08-16 17:47:45 +02:00
mehjabinfarsana 0b2133fe4a [FIX] hr_expense: remove quick_create from expense report kanban view
before this commit, on expense report kanban view
after adding group by status, it allows the
to quick create expense report in approved
status.

after this commit, quick create is disabled

closes odoo/odoo#131579

X-original-commit: 6848d8e37d1bce0cb767ba9328b38038b6056e77
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-08-16 16:05:35 +02:00
Maximilien (malb) e3f4651c52 [FIX] * : Display improvement
This PR will introduce multiple display improvements. Here is the list:

- In the accounting settings, the fiscal localization section has a button that
was oddly placed. This PR solves that issue.

- On the dashboard, when clicking the three dots on a card, the options "remove
from favorites" and "configuration" were not aligned.

- In ir_attachment, the label and field of "datas" will be aligned, and a gap
will be added between the icons.

- In the settings, the button links were inconsistent in terms of padding. This
PR resolves that.

- In the payment providers, two button links had text wrapping issues. By adding
 Bootstrap classes, this has been resolved.

closes odoo/odoo#130522

Task-id: 3342969
X-original-commit: d4ba0c1f69212bfb0030036951c2888e935bbdf0
Related: odoo/enterprise#45060
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-08-02 17:29:27 +02:00
Maximilien (malb) 182c8b0b84 [FIX] hr_expense: Fill payment_mode
When creating a new expense sheet the payment_mode is empty by default. When adding a new expense to it, the payment mode of the expense itself should be filled with 'own_account' but if the payment mode of the expense sheet is set, the payment_mode of the expense related will be the same as the expense sheet.

closes odoo/odoo#130372

Task: 3382023
X-original-commit: 662c98fb19aeef331f110d6dc4a3d68890af7df4
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-08-02 06:18:06 +02:00
Julien Carion (juca) 6c412be2ea [IMP] *: coherent hotkey uses
This commit makes hotkey uses more coherent throughout the entire
codebase by setting alt+q as main shortcurt for confirm and default
actions and alt+x for cancel actions.

task-3370463

closes odoo/odoo#127469

Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-19 18:24:15 +02:00
Julien Alardot (jual) 495546de79 [IMP] hr_expense: Allow user to fix currency rate
This allows the user to set the total_amount_company

Currently, when an employee set the amount
in a foreign currency, Odoo doesn't let the employee
register how much they have been charged after
conversion in their own currency
(assuming that it's the company one)

After this if the user changes the total_amount_company,
the new rate is computed and used

Task-3255758

closes odoo/odoo#127246

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-07-15 04:01:01 +02:00
Yosua Nicolaus 41d56e2e98 [IMP] expense: default expense category on scan
Description of the issue/feature this PR addresses:
- Expenses are automatically created when uploading or scanning receipts. This is a feature often used by employees who have a lot of tickets and upload them in batch. The expenses created have a random category (product_id) specified. Companies may however want to specify the default category for accounting or management purposes. They are currently unable to do so.

Current behavior before PR:
- Companies can't specify default category for scanned/uploaded expenses

Desired behavior after PR is merged:
- In the Expenses setting, combine the "Default Journals" and "Payment" block into one and name the new block "Accounting"
- Add new setting in Expenses for specifying default category for scanned/uploaded expenses
- If that setting is set, use the value inside it for the category field of new scanned/uploaded expenses

closes odoo/odoo#124205

Task-id: 3354763
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-13 16:52:52 +02:00
Julien Alardot (jual) 81fe11fabb [IMP] hr_expense: Split company payments 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 move is created per expense

Task-3328877

closes odoo/odoo#126805

Related: odoo/upgrade#4873
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-07-13 14:47:30 +02:00
Julien Alardot (jual) 649b6d055d [FIX] hr_expense: fix currencies handling
Allow expenses reports to generate foreign currency
payments and use foreign currency accounts when all
expense lines are of the same currency.
If the report is multi-currency the company currency
is used instead (previous behaviour)

Task-3346458

closes odoo/odoo#126836

X-original-commit: 3d6d36ac5bab95af76776f07e55f286850f22ff9
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2023-06-30 01:32:58 +02:00
Maximilien (malb) 2eca114f52 [FIX] hr_expense: padding setting
Before this pr the label and the field were way too close, by adding a padding
start the setting become way more readable.

closes odoo/odoo#123887

Task-id: 3338500
X-original-commit: 33d2cf77434c27f3ac382dc45888f7824dbb6bb5
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-06 13:10:42 +02:00
Elisabeth Dickinson c84d388fac [FIX] *: switch image's .rounded-circle to `.rounded
*: gamification, hr, hr_contract, hr_expense, hr_holidays, hr_org_chart,
lunch, mail, web

Since the Milk refactoring, the backend uses only `.rounded` avatar
images. The `.rounded-circle` classes on images have been replaced by
`.rounded`.

task-3336569
part of task-3326263

closes odoo/odoo#123286

X-original-commit: b492049788353274fb32bb6fbe4d40e97a184a87
Related: odoo/enterprise#41798
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-01 17:55:25 +02:00
Abdelouahab (abla) 90c94b0de1 [FIX] hr_expense: scrolling in tree view
To reproduce
============
create many Expenses records, go to expenses in List View
scrolling not working

Problem
=======
some style classes are not applied on the correct element, which leads to this behavior

Solution
========
apply the classes on the correct element

opw-3300041

closes odoo/odoo#122133

X-original-commit: b7bc19e30afaf1e6374620b7a3bfbdf26c63e765
Signed-off-by: Laurent Smet <las@odoo.com>
2023-05-24 14:28:06 +02:00
Damien Bouvy 0066181f81 [FIX] hr_expense: misaligned icon
X-original-commit: c5a4f0532140d7bd429c1da787d461debda2b5a7
Part-of: odoo/odoo#122111
2023-05-23 22:32:45 +02:00
Maximilien (malb) 1c6a8a2975 [FIX] hr_expense: css issue on attachment
Before this pr, when attaching an image to an expense, the image was misplaced.
By adding a display flex and justify the content in the center, the image is now
vertically align in the center.

closes odoo/odoo#121607

Task-id: 3329707
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-23 18:01:43 +02:00
Brieuc-brd ee75969979 [IMP] *: app icons: replace svg to png
The introduction of Milk has brought new app icons.
Using the svg format creates a lack of anti-aliasing on the edges of the
shapes, which makes the icons look bad.
Since the png size has been reduced, we can afford to use the png format
to have the best possible quality without having a lack of performance.

task-3326633
Part of task-3326263

X-original-commit: e07cb722f2b11407a3ad093bd688b7d37afd5a88
Part-of: odoo/odoo#121886
2023-05-22 13:54:07 +02:00
Ali Alfie (alal) 2f2250622b [FIX] hr_expense: expense categories padding issue
Before: in Expense Categories list view, if Internal Notes wasn't empty it would  cause a padding issue. The issue's cause was that the Internal Notes columns is an HTML field, where every line is assigned a margin-bottom.

Now: fixed the padding issue by removing the margin-bottom for the last line in the Internal Notes field.

task-32999162

closes odoo/odoo#121014

X-original-commit: f6bffc092ddc4bdfd9d68efe66dbbcdeed4f0309
Signed-off-by: William André (wan) <wan@odoo.com>
2023-05-15 11:41:29 +02:00
Elisabeth Dickinson 45b9e04db4 [IMP] *: status buttons fix
Part-of: odoo/odoo#116641
2023-05-12 22:59:23 +02:00
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
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
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
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
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 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
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
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
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
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
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
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
FrancoisGe 1f0e840238 [IMP] *: converting custom list views adding a doAction button
In this commit, we will convert all the customisations of the list view
consist in adding an always present button in the control panel that
performs an action/calls a model's method.

To do this, we will use the new display="always" parameter applicable
to buttons in the header of list views. This allows us to define a
button that is always visible in a list view.

closes odoo/odoo#106519

Taskid: 3082303
Related: odoo/enterprise#34387
Related: odoo/documentation#3044
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-16 18:39:56 +01:00
sofiagvaladze 7a6b903830 [FIX] hr_expense: set 'name' and 'expense_line_ids' during report creation
Steps to reproduce
- Install Accounting
- Create user and employee, "user_acc", with Accounting-Accounting and no Expense rights
- Take the expense in "To Submit" state for the employee different than user_acc and create report
- Save the report.

Bug - We get the error that required field 'name' is not set and expense lines disappear.

task - 3099142

closes odoo/odoo#107903

X-original-commit: c5765be58dcdb3f6d766e6ce409a6e0f8a82e45b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-14 09:34:55 +01:00
gawa-odoo 8bf6bee153 [IMP] analytic, *: block validation with mandatory plan
* = {account, sale, purchase, hr_expense}
When a plan is mandatory for SOL, POL or expenses, the flow should still be blocked when pressing the button, and not only when creating analytic lines.

We add the info in the context of the button, so automatic flows are still not blocked.

When the applicability rule requires a mandatory analytic distribution, raise an error upon :
- confirming PO,
- sending or confirming SO
- approving Expense Report by manager.

t-3040929

closes odoo/odoo#107166

X-original-commit: 8623a7850288828759db125b1054b0fed6b6b135
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-04 17:58:01 +01:00
Jorge Pinna PuissantandMichael Mattiello (mcm) c7c2959449 [IMP] web, *: simplification and standardization of the settings arch
The aim of this commit is to simplify and standardize the settings archs.

To do this, a small DSL exclusively for the settings was created. This
new DSL introduces 3 tags: `app`, `block` and `setting`.

The `app` tag is used to declare the application on the settings view.
It creates an entry with its logo on the sidebar of the view. It also
acts as delimiter when searching.

```xml
    <app string="CRM" name="crm">
    ...
    </app>
```

- `string` : The "display" name of the application.
- `name` : The technical name of the application (the name of the module).
- `logo` *optional* : The relative path to the logo. If not set, the
        logo is created using the `name` parameter :
        `/{name}/static/description/icon.png`.

The `block` tag is used to declare a group of settings. This group can
have a title and a description/help.

```xml
    <block title="Title of group Bar">
    ...
    </block>
```

- `title` *optional* : The title of the block of settings (the old h2),
        you can perform research on its text.
- `help` *optional* : The description/help of the block of settings
        (the old h3), you can perform research on its text.

The `setting` tag is used to declare the setting itself. The first field
in the setting is used as the main field (optional). This field is
placed on the left panel (if it's a boolean field) or on the top of the
right panel (otherwise). The field is also used to create the setting
label if a `string` is not defined. The `setting` tag can also contain
more elements (e.g. html), all of these elements are rendered in the
right panel.

```xml
    <setting string="this is bar">
        <field name="bar"/>
        ...More elements
    </setting>
```

- `type` *optional* : By default, a setting is visually separated on two
        panels (left and right), and is used to edit a given field. By
        defining `type='header'`, a special kind of setting is rendered
        instead. This setting is used to modify the scope of the other
        settings. For example, on the website application, this setting
        is used to indicate to which website the other settings apply.
        The header setting is visually represented as a yellow banner on
        the top of the screen.
- `string` *optional* : The text used as label of the setting. If it's
        not defined, the first field is used as label.
- `title` *optional* : The text used as tooltip.
- `help` *optional* : The help/description of the setting. This text is
        displayed just below the setting label (with classname
        `text-muted`).
- `company_dependent` *optional* : If this attribute is set to "1" an
        icon is displayed next to the setting label to explicit that
        this setting is company-specific.
- `documentation` *optional* :  If this attribute is set, an icon is
        added next to the setting label, this icon is a link to the
        documentation. Note that you can use relative or absolute path.
        The relative path is relative to
        `https://www.odoo.com/documentation/server_version`, so it's not
        necessary to hard-code the server version on the arch anymore.

closes odoo/odoo#106425

Task-id: 3081367
Related: odoo/enterprise#34337
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: "Michael Mattiello (mcm)" <mcm@odoo.com>
2022-12-02 14:40:25 +01:00
Thibault Delavallée 5eca7b7378 [REF] hr_expense: cleanup alias management
Purpose of this commit is to cleanup alias usage in hr_expense. Indeed it
is currently used as a master data without being cleanly supported.

In this commit we

  * globally avoid crashes if the alias data has been removed;
  * recreate Xml ID record if it has been removed as it is considered as
    being a master data;
  * avoid issues when trying to configure the expense alias in settings if
    alias has been manually removed. Setting a name now creates the alias
    and an XmlID if it has been removed;
  * rename a generic 'use_mail_gateway' field into 'expense_use_mail_gateway'
    in order to avoid conflicts with future changes in generic settings linked
    to email gateway and configuration
  * fix empty list helper: it is now translated and correctly encode parameters
    given to 'mailto';

Task-2710804 (Mail: Clean MailThread Posting API)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

Part-of: odoo/odoo#105992
2022-11-18 13:59:53 +01:00
Kevin Baptiste 7017150d7d [FIX] hr_expense: correctly align fields
The fields were not correctly aligned.

task-3040395

closes odoo/odoo#104195

X-original-commit: f5cec113222db06f427f17a0170d45e2022b5b39
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-27 10:37:37 +02:00
FrancoisGe c998fdd77b [FIX] base: consider multi_edit="1" views editable
Since odoo/odoo#95729

nodes with a `groups=` are completely removed from the views when
the user is not part of the group, instead of being made invisible.

In that PR, views have been adapted to add back fields, with invisible="1",
when they were required, for instance when they were used in a domain
of another field which was still there despite the user is not part
of the given group.

As `tree` views having `multi_edit="1"` where not considered
as editable views, the domain of fields in these views were not
validated:
- https://github.com/odoo/odoo/blob/1fb8fa16ab7dc298d54f089d7163fb556dbc5fcc/odoo/addons/base/models/ir_ui_view.py#L1460
- https://github.com/odoo/odoo/blob/1fb8fa16ab7dc298d54f089d7163fb556dbc5fcc/odoo/addons/base/models/ir_ui_view.py#L1321-L1322

while they are well required for the web client,
in `multi_edit="1"` this is possible to edit relational/many2one field,
and therefore it will do `name_search` calls using the domain of the
field, and therefore the fields used in these domains must always
be present in the views. Without it, a crash in the web client occurs
when attempting to edit the relational/many2one field.

This revision targets to consider the `multi_edit="1"` tree views
as editable, to make the field domains validated as they should be.

Hence, views are adapted to add back fields with `invisible="1"`
when they are required in domains of other fields.

Part-of: odoo/odoo#103790
2022-10-23 12:30:03 +02:00
gawa-odoo b8dca3b174 [IMP] analytic, *: Json field for analytic distribution
The `analytic_distribution` field is a Json.
It was stored temporarily as a char.

Search is not available yet, so we do queries by hand when we need to search on keys.

Also added a constraint on account_analytic_distribution_model,
so we don't have models with accounts specific to a company when the model has no company or another company.
It would cause an issue when looking at the models from another company.

X-original-commit: 7064c95aa04e5138bb12ae97acfee04ebb67cc0e
Part-of: odoo/odoo#103097
2022-10-17 10:11:09 +02:00
Damien Bouvy e647a2de09 [IMP] *: adapt to grid form views
The recent switch from tables to css grids for form views `group` nodes
has introduced several inconsistencies/issues with several views accross
modules - these will not be the last fixes.

closes odoo/odoo#102174

X-original-commit: 836568dfd59886a6d52f15e0e2109709903b6803
Related: odoo/enterprise#32295
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2022-10-11 13:15:12 +02:00
gawa-odoo ba4b71427f [IMP] analytic,*: changes on applicability and make fields visible
Add choices for the business domain on applicability rules, so rules are more precise
Also put 'general' as domain from the view when it's what should have been.
Make analytic field visible since owl migration (for sale and purchase)

closes odoo/odoo#102461

X-original-commit: c5867d5009a7fb448fff1be487b9e9c3e7945d4b
Related: odoo/enterprise#32421
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2022-10-10 14:04:43 +02:00
Kevin Baptiste 9b7d968557 [FIX] hr_org_chart,hr_expense: fix form UI
This PR adapts the form views since the merge of #100570.

task-3002465

closes odoo/odoo#102750

X-original-commit: 03b7ed51d9bb1e0717d21cd6516f98e477a2c926
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-10 09:48:23 +02:00
Yolann Sabaux 661b35c1e7 [FIX] hr_expense: allow saving expense with UOM readonly
Steps to repoduce:
- go to expense
- select Mileage [MIL]
- Save

Issue:
Canno save, different UOM

opw-3001568

closes odoo/odoo#102280

X-original-commit: 4621d776f0108fa0226cfac56b0f376a5f2a0b2d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2022-10-06 00:37:30 +02:00