Commit Graph
156695 Commits
Author SHA1 Message Date
Lucas Perais b50fec6aa9 [FIX] web: x2many fields: set display name and correct supported types
Before this commit, the X2ManyField did not have a display name and its supported
types only mentioned one2many.

After this commit, those fields have a display name and the type many2many
is rightfully put has beng handled by the fields.

Part-of: odoo/odoo#107233
2022-12-06 07:01:41 +01:00
niyasraphy fb2132719c [IMP] sales_team: remove unused menu 'menu_sale_config'
'sales_team.menu_sale_config' is not used anymore and can be removed in
order to cleanup a bit unused records.

closes odoo/odoo#107206

Related: odoo/enterprise#34643
Related: odoo/upgrade#4102
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-05 22:02:44 +01:00
niyasraphy bde98499d0 [FIX] purchase_stock: missing documentation link for drop shipping
documentation link for drop shipping feature is missing as the documentation tag was added along with the field rather than the settings tag.

closes odoo/odoo#107192

Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-12-05 18:13:41 +01:00
Maruan Aguerdouh (magm) c911e63c6f [FIX] account_edi_ubl_cii: send and print working properly for invoices
with canary islands taxes

Steps to reproduce:

1. Go to Apps, and Install the module `l10n_es`
2. Go to Accounting App > Customer invoices
3. Create a new Invoice with fake comany, fake address with state set as
`Santa Cruz de Tenerife (ES)` and the ZIP set as 38400.
4. Add any line to the invoice and confirm.
5. Try to Send & Print the invoice, you may need to select the template
before.

Issue:

We won't be able to either print or send the Invoice getting a traceback
containing `KeyError: 'tax_details_per_record'`.

Solution:

Keys for `vals` have change so we need to adapt it to match new keys
naming and sorting for accesing the same values.

FW - port: master

opw-3067491

closes odoo/odoo#107176

X-original-commit: accb722d12e76d178ba70b884a020e162e73634f
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-12-05 17:06:59 +01:00
niyasraphy 3bb81be583 [IMP] pos_restaurant: table_id, customer_count fields readonly
currently the table_id, customer_count fields are editable from the pos order form in the backend and all the other fields are readonly

closes odoo/odoo#107135

Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-12-05 17:06:56 +01:00
Julien Castiaux 05a3ad3159 [FIX] core: skip useless controllers in routingmap
The routing-map is a mapping that maps HTTP verbs and paths to python
controller methods (endpoints), e.g. it maps `GET /web/health/` to
`/web:Home.health`. The `_generate_routing_map` function is the function
responsible to generating the werkzeug routing-map in regard to the
controller inheritance mechanism. The mechanism makes it possible to
override an endpoint is various odoo modules to enrich it with new
features, e.g. `/web/login` is overriden in website to change the visual
of the page.

Implementation-wise, the informations from each `@route` decorator must
be merged with the other `@route` info for each endpoint override. When
a method is not overriden in a controller, there is not new info and
that controller should be skipped for that method.

The previous implementation attempted to skip such method using the
following idiom:

    if not hasattr(controller, method_name):
        continue

That idiom doesn't work as `hasattr` will perform a lookup on the full
controller's MRO instead of a lookup only on controller's own methods
and attributes. The controller's own methods and attributes are
actually found in `controller.__dict__`.

closes odoo/odoo#107064

X-original-commit: 42f52d26b6a81a68f1fe28e28971f0e7f4c97d11
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-05 16:06:49 +01:00
maximilien(malb) d151158637 [IMP] account, account_asset: account move views with assets
This PR add a new page "Accounting Documents" with the journal entry, the list view asset_id and the statement_line_id. This make the first page more concise and allow the related asset to be more visible and simple to work with.

closes odoo/odoo#107205

Task-id: 3075466
Related: odoo/enterprise#34642
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-12-05 14:04:08 +01:00
niyasraphy 5dd5dd2669 [IMP] point_of_sale, l10_nl: change openerp tag to odoo
change the openerp xml tag to odoo in point_of_sale and l10_nl module

