Commit Graph
143902 Commits
Author SHA1 Message Date
Xavier Morel de5aceb88e [IMP] web: test reliability
This test sometimes fails locally.

Updating it to be a bit more modern also seems to make it more
reliable (also moved the delay between the drag & drop operation & the
steps checking as it seems more logical, but the reliability issues
had disappeared before that).
2021-06-29 05:34:16 +00:00
Xavier Morel 3985edd5da [FIX] web: missing action id warnings
* Add test name when logging missing action ids, makes finding out
  which test causes the issue much simpler.
* Suppress the warning emission in the one remaining test which
  triggers it, as testing invalid action IDs is exactly the purpose of
  the test.
2021-06-29 05:34:16 +00:00
Xavier Morel 46bc0b110e [FIX] web_tour: warning during tip consumption test
Tip consumption is an RPC request. Because the test did not mock the
model or RPC, a warning would be triggered by the mock server.

* update `createTourManager` to forward parameters outside its very
  own to the mock environment setup
* pass in a `data` to set up our model, including `fields` because for
  some reason the default RPC mocking is quite cross when a model
  doesn't have fields
2021-06-29 05:34:16 +00:00
Xavier Morel 1e6de40b78 [IMP] web: downgrade warning messages to info
Two internal warnings are features which literally are not (entirely)
implemented, the tests can't be fixed to avoid them. Also augmented
the log messages with which test triggered the log, as it's very hard
to debug the issue otherwise.

As for the qweb debug mode warning, there's no way to disable it
easily because multiple tours explicitly opt into debug mode (with
good reasons), so it's not enough to just bypass the `mode` setter in
the test setup helpers (test_main in POS and main_tests in web), there
would also need to be special workarounds in the 4 modules which set
`owl.config.mode` based on the session's debug mode.

I don't know that this warning is even useful, it defaults to `false`
so the only situation in which this would be relevant would be for a
third-party to use Owl *and* explicitly enable the debug mode *and*
forget to remove it when deploying to production *and* look at their
console.
2021-06-29 05:34:16 +00:00
Xavier Morel 053285afdc [FIX] web: momentjs warnings
* Without an explicit format string, moment() should be called with
  ISO date(times).
* Correctly destroy all test locales (`zz` was not destroyed at all,
  and `englishForTest` was double-destroyed instead of destroying
  `frenchForTests`).
* Avoid creating a moment object from the value `false` in date(time)
  fields.
* Disable the warning entirely in dates_tests, the contents are super
  messy and weird.
2021-06-29 05:34:16 +00:00
Xavier Morel 29de1ef72b [IMP] web: reduce warning spam, only show rpc error warning in debug
Trigger a *lot* of spam while running tests

It's not great that this is now disabled:

* some cases are mistakes in the test e.g. RPC not properly setup,
  they should really be fixed
* others are literally testing error responses, the logging should be
  suppressed instead

Ideal scenario would probably be to upgrade this to `error` and have
an API of some sort to suppress it on a per-test basis (not unlike
`@mute_logger` on the Python side).
2021-06-29 05:34:16 +00:00
Xavier Morel 9528fd350f [FIX] qunit: suppress ResizeObserver error
The error is (apparently) benign and already suppressed in some parts
of the system, however it can (apparently) trigger locally during some
tests, causing the test to fail as the error is caught and converted
to a failure by QUnit.

Sadly QUnit does not offer a proper hook for this, so it has to be
suppressed by wrapping the existing handler and only calling it for
other errors.
2021-06-29 05:34:16 +00:00
Xavier Morel c6855cdcf8 [IMP] qunit: avoid splitting console.error calls
The Chrome runner may only show the first one, which may or may not be
useful on its own.
2021-06-29 05:34:16 +00:00
Xavier Morel 438c6efdd7 [IMP] core: JS test runner
Emit JS warnings as Python warnings, otherwise it's a pain in the ass
to identify the t-raw messages (they get lost in the INFO spam).

Also just log exceptions when looking for specific messages instead of
re-raising them: if the pipe from chrome is full of exception reports,
the runner may blow its stack as it looks for the screenshot message:
on the first it takes a screenshot, then looks for the screenshot
message, finds an exception, takes a screenshot, looks for a
screenshot message, finds an exception, takes a screenshot, looks for
a s...
2021-06-29 05:34:16 +00:00
Mohammed Shekha 6246bddba4 [FIX] web: calendar sidebar name cropped
Before this commit: calendar view sidebar filter names were getting cropped
at bottom, it is because of line-height property which is set to 1.

