Commit Graph
158118 Commits
Author SHA1 Message Date
Denis Ledoux f498ab4b13 [IMP] base: remove unused check_group methods on ir.model.access
It looks like these methods where an alternative to `has_groups`,
but not used since a while.

In Odoo 10.0, there is only one hit, in point_of_sale,
which has been replaced by `user_has_groups`
in 11.0 with revision
34c661111b

In Odoo 9.0, there are a few more hits in base,
which have been replaced by `self.env.user.has_group`
in 11.0 with revision
4ddc323139

closes odoo/odoo#111622

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-02-02 21:25:12 +01:00
Ivan Yelizariev 931595165d [FIX] pos_loyalty: fix order syncronization
This commit is a forward port from v16. It completes another commit that was
done in master only:
https://github.com/odoo/odoo/commit/7c415e972fa97ba52d8d5165fd47494965e3053d

---

Module `pos_restaurant` synchronizes orders between different POS devices. It
works by pushing order from POS to server and loading it back. This commit
assures that loyalty fields are correctly prepared before returning values to js
client. Specifically, many2one fields must be just ids [1] [2], and not `[id,
name]`. Similar cleaning is already done in `pos_restaurant` module for `product_id`
field [2].

To correctly implement this patch, empty `_prepare_order_line` is added to
`point_of_sale` module to be sure that extension of that method in `pos_loyalty`
is not ignored: the method in `pos_restaurant` didn't have `super` call and
`pos_loyalty` module doesn't depend on `pos_restaurant`

STEPS:
* install pos_restaurant, pos_loyalty
* prepare gift card
* open pos, create order, apply gift card
* switch to floor screen and then back to table (order) screen

[1]:
https://github.com/odoo/odoo/blob/c4b90db77705139333bdf5faf26b12fc120d1661/addons/pos_loyalty/static/src/js/Loyalty.js#L833
[2]: https://github.com/odoo/odoo/blob/c4b90db77705139333bdf5faf26b12fc120d1661/addons/pos_restaurant/models/pos_order.py#L76

closes odoo/odoo#111617

X-original-commit: 0cf1fb6cf9dad69d58939d735081428a5e1650f4
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-02-02 21:25:09 +01:00
tsm-odoo fa028a18df [FIX] bus: make bus_service recover faster from offline/online switch
Before this PR, recovering from an offline/online switch could
take up to 20mn. Indeed, WebSocket are based on TCP that uses
FIN packets to close the connection. In case of a sudden loss
of internet connection, the client is unaware of the already
dead TCP connection. It is up to the browser to assume the
connection is dead after some time.

This commit solves the issue by closing the connection properly
upon the reception of the offline event. When the client is back
online, the connection is opened again thus allowing an almost
instant recovery.

At the same time, this PR increases the default keep_alive_timeout
for websocket connections. Indeed, those re-connections lead to cursor
usage bursts and are not required so frequently.

closes odoo/odoo#111274

X-original-commit: d3a3792e5247cc41a58b47d148d4adf4fb0e4631
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-02-02 18:46:02 +01:00
niyasraphy 1436aa84c7 [FIX] mrp: mrp.bom model product_qty field precision
before this commit, the precision given for the field product_qty in mrp.bom model is Unit of Measure, which is not existing by default in Odoo decimal precisions.

after this commit, precision will be updated to default Product Unit of Measure precision

closes odoo/odoo#111115

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-02 15:02:13 +01:00
Cyril Dutrieux (cydu) 768a2e438f [FIX] purchase: Prevents logging a qty update when qty isn't updated
closes odoo/odoo#110905

X-original-commit: dbf526ba37e0e34a569aee079e4cd65b24a6d6d0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-02 15:02:10 +01:00
Michael (mcm) 42a57110eb [IMP] web: enable list button for draft record
Before this commit, the buttons of the draft record in a
list view were disabled. Now, they are enabled and will
save (create) the record before executing the button's action.

closes odoo/odoo#110383

Task: 3132960
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-02 15:02:07 +01:00
Florian Damhaut 5c3589ebe7 [IMP] web, calendar: make odoo calendar google again
This PR change generic calendar view to make it behave more like
google calendar.

These changes includes :
- Scss rules for small event(<15 minutes) so that the title is always readable.
  On top of that, the top border of a darker color has been removed
  for these even to allow more space.

- Event longer than 24h are now shown in the all day column independent
  of their 'allday' status

- Time is now added in the event description, if the event is
 shorter than 30 minutes, only the start time is displayed at the end
 of the line.
 If the event is longer, the start time and end time are displayed
 on a new line.

task-id : 3114155

