Commit Graph
102882 Commits
Author SHA1 Message Date
Lucas Perais (lpe) ccb8896fe3 [FIX] account: introduce a form view for account.move.line for mobile
On a small display, go to accounting > journal entries > create
In the (now kanban) list of account move lines, click ADD
Then, try to choose an account

Before this commit:
The list of accounts was empty.
This was because the form view spawned was the automatic generic one
The generated view did not have thr necessary structure to get fields' value
from the parent form view.
In this case, the domain of the name_search for account.account was wrong

After this commit:
The flow works on mobile as on desktop. The form view's arch is a 1 to 1
copy of the list view in terms of fields and their definition

OPW 2030837

closes odoo/odoo#34601

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-05 07:31:12 +00:00
jem-odoo f8e41c6b00 [FIX] sale_expense: avoid breaking "Sale: Own Documents Only" rule when reinvoicing
In sale_expense, there is a rules allowing employee to see all confirmed sales
order. This rule breaks the one from sale "see own document" for salesman user.
The initial goal of this rule is explained in Task-29303: we wanted to ease the
reinvocie flow. For an employee, is it diffuclt to know on which analytic account
the expense should be reinvoice (no knowledge of that, no "analytic rights", ...).

Anyway, this rule brings more problem than expected and prevent people to work.
So, we decided to functionnaly revert the feature by desactivate the rule and hide
the sales order field on expense for user that are not salesperson. Salesperson can
set the SO, and the onchange will set the analytic account. Futher work will be
done in master (for 13.0) in order to solve that matter.
To apply the fix, the rule should be desactivated, and the module sale_expense can
be updated.

opw-2027005
Coming from Task-29303

closes odoo/odoo#34514

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-07-02 14:15:45 +00:00
Christophe Simonis 9c742d0c65 [MERGE] forward port branch saas-11.3 up to 6cf09b9a3c 2019-07-04 20:14:47 +02:00
Nicolas Martinelli 6cf09b9a3c [FIX] purchase: correct average cost tests
Correctly forward-port baf1580be4 by
backporting 38eb5346c7.
2019-07-04 19:45:25 +02:00
Christophe Simonis 7b74f4ca9a [MERGE] forward port branch saas-11.3 up to 1debaa89f1 2019-07-04 18:57:17 +02:00
Christophe Simonis 1debaa89f1 [MERGE] forward port branch 11.0 up to 56ce29e71f 2019-07-04 17:35:07 +02:00
Romain Derie 789aa140b9 [FIX] website, website_sale: correctly set company_id on address
During checkout, the user can create a new billing (only for public user as it
will create a 'normal' `res.partner`), a new shipping, edit its billing (that
will edit himself) or edit its shipping address.

All those cases will go through the exact same methods, public user and logged
in user included.

This previously led to multiple issues and multiple fixes to correctly set
`company_id` and `website_id` on the address (res.partner).

See 44372471ef that fixed the `website_id` part.

See 3a0f05f33 that fixed the multi-company behavior, but needed 2ba71140 to not
modify the company of an already created partner, but was still incomplete as
after that fix a logged in user would still have the admin (sudo) company
instead of the website one as supposed.

This commit will fix that bug and add some tests for all mentionned issues.

Related to #28853 as we want to backport the mentionned commit but needed to be
fix first.

closes odoo/odoo#34596

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-04 13:58:23 +00:00
Jorge Pinna Puissant 56ce29e71f [FIX] web_editor: tel url in werkzeug parser
Before 8557bcf the URLs were never rewritten for multilang, which was an
error and could duplicated the number of requests on frontend.

Since 8557bcf the URLs are rewritten. In Odoo the werkzeug library is
used to parse the URLs (this is similar to python parsing URL but works
in python2 and python3 the same), and in this particular instance it
chooses that tel:800800 is website http://tel:800800 and not a telephone
number.