After this commit: calendar view sidebar filter names will not be cropped
as line-height property set to 1.5.

task-2519813

closes odoo/odoo#72898

X-original-commit: 4e24df71f34f0306447f724fd5028778fdf46428
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-06-28 17:14:20 +00:00
Nicolas Lempereur 725a30c2f9 [FIX] account: remove duplicate _compute_payment_method_id
seen when working on opw-2508263c

forward-port of #72654

closes odoo/odoo#72895

X-original-commit: 38906fb5a9c65335f15fd3d09399988616fbe18f
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-06-28 17:01:52 +00:00
fw-bot 45b378f1f0 [FIX] account_check_printing: wizard use vendor payment method
The payment method added by account_check_printing is meant as:

> Preferred payment method when paying this vendor. This is used to
> filter vendor bills by preferred payment method to register payments
> in mass. Use cases: create bank files for batch wires, check runs.

But it may also select the default payment method on an account.payment.

With this changeset, we copy what is done in account.payment to
account.payment.register so the behavior is the same for it.

forward-port of #72655

opw-2508263

X-original-commit: a546e7e870987e882ab2c9a6fa2618476b76fcb8
2021-06-28 17:01:51 +00:00
william-andre 5cee367966 [FIX] l10n_ca: rename layout
Following https://github.com/odoo/odoo/commit/bc40795c56eb463fea29be08306883d7d8ea31fc

closes odoo/odoo#72841

Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-06-28 09:17:41 +00:00
Yannick Tivisse e91e6307e6 [IMP] hr_contract: Improve general UX (back2basics)
- hr_contract: Add kanban view on contract history action
- hr_contract: Display the avg wage, not the sum on aggregates
- hr_contract: Improve contract history list view
- hr_contract: Improve contract history tree view
- hr_contract: Improve contract history search view
- hr_contract: Display wage on contract kanban view
- hr_contract: Improve contract tree view
- hr_contract: Improve contract search view
- hr_contract: Make hr_responsible required
It is useful in multiple HR flows.
- hr_contract: Improve contract history form view
- hr_contract: Improve contract form view
- hr_work_entry: Improve work entry computed name
- hr_work_entry: Improve work entries tree view
- hr_work_entry: Improve work entry type form view

closes odoo/odoo#72402

Taskid: 2558171
Related: odoo/enterprise#19124
Related: odoo/upgrade#2583
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-28 14:39:44 +00:00
Yannick Tivisse a223bc66d1 [IMP] web: Hide empty pills if empty 2021-06-28 14:39:44 +00:00
Mohammed Shekha f9629c546d [FIX] base: partner name displayed with unnecessary comma
Before this commit: when partner is only created with name(i.e. without
address) and when 'address_inline' is passed in context then partner name shows
with unnecessary commas.

After this commit: partner name will not have unncessary commas, as we removes
unncessary '\n' in case of 'address_inline' passed in context.

task-2502597

closes odoo/odoo#72869

X-original-commit: c08082d89782b7675e8e649cba15ca9e03e40077
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-06-28 12:55:24 +00:00
Francois (fge) f92bd09244 [IMP] web: add shortcuts access from the command palette
This commit adds the possibility to use a shortcut from the command
palette. When a shortcut is called from the command palette, the palette
will be close and the action related to the shortcut will be apply.

closes odoo/odoo#72831

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-06-28 12:06:26 +00:00
Julien Banken c9a712ab25 [FIX] mass_mailing: Fix crash when trying to schedule a new compaing from the calendar view
To reproduce the error:

1. Open Email marketing
2. Go to the calendar view
3. Click on a cell

Explanation:

The function 'default_get' defines an argument named 'field' that conflicts
with the 'field' variable imported from the default 'odoo' package. When
two identifiers conflict, Python will use the variable defined in the closest
enclosing scope.

When the 'default_get' function accesses the 'Datetime' attribute of 'field',
the function will raise an exception as the identifier 'field' will refer to
the argument of the function and the property 'Datetime' will not defined on
that variable.

To solve the issue, we will rename the argument of the function 'default_get'
to 'fields_list' so that it will no longer conflict with the imported variable
'fields'.

Links:

Task id: 2581357

closes odoo/odoo#72857

X-original-commit: a9f6f708d40d0ecafb4a903eb9ff810a6c959416
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-28 10:52:03 +00:00
Munaf Khan 0ead5ea0af [FIX] website_event: properly show social share icons on event sidebar
Currently, the social share icons on right sidebar of the event page
are not alligned properly. This is because the rules written from
there are having lower precedence than the generic rules for the
social share snippet.

