Commit Graph
127612 Commits
Author SHA1 Message Date
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
Martin Geubelle 120359bf0c [FIX] web: restore handle and remove button width on list
Rev. odoo/odoo@9fbb4fb wrongly removed the fixed width on handle and
button width on list views.

This commit restores it.

closes odoo/odoo#32467

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-05 13:37:56 +00:00
Martin Geubelle cdd644befc [FIX] web: correctly update modifiers in editable list with buttons
Since rev. odoo/odoo@015958d it is possible to add buttons in list group
headers. These buttons are defined in <groupby> nodes, pointing to m2o
fields. Modifiers specified on these buttons thus use fields on the m2o
comodel.

There was a traceback in editable list view, when grouping by a m2o
that defines a groupby button with modifiers as the modifiers are not
registered with the same datapoint. When updating the modifiers, one
must ensure that the modifier are related to the updated record.

closes odoo/odoo#32456

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-08 11:23:24 +00:00
Aurélien Warnon b424aba504 [FIX] sale_product_configurator: remove es6 JS code
Task#1964518

This commit removes es6 code that was unintentionaly introduced
by the product configurator for better compatibility

closes odoo/odoo#32452

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-12 06:37:09 +00:00
Christophe Simonis 3fc2577c01 [MERGE] forward port branch saas-12.2 up to be3c981423 2019-04-11 19:27:36 +02:00
Christophe Simonis be3c981423 [MERGE] forward port branch saas-12.1 up to 636df25f21 2019-04-11 18:17:25 +02:00
Christophe Simonis e7a0d82c3c [FIX] account_check_printing: correct test
Since 491deeb3d4, only check related to
reconciled invoices are printed. Adapt test to take it into account.
2019-04-11 17:24:25 +02:00
Goffin Simon 36d4c99828 [FIX] sale_coupon: Promotion code removed when adding in shopping cart
Steps to reproduce:
- Create a sale.coupon.program with a discount of 10% and generate coupons for it
- Go on the shop and add a product of 100€ in the cart
- Go in your shopping cart and add a promotion code
- A new line has been created in your cart with a discount of 10€
- Click on "Process to checkout"

Bug:

The discount had been removed from the cart

Technically:

When clicking on button "Process to checkout", the function "recompute_coupon_lines" is called several times.
The second time, in function "_remove_invalid_reward_lines", the valid applied coupon program couldn't be retrieved
due to the sale price of the discount_line_product_id = -1000000 €. The function _filter_on_mimimum_amount filtered
the targted program  because the untaxed_amount of the order was equal to -999900€. So the program._compute_program_amount
was all the time greater than untaxed_amount or untaxed_amount + tax_amount

It s not consistant to set a default value to -1000000 to prevent pricelist strikethrough because in some currencies,-1000000 is not enough.
Now the reward lines are not strikethrough.

X-port/cherry-pick of odoo/enterprise@2748249c0b

opw:1957671
2019-04-10 18:59:59 +02:00
Christophe Simonis 3a3f7fd586 [FIX] web: convert forward-ported test to use async/await 2019-04-10 18:11:24 +02:00
Christophe Simonis b917fdd1ac [FIX] web: correctly forward-port 8d34eb1328.
I shouldn't have trust the comment and apply the patch anyway.
2019-04-10 18:09:55 +02:00
Aurélien Warnon 2268e747c9 [FIX] survey: allow creating survey with no sections
Task#1958723

This commit fixes the survey form to allow creating, testing and sharing
surveys that don't have sections as long as they don't use the "page_per_section"
layout.

closes odoo/odoo#32159

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-10 15:03:10 +00:00
Priyanka Kakadiya 61495126ae [FIX] survey: correct score of answer in demo data
- when answer is correct, then score should be +1.

Related to Issue: 1967506

closes odoo/odoo#32612

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-11 07:02:59 +00:00
Christophe Simonis 5313cea8e6 [FIX] snailmail: add missing model entry in test declaration
This allow enterprise tests to pass.
2019-04-10 15:38:09 +02:00
Christophe Simonis e145f2b0c8 [MERGE] forward port branch saas-12.2 up to 2694174b41 2019-04-10 15:10:24 +02:00
Christophe Simonis 2694174b41 [MERGE] forward port branch saas-12.1 up to 0fb9110e46 2019-04-10 14:24:09 +02:00
Christophe Simonis c9e1deb496 [MERGE] forward port branch saas-12.1 up to af313858b4 2019-04-09 20:48:01 +02:00
Christophe Simonis 6c8e30cae6 [MERGE] forward port branch saas-12.1 up to 6d4940675f 2019-04-09 12:16:06 +02:00
Carlos Lopez 288d82a671 [FIX] pos_hr: auto_install on module pos_hr
In the manifest must be auto_install instead of auto-install
complementary to commit f14092c

closes odoo/odoo#30980

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-08 13:32:40 +00:00
Pierre Paridans 75c219bfdf [FIX] mail: chatter's button alignment and composer width on mobile
Buttons "Send message / Log note / Activity" are on two lines instead of
one. In addition there is a 1px glitch on the attachment icon.

