Commit Graph
127612 Commits
Author SHA1 Message Date
Nicolas Martinelli 0cda05853e [FIX] website_blog: Latest Posts
On the website, when the widget "Latest Posts - Big Images" or "Latest
Posts - List" is added a 404 error is raised in the console.

This is because the regular expression of the background image is too
'greedy' and also match the trailing double quote, e.g.:
`website_blog.blog_post_cover_02"` instead of
`website_blog.blog_post_cover_02`.

By making it match the minimum pattern, the trailing double quote is not
selected.

opw-2061596

closes odoo/odoo#36622

X-original-commit: 0797a4ab90ec4d9be55e16d917da98909ce0ece4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-10 11:59:10 +00:00
Lucas Perais (lpe) 0c5409f254 [FIX] sale: i18n: fr: translation downpayment
Before this commit, a french translated term missed the string format symbol
It crashed when making a so with a downpayment and issuing invoices

After this commit, the term is corrected, and no crash occurs

OPW 2069089

closes odoo/odoo#36574

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-09 14:45:12 +00:00
RomainLibert 988e201d2e [FIX] lunch: allow location_id to be NULL
In case the last location of a user was NULL in databse, lunch was
crashing because lunch_kanban was adding an undefined leaf to the load
domain.

closes odoo/odoo#36571

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-09 14:04:12 +00:00
Nicolas Lempereur 25bba05710 [FIX] account: wrong html in AR translation
This translation causes a traceback when opening accounting app in
arabic.

opw-2068360
opw-2068513
opw-2069010
closes #36570

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-09-09 14:02:04 +00:00
Romain Estievenart 00d65a9495 [FIX] calendar: Attendance buttons doesn't exist on mobile
Step to reproduce :
For small screens
 > enter the debug mode
 > go to the calendar app
 > access one of your meetings
 > access the tab "invitations"
 > try to change the state of attendance

It's due to the missing kanban view used by the o2m field 'attendee_ids'
We had to create this missing kanban view to allow theses actions on mobile.

opw-2058770

closes odoo/odoo#36501

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-09-09 11:42:53 +00:00
Joren Van Onder 5e13e13a20 [FIX] payment_authorize: create a customer profile for ACH transactions
The response profile of an ACH transaction won't contain a credit card
number since ACH transactions use bank accounts instead. It looks like
this:

<getCustomerPaymentProfileResponse
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <messages>
    ...
  </messages>
  <paymentProfile>
    <billTo>
      <firstName>XXX</firstName>
      <lastName>XXXX</lastName>
      <address>XXX XXX XXX</address>
      <city>XXX</city>
      <state>XX</state>
      <zip>XXXXX</zip>
      <country>XXX</country>
      <phoneNumber>XXXXXXXXX</phoneNumber>
    </billTo>
    <customerProfileId>XXXXXXXXX</customerProfileId>
    <customerPaymentProfileId>XXXXXXXXX</customerPaymentProfileId>
    <payment>
      <bankAccount>
        <accountType>checking</accountType>
        <routingNumber>XXXXXXXX</routingNumber>
        <accountNumber>XXXXXXXX</accountNumber>
        <nameOnAccount>XXX</nameOnAccount>
        <echeckType>WEB</echeckType>
      </bankAccount>
    </payment>
  </paymentProfile>
</getCustomerPaymentProfileResponse>

This causes the transaction not to get confirmed in Odoo:

...
File ".../authorize_request.py", line 241, in create_customer_profile_from_tx
  res['name'] = response_profile.find('paymentProfile/payment/creditCard/cardNumber').text
AttributeError: 'NoneType' object has no attribute 'text' - - -

To solve it fall back on the accountNumber if there's no cardNumber.

opw-2062784

closes odoo/odoo#36298

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-05 17:25:27 +00:00
Lucas Perais (lpe) 0aa4bd1da9 [FIX] l10n_in: adapt invoice and report to new taxes
Before this commit, printing an invoice crashed
This was because of the refactoring of taxes

