Commit Graph
1326 Commits
Author SHA1 Message Date
yosa-odoo 4e9f542cb1 [FIX] analytic: display correct analytic when using arrows
Steps to reproduce:
- activate analytic
- Create two assets with different analytic distribution
- Open the first asset
- Navigate to the second asset via the arrow

Issue:
The analytic account will not be displayed correctly

Cause:
In `jsonToData` the record used is the previous one.

Solution:
Use the record that will efectively be displayed

opw-3698383

closes odoo/odoo#153681

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2024-02-27 20:15:14 +00:00
Xavier Bol (xbo) f5d6a2db3b [FIX] analytic,sale: confirm SO with "expense" product
Before this commit, when a salesman user without any access in other
apps (just has the `sales_team.group_sale_salesman` group) creates
an SO and adds a SOL for a product with `expense_policy='sales_price'`
and then confirm the SO, he will got a traceback because he does not
have access to `analytic.account.line` model. The reason is because
an analytic account has to be generated for the SO since there is an
expense product in its SOLs and so during the generated of analytic
account a check is triggered to be sure the company set on that
analytic account is correct.

This commit adds a sudo before calling the search method in
`analytic.account.line` model to do the check without checking
the access right since the user does not really want to read the
analytic account line.

Steps to reproduce
==================
1. Log in as Salesman user (without other access)
2. Create a product and the expense policy to Sales price.
3. Create a SO and add a SOL with that product
4. Confirm the SO

Expected Behavior
=================
The SO should be confirmed without any issue (and an analytic account
should set on that SO)

Actual Behavior
===============
Traceback is occured because the user cannot access to
`analytic.account.line` model.

Follow-up task-3256865

closes odoo/odoo#155238

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-02-27 08:07:48 +00:00
Odoo Translation Bot 4f4ca50e8d [I18N] Update translation terms from Transifex 2024-02-25 00:13:04 +01:00
Odoo Translation Bot 1cf48deef9 [I18N] Update translation terms from Transifex 2024-02-18 00:12:23 +01:00
Odoo Translation Bot dd40867949 [I18N] Update translation terms from Transifex 2024-02-11 00:14:17 +01:00
Gauthier Wala (gawa) 59aae9767f [FIX] analytic: can't create plan with access.
You should be able to create analytic plans with analytic group.
But currently, you need Access Right's group.
We should put a sudo there.

closes odoo/odoo#151328

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2024-02-07 09:18:50 +00:00
Tiffany Chang (tic) 94c58407f6 [I18N] *: add in Russian translations
For a first iteration, Russian translations were done using DeepL using
1 large .pot file of all the standard modules to translate (e.g. no
localizations, no test modules, etc). Unfortunately for some reason
doing a msgmerge with the existing ru.po files didn't seem to work, so
old "Translators" metadata at top of files were lost (maybe they will be
re-added during next Transifex sync?)

Part-of: odoo/odoo#152285
2024-02-06 18:49:02 +00:00
william-andre bdd724b1a3 [IMP] analytic: index the dynamic plan columns
The table linked to analytic items can be pretty huge, and searching by
account needs to be fast.
For instance, this index can be used when deleting an account because of
the foreign keys.

closes odoo/odoo#151366

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2024-02-06 18:49:01 +00:00
william-andre 0ff125b957 [FIX] analytic: prevent errors when a plan or an account is deleted
Deleting an account or a plan shouldn't raise errors or provoke errors
elsewhere.
Since the `analytic_distribution` doesn't have a proper foreign key, an
account might be deleted while still being referenced. Because of this
the code needs to be defensive everywhere: we can't trust the content of
the JSON field.

Also, add tests to ensure that we can't delete a plan while the field is
still referenced in views.

closes odoo/odoo#152494

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-02-05 23:51:14 +00:00
Odoo Translation Bot c95419af44 [I18N] Update translation terms from Transifex 2024-02-04 00:11:05 +01:00
william-andre 133356da4c [FIX] analytic: populate analytic lines
The `sum` function needs to be given a compatible for the `start`
argument.
Instead of using that function for a simple sum of two elements (not
`int`), lets just sum them explicitly instead.

Traceback:
```
TypeError: unsupported operand type(s) for +: 'int' and 'account.analytic.plan'
```

closes odoo/odoo#151738

