Commit Graph
860 Commits
Author SHA1 Message Date
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
stefanorigano (SRI) c964329add [REF] web,account: listView & kanbanView design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:14 +02:00
hupo-odoo 8823e01040 [IMP] account: Express VAT in local currency on invoices
Display the totals and taxes on pdf invoices in the company currency when the invoice is in foreign currency. This is a requirement from some countries where local authorities need the VAT to be expressed on the invoice in the national currency even if the invoice has been issued in another currency. The tax groups details are also required. The new information is expressed using a rectangle at the bottom right of an invoice. It includes the same information as the detail of totals and taxes above, with the difference that it is in company currency. If cash rounding is activated, the total rounded must not be displayed in company currency.

task : 3256515

closes odoo/odoo#118234

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-05-09 04:44:28 +02:00
moerradi 5881af92d8 [IMP] account: Enable saving bank account for new partners
This PR resolves an issue where it was impossible to save a bank account for a newly created partner (customer/vendor) without saving the partner details first. The solution implemented is to automatically save the partner when the user clicks on "add a bank account", thus ensuring a smoother user experience.

Problem Description:
When creating a new customer or vendor, users encountered difficulty when trying to add a bank account without saving the partner details first. The account holder field was required to save a bank account, but it didn't exist yet, creating a frustrating experience for users.

Solution Implemented:
We have implemented an auto-save feature for the partner when the user clicks on "add a bank account". This will force the save of the partner details before proceeding with the bank account addition, ensuring the account holder field exists and can be filled in.

closes odoo/odoo#120599

Task-id: 3266820
X-original-commit: d4defd079508e14b6a74c01a41868d3b57b2e0c0
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Erradi Mohammed (moer) <moer@odoo.com>
2023-05-05 00:39:50 +02:00
Rodrigo ca62e32aa4 [FIX] account: account_searchpanel.scss add width 0 to firts elemnet with class .o_toggle_fold for align header test to left
closes odoo/odoo#119904

X-original-commit: b3b05e6f764229298c9e74abf0dd42c06a5dd73d
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-27 12:31:41 +02:00
Antoine Dupuis (andu) d1834758ea [IMP] tools, account: remove XSD crons; download XSD button
At the moment, XSD files are automatically downloaded at database
initialization, which is quite unnecessary.

The idea is to change Odoo's use of XSDs from being systematically
downloaded and used for validation to simply being available if desired
(e.g. for development or for customers who want them).

To achieve this, this commit does the following:

- remove the XSD download crons;
- provide a 'download XSDs' button in the Settings (next to the debug
  mode button) which is available in debug mode;
- skip XSD validation if any required XSD file is not present; and
- deprecate the 'force_reload' option.

Entreprise PR: odoo/enterprise#38350
Task id: 3010716

closes odoo/odoo#118790

X-original-commit: c8174c7914e567489de74b574b076467440bdb2d
Related: odoo/enterprise#39879
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
2023-04-17 18:01:18 +02:00
Bruno Boi b4b834c0a9 [REF] web: simplify popover hook usage
**Before this commit**
Almost all of the use cases of the `usePopover` hook are dealing
with an abnormal amount of complexity:
- they have to store the closing function of the popover, and sometimes
  keep track to its opening state,
- you can find a duplication of a useUniquePopover hook, which is
  anyway the behavior that is always wanted for popover users.

This is due to the fact that usePopover is just some kind of wrapper
to the lower level popover service.

**After the commit**
- The usePopover now has a new API, which simplifies its usage.
- The useUniquePopover hook implementations have been removed and
  this "unique" behavior is now merged into usePopover
  and has become the standard one (not configurable).
- All of the use cases have been adapted, even the cases where
  components used directly the popover service (through `useService()`).

See the adapted jsDoc around the hook in popover_hook.js

closes odoo/odoo#118066

Related: odoo/enterprise#39654
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-04-13 16:40:19 +02:00
Habib (ayh) 87c91139c6 [FIX] account: tax totals currency issue
The tax totals widget is formatting data using the old props instead of the new. When viewing an invoice the currency is correct, but when scrolling through records or changing currencies, the currency in the widget is not correct.

To replicate:
1. Create 2 invoices, one in EUR, one in USD, ideally both with tax
2. Scroll through the record form views using the next/previous pager buttons
3. Observe the currency is not correct (display USD instead of EUR, and EUR instead of USD)