After this commit, the invoice prints well
and the specific taxes amount appear in the right columns

OPW 2060259

closes odoo/odoo#36244

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-29 15:20:54 +00:00
Raphael Collet 63b3297af3 [FIX] models: _rec_name when field x_name is discarded
closes odoo/odoo#36617

X-original-commit: 32ca79940b1608495cb08c2272add5216685af71
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-10 10:38:12 +00:00
Christophe Simonis 9bf0b04adb [MERGE] forward port branch 12.0 up to 82a8cdd6f2 2019-09-06 17:52:48 +02:00
Christophe Simonis 82a8cdd6f2 [MERGE] forward port branch saas-11.3 up to 091aa33190 2019-09-06 16:51:57 +02:00
Christophe Simonis 091aa33190 [MERGE] forward port branch 11.0 up to f048652ca7 2019-09-06 16:08:58 +02:00
Olivier Colson e270efff2e [FIX] account: tax lock date: avoid posting account moves that would impact the tax report before the tax lock date
The previous version of this verification was buggy and inadequate. It was for example impossible to post an account.move before the tax lock date, even if it did not impact the tax report in any way.

closes odoo/odoo#36289

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-09-06 11:00:17 +00:00
RomainLibert d4fab012f6 [FIX] l10n_ae: forward port broke this
closes odoo/odoo#36502

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-09-06 11:07:13 +00:00
Raphael Collet f048652ca7 [FIX] models: callable in api.depends() sees valid _rec_name
Determine `model._rec_name` before the dependencies of the fields.  The
compute method of the automatic field `display_name` uses a callable
depends that retrieves `model._rec_name`.

closes odoo/odoo#36479

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-06 09:02:51 +00:00
Raphael Collet 96266bfe54 [FIX] models: callable in api.depends() sees valid _rec_name
Determine `model._rec_name` before the dependencies of the fields.  The
compute method of the automatic field `display_name` uses a callable
depends that retrieves `model._rec_name`.

closes odoo/odoo#36480

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-06 09:02:19 +00:00
Sébastien Theys c6bb103eac [IMP] website: avoid computing multi_website_ qcontext if not useful
Those values are only used on the website navbar when the user is in both groups
so the vast majority of the time they are done for no reason.

This reduces the number of queries by 2 on every page when the user is not admin
and/or multi website is not enabled.

Part of task-2061122

closes odoo/odoo#36483

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-09-05 14:53:16 +00:00
Nicolas Martinelli 3cadfebf0f [FIX] account: avoid traceback in auto-reconciliation
Commit 6b6d290a5b made sure that the list of candidates was not
empty to avoid a zero division. However, it might still happen that the
`total_residual` is zero.

We make sure to avoid the zero division in this case.

opw-2058784

closes odoo/odoo#36482

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-05 13:45:49 +00:00
Jorge Pinna Puissant 2581693b5d [FIX] mrp: warning message in production order report
— create a bom which uses 5.6 units of a product;
— make a production order;
— reserve the materials (all materials should be available);
— print the production order report.

Before this commit, a warning message in the report that says : 'All
components could not be reserved. Click on the "Check Availability
button" to try to reserve components'. This warning message is shown
despite the fact that all the components are reserved. This occurs
because of a rounding error.

Now, the warning message only when a component could not be reserved.

opw-2058921

closes odoo/odoo#36462

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-05 13:37:12 +00:00
Goffin Simon b4a1b87fb6 [FIX] mrp: domain on field final_lot_id in mrp.production.work.order.form
Steps to reproduce the bug:

Let's consider two storable products P1 and P2 where P1 is tracked by serial number
- Create a BOM B  for P1 where P2 is a component
- Create a serial numberv SN for P1 with no quantity
- Create a MO M1 for P1 and click on button "Produce"
- In the view MRP Product Produce, SN is selectable in the field lot_id
- Now change B and set a routing on it
- Create a new MO M2 for P1 and click on produce
- At least one WO has been created, click on the first one