Signed-off-by: Raphael Collet <rco@odoo.com>
2024-01-31 06:59:14 +00:00
Odoo Translation Bot 625dac5a10 [I18N] Update translation terms from Transifex 2024-01-28 00:16:34 +01:00
Odoo Translation Bot 95a4b6dfdc [I18N] Update translation terms from Transifex 2024-01-21 00:17:03 +01:00
guva-odoo 461ac4cb3a [FIX] analytic: all accounts count wrong on sub plans
When having an analytic plan with subplans, with analytic
accounts on each, the all accounts count is not well computed
on the subplans.

opw-3677889

closes odoo/odoo#149898

Signed-off-by: William André (wan) <wan@odoo.com>
2024-01-19 13:13:53 +00:00
Odoo Translation Bot b81790505b [I18N] Update translation terms from Transifex 2024-01-14 00:16:26 +01:00
kdeb@odoo.com 5860b086c0 [FIX] analytic: error when you tab through the fields on a vendor bill
Issue:
- When you have analytic plans but no analytic accounts you got a
traceback when you tab through the fields on a vendor bill.

Steps to reproduce:
- In accounting app create a vendor bill where analytic plans exist
without associated analytic accounts.
- Use the key 'Tab' to move through the fields on the vendor bill.
- Notice Traceback error.

Solution:
- Checking if the dropdown is not empty before proceeding with the Tab
key logic.

OPW-3648815

closes odoo/odoo#147807

Signed-off-by: William André (wan) <wan@odoo.com>
2024-01-09 20:51:43 +00:00
Odoo Translation Bot 0e23020b84 [I18N] Update translation terms from Transifex 2024-01-07 00:23:19 +01:00
Odoo Translation Bot ad35458e8b [I18N] Update translation terms from Transifex 2023-12-31 00:18:24 +01:00
Odoo Translation Bot 50e8e08183 [I18N] Update translation terms from Transifex 2023-12-24 00:18:24 +01:00
Gauthier Wala (gawa) 5506ca7479 [FIX] analytic: gross margin domain empty
To reproduce:
- Create a new plan with an account
- Add an analytic item with this account
- Go to the view of this account
- Gross Margin Button has a value
- Click on it
=> List is empty

The reason being that the view should not include account_id,
but auto_account_id

closes odoo/odoo#147080

Signed-off-by: William André (wan) <wan@odoo.com>
2023-12-21 13:01:15 +00:00
Abdelouahab (abla) 70abc5d083 [FIX] analytic: read analytic plan
To reproduce
============
Users in a newly created database are not able to create new projects
that has timesheet enabled

Problem
=======
when creating a project with timesheet, an analytic account is created
which requires reading `analytic.plan` which leads to the access error

Solution
========
read `analytic.plan` through `sudo`

opw-3642817

closes odoo/odoo#146769

Signed-off-by: William André (wan) <wan@odoo.com>
2023-12-20 15:21:34 +00:00
Habib (ayh) 8725127d45 [FIX] analytic: remove precompute
Anlytic distribution models did not apply to bank recon entries. The corresponding enterprise PR activates the feature, however due to dependencies on non-precomputed fields, the attribute is removed

OPW-3558060

closes odoo/odoo#146235

X-original-commit: b9047febf3c4d67ce409f9f1dba8a9cc7c7165fe
Related: odoo/enterprise#52742
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-12-18 23:31:56 +00:00
Odoo Translation Bot 304a6caa14 [I18N] Update translation terms from Transifex 2023-12-17 00:08:26 +01:00
Odoo Translation Bot 8ab45d4a85 [I18N] Update translation terms from Transifex 2023-12-10 00:12:46 +01:00
Odoo Translation Bot 2ac98dc2e5 [I18N] Update translation terms from Transifex 2023-12-03 00:18:54 +01:00
Odoo Translation Bot 3ffba892de [I18N] Update translation terms from Transifex 2023-11-26 00:20:02 +01:00
Gauthier Wala (gawa) 83efa5993e [FIX] analytic: plans without account but with subplan can appear
If we have an analytic plan without analytic accounts, but with
subplans that do have analytic accounts, we do want them to
appear in the widget.

Also changed a search in a loop to a read_group

closes odoo/odoo#142222

Signed-off-by: William André (wan) <wan@odoo.com>
2023-11-21 20:06:41 +00:00
Odoo Translation Bot f6fe982853 [I18N] Update translation terms from Transifex 2023-11-19 00:28:08 +01:00
Louis (wil) 68b4dfc2bb [I18N] *: import translations
closes odoo/odoo#141655