closes odoo/odoo#107191

Related: odoo/enterprise#34636
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-12-05 14:04:02 +01:00
qsm-odoo c7c0a6679e [FIX] website_blog, *: allow more than 6 blog posts in dynamic snippet
*: website

Commit [1] introduced the possibility to configure "website filters"
used in the website to display some records dynamically via the "dynamic
snippet" and its variants. One of their field is `limit` which is a max
number of records the filter allows to show (so that the client side
cannot ask for thousands of records). Users can configure the limit used
by a snippet via the editor: they are allowed to choose up to 16, still
safe-guarded by the internal limit configured on the website filter on
the python side.

The problem here was that [2] introduced website filters for the blog
posts but set up a max limit of 6. Thus breaking the editor option if
the user choose a limit between 7 and 16. This commit fixes the issue,
for newly configured snippets (as a stable fix) or for users who would
-u their blog application. EDIT: as the master version of this fix, all
blocks will now use their set limit. We consider that is an acceptable
change after migration that the user can change by himself if he wants
to.

Steps to reproduce:
- Install blog application
- Add a "Blog Posts" snippet
- Set "Fetched Elements" to 10 (there are 7 records in demo data)
=> Only 6 are still shown

[1]: https://github.com/odoo/odoo/commit/0e7640b5f22d2bea04bbe22d3189cff7e03af545
[2]: https://github.com/odoo/odoo/commit/3c0d98bcd8adf9325ee3497eb8d25ec7f904d6a5

opw-2885948

closes odoo/odoo#107179

X-original-commit: 3a3dc8729aa2beec49602fe4c141043f60effdf1
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-05 14:04:00 +01:00
Julien Castiaux d9cb0671a6 [FIX] core: converse existing context in JSON-RPC
Define the following controller:

    @route('/get-context', auth='public', type='json', website=True):
        return request.env.context

Access that route via JSON-RPC providing a context:

    this._rpc({
        route: '/get-context',
        params: {
            context: {"a": 1}
        }
    })

Since httpocalypse, it replaces the context entirely instead of updating
it. i.e. before you would get along those lines:

    {"a": 1, "lang": "en_US", "tz": "Europe/Brussels", "uid": 2}