Bug:

- SN is not selectable in the field final_lot_id

The domain set on the field final_lot_id:

"['|', '&', ('product_id', '=', product_id), ('product_id.tracking', '!=', 'serial'), ('use_next_on_work_order_id', '=', id)]"

didn't allow to chose SN.

With this fix, it's now possible to chose SN on the first WO created for M2

opw:2059745

closes odoo/odoo#36425

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-05 09:35:39 +00:00
Nicolas Martinelli a3f2c82789 [FIX] stock, mrp: merge SFP for 2 different MO
The condition needs to be fined-tuned, so revert for now.

This reverts commit 40487aca5c.

closes odoo/odoo#36470

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-05 12:29:43 +00:00
Lucas Perais (lpe) 7c28c97724 [FIX] hr_expense: sheet multi expense partial payment
Create two expense and put them into one sheet
Post the sheet

Make One partial payment with the wizard (Register Payment)
Do it again for the residual amount

Before this commit, it crashed because the second payment tried to reconcile
itself with an already reconciled line

After this commit, all the lines that need to be reconciled
actually are without crash

OPW 2065501

closes odoo/odoo#36454

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-05 09:22:20 +00:00
Nans Lefebvre 85b9f3abfd [FIX] product: pricelists with temporary discounts
Create a pricelist with a temporary discount on some product only for today.
Go to the shop. The discount is applied on the product.
Add the product to the cart.
Go to the cart page (review order): the price does not use the discount.

Because the query getting the pricelist item is some handwritten SQL,
it only works for dates, and not e.g. in the case of datetimes.
So the pricelist item encoding the discount is not retrieved, and thus not used.

It turns out e.g. in _website_product_id_change it gives a datetime in context,
explaining why sometimes the discount is applied, and sometimes not.

We use fields.Date.to_date as it should work on all date formats we shall pass.

Co-written with @sbbaro

opw 2054881

closes odoo/odoo#36453

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-09-05 08:58:07 +00:00
Christophe Simonis a4fe211ee2 [MERGE] forward port branch 11.0 up to cd1b56b41f 2019-09-04 16:31:43 +02:00
RomainLibert c7f11aae6e [FIX] hr_holidays: aggregate attendances using day_period and dayofweek
Before this commit, if you had defined multiple attendances for the
morning or for the afternoon, the system would only use the first
attendance defined for either morning or afternoon.

This lead to wrong computations of the real leave length.

This commit fixes this issue by getting the min(hour_from) and
max(hour_to) for the attendances using a read_group.

closes odoo/odoo#36413

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-04 11:36:04 +00:00
Goffin Simon cd1b56b41f [FIX] account: Wrong amount due when reconciling with refund
Steps to reproduce the bug:
- Let's consider the following currency rates: 1.00 for USD and 0.50 for EUR
- Create invoice I with the same currency of your company (USD) and amount due = 100$
- Validate I
- Create refund R with  a diffenrent currency of your company (EUR) and amount due = 1€
- Validate R
- Reconcile R with I

Bug:

The amount due of I was 196$ instead of 98$

PS: The root of this issue was coming from function assign_outstanding_credit that was called when
reconciling R with I. This function changes the currency_id and the amount_currency of the account move line.
So the function _amount_residual defined on model account.move.line was triggered as
the currency_id was changed. In _amount_residual, the residual_amount_currency was computed.

Forward-port up to saas-11.3

Closes #36252

opw:2062103

closes odoo/odoo#36412

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-04 11:04:26 +00:00
Christophe Simonis 6143de52ad [MERGE] forward port branch 11.0 up to 923fb7aa05 2019-09-04 11:33:04 +02:00
Jorge Pinna Puissant 92990ad30e [FIX] i18n: missing Slovenian translation
Slovenian language, as many others languages, is not present in the
beta/master projects in Transifex.

