Commit Graph
127612 Commits
Author SHA1 Message Date
Christophe Simonis 4c61621efb [MERGE] forward port branch 11.0 up to 9a7e3c8b49 2019-04-08 17:45:00 +02:00
Christophe Simonis 9a7e3c8b49 [MERGE] forward port branch saas-15 up to cd28e53a31 2019-04-08 16:46:31 +02:00
Lucas Perais (lpe) ce3d83f579 [FIX] board: correctly fill action context with everything
Several cases:
- on a dashboard viewtype, put a group by on the chart
- on a list viewtype, apply a group by and an ordered by

In both cases the parameters were not taken into account when
rendering the view in the board app

ref: 40dd121938
This was because, when saving an action for the board app
we tried to fill the "action's context" with only the contexts of:
- the search query (where context is just one of attributes)
- the ownQueryParams of the controller

Doing that, some other vital attributes, like group_by and orderedBy
where forgotten in the process. "C'est ballot!".
Also, the "real context" of those attributes was saved
as a context within the context.
But (!), the action's context will behave as a "real context" when spawning
views and controllers down the line.

After this commit, we flatten as much as possible all those nested
contexts at the time of saving the view

OPW 1944857
2019-04-08 14:19:48 +00:00
Christophe Simonis efa90f78e5 [MERGE] forward port branch 12.0 up to 385342b575 2019-04-12 16:28:18 +02:00
Yannick Tivisse 4df020135c [FIX] l10n_be_hr_payroll: Fix typo 2019-04-12 13:24:59 +02:00
Nans Lefebvre 385342b575 [FIX] account: only put internal users as followers of vendor bills (2)
Fine-tuning of 0a4e67c609.
Due to some confusion, has_group had been replaced by user_has_groups
on the corresponding PR.
However the latter is not a higher-level version of the former,
since it checks the groups on the self.env.user, not on self.

As a result, the filtering was completely False, since it checked that the env
user was in group_user which was always True.

closes odoo/odoo#32653

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-12 10:27:02 +00:00
Julien Castiaux 4ba4d61903 [FIX] website_livechat: load im_livechat i18n
As authenticated user, join the website livechat. As a portal user,
start a livechat. Close it, it asks you to review the chat but all
messages are displayed in english.

opw-1958819

closes odoo/odoo#32629

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-04-12 08:02:41 +00:00
Christophe Simonis 636df25f21 [MERGE] forward port branch 12.0 up to c9d3653f48 2019-04-11 18:00:27 +02:00
Arnold Moyaux c9d3653f48 [FIX] mrp: state on workorder with 0 batch size
Usecase:
- Go on a BoM with a routing. Go on the first operation and set
the next operation(batch field) as 'Once a minimum number of products is
processed'.
- Set the batch size (minimum operation) to 0.
- Create a MO and plan it.
- The second work order has state 'pending' instead of 'ready'

It happens because the system automatically set the first wo as
'ready' and the following as 'pending' and don't check the batch
and batch_size.

closes odoo/odoo#32628

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-11 13:21:54 +00:00
Hugo Vinicius Garcia Razera 2a88e0197a [CLA] Sign Odoo CLA for hviniciusg
closes odoo/odoo#32591

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-11 11:55:38 +00:00
Yannick Tivisse 87a30cca7d [IMP] l10n_be_hr_payroll: Add an overridable method to compute costs
closes odoo/odoo#32582

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-04-11 11:19:50 +00:00
Nans Lefebvre 9365dc5d17 [FIX] account: better message on user group error
The validation error introduced in 552da8dc can pop up in contexts where
it is not expected;
e.g. not in editing user rights but while upgrading a module.
Therefore we make it more explicit, giving the user a way to resolve the error.

closes odoo/odoo#32623

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-11 10:29:30 +00:00
Xavier Morel 6bd9e71d9d [FIX] SSF: misinterpretation of onchange command (4)
From an onchange, at this point, (4) doesn't mean "no change" it means
"reset to database values". Through the interplay of client and server
reverse-engineering one another at this point the client (is supposed
to) assume the o2m results are "complete" and a diff from the
current *in-database* values rather than the in-client (sent to the
server) ones.