This fix modifies the way the record data (props.value) is formatted, and ensures using the correct currency (nextProps) instead of the old one (props)

OPW-3244079

closes odoo/odoo#118241

X-original-commit: 15a610acddf4ea19082a88aaf1eee231aa1fe91f
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
2023-04-11 18:49:38 +02:00
Habib (ayh) 34149617a3 [FIX] account: broken no content helper
doAction does not convert the action help html to markup resulting in the display of an html string.

To replicate:
- Journal Items List view or Analytic Items
- Click a link to the bank recon widget
- In bank recon widget, search for something that returns no records
- The no content helper displays html string

After this PR:
By using the doActionButton instead, noConentHelper is marked up and displays correctly.

closes odoo/odoo#118093

X-original-commit: 8cedb020f2bcd2115fdaf0fb44abbeb936ced3c0
Related: odoo/enterprise#39531
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
2023-04-07 20:44:28 +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
Géry Debongnie 3db0ad01a1 [REF] web, *: rework webclient cache invalidation system
The web client has a mechanism to invalidate the action and the view
cache: in the basic model (and the relationalmodel), some code is
looking for updates to some specific models (such as ir.actions) and
trigger a `CLEAR-CACHE` event. This event is then listened by the action
and view services to properly clear the caches.  This mechanism was also
used to reload the page after editing a company, or reloading the
currencies after editing some currency.

With this commit, we modify the orm service to trigger an event after
each rpc. This event can then be used by the action/view service, and
also by the currency/company services to perform their specific cleanup.
This work is one step in the future refactoring of the relational model.

closes odoo/odoo#115655

Related: odoo/enterprise#38814
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-27 16:04:58 +02:00
Jorge Pinna Puissant 04d5fb2255 [FIX] *: simplify concrete field API - remove update prop
Since [1], the update props is not used anymore in the field API. Some
utilization were missing in the refactoring.

[1]: https://github.com/odoo-dev/odoo/commit/b5db53b5df6403d2d9b57771854bc36aa5d83583

task-id 3241162

closes odoo/odoo#116229

X-original-commit: d212e46119a187452eb6c6d52b8592f28a633dd0
Related: odoo/enterprise#38579
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-23 09:06:52 +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
Jorge Pinna Puissant bd2bf1a30f [FIX] account: remove isVirtual
Since [1] we removed the isVirtual function from the record, to use the
equivalent isNew, this was made to avoid having two functions with
equivalent behavior. This one was forgotten.

[1] : a73390a42a

closes odoo/odoo#114639

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-08 10:31:15 +01:00
det 3dfe9d372f [FIX] account: add attachments to send&print
Before this commit, it was not possible to add attachments to the
send&print wizard (account.move.send) due to:
https://github.com/odoo/odoo/commit/688986f888f2fe2371d58b74ded81315ba6bb353

closes odoo/odoo#114627

Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-07 23:10:01 +01:00
Jorge Pinna Puissant 688986f888 [REF] web, *: simplify concrete fields API - remove value prop
This commit, is part of a series of commits that aim to simplifie the
concrete fields API.

In this commit we will remove value prop from concrete fields. Now each
field will directly use this.props.record.data[this.props.name] to
access their value, As a consequence of this, the name props need to be
mandatory.

task-id 3179751

closes odoo/odoo#113495

Related: odoo/enterprise#37464
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-07 09:02:50 +01:00
Jorge Pinna Puissant a73390a42a [REF] web: remove isVirtual function from Record
Before this commit, the model's record had two similar functions: isNew
and isVirtual, this commit will remove the isVirtual function to only use
the isNew one.

closes odoo/odoo#114431

Part-of: task-id 3179751
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-07 02:56:18 +01:00
MerlinGuillaume 9ea183bc39 [FIX] account: use currency to format tax
An error is thrown when trying to edit the tax in a vendor bill

Steps to reproduce:
1. Install Accounting
2. Go to Accounting and create a new Vendor Bill
3. Add product 'Large Cabinet' to the bill
4. Click on the pencil icon next to the tax in the total amount
5. An error is thrown

Solution:
Partially revert the erroneous fix in TaxTotalsComponent by adding the
currency getter. If there is no currency, floatFormat will fallback on a
decimal precision of 2.

Problem:
https://github.com/odoo/odoo/pull/108412 removed `currency` from
TaxTotalsComponent. This value was passed in the props of
TaxGroupComponent so it was undefined.

opw-3212170