closes odoo/odoo#109736

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-02-02 15:02:04 +01:00
luvi 1f022636f0 [ADD] web: add boolean_icon field widget
This commit adds a new widget to the field registry. This button
is represented with an icon and acts as a boolean field widget.
The label is shown as a tooltip when hovered.

A test file has also been added to verify its behavior.

task #3121078

closes odoo/odoo#110365

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-02 08:11:58 +01:00
Nasreddin Boulif (bon) 556b1b656d [FIX] survey: fix print of survey results
Steps to reproduce (Using Chromium-based browser > v. 108):

  - Install Survey module
  - Open 'Feedback Form' survey
  - Click on 'See Results' button
  - Try to print the 'results' of 'Feedback Form'

Issues:

  - Hundreds of empty pages added when printing.
  - Chart not fully displayed.

Cause:

  - The chartjs library add some HTML elements not displayed (inside div
  with class `chartjs-size-monitor`) to handle the resizing of the
  chart canvas.
  One of the element has a width and height of 1000000px with an
  overflow:hidden, but the overflow does not work properly when printing.
  (Issue introduced in Chrome v. 108, working fine in v. 107 or on any
  Firefox version)

  - The chart canvas is not resized to 100% of its parent container and
  therefore not fully displayed. (Not working in all Chrome and Firefox
  versions)

Solution:
  (in print media rule)
  Add CSS :
  - Set style to `display: none` on `chartjs-size-monitor` HTML element.
  - Set the width and height of the chart canvas to 100%.
  Remove css that set a fixed max-width on the parent element of the
  chart canvas parent.

opw-3109523

closes odoo/odoo#111640

X-original-commit: a3fd499b1cd1416093d1f4348302f090b0f38554
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-02-02 03:19:43 +01:00
Victor Piryns (pivi) dd2fdcef05 [FIX] project: set default analytic plan in settings
Current behaviour:
You cannot set the Default Analytic Plan for projects in the settings.

Expected behaviour:
You should be able to set the default plan, like any other settings.

Steps to reproduce:
- Install Accounting, Project, (Timesheets if you want to test
  project creation with an auto-created analytic account)
- Settings > Check Analytic Accounts
- Try to change the Default Plan in Settings > Project
- Upon saving, the change is lost

Reason for the problem:
The `analytic_plan_id` in the project's `res.config.settings` is
related to the same field on the `res.company` model.
The `analytic_plan_id` that is set on the company upon installing the
project module is a non-stored computed field, which makes a call to a
`_get_default` -> the field cannot be set. It will always return
the first default plan in the sequence.

Fix:
Since the field isn't stored (which would have worked if it was),
we use `ir.config_parameter` to write and read to it, per company.
In master we should just add a `store=True` and write a migration
for it?

Affected versions:
- 16.0
- saas-16.1
- master

opw-3127638

closes odoo/odoo#111635

X-original-commit: 11b0e2556ce824048bb4c760893b05e98537d171
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-02 00:28:12 +01:00
Arnold Moyaux 2ea54a3949 [FIX] stock: replenish avoid to compute everything
Some people create a lot of references but don't use them in their
stock. To avoid a big computation time to know the quantities for
each product in each location, we only compute it for product having
`stock.move`

For a database with 60 000 `product.product` and 6 replenish locations
but with 100 `stock.move` it goes from 50s to 0.5s

opw-3144094

closes odoo/odoo#111628

X-original-commit: 95ddf47a1ca105d9de8fec01c69fbe53b720bfe2
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-02-01 22:30:59 +01:00
arsi 52df6a3a6b [FIX] account: Set default amount in bank.statement.line create
Problem:
It is possible for an `account.bank.statement.line` to have in the
database the field `amount` set to `NULL`.  It happens when importing
from the 'bank statement line' list view (Favorites>Import Records), a
csv file that have no column 'amount'.
This causes an issue for the queries accesing that value, as they expect
a number and get a Nonetype (for example in the function
`_compute_running_balance`).

Solution:
As this is stable, we cannot change the attributes of the field.
So here, in the `create` function, we set the amount to 0 if
it is not specified. Like when you create a bank statement line with the
'create' button, where this field is set to 0 per default (client side).

opw-3161652

closes odoo/odoo#111585

X-original-commit: 37b271e777576fbaed6e718bb7cd1c064fdb9a54
Signed-off-by: Laurent Smet <las@odoo.com>
2023-02-01 21:31:30 +01:00
Hansun (hale) 8092e43d6f [FIX] stock_account: Allow inventory users to view the bill
To reproduce the issue:

1. On [Settings]>[Users & Companies]>[Users] add a user with:
- admin rights to purchase and accounting, user right to inventory
- admin rights to all three
2. Go to [Purchase], create a RFQ and click Create Bill
3. On the top right corner left of Receipt, Vendor Bills will be shown
4. It is only viewed by user with admin rights to all three apps

Request: Allow Inventory users to view vendor bills as in pre-versions

Applicable versions: 16.0 up to master

opw-3135682

closes odoo/odoo#111564

X-original-commit: bee4d91d030e305ba8c44704a38c4fd8d614997b
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-02-01 19:37:51 +01:00
Nicolas Bayet 5c07e48da4 [FIX] web_editor: remove focus listener on resetEditor
When resetting the editor, we need to remove the focus listener if one
was previously added. Otherwise, the editor will try to connect too
much for each resetEditor call.

task-3164032

closes odoo/odoo#111541

X-original-commit: ed73015ee8dc53692026d3bc040ece4226e2c117
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-01 19:37:48 +01:00
payen000 4cf6e2992f [REF] pos_restaurant: making pos.order's 'get_table_draft_orders' inheritance friendly
By making the search_read inside 'get_table_draft_orders' non-hardcoded,
its domain can now be modified by inheriting
_get_domain_from_draft_orders from other modules.

closes odoo/odoo#111609

X-original-commit: 64156e5ed6a9825bdbe2277783f250b471636004
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-02-01 17:49:13 +01:00
Aurelien van Delft (avd) b7d66bec16 [FIX] stock: speed up MO confirmation
When confirming a MO for a SN-tracked product with
at least one SN-tracked component, most of the time
is taken by _update_reserved_quantity and _apply_putaway_rule.

Since a component is tracked by serial number, there will
be one move_line with product_uom_qty = 1.0 and one reserved_quant
with associated quant of 1.0 by serial number. When the
mrp.production.product_qty gets bigger (> 1000) this becomes
a performance bottleneck as it slows down the creation of smls
and the search for candidate move_lines in _update_reserved_quantity.

To fix that, this commit introduces a delay when creating move_lines
with sn-tracked products. Because move_lines with sn-tracked product_id
are not eligible as to-update candidates, we can create them at the end
of the method.

This speeds up the search for to-update candidates as these lines
are not written to self.move_line_ids during the for loop. This also
speeds up the creation of serial-tracked smls as it calls self.create
only once at the end.

opw-3125714

closes odoo/odoo#111608

X-original-commit: 57ac92fc4c14bf305ffd9ef98212cc80013345f5
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-01 17:49:10 +01:00
Pierre Rousseau 032c5e1d9d [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/dac9cfd14 [REF] collaborative: don't dispatch commands twice to views
https://github.com/odoo/o-spreadsheet/commit/04459ca94 [FIX] sheetview: check active sheet exists
https://github.com/odoo/o-spreadsheet/commit/2f1852560 [FIX] EdgeScroll: Allow edge scrolling through hidden columns
https://github.com/odoo/o-spreadsheet/commit/de4abb0b4 [IMP] Registry: add sequence to chart registry
https://github.com/odoo/o-spreadsheet/commit/bb110f20d [IMP] Header: auto-resize of row height
https://github.com/odoo/o-spreadsheet/commit/bfe777ada [IMP] topbar: CSS tweaking
https://github.com/odoo/o-spreadsheet/commit/73379f013 [FIX] collaborative: don't render uselessly
https://github.com/odoo/o-spreadsheet/commit/3dd59192a [FIX] freeze: check overlapping merge with command sheet
https://github.com/odoo/o-spreadsheet/commit/520fdad1e [FIX] header size: compute the size before duplicating the sheet
https://github.com/odoo/o-spreadsheet/commit/bc62fcff2 [FIX] data filters: don't copy filter values
https://github.com/odoo/o-spreadsheet/commit/8ed593daa [FIX] merges: validate zone to unmerge
https://github.com/odoo/o-spreadsheet/commit/21d1fb7e0 [FIX] collaborative: validate remote commands with allowDispatch
https://github.com/odoo/o-spreadsheet/commit/ba4f998cb [FIX] collaborative: transform remote commands before dispatch to UI
https://github.com/odoo/o-spreadsheet/commit/d811b1f08 [IMP] Function: add `hidden` tag to hide functions
https://github.com/odoo/o-spreadsheet/commit/d24b6f09e [FIX] composer: (real) support of IME
https://github.com/odoo/o-spreadsheet/commit/3edc780fd [FIX] popover: preserve scroll in popover
https://github.com/odoo/o-spreadsheet/commit/4da67942c [FIX] topbar: properly toggle menus
https://github.com/odoo/o-spreadsheet/commit/ecdd45fd6 [FIX] menu: reduce redundant calls to getter
https://github.com/odoo/o-spreadsheet/commit/ccd231e4e [FIX] ripple: use `window.getComputedStyle()` only in `onClick`
https://github.com/odoo/o-spreadsheet/commit/c8b5f70fc [FIX] drag&drop: preventDefault on passive wheel event
https://github.com/odoo/o-spreadsheet/commit/db5b00246 [FIX] figure resizer: fix CSS
https://github.com/odoo/o-spreadsheet/commit/a05fa98c2 [FIX] chart: default chart background behaviour
https://github.com/odoo/o-spreadsheet/commit/015dd2cff [FIX] ColorPicker : showing black color selected upon reset
https://github.com/odoo/o-spreadsheet/commit/3710b7df1 [IMP] css: use cssPropertiesToCss helper everywhere
https://github.com/odoo/o-spreadsheet/commit/cd424377e [REF] tests: use helpers in autocomplete dropdown tests
https://github.com/odoo/o-spreadsheet/commit/73c7dce73 [IMP] EventStream: self releasing does not call the release callback
https://github.com/odoo/o-spreadsheet/commit/01e001d5a [IMP] demo: add Owl error handling in demo.js
https://github.com/odoo/o-spreadsheet/commit/d1ad65205 [FIX] `Grid`: double click should target the main cell
https://github.com/odoo/o-spreadsheet/commit/ccfd28c42 [IMP] Grid Composer: add cell reference when scrolling
https://github.com/odoo/o-spreadsheet/commit/41708c7ae [FIX] Reference: Support sheet names containing exclamation points
https://github.com/odoo/o-spreadsheet/commit/84d8ffab6 [FIX] package-lock.json: solve conflict in file
https://github.com/odoo/o-spreadsheet/commit/98ad66f29 [FIX] config: bump owl version to 2.0.3
https://github.com/odoo/o-spreadsheet/commit/9a618dbb2 [IMP] top bar: add menu item to insert formula functions
https://github.com/odoo/o-spreadsheet/commit/289ec5b92 [REF] compiler: use code builder
https://github.com/odoo/o-spreadsheet/commit/71ae6cfa0 [FIX] grid_overlay: properly detect grid overlay resize
https://github.com/odoo/o-spreadsheet/commit/be62b9ebf [FIX] sheetView: grid composer at wrong pos when cell not in viewport
https://github.com/odoo/o-spreadsheet/commit/b3da747df [IMP] Autofill: alphanumeric values
https://github.com/odoo/o-spreadsheet/commit/ca5becafa [IMP] composer: add multi line composer handling
https://github.com/odoo/o-spreadsheet/commit/4aea6af88 [IMP] mockContentHelper: use focus to change window.mockContentHelper
https://github.com/odoo/o-spreadsheet/commit/1bee3a4b6 [IMP] tokenize: add NEWLINE handling
https://github.com/odoo/o-spreadsheet/commit/1da559c75 [FIX] menu: fix positioning of sub menus

closes odoo/odoo#111568

Related: odoo/enterprise#36586
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-02-01 16:39:54 +01:00
roen-odoo df9bfb17da [FIX] pos_hr: correctly send back to login screen after cancelling badge
Current behavior:
When a user scans a badge, the user is prompted to enter his pin. If
you click on cancel on the pin window you would be sent directly in the
pos and no user would be logged in.

Steps to reproduce:
- setup any employee badge with number and PIN
- Enable Multi Employees per Session in POS settings
- Open a new session for this POS
- Scan the badge with barcode scanner
- At password screen, click cancel
- No employee is shown in the top right but the session can be used

opw-3110299

closes odoo/odoo#111513

X-original-commit: 79a32fca91538a179a0f546a552176b46134c403
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-02-01 16:39:51 +01:00
Benjamin Vray 75166dbcd4 [IMP] web_editor, website: adds label input to links in the editor panel
This commit adds a new feature to the web editor of a website. A "text"
input field has been added to the link editor panel, allowing users to
edit the label of a link.

The label will only be updated when the input is changed, to prevent
loss of formatting (e.g. if one letter is bold).

However, only formatting applied to the entire selection will be kept
(e.g. if you have a "link <b>like</b> this", nothing will be in bold if
you update the label in the editor panel).

Additionally, if there is a media element (such as an image or icon)
included in the selection, the "text" input will be hidden.

task-2900529

closes odoo/odoo#99239

Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-02-01 16:39:48 +01:00
Jinane Maksoud 48d2cf8fc2 [FIX] l10n_fr_pos_cert: clear memory after report generation
The inalterability report can inflate the memory by loading all the
pos orders.

closes odoo/odoo#111594

X-original-commit: dcffa8997a1c94309ecab2bf7996b0391b46910c
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-02-01 14:38:28 +01:00
Jorge Pinna PuissantandMichael Mattiello b4038c915a [FIX] web: tempus dominus date as null in setup
- Open User-defined Filters in debug mode;
- Create a new Filter, name it;
- Use Contact model;
- Add a filter in the domain;
- Choose Last Update On;
- on the domain code editor modify it to be :
 `[("write_date", "=", context_today())]`
- Save the new filter and comeback to the filter lists;
- Open again the filter;
- Click in "Invalid DateTime";
- Choose a new date;
- Discard the changes;
- Click again in "Invalid DateTime".

Before this commit, a traceback is raised. This error occurs because
Bootstrap's Tempus Dominus don't manage correctly when in the setup we
send `null` as date.

Now, we sent a invalid date to Tempus Dominus.

closes odoo/odoo#111593

X-original-commit: b43f9473d1597b71323488f7d11e5f1fbdf0d638
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
2023-02-01 14:38:26 +01:00
Soukéina Bojabza affc184a76 [IMP] web_editor,*: highlight the grid items padding when it is changed
*: website

When changing the padding of the grid items with the `Padding (Y, X)`
option (when the grid mode is toggled), depending on these items
content, the effects are not always visible.

This commit adds a highlight effect on the grid items when the padding
is changed, to better show the changes being made.

task-3058630

closes odoo/odoo#111584

X-original-commit: f3f2c4c73ce08d3898b8c88e1ef045f7bbd1f624
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-02-01 14:38:21 +01:00
Mohammed Erradi (moer) 94d6e8b474 [FIX] l10n_ch: Correct export fiscal position for LI
The aim of this commit is to fix the export fiscal position for invoices between Switzerland and the Principality of Liechtenstein in the Swiss localization.

context:
This commit corrects the Swiss national fiscal position, in accordance with legislation that considers Switzerland and Liechtenstein to be a common fiscal territory of application for VAT.

Previous to this commit:
- When the use create an invoice with a customer from Liechtenstein, the correct VAT is not applied because transactions to Liechtenstein were considered as export transactions.

After this commit:
- When the use create an invoice with a customer from Liechtenstein, the correct VAT is applied because transactions to Liechtenstein are considered as domestic transactions.

closes odoo/odoo#111578

Task-id: 3151891
X-original-commit: 773ad35af4b4d6d8ec608875ded6b5f22ecad1dd
Signed-off-by: Erradi Mohammed (moer) <moer@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-02-01 14:38:18 +01:00
Jorge Pinna Puissant 5c27039bc7 [FIX] web: update field when using compute date
- have a current date of 24/03/2022;
- have a date field of 29/01/2020;
- use compute date (+5d for instance) on the field;
- as the date field changed, the datepicker will update with the new
    value : 29/03/2022;
- use again the compute field, with the same value (+5d);

Before this commit, the datepicker didn't shown the result of the
compute date but it will show 05/01/2022. This occurs because the
datepicker updates when the dates are different, in this case the result
of the computation and the current date are the same. The shown date
05/01/2022 is shown because the input have 5 in it.

Now, the datepicker input will always update, and the correct date is
shown.

closes odoo/odoo#111574

X-original-commit: 85a36a183de5a1a68f8566489b307216568dad9c
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-02-01 14:38:09 +01:00
Samuel Degueldre e57719733d [REF] point_of_sale, *: move things out of Chrome and store
*: pos_hr_restaurant, pos_restaurant

This commit continues the work of simplifying the Chrome component, it
moves the popup controller and the notification to their own component
and service, and moves the state of the notification, sound and debug
widget into their own services.

closes odoo/odoo#111553

Related: odoo/enterprise#36573
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-02-01 14:38:03 +01:00
Habib (ayh) 7618e2e657 [IMP] account: hide print statement button
odoo/enterprise#36355 adds the ability to generate PDF's and attach them to the statement. To give the user feedback of completion, the PDF is then downloaded. Since this is a duplication of features, the report is no longer bound to the print menu.
Task-3151040

closes odoo/odoo#111542

X-original-commit: 331aabe79b80b06f44bc2de1712742ec8f00f735
Related: odoo/enterprise#36559
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
2023-02-01 14:37:55 +01:00
rhe-odoo de6a9a9ee2 [FIX] l10n_gcc_pos: fix country undefined
When the country is not defined on the company, there was an error when using the gcc l10n.
To fix this, we check if the country is set before going further.

closes odoo/odoo#111325

X-original-commit: 0ac8554751fbe22d58108eda0ac24edc933a41d8
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-02-01 14:37:50 +01:00
Daniel Kosky (dako) e177ce3d21 [FIX] l10n_ke_edi_tremol: fix unused hsn_name field
Currently the hsn_name should be submitted every time the hsn_code
is (i.e. when the line is not 16% standard rate taxed). However when
serialising the data, a mistake means that this field is always empty in
the message that gets sent to the device.
This is because of the
     re.sub('[^0-9.]+', '', ...)
regular expression, which replaces all the characters of the
description (excepting digits and periods).

This commit adjusts the way that this field is serialised to utilise the
same formatter (_l10n_ke_fmt) as the other text fields used to construct
the message.

closes odoo/odoo#111529

X-original-commit: c087979c853bfcba28094d784d665033c42a1ccc
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2023-02-01 13:30:46 +01:00
José Moreno Hanshing 1946f87def [IMP] l10n_cl: Added missing country codes used in customs
Added countries which have ports defined in aduana.cl but were not in the list.

closes odoo/odoo#111022

X-original-commit: aa2ccdd661cc4cd762b90a201b09bb89641471ac
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-02-01 12:27:48 +01:00
Laurent Smet 80ac152feb [IMP] account: Rename context key skip_sync_invoice => skip_invoice_line_sync
The skip_invoice_sync context key already exists on account.move.
The context key must be different on account.move.line but skip_sync_invoice is very confusing.

closes odoo/odoo#111555

X-original-commit: 7dcd5495772d6032233f071c8fa25c81be0530ec
Related: odoo/enterprise#36570
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-02-01 10:25:10 +01:00
Jorge Pinna Puissant 89c2a3978e [FIX] web: show status indicator buttons on editing field
Before this commit, when editing a form view, when editing a input field,
the status indicator buttons (the save and discard buttons) didn't show
up until a click outside the field was done (change event).

Now, the status indicator buttons shown as soon as the input field is
edited (input event).

task-id 3147130

closes odoo/odoo#111387

X-original-commit: 64aa9a6afdc8eb27711f6deb5d6ee3e79e6276b2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-01 10:25:04 +01:00
Denis Ledoux fdf2f0c095 [FIX] l10n_*: missing load_translations in manifest post_init_hook
There is a code pattern in l10n modules
to create a post init hook method `load_translations` in `__init__.py`
and to add it in the `post_init_hook` of the module  manifest.

For the modules part of this revision,
the method `load_translations` was created as expected,
but then was missing in the `post_init_hook` key of the manifest,
therefore leading to the fact this `load_translations`
method was never called for these modules,
despite their `spoken_languages` were correctly
set in their charf of account template.

closes odoo/odoo#108254

Related: odoo/design-themes#631
Related: odoo/enterprise#35084
Related: odoo/upgrade#4144
Signed-off-by: Christophe Simonis <chs@odoo.com>
2023-02-01 10:25:01 +01:00
Denis Ledoux b4a7996e96 [IMP] base, *: change the API of init hooks to pass env
This is mostly a cleaning/refactoring change.

The current API for init hooks (pre, post, uninstall) is to pass
`cr, registry`.
But the first thing which was done by most
post init and uninstall hooks was to create an env using
the cr passed
e.g.
`env = api.Environment(cr, SUPERUSER_ID, {})`
and the `registry` argument was unused in all these hooks,
completely.

By changing the API of hooks to pass `env` instead
of `cr, registry`, we gain in average two lines in every
hooks:
- the line creating the env `env = api.Environment(cr, SUPERUSER_ID, {})`
- the line importing `api` and `SUPERUSER_ID`

Therefore removing ~250 lines of repeated code lines accross odoo/odoo and
odoo/enterprise.
In addition to these lines removed,
it also ease the API of init hooks for Odoo developers,
who are used to that `env` and not so much how to create an `env`
from a cursor.

Part-of: odoo/odoo#108254
2023-02-01 10:25:01 +01:00
Denis Ledoux 5bf1207c8c [IMP] base, *: re-use env during registry loading
The goal of this revision is to re-use the environment among the
different steps of the registry loading,
instead of creating a new environment for each step.

1. Simply To avoid to repeat the line
   `env = api.Environment(cr, SUPERUSER_ID, {})`
   multiple times in the code
2. This also allows to share the context among the different
   steps. This is not yet used in this revision, but it could
   be, for instance to avoid the current repetition to add the keys
   `install_module`, in `convert_csv_import` and `xml_import._tag_record`

Part-of: odoo/odoo#108254
2023-02-01 10:25:01 +01:00
Maruan Aguerdouh (magm) 74b73cee85 [FIX] point_of_sale: fix the numpad shifting when introducing numbers
Steps to reproduce:

- Install point_of_sale
- Go to Point of Sale > Payment.
- Click on the numpad for many numbers.

Issue:

The content will move which will also move the position of the number
keys, creating sometimes missclicks.

Solution:

Added some changes to the numpad and payment screen content css in order
to not shift but keep the same behavior.

This issue affects all versions until master.

opw-3089013

closes odoo/odoo#111493

X-original-commit: 6909f5d0a537449330174afb06cae87dbaa99c5b
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-02-01 09:20:42 +01:00
roen-odoo 2e8fe417e6 [FIX] point_of_sale: Add internal product reference to invoice
Current behavior:
The internal product reference is not added to the invoice when the
invoice is created from the POS.

Steps to reproduce:
- Create an order in the POS
- Validate the order and print the invoice
- Open the invoice, the internal product reference is not written on the
  invoice

opw-3119678

closes odoo/odoo#111543

X-original-commit: 38e93f5951528526c060832eecb5514a3ee466a8
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-01-31 21:16:59 +01:00
Valentin Vallaeys (vava) 956d0d26a3 [IMP] payment_stripe: prevent enabling Stripe if onboarding is ongoing
For now, you can enable the Stripe payment provider while onboarding
with Stripe Connect.

This raises two issues:
- This will raise errors in online payments because Stripe is not
completely configured;
- The button to continue the onboarding is not working anymore,
preventing the user to finish the configuration of his account from
Odoo.

This commit prevents enabling Stripe if the onboarding has been
initiated but is not finished. It also changes the way constants are
read from const.py to allow patching one of them if needed.

OPW-3149159

closes odoo/odoo#111534

X-original-commit: fa3bcac71d1699aa9b9a7bc1d6b6181a70171662
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-01-31 21:16:56 +01:00
Daniel Kosky (dako) f18153b042 [FIX] l10n_ke_edi_tremol: fix naming of product HS Code fields
Although in the documentation these fields on the product are referred
to as 'HS Codes' (codes belonging to the Harmonised System), they are
not HS Codes and share nothing with HS codes excepting the
length/format.

Apparently the folks at the KRA have been referring to these internally
as 'Item Codes'.

The fiscal device itself has a list of around 260 of these item codes
preloaded, and if the data sent contains an 'Item Code' not present in
this preloaded list, then the device will throw a 'Zero Input Registers'
error.

By representing this field as an HS code field, we misguide the clients,
who will enter the wrong value and get this error. This commit adapts
the strings of these fields from HSN Code/Description to KRA Item
Code/Description in order to avoid this confusion.

closes odoo/odoo#111516

X-original-commit: e9f15804e1d613ebd7d8ce73f34b37f3ad04f940
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2023-01-31 18:37:39 +01:00
Kevin Baptiste dc69cb39cb [FIX] hr_holidays: freeze time on test
The test introduced in odoo/odoo#110658 would fail when run close to
midnight.

closes odoo/odoo#111503

X-original-commit: d27516ab9fa248b1901bce69bf892719cce0cefb
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-31 18:37:28 +01:00
Daniel Kosky (dako) b99ec5cb3a [FIX] l10n_ke_edi_tremol: error message spacing
Since batching was introduced for posting invoices with the fiscal
device (in https://github.com/odoo/odoo/pull/107852), the error messages
that are generated when doing the pre-post validation had to be grouped
by the invoice name. However, there is no line break between the groups
of messages, and thus the "Invalid invoice configuration on (invoice
name)" can appear on the end of the previous line, which is quite
confusing.

This commit inserts a new line at the end of each error message string,
so that the error messages displayed to the user are grouped
appropriately by the invoice to which they refer.

closes odoo/odoo#111502

X-original-commit: 1a47cf066a7c8eead7e602ebcb25c010021352f3
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2023-01-31 18:37:26 +01:00
roen-odoo 1253362124 [FIX] point_of_sale: correctly show image that have a little ratio
Current behavior:
When a product image has a little ratio (height > width), the image
looks like it's zoomed in.

opw-3133037

closes odoo/odoo#111496

X-original-commit: 9cd35d940f4c60401bdc2e1dd84efc950cd0e584
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-01-31 16:25:06 +01:00
det 6a1d60bf54 [IMP] account/purchase: automatically match PO when importing bill
When a vendor bill document is uploaded (EDI, PDF,..) the link with
the purchase order is often lost.

We want to reuse the purchase.order OCR' matching logic to enhance
vendor bill extracted from documents.

To sum up the logic;

- if we find a partner or reference match (invoice_origin)
AND the same amount, we use autocomplete and replace the line in the vendor
bill with the purchase order one.

- if we find a match with the reference and some line in the purchase order
sum up to the vendor bill total, we add those line in the vendor bill
but we set the qty to zero (the accountant can  manually remove the XML
line and link the new one afterwards).

task-id: 2828521
[community](https://github.com/odoo/odoo/pull/109093)
[enterprise](https://github.com/odoo/enterprise/pull/35436)

update master: make _find_matching_subset_invoice_lines private

closes odoo/odoo#111491

X-original-commit: ebc8b007ecb375d20c566b6e6ecc3f6749ebaa2a
Related: odoo/enterprise#36545
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-01-31 16:25:03 +01:00
Jacky (trj) 9d6607b329 [FIX] point_of_sale: wrong return value in db.js add_partners
The performance fix in e3efa7a91dd8648bf2e0632640bdb62938ecef00 added a small
typo in the return value of `add_partners` which ended up by always returning undefined.

closes odoo/odoo#111472

X-original-commit: 4b07d022c081763ce0b7c5d6efad7be922704779
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-01-31 16:24:48 +01:00
Pierre Masereel 42afdd13df [IMP] google_calendar: generate meeting link when creating event
When we are creating an event in odoo and synchronise it with google,
the google meet link is not automatically generated. To ease the use of
the meeting, we'll auto generate the google meet link.

closes odoo/odoo#110847

Task-id: 2945998
Signed-off-by: Masereel Pierre <pim@odoo.com>
2023-01-31 16:24:45 +01:00
Josse Colpaert f7e5c86e11 [FIX] l10n_ar: remove tagged on common test class to allow tests to run
closes odoo/odoo#110480

X-original-commit: 5e58a748c76c8c2adb2c1890da7662949ae310c9
Related: odoo/enterprise#36073
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-01-31 16:24:40 +01:00
Katherine Zaoral a3c44a7844 [ADD] l10n_ar: add demo data liquido producto
X-original-commit: 72523a110755cb7d822a96c41d545b9f3a4e61ea
Part-of: odoo/odoo#110480
2023-01-31 16:24:40 +01:00
niyasraphy 2507c8e819 [FIX] website_forum: display correct user image in forum sidebar
Before this commit, on accessing the validation queue in the website forum,
the user image shown in the sidebar is different from the logged in user image.

The cause of issue was the variable passed from the controller and the
variable used for iterating the for loop who are the same, aka user. Thus
the value for 'user' is getting changed. resolved by storing the user value
to a temporary variable and restoring it after the loop.

After this commit, in the validation queue it will show the same logged in
user image in sidebar.

closes odoo/odoo#111474

X-original-commit: 31ad927c825f0aea02b3031fa228002ca33f65fd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-31 15:18:01 +01:00
Maruan Aguerdouh (magm) 54607d473f [FIX] website_mass_mailing: fix traceback when submitting a newsletter website_form
Steps to reproduce:

- Install website_mass_mailing
- Go to Website homepage and edit to add a newsletter block.
- Drag the block to add it to the page and inside it change the Template
to Form Susbscription.
- Save the page and try to fill the form logged out.

Issue:

We get an error about permission as we don't have any access.

Solution:

Added proper `sudo` to the search so we avoid the error.

opw-3145571

closes odoo/odoo#111468

X-original-commit: 3631643e0d6294d3fa6c8e1b3bb087c08bbabb4a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-31 15:17:58 +01:00
miad-odoo f1cb5e6b39 [FIX] event: make scheduler respect mail template
Before this commit, the mail scheduler in event bypassed the email_from field
in the selected template, implementing instead its own logic.

With this commit, the scheduler respects the `email_from` field from the mail
template, and only implements its own logic if that field is not set.

Task-3092425

closes odoo/odoo#111462

X-original-commit: ef503e62480c774e8a0d193666cc4cce5ab90282
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-31 15:17:55 +01:00
mehjabinfarsana 500c555690 [FIX] purchase_mrp: constrains not working
before this commit, in BoM form view, it was allowing to select BoM product as the BoM line product , as the constrains decorator was missing in this inherited function. typo in field name

after this commit, it is not allowed to add BoM product as BoM line product, as it will show the UserError. instead of bom_lines bom_line_ids used

closes odoo/odoo#111416

X-original-commit: 6e68005b27613ce84fe54d6d2f9273aa3ccfd662
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-31 15:17:52 +01:00