So a (1) should completely replace all existing values, and a (4)
should just remove all of them (but keep the record linked).

closes odoo/odoo#32617

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-04-11 07:49:21 +00:00
Goffin Simon 5a83cd2649 [FIX]sale_stock: Issue when clicking on "No backorder"
Steps to reproduce the bug:
- Create a SO with no salesperson
- Add a SO line with 2 storable product
- Confirm the SO and deliver only one product
- Click on "No backorder"

Bug:

A error was raised because the function "_log_activity"(called by _log_less_quantities_than_expected) requires a responsible

Partial Backport: https://github.com/odoo/odoo/commit/e1f9499d2672fb0a346f8ac74552f038f5204a64

opw:1950968

closes odoo/odoo#32592

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-10 14:35:40 +00:00
Nicolas Martinelli e402c89bcc [FIX] stock_account: price unit is zero
- Set a product P to average valuation, real time
- Create a PO for 1 unit @ 100, validate the picking
- Create a PO for 1 unit @ 0 (e.g. you receive a free product)

You cannot validate the picking because of the message 'The cost of P is
currently equal to 0...'

This error message is historical, to prevent users from an incorrect
configuration.

Since we still want to prevent misconfiguration, but support the
mentioned use case, we introduce an `ir._config_parameter` for people
who 'know what they are doing'.

opw-1962249

closes odoo/odoo#32550

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-10 12:15:58 +00:00
Christophe Simonis 0fb9110e46 [MERGE] forward port branch 12.0 up to 81215120af 2019-04-10 12:27:56 +02:00
Nans Lefebvre 81215120af Revert "[FIX] mail: remove attachment as main at unlink"
This reverts commit abc45b1
Since by default the ondelete attribute of a many2one is `set null`,
this was completely unnecessary to begin with.

Bug caused by this commit:
Unlink a record that has some attachments.
The unlink first removes the record, then its related attachments.
It calls remove_as_main_attachment, which reads the attachment res_model and
res_id. This triggers a check that the related record can be read.
However the related record has already been removed, an exception is raised.
It is thus impossible to unlink a record.

Closes #32563

closes odoo/odoo#32572

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-10 08:00:06 +00:00
Lucas Perais (lpe) c43acc34b8 [FIX] account: cash basis reconciliation almost all amount
In multicurrency

Do an invoice with cash basis lines in the foreign currency
Make a payment for almost all the invoice
"almost" refers to the point where virtually all taxes will be paid

i.e., paying 90 over 100, that contains a tax of 5%
The tax paid will be an amount almost equal (to a few cents) to the
total amount of the tax
It is not negligible, but if the currency rates are in the right configuration
(i.e. 0.005888)

Before this commit: the Cash Basis reconciliation will be considered as full and will trigger
the creation of the Exchange Diff Entry.
In turn, paying the rest of the invoice will pop up an error saying that some entries are already reconciled
(with the Exchange Diff entry)
It is not *that* that an exchange rate entry has been created the first time
after all, a percentage sufficiently close to 100 has been paid
But it blocks subsequent reconciliation, hence this fix

After this commit, if the cash basis entry doesn't match at least 100% of the paid move
then, we force to not check for full reconciliation

OPW 1953027
closes #31168

closes odoo/odoo#32023

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-10 08:02:14 +00:00
Lucas Perais (lpe) 30f7c0ea0e [FIX] account: tests reconciliation helper class
Before this commit, test reconciliation was inherited by
test reconciliation widget.
It made the actual test_xx functions of the former
being executed twice

After this commit, we create an intermediary test class for setUp and helpers
And the tests for each class execute only once
2019-04-10 08:02:14 +00:00
Lucas Perais (lpe) ea00318e9e [FIX] account: revert move subjected to cash basis
Before this commit, when reverting a move
that will be subjected to the creation of a cash basis move
the process failed saying that some entries were already reconciled

