Commit Graph
123750 Commits
Author SHA1 Message Date
Goffin Simon ae61ed7f50 [FIX] delivery: Delivery method zip using the customer not shipping address
The available_carriers must be computed according to the shipping address.

opw:1967445

closes odoo/odoo#32693

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-15 13:20:46 +00:00
Arnold Moyaux 027ff77a9e [FIX] stock, mrp: scheduler assign finished move
Usecase to reproduce
- Create a BoM with finished product A and Comp C
- Create a RR on product A with min qty 10
- Product A is tracked by serial number and have route manufacture
- Run the scheduler twice.

The finished tabs in the manufacturing order created from the order
point contains 10 move lines with 1 qty reserved and 0 quantity done.

The first run created the MO. The second run, assign the finished moves
and thus created the move lines for finished product A.

However those move line are not used by mrp because the workorder and
the produce wizard will only create new lines instead of using existing
lines with reservation. Also action_assign on MO only trigger
_action_assign on raw moves.

This commit add a hook on scheduler in order to modify the domain that
will be used in order to search moves to assign. Use the hook in order
to avoid move with the production_id many2one set.

closes odoo/odoo#32597

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-04-11 07:24:49 +00:00
Julien Castiaux d5d93474de [FIX] account, portal, sale: odd sidebar on IE11
Open a quotation from the portal using IE11. The sidebar is rendered as
it did not have any width.

What we are trying to achieve on large screens is to create a sidebar
with a fix width the size of its children and to let the rest of the
content (right to the sidebar) expands. On small screens we want to
invert the direction from left-to-right to up-to-bottom.

The classes `col-12`, `col-lg` and `flex-lg-grow-0` are used to fulfill
that purpose.

The problem is due to the rule `flex-grow: 0 !important` applied by the
selector `.flex-lg-grow-0` on the sidebar. On Chrome/Firefox the dom
element takes the width of his children as minimal width, the
`flex-grow: 0` does not shrink the element below that minimal width.
IE11 does not set a minimal width based on the child elements of the
node, the width is equal to 0 and the `flex-grow: 0` forbid it from
growing.

The solution is to replace the said classes by the `col-lg-auto` class
that does exactly what we want and is cross-browser.

opw-1944188
opw-1935087

closes odoo/odoo#32484

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-16 06:10:29 +00: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
Christophe Simonis 44aedc9b13 [MERGE] forward port branch 11.0 up to 0b2dbbb337 2019-04-15 14:52:20 +02:00
Christophe Simonis 0b2dbbb337 [MERGE] forward port branch saas-15 up to b7a39c5722 2019-04-15 13:57:32 +02:00
Christophe Simonis b7a39c5722 [MERGE] forward port branch saas-14 up to 6b87c851b9 2019-04-15 12:00:54 +02:00
Christophe Simonis 6b87c851b9 [MERGE] forward port branch 10.0 up to 78ba90d548 2019-04-15 11:58:47 +02:00
Thorsten Vocks c2f071c619 [FIX] l10n_de_skr03, l10n_de_skr04: tax and fpos
* Some accounts have wrong tax tag mapping
* Some fiscal positions don't work properly (mapping of taxes, right tax
  keys, right accounts)
* Missing fiscal position "domestic partners" in order to allow
  automatic selection of the right fiscal position if it is a doemstic
  partner and to make it more clear for customers, otherwise they might
  wonder why fiscal position field is empty for domestic partners.
* Issue with fiscal position "Geschäftspartner EU (ohne USt.-ID)" to
  detect the right account, tax, tax tags if we sell to a customer / buy
  from a supplier  located in the EU without valid VAT-ID (for example
  private people)
* Issue with fiscal position "Geschäftspartner Ausland" to detect the
  right account, tax, tax tags  if we sell to a customer / buy from a
  supplier not located in the EU.

Closes #31389

closes odoo/odoo#32673

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-15 06:48:59 +00:00
Olivier Dony 78ba90d548 [FIX] requirements: bump up jinja2 reqs
Recommended by GitHub's repository alerts.

