Commit Graph
124195 Commits
Author SHA1 Message Date
Goffin Simon 6035112043 [FIX] hr_holidays: Wrong computation of leave duration
When all days in a calendar don't have the same schedule, it's wrong
to compute the leave duration with the average working time hour per day.

opw:1909145

closes odoo/odoo#29313
2018-12-06 14:45:18 +00:00
Odoo Translation Bot ec4ee14c89 [I18N] Update translation terms from Transifex 2018-12-09 01:16:26 +01:00
William Henrotin 33a6649aa4 [FIX] purchase_requisition: incorrect field
Before the fix we were requiring for product.supplierinfo.requisition_id
which is a non existing field of the model 'product.supplierinfo'. I
just change it then to purchase_requisition_id which is the required
field.

This triggered an error when you add a product selled by the defined
vendor for an aggreement type defined as 'Blanket order'.

opw-1914712

closes odoo/odoo#29342
2018-12-07 16:38:28 +00:00
len-odoo aed0a828e4 [FIX] barcodes: allow special keys input on firefox
Install stock_barcode.
It adds a barcode to the product quantity of the inventory adjustment view.
On firefox special characters are ignored (CTRL, BACKSPACE, Fn...)

closes odoo/odoo#29245
2018-12-07 13:48:57 +00:00
Lucas Perais (lpe) d40956c790 [FIX] account: install a chart of account on another company
1. Create odoo instance with "--without-demo=ALL" option.
2. Install Accounting module.
3. Add Chart of Accounts manually (e.g. code 111111 Bank and Cash and 222222 Other Income)
4. Create Journal.
5. Create Journal Entries.
6. Activate multi-company.
7. Set new company to current user and set the new company as current company.
8. Install accounting localization: Accounting >> Configuration >> Settings >> Install More Packages >> (install any localization module)

Before this commit, there was an error because when installing any module,
the environment in which it happens is in uid = 1 and doesn't have a context anymore
Thus, when arriving in the charts of accounts code, the env's user is still 1
Which doesn't mean anything in V12, since it is the system user

After this commit, the user is retrieved from the request

OPW 1911677