That was because the process tried to create the cash basis move during
the revert.
This is  wrong, because no real cash is dealt with.

After this fix, the move lines of the original entry are reconciled
only with their revert counterpart

OPW 1938809
closes #30972
2019-04-10 08:02:14 +00:00
Christophe Simonis af313858b4 [MERGE] forward port branch 12.0 up to c1c322dd40 2019-04-09 20:43:35 +02:00
Christophe Simonis c1c322dd40 [MERGE] forward port branch saas-11.3 up to 372ecf4c09 2019-04-09 20:38:23 +02:00
Antoine Prieels 5e8b667951 [FIX] hw_screen: Add delay to longpolling
When an error occurred in the longpolling, we used to resend a new
request immediately. This resulted in thousands of request in a few
seconds when we lost connection to the box.

closes odoo/odoo#32544

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-04-09 09:27:35 +00:00
Christophe Simonis 6d4940675f [MERGE] forward port branch 12.0 up to ea1fc124ef 2019-04-09 11:11:48 +02:00
Kiril Vangelovski 6bae16b788 [FIX] hw_screen: Mixed Content when loading with https
The protocol is hardcoded to `http` in the url for the longpolling
request (/point_of_sale/get_serialized_order). It should match the
same protocol as the page was loaded in to avoid Mixed Content errors.

closes odoo/odoo#32528

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-04-08 20:12:46 +00:00
sbbaro 71b590121e [IMP] Website sale performance improvement
The search on products is quite a slow sql query and it's run different times.
We avoid that repetition by storing it in a variable.

opw 1941352

closes odoo/odoo#32626

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-11 10:05:01 +00:00
Lucas Perais (lpe) c150ab367a [FIX] web: FieldFloatToggle cell multi language
Have a timesheet uom per Day
Have a language with a different number format than English

Click on grid cell to change its value

Before this commit, the value was stuck on the highest value in range
This was because the parsing of the value into float was not taking into account
the real format of the float

After this commit, it works in all languages

OPW 1964657

closes odoo/odoo#32581

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-10 12:33:45 +00:00
Christophe Simonis cd28e53a31 [MERGE] forward port branch saas-14 up to 32c2af2376 2019-04-08 15:53:36 +02:00
Julien Castiaux 30a848bffb [FIX] crm, sale: safe override of sales team
The user can delete teams created during the installation of the Sale
Team module, both CRM and Sale modify those teams but the way they
modify the teams doesn't take their deletion into account.

opw-1962297

closes odoo/odoo#32412

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-08 13:42:52 +00:00
Goffin Simon 8d97b3b6fc [FIX] stock_account: Multicompany wrong cost in picking validation
Steps to reproduce:
- 2 Companies Parent A, and Child B
- Create a Stockable Product FIFO/automated,
- In A leave cost as 0, in B give cost of 10
- Create an SO for product in company B
- Logged into Parent A, validate the picking for Child B

Behavior before the fix:
An error was raised saying: Error cost of 0 (but the SO had been created in B, so the price had to be 10.)

Behavior after the fix:
Now the cost of the company B is taken.

closes #32329

opw:1966322

closes odoo/odoo#32615

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-15 13:28:04 +00:00
Nicolas Lempereur 77a2411171 [FIX] mail: upload_attachment without model
The method /web/binary/upload_attachment may be used (eg. it is the case
in enterprise documents module) without res_model (eg. if folder_id is
specified).

Thus we should make it work (that was not possible since a26496b6e).

opw-1964091
opw-1965832
opw-1967181
opw-1968063
closes #32692

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-15 13:19:58 +00:00
Nicolas Lempereur a68412c1f2 [FIX] account: style account dashboard if groupby
If we use a group by on the account dashboard, the kanban tiles have the
size of a normal kanban card so all graphs and so on are overlapping
which is a little ugly.

With this changeset, we have the same base width as in the non-grouped
view (which in the non grouped view may change with flex).