closes odoo/odoo#114362

X-original-commit: 59a1d1f825cfbc1f720cccb80de212f6ee6d5404
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-03-03 22:23:51 +01:00
Laurent Smet 955091e707 [IMP] account*: send&print with documents
Refactoring send&print wizard.
==============================

Main reason for this commit is that we want to let the user
decide when to generate the relevant documents / approvals
for its invoices. The natural choice is when the information
leaves Odoo. So now, each time the users decide to
download/send its invoices, he will be able to select the
relevant documents to be generated and the approvals to be
requested from the send&print wizard.

This used to happen automatically during the posting with lots
of undesirable behaviors (difficulty to update/revert, hard to
know exactly what will happen,...)

Main changes:

1/ Send&print wizard

- The model 'account.invoice.send' has been replaced by
'account.move.send' and became models.Model to handle
asynchrounous generation of documents (webservice,..) in
case of more than one invoice.

- The wizard is meant to be overriden in order to add
checkbox and document to be generated. A comprehensive exemple
can be found in account_edi_ubl_cii.

2/ Import invoice from attachments

- The decoding logic has moved from account_edi to account
on the attachemnts.

- The function _extend_with_attachments() serve as a common
entry point for import (from chatter, dashboard).

3/ Export invoice pdf / document

- All the specific actions to export attachments should be
implemented on the account.move and called from the wizard in
 _generate_documents()

- The official pdf for the invoice is now only generated once
 the user request it. In order to regenerate the pdf and
documents, it needs to be deleted.