We normally stick as close as possible to the version we depend
on in the official DEB packages. This in turn depends on the version of
Debian stable at the time of release - for 10.0 that would be Debian 8
(jessie) and thus Jinja 2.7.3 (albeit with security backports).

However Jinja2 before 2.10.1 suffers from a few issues that could lead
to crashes of Odoo processes.

It seems it's worth an exception to our rule for pip users, similarly to
previous bump up at d2605bccdb.

closes odoo/odoo#32602

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-10 17:45:06 +00:00
Jorge Pinna Puissant c6b3dc613a [FIX] delivery: default sale and purchase ok in delivery product
When creating a delivery product from the delivery carrier form.
The delivery product should not be sealable or purchasable.

opw-1958029

closes odoo/odoo#32289

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-10 13:47:18 +00:00
Jorge Pinna Puissant 610b813c87 [FIX] delivery: description of the delivery method on SO line
In this way the description of the delivery method can be used on a SO
line. If the description wasn't set, the name of the delivery method
will be used.

opw-1958029
2019-04-10 13:47:07 +00:00
Nathan de Pryck 62f98e34c8 [FIX] stock_account: Performance of _compute_stock_value
On the ticket 1961412, the custommer has more than 12 millions
of stock moves. Before this commit, the search request  does
not take too much time to execute but fetching the fields on the
recordset takes a lot of time due to the 'in' in the where clause
of the associated SQL request.

This optimization permit to avoid this 'where clause' and decrease
the time to gather all the different fields. The time has been reduce
to less than one minutes where it takes approximately 20 minutes before.

closes odoo/odoo#32520

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-11 11:41:02 +00:00
Olivier Dony 6cbecced3d [FIX] requirements: bump up jinja2 reqs
Recommended by GitHub's repository alerts.

We normally stick as close as possible to the version we depend
on in the official DEB packages. This in turn depends on the version of
Debian stable at the time of release - for 11.0 that would be Debian 9
(stretch) and thus Jinja 2.8 (with security backports).

However Jinja2 before 2.10.1 suffers from a few issues that could lead
to crashes of Odoo processes.

It seems it's worth an exception to our rule for pip users, similarly to
previous bump up at d2605bccdb.

closes odoo/odoo#32601

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-10 18:03:01 +00:00
Odoo Translation Bot 330e1ea4ab [I18N] Update translation terms from Transifex 2019-04-14 03:14:27 +02:00
Denis Ledoux 39fd19ffd7 [FIX] point_of_sale: lost pos orders on IntegrityError
This revision is similar to
605b94e64c

except that instead of an OperationalError
(e.g. a conccurent update),
this is an IntegrityError which is raised,
an sql constraint which is not met,
e.g. a unique or required constraint.

In the case of this opw,
this is the picking name unique constraint
which was not met,
the picking sequence number has somehow been re-used.

Both
`psycopg2.OperationalError`
and
`psycopg2.IntegrityError`
inherits from
`psycopg2.DatabaseError`

We therefore choose to use this Exception class,
to include all kind of psycopg2 exceptions that prevent
the transaction to be committed.

opw-1965679

closes odoo/odoo#32577

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-04-10 09:28:16 +00:00
Christophe Simonis 372ecf4c09 [MERGE] forward port branch 11.0 up to 492c5b6e17 2019-04-09 20:34:03 +02:00
Christophe Simonis 492c5b6e17 [FIX] survey: prefill checkboxes
Oversight of 82d733d68c

See #32149

closes odoo/odoo#32557

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-09 16:54:42 +00:00
Jorge Pinna Puissant 1cf284e91e [FIX] calendar: alarm for past events
Before this commit, Odoo notifies the user of all the recurring past
events, existing before the installation of the module Calendar (old
events imported when synchronizing with Google, for instance). This
occurs only the first time a synchronization with Google is made. This
occurs because Odoo notify all the events that occurs since the last
time it notified, and the first time you install the module the date of
the last notification is empty.

