Commit Graph
976 Commits
Author SHA1 Message Date
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Yosua Nicolaus 23b0d6f5a6 [IMP] account: improve invoicing tour
improve the flow of invoicing tour by:
- moving some bubble to a more clear position
- rewrite some text content
- delete some and add new tour step

closes odoo/odoo#132382

Task-id: 3468585
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-10-03 12:52:31 +00:00
Yosua Nicolaus 6db8079d7b [REM] account: remove useless fixme & extra_trigger
remove unrelevant FIXME from 1 year ago as it was not relevant anymore

Task-id: 2632645
Part-of: odoo/odoo#132382
2023-10-03 12:52:31 +00:00
Claire Bretton (clbr) 43b3abd3e2 [FIX] account: fix traceback on payment info button
Steps to reproduce:
1. Accounting > Invoices > click any unpaid invoice
2. Register Payment (doesn't matter if it's full or not)
3. Click the info (i) button next to the "Paid on" below invoice lines
-> Traceback
Before the traceback the unreconciliation button available was not
refreshing the view, which still appeared with "Paid on".
We fix both problems at the same time.

task-id:3516681

closes odoo/odoo#136383

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-10-03 08:42:20 +00:00
FrancoisGe d682871a8b [FIX] *: Wrong usage of onWillUpdateProps in Field
Since the new model (PR: odoo/odoo#114024), updating a record no longer
triggers a deep render and therefore no longer triggers the onWillUpdateProps
for Field components.

The goal of this commit is to adapt the usage of onWillUpdateProps
in Field composents in order to fix the bugs introduced by the RelationalModel

closes odoo/odoo#135842

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-22 11:55:55 +00:00
Chrysanthe (chgo) fe7dedfbc7 [FIX] account: upload button contrast
=== ISSUE ===

With Milk, our primary buttons received a fresh lifting in term
of design,with different designs according the state the button is in.

Before that, our buttons were green with a white text on it,
and the behavior was identical on `hover`. This allowed us to force
a `color: white` when it was needed, since the background always matched
WCAG contrast standards.

Since the 16.3, these buttons are on a dark background,
and that background becomes light when in `active` state. That means we
cannot use white on these buttons.

=== AFTER ===

We set the color of the link inside the button to `inherit` in order to
fix the active state behaviour.

Note that this should be improved when reworking the widget since having
a link inside a button is not really expected. Instead we should use a
link that allows different actions.

task-3354844
part of task-3326263

closes odoo/odoo#135996

X-original-commit: 572288ccf2244df23c031dd88c47d2807fd06c47
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-09-21 18:27:49 +00:00
Sébastien Theys 7ea370fce7 [REF] mail, *: tests: refactor contains to further remove jQuery
* = account, base_iban, bus, calendar, crm_livechat, hr, hr_holidays,
    im_livechat, mrp, project, sms, snailmail, test_mail,
    test_mail_full, web, website_livechat, website_slides

Add support in `contains` for most operations that we use in tests.
Remove return value from `contains`.
Move into `web` module.
Remove import/export chains, directly import from correct module.

closes odoo/odoo#134652

Related: odoo/enterprise#47064
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-14 11:22:47 +00:00
Laurent Smet d3707cf954 [IMP] account: allow to remove placeholders attachments in send & print wizard
In 16.1 and before, when you used the Send & Print, you could manually remove the attachments when using
the Send by Email. Even though the use case is weird (sending an invoice by email without attaching the document),
we have feedback of user actively using that option before.

Also, prevent the deletion of the PDF report from the wizard:
- Create and invoice and send it by mail
- Open again the send & print, remove the PDF and send by mail
=> The PDF is deleted from the invoice

closes odoo/odoo#135101

Task: 3476700
Opw: 3378840
X-original-commit: 00dc68955c8e4c35fab29617eed7f03e45fc6643
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-12 08:31:42 +00:00
Dylan Kiss (dyki) c81e89adf7 [FIX] account: fix drag and drop on journals
When trying to drop an invoice on a journal on the journal dashboard,
it fails with a message "Could not upload files". The issue is that
commit 6f95be6884 changed a CSS class
where the upload functionality depended on, making it fail.

This commit fixes this issue by adapting the CSS selector of the upload
field.

task-3496997

closes odoo/odoo#134965

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-12 08:31:39 +00:00
Aaron Bohy 0d7acf60b4 [REF] *: remove legacy Markup
Use owl.markup instead.

Part of task~3439226

closes odoo/odoo#134793

Related: odoo/enterprise#47124
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-11 19:13:59 +00:00
moerradi 6dba17d461 [FIX] account: Client Traceback on Payment Terms
Removed the `ListRenderer` overload in `payment_term_line_ids.js` to fix
an issue where trying to set `this.props.list.editedRecord` to null was
causing a stack trace error when navigating away from a Payment Term
lines.

The original intention was to prevent the discard of new records when
clicking outside of the list, especially when the user is not required
to edit something on the newly created record.

It has been replaced by an overload `X2ManyField` component making the
`AddInLine` method mark all the new records as `dirty` by calling the
`update` mehod on them with an empty object to prevent them from being
discarded.

closes odoo/odoo#132257

Task-id: 3460696
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-09-08 13:45:32 +00:00
Aaron Bohy dc680a4429 [REF] web,*: stop using and remove legacy utils
*account,web_editor,website,website_sale,website_slides

This commit removes all legacy utils except Markup, which will be
removed in another PR. A lot of those utils were no longer used and
thus have just been removed. Those that were still used either
already existed in the wowl codebase, so usecases have been adapted
to use the new version instead. A few have been re-implemented (or
moved basically) to the wowl codebase (e.g. isEmail and humanSize).

Part of task~3439226

closes odoo/odoo#134620

Related: odoo/enterprise#47044
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-08 08:29:58 +00:00
Valentin Chevalier 054ca0a19a [IMP] web, *: Add more formatters in assets_frontend
Before this commit, formatters like `formatMonetary` and `formatFloat`
weren't loaded in the assets front-end.

This commit introduces `formatAmount` ( `formatMonetary` calls
`formatAmount` but makes some prior processing to deduce the currency
from the field) and makes `formatAmount` and `formatFloat` accessible
from any front-end application.

Note: The currencies were added in the front-end session info because
they are needed in `formatAmount`.

closes odoo/odoo#133824

Related: odoo/enterprise#46658
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-09-06 19:43:39 +00:00
divy-odoo cea1cab535 [FIX] *: resolve the last tour step warnings
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, It shows warnings of 'ignoring action (auto) of last
step' as it can lead to a race condition.

This commit resolves the warnings: `ignoring action (auto) of last step`

task-3429500

closes odoo/odoo#129239

Related: odoo/enterprise#46683
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-04 15:02:47 +00:00
Dylan Kiss (dyki) 09b8c32e9e [FIX] account: branch management fixes
After feedback on the new branch management feature, there were a few
bugs reported. This commit solves several of them:

- Display the company/branch name of a reconciled payment in the info
  popover when viewing customer invoices and vendor bills. This way you
  can see why you don't have access to the payment e.g.
- Make it possible to select the taxes of the parent company when
  creating moves in a branch.
- Allow users with only access to a branch to open the Accounting app.
  The dashboard would fail with a security error before.

task-3461421

closes odoo/odoo#134000

X-original-commit: 92d261d9a3f64fcbb01023e680d362b598061707
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2023-09-04 10:56:06 +00:00
Jorge Pinna Puissant ebd538a194 [IMP] web, *: optimize save record from webclient
This commit, adds a new python method (`web_save`) to save a record, and
optionally read-it again in one rpc call. This optimizes the current
behavior that is to save a record in one rpc, and read-it in a second
rpc.

web_save, will receive the list of IDs of the records to save (if this
list is empty it will create the records, if not, it will write on the
existing records), the list of changed fields, and the unity
specification as optional argument to read the created/modified records
(if the specification is not set, the function will return a list of IDs
of the created/modified records).

closes odoo/odoo#133021

Task-id: 3453184
Related: odoo/enterprise#46559
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-04 09:19:06 +00:00
Jorge Pinna Puissant c885e76152 [REF] *: remove unused parameter from record save method
Remove unused parameters from record save method :
- stayInEdition
- useSaveErrorDialog
- savePoint
- force
- closable

closes odoo/odoo#133152

Related: odoo/enterprise#46289
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-08-25 13:59:00 +02:00
Antoine Boonen d852a81645 [FIX] account: Fix manual tax entry display bug
Problem
---------
Fix a display bug happening when manually modifying taxes in bills.

Objective
---------
Get the same behavior as in 15.2

Solution
---------
Colspan was acting weird when clicking the tax to input. It would
expand to the full size allowed. To avoid this behavior, I made the tax
display width to 0%. This makes it impossible for the input to expand
upon clicking.

task-3397951

closes odoo/odoo#132597

X-original-commit: b955f2f448e6e7063aafb6e98985c7afe748fd26
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
2023-08-21 22:18:25 +02:00
Sébastien Theys d08a18b791 [IMP] mail, *: tests: use contains in click and insertText
* = account, calendar, im_livechat, mrp, project_todo, sms, snailmail,
    test_mail, web, website_livechat

`contains` is more efficient than `afterNextRender` as it does not wait
for several extra animation frames, and it is functionally more
meaningful.

closes odoo/odoo#130451

Related: odoo/enterprise#44999
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-21 21:00:03 +02:00
Mahdi Cheikh Rouhou (macr) e43ee20eb0 [FIX] account, web: display total and subtotals correctly rtl lang
Issue :
After the last fix https://github.com/odoo/odoo/pull/124663
there is still an issue of currency placements and alignement
of numbers in rtl language at the total and subtotals.

Steps to reproduce the isse :
1-create an invoice and confirm it.
2-install accounting
3-go to accounting/customer invoices and choose the created invoice

Origin of the problem :
The fields displayed didn't have the appropriate classes and the
style for number and monetary values for rtl language is missing from
the css folder.

Fix:
I applied the class on the `td` tag and `span` tag.

opw-3295573

closes odoo/odoo#132572

X-original-commit: e3eb140fb431aa1fc08e718d79f332c50e86c079
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2023-08-21 19:57:55 +02:00
Habib (ayh) 7a78f5856e [FIX] account: save on tab change
Due to the new relational model (218ad8456a), a new property isInEdition is available while `mode` has been removed.
Due to mode always being undefined, the save method was never actually called, preventing the journal items from being available when switching tabs.

Task-3471248

closes odoo/odoo#132345

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-08-19 06:59:49 +02:00
Pierre Pulinckx (pipu) c07181b20b [REF] *: Replace env._t() by _t()
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :

<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>

task-3292454

closes odoo/odoo#131390

Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-18 19:17:16 +02:00
Gorash 0d99f4b9d9 [REF] base,all: Update modifier syntax: adapt JavaScript
closes odoo/odoo#104741

Related: odoo/enterprise#35255
Related: odoo/documentation#3523
Related: odoo/upgrade#4884
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-08-18 09:49:16 +02:00
Louis Wicket (wil) 75c69aeb38 [IMP] account, web_editor, base: remove useless use strict
According to the ECMAScript 2023 Language Specification:
> Module code is always strict mode code.

Odoo Modules mimic this behavior and automatically add “use strict“ at
the top of the file, so there's no need to do it yourself.

This commit removes all the useless occurrences of use strict.

closes odoo/odoo#132235

Related: odoo/enterprise#45908
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-08-17 19:51:17 +02:00
Gauthier Wala (gawa) 6c0d1e90ec [FIX] account: fix tour that is checking css value
This tour creates an indeterministic error, which is most
probably due to the fact that the css is sometimes not loaded when
we check it.
But this is not something that should be tested (especially in an
account tour), so we remove this step.
Removing this makes the tour useless, so we remove it.

Linked to runbot error 23583

closes odoo/odoo#131897

X-original-commit: 7d7535226332e766d1299b0d887bf7b21f34af88
Related: odoo/enterprise#45751
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2023-08-14 15:55:55 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Jorge Pinna Puissant 7b1d82aa9b [REF] *: add t-key when needed on the template
As all the templates are now imported in the owl app, the templates must
comply to owl.

t-key is mandatory when using a t-foreach

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:27 +02:00
Ruben Gomes b5394a93f7 [FIX] account: tour bold text
Make 'Invoice app' text bold.

closes odoo/odoo#131318

X-original-commit: e6190d86621c6d11736096adf9a87ca3d24b4fb1
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Ruben Gomes (rugo) <rugo@odoo.com>
2023-08-09 09:11:23 +02:00
Pierre Pulinckx (pipu) b1ebe3b6f4 [REF] *: Replace core._t imports
In this commit, _t import from import { _t } from
"@web/legacy/js/services/core" and from
 web/static/src/legacy/js/core/translation.js are replaced by
@web/core/l10n/translation.js.

task-3292454

closes odoo/odoo#130865

Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-09 00:13:08 +02:00
Michael (mcm) 9d6b380a24 [REF] *: adapt patches after new patch function
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.

task 3410198

[1]: 19ea1ac08043e22a811630968e44715cc3bfc495

Part-of: odoo/odoo#125716
2023-08-02 17:29:05 +02:00
Pierre Pulinckx (pipu) 60fe2e9b17 [REF] *: remove _lt()
In a previous commit 8bfa76a, _lt() returns _t().
So, in this commit, all usages of _lt() are replaced by _t().

task-3292454

closes odoo/odoo#130179

Related: odoo/enterprise#44906
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-08-01 13:51:17 +02:00
FrancoisGe 6424edb254 [FIX] *: convert record.data.id => record.resId
Since the relational model was rewritten (PR 114024), the record id is
no longer present in data by default. The correct way to access the id of
a record is to do record.resId.

closes odoo/odoo#130061

Related: odoo/enterprise#44785
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-01 07:04:57 +02:00
FrancoisGe 9d2656720c [REF] *: remove model.notify()
Since the relational model was rewritten (PR 114024), it is now reactive,
so it is no longer necessary to use model.notify() to render the view.

closes odoo/odoo#130058

Related: odoo/enterprise#44781
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-31 23:21:18 +02:00
Romain Estievenart 79ed7b15c6 [FIX] web: Remove M2M tags avatars doesn't work on kanban Quick assigns
Steps to reproduce:

- Open a kanban view inside the project app
- Click on the "Quick Assign icon"
- Select a user A
- Directly unselect this user
- Close the dropdown and open the edited record
- you can see the user A is still assigned => bug

This bug was occurred by a missing awaiting promise inside the deleteTag
method.

closes odoo/odoo#129996

X-original-commit: b345af5389cd0cc3eb5e373d50ea62afc4e46b22
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2023-07-28 16:29:21 +02:00
Bastien PIERRE 65242e31e9 [IMP] *: Remove alias in JS files
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo/odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-07-27 11:58:34 +02:00
218ad8456a [REF] *: adapt codebase to new RelationalModel
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.

Main changes that were requested are:
 - record datapoints no longer always have an "id" key in their
 data (they still do if the id field is in the view), so we use
 record.resId instead
 - the new model is based on fined-grained reactivity, so several
 components that previously relied on onWillUpdateProps to update
 their internal state no longer worked. Typically, using the hook
 "observeRecord" is the way to go now.
 - specialdata are no longer handled in the model, so the components
 needing specialData can use the hook "useSpecialData"
 - more generally, all overrides of models (RelationalModel or
 KanbanModel) needed to be reworked.

Part of task~3179751

Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:50 +02:00
Pierre Pulinckx (pipu) 8bfa76a842 [REF] *: Unify _t and _lt
The goal of this commit is to prepare ground to remove
lazytranslate function _lt() and keep only _t()
for a better understanding of the use of the translation function.

In this commit,

the translate function _t() has been updated to return the translation
if they are loaded. If not, it throws an error.
the lazytranslate function _lt() returns _t() function.
Corollaries :
Steps in test tours are now a function that returns an array of steps
to avoid any interpolation of _t in this ones before translations has
been loaded.

Example :

registry.category("web_tour.tours").add("example", {
    test: true,
    steps: () => [
        {...},
        {...},
    ],
});

task-3292454

closes odoo/odoo#124157

Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-07-19 13:13:16 +02:00
aliya 9616c9940d [FIX] account: fix delete invoice rights
From 16.0 any user can delete a customer invoice/vendor bill even if it creates a sequence gap.
This commit updates the rights and the warning message:
- The deletion confirmation message contains a warning about the sequence gap
- Only a Billing Administrator/Accountant can delete customer invoices/vendor bills creating the gap
- Also, if the fiduciary mode is on (`quick_edit_mode`) it should be possible to delete
  invoices/bills regardless of the user group

task-3284218

closes odoo/odoo#128556

X-original-commit: 2249f899049ef94b14b083c8db976662b868b026
Related: odoo/enterprise#44128
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-07-15 13:05:51 +02:00
Maruan Aguerdouh (magm) 954f3ad6e0 [FIX] account: no traceback thrown in older browsers when formatting
Trying to access quotations using an older version of a browser, that
doesn't support `structuredClone` like i.e Safari <15.3 will throw a
traceback that will block the regular usage of the app.

We can use an older alternative to handle the deep cloning, with this
approach tho, we will lose the support of Dates, RegExps, Maps, Sets,
Blobs, FileLists, ImageDatas, sparse Arrays, Typed Arrays.

opw-3386434

closes odoo/odoo#128472

X-original-commit: 5b4526b5dab519178a7c694de0625629e8686396
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-07-14 07:37:45 +02:00
Arthur Detroux (ard) 7b2bbb9c52 [FIX] account, sale: fix dependency on PortalHomeCounters
Prior to this commit, the patches done by `account_portal.js` and
`sale_portal.js` were done without any import.

This means that the widget it modifies (PortalHomeCounters) might not
already be loaded in the registry. This could lead to some issue later.

This commit uses an "import" statement on the module that defines
PortalHomeCounters to ensure that it is present in the registry.

task-3249625

closes odoo/odoo#127371

X-original-commit: 7937dbec9699e7d0f68450c469c9b742446303eb
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-07-05 14:34:04 +02:00
Florian Charlier 77f9ff50db [REF] *: use onboarding module
* = account{_payment}, base, onboarding, payment{_stripe},
sale{_management}, web, website_sale

Use the dedicated onboarding module introduced in 16.0 instead of
the res.company model to store onboarding progress.

It allows
 * onboarding steps to be reused across panels
 * to support steps that should be completed per-database or per-company
 * to clean the res.company model from many fields and methods,
 * to remove many views, controllers, actions

Module-specific notes:
* account: We also clean the remaining two steps that are not
part of an accounting panel but make the most sense to be kept here.
* account_payment: Following 8e4e8eb8, the payment provider step is
added to the invoicing onboarding panel. We apply this change here too.
Also impacts the website_sale_dashboard panel (see related ENT PR).
(The "sale tax" one is currently used for to the website sale dashboard).
* payment: Note that the step was already not part of an onboarding
panel within this module.
* website_sale: We clean
  * a field not used (The website_sale dashboard onboarding panel used
  the payment_provider_onboarding_state field).
  * a method that was only called from website_sale_dashboard, so it is
  moved there. See related ENT PR.

Includes a few tests.

Moving views/templates/styling, as well as cleaning residual onboarding-related fields and methods in base, including populate.

This also includes restoring the "onboarding_complete" overlay panel
animating it to disappear after a few seconds so that it doesn't hide
text and block buttons to re-open steps.

Task-3025136

Part-of: odoo/odoo#104223
2023-06-30 23:37:50 +02:00
Gauthier Wala (gawa) f15134fa7d [FIX] account: tour had wrong taxes and was too fast
Added a saveForm to wait for the compute/onchange to proc on the save
Added a tax, to be independent of localizations
Changed the product, to have a product with an amount that won't be
impacted by difference of default decimal place from localizations.

Fixes runbot error 22093

closes odoo/odoo#126883

X-original-commit: 2678f490648f81488c8635f2ebc01591935a48f1
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-30 01:33:10 +02:00
Julien Carion (juca) bfc6c71402 [FIX] account: fix account tax groups tour
This commit simply makes the account tax groups tour compatible with
odoo enterprise even without the accounting app installed.

closes odoo/odoo#126738

X-original-commit: 450c26a866a58f0441db83376066d606ec429bc2
Related: odoo/enterprise#43323
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2023-06-29 09:10:59 +02:00
Samuel Degueldre 81be42d8f9 [FIX] *: ensure tour tips are correctly translated
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows

In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.

This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.

This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.

In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.

closes odoo/odoo#125284

X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-19 13:35:28 +02:00
Habib (ayh) 4e09f0d86e [FIX] account: term is not translatable
The bills upload widget uses a custom attr "linkText". translate.py will only generate terms that are in the TRANSLATED_ATTRS constant, thereby not including these in the po template file.

To fix this, the attribute is changed to a recognised attr "title".
The JS widget will still recognize linkText, for databases that have not updated the module.

Task-3335585

closes odoo/odoo#125516

X-original-commit: 8569ceb101f6dfe5882c33c120b9ed6d76ccf5be
Related: odoo/enterprise#42755
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-06-17 22:02:28 +02:00
Julien Carion (juca) 4efb32dc23 [FIX] account: fix vendor bills tax discard
This commit fixes the object reference issue which was linked to the
TaxTotals Component computations. The issue was that discarding changes
on the tax field of a vendor bill wouldn't roll back the field's value
visually while the record would still have correctly updated values.
This issue originates from the fact that operations were made to compute
the taxes in the component but these would affect the server data as
well since the object reference between the local data and the server
data was the same. This means that the discard operation would bring
the displayed value back to the server data's one which has been
modified by the computations so it would not work. The reference to the
server data is now separated from the local one so that the bug won't
appear anymore.

opw-3285209

closes odoo/odoo#125304

X-original-commit: 9178c96f5788989c38fbb335ea79fc6ea8698131
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2023-06-16 10:52:51 +02:00
hupo-odoo ee6e560415 [IMP] account: cash rounding strategy differentiation
Improves the cash rounding visualization in the account move view. At the bottom right of the view, a widget displays the detail of taxes and the possible rounding must also be included in this display. In all cases, whatever the cash rounding strategy, whatever the (withholding) taxes applied if any, the invoice/bill total must equal the total of the account receivable/payable respectively. This commit makes the 'Total' line always the total amount of the account move. There is no longer a 'Total Rounded' that is displayed when using cash rounding. Instead, a rounding line is added only when the cash rounding strategy is set to 'add invoice line', which is clearer for the user.

Two cash rounding strategies exist in Odoo. The new correct way to display data is the following:
When using 'add_invoice_line':
    - a rounding line is displayed on the widget
When using 'biggest_tax':
    - the biggest tax (the tax with the highest tax amount) is incremented with the rounding amount

task-3333052

closes odoo/odoo#124632

X-original-commit: ae1b1f62a53b03278ef5aec583fc75b6eb7950c4
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: hupo-odoo <hupo@odoo.com>
2023-06-13 08:44:03 +02:00
Laurent Smet 688897cf10 [FIX] account*: Always send an invoice report using send & print
In case of error, the send & print wizard is crashing or log an error on the invoice chatter.
In that case, nothing is sent to the end-customer.
This is problematic for all flows in which we want to send a mail to the customer automatically.
For example, e-commerce with automatic invoicing or subscription/recurring invoices.

To avoid that, the current logic of the send & print has been reshaped. In case of error, a proforma
PDF is sent instead. This is exactly the same document as the PDF but without the legal layer.

To do that, a lot of refactoring has been necessary to always provide the cumulated data for invoices
to be able to access the generated proforma report and to allow the overrides to know exactly in which
mode the hooks are called.

Also, this commit renames the method by something less generic about invoices. Indeed, this wizard needs to be
usable for others documents than invoices. That's the purpose of the invoice_single/invoice_multi mode.
For that reason, all methods about invoices are now expricitely prefixed by 'invoice'.

Fix also a performance issue on multi-invoices since the invoice_pdf_report_id document was invalided for the
whole model instead of the current record. When dealing with X invoices, the whole model was invalidated X times.

Fix the managment of attachments:
- The manual attachments wasn't send when sending a mail 'invoice_single' mode.
- When changing to another mail template, the manual attachments were lost.

Fix the double generation of PDF using a web-service.
When opening again the send & print wizard, the PDF must not be regenerated but reloaded from the previous one.

Task: 3339352
X-original-commit: e9e90811aeee46989a83b21f9b59071a9c7bc362
Part-of: odoo/odoo#124436
2023-06-09 17:01:17 +02:00
25f43c2161 [FIX] web, *: cogMenu visual flaws
*: account, base_import, board, website

This PR enhances the "cog menu" by fixing several UX flaws.
Notable improvements include:
- Reordering entries in a more logical manner, enhancing user intuitiveness.
- Assigning icons to common actions for quick comprehension.
- Grouping both print actions and module-specific actions for better organization.

Enterprise:
- https://github.com/odoo/enterprise/pull/41851

task-3337951
task-3355224 (milk post-merge fixes)
part of task-3326263

closes odoo/odoo#124413

X-original-commit: 596772885a87016d29f002cd4e41b5a973965e40
Related: odoo/enterprise#42212
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
Co-authored-by: Pierre Paridans <app@odoo.com>
Co-authored-by: stefanorigano (SRI) <sri@odoo.com>
2023-06-09 17:01:06 +02:00
Laurent Smet 2afd431756 [FIX] account: Fix removal of attachment when cancelling send & print wizard
- Create an invoice
- Send it using sent & print
- Re-open the wizard
- Click on 'Cancel'
=> The PDF has been deleted.

This is because we want to remove the attachments manually added by the user but the condition to do it is wrong.

closes odoo/odoo#124345

X-original-commit: 26e95e1eb906d6770016a80c39c79eb2be03c1f6
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-09 17:00:55 +02:00