closes odoo/odoo#29310
2018-12-06 16:21:09 +00:00
Géry Debongnie 6d3ada178f [FIX] web: prevent crash when searching for escaped strings
Recent works in the search view (in 12.0) on dynamic filters had an
unfortunate effect: when the user tries to input escaped strings (for
example "test" in custom filters, there was a crash.

The reason is that the JS python parser (or more specifically, the
tokenizer) was unable to parse that as a string.  It worked before
because the web client sent the raw string to the server.  However, with
dynamic filters, this is no longer the case, and we need to parse
domains to be able to combine them.

In this commit, we modify the tokenizer to be able to work with escaped
strings.

closes odoo/odoo#29324
2018-12-06 15:16:32 +00:00
Toufik Ben Jaa 84b976fb7c [FIX] payment: process payments older than 10 minutes
- The payment transaction processing cron retrieves all the transactions
  that need to be processed.

  In some cases, it can causes issues when trying to process payments
  that are being process by the payment polling page after returning
  from the payment acquirer.

  To avoid this concurrency issues, the cron will only process payments
  that have been validated for at least 10 minutes.

closes odoo/odoo#29317
2018-12-06 14:09:24 +00:00
Nicolas Lempereur 89d3e2219c [FIX] website_sale: accessories button no all width
The cell containing "Add to Cart" button that adds suggested accessories
in the cart has col-* classes. Thus it there is "flex-item" CSS
properties that make no sense since there is no container and the
sibling are not flex items.

So the button tried to take 100% of width and this commit just fix its
proposed width to 25%. Before change width was 16.7% width for large
screen, 25% for medium screen and 33.3% for small screen. I choosed 25%
since it seemed a good default (we don't need 33.3% since .btn is
whitespace:nowrap so the size will be higher than 25% if necessary).

opw-1914994
closes #29287
2018-12-05 15:21:48 +00:00
Tejas Shahu 2a4c44bb4f [FIX] web: prevent crash in line chart
Before this commit:
While user was opening first time line chart graph, at that time undefined
label values were not being converted into undefined string due to misplace
code. So it was giving traceback error

After this commit:
Code has been moved to proper place.

Joint work with msh-odoo

Issue-ID: 1882328

closes odoo/odoo#29306
2018-12-06 10:38:44 +00:00
Laurent Smet 458b49241a [IMP] account: Improve matching communication rules
Suppose a statement line having 'SO022' as name.
Suppose a move having 'INV/2018/0001' as name and 'INV/2018/0001 SO022' as ref.

The previous behavior didn't work because '20180001 022' = ANY({'022'}) was False.

This commit changes the matching by computing the array in both size and checking the intersection.
{'20180001', '022'} && {'022'} is True

closes odoo/odoo#29299
2018-12-06 08:21:22 +00:00
Jeremy Kersten 8a0e42e8f4 [FIW] website_event_track: fix location order
Without this commit, each refresh of the agenda, will randomly show the locs.

-- Fix done in prod for oxp

closes odoo/odoo#29300
2018-12-05 08:54:19 +00:00
Jeremy Kersten ba7454eb08 [FIX] website_event_track: track.date is not required
Dont compare bool to datetime if not filled

TypeError: '<' not supported between instances of 'bool' and 'datetime.datetime'
2018-12-05 08:54:19 +00:00
Goffin Simon f86b9ff3c4 [FIX] base: Upgrading a module with deleted models
Steps to reproduce the bug:

- Write a model in lunch.py called "my.model"
- Install module Lunch
- Erase "my.model" in lunch.py
- Upgrade the module Lunch

A error was raised when processing function "_process_end" because
the ir.model.data record of "my.model" was not deleted

opw:1908813

closes odoo/odoo#29247
2018-12-05 15:39:02 +00:00
Nicolas Martinelli df3922f396 [FIX] account_payment: partial payment
- Activate Invoice Online Payments
- Create an invoice for 2000, make a partial payment of 500.
- Send the portal link to the client
- Open the portal link => the amount due is 1500
- Pay the invoice

The amount to pay is 2000 instead of 1500.

opw-1909118

closes odoo/odoo#29284
2018-12-06 07:17:12 +00:00
Cedric Snauwaert 053bb45706 [FIX] account: manual reconciliation auto assign partner is wrong
when selecting a line with a partner, all propositions for other partner dissapeared and we have no way in the manual reconciliation to remove the partner that is set up, so we removed the fonctionality to set the partner automatically when selecting a line in case of a manual reconciliation.

closes odoo/odoo#29289
2018-12-05 15:37:03 +00:00
Cedric Snauwaert 546c38d12c [FIX] account: manual reconciliation fix new icon
In the manual reconciliation widget, after a reconciliation with a writeoff is done, there is still an empty line displayed with the "new" icon. This commit removes the "new" icon on empty line.
2018-12-05 15:35:36 +00:00
Cedric Snauwaert 7b636f3342 [FIX] account: manual reconciliation with writeoff and currency was wrong
When trying to reconcile the following line with the manual reconciliation widget
(company currency in EUR)

Debit Credit Amount_currency Date        Currency
13.11    0          0        10/26/2018  /
0       34.16      -39       11/09/2018  USD

And a write off with the following value:
Debit: 21.05

The write-off created was not with the correct debit and the entries were not totally reconciled.

The reason being that the method was converting the 21.05 with the USD rate of today and changed the debit.

We should never convert debit/credit as debit/credit in the manual reconciliation widget is always displayed in company currency. However if all entries are with the same currency, the writeoff should also have that currency set.
This commit fixes this behavior.
2018-12-05 15:34:00 +00:00
Nicolas Seinlet 59c2559e97 [IMP] account: improved join
Joining on a case is far to be optimal. doing 3 left joins and a coalesce is faster.
partner_id is a required field in res.partner.bank, but some migrated database have
records in res.partner.bank model without id. To keep existing behaviour, the third
join (the one on the name) is kept for backward compatibility.

closes odoo/odoo#29276
2018-12-05 12:41:32 +00:00
Christophe Simonis 937d870ffc [FIX] account: correct reconcialtion widget tests
The widget expect a list of accounts to be defined.
2018-12-05 16:19:16 +01:00
Christophe Simonis b4c3268e38 [FIX] website_sale: convert price to company currency using the right method
Oversight of previous forward-port.
2018-12-05 15:26:14 +01:00
Christophe Simonis caf1837216 [MERGE] forward port branch saas-11.3 up to d4c65a7ede 2018-12-05 12:27:57 +01:00
Humberto Arocha 03c40e3104 [FIX] account: date in log must a string not a date object
Closes #29248

closes odoo/odoo#29262
2018-12-05 08:47:31 +00:00
len-odoo 97aec9f836 [FIX] account: hide meaningless measures from the pivot view
The fields amount_total, amount_total_signed, residual, residual_signed,
all sum values that are unsigned or in different units, as they may be in
different currencies.
Therefore their display in the pivot view can be confusing, misleading,
and may lead people to file bug reports.

Since support for hiding measures has been added in commit 24f7c7ce7f,
we remove these fields from view.

opw 1909046

closes odoo/odoo#29211
2018-12-05 08:15:21 +00:00
Lucas Perais (lpe) 332d43ebd4 [FIX] survey: adapt prefill controller to new date field
Try to print a survey answer which has a date question

Before this commit there was a traceback because the value_date
which is a Date field was not JSON dumpable

After this commit, the survey answer prints well

OPW 1914984

closes odoo/odoo#29250
2018-12-04 15:48:52 +00:00
Goffin Simon edc1cbc063 [FIX] stock: To prevent settig a wrong uom
Steps to reproduce the bug:

- Configure to use UoM
- Make an inventory adjustment for all product
- Select one product one the inventory line, and select the UoM

Bug:

All the UoMs were selectable but only the uoms in the same category of
the product are allowed.

opw:1911941

closes odoo/odoo#29238
2018-12-04 10:33:31 +00:00
len-odoo 24f7c7ce7f [FIX] web: add support for string and invisible attributes in pivot view
The pivot view may sum fields that are not really summable:
    unsigned values (e.g. in the case of refunds)
    values in different UOM, currencies (any different units really)
Which causes confusion when these fields are displayed.

We add support for the string and invisible attributes in the pivot view,
so that a field can be given a more informative name or hidden altogether.

opw 1909046

closes odoo/odoo#29144
2018-12-03 15:03:58 +00:00
Nicolas Martinelli cba55c12e4 [FIX] account: 'Load More' on Manual Reconciliation
In case there is a large amount of data to display, the 'Manual
Reconciliation' widget suffers from high CPU consumption, and therefore
slowness.

This is mainly due to the line rendering (function `_renderLines`).
Indeed, unlike the 'Bank Statement Reconciliation' widget which
retrieves the data partially, the 'Manual Reconciliation' widget
retrieves and renders all the data. No offset is implemented in this
case, neither for data retrieval nor rendering.

With this commit, we implement a partial rendering of the data
retrieved. This means that all data are fetched when loading the widget,
but only a part of it is rendered. We make use of the existing 'Load
More' mechanism to display more data. By default, 30 accounts or
partners are loaded.

By combining this with PR #28958, we aim to make the widget more usable
for large data volumes.

opw-1903575

closes odoo/odoo#28959
2018-12-03 09:57:07 +00:00
Odoo Translation Bot e0b1718e4a [I18N] Update translation terms from Transifex 2018-12-02 03:16:02 +01:00
lieyanqzu 849b169248 [CLA] Signature for lieyanqzu
closes odoo/odoo#29198
2018-12-01 04:54:24 +00:00
Nans Lefebvre ddc5cc186f [FIX] web: call _applyX2ManyChange with the correct viewtype
Have a one2many display records in a kanban subview,
which opens a form view when edited.
Edit a field displayed only on the form view.
A call to _applyX2ManyChange is done without giving it the viewtype argument,
therefore the fieldinfo is taken from the wrong view, traceback ensues.

opw 1914163

closes odoo/odoo#29607
2018-12-18 14:28:55 +00:00
lul-odoo 9b6073c3ea [FIX] web: Load form subviews without previous '*_view_ref' in context
On a form view of model A, if a many2one field (model B) has a [tree|form]_view_ref in the context
(to display a custom 'Search More...' tree view dialog for example),
when clicking on this field to display the model B form view, the context key *_view_ref is passed
when loading subviews (model C) making them crash because the view ref corresponds to the model B.

After this commit, '*_view_ref' keys in the context are dropped when loading subviews

closes odoo/odoo#29022
2018-12-03 08:03:09 +00:00
Sébastien Theys f8dad1bb4b [FIX] product,(website_)sale(*): fix product configurator
This commit has several parts:

- fix ordering of attributes and values
- fix/create python logic (notably for checking the possibility of a combination
	and for price computing)
- fix currency
- display correct info on the views without the need of JS (prevent flickering)
- fix various issues with website and SO
- add a lot of tests (both unit and tour)

================================================================================

*** Make consistent the filtering and ordering of product variants ***

Filter & Check possibility
==========================

The first variant shown on the website should always be possible.

When activating the customize "list view of variants", we don't want to show
impossible combination on the list.

We also don't want the user to be able to add to cart an impossible variant.

Show appropriate messages when no combination is possible.

Order
=====

We want the variant order to be consistent with what the user selected with the
sequence fields. The display order on the website should be the same than the
display on the various backend views.

This implies also fixing the order of:
- product.attribute
- product.attribute.value
- product.template.attribute.line
- product.template.attribute.value

The general order is now: (parent,) sequence, id.

Before, it was already a mix of those, but not always in the same order, and not
every key for every model. The name has been removed from the order: either we
sequence them correctly, or we want them in the creation order.

On the website, the first combination shown by the python should be the same as
the one that will be computed by the JS to prevent flickering.

Ideally there should be no RPC at page loading if the python has computed
everything correctly, but it is currently not possible to achieve because the
view logic for website_sale_stock is only in JS.

================================================================================

*** Fix product template and variant price computation ***

Move and improve the get_combination_info method:

- take into account tax included/excluded settings (B2B/B2C)
- take into account pricelist discount policy (striked price)
- fix inconsistencies when price after pricelist would be 0
- use proper rounding and discount compute with the currency helper methods
- fix an issue where context "partner" would have a mix of id and recordset

================================================================================

*** Fix currency conversions ***

The list_price and lst_price of a product are always encoded using the currency
of the product.

The results of "combination info" are always returned using the currency of the
pricelist if given, or the currency of the product.

The prices on an order (line) are encoded with the currency of its pricelist.

================================================================================

*** Fix dynamic variants access rights ***

Public users on the e-commerce should be able to create product variants if the
configuration of the attributes of the product template is set as "dynamic".

This uses "sudo" to bypass create security rules for public users.
Multiple checks are done to ensure that it creates a valid product variant.

================================================================================

*** Miscellaneous bugs, tracebacks and necessary improvements ***

In general:
 - correctly show warning when no variant is possible
 - don't let user add to cart an impossible variant (from optional product
 	modal or from any RPC), both in interface and controller logic
 - fix as much flickering as possible by correctly pre-computing in python/views
 - move business logic from controllers to models
 - correctly add no_variant and is_custom values on the SO line description