For some reason, Transiflex removed all current translations, this was
already fixed in 12, but as there are not automatic forward-port for
translations, this is a manual forward-port.

opw-2060055

closes odoo/odoo#36374

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-03 11:32:39 +00:00
Christophe Simonis 7895044a79 [FIX] web: unpatch test Views earlier
We need to unpatch the view as soon as we correcly applied the
`groupedBy` attribute to avoid sub views to also be patched.

closes odoo/odoo#36486

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-05 13:43:51 +00:00
Christophe Simonis 41f7befb8e [FIX] web: correctly await promises in forward-ported test 2019-09-05 13:41:59 +00:00
Christophe Simonis 02a8490f05 [FIX] web: use defined variable
Oversight of previous forward-port.
2019-09-04 20:14:15 +02:00
Jorge Pinna Puissant dc5a8b1b30 [FIX] website_sale_coupon: promotion program image
Before this commit, when using a promotion program ('I have a promo
code') in the shopping cart in the e-commerce, the image of the
promotion product is only shown if the user is connected.

opw-2056968

closes odoo/enterprise#5343

X-port/Cherry-pick of odoo/enterprise@88e1ab31d2

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-04 19:40:17 +02:00
Lucas Perais (lpe) 9570151cb5 [FIX] sale_coupon: display domain widget in dialog
Before this commit, when being on the sale coupon program form view
in French, it was impossible to click on the record found by the domains

this was because the widget domains were displayed in line, which made long
text overlap

After this commit, we display the widgets in the "in_dialog" mode, which
makes more vertical blocs

OPW 2061859

closes odoo/enterprise#5363

X-port/Cherry-pick of odoo/enterprise@ffb86687a3

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-04 19:37:41 +02:00
Christophe Simonis 7a548569c6 [MERGE] forward port branch 12.0 up to 638eac9bae 2019-09-04 19:32:26 +02:00
Christophe Simonis 638eac9bae [MERGE] forward port branch saas-11.3 up to a4fe211ee2 2019-09-04 18:56:27 +02:00
jev-odoo 2761393b06 [FIX] stock,sale_stock: Speed up sale_order confirmation
In case there is a lot of stock_moves and/or lot of
stock_quants, the function _get_qty_procurement
takes a lot of time because there is no index defined
on most accessed fields.

I.E. OPW-2027183

closes odoo/odoo#36113

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-09-04 12:03:22 +00:00
Goffin Simon dde5227546 [FIX] l10n_ae: Wrong translation
TVA in english is VAT

opw:2065413

closes odoo/odoo#36410

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-04 09:37:59 +00:00
Nans Lefebvre 116dda06a7 [FIX] account: do not sent user as vendor when sending bill by email
On purchase journals, there is the possibility to set up an alias to
automatically create vendor bills from incoming email.
Three types of emails can send the bill:
- the vendor, with email matching a partner in database
- an internal user, possibly forwarding the bill he received from the vendor
- an unknown address
In the third case, the address will be ignored.
In the first, we found the vendor, so he can be set as partner_id of the bill.
The tricky one is the second case, where we try to guess the vendor.

Before, the code would take only the first email found in the body;
if it found a matching partner, then it used that partner anyway,
even if that partner belonged to a user and was skipped before.

After the fix, we get the partners for all emails
and take arbitrarily the first vendor, then backup on the first non-user.

Note also that email_addresses would duplicate every address read in the body;
we make a set to avoid duplicate processing.

opw 1885070

closes odoo/odoo#36399

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-09-04 06:21:22 +00:00
Goffin Simon 450269b268 [FIX] account: Wrong amount due when reconciling with refund
Steps to reproduce the bug:
- Let's consider the following currency rates: 1.00 for USD and 0.50 for EUR
- Create invoice I with the same currency of your company (USD) and amount due = 100$
- Validate I
- Create refund R with  a diffenrent currency of your company (EUR) and amount due = 1€
- Validate R
- Reconcile R with I

Bug:

The amount due of I was 196$ instead of 98$

PS: The root of this issue was coming from function assign_outstanding_credit that was called when
reconciling R with I. This function changes the currency_id and the amount_currency of the account move line.
So the function _amount_residual defined on model account.move.line was triggered as
the currency_id was changed. In _amount_residual, the residual_amount_currency was computed.

opw:2062103

closes odoo/odoo#36379

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-04 07:34:08 +00:00
Aaron Bohy 0b146aa253 [FIX] web: form: race condition when editing in readonly
... and switching to 'edit' mode before the write RPC returns.

For instance, on a project task form view, in readonly, change the
state by clicking on the bullet, and directly switch to 'edit'
mode: when the RPC returns, the view is switched back in readonly.

Task 2065443

closes odoo/odoo#36400

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-04 07:15:18 +00:00
Lucas Perais (lpe) b7e3469931 [FIX] web: grouped list as grouped list as child
In grouped editable list, get rid of the groups
Edit one record in the editable list
In a M2O, click on search more

In search's list, group by a field
Expand a group in the search's list

Before this commit, it crashes because the event was propagated
onto the first main list

After this commit, it doesn't crash and the group is expanded

OPW 2064156

closes odoo/odoo#36383

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-03 14:24:58 +00:00
Aaron Bohy ae50f2cbbb [FIX] web: editable list: edit group with create=0
This rev. disables the 'create' action in the form view reached
when clicking on the 'Edit' button on a group in an grouped list.

closes odoo/odoo#36384

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-03 13:37:47 +00:00
Lucas Perais (lpe) c132a8c364 [FIX] account_cancel: update posted always visible
Before this commit, the allow cancelling entries field
was invisible when the journal was of type general

After this commit, the field is visible for every journal

OPW 2062875

closes odoo/odoo#36358

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-03 11:24:31 +00:00
Alexandre Kühn 923fb7aa05 [FIX] im_livechat: no duplicated messages
Before this commit, when using website livechat with multiple tabs,
it may duplicate messages in the chat window.

This happens due to registering messages twice:

- once, from `/mail/chat_history`
- second, from receiving notification from master tab, via local
storage.

This commit fixes the issue by not registering messages that have
already been registered (i.e. unique ID).

opw-2052960

closes odoo/odoo#36370

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-03 10:55:32 +00:00
Christophe Simonis 4528f75cb0 [MERGE] forward port branch 12.0 up to 82c0e9b620 2019-09-03 12:41:08 +02:00
Goffin Simon 82c0e9b620 [FIX] payment: Publish Sips online payment
Steps to reproduce the bug:

- When trying to publish the sips payment acquirer not in debug mode

Bug:

It raised a access rights error because the fields: sips_test_url, sips_prod_url, sips_version
were not readable in function _check_required_if_provider and  a default value was set for all
these fields.

opw:2061123

closes odoo/odoo#36346

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-03 08:13:49 +00:00
Goffin Simon a9bb669487 [FIX] mrp: Kit in manufacturing
Steps to reproduce the bug:

- Create a MO with a product with a normal bom B
- Save the MO
- Change the type of B to phantom
- Try to produce the MO

Bug:

It was impossible to cancel or confirm the MO.
It's not allowed to produce a MO with phantom bom.

opw:2061958

closes odoo/odoo#36329

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-03 07:38:18 +00:00
Christophe Simonis 149d782a0e [MERGE] forward port branch saas-11.3 up to 79ff916b59 2019-09-02 19:57:25 +02:00
Christophe Simonis 79ff916b59 [MERGE] forward port branch 11.0 up to 61a85ccf8f 2019-09-02 19:37:06 +02:00
Christophe Simonis 61a85ccf8f [FIX] website_blog: avoid using map to please pylint 2019-09-02 18:46:34 +02:00
Christophe Simonis 1e1702d3c0 [MERGE] forward port branch saas-15 up to dc934d67dd 2019-09-02 18:24:59 +02:00