Now, when the module Calendar is installed, the date of the last
notification is set by default to the current date (the date of the
installation of the module)

opw-1942443

closes odoo/odoo#32535

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-09 06:16:41 +00:00
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
Christophe Simonis cd28e53a31 [MERGE] forward port branch saas-14 up to 32c2af2376 2019-04-08 15:53:36 +02: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
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
Alex Tuyls 49eb24a467 [FIX] account, sale_timesheet: access rights when validating invoice
When validate an invoice, if the user is member of the timesheet user
group and the billing user group, it is forbidden to create an analytic
line without a project set. The previous commit (81218a8) allow the user
to create an analytic account line by adding a record rule in the
sale_timesheet module.

If only the account and timesheet modules' are installed, before this
commit, an error was raised when trying to validate an invoice in the
account module. This issue occurs because the record rule to allow the
user to create an analytic account line is found in sale_timesheet
module, and this one is not installed.
As an invoice can be validated without the need of the sales module's,
from the purchase module, or directly in the account module.
In this commit, the record rule was move to the account module.

opw-1948132

closes odoo/odoo#31661

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-10 13:40:54 +00:00
Adrian Torres 3f3d2b2773 [FIX] base: prevent module operations while cron is running
closes odoo/odoo#32234

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-05 13:10:35 +00:00
Carlos Lopez f1d0f2ada5 [FIX] stock_account: always return a value
4612d50bae fixed 9eac6c6377 as _run_valuation did not returned any result
4612d50bae was however returning a value only in one case

Move the return statement to alaways return value_to_return, whatever the state
of the move

closes odoo/odoo#32401

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-05 09:43:47 +00:00
Odoo Translation Bot 37378592db [I18N] Update translation terms from Transifex 2019-04-14 01:26:47 +02:00
Nans Lefebvre 29052c5328 [FIX] account: fix group checks
Due to incompetence, previous commiter used user_has_groups instead of has_group
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 on the whole recordset was wrong,
since it did the check on the env user for each record.

closes odoo/odoo#32655

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-12 13:25:51 +00:00
Nans Lefebvre 30b5e0c024 [FIX] purchase: move reference update to the right onchange
Move the code from commit ea1fc124 to the onchange on purchase_id.
The field vendor_bill_purchase_id is a technical one added in v12 to allow using
old vendor bills as template for new vendor bills.
However the logic on purchase_id was already in v11, so we match commit 14239733

opw 1962364

closes odoo/odoo#32661

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-12 14:16:56 +00:00
Julien Castiaux 917213963f [FIX] hr: add activity filter
Like other models with a chatter (sales, stock, ...) it is possible to
schedule activities on employees. Scheduling an activity add the
activity to the activity menu (top-right *clock* button) where activities
are classified as *late*, *today* or *future* and grouped by
application. Clicking any of the three class on an employee activity
shows all activities regardless of their class.

opw-1957013

closes odoo/odoo#32657

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-12 12:56:49 +00:00
Nicolas Lempereur 58c64558a9 [FIX] web: checkbox readonly is RO in list editable
Since f4fbaf1efa the structure of checkboxes has been improved, now we
have something like:

```
 <input type="checkbox" id="checkbox-18" class="custom-control-input">
 <label for="checkbox-18" class="custom-control-label">&#8203;</label>
```

With the first input invisible (whilst before it was visible and the
clickable element).

This cause an issue in an editable list view:

- we have a boolean readonly field in a cell
- we are on focused on a line (not in the boolean field cell)
- we click on the boolean field

=> the check mark is toggled

This is because when we switch cell, we try to activate the widget of
the other cell. Before f4fbaf1efa this issue did not happen since the
browser do not generate a click event when clicking a disabled checkbox.

With this changeset, a disabled FieldBoolean is not focusable as is the
case for other fields, so we can't "activate" it.

Without the fix, the added test fails with:

 [clicking disabled checkbox did not work]

opw-1958433
closes #32652

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-12 11:42:15 +00: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
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
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
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