Related: odoo/enterprise#50484
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-11-08 20:48:14 +00:00
william-andre a5f00ac011 [FIX] analytic: plan column not created
Reproduce:
* create a sub-plan (with parent_id)
* make that plan a main plan (void parent_id)
* open the analytic line view

Result:
Traceback because the dynamic field was not created

closes odoo/odoo#141409

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-11-07 23:57:44 +00:00
Habib (ayh) 00efda4d77 [IMP] analytic,purchase,sale: misc analytic improvements
1. Order Plans by sequence in the widget and analytic item views
2. Add amount_field to analytic widget in sales and purchase views
3. UI improvements (split plan name and percentage)

Task-3572128

closes odoo/odoo#141030

Signed-off-by: William André (wan) <wan@odoo.com>
2023-11-07 19:32:22 +00:00
william-andre b6c108e775 [FIX] analytic: insert analytic lines in spreadsheet
How to reproduce:
* Install Accounting and Documents
* Accounting > Configuration > Settings > check Analytic Accounting
* Accounting > Accounting > Analytic Items
* Cogs > Spreadsheet > Insert List

Issue:
The header in the spreadsheet displays errors.

closes odoo/odoo#141230

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-11-06 15:36:59 +00:00
Odoo Translation Bot 5d2bc9e9b3 [I18N] Update translation terms from Transifex 2023-11-05 00:21:55 +01:00
Odoo Translation Bot 6739c317d1 [I18N] Update translation terms from Transifex 2023-10-29 00:07:17 +02:00
Louis (wil) 3f6f949fa5 [I18N] export sources
closes odoo/odoo#140002

Related: odoo/enterprise#49687
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 08:36:16 +00:00
williamandh4818 dc696c8ed4 [IMP] analytic: allow cross analytics
Purpose
=======

Make it possible to compare analytic values between plans by inputting
up to one account per plan on each line.
For instance, if we have 2 plans: "Country" and "Product Type", with the
following accounts

| Country | Product Type |
| ------- | ------------ |
| BE      | Drinks       |
| LU      | Food         |

And the following invoices:
* 1000€ of drinks in Belgium
* 2000€ of food in Belgium
* 3000€ of food in Luxemburg

We want to be able to display the following pivot tables:

|     | Drinks | Food | Total |
| --- | ------ | ---- | ----- |
| BE  |   1000 | 2000 |  3000 |
| LU  |      0 | 3000 |  3000 |
| Tot |   1000 | 5000 |  6000 |

|        | Total |
| ------ | ----- |
| Food   |  5000 |
| * BE   |  2000 |
| * LU   |  3000 |
| Drinks |  1000 |
| * BE   |  1000 |
| Total  |  6000 |

Implementation
==============

* `ir.fields` are added/removed dynamically on `account.analytic.line`
* Each analytic plan corresponds to one field on `account.analytic.line`
* The fields are added dynamically in the views.
* `account.analytic.plan` doesn't have a `company_id` field anymore,
  meaning that all the companies have access to all the plans. This
  means that the applicability fields and lines are now company
  dependent, and those can be used to know which fields/plans to display
  for which company.
* There can no longer be one "Project" plan per company, even if the
  accounts of that project can still be owned by only one company.
* There is now only one method to get the default (or "Project" plan),
  which is `_get_plan_columns`

task-3497653

closes odoo/odoo#139225

Related: odoo/upgrade#5306
Related: odoo/enterprise#49226
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: william <wan@odoo.com>
Co-authored-by: h4818 <ayh@odoo.com>
2023-10-25 18:10:57 +00:00
John Laterre (jol) 76c0b8ef06 [IMP] account,analytic,hr_timesheet: harmonize analytic search view
The aim is to harmonize the analytic search view between `hr_timesheet` and `account` by creating an inheritance from `analytic`.
This allows the accountant to have access to all the fields and filters defined in other modules.

task-3463639

closes odoo/odoo#138542

Related: odoo/enterprise#48870
Related: odoo/upgrade#5271
Signed-off-by: William André (wan) <wan@odoo.com>
2023-10-20 14:59:16 +00:00
Bruno Boi b449ae6036 [IMP] web: improve usePosition API
**Before this commit**
The usePosition hook takes two arguments:
- the target element (could be a function returning an element)
- the positioning options, which are optional.