On {0,MD} screen size, we get in one column full width and ignore this.

opw-1964331
closes #32659

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-12 13:26:20 +00:00
Christophe Simonis 33f1e5f64b [MERGE] forward port branch saas-11.3 up to 44aedc9b13 2019-04-15 18:33:51 +02:00
Nans Lefebvre ea1fc124ef [FIX] purchase: update reference onchange of vendor_bill_purchase_id
Commit 1be873d4 removed the modification of the reference field
from the _onchange_origin.
The reasoning was that since this is an onchange on invoice_line_ids, it was
applied too often, which annoyed users in the case they overwrote that field.

However when using the "Autocomplete" field (vendor_bill_purchase_id),
then the user expects values to by modified.
Before, it worked by setting the origin field, which trickled down
to the reference.
Since that commit removed this, we re-add it explicitly in that case.

opw 1962364

closes odoo/odoo#32500

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-08 13:18:51 +00:00
Thibault Delavallée 32c2af2376 [FIX] mass_mailing: correctly find partner email in mass mailing
In mass mailing access to partners when performing a mass mailing has been
done in batch to speedup computation [1]. Emails are put into a dictionary
allowing to find back the email based on partner_id.

However the matching between the partner and its emails is done using a
shortcut using the current document ID as partner ID. It works when performing
a mass mailing on partners but fails when performing a mass mailing on models
having message_get_default_recipients not returning only emails. Currently
in saas-14 main models return only emails (crm, event, mailing contacts) but
other models may encounter issues (applicants, tickets).

This commit fixes it by correctly matching partner id and its found email.

[1] See 65ed4553a5
2019-04-08 15:18:18 +02:00
Christophe Simonis e831064d93 [MERGE] forward port branch 10.0 up to 6431e366a8 2019-04-08 15:12:52 +02:00
Jalpesh Patel e524a25004 [FIX] digest: fix m2m typo that would not do whats expected
m2m ORM operation (4, id, _) was not correctly used, resulting in an
unexpected behavior. Instead of adding the record, it would add the record and
also the res.user(4,).

As that used is generally the public user, without an email address, that bug
would not be that critical but if that res.user(4,) does not exist (eg deleted),
then the code simply crash as it tries to read user 4 from db.

closes odoo/odoo#32425

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-08 09:30:41 +00:00
Christophe Simonis fef49061ea [MERGE] forward port branch saas-11.3 up to 4c61621efb 2019-04-08 19:52:29 +02:00
Thibault Delavallée ebba721130 [FIX] mass_mailing: fix statistic state computation
Replied / Bounced / Opened states should be computed prior to Sent state.
Indeed Sent is the default state once the email is sent. Then replied,
bounced and opened are states that happen after sending the email. It
is therefore necessary to re-order the state computation to correctly compute
the statistic state.

Related to task ID 1924711
Linked to PR #32496

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-08 12:39:41 +00:00
Thibault Delavallée b0491c4445 [FIX] mass_mailing: correctly find partner email in mass mailing
In mass mailing access to partners when performing a mass mailing has been
done in batch to speedup computation [1]. Emails are put into a dictionary
allowing to find back the email based on partner_id.

However the matching between the partner and its emails is done using a
shortcut using the current document ID as partner ID. It works when performing
a mass mailing on partners but fails when performing a mass mailing on models
having message_get_default_recipients not returning only emails. Currently
in saas-14 main models return only emails (crm, event, mailing contacts) but
other models may encounter issues (applicants, tickets).

This commit fixes it by correctly matching partner id and its found email.

Related to task ID 1924711
Linked to PR #32496

[1] See 65ed4553a5
2019-04-08 12:39:18 +00:00
Andrey Semko 986e405457 [CLA] signature for andriisem
closes odoo/odoo#32490

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-08 10:26:36 +00:00
Mohammed Mahgoub 8ac788adff [FIX] doc: Steps to install website theme in v12.0
Correct the instructions needed to install a website theme
In 12.0 the steps have changed