Also long attachment name on tiny screens (i.e. iPhone 5) breaks the
composer layout: horizontal scrollbar appears.

The two-line buttons effect is related to a change (fix) in Bootstrap
4.2 which removes the white-space: nowrap on .btn. It was originally
introduced in Odoo through https://github.com/odoo/odoo/pull/29949.

Reference: Original Bootstrap PR https://github.com/twbs/bootstrap/pull/27010

Task ID: 1946573

closes odoo/odoo#31939

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-04-08 12:31:16 +00:00
Odoo Translation Bot 7887dd8727 [I18N] Update translation terms from Transifex 2019-04-07 06:20:48 +02:00
Christophe Simonis 3f95b074e9 [MERGE] forward port branch saas-12.2 up to f2be461f09 2019-04-05 18:46:10 +02:00
Jorge Pinna Puissant bb17098172 [FIX] mail: only display errors linked to message of current user
fine-tuning commit 1120bffb66

Before this commit, the search on message_has_error (used when clicking
on a failure notification) only display errors linked to message of the
current user. Also, the filter Has_error is true, in the messages view
in technical menu only display the message with errors of current user.

Now, the filter Has_error is true display the message with errors of all
users. The search on message_has_error behave as before.

opw-1958813

closes odoo/odoo#32462

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-04-05 13:20:21 +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
Sébastien Theys 742fa44fe9 [FIX] product: fix speed of closest combination
Before this commit, the code would try to loop over all possible combinations
following their sequences, until it found the requested one, which could be
extremely slow if there was a lot of combinations.

Now if the given combination is possible, we skip that useless looping and
yield it directly.

To reproduce this: create a product template with millions of possible
combinations (using dynamic attributes) and try to add to cart a combination
that would be found late in the looping. Before the commit, the request would
take too much time.

opw-1958623

closes odoo/odoo#32433

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-05 09:48:07 +00:00
Nicolas Lempereur 924beddeb1 [FIX] sale_management: translate quote template t&c
On a quotation template, the "Terms and conditions" (note) field may
override the company terms and conditions.

The company terms and conditions is translatable is translatable at
least since 2013 (a510050ba) but the quotation template terms and
conditions has never been translatable.

With this changeset the quotation template terms and conditions are
translatable (so when used on a partner in the lang of the partner for
the quotation).