but since you get instead (and that's wrong):

    {"a": 1}

Note that after this commit, this merging-context behavior will be the
same whether or not website=True is defined (while it was only there for
website=True before).

Discovered via opw-2885948

X-original-commit: 7887cfc3f177d9e64f008aabb8bd710f54024dea
Part-of: odoo/odoo#107179
2022-12-05 14:04:00 +01:00
niyasraphy 928d584f20 [IMP] pos_restaurant: add sheet tag for restaurant.table form view
closes odoo/odoo#107133

Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-12-05 14:03:51 +01:00
Achraf (abz) a8d30764ae [FIX] web_editor: Fix MissingError traceback
A MissingError traceback that occurs in `_build_bus_channel_list` was
caught by Sentry. This error has been seen 1.3k times in the last 30
days from several customers.

The fix simply consists in checking if the document exists before
checking the rights on it.

Traceback:
```
MissingError: Record does not exist or has been deleted.
(Record: project.task(83,), User: 6)
  File "addons/bus/websocket.py", line 879, in _serve_forever
    req.serve_websocket_message(message)
  File "addons/bus/websocket.py", line 752, in serve_websocket_message
    service_model.retrying(
  File "odoo/service/model.py", line 134, in retrying
    result = func()
  File "addons/bus/websocket.py", line 767, in _serve_ir_websocket
    ir_websocket._subscribe(data)
  File "addons/bus/models/ir_websocket.py", line 38, in _subscribe
    channels = set(self._build_bus_channel_list(data['channels']))
  File "home/odoo/src/enterprise/16.0/spreadsheet_edition/models/ir_websocket.py", line 13, in _build_bus_channel_list
    return super()._build_bus_channel_list(channels)
  File "addons/web_editor/models/ir_websocket.py", line 33, in _build_bus_channel_list
    document.check_access_rule('read')
```

SAAS-K22 (sentry code)
opw-3086292

closes odoo/odoo#106982

X-original-commit: 9e4c5e427285b76000398476e9d923e7ea036a65
Signed-off-by: Achraf <abz@odoo.com>
2022-12-05 14:03:49 +01:00
Kishan Gajjar 871ff74d3d [FIX] website: restore narrow mega menu
Since [1], the narrow mega menu is broken because with BS5 the class
'dropdown-menu' is having a more specific CSS rule to set its left
property. This commit increases the specificity of Odoo related rule.

[1]: https://github.com/odoo/odoo/commit/c48f57ea2538ad51e00ac27d58f8e191781444f3

Closes https://github.com/odoo/odoo/pull/107074

closes odoo/odoo#107177

X-original-commit: 27e66ae4c9ccfbc3f309cac9729fe097226e0cae
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-05 13:02:29 +01:00
pedrambiria 5dabdcd5f8 [FIX] payment_sips: accept scoreInfo in payment response
After a payment is processed by SIPS, a data object is posted back
to Odoo. The data has a `ScoreInfo` element that has more than one
`=` characters (e.g. `scoreInfo=A3;N;N#SC;N;TRANS=3:2;CUMUL=4500:250000`)
This causes the method `_sips_data_to_object` to break, because there
will be too many values to unpack.

To fix this, we should limit the data split to 2 values. This is the
same method used by SIPS to process data as well.
(See: https://github.com/worldline/Sips-International-non-FR-PHPlibrary/blob/master/lib/Sips/PaymentResponse.php#L73)

opw-3071315

closes odoo/odoo#107143

X-original-commit: 3dce793ad00b1c0b9f06c705f40e31666db74a06
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2022-12-05 13:02:24 +01:00
maximilien(malb) 81a32cf3f9 [IMP] l10n_rs: translation and small modification
Ideally, we develop in English any localization (then translate to the domestic language, in this case Serbian) All the module has been translated in english and then a .po file has been create to translate back in Serbian

Added more info on the description of the module and activate storno by default.

closes odoo/odoo#107101

Task-id: 3086250
Related: odoo/enterprise#34608
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-12-05 13:02:18 +01:00
Denis Ledoux 51e12ca394 [FIX] base: continue stack post-processing after adding <t groups=
In a view, in the case of a field node combining
- a `groups` attribute on the field node in the view architecture
- a `groups` attribute on the field in the Python model

e.g.
```py
name = fields.Char(groups='base.group_system')
```
```xml
<field name="name" groups="base.group_multi_company"/>
```

The view post-processing adds a temporary `<t groups` block.
e.g.
```xml
<t groups="base.group_system">
    <field name="base.group_multi_company"/>
</t>
```
This is to make an `AND` connection with the two groups:
the user is required to have both groups in order to see the field.
Currently, there is no way to make that `AND` combination on the same
node. The below:
```xml
<field name="name" groups="base.group_system,base.group_multi_company"/>
```
would be an `OR` connection, not an `AND.`
Hence this temporary added `<t groups=""`.

Before this revision, in such a case,
the stack post-processing was interrupted by an unexpected side-effect:
The field node changes of parent (the parent becomes that `t` block),
and a condition attempting to check that the node wasn't deleted from
the view actually checked that the parent changed, to decide to
interrupt the rest of the stack post-processing, including the modifiers
post-processing for that node.

This revision changes this behavior,
to check the field node no longer has a parent,
instead of a change of parent,
to decide that the node is indeed no longer in the view,
and to interrupt the stack post-processing or not.

This allow the field modifiers (e.g. `attrs=""`) to be post-processed
as expected.

opw-3072910

closes odoo/odoo#107173

X-original-commit: c163cbb6a9b3679067606868e325d9842ea66aa8
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-12-05 10:08:01 +01:00
Florent de Labarre 4e98f9902c [FIX] stock_account: method doesn't wok with a recordset
If you try to get show_reset_to_draft_button for more than one account.move, it can raise.

closes odoo/odoo#107169

X-original-commit: a5b985e8449a1e858c3fb9a0a90a6d203e16f739
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-05 10:07:58 +01:00
arsi 8169f64001 [FIX] mrp_subcontracting: add subcontracting loc for archived company
The problem is that when you archive a company and then install
subcontracting, you get a traceback.

Step to reproduce (in a multi-company environment):
-install 'stock'
-archive a company
-install 'mrp_subcontracting'
-->traceback

Explanation:
When installing the 'mrp_subcontracting', there's a search on all
(active) companies in order to add a subcontracting location for each
of them (this is is triggered by
'/odoo/addons/mrp_subcontracting/data/mrp_subcontracting_data.xml').
But there is still a warehouse linked to the archived company.
So when adding routes to all warehouses and looking for the
subcontracting location of the archived company, it is set to
False.  Which is not intended and causes the traceback.

Solution:
Add '.with_context(active_test=False)' to the search for the companies
in '_create_missing_subcontracting_location(self)', so the missing
subcontracting location will be created for the archived companies too.

Discussion:
-The ability to archive companies is new to Odoo16 (implemented due to
the new pricing).
-Here I considered that we want to create a subcontracting location for
an archived company instead of taking action on the warehouse linked to
the archived company (like not considering it when creating routes).
I did this because a company can be unarchived and with this fix, it
will not cause issues.
-I think other problems similar to this one (in any app), should appear
in the future.

opw-3039495

closes odoo/odoo#107168

X-original-commit: 1dcdbe9e3cc21af50ed580c032b1927e21c3c24b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-05 10:07:55 +01:00
Antoine Guenet e0aae26c4d [FIX] web_editor: show the correct alignment in toolbar when in link
The `align` command applies the alignment to the closest block of the
selected node. Bootstrap sets the default alignment of `.btn` to
`center` but we don't support links with a width that is larger than
their contents so that alignment is not visible. For these two reasons,
we want the toolbar to show the alignment of a link's closest block
rather than that of the link itself.

closes odoo/odoo#107155

X-original-commit: a3bb5b0c4b010b7583af1440cb65e889586636c8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-12-05 10:07:52 +01:00
Antoine Guenet c94c19cc3c [FIX] web_editor: properly apply alignment to links
When the selection was in a link, the alignment buttons didn't work.
That is because they are supposed to align the parent paragraph, which
is temporarily in a contenteditable=false context when the selection is
in a link. This restores the context before applying an editor command,
and restores it afterwards.

task-3083748

X-original-commit: 0a4eb266b198e5e02a3325d063d07c0dd8af0148
Part-of: odoo/odoo#107155
2022-12-05 10:07:52 +01:00
Adrien Widart (awt) f48056fd32 [FIX] purchase_stock,stock_account: convert UoM for price diff
When confirming a bill with a price diff, if the UoM of the bill
line is not the default UoM of the product, the values will be incorrect

To reproduce the issue:
(Need account_accountant)
1. In Settings, enable 'Units of Measure'
2. Create a product category PC:
   - Costing Method: FIFO
   - Inventory Valuation: Automated
3. Create a product P
   - Type: Storable
   - Category: PC
4. Create and confirm a PO with
   - 1 Dozen x P at $50
5. Process the receipt R01
6. Create and process the return RT01 of R01
7. Create and process the return RT02 of RT01
8. Create the bill related to PO
9. Set the bill line price to $60
10. Confirm
11. Open the valuation of P

Error: a stock valuation layer has been created because of the price
diff, which is correct, however the value is not the good one: $670
instead of $10 ($60 - $50)

When confirming the bill, we check if there is a price difference.
To do so, we compare the price unit of the bill line with the one of
the incoming layer:
https://github.com/odoo/odoo/blob/d3d41c7679f9068a7b986925b15d0d7670233bfc/addons/stock_account/models/account_move.py#L304
But, currently, the price unit of the bill line is based on the UoM
of the line while the price unit of the layer is based on the
default UoM of the product. We need to convert the PU of the bill line

OPW-3081449
OPW-3062433
OPW-3075917
OPW-3048587
OPW-3078429
OPW-3075627

closes odoo/odoo#107145

X-original-commit: a1906f0b5e22f03937389d47e6ce5a650f9269e6
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-12-05 10:07:49 +01:00
Adrien Widart (awt) 6326340265 [FIX] purchase_stock,stock_account: convert currency for price diff
When confirming a bill, if its currency is not the one of the
company, and if there is a price diff, the value of the generated
SVL will be incorrect

To reproduce the issue:
(Need account_accountant)
1. Edit the currency of EUR:
   - Rate: 2.0
2. Create a product category PC:
   - Costing Method: FIFO
   - Inventory Valuation: Automated
3. Create a product P
   - Type: Storable
   - Category: PC
4. Create and confirm a PO with
   - 1 x P at $50
5. Process the receipt R01
6. Create and process the return RT01 of R01
7. Create and process the return RT02 of RT01
8. Create the bill related to PO
9. Edit the bill:
   - Currency: EUR
   - Price unit: 120
10. Confirm
11. Open the valuation of P

Error: a stock valuation layer has been created because of the price
diff, which is correct, however the value is not the good one: $70
instead of $10 ($60 - $50)

When confirming the bill, we check if there is a price difference.
To do so, we compare the price unit of the bill line with the one of
the incoming layer:
https://github.com/odoo/odoo/blob/d3d41c7679f9068a7b986925b15d0d7670233bfc/addons/stock_account/models/account_move.py#L304
But, currently, the price unit of the bill line is based on currency
of the account move wile the price unit of the layer is based in the
currency of the company.

Related to OPW-3040171

X-original-commit: 86ca91c3684fe5ea5dac1326278b5d4cce0cecda
Part-of: odoo/odoo#107145
2022-12-05 10:07:49 +01:00
Adrien Widart (awt) 8acc41c66c [FIX] purchase_stock,stock_account: create only one SVL for price diff
When confirming a bill with a price diff, if the user received, returned
and received again the products, some unexpected valuation layers will
be generated

To reproduce the issue:
(Need account_accountant, sale_management)
1. Create a product category PC:
   - Costing Method: FIFO
   - Inventory Valuation: Automated
2. Create a product P
   - Type: Storable
   - Category: PC
3. Create and confirm a PO with
   - 3 x P at $50
4. Process the receipt R01
5. Create and process the return RT01 of R01
6. Create and process the return RT02 of RT01
7. Create and confirm a SO with
   - 1 X P
8. Process the delivery
9. Create the bill related to PO
10. Set the bill line unit price to $60
11. Confirm
12. Open the valuation of P

Error: There are two lines for the price difference, there should be
one line only. Moreover, the value is incorrect: 30 instead of 10 (i.e.
we should generate the price diff layer for the quantities in
stock only)

When confirming the bill, we check if we have to generate some
additional SVL (in case of price diff)
https://github.com/odoo/odoo/blob/d3d41c7679f9068a7b986925b15d0d7670233bfc/addons/stock_account/models/account_move.py#L288-L305
But, we get all ingoing SVL and process them, we don't consider that the
quantity of a SVL might actually be returned and should be ignored.
This is the reason why a SVL is created for the first receipt. This
also explains why the value is incorrect (we use the quantity of the
SVL instead of its remaining quantity)

OPW-3040171

X-original-commit: 18912b05239e6fc5dab26ec4c930f9080882d127
Part-of: odoo/odoo#107145
2022-12-05 10:07:48 +01:00
JordiMForgeFlow 07b1aa5376 [FIX] purchase_mrp: filter cancelled moves when evaluating kit
The current behaviour does not filter the cancelled moves when
evaluating if the product of the purchase order line is a kit.
This causes that, in cases where you have a cancelled wrong receipt
where the product was being received as a kit, if a new receipt is
created without receiving as a kit Odoo will always expect it as a kit.

After the fix, the cancelled moves will not be considered, as this is what
should be expected from cancelled operations.

closes odoo/odoo#107144

X-original-commit: 9659683d1f09c49a3ba3df8770eb7256660d0033
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-05 10:07:45 +01:00
niyasraphy 4ac78ff3e9 [FIX] gamification, hr_gamification: field alignment in grand badge
field alignment in grand badge

closes odoo/odoo#107015

X-original-commit: 2d55fa65e6dd36586b0bf8b20bd2ca4d43e5109b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-05 10:07:39 +01:00
Patrick Hoste 50b7727f36 [FIX] crm,website_slides: fix grouped kanban view
This commit fix the issue where the slide content records,
crm team records and crm team members records were
overlapping on other group.
This was introduced by odoo/odoo#105531

Task-3086887

closes odoo/odoo#107159

X-original-commit: f7a2928afc4bc6f3ce4622f28f7cd9672b8a7b6f
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-12-05 07:30:41 +01:00
Romain Derie a6bf6cf44d [FIX] website, test_website: prevent fuzzy search to crash with inherits
This commit ensures that when searching on a `inherits` field of
a model (like `name` of `website.page`), it works properly when
`pg_trgm` is activated.
Indeed, `name` is a field of `website.page` record but only at the ORM
level, not in SQL, due to how `inherits` works.

So, when the `pg_trgm` extension is enabled, it will switch from ORM
queries to raw SQL query (to use the native SQL similarity feature and
not our custom python/orm one, as obviously the SQL one is better, more
powerfull/accurate and faster).
But this will actually make the code fail when searching on fields from
a model which has `inherits` and that you search on that `inherits`
model fields.

Note that in 15.2, the `pg_trgm` extension is auto installed when
possible thanks to [1] and [2].

[1]: https://github.com/odoo/odoo/commit/eedf37d6e286b995c47b946be1a6b66817094eff
[2]: https://github.com/odoo/odoo/commit/75e6b645acdc95aece506ce0249fd0760838281c

opw-3063592

closes odoo/odoo#107178

X-original-commit: 3d978caad9de2010603581687ee39a5240b74074
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-04 23:41:55 +01:00
Katherine Zaoral a34e5d20c8 [ADD] l10n_latam_check: Checks Management
New features to manage checks and managed them Odoo in latam countries
where they are widely use.

Own Checks Management
---------------------

Extends 'Check Printing Base' module to manage own checks with more features:

* allow using own checks that are not printed but filled manually by the user
* allow to use deferred or electronic checks
  * printing is disabled
  * check number is set manually by the user
* add an optional "Check Cash-In Date" for post-dated checks (deferred payments)
* add a menu to track own checks

Third Party Checks Management
-----------------------------

Add new "Third party check Management" feature.

There are 2 main Payment Methods additions:

* New Third Party Checks:

   * allow the user create a check on the fly from a payment
   * create a third party check from a customer payment

* Existing Third party check:

   * allow the user to reuse a Third party check already created
   * pay a vendor bill using an existing Third party check
   * move an existing checks between journals (i.e. move to Rejected)
   * Send/Receive again a check already used in a Vendor Bill/Customer INV
   * allow the user to do mass check transfers

closes odoo/odoo#107163

X-original-commit: cbec68b414f5b87fe6e146487c532c9a174f40a3
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-04 23:41:53 +01:00
Katherine Zaoral 3b08a62751 [IMP] account, account_check_printing: latam adapt
In order to make this modules to also match new module l10n_latam_check.

* refactory of some methods to make it more heritable
* check number now is showed only when is defined and is related to
check_printing payment method.

X-original-commit: 9394903813947cd4bfbad87f077cdf67233907d8
Part-of: odoo/odoo#107163
2022-12-04 23:41:52 +01:00
Ninh Duc Hieu 958ec7aeb4 [FIX] sale: text overflow
Currently in Sale/Orders/Sales Teams menu , The Sales Analysis dashboard
have text overflow bug for large numbers in USD/EUR this bug might be
rare but in currency like Yuan or VND its common

closes odoo/odoo#106822

X-original-commit: 5cebb129860616d80f8f6db6e261818f4ab54e05
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-04 23:41:50 +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
gawa-odoo 4d7a9eea13 [FIX] analytic: field None should not validate model
If an aml has no product, it should not trigger a model that has a product.
So, we now define the fields that have to be checked on the model, instead of just being the ones given as parameters.

The way the field `company_id` impacts the model has also been changed.
The idea is that a model with a company specified should be better than a model without one.
But we also want that a model with 1 valid rule and no company is better than one with only a good selected company.

closes odoo/odoo#107165

X-original-commit: feff1a8a056f1fbbc852f7cf164e73abf83c4cc9
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-04 17:57:58 +01:00
william f33e1ca222 [FIX] account: performance of search panel
This fixes the performance of the search panel of `account.move.line`
Menu > Accounting > Accounting > Journal Items
The control panel based on the accounts' roots was the issue (call to
`search_panel_select_range`)

Before this fix, the entire table was read through the use of a
`read_group`.
Since the data returned by the `read_group` is not interresting in our
case, we can simply do a lateral join on an indexed column with a limit
in order to improve the performances.

closes odoo/odoo#107164

X-original-commit: 26dd1d9627cdd04e12c3187f0f53c0e11892a345
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-04 17:57:56 +01:00
william-andre 13f98fc7c0 [REV] account: fix the report invoice template
This reverts 0e958ccd85

Using the id instead of the previous xpath makes it less natural.
It was also conflicting with `l10n_au` which was replacing that part
with something else, removing the id.

closes odoo/odoo#107186

Related: odoo/enterprise#34635
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-12-04 14:32:15 +01:00
william-andre 421c02e36d [FIX] l10n_{ar,co_pos}: fix xpath after c7c2959449
This commit was merged during a small hiccup of runbot's l10n staging 🥴

Part-of: odoo/odoo#107186
2022-12-04 14:32:15 +01:00
Solan Delvenne (sode) ee65a44218 [FIX] snailmail: overwrite margins in letters
In order to pass the validation of the snailmail provider, the margins
are required to have nothing but white pixels. To avoid letters being
stuck until their layout is fixed, we fill the margins with white.

closes odoo/odoo#107180

X-original-commit: 206eb42468997d23b9b998530d246aa0bc69607d
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
2022-12-03 02:23:07 +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
william-andre 67b1c47c22 [FIX] l10n_eu_oss: fix xpath after c7c2959449
This commit was merged during a small hiccup of runbot's l10n staging 🥴

closes odoo/odoo#107137

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-12-02 22:04:54 +01:00
Hugo Carlier (Huca) 52c53a0210 [IMP] hr_timesheet, project: Modify timesheet info display in project.task form view
- project.task form view:
    - move the tag_ids field below the user_ids one
    - move the 'allocated hours' field above the 'deadline' one
        - remove the 'progress' field and indicate (x%) next to
        'allocated hours' instead
        - the final output should look something like
    - 10:00 (incl. 05:00 on Subtasks) (50%)
    - the timesheets o2m takes the whole width of the notebook

task-3046210

closes odoo/odoo#104677

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-02 19:49:57 +01:00
Hugo Carlier (Huca) dd4168e3d8 [IMP] project: make task description editable for portal users
A portal user who has access to a project can edit tasks description.

task-3046210

Part-of: odoo/odoo#104677
2022-12-02 19:49:56 +01:00
Paolo (pgi) 7b6df33961 [IMP] account: changing demo vendor bill date
There's a demo vendor bill that is fixed on the 2018, while it
sure should be set at more than an year ago, but not in a fixed
point in time that keeps getting further away from the present moment.

Task link: https://www.odoo.com/web#id=2732449&model=project.task

closes odoo/odoo#107112

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-12-02 18:40:00 +01:00
Nicolas Bayet d5df65bdf4 [FIX] web_editor: reset the options of the editor
Before this commit, when the editor was reset through updateWidget, the
options were not updated.

closes odoo/odoo#106450

closes odoo/odoo#107108

X-original-commit: 8ac396e6709d1a2eb1134e376572c7a7ec0bd15e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-12-02 17:44:15 +01:00
Xavier-Do a0732197f4 [FIX] tests: don't pregenerate asset bundles for upgrade tests
Pregenerate doesn't work for rtl languages. It shouldn't be a problem
but it was discovered that pregenerate run during upgrades leading to
errors

```
Traceback (most recent call last):
  File "/home/odoo/src/odoo/16.0/odoo/service/server.py", line 1314, in preload_registries
    env['ir.qweb']._pregenerate_assets_bundles()
  File "/home/odoo/src/odoo/16.0/addons/website/models/ir_qweb.py", line 180, in _pregenerate_assets_bundles
    _, _, _, id_unique, name = bundle_url.split('/')
ValueError: too many values to unpack (expected 5)tore the set of known environments as it was at setUp
```

This is because the rtl is an extra in the url breaking the logic.

Pregenerate is mainly usefull for tests on runbot
(or running tests locally), to speedup httpcases
avoiding generation at each page load.

IntegrityCases are postinstall but don't requires generating assets, or
at least no so often meaning that we can avoid the pregeneration in this
case. It should also avoid losing some time on pregeneration since it
is not useful.

This new logic only pregenerate if we have at least one HTTPCase in the
test suite. This should also speedup local testing when starting
non http post_install tests.

closes odoo/odoo#107107

X-original-commit: 43a5c17088707eec134d54ccf9341e86859f88c7
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-12-02 17:44:13 +01:00
Florian Charlier 987ca5c2b8 [REF] *: use f-strings
* = crm, mail, survey, test_event_full, website_event

To increase readability and performance, use f-strings where appropriate
(multiple concatenation +- formatting).

Note: Also removing unnecessary string concatenation with `%` for `(i)like`
in domains definitions.

Task-2977548
See odoo/enterprise#31156

closes odoo/odoo#99811

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-12-02 16:41:50 +01:00
Nicolas (vin) 0e958ccd85 [FIX] l10n_pe: fix the report invoice template
At the moment, a wrong xpath is causing the l10n_pe
modules installation to fail.
Correct it and ensure that it works.

See https://github.com/odoo/enterprise/pull/34464

closes odoo/odoo#107096

Related: odoo/enterprise#34603
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-02 15:34:48 +01:00
sofiagvaladze bfa7a47c86 [IMP] hr_holidays: hinder allocation date_to to precede date_from
Purpose: In order to reduce the possibility to make errors, make the end
date of the validity period always come after the start date.

task - 3069666

closes odoo/odoo#106966

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-02 14:40:28 +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
clesgow 7b8bb75368 [IMP] mrp{,_subcontracting}: Remove context calls when not necessary
Since fixes done on the bom overview had to be done in a released
version, no method signature changes could be done, hence the use of
excessive context keys to bypass it.

Changes the signatures so that future work is done on better grounds,
and so that each method explicitely asks for what parameters it needs to
do its work.

closes odoo/odoo#107006

Related: odoo/enterprise#34577
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-12-02 13:41:53 +01:00
JF Aubert c21cf21de4 [REF] stock: replace stock.scrap onchanges by computes
closes odoo/odoo#104062

Task: 2985735
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-12-02 13:41:48 +01:00
JF Aubert 25c808f9fc [FIX] stock: fix scrap creation
Commit 168cbe66bee7824bdf389de5c6c680342e27bc6d removes fields
with the 'groups' attribute from views when the user is not part
of the groups.

This is the case of product_uom_id in stock_scrap_form_view2,
but the field is mandatory for scrap creation,
therefore we use the unit of measure of the scrapped product
when not provided (as this is the case when uom are not checked).

Task: 2985735
Part-of: odoo/odoo#104062
2022-12-02 13:41:47 +01:00