closes odoo/odoo#31886

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-08 12:41:14 +00:00
Mohammed Mahgoub 8f5a0d782f [CLA] signature for Mohammed Mahgoub 2019-04-08 12:38:15 +00:00
SimoRubi 6431e366a8 [FIX] web: call method with correct record
_compute_website_url can only be called on singletons
It should not be called with self but the record we are iterating on

closes odoo/odoo#32369

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-08 09:26:01 +00:00
Bohdan Lisnenko da28c37a4a [ADD] l10n_ua: Ukraine - Localization
One module with 2 chart of accounts:
- psbo (local)
- ias (ifrs rules)

We added the VAT taxes with tax groups.

Tags are already added for if we want to add
the VAT report later.

Closes #21402

closes odoo/odoo#32468

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-05 13:58:16 +00:00
Martin Trigaux 42530b02fe [FIX] web_editor: override fonts in reports
Fixes odoo/odoo#27487
Noto Color Emoji produces an error on wkhtmltopdf, cf
wkhtmltopdf/wkhtmltopdf#4149

In the backend assets, the $font-family-sans-serif is changed in
web/static/src/scss/bootstrap_overridden.scss

In the reports assets, the $font-family-sans-serif was NOT changed in
web_editor/static/src/scss/bootstrap_overridden.scss

The default boostrap fonts were still used in reports, ignoring the changes made
for backend.

closes odoo/odoo#32312

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-15 12:14:40 +00:00
Martin Trigaux 02a321cffb [FIX] web: use specific font for Arabic, Hebrew and Cyrillic alphabet
The basic font-family offered on Odoo do not support a large set of characters
and rely on the system fonts for non-latin languages
On a system without specific fonts installed, the characters were replaced by �
For Hebrew, the system sans-serif font (at least on Windows pc) was too small.

Rely on the unicode-range range CSS descriptor to load a font only for a
specific range of unicode code.
https://developer.mozilla.org/en-US/docs/Web/CSS/%40font-face/unicode-range
This way, the fonts are ignored for English text (and you don't have to load
the fonts of every possible language).

Add Noto fonts that covers many charsets.
There is an heavy version for many charset and lighter ones for Arabic and Hebrew
More ranges can be added later

Serve the fonts on our CDN to avoid shipping several MB of fonts for everyone
but lazyload it when needed.

Fixes odoo/odoo#32228
Fixes odoo/odoo#21781
2019-04-15 12:14:14 +00:00
Julien Castiaux 9ef33f4d43 [FIX] mail: File deletion on module uninstallation
PR #30798 introduced thread, message, and attachments deletion on a
module uninstallation. When removing attachments it was also removing
files in the filestore even if those files were still in use by other
attachments.

opw-1968117

closes odoo/odoo#32682

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-15 12:40:44 +00:00
Nicolas Martinelli 8906807669 [FIX] website: submit form
Example where the issue occurs:
- Publish an event
- Go to the website, register for that event
- At confirmation, when the email address is requested, click quickly
  several times on the 'Continue' button

Several registrations are created since nothing prevents multi-clicks.

The stateful button feature of the `button.js` jQuery plugin has been
dropped in Bootstrap 4 (see [1]).

[1] https://getbootstrap.com/docs/4.1/migration/#buttons

opw-1958580

closes odoo/odoo#32571

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-15 06:29:05 +00:00
Jorge Pinna Puissant b2d2668f85 [FIX] account: negative invoices in batch payments
Avoid the user to use batch payment with negative invoices (credit notes
or refund) and positive invoices (customer invoices and vendor bills).
This will create two different payment, one for the negative invoices
and one for the positive invoices, it will not partially reconcile them
before register the payment.

The normal behaviour is to add the negative invoice (outstanding debits
of the supplier or the customer credit notes) to the positive invoice
(vendor bill or the customer invoice), and after register the payment of
the balance.

opw-1959687

closes odoo/odoo#32250

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-10 12:21:42 +00:00