opw-1960728
closes #32236

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-09 09:31:25 +00:00
Christophe Simonis 5521b05a04 [FIX] account: do not force users on B2B group on update
Followup of 552da8dc8d (#32200)

opw 1950833

closes odoo/odoo#32472

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-04-05 17:05:15 +00:00
Nans Lefebvre abc45b19d0 [FIX] mail: remove attachment as main at unlink
If an user unlinks an attachment,
it doesn't remove it as message_main_attachment_id.

opw 1950403

closes odoo/odoo#32347

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-05 13:43:28 +00:00
Nans Lefebvre 6a5dab9c64 [FIX] mail: reload the record when uploading attachments if post_refresh is set to always
When post_refresh is set to 'always', the displayed record is entirely reloaded
each time a message is posted in the chatter.
However no such thing exists for when attachments are uploaded.

This is of use e.g. when in the view there are fields that have attributes that
depend on computed fields, themselves dependent on the record's attachments.

One such case is the OCR.

opw 1950403
2019-04-05 13:42:55 +00:00
Nans Lefebvre c791981abc [FIX] mail: only register as main attachment if main not already set
Commit a26496b6e7 registered an attachment added through the widget as record's
message_main_attachment.
This to make the OCR feature available for such attachments.
However we copy more closely the behaviour in message_post,
which only puts the attachment as main if there isn't already a main.

opw 1950403
2019-04-05 13:42:39 +00:00
Nicolas Martinelli c89b8451c2 [FIX] stock: inventory report
Avoid overlap between address and title in case of a long address.

opw-1966325

closes odoo/odoo#32546

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-09 11:32:43 +00:00
Lucas Perais (lpe) cdc150d0a3 [FIX] board: fixed height for graph svg container
Commit 9214d78152 is a bit old and made
huge white spaces between graphs

Commit 89931d1749 introduces
a dedicated svg container, on which we can set a fixed height

The 250 px comes from what is being done in the web_dashboard app
with commit odoo/enterprise@1638e5d481

OPW 1944857

closes odoo/odoo#32522

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-09 10:32:19 +00:00
Nicolas Lempereur a540f7864a [FIX] account,sale: colspan revert part of e2e27b41a
In e2e27b41a variable `colspan` and several `<t t-set="colspan"/>` were
removed replacing `t-att-colspan="colspan"` with `colspan="99"`.

- sale_management.sale_order_portal_content_inherit_sale_management has
  `<t t-set="colspan" t-value="colspan+1"/>` overidding the portal view
  sale.sale_order_portal_content which so may result in error 500
  because colspan variable does not exist

- when doing a customization adding a column, adding:
  `<t t-set="colspan" t-value="colspan + 1"/>` was the expected behavior
  which after colspan change would break

So this changeset reintroduce `<t t-set="colspan"/>` tag up to not
including master, they will have no effect but possible existing xpath
or use of the variable colspan will no longer cause an error.

note: for 12.0 up to saas-12.3 (not necessary in master)
opw-1965886
closes #32539

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-09 08:29:39 +00:00
Aaron Bohy 7d31b863ca [FIX] web: list: re-evalute modifiers depending on id
In an editable (main) list view with modifiers depending on the
record id, add a new record. While the record isn't created yet,
the modifiers were correctly evaluated. However, they weren't
re-evaluted when the record was saved (thus getting an id), and a
reload of the view was necessary for the modifiers to be correctly
applied. With this rev. they are now correctly re-evaluated when
the record is saved.

closes odoo/odoo#32483

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-04-08 11:32:18 +00:00
Aaron Bohy 8d34eb1328 [FIX] web: editable list: shift-tab and readonly fields
Before this rev., navigating with shift-tab didn't produce the
expected result when there were readonly fields on the way. For
instance, pressing shift-tab on a field:
- to the right of a readonly field: the focus was kept in the
  current field, whereas it should have been moved to the first
  editable field to the left of the readonly one
- in the editable first cell of a row, with a readonly field in
  the last column: the focus was moved to the previous line,
  which is ok, but on the first editable cell of it, whereas it
  should have been on the last editable cell.

@KangOl this commit needs to be forwardported up to saas-12.2, not
later (the code slightly changed in saas-12.3, and we did another
version of the fix).
2019-04-08 11:32:18 +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
Laurent Smet 1a871d7243 [ADD] l10n_be_edi: allow import of XMLs as Vendor Bills
Task 1823110
New module to import bills in the belgian e-invoice format.

Author: las@odoo.com
Co-Author: wan@odoo.com

closes odoo/odoo#24303

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-05 09:08:09 +00:00
Vincent Schippefilt eebb0c6152 [FIX] web: corrected the order of icons in systray
Since the merge of JQuery 3, the building of systray icons is non
deterministic.

After this fix, the menus are loaded correctly in order.

Task-ID: 1960741

closes odoo/odoo#32382

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-05 10:13:41 +00:00
Christophe Simonis f2be461f09 [MERGE] forward port branch saas-12.1 up to f2d0995362 2019-04-05 10:50:56 +02:00
Damien Bouvy a25abec95c [FIX] orm: don't crash on index creation
For existing installations, creating indices might not always be
possible, e.g. if you have a Text/Char field that has an index=True
set on it in a field override and pre-existing rows longer than
the pg supported size , the index creation will fail.

Instead of failing miserably during the schema modification, simply
log the problem instead and keep going.

closes odoo/odoo#32442

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-05 07:53:07 +00:00
Christophe Simonis 214e819c1b [MERGE] forward port branch saas-14 up to 6e0c89867e 2019-04-04 19:34:35 +02:00
Christophe Simonis 6e0c89867e [MERGE] forward port branch 10.0 up to 60592561d7 2019-04-04 18:33:42 +02:00
wan 6940cfddbc [IMP] account: visible but not required bank account on payment
When making a manual payment with account_sepa we want to allow people to add a bank account as it might display the European QR code for banking app, but this should stay optional.
So we made sure that the conditions making the field visible and required weren't the same.

part of task #1918423

closes odoo/odoo#32198

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-04 12:46:20 +00:00
wan 3c2e3b8c5a [REF] account: simplification of payments objects
simplification of payments objects and refactoring of the code

* registering payment(s) from the list of invoice now generate a single payment per invoice selected
* no more abstract object for payments/payment wizard as the logic is now really simple:
    - group_invoices option is now removed and we never try to group payments based on the currency/customer of whatsoever (see above),
    - the payment amount is the full residual amount of invoice and users cannot change it anymore
* partner_bank_account_id not required as soon as visible (depends on the payment method)
* refactoring to name tags and allow easier inheritance via xpath

part of task #1918423
2019-04-04 10:42:41 +00:00
William Henrotin 2190568d9e [IMP] mrp: suggest lot on workorder
On a manufactoring order, 'checking availability' will make the reservation of
the components to consume. If those components are tracked by lot or serial numbers, the
reservation will also set a available lot/sn on the move lines and workorder lines.

The reservation already works on product produce wizard lines and workorder line
(form view). We need this commit as preliminary work to being able to suggest them
on the workorders tablet view too.

In case of requesting the reservation after planning the production (applying
reservation on already created workorder lines and checks), we deleted all lines
not yet consumed. They are then recreated with the reservation.

The user can obiously still use the lot/sn he wants by changing it onto the
workorder.

Task : 1891864

closes odoo/odoo#28020

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-04 11:32:42 +00:00
William Henrotin 7556938fc7 [IMP] mrp: multiple finished product lots
This commit allows the user in charge of manufacturing products to
split his production into different lots if this production is done via
workorders. Using a lot in a workorder will adds constraint to all the
other ones. It will also prefil the final lot field and matching quantity
to produce for futur workorders.

This commit uses workorder lines (in another one2many as standard workorder_line_ids)
to register lot/serial number and produced quantity. Prefill lots and
quantities are all read from those lines

Task : 1891864
2019-04-04 11:13:41 +00:00