Sale order:
 - fix traceback when emptying the product_id field from configurator

website_sale:
 - correctly compute first image / carousel, and correctly swap images when
 	changing variants, without duplicate image or zoom problems
 - don't use list view of variants when it doesn't make sense
 - added missing product info when adding a no_variant attribute to cart
 - fix cart accessory product computation

website_sale_wishlist:
 - fix it with dynamic variants, no_variant and is_custom

website_sale_comparison:
 - fix it with dynamic variants (comparison and alternative products)

website_sale_stock:
 - fix it in general (some flickering still present)

================================================================================

Authored by @seb-odoo with contribution from @awa-odoo

task-1910821

closes odoo/odoo#28079
2018-12-18 16:21:32 +00:00
Sébastien Theys 4e01d5f702 [FIX] sale: fix indent of product configurator templates
This will make the diff of the following commit easier to read.
2018-12-18 13:02:06 +00:00
Sébastien Theys dc1b20f484 [FIX] sale,website: fix variant alert style
It should be warning instead of danger, and use appropriate BS4 classes.

Without this commit, the resulting style might be wrong with some themes.
2018-12-18 13:02:06 +00:00
Sébastien Theys 9e71571999 [FIX] website_sale: fix product variant image zoom
The product image zoom was computed in the start method, and an "on load" event
was set in some but not all cases.

