Commit Graph
127612 Commits
Author SHA1 Message Date
Nicolas Martinelli 8f21148e1a [FIX] hr_contract: contract type name
Make the contract type name translatable.

opw-2003957

closes odoo/odoo#33781

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 05:41:25 +00:00
Christophe Monniez b27077bb0c [MOV] test_pylint, test_lint: add es-check linter
Because Odoo still supports Android Kitkat and Internet Explorer, ES5 is
the highest ECMAScript allowed version.

This commit adds a new test that parses each javascript file found in
addons. The test fails if unsupported js code is found.  As ES6 is
allowed during tests, the files under a path that contains 'static/test'
are just skipped.

This test uses the es-check tool
(https://www.npmjs.com/package/es-check).

If the es-check tool cannot be found, the test is simply skipped.

Also the test_pylint module is renamed to a more generic name test_lint,
that way, every linter test can find a shelter  here.

closes odoo/odoo#33724

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-05-30 11:22:10 +00:00
Priyanka Kakadiya d85451800f [FIX] web_editor: restoreRange on invalid node
In a web editor, add some text, select the text, add a link and
immediately discard the link modal. Traceback.

The traceback is a execute `setEnd` on `Range`, that error is thrown
because editable DIV doesn't save old range

Odoo wrap code does some text node split in order to attach the link
just on the selected text. If it correctly re-set the underlying
structure, it does not update the $(editable) structure used to restore
ranges.

After this commit, editable div will use newly created range for the element

for ex:
-> content: test
-> selected content "test"

when click on link dialog:
ec: test , eo: 4, sc: test, so: 0
selected content  ->  start 0, end 4 -> "test" like this

after clicking on discard:
ec: null text element, eo: 4, sc: null text element, so: 0
selected content  ->  ec and sc both are null, so it will throw an error
while setting cursor position

after applying fix when click on discard:
ec: test, eo: 4, sc: test, so: 0
selected content -> start 0,  end 4 -> "test"

task - 1955863

closes odoo/odoo#33792

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-03 05:52:13 +00:00
Toufik Ben Jaa 29762514ae [FIX] sale: singleton error when validating payments
- When validating a payment an "expected singleton" exception is
raised due to the fact that we are using a recordset with multiple
record instead of a recordset with a single record.

OPW-1981632

closes odoo/odoo#33767

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-29 16:16:18 +00:00
Nicolas Martinelli d92acc602c [FIX] event_sale: no currency
If the company is not set on the SO, the creation of a SO line crashes
because `currency` is empty.

opw-2005143

closes odoo/odoo#33783

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 06:36:55 +00:00
Nicolas Martinelli 5fccb75fde [FIX] account_analytic_default: default based on user
- Create an Analytic Distribution for:
Product A
Current user (e.g. Mitchell Admin)
- Sell the product in the POS, request an invoice

The analytic account defined is not used.

This is due to the invoice created as SUPERUSER.

We should first take into account the user on the invoice, then the
current user.

opw-2003935

closes odoo/odoo#33758

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-29 12:49:24 +00:00
Cedric Snauwaert 8085f259c8 [FIX] l10n_ca: tag_ids is not used anymore, remove it
closes odoo/odoo#33754

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-05-29 12:46:59 +00:00
Artur Neumann 7c546f10b4 [CLA] Signature in behalf of JankariTech Pvt. Ltd.
closes odoo/odoo#33513

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-29 11:25:41 +00:00
Saugat Pachhai 9308180089 [ADD] website_sale_delivery: Add test for delivery 'free over'
This commit adds a tour for the condition where the delivery charges,
even though that was not added to the total charges, it was shown in the
delivery charges aside (even if the payment was over the amount where free
delivery was available). This adds a test that it should be "0.0" instead.

This was tested before the fix and after the fix.
2019-05-29 11:25:22 +00:00
Nicolas Martinelli 691dc424a1 [FIX] hr_expense, hr_holidays: default activity user
- Activate multi-company
- Create a company B
- Switch to company B
- Create an allocation request

An access error is raised.

Commit 7f775f0677 added a `sudo` call in order to prevent an access
error. However, it implies that the fallback value `self.env.user`
refers to the SUPERUSER, not the current user anymore. If the current
user is not in the same company than the SUPERUSER, the multi-company
record rules will be triggered.

The fallback is changed to an empty recordset, and selecting the current
user is done out of the method called with `sudo`.

opw-2003137

closes odoo/odoo#33804

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 15:06:08 +00:00
Nicolas Martinelli 9e77ce2edc [FIX] mrp: add line on canceled move
- Create a MO for '[FURN_8855] Drawer'
- Consume 1 unit of '[FURN_2100] Drawer Black', but DO NOT consume
anything for '[FURN_5623] Drawer Case Black'.
- Complete the MO, then Unlock it
- Edit the '[FURN_5623] Drawer Case Black' line to add one unit
consumed, save

The new stock move line is created as canceled.

It is created canceled since the corresponding stock move is canceled.

We should not be able to add a stock move line on a canceled stock move.

opw-1986919

closes odoo/odoo#33794

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 10:11:06 +00:00
Jorge Pinna Puissant d488432af6 [FIX] account: warning when sending invoice by email
Before this commit, when sending multiples invoices by email in batch,
if one of these invoices was for a customer without an email address,
these wasn't sent and the user didn't have any feedback about this.

Now, before the user send the emails a warning is shown with the list of
invoices that can't be sent by email.

opw-2002350

closes odoo/odoo#33753

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-05-29 12:34:02 +00:00
Odoo Translation Bot 28382b76d8 [I18N] Update translation terms from Transifex 2019-06-02 01:18:32 +02:00
Nicolas Lempereur 9e6f3abead [FIX] web_editor: image modal nochange close on save
When you open the image modal of the website editor the selected image
is the current image.

But if the image is not an attachment with an `url` field set (eg. it
has been uploaded and is not a file in a /static/ folder) the match
between image modal and current did not work and to close it we need to:

- actively select the current image then click "Save"
- use the X button to close the modal without saving

With this changeset, the match of current image with image list is done
on the attachment `url` and if unavailable with /web/image/ID/name.jpg
path which cover both possibilities.

opw-2004073
closes #33799

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-05-31 13:26:50 +00:00
Christophe Simonis 8a0e819d0b [MERGE] forward port branch 11.0 up to 3e12f2ff56 2019-05-29 11:10:34 +02:00
Gabriela Mogollon 910b98c8c3 [FIX] l10n_mx: add new changes on COA according with the SAT
New account tags were added to use with the incoming of the northern border
zone of Mexico

These changes were announced in the new Annex 24 RFM 2019 [1] and define
the new accounts for the northern border zone. This change affects a
part of the CoA because these accounts are added in the middle instead
of at the end of the group.

[1] https://www.sat.gob.mx/cs/Satellite?blobcol=urldata&blobkey=id&blobtable=MungoBlobs&blobwhere=1461173688346&ssbinary=true

Closes #33631

closes odoo/odoo#33734

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-29 06:10:37 +00:00
Andreas Perhab 8242ddbc10 [FIX] website: provide favicon for pdf tabs
When opening the pdf at the end of an order Chrome tries to load
/favicon.ico which returns 404 before this patch. We provide the
favicon from the current website.

closes odoo/odoo#33746

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-29 10:02:18 +00:00
Nans Lefebvre 3e12f2ff56 [FIX] mail: fix mail template onchange
The stable behaviour of the mail composer is the following:
- if a template adds new attachments, the composer only has this list
- if a template doesn't add attachments, the list is unchanged
- if no template is set, the list is cleared up
In the case of templates, we also check that both static and dynamic attachments
are added to the list.

We clean up after c6d718f211 and subsequently 516f22c398 which failed to take
into account the fact that the attachement list could be a blend of commands
and ids.
Transforming that is taken care of by _convert_to_write, which semantics was
changed by c6d718f211.
To keep the second behaviour, we thus need to add a (5,) command.

opw 2003197

closes odoo/odoo#33706

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-28 18:44:09 +00:00
Christophe Simonis 5adbaf827e [FIX] hr_expense: use defined variables
Oversight of previous forward-port.
2019-05-28 16:24:15 +02:00
Christophe Simonis cffd147cfd [MERGE] forward port branch 11.0 up to a20a31486c 2019-05-28 15:52:00 +02:00
Christophe Simonis a20a31486c [MERGE] forward port branch saas-15 up to cad0be27e7 2019-05-28 15:04:40 +02:00
Christophe Simonis cad0be27e7 [MERGE] forward port branch saas-14 up to 6b6d2c8455 2019-05-28 14:36:59 +02:00
Christophe Simonis 6b6d2c8455 [MERGE] forward port branch 10.0 up to 01020e18e9 2019-05-28 14:07:09 +02:00
Florent de Labarre 897feb553e [IMP] doc: add information about index attribute
closes odoo/odoo#32606

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-27 16:29:50 +00:00
Nathan de Pryck d71f2116d9 [FIX] account_voucher: unnecessary copy of payment memo
Before this commit, the payment memo was copied during the duplication
of a voucher. The issue is that the payment memo is not always shown in
the view, and it's mostly unique by voucher.

Now, the payment memo it's not copied anymore.

opw-1986544

closes odoo/odoo#33708

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-29 12:45:27 +00:00
Christophe Simonis 8d7ee39213 [MERGE] forward port branch saas-11.3 up to 8a0e819d0b 2019-05-29 14:06:12 +02:00
Navarro Presas Moisés Alejandro 7ca0fe3c9f [CLA] Signature for AfroMonkey
closes odoo/odoo#32396

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-05-28 15:58:33 +00:00
Navarro Presas Moisés Alejandro f1d8691985 [FIX] sale_order: Set qty_delivered to 0 if not moves.
In `_compute_qty_delivered` function
Python `all` function returns `True` if list is empty; thast why check
if `moves` is not empty to set `qty_delivered` to `product_uom_qty`.
2019-05-28 15:58:33 +00:00
mreficent fa294d2059 [FIX] mail: correctly detect if model is a mail thread
closes odoo/odoo#31799

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-29 08:03:24 +00:00
Richard Mathot 76131748f9 [FIX] iap: avoid a crash when multiple accounts are found
Before the fix, if you had multiple accounts for a specific service, the
settings page was crashing.
(eg: for a service, you have one account specific to a company and
another account with no company set).

We now prefer accounts specific to the current company and tie-break on
the most recently created one

opw-2003744

closes odoo/odoo#33736

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2019-05-29 06:57:43 +00:00
Richard Mathot edf90bb1da [FIX] iap: allow admins to remove IAP accounts
opw-2003744
2019-05-29 06:49:55 +00:00
Nans Lefebvre c52b9dfc37 [FIX] mail: fix mail template onchange
The stable behaviour of the mail composer is the following:
- if a template adds new attachments, the composer only has this list
- if a template doesn't add attachments, the list is unchanged
- if no template is set, the list is cleared up
In the case of templates, we also check that both static and dynamic attachments
are added to the list.

We clean up after c6d718f211 and subsequently 516f22c398 which failed to take
into account the fact that the attachement list could be a blend of commands
and ids.
Transforming that is taken care of by _convert_to_write, which semantics was
changed by c6d718f211.
To keep the second behaviour, we thus need to add a (5,) command.

opw 2003197

closes odoo/odoo#33707

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-28 18:19:26 +00:00
Martin Trigaux 44d11fe777 [FIX] fields: inherit context_dependent from parent fields
If a field is inherited from another model, the attribute context_dependent
was not propagated correctly.

Example of bug:
>>> product = self.env['product.product'].search([], limit=1)
>>> product.name
'Whiteboard Pen'
>>> product.with_context(lang='fr_FR').name
'Whiteboard Pen'  # cache used
>>> template = product.product_tmpl_id
>>> template.name
'Whiteboard Pen'
>>> template.with_context(lang='fr_FR').name
'Marqueur pour Tableau Blanc'
>>> product._fields['name'].context_dependent
False
>>> template._fields['name'].context_dependent
True

Fixes odoo/odoo#33641
Closes odoo/odoo#33722

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-28 14:26:29 +00:00
Stéphane Bidoul (ACSONE) 060e35f62a [FIX] account: allow cancelling payment whith draft move
Payment journals have an option to keep moves unposted until bank statement
reconciliation.
When cancelling such payments, it is not necessary to attempt canceling the move
if it is unposted.
This patch allows cancelling such payments without needing to configure the
journal as cancellable while the move is still draft.

To reproduce:
1. check "Post at bank reconciliation" on a bank journal
2. do "Register payment" with that journal on a invoice
3. open the generated payment
4. click cancel => error "You cannot modify a posted entry of this journal..."

closes odoo/odoo#33312

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-05-27 14:30:46 +00:00
Odoo Translation Bot 472bfdca56 [I18N] Update translation terms from Transifex 2019-08-21 11:11:21 +02:00
Nicolas Martinelli f925026501 [FIX] base_import: date pattern
- Change the date format of the users language to "%b %d, %Y"
- Export any res.partner as .csv and include at least 'Display Name' in
the fields to Export
- Import the file exported

The import fail with error: "Import preview error failed due to: 'b'".

This was introduced with commit 32c2666d18 where the format of the
user was added in the list of patterns to match. Since we use a limited
version of TimeRE (see Python module `_strptime`), only the patterns
defined in `_P_TO_RE` are supported. If an unsupported format is used, a
`KeyError` is raised.

We simply skip the pattern if it cannot be parsed. Another solution
would be to instanciate TimeRE, but that would also require to set the
locale correctly. Long story short: things will start to get messy for a
nice-to-have feature, a.k.a being able to import dates such as
`January 1, 2019`.

Fixes #35868

opw-2055971
opw-2055140

closes odoo/odoo#35883

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-21 07:44:02 +00:00
Nicolas Martinelli 7f365127d6 [FIX] account: do not copy 'Reverse entry'
When a journal entry is duplicated, `reverse_entry_id` should not be
copied for obvious reasons.

opw-2055947

closes odoo/odoo#35847

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-20 12:26:15 +00:00
Nicolas Martinelli bdf1817d03 [FIX] hr_payroll_account: no company on payroll
When no company is set on the payslip, journal entries of zero are
generated.

This is because `currency` is empty, therefore `currency.round()` rounds
all amounts to zero.

We fall back on the company of the journal, since the latter is
mandatory.

opw-2054781

closes odoo/odoo#35859

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-20 13:25:08 +00:00
Lucas Perais (lpe) 900d89c997 [FIX] account: reconciliation filter when partner found
Have 2 invoices for one partner
Have 1 statement, and line, without partner
Reconcile it

In the filter to search among proposition, type the name of the partner of the invoices
The two invoices should appear

Click on one of them to add it to the reconciliation

Before this commit, the filter was reloaded without the second invoice

After this commit, the filter is reloaded with the second invoice

OPW 2053615

closes odoo/odoo#35846

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-20 11:50:17 +00:00
Andrea Grazioso (agr-odoo) 5e268d8893 [FIX] account: avoid deleting contact on invoice
From Invoicing/Accounting generate an invoice toward a customer
which is a child contact of a company.
Click on "Validate" and print the invoice: the name and contact
information of the customer will be in the report.

Now go into Contacts and delete the customer. If you print again the
report there will be no mention of the customer, and also from the
invoicing tree view there is no customer information.
This is due to the contraint on the deletion that affect only the
parent contact (i.e. a company) which is being billed.

The solution is to put a constraint on the account model to restrict the
deletion of the contact if it is customer of an invoice.

opw-2052717

closes odoo/odoo#35761

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-16 12:50:07 +00:00
Nicolas Martinelli c2bcd15998 [FIX] account, payment, website_sale: QR code based on partner's country
The QR code was limited to a set of countries listed from Wikipedia [1],
but the list is incomplete. Any partner from a SEPA country should have
the QR code printed since we don't know which banks support it.

At the moment we simply remove the limitation, and hopefully a proper
filtering will be done in master.

[1] https://en.wikipedia.org/wiki/EPC_QR_code

opw-2052315

closes odoo/odoo#35827

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-20 08:00:58 +00:00
Andrea Grazioso (agr-odoo) f2c914883e [FIX] base: Page not found on "project forecast" link
In odoo community edition go to Apps, locate Project Forecast and click
on "Learn More". A page not found error is displayed

The link is wrong or missing
Replaced with a working one

opw-2050074

closes odoo/odoo#35836

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-20 09:19:12 +00:00
Nicolas Martinelli e1128c9387 [FIX] base: create partner from email
Call the method `find_or_create` with `email` equals to
`"Raoul Grosbedon <r.g@grosbedon.fr>"`

The partner created has the name `r.g@grosbedon.fr` instead of
`Raoul Grosbedon`.

The method `name_create` is capable of handling such a use case, so we
take advantage of it.

opw-2052997

closes odoo/odoo#35797

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-19 08:49:25 +00:00
Swapnesh Shah d928580d23 [FIX] base_address_city: Add parent_id in view
Fixes https://github.com/odoo/odoo/issues/34405
base_address_city adds domain on existing fields which uses parent_id as field_name while it is not present in 'res_partner_view_form_private'

closes odoo/odoo#34498

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-07-01 18:57:06 +00:00
Nicolas Martinelli e1aee2aac2 [FIX] base: QR code validation
The QR code validation does not require the payment account to be in EUR
(e.g. CHF or GBP).

From [1]:

> Though the transaction must be made in euros, the payment accounts
> held at operating in SEPA do not have to be denominated in euros.

[1] https://www.europeanpaymentscouncil.eu/what-we-do/sepa-instant-credit-transfer

opw-2052315

closes odoo/odoo#35824

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-20 06:36:35 +00:00
Parth Choksi e20c81efcd [FIX] l10n_ch: traceback when installing module
Getting traceback when installing the l10n_ch module.

In the form view of journal, the field "l10n_ch_postal" is added using the xpath.
However the field provided in the expression of xpath('bank_acc_number') doesn't
seem to exist anymore in the form view of account journal.

Hence, it is replaced with the existing field('bank_account_id') in form view
of journal.

task-1999654

closes odoo/odoo#33702

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-05-27 12:45:51 +00:00
Romain Derie e9350993ca [FIX] web: restore /apps/<app> controller
Since JS refactoring of ActionManager at 32b8cec536, the /apps/<app> controller
was not working anymore as the refactoring dropped the support of `sa` as URL
state.

closes odoo/odoo#33679

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-27 11:44:08 +00:00
Benoit Aimont 01020e18e9 [FIX] hr_expense: prepare method for move values
There was no way to inherit properly action_move_create method.

opw:1974069

closes odoo/odoo#33488

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 07:04:27 +00:00
Benoit Aimont c8b87f66f8 [CLA] Add Benoit Aimont in Acsone CCLA 2019-05-27 07:02:58 +00:00
Luis 0379c51be3 [FIX] web: refresh calendar if error
If an error is raised when saving a calendar event, the transaction is
correctly rolled back. However, the view is not refreshed and the
incorrect information is displayed.

We simply reload in all cases.

opw-2002186

closes odoo/odoo#33028

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-24 10:45:48 +00:00