The problem is when the url uses the uri 'tel:' and only numbers as a
phone number, if the user uses the global format for telephone number
(with the +) or using a separator for the numbers (e.g. '-' , '/'), in
these cases there are no problems parsing the url (phone number RFC:
https://tools.ietf.org/html/rfc3966).

This commit changes the uri 'tel:' to 'tel://' this one is correctly
parsed by the werkzeug library.

opw-2029844
closes #34306

closes odoo/odoo#34586

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-04 13:50:50 +00:00
Abridbus 1c57d5edcf [FIX] mail: use server mail on template
Sending an email wasn't taking the outgoing mail server into account.
Adding it in the 'account_invoice_send_views' to use it in the wizard.

opw-2030717

closes odoo/odoo#34593

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-04 13:03:11 +00:00
qdp-odoo 90334b7db0 [FIX] account: aged partner balance with private partners
When hr is installed, with 'private' type, you should be member of
hr/officer group to read them, or you'll face an access right error.

closes odoo/odoo#34587

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-07-04 12:30:44 +00:00
Christophe Simonis 2c81916f5d [MERGE] forward port branch saas-15 up to aaaf32fedd 2019-07-04 11:39:07 +02:00
Christophe Simonis aaaf32fedd [MERGE] forward port branch saas-14 up to c816efe7de 2019-07-04 10:48:04 +02:00
Lucas Perais (lpe) 356b2ae43e [FIX] hr_holidays: report summary has a wizard as model
Before this commit, the report Leave Summary had hr.leave as its model
implicitly meaning that a report could be printed from an hr leave.

Since the report actually is a view which aggregates data, and not a document
representing a leave, it should have its wizard (the only entry point for that report)
as its model

OPW 2029699

closes odoo/odoo#34507

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-04 08:14:58 +00:00
Christophe Simonis 565165a6c8 [MERGE] forward port branch 10.0 up to acbdd526e6 2019-07-03 18:32:16 +02:00
Lucas Perais (lpe) 59c663ae42 [FIX] point_of_sale: correct compute fixed tax negative quantity
Have a product with a fixed amount tax.
Make a "return" of that product in the pos (i.e. negative quantity)

Before this commit:
- The amount of the return was `tax_amount + product_amount` instead of `-1 * positive_total_amount`
- The amount differed from what can be observed in sales

This was because the sign of the quantity was applied twice

After this commit,:
- the amounts of positive and negative amounts are symmetrical
- they match the behavior in sale

The logic is very similar to bb72dea98d

OPW 2026278

closes odoo/odoo#34548

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-03 13:25:01 +00:00
jev-odoo acbdd526e6 [FIX]l10n_fr_fec: better remove new line
Fix/improve commit d870749d79
that was removing line feed (\n).

In this one, we also remove carriage return (\r)
to address all cases.

closes odoo/odoo#34536

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-03 07:40:43 +00:00
Julien Castiaux 67c281c6a8 [FIX] google_account: use HTTPError over UserError
In an attempt to ease the error reporting, some Google Error were raised
as UserError so they are shown on screen and the user can take immediate
action when the error is their side.

As shown by the different commits bellow, the introduced changes had
some bad side effects. Empty request body, empty response body, non-json
response. The resulting code got complicated.

Apart from the Google API itself, some Odoo module (i.e.
google_calendar) excepted HTTPErrors on some endpoints that are now
raised as incompatible UserErrors. There are no straightforward
solutions for those endpoints.

This commit reverts:
- da13c704
- 9c369a44
- 85ab9238

opw-2000950

closes odoo/odoo#34532

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-07-02 14:55:41 +00:00
Julien Castiaux 0e2f3b1445 [FIX] website_form: set filename on studio binary
Using studio, add a file field on a form. Using the web form builder,
append that field on a form. Upload a file, `x_field_filename` is left
empty thus the filename is lost.

opw-2028071

closes odoo/odoo#34491

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-07-01 13:20:51 +00:00
wan 5fef17540c [FIX] account: get credit and debit regarding to company
Detected with OPW 1920765

Reproduce : set multi-companies, install accounting. The due amount for all companies is the sum of the due amount for every single company

Cause : the context for company_id is not set in account.move.line:_query_get

Solution : set it in res.partner:_credit_debit_get in case _query_get is used elsewhere

closes odoo/odoo#30463

closes odoo/odoo#34486

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-01 12:09:01 +00:00
Nans Lefebvre f401d2f3ba [FIX] account: restrict asset difference search to current company
Let contacts be shared in a multi-company setting.
Make a filter on 'Total receivable', e.g. greater than 0.
All contacts that correspond to this clause are show,
even if their Total receivable is nonzero in another company.
It follows that a partner can be shown by the filter with a value 0.

The inconsistency was created by 017184331b, which adapted the compute method
to the multi-company setting, as before the two were summing all companies.

opw 2028660
2019-07-01 12:08:09 +00:00
Nicolas Martinelli baf1580be4 [FIX] purchase_stock: average cost
- Create 2 rates:
2019-05-01: 1.0
2019-06-01: 0.5
- Set-up a product A in AVCO
- Create a PO for A on 2019-05-15
- Receive the product after 2019-06-01

The AML are created with a rate of 0.5, but the product cost is updated
with the rate of 1.0.

This is because the stock move date is used when it is still assigned,
and not done yet. As described in:

https://github.com/odoo/odoo/blob/2f789b6863407e63f90b3a2d4cc3be09815f7002/addons/stock/models/stock_move.py#L36

The date is the scheduled date until the move is done, then it is the
date of the actual move processing.

We change the date to today's date, since it is the value used to update
the move date:

https://github.com/odoo/odoo/blob/2f789b6863407e63f90b3a2d4cc3be09815f7002/addons/stock/models/stock_move.py#L1143

opw-2006368

closes odoo/odoo#34446

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-01 08:53:53 +00:00
Odoo Translation Bot 214bbfeb84 [I18N] Update translation terms from Transifex 2019-07-01 02:42:17 +02:00
Odoo Translation Bot eedcaca503 [I18N] Update translation terms from Transifex 2019-06-30 03:07:11 +02:00
Kishan Gajjar 5d4e75ae58 [FIX] web_editor: restore broken VideoDialog options
- To enable loop on a video, only setting the 'loop' URL parameter
to 1 will not work anymore. We also need to set the playlist parameter
to the video ID.

- Sound is no longer allowed in autoplay because of new autoplay
policies of most browsers. To make autoplay work, the video must be
explicitely muted.

closes odoo/odoo#34323

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-28 15:38:31 +00:00
Nicolas Seinlet 2d03ed43a5 [FIX] website: not setting domain is not empty domain
Previous versions of this action were setting a domain. Removing the
domain field, instead of setting it to empty value, have not the same
result for upgraded databases.

closes odoo/odoo#34454

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-28 14:48:33 +00:00
Nans Lefebvre d5688e6ca0 [FIX] account: set bank account when creating invoices programmatically
The bank account field is set up by the default_get of invoice.
Similarly to the application of the onchange in the create,
we add it in the create if it is not already part of the given values.

This will set the bank account for invoices created e.g. from subscriptions.

Note that we extract it in a function to avoid duplicating the logic.

opw 2030562

closes odoo/odoo#34558

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-03 13:33:22 +00:00
Lucas Perais (lpe) 6020f4baf2 [FIX] base_import: support import url images with manual fields
Create a Binary field through the interface.
Try to import records through CSV like file, with a url as the value of that new image field

Before this commit, the url was saved in DB, leading to an error when trying to get
the image at read time (/web/image)
This is due to the fact that before 66f0e26f6f (saas-12.2) , Binary fields
were not attachments by default, thus did not enter the condition that db403e6dd7
introduced

After this commit, the special case of manual fields with url at import is correctly handled

OPW 2024822

closes odoo/odoo#34489

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-01 13:09:38 +00:00
Christophe Simonis 2f2bc67c06 [MERGE] forward port branch 11.0 up to b1d43cc80e 2019-06-27 14:40:32 +02:00
Christophe Simonis b1d43cc80e [MERGE] forward port branch saas-15 up to d090c92782 2019-06-27 14:25:31 +02:00
Nicolas Martinelli 90c2e0c75e [FIX] pos_discount: change customer
- Enable general discounts for POS
- Create a POS session
- Add a product
- Create a general discount of 10%
- Change the customer

The discount is reset to the product price.

When changing the customer, the prices are reset:

https://github.com/odoo/odoo/blob/3b1699e02d4483913159681bf7e10839e6493244/addons/point_of_sale/static/src/js/screens.js#L1251

In the case of a global discount, the price is therefore reset to the
product price in:

https://github.com/odoo/odoo/blob/3b1699e02d4483913159681bf7e10839e6493244/addons/point_of_sale/static/src/js/models.js#L2304

To avoid this, we set the price as manually set. Conceptually, this is
indeed the case since we manually chose the percentage, therefore the
price.

opw-2009761

closes odoo/odoo#34418

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-27 11:55:01 +00:00
Christophe Simonis d090c92782 [MERGE] forward port branch saas-14 up to 1985a49b92 2019-06-27 12:41:55 +02:00
Christophe Simonis 1985a49b92 [MERGE] forward port branch 10.0 up to 5eb15c01b5 2019-06-27 12:41:15 +02:00
Priyanka Kakadiya 5eb15c01b5 [FIX] base, web: missing extension on binary downloads
It's currently possible for binary downloads to be missing an
extension entirely. Generate an extension from the mimetype and use
that. Also ensure the existing extension (if any) matches the
mimetype.

Warning: this may require adding new mimetype/extensions pairs to the
local mimetype database similar to
f413d155df.

Also fix missing or incorrect filenames on records without a filename
field: in some Odoo versions the client would send a filename of
"null", resulting in a download of e.g. "null.pdf" instead of the
attachment or inferred name.

Task 2025716

closes odoo/odoo#34299

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-27 08:26:49 +00:00
Christophe Simonis b5beeb0901 [MERGE] forward port branch 11.0 up to 7742887e96 2019-06-26 13:52:44 +02:00
Nicolas Martinelli d870749d79 [FIX] l10n_fr_fec: remove new line
- Make a SO with a product that have a carriage return in its
description
- Export FEC report

The CSV contains new lines and is not correctly formatted.

opw-2026861

closes odoo/odoo#34385

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-26 11:45:57 +00:00
Nicolas Martinelli da986aa479 [FIX] l10n_fr_fec: backport fixes
Backport of:

a3519638a3
fe9e7d47b8

opw-2026861
2019-06-26 11:41:41 +00:00
Christophe Simonis d65953124c [MERGE] forward port branch saas-14 up to 61a51a8651 2019-06-26 11:15:32 +02:00
Christophe Simonis 61a51a8651 [MERGE] forward port branch 10.0 up to ea4ddff117 2019-06-26 11:12:36 +02:00
Bohdan Lisnenko 7742887e96 [FIX] http_routing: slugify_lib - max_length param should be int
closes odoo/odoo#33858

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>

closes odoo/odoo#34363

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-25 12:15:37 +00:00
Goffin Simon 3d27337f6d [FIX] account: correct communication when registering payment for multiple invoices
When registering a payment against multiple vendor bills and change the memo,
the memo must be populated to all the payments. This behavior has been introduced
with the following commit in stable 11.0: c04065abd8

opw:2024652

closes odoo/odoo#34322

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-24 11:29:08 +00:00
Jorge Pinna Puissant 49b949759f [FIX] crm: change team with the default one
Backport from 12.0 to 11.0 (commit: 3cbdfe8807)

- Have two crm teams with the same team leader, and without team members
(team1, team2 as instance).
- Create a new lead, add as Salesperson the team leader, and as Sales
team the second previously created team (team2).
- Save the new lead.

Before this commit, when we save the lead, the sales team will change,
to set the default sales team for the chosen Salesperson, in this case
team1.

opw-2005924

closes odoo/odoo#33898

closes odoo/odoo#34327

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-24 11:22:23 +00:00
Odoo Translation Bot 149783fb19 [I18N] Update translation terms from Transifex 2019-06-23 03:06:47 +02:00
Carlos Lopez eedb1bd8d2 FIX: take date on user time zone for payments of backend
closes odoo/odoo#34307

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-22 03:54:41 +00:00
Romain Derie 805955b4d9 [FIX] website_crm_partner_assign: fix sitemap partner no country
Same fix as dee3b87ae4
Avoid sitemap to crash if a `res.partner` has no country.

Fixes #32636

closes odoo/odoo#34494

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-01 14:18:55 +00:00
Pragya Ladda bd49d9c0cf [IMP] website: cannot deactivate language used by website
closes odoo/odoo#31520

---

backport of 8e2f9a4fe2
Initially a improvement, it is now backported in 12.0 to fix #34430

closes odoo/odoo#34474

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-07-01 08:59:28 +00:00
Romain Derie 9d5131a696 [FIX] website_sale: add tests
Parent commit moved needed functions into misc so this test could use those.
This test is for parent's parent commit which fix checkout billing address
edition.

Part of #34396
2019-07-01 10:05:30 +00:00
Romain Derie 6ebcb1db80 [IMP] tool, website, website_sale: move test utils functions
We have multiple ways of simulating a frontend context while running python
tests (mainly during TransactionCase):
  - `MockObject` class from 8557bcfa30
  - `simulate_frontend_context` method from a5a5a57e48
  - `DotDict` from f8efc9a957

This commit moves `MockObject` to misc to be reusable and adapt it to be
accessible by dot notation with `DotDict`.

Part of #34396
2019-06-26 17:08:09 +00:00
Romain Derie bb81e4ccd7 [FIX] website_sale: avoid adding website on customer when not needed
Before this commit, when an address would be edited or created from checkout,
we would always add a website_id on it.
(values_postprocess -> _checkout_form_save)

That would be incorrect if the website has not 'specific user account' enabled.

It would lead to an error as the user would not be able to connect to another
website. Indeed, the billing address is stored on the partner directly. Since
the res.user website_id is a related to the partner one, the user would then be
restricted to that website.

Closes #34396
Fixes #34308
2019-06-26 17:07:29 +00:00
Jorge Pinna Puissant 47bbb504a8 [FIX] account_voucher: round globally
1. Set "Round Globally" on Invoicing settings;
2. Create a new vendors receipts and validate it;
There are an error messages that said : "Cannot create unbalanced
journal entry."

Fine turning of : 3e147220fd

opw-2026534
closes #32667

closes odoo/odoo#34415

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-06-27 11:35:03 +00:00
Jorge Pinna Puissant 7f57d3c5f2 [FIX] mail: allow more complex email layout
Add record to the email values to allow the use of more complex
email layout as : "mail.mail_notification_paynow"

opw-2025099

closes odoo/odoo#34375

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-27 08:15:51 +00:00