This commit makes sure the load event is always set, to correctly recompute the
zoom feature when the image is later changed (for example, changing variant).
2018-12-18 13:02:06 +00:00
Sébastien Theys 87d75f78d6 [IMP] web_tour: allow simulating click without leave
This is important if the mouse must stay on the element after it has been
clicked. This is the case for the product image zoom, which will be tested in
the following commit.
2018-12-18 13:02:06 +00:00
Sébastien Theys bb8e6e7a82 [IMP] product: improve variant demo data
Activate variant by default with demo data: since we have demo data creating
variants, the database will be more consistent if the option is also activated
by default. It also allows to gain time when making a demo or testing feature
using them on a new database.
2018-12-18 13:02:06 +00:00
Sébastien Theys f763193374 [FIX] sale_quotation_builder: remove warning when installed
We don't need to clutter the interface with this warning once the module is installed.
2018-12-18 13:02:06 +00:00
Sébastien Theys 42ded05f4b [FIX] base: fix print pdf with --test-file command 2018-12-18 13:02:06 +00:00
mgh-odoo 6be0cdef98 [FIX] web: remove extra space in kanban dragging images
While dragging kanban record which have a cover image set, the kanban view
creates extra space, which makes it difficult to properly target a
position.

This is because of a jquery.ui issue for sortable when helper=clone is used.
In that case, then jquery.ui sortable will create a clone of current element
after hiding it. Note that jquery.ui tries to get height to current dragged
element after making it hidden(display: none) and display: none, so the element
does not return actual height and hence it gives innerHeight which considers
height of the image also and extra space is generated.