task-id: 3117238
[enterprise](https://github.com/odoo/enterprise/pull/36757)
[community](https://github.com/odoo/odoo/pull/111857
)

[IMP] web: enable close on ir.actions.act_url in wizard

Before this commit, calling ir.actions.act_url on a modal
leaves the modal open. Which feels ackward in the send&print
wizard.

We now enable 'close' parameter on ir.actions.act_url. If set,
the wizard will close after act_url.

closes odoo/odoo#111857

Related: odoo/enterprise#36757
Related: odoo/upgrade#4387
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-03 19:10:10 +01:00
hupo-odoo 776d28b539 [IMP] account: show company name when accounting firm
Accounting firms are often connected to customer's company, so often single company database. To know easily in which company they work we think that it should be better to show the name of the company on the top for them. A systray item is therefore generated at the location of the company selector. It is visible only when there is a single company (so no company selector) and only when accounting firms mode is on, i.e. the setting field is set to either one of these values ('customer Invoices', 'Vendor Bills', 'Customer Invoices and Vendor Bills')

closes odoo/odoo#108928

Task: 3110453
Pr: 108928
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-03-03 13:10:39 +01:00
Camille Spiritus 01cd352a9a [FIX] account: Fix payment terms computation + usability
- Compute the fixed amounts first before managing the percentage.

Suppose a fixed line of 100 plus a percentage line of 100%.
For 1000, the previous behavior was 100 + 1000 = 1100 != 1000

- Manage fixed amounts in multi-currency.

With multi-currency, apply the rate to compute the company amount.

- Ensure the full amount is dispatched exactly with percentages.

Suppose 2 percent lines of 50%. To dispatch 0.03, the previous behavior was computing 0.02 + 0.02 = 0.04 != 0.03 leading to a not balanced journal entry.

- Don't discard the last new line when clicking outside the sheet.

Click on "add new line", then click on the empty space near the form view.
=> The last added line is removed.

closes odoo/odoo#114025

Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-03 10:15:46 +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
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
FrancoisGe 5126c9b1d4 [REF] *: register widget descriptors instead of components
Before this commit, the widget's description was stored on the
component and this component was then registered.

Now, an object describing the widget is used on registration the same way
as it is done for views since b828cfc.
This split the component's description (props, template, ...) of
the widget's description ( component, extractProps, ...) and makes
it clearer.

We did the same thing for fields in 9f4622492c

Part of task: 3179751

closes odoo/odoo#112962

Related: odoo/enterprise#37215
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-21 15:53:06 +01:00
Mathieu Duckerts-Antoine 94c2db94e0 [FIX] *: adapt code related to orm service create
The previous commit has as a side effect to change the value returned by
the create method of the orm service. Here we adapt the code that uses it
and make the test pass.

Part-of: odoo/odoo#111965
2023-02-20 19:25:00 +01:00
Nshimiyimana Séna d91070936d [FIX] account: remove references to session.company_currency_id
Currently, there are a few references to a variable called
`session.company_currency_id`. This variable used to be defined in the
`web_dashboard`, a module that no longer exists.

https://github.com/odoo/enterprise/blob/3d351aa3f8e4943df81bc09640ae16380e9a89f7/web_dashboard/models/ir_http.py#L14 (v15.3)

This commit removes all references to `session.company_currency_id` in
the `account` module.

opw-3033656

closes odoo/odoo#112941

X-original-commit: aa0db63ecf8e6903ef3e664d8b22b00bf51ca1f2
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-02-17 01:52:44 +01:00
Michael (mcm) 9f4622492c [REF] *: register field descriptors instead of components
Before this commit, the field's description was stored on the
component and this component was then registered.

Now, an object describing the field is used on registration the same way
as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671.
This split the component's description (props, template, ...) of
the field's description (displayName, supportedTypes, ...) and makes
it clearer.

closes odoo/odoo#112498

Task: 3171520
Related: odoo/enterprise#37105
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-16 14:13:32 +01:00
amdi-odoo 0c700c387c [REM] account: remove useless css
Remove an unnecessary css rule, it was made
global for all x2many list fields.

Task-3151054

X-original-commit: 81cf885a9d102c86782f6742bbc98bccb1ee8344
Part-of: odoo/odoo#112372
2023-02-10 09:11:57 +01:00
hupo-odoo 3764914c86 [IMP] account : invoice layout improvement
Modifies the invoice layout according to the mockup provided in the task. This enables to remove the blank space that occured in the middle of the invoices
Add the possibility to add the total amount of an invoice in words. This feature can be enabled by activating a boolean setting in Accounting settings.

Task: 3097097
Pr: 107714
Part-of: odoo/odoo#107714
2023-02-09 08:46:45 +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
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
Brice bib Bartoletti 43076cdd26 [FIX] account: adapt AccountMoveFormCompiler hack
The aim of this commit is to get rid of a traceback preventing the user
to switch tabs in Invoice and Bill

Context:
AccountMoveFormCompiler is a hack that allows to save the record
automatically when the user switch between tabs.
With commit 264f313012aa99449d1576ae1110252c13755142 the way to call the
compiler changed a bit but the hack wasn't.

Before the commit:
The `this` was leading nowhere in the compiler frame leading to a
traceback in OWL.

After the commit:
`this` is defined and the traceback is gone

closes odoo/odoo#110635

Community-pr: https://github.com/odoo/odoo/pull/110506
Task-id: no task
X-original-commit: a926071fc6944d5cd720a8849b2f31a5dd8ff4dc
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-01-21 00:57:25 +01:00
Michael (mcm) bc82ea7379 [FIX] web: fix issue on reorder list with colspan
The PR https://github.com/odoo/odoo/pull/109461
fixed the size of the dragging row but it did not care
about cells with colspan.
Since this PR, another one (https://github.com/odoo/odoo/pull/110349)
has been opened to manage the colspan in the
section_and_note widget but the issue also exists in
other subclass of list.
This commit moves the fix from the section_and_note
widget in the base list.

closes odoo/odoo#110487

X-original-commit: 9de8080a45773c4fd4fc2882e9135b51e3e613ce
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-01-20 08:40:46 +01:00
Habib (ayh) 280a43bf20 [FIX] account: reorder section and notes bug
With PR odoo/odoo#109461, the drag and drop of lines in a section_and_note field causes a traceback. This is because the cells and headers do not align perfectly for section and note lines. To solve this, an override of sortStart method is added which takes into account the colspan.

Additionally, the word-wrap of section and notes is enabled, and tests are improved.

fixes #109934
task-3136580

closes odoo/odoo#110349

X-original-commit: 4894f6eac7aead113049be99fcb1cad3d75c3325
Signed-off-by: William André (wan) <wan@odoo.com>
2023-01-18 23:02:14 +01:00
Yolann Sabaux 299d4921c8 [FIX] account: render rounding line
Steps to reproduce:
- create a cash rounding
- create an invoice
- in Other Infos, select the created Cash Rounding Method

Issue:
Accounting wise, everything works fine but the back-end view and the Invoice Reports do not take into account the rounding
(except wen you create a partial payment, the amount due is correct of course)

Solution:
Make sure the value `formatted_amount_total_rounded` is returned by the method `_prepare_tax_totals` so it can be used in the templates

opw-3090556

closes odoo/odoo#109312

X-original-commit: 5724858a374c894bf787b4381bdcd466b4cc2816
Signed-off-by: William André (wan) <wan@odoo.com>
2023-01-06 14:31:52 +01:00
Jorge Pinna Puissant 5b68871097 [IMP] * : kanban, unify dropdown definition in archs
This commit separate the templates, one for the card and another one for
the menu (the ellipsis dropdown).

The new template, called 'kanban-menu', will only contain the dropdown.
Note that, this behaviour is the same as the one used for the kanban
tooltips.

closes odoo/odoo#107589

Task-id: 3096776
Related: odoo/documentation#3284
Related: odoo/enterprise#34962
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-05 15:37:04 +01:00
MerlinGuillaume 78c79d8cf0 [FIX] account: make prop currency optional
An error is raised when trying to create sale order lines with tax on a
sale order without any customer (with debug mode enabled)

Steps to reproduce:
1. Install Sales
2. Create a new sale order without any customer
3. Add a new sale order line and a tax to this line
4. An error is raised `Invalid props for component 'TaxGroupComponent':
   'currency' is undefined`

Solution:
Make prop `currency` optional (and format the total without any
currency)

Problem:
When trying to render the tax total of a sale order without any
pricelist, an error is raised as the `currency` prop is missing, which
depends on the pricelist

opw-3098020

closes odoo/odoo#108310

X-original-commit: c3acd369976f46e5c987d9d460908f99c6f05b0c
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-12-19 16:49:09 +01:00
Guillaume (guva) e858ce0d86 [FIX] account: card color kanban view
The kanban cards did not take the class
oe_kanban_color.
This is because it was set on the child div
instead of the parent one.

opw-3069024

closes odoo/odoo#107778

X-original-commit: 9078761d10289446cfd3881e9df9061075441440
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2022-12-12 19:18:34 +01:00
Habib (ayh) 03f485e064 [FIX] account: import notification
Since mail.thread was removed from the account.bank.statement, the message_post code was causing a crash when attempting to import duplicate transactions.
This commit retrieves the messages from the returned action and displays them using the notification service

task-3044636

closes odoo/odoo#107167

X-original-commit: 6b5dd2399ccb2a7f533cdf7e2d00d0161a037c1a
Related: odoo/enterprise#34626
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
2022-12-03 00:37:31 +01:00
Aaron Bohy 4c5b867ff6 [IMP] web,*: control form and kanban rendering context
Before this commit, the rendering context of kanban and form views
was the instance of the KanbanRecord and FormRenderer, respectively.
As a consequence, a lot of implementation details (e.g. "props",
"__owl__", any Class method...) were available. This wasn't what
we want.

The door being left open, people went through, and in 16.0, several
kanban and form archs contain(ed) such use of undesired "features".

With this commit, we restrict the rendering context of those two
views. In kanban views, it contains what has been historically
available (e.g. "record", "widget", "kanban_color"...). In form
views, nothing is available since the only dynamic part in those
archs is the attrs, which aren't evaluated by the rendering engine.

To do that, we use `t-call-context` owl directive. When using this
directive, the rendering context is the given one, + `this`. So the
component instance is still available, but through the `this`
keyword. We can thus use it in our compilers, to make them work as
before. Note that `this` can never be used in an arch directly.

Task 3085357

closes odoo/odoo#106045

Related: odoo/enterprise#34493
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-12-02 11:37:48 +01:00
Habib (ayh) 0eeee27a82 [FIX] account: view arch should not contain owl directives
The Accounting Journal Dashboard Kanban view contains direct owl components and directives. This should not be the case as it may cause problems with studio.

This commit replaces the direct owl with
1. a view widget for the file uploader buttons.
2. the kanban record template is extended to add the dropzone and file uploader with context

Task-3040946

closes odoo/odoo#105575

X-original-commit: 5de857d56c5f4cff318ed6b6c7dd15bf426e6a18
Related: odoo/enterprise#33877
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
2022-11-10 22:22:07 +01:00
Jorge Pinna Puissant 4f24e34b39 [IMP] test_lint, *: eslint remove caughtErrorsIgnorePattern from no-unused-vars
Unused catch block arguments are now forbidden even when prefixed with an
underscore:  if the argument on the catch block is not needed, the use of the
optional catch binding is enforced.

Part-of: odoo/odoo#105433
2022-11-09 16:08:07 +01:00
Julien Alardot (jual) e76c76169b [IMP] {account_*, l10n_*}: t-esc to t-out
Due to the deprecation of t-esc to the unique use
of t-out in the rendering template, this replace
every usage of it and ensures everything continues to
work as inteded. Removing deprecation warnings
polluting terminal

deprecation commit: odoo/odoo:9ce5bc8881ae06b613ef61eb07453b224f62bae6

closes odoo/odoo#103731

Related: odoo/enterprise#33037
Signed-off-by: William André (wan) <wan@odoo.com>
2022-10-25 18:44:57 +02:00
william-andre ae2fcda9e8 [FIX] account: quick encoding
The computation of the taxes in the context of quick encoding wasn't
working properly.
* The value was not updated in the widget when it was updated
  programatically.
* The payment terms were created twice because of the `new` method on
  account.move.line
* The taxes should be updated both when we create a new line manually
  and when we update the quick encoding fields
* Generally speaking, it should be all controlled from the invoice, not
  from the lines

To test and reproduce: use a tax of 21% with an invoice line of 100.0

X-original-commit: 48c068a2d76c302fdddda7125b7244c670b4a77c
Part-of: odoo/odoo#103081
2022-10-11 17:59:43 +02:00
John Laterre (jol) 42cdd7f657 [FIX] account: include account changes in autosave triggers
Currently, when creating/editing Journal Entries, changing
taxes or balances (with taxes) triggers a save in order
to generate an automatic balancing line.

See this PR : https://github.com/odoo/odoo/pull/102040

But in some cases (like the non-deductible taxes in Belgium),
the tax line is linked to the base line account (or its partner).
Which is why we also need to trigger a save when changing the
account (or partner) on a line with taxes.

This also fixes a bug that prevented the Journal Entries from being posted.

closes odoo/odoo#103080

X-original-commit: beb49a83b5c0c1547122dd91582a6a2bd26a4cfc
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-10-11 17:59:40 +02:00
Demesmaeker 95048fff04 [IMP] web_tour,*: add dynamic step skipper in tours
Some onboarding tours were conflicting between themselves, with some
common steps. This commit introduces the possibility to skip a step
depending on the current DOM, making dynamic tours and ensuring tours
compatibility

task-3002442

X-original-commit: 1e4fb74f2cb8d500effa54d548dc9c29f12b32c1
Part-of: odoo/odoo#103036
2022-10-11 14:10:23 +02:00
Nicolas (vin) d765b0301e [FIX] account: fix resequence form view
The resequence form view css has been broken, this aims to restore
it as it was in previous versions

X-original-commit: aa1fc47cc52b7ae51fb66ba077eb8b2691d0dbff
Part-of: odoo/odoo#102790
2022-10-09 19:49:53 +02:00
Romeo Fragomeli 13f3ed2919 [FIX] account: force One2Many List to take all space
The component `section_and_note_one2many` doesn't take all `width`
available and so in some case when there is too content or the form view
is too small the `table` overflow outside the form.
This commit forces this component to take `100%` of the `width`
available.

Steps to reproduce:
* Open Sales
* Select a Quotation
* Reduce the size (width) on the Browser => BUG

closes odoo/odoo#102743

X-original-commit: 32b0d75385889f037f574cbc515aa2895583f99e
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-10-08 12:31:50 +02:00
maximilien(malb) 7bd748077a [FIX] account: bills view
The pencil for the edit of the tax present in the tax total widget was too close of the amount, by adding a padding it's now corrected

closes odoo/odoo#102710

X-original-commit: 076438d71d9f9c11c84e1086e4a29b01aabab399
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2022-10-07 23:08:02 +02:00
Aaron Bohy 8540aad29f [REM] *: remove legacy views converted to owl
This commit removes legacy views that are not used anymore as they
have been converted to owl. They could actually have been removed
in the commit that converted them, as we never needed to have a
double implementation of views, unlike we need to (field) widgets.

The LazyColumnList is a special case. This view hasn't been
converted. Instead, it has been decided not to use it anymore.
So it was dead code, and this commit removes it.

The form/list/kanban views are no longer necessary in the view
registry, since their owl version exists. However, we kept them
in the test asset, as they are massively used in legacy tests
(in field tests for instance).

closes odoo/odoo#102634

X-original-commit: 186a8b31161fc8c75b346ff97f9403dca1ae677e
Related: odoo/enterprise#32501
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-07 17:47:58 +02:00