This API is a bit weird for these reasons:
- the target argument's type is variable
- the "popper" option is not very meaningful and has a
  default value of "popper", which is not clearly stated

**After this commit**
The usePosition hook now takes three different arguments:
- first is "refName", which is the reference to the element to position
  in the template
- then is "getTarget", a callback that must return the target element,
- finally the "options"

Part-of: odoo/odoo#135188
2023-10-13 21:11:52 +00:00
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
Yolann Sabaux e4fc2ec5e3 [FIX] analytic: prevent closing the analytic editor
steps to reproduce:
- enable analytic
- open journal items in list view
- select one item, set an analytic account
- select the same item, click on the analytic account, click on the save button (floppy disk)
- pop up opens
- close it

Issue:
Traceback

Cause:
In multiEdit mode, the main element cannot be focused in

opw-3463911

closes odoo/odoo#136576

X-original-commit: 93e553c211e1b74c0e712e387290db6455cf0e3d
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-09-27 17:41:04 +00:00
luvi b91f4034ab [IMP] *: improve documentation of options in fields metadata
*: analytic,  base_automation, loyalty, mass_mailing, project, web, web_editor, website

This commit adds many new documentation of options and their usage for
fields. This makes them more usable and customizable in Studio, and adds
documentation for developers to know the type of expected option.

Some options that might lead to issues or that are too technical have
been removed, as they are not relevant and not required in most use cases.

task-3469741

closes odoo/odoo#134858

Related: odoo/enterprise#47148
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-09-27 14:57:03 +00:00
Damien Bouvy 180de8afe6 [IMP] web, *: replace view all with search more
This partially reverts commit da50ce31ae825ef9f4b527553a2e2caec970d290.

Whilst the behavioral changes done in the task are correct, the wording
is not optimal and was better understood by users before this change.

Task-3483936

closes odoo/odoo#133511

Related: odoo/enterprise#46503
Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
2023-09-04 17:10:05 +00:00
Pierre Paridans 8bbe70433d [IMP] web,*: remove unused .o-dropdown-menu class
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00: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 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
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
Louis Wicket (wil) f1722c7334 [IMP] *: unify sprintf and gettext
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.

closes odoo/odoo#123932

Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-10 18:14:04 +02:00
Anh Thao Pham (pta) 4a38bf2927 [FIX] analytic: limit width of analytic tag to 200px
Steps to reproduce:
- Activate "Analytic Accounting" in Accounting settings
- Go to Accounting / Configuration / Analytic Accounting / Analytic Accounts
- Create an Analytic Account with a very long name (i.e. +100 chars)
- Go to Expenses
- Create an Expense with the created Analytic Account in the Analytic field
The display of the labels in the form view should break because the badge is too
long and is taking all the available width.

Solution:
Limit the width of tag badges in "analytic_distribution" widget as it is done in "many2many_tags" widget.
https://github.com/odoo/odoo/blob/2f47df6663b65c4f6b6ec61f956c453e97563462/addons/web/static/src/views/fields/many2many_tags/many2many_tags_field.scss#L47-L49

opw-3322688

closes odoo/odoo#131136

X-original-commit: 32fc4d44446a15b215c3f61cb2b35fa6f4ecb95b
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2023-08-08 08:56:22 +02:00
John Laterre (jol) d94a3087be [IMP] account,analytic: UI/UX improvements
Miscellaneous improvements:
1. In analytic tags, the percentage is now a prefix.
2. In the widget, 0% accounts are now hidden.
3. In the analytic items list/pivot views, it is now possible to search by:
- Financial Account.
- Cross by.
4. By default, the pivot view is now grouped by plans and then analytic accounts.
5. An "Analytic Reporting" menuitem that opens the pivot view is added in Reporting > Management.

task-3446504

closes odoo/odoo#130971

X-original-commit: adb8ec875c9b4e299147c46dc60a87fd26fff91f
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-08-06 20:27:15 +02:00
Gauthier Wala (gawa) e8d9a21b5c [FIX] analytic: filter analytic distribution boolean inverted
- Create Journal Entries with analytic distribution
- Go in Journal Items list view
- Filter with 'Analyic is set'
=> The wrong entries are filtered

The problem is that the replacement of the domain for the search
has changed with a factoring of the function, which causes the
search replacement to occur with booleans, which is not needed.

closes odoo/odoo#130760

X-original-commit: 5d2accdf56ccd86c8797743f151ad80b614f0f77
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2023-08-04 09:43:20 +02:00