An alternative solution is to add start event in sortable option and
1) show ui.item
2) get height of the element and
3) hide ui.item, which gives proper height of the current dragged element

But removing helper=clone will also fix the issue and is not actually required.
Note that some special care had to be done to prevent the click from the
drag and drop operation to actually open the record.

Related to task: #1865788
Closes: #25734

closes odoo/odoo#29642
2018-12-19 10:28:17 +00:00
Martin Trigaux fa98749154 [I18N] export 12.0 source terms
Update to reflect the recent code changes

closes odoo/odoo#29636
2018-12-19 08:50:10 +00:00
Goffin Simon 4612d50bae [FIX] stock_account: No returned value for function _run_valuation
This commit 9eac6c6377 expects a returned value
from function called "_run_valuation".

But this function always returned None.

opw:1907021

closes odoo/odoo#29302
2018-12-06 09:45:09 +00:00
celm1990 b750c78b91 [FIX] web: translate terms on search view
Group by options for fields date and datetime was untranslated
Add call to translation method _t

closes odoo/odoo#29490
2018-12-18 16:48:46 +00:00
Nicolas Martinelli 16c1c89e46 [FIX] payment: manual acquirer
Raise an error if no manual acquirer could be found for the current
company instead of crashing.

opw-1915813
opw-1917979

closes odoo/odoo#29608
2018-12-18 12:53:31 +00:00
Mathieu Duckerts-Antoine 7618f84beb [FIX] web: sort pivot rows in comparison mode
Before this commit, it was not possible to sort
the rows of a pivot view while in comparison
mode. This fix makes it now possible. Note that
in comparison mode, a click on a header of type
"measure" will sort the rows according to the
column values coming from the data of interest.

closes odoo/odoo#28411
2018-12-18 12:56:06 +00:00
Jorge Pinna Puissant c7a307ffd2 [FIX] account: Two actions same name
opw-1917444

In the "Chart of Accounts" view, the action to view journal items show
up twice. This was because, two action windows had the same name, one
is for view journal items, and the second one is for view jounral items
for Tax Audit.
After this commit, the second action is named
"Journal Items for Tax Audit".

closes odoo/odoo#29597
2018-12-18 10:04:09 +00:00
Jeremy Kersten 7afaf2c277 [FIX] website: seo - fix translation for seo modal
Lang / Context is implicitely added in the query using this._rpc

Before this commit if you set the title 'Title 1' for your website in the main
langage and after edit the title as "Title 2" in another language, it was the
main title that was replaced instead of the translation.

Now we use this._rpc that bind automatically the context and so the current lang
that we are editing.

closes odoo/odoo#29596
2018-12-18 09:22:49 +00:00
qsm-odoo e1990d267c [FIX] sale: use theme design for optional product modal
Since the product configurator task, the optional product modal was
always using the backend style instead of the theme style.

task-1911015

closes odoo/odoo#29587
2018-12-17 15:46:19 +00:00
len-odoo 71ae0eac33 [FIX] im_livechat: fix table layout overflowing with long URL/words
Ignorant fools have been saying for more than a decade that <table> elements
should not be used for layout.
Once again, Odoo proves them wrong. You just need the right css.

opw 1914139

closes odoo/odoo#29498
2018-12-13 09:16:31 +00:00
Toufik Ben Jaa b49d5388ff [FIX] mail: crash on mail resend
- When resending a failed mail the code could crash.
  The issue is caused by the fact that calling `_get_recipient_data`
  with the parameter `pids` only, returns as the partners' groups the
  value `None`.

  The codes that uses the result of this method consider the groups as
  an iterable and crash when trying to iterate on a `NoneType`.

  OPW-1916498

closes odoo/odoo#29408
2018-12-11 08:32:12 +00:00