This commit fixes the issue by providing higher precedence to the
rules specifically written for event's web page.

TaskID-2557077

closes odoo/odoo#72856

X-original-commit: 26a7262ba926039741cfe24cecfa6c48a9348353
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-28 10:50:31 +00:00
Jeremy Kersten bb22e52d0b [FIX] website: serve_redirect with trailing /
Before to search if a redirect exists, we try to match a page via serve_page.
But this one redirect without the trailing /. So if none page is found, we
look for redirection, but we need to search with and without this trialing /.

opw-2527063

closes odoo/odoo#72847

X-original-commit: df6f92f1c290276fed8d0643315cc0973f3729e5
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-06-28 09:51:48 +00:00
Francois (fge) a7984f484b [FIX] web: properly display reference field in editable form view
Since a recent commit[1], many2one field was improved, and the inner components
are now wrapped within a newly introduced div `o_field_many2one_selection`.

Reference field extends many2one field and due to newly introduced wrapper div,
few editable form view related css rules (mainly for `o_row`) were broken and
the referece field was a mess in editable form view.

This commit fixes the issue by adding reference field specific rules that
restores the UI in the editable form view.

This commit fixes the issue by adding the class "o_row"
on the <div class='.o_field_many2one_selection'>  containing the <select>
and the <input>.

commit[1] - 288b24c

TaskID-2453138

closes odoo/odoo#72833

X-original-commit: 1f14652aca91763caf271c248c7576978671cfca
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-28 08:27:12 +00:00
Sébastien Mottet (oms) 6ba709a812 [FIX] website: correctly activate tour for each website
- Creating a website through the configurator activated the configurator tour.
This tour was active for every websites even the ones not created using the
configurator. Theme tours were overridden by the configurator tour when they
should have been the active tour for website not created using the configurator.

Now the configurator tour is an asset specific to each website. This asset is
deactivated by default and activated for a website only if it is created using
the configurator.

- Some actions of the website tour were also visible when we were not in edit
mode. extra_trigger has been added on these actions to ensure they are visible
only in edit mode.

task-2518565

closes odoo/odoo#72827

X-original-commit: 5799410ec257fc7f756722579d3d0141b0ce7de4
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-06-28 07:24:29 +00:00
John (jol) 43b41ad948 [IMP] account: use config bar for real config steps
The purpose is to use config bar for real config steps rather than highlighting tour steps.
Mainly by:
- Removing "First Bill" step from the configuration bar and replacing it by "Company Data".
- Adding "Taxes Review" step in the configuration bar as the last step (after CoA). This step opens the Taxes list view.
- Adapting the Tour according to these changes.

closes odoo/odoo#70115

Related: odoo/enterprise#18125
Related: odoo/upgrade#2449
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-28 08:07:52 +00:00
Jérôme Vanhaudenard 162eb35de8 [FIX] point_of_sale: Warning on posted cash register
To reproduce the problem :

1. Install POS and accounting
2. Open a POS session and make a cash payment
3. Go on accounting -> statement of CASH -> click on the POS statement
4. Try to post the statement -> It works
5. Try to close the session -> Only new statements can be posted.

Now, a check is performed at the beginning of the closing process
and display a useful message to the user if a statement is already posted.

OPW-2494806
OPW-2377190
OPW-2448362
OPW-2485830
OPW-2487628

closes odoo/odoo#72806

X-original-commit: 6c0646aa48900933474ee237ab143967e15f4086
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-06-25 14:57:10 +00:00
Noe Antoine 94e4756343 [IMP] website_event: rename extra register button.
BEFORE THIS COMMIT

The option adding an extra register button in top right
(at submenu height) of an event website page was presented as a
checkbox 'Register Button' on event form and 'Add Register Button'
on event type form.This was easily mistaken as the option of
allowing / preventing user registrations, which is not the case at all.

AFTER THIS COMMIT

In both event.event and event.type, this option is renamed
'Extra Register Button' to clarify its purpose and prevent such
a confusion.

--- Links ---
Task Id - 2578891
COM PR - odoo/odoo#72686

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-24 10:59:28 +00:00
stefanorigano (SRI) a61d06217d [FIX] mass_mailing: cleanup 'assets_mail_themes_edition' sub-bundle
Solve SCSS compilation issues due to 'webclient.scss' that was initially
added in b3e7fd040b.
The fine is now unnecessary and it's actually causing the editor to
behave incorrectly.

closes odoo/odoo#72678

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-24 09:24:14 +00:00
William Braeckman bfa0a66e52 [IMP] hr: move personal documents to hr
Previously personal documents on employees were added with the belgian
contract salary module. This changes moves part of those fields to the
base hr module

Task ID: 2578139

closes odoo/odoo#72673

Related: odoo/enterprise#19219
Related: odoo/upgrade#2587
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-24 07:53:49 +00:00
yhu-odoo f3307e201c [FIX] mrp: skip service when compute kit quantities
Since we can't transfer service product, when compute delivered or
received kit quantities, we should skip the service components.

Task-2566373
PR #72306

closes odoo/odoo#72575

X-original-commit: f86c7c0dfa09a2136ed1789a905eae9205de0c03
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-06-28 07:16:55 +00:00
nounoubensebia c56ba2949e [IMP] website_event_[exhibitor|meet|track]: add link for no content submenu buttons
This commit modifies texts proposing to the users to create new
exhibitor/meeting_room/tracks by adding links redirecting the user to the
backend allowing them to easily create new records without having to go to
the backend again.

It also prevents the user from being redirected to the main event page when
toggling the allow room creation submenu, instead it will only reload the
current page, thus preventing the user from losing the community page.

Task-2531104

closes odoo/odoo#71825

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-22 09:37:35 +00:00
Prakash Prajapati 9b53115345 [IMP] hr_timesheet: refactor _apply_time_label method
The purpose of the commit is in order to avoid code duplication and ease maintenance,
the _apply_time_label method has been centralized in hr.timesheet
which makes more sense since the relation to the timesheet encoding unit.
It can now be used in other models by providing the right model name.

closes odoo/odoo#72679

Taskid: 2451722
Related: odoo/upgrade#2499
Related: odoo/enterprise#18621
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-06-25 10:54:59 +00:00
Lucas Perais (lpe) 574739e125 [FIX] web: legacy: CustomFilterMenu is focusable
Before this commit, when browsing a filterMenu with the keyboard, the CustomFilterMenu
was not focusable. This is because its root node changed from `button` to `span` which is not
focusable by default.

After this commit, the CustomFilterMenu is focusable and the root node has been replaced back by a button

closes odoo/odoo#72738

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-25 15:25:50 +00:00
Anh Thao Pham (pta) 7b1acdf41a [FIX] sale_mrp: fix COGS aml for products with kit BOM
- Install stock, account_accountant, sale_management & mrp
- Create a storable product (i.e. Kit A)
- Configure its Product Category as followed:
  * Costing Method: Standard Price
  * Inventory Valuation: Automated
- Create a consumable product (i.e. Kit B)
- Create a consumable product with cost $3 (i.e. Component A)
- Create a consumable product with cost $4 (i.e. Component B)
- Create a consumable product with cost $5 (i.e. Component BB)
- Create BOM for Kit B:
  * BOM Type: Kit
  * Quantity: 10
  * Components:
      2 x Component B
      3 x Component BB
- Create BOM for Kit A:
  * BOM Type: Kit
  * Quantity: 3
  * Components:
      2 x Kit B
      1 x Component A
- Create a SO with 1 Kit A and confirm it
- Create an invoice and confirm it
Values of the COGS aml created for Kit A ($26) do not match its BOM cost ($2.53).

The method computing the price unit does not take into account BOM quantity:
10 for Kit B and 3 for Kit A.
It only sums the cost of the components of BOM.

Quantities of the components used by sub-kits should be related to the quantities
defined in the BOM.
Also, the average price unit computed for the BOM should be divided by the BOM
quantity to get the true average price for one unit (BOM cost).

opw-2557198

closes odoo/odoo#72812

X-original-commit: 36974be7cb46712f80d137b0a35646e77db910d8
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-06-25 17:17:11 +00:00
Adrien Widart 865aa6c762 [FIX] point_of_sale: set opening amount with several POS
When having several POS with cash control, if at least one POS already
has a closed session with cash in box, the first session of the other
POS may have an incorrect opening amount

To reproduce the error:
(Let POS01 be the existing point of sale)
1. Edit POS01's settings:
    - Enable "Advanced Cash Control"
2. Duplicate POS01 (-> POS02)
3. Start a session with POS01
4. Sell one product, payment in cash (Let P be the product's price)
5. Close POS01's session (correctly set the closing cash)
6. Start a session with POS02

Error: On opening cash control, the opening amount is P, it should be 0

OPW-2574096

closes odoo/odoo#72803

X-original-commit: ba86192043ad014a0e13867a66816acede64c897
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-06-25 14:41:23 +00:00
Didier (did) 6240617358 [IMP] mail, *: use explicit export instead of default
* = hr, hr_holidays, im_livechat, sms, snailmail, website_livechat,
    website_slides

Exporting directly on the line of the class or variable definition is less lines
of code and less repetition (and risk or mistake).

Exporting with a name instead of default allows to catch typos more easily when
importing and ensures the same name is used for consistency (and ease of grep).

closes odoo/odoo#72597

Related: odoo/enterprise#19224
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-25 14:56:52 +00:00
Yograj Tandel d7b2457331 [IMP] web: color picker adjustment
Before this commit: on smaller screens, in color field, colors are not display
in one line, few colors are coming on second line.

After this commit: colors are now displaying in one line by reducing margin
between color squares.

task-2454346

closes odoo/odoo#66915

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-06-25 13:23:41 +00:00
Nicolas (vin) 90dc650ce8 [FIX] account: Fix a traceback in account_payment
When changing the journal of a payment that has already been saved by
one of another company, a traceback will occur because of writeoff lines.
This ensures that it will not happen.

closes odoo/odoo#72800

X-original-commit: b44a70284c52623061623d4793ffce29ea25487a
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Nicolas Viseur <vin-odoo@users.noreply.github.com>
2021-06-25 13:46:45 +00:00
Florent de Labarre d580c93aa3 [FIX] website_sale: remove always falsy condition
This code can't be reached, the condition can't be true anymore, as
`partner_shipping_id` is a required field.

closes odoo/odoo#72794

X-original-commit: 3857d27d54b3dc839376abf08de535626e3af850
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-06-25 13:14:27 +00:00
Denis Mudarisov 8100980773 [FIX] crm: make help note translatable
closes odoo/odoo#72789

X-original-commit: f21392f5290d298f43b4a64f4e4cdbbc992df627
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-25 12:43:12 +00:00
William Braeckman 824af72a9b [IMP] hr_skills: remove optional dropdown
When studio is installed, the List view renderer will always render a
threedot menu to promote studio, but since resume and skill widget
extend that view it also gets rendered on top of the add button.

This change completely removes the optional dropdown menu from those two
widgets.

Task ID: 2578126

closes odoo/odoo#72654

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-23 15:46:18 +00:00
Lucas Perais (lpe) 0ffc12c0a4 [REF] web_editor: loader split the loading and the creation of wysiwyg
Before this commit, the wysiwyg loader had only one method to both load and create it.

After this commit, it has two separate methods to do it. This is practical if one wants to load
in some other context, like studio

closes odoo/odoo#72454

Related: odoo/enterprise#19139
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-06-24 15:05:23 +00:00
Tiffany Chang (tic) 03aede0a2c [FIX] mrp: allow validation when no components
Conflicting fixes for unusual cases of MO validation when no components
assigned and when components assigned all with 0 consumed made it so we
cannot validate an MO with no components despite there being a
confirmation popup that makes it seem like you can. This fix makes it
so we can validate a MO when no components are assigned (ideally we
would allow validating both cases, but fix for 0 consumed is much more
difficult + an extremely unlikely use case).

closes odoo/odoo#72343

Task: 2422698
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-06-18 07:37:19 +00:00
Kevin Baptiste 405cdd6388 [IMP] hr_recruitment: improve hr.job kanban view
- Display the total number of applications (including refused)
- Show the number of new applications on the button instead of total

closes odoo/odoo#72277

Taskid: 2574370
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-17 11:13:27 +00:00
Leonardo Pavan Rocha bc40795c56 [IMP] base: base layout designer improvements
This commit implements improvements in the layout designer, such as addition of a new custom background, adds custom report footer and company details.

task-2355704

closes odoo/odoo#66860

Related: odoo/upgrade#2275
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-06-25 10:33:31 +00:00
Mohammed Shekha ae4cb866de [FIX] web: do not display notebook ul element if all pages hidden
before this commit: if all pages are hidden then notebook ul was still visible
due to which border for notebook ul element was displayed.

after this commit: if all pages are hidden then we hides notebook ul element
as well, so that we don't have empty border line of empty notebook.

task-2411651

closes odoo/odoo#63420

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-06-25 07:28:47 +00:00
Katherine Zaoral 216b07eb46 [ADD] l10n_ar: AFIP RG 5003
Be able to create letter A documents to monotributista AFIP
responsibility types.

closes odoo/odoo#72667

X-original-commit: b204f7d1b0bcaf3984600d94395377c97facf168
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-25 11:50:32 +00:00
Laurent Smet a455483c2a [FIX] account: Fix missing dependency of '_compute_is_reconciled' in statement lines
closes odoo/odoo#72764

X-original-commit: 3ca7f28de24f3d64d67d9d358bf6ad93d36479c0
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-25 08:43:06 +00:00
Adrien Widart 50e81b110f [FIX] point_of_sale: set end balance of cash register
This commits is about two problems. The first one is a undesirable
warning message displayed when closing the POS session

To reproduce the error:
1. In POS settings, enable "Advanced Cash Control"
2. Start a POS session
3. Make an order of 70$, payment in cash
4. Close the POS session (correctly set the closing cash)

Error: When clicking on "Close Session & Post Entries", a warning is
displayed: "There is a difference between the expected and actual
closing in cash. Are you sure [...] ?" However the actual cash is equal
to expected cash so the message does not make sense

The error has been introduced with commit 7252350d35c6e8e7f47458c3aedcf05d92e71afa,
so the current commit reverts it.

However, the reverted commit was a solution to a second problem: When
cash control is disabled, if the user opens and closes a POS session
(without any order), the ending balance of the associated cash register
will always be 0. Here are the explanations: if cash control is enabled,
when the user sets the closing cash, it creates a record:
https://github.com/odoo/odoo/blob/80c28189ae6b10ad17c4de2a781233a8ffe663a6/addons/account/models/account_bank_statement.py#L82-L98
and therefore, thanks to `_validate_cashbox`, `balance_end_real` will be
defined with its correct value. However, there isn't anything to define
the ending balance when there isn't any order and when cash control is
disabled.

OPW-2580699

closes odoo/odoo#72763

X-original-commit: 550e7280212b740bfce72331f6d0aef99b7aadb6
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-06-25 09:41:23 +00:00
Xavier Morel ded278b9c2 [FIX] core: have HttpCase automatically set the base url
While HttpCase did set `web.base.url` before starting a browser, in
the non-browser test cases (or cases which would mix browser and
non-browser) it would not do so.

This is an issue when installing the database with one http-port and
running tests with an other e.g. after duplicating the database (or
even not duplicating it) in order to run multiple test instances
concurrently, which requires using different http ports.

Tests would then see the base url generated during installation,
embedding the port used at installation, and would break weirdly (at
best exploding due to not finding any server to bind to, and at worst
making request on the wrong instance entirely). Simply updating the
base url during setup seems to fix most of the tests.

Notes:

* Some tests (e.g. survey) don't flush() their create/update before
  calling `start_tour` or `browser_js`, the implicit flush because of
  the ICP handled the issue. Perform an explicit flush of base
  (similar to `url_open`) to ensure they keep working correctly.
* `url_join` should handle absolute URIs correctly, it does imply
  slightly different semantics in case the `base_url` has a non-empty
  path, but that seems like a very limited risk (and possibly
  convenient to boot).
* `payment` needed a fix because the vagaries of the MRO led to the
  extra parameter internally used by the thing to be passed to
  `HttpCase`'s `setUpClass`, which would not expect it.

closes odoo/odoo#72645

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-06-25 09:13:49 +00:00
Younn Olivier 58503a248e [IMP] website: disable some options for inline snippets
When a snippet is displayed inside another snippet, some options that
were not useful in that case are removed from the editor:
- ContainerWidth
- minHeight
- ScrollButton
- Background

Part of https://github.com/odoo/odoo/pull/72180
task-2566338

closes odoo/odoo#72180

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-25 07:39:54 +00:00
Younn Olivier 3426283c22 [IMP] web_editor: display toolbar only when needed
For now, the toolbar was hidden from the snippets menu only if:
- it was an image
- it had no editable parent or was outside the wrapwrap
- for model fields that were not html nor views

We also want to hide it for every selected element that is not editable,
as the options will have no effect on such element.
When an element is not editable, it is useless to display the toolbar.

For example, for the website form fields, or the newsletter
subscription, the toolbar was displayed even if it had no effect on the
snippet.

To hide it, we test on the last element at the wysiwyg level.

Part of https://github.com/odoo/odoo/pull/72180
task-2566338
2021-06-25 07:39:54 +00:00