Commit Graph
127250 Commits
Author SHA1 Message Date
Christophe Simonis cecb1ec77d [MERGE] forward port branch saas-14 up to 556b59bce1 2019-05-16 18:11:09 +02:00
Christophe Simonis 556b59bce1 [MERGE] forward port branch 10.0 up to 90d86e07dd 2019-05-16 18:10:33 +02:00
Mohammed ShekhaandDhaval Limbuwala 90d86e07dd [FIX] tools: allow using datetime in function call
Traceback generated when trying to pass a datetime object into a function tag
in xml.

<function name="action_name" model="model_name" eval="datetime.date.today"/>

Used to fail.

With this commit now one can pass time, datetime, timedelta, relativedelta,
version, ref, pytz in function tag in xml

Task-id: 1772614
Closes odoo/odoo#29212

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>


Co-authored-by: Dhaval Limbuwala <dli@odoo.com>
2019-05-16 14:42:41 +00:00
Sébastien Theys 3b3f85670f [FIX] website: prevent crash with image gallery snippet
If destroy is called before start, there will be a crash before this commit.

At the time of this commit, this can be reproduced in master by dropping the
image gallery snippet, clicking on add images (double click, which opens the
media dialog twice for some reason), selecting 2 images to add on the
media dialog, and clicking on add. The error will be in the JS console.

closes odoo/odoo#33440

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-16 14:33:40 +00:00
Nans Lefebvre 516f22c398 [FIX] mail: remove previous attachments when changing template
Open a mail.compose.message wizard.
Select a template that generates an attachment.
Reselect it. A second attachment has been generated.
Can be repeated ad infinitum.

At template onchange, the template is rendered to overwrite the composers values
This includes the attachments.
Let L1 be the list of attachments generated by the template.
When _convert_to_write(values) is called with {'attachment_ids': L1},
it gets self.attachments_ids = L2, and generates a [(6, 0, L1 + L2)] command.
As a result attachments are only added,
the previous ones need to be removed manually.

Since c6d718f, the semantics of _convert_to_write changed.
Before, it always returned an empty list for new records (without an id).
In other words, wa always had L2 == [].
As a result we need to adapt the wizard to keep its old behaviour.

To solve it we bypass the _convert_to_write for 'attachment_ids' and directly
generate the 6 command with the list of ids L1 generated by the template.
We only do this for templates that add attachments to keep the templates
composable (a template only overwrites the values it defines).
Unfortunately, we don't have any way to know which attachments have been added
manually, so we can't preserve these (which was the old behaviour anyway).

opw 1997430
opw 1987169
opw 1998115
opw 1998782

closes odoo/odoo#33387

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-16 13:15:03 +00:00
Denis Ledoux 272359b86c [FIX] mail: accurate message notifications marked as sent
When multiple emails (`mail.mail`) are linked
to the same message (`mail.message`),
all the message notifications were being marked as sent
as soon as one of the mail was sent, and not all of them.

This is indeed possible to have multiple emails linked to a single
message, for instance when there are employees and customers in
the followers of a thread, and some must therefore have
the buttons meant for the employees ("Assign me") and some not.

In other words, it was possible notifications were marked
as sent while their associated email was not sent yet.

This revision also comes as an addition to
5d6656d739

as it was possible to receive a bounce coming from
the previous mail sent which wrote on the same notifications `email_status`
than the current message being sent before we could acquire the lock on
them (see commit message of the above mentioned revision),
as it was writing the `email_status` on more notifications that it
should have, including notifications of the previous email.

e.g
- Mail 1
- Message 1
- Recipient A, B, C
- Mail 2
- Message 1
- Recipient D, E

Let's say recipient A bounces

If the email notifying the bounce arrives during the processing of the "Mail 1",
it will be blocked until we release the lock on the `mail.notification` `email_status`
we acquire thanks to having written `exception` on `email_status` before sending the email.
But, as soon as it is unblocked (after the `cr.commit()`),
it will immediately re-attempt the delivery of the bounce email,
therefore writting "bounced" in `email_status` of recipient A,
while the transaction of the second email already began.
When the second email sending will try to write the `email_status`
of recipient A as well
(as it used to write the `email_status` on all the message notifications,
not just the one related to the current email),
it raised a concurrent update.
Therefore:
1. Interrupting the loop, as psycopg2 exceptions are raised and not passed,
2. Replay the sending of the second email a second time.

opw-1984293

closes odoo/odoo#33431

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-05-16 12:57:57 +00:00
Lucas Perais (lpe) 587357432e [FIX] account: payments cannot be grouped on company
Since cdca5d4751, the field company_id
on account.payment is not stored anymore, so, it doesn't make sense to be able to group on it

OPW 1998427

closes odoo/odoo#33428

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-05-16 11:53:18 +00:00
Christophe Simonis 624c30a3b7 [MERGE] forward port branch saas-14 up to 679a73474e 2019-05-16 11:36:32 +02:00
Christophe Simonis 679a73474e [MERGE] forward port branch 10.0 up to 0164c9dfcb 2019-05-16 11:22:53 +02:00
Olivier Dony 9fc5a4a061 [FIX] ir_mail_server, mail: catch SMTPServerDisconnected exceptions
If the smtp session was dead, it would lead the whole mail batch to fail.

opw 1949270

closes odoo/odoo#32424

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>

closes odoo/odoo#33350

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-16 07:02:06 +00:00
Olivier Dony 11f0d7cefa [FIX] mail: do not shadow SMTP errors with QUIT
When an exception is raised during the course of a normal SMTP session,
smtplib's `sendmail()` method will close the channel automatically,
so any further attempt at sending SMTP commands will fail with an
SMTPServerDisconnected error, even just calling `smtp.quit()`.
This will shadow the original error, and make debugging harder.

Fixes #1493
2019-05-16 07:02:06 +00:00
Pierre Rousseau 11cab26fb0 [IMP] crm_iap_lead_website: make it compatible with multi-website
The purpose of this commit is to allow to define lead generations rules based on the website visited.

Task-ID: 1964025

closes odoo/odoo#33391

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2019-05-15 12:39:08 +00:00
MaxLarue e0b33e280e [IMP] sale_timesheet: overview usability and styling
In order to make the overview more understandable, we provide some modifications:

- remove some value when they are zero ("No task found", ...)
- the whole middle column (percentages) is merged inside the hours one
- provide some tooltips
- renaming titles
- ...

To do so and to avoid leaving empty lines or doing complicated template branching, the
above table is split in two different tables, so that we can remove lines independently.

We also added a new category in the overview, concerning timesheets that are related to a cancelled so. This meant tweaking the project_overview plan_prepare_value method, in order to have the new numbers calculated and keep the others consitent.

Task-1968121

closes odoo/odoo#33015

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-05-29 07:29:21 +00:00
Juhil Somaiya 1f3a00fb3e [FIX] calendar: traceback on recurrent meetings when repetition number is 0
If the user tries to save the recurrent event with 0 as the number of
repitations or interval there will be a traceback so instead of traceback
display the warning so user will not be able to save that event.

Task-1930809

closes odoo/odoo#31388

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-29 08:39:13 +00:00
Martin Trigaux 9aac7c9286 [IMP] web: unify the use of GROUPABLE_TYPES
cf discussion on #31789

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-28 15:47:49 +00:00
Martin Trigaux b9f8e234ae [IMP] web: allow to group by integer
No technical reason to forbid it

Fixes odoo/odoo#31684
Closes odoo/odoo#31789
2019-05-28 15:47:36 +00:00
Rafis Bikbov f203a89859 [IMP] base: remove unused variable 'last_update'
closes odoo/odoo#28725

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-28 16:15:01 +00:00
Rafis Bikbov 5c9e5aadf3 [CLA] Add Rafis Bikbov from IT-Projects LLC 2019-05-28 16:14:55 +00:00
Christophe Simonis a7743e0be8 [MERGE] forward port branch saas-14 up to 64ed30e34b 2019-05-14 13:55:35 +02:00
Christophe Simonis 64ed30e34b [MERGE] forward port branch 10.0 up to 2a14eea095 2019-05-14 13:54:56 +02:00
Nils Hamerlinck af8af70fd9 [FIX] payment: transactional routes should not appear in the sitemap
closes odoo/odoo#33360

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-14 11:23:46 +00:00
Jorge Pinna Puissant bc3ee30504 [FIX] sale: discount in pricelist for negative price
Having :
- a pricelist with 10% of discount for all the products.
- the discount policy in the pricelist set to : "Show public price &
discount to the customer"
- a product with negative price (ex : -$125)
- add the product in a SO with the 10% pricelist

Before this commit, the unit price was the price with the discount
already applied: -$112.5, and not the original price as expected; The
subtotal price was $101,25 (the discount is applied twice) which is
wrong.

Now, the unit price is -$112.5 as expected, in Odoo surcharge are always
included in the display price.

opw-1986582

closes odoo/odoo#33717

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-05-28 11:38:55 +00:00
jev-odoo 04b2b93143 [FIX]hr_expense:typo in classname
oe_view_nocontent_smiling_face does not exists in css
when using this classname, the smiling face does not appear

closes odoo/odoo#33519

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-21 09:52:15 +00:00
Martin Trigaux 985953d0f8 [FIX] base: make user form update-proof
When recreating the auto-generated view of user base.user_groups_view (e.g.
with a '-u base'), the view was generated in the language of the admin.
In case the database was in a different language than English, the source arch,
stored in database in arch_db field, was translated.

Instead, the source must be in English and translations must change the content
based on the user's language.

This was introduced at 894143cb4c as the view content was not translated.
At that time, the arch field was not translatable and the xml_translate mode
did not existed yet

Fixes odoo/odoo#33482

closes odoo/odoo#33566

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-22 12:12:44 +00:00
Prakash Prajapati ddabee78e1 [FIX] hr_holidays: overlap constraint
Allow to request a leave that create exactly when another leave start.

Closes #33665

opw-1998762

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 06:45:16 +00:00
Nicolas Martinelli ce39ca8a97 [FIX] crm: rewrite Assignation Date
- Create a lead without Salesperson assigned
- Edit the lead, set a Salesperson => the Assignation Date is set
- Edit the lead, change the Salesperson

The Assignation Date is reset.

There is no reason to change the Assignation Date in the second case.
Indeed, in many cases the Salesperson is modified for a good reason
(e.g. the first person left the company). From a customer perspective,
that doesn't change anything: he was always in contact with a
salesperson and the lead was handled. Moreover, the reporting becomes
incorrect.

We only change the Assignation Date if no Salesperson was assigned.

opw-2001912

closes odoo/odoo#33640

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-24 08:41:24 +00:00
Nicolas Martinelli bfe76859e8 [FIX] sale_stock: change shipping address
- Create a SO for a stockable product
- Validate the SO
- Change the 'Delivery Address'

Nothing warns the user that the address was not changed on the
corresponding pickings.

opw-2002084

closes odoo/odoo#33636

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-24 08:06:40 +00:00
Jared Kipe b0ea06ab91 [FIX] stock_warehouse: _get_all_routes() override
Usecase to reproduce:
- Install stock, mrp, purchase
- Go on warehouse form view
- Click on Routes button
Either one of the route manufacture or buy is missing.

All implementations/overrides of stock.warehouse._get_all_routes()
call their parent's implementation of get_all_routes_for_wh().
which is a reference to stock.warehouse._get_all_routes() but that means
that the route 'mixin' behavior can be skipped.
(the reference is to the base implementation of _get_all_routes())

Fixes #33286
Fixes #33288

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-05-27 15:51:38 +00:00
Johan Demaret Rivarola 2a14eea095 [FIX] website_{crm_partner_assign,customer}: fix 404 when crawling
When website_customer is not installed, some endpoints are not handled
by the router, causing the following tests to fail:

- test_10_crawl_public
- test_20_crawl_demo
- test_30_crawl_admin

Those tests were failing due to /customers responding with 404.

Indeed, the route /customers is defined in website_customer, but had
some usage within website_crm_partner_assign, causing tests to fail when
the former module is not installed.

The new behavior can be explained as follows:

- module website_crm_partner_assign on its own will lose the hyperlink.
- module website_customer will now inherit the view definition in order
to wrap the targeted HTML text elements with an anchor tag.

Closes #33344

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-13 16:34:27 +00:00
Christophe Simonis 825fee2626 [MERGE] forward port branch 11.0 up to d01db48087 2019-05-08 18:29:32 +02:00
Christophe Simonis d01db48087 [MERGE] forward port branch saas-15 up to 82f88478cf 2019-05-08 17:27:30 +02:00
Christophe Simonis 82f88478cf [MERGE] forward port branch saas-14 up to 98b10f98bb 2019-05-08 17:13:30 +02:00
Christophe Simonis 98b10f98bb [MERGE] forward port branch 10.0 up to a48318cb33 2019-05-08 17:09:40 +02:00
wan 7a93f82bc9 [FIX] account: resolve2many in aml default_get
resolve_2many_commands() is bugged and returns different outputs for new
vs existing records. It is to be removed, so it is replaced with a call
to new()

closes odoo/odoo#33222

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-05-08 13:43:04 +00:00
Ravi Gohil d18b5b829a [FIX] l10n_in: fix method parameter
'tax_ids' param was removed in main method by 8f7b6d0d6b, hence removed it from it's overridden method

closes odoo/odoo#33639

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-05-24 05:05:13 +00:00
Olivier Colson 8f7b6d0d6b [FIX] account: fix the use of "tax_ids" field of account.move.line
Before this fix, in 12.3, with taxes affecting subsequent taxes' base, tax_ids was used to store the taxes whose tax lines impacted current tax line's base. Before 12.3, this field was used to store the taxes whose base line has to be impacted by the current tax line.

This old behavior was changed by mistake. We restore it for consistency.

closes odoo/odoo#33471

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-05-17 12:55:11 +00:00
Olivier Colson 3d97dfeb17 [FIX] account: fix default tax repartition lines creation
Before that, creating a tax without any repartition line with a company_id set in create() failed to create the default ones, because they did not receive the company they had to be created for (as 'company_id' was not passed to the default_get).

closes odoo/odoo#33617

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-05-23 12:44:22 +00:00
Goaman 2ed42c3e2e [FIX] account: create a writeoff in reconciliation widget
The method _renderCreate in the ManualLineRenderer was executed before
the call to super finished. Which makes impossible to create a writeoff
in the reconciliation widget.

closes odoo/odoo#33582

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-05-22 14:44:43 +00:00
Hardik Prajapati 97a21aeec1 [IMP] l10n_ae: Added taxes, COA and Fiscal position
- On the invoice pdf, if the invoice is in USD, we
need to specify conversion rate and amounts in AED.
Also, if it is between certain Gulf states, you need
to mention this on the invoice.   'Invoice' also
needs to replaced with 'Tax Invoice'.
- Taxes changed to 0% and 5% / AED symbol on currency
adapted to the real situation of UAE.
- A tax by state automatically adapted with the fiscal
positions in order to have the tax amounts correctly
split by state in the tax report.

opw-1931322
updated to 12.3 taxes (and l10n_ae_reports removed in
enterprise)

closes odoo/odoo#33474

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-05-22 13:39:59 +00:00
Habib Ayob 587bf71cec [ADD] l10n_za: add chart of accounts for South Africa
- generic CoA
- Sars VAT report

Thanks to Paradigm Digital

opw-1893580

closes odoo/odoo#33397

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-05-15 12:25:47 +00:00
Meghna Jaswani 2192270914 [FIX] base : fixed traceback when print and then save document layout in SaleOrder.
In Sales > Order > SaleOrder > Print > Choose Document Layout > Save: when data is saved there is comes a traceback as write method is called directly on Save button.
(sale_management)

Hence write method should not be called and args passed returns an empty list.
- we defined dummy method to be called on save

Similarly, in TimeOff > Reporting > Report by Department > Print > Choose Document Layout > Save and Print : write_company_and_print_report method is called on Save and Print button
(hr_holidays)

-write method which is called inside write_company_and_print_report is removed as empty args list is passed.
reference is taken from- https://github.com/odoo/odoo/commit/1ced3bfca457ac50845637bcd42a8e53bd7f088d

opw:1973947

closes odoo/odoo#33454

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-22 07:30:43 +00:00
qsm-odoo 370acf653f [FIX] web: restore pointer cursor for all buttons
Since the update to Bootstrap 4.3.1 made with commit
https://github.com/odoo/odoo/commit/4697d7448010376397f7150b84c207978ab3010e,
the pointer cursor is not automatically added on elements with the 'btn'
class but only on <button> elements. This is a strange undocumented
decision as the 'btn' class can be used anywhere, especially on <label>
elements for their checkbox and radio button components as documented:
https://getbootstrap.com/docs/4.3/components/buttons/#checkbox-and-radio-buttons

This commit reenables the pointer cursor for all non disabled elements
with the 'btn' class.

closes odoo/odoo#33505

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-20 13:54:07 +00:00
Olivier Colson cb5eea5914 [FIX] l10n_be: apply correct sign on refund repartition for grid 62
closes odoo/odoo#33525

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-05-21 11:06:53 +00:00
Jigar Vaghela a3f923f39e [ADD] l10n_mn: Add Mongolia Accounting
Basic Chart of Accounts and taxes for the Mongolian
accounting.  Tags for a lot of reports in Enterprise.

A lot of different taxes are created to be able
to represent them in the vat report. Mongolians
are used to taxes included even for B2B.

Some fiscal positions are added e.g. to automatically
apply 0% for export.

We got a lot of input from our Mongolian partner
Baskhuu Lodoikhuu and colleagues from BumanIT LLC

opw-1946238
Adapted to taxes in 12.3

closes odoo/odoo#33399

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-05-21 08:53:02 +00:00
Adrien Dieudonne 8cc034d9f1 [FIX] web: date_picker: avoid duplicate function declaration
Due to forward port, _onKeydown was declared twice.

This commit should fix an issue in mobile with Android 4.4 where
it's not allowed to have two functions with the same name.

Original Commit: a3d98dae68

closes odoo/odoo#33495

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-05-20 09:28:58 +00:00
Ravi Gohil 70658d035e [IMP] l10n_it: adapting addition of new taxes to V13 tax configuration
Tax of 5% added

opw-1915454
Closes #33401

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-05-15 13:27:02 +00:00
Olivier Colson 57feafd4d9 [FIX] account, hr_expense, point_of_sale: 'affect subsequent taxes' base" taxes
Consider the following use case:
- Two taxes:
-A: price included, affect base of subsequent taxes, 10%
-B: 15%, regular
- Create an invoice with a line applying A, then B, for 110€. Post it
- The following move lines are generated:
- base: 100€
- tax A: 10€
- tax B: 16.5€

Before this fix, line "tax A" only had the tax tags of tax A. It should also receive the base tags from tax B, in order to affect its grid total correctly in the tax report.

Also, tax_base_amount field used to be computed, but its computation was too simple, and most of the time wrong when doing advanced use of taxes like the one we defined above. It is now not computed anymore, and directly takes its value from the compute_all's result.

closes odoo/odoo#33420

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-05-16 08:55:12 +00:00
Prakash Prajapati 69d708c07c [FIX] web: Alignment for total in List view
The goal of this commit is the alignment of the total in List view.

before this commit, it shows the left side so that it looks weird.

After this commit total show below the related column.

Task: 1981893

closes odoo/odoo#33210

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-05-14 08:43:58 +00:00
Nicolas Martinelli 709e59b4e9 [FIX] account: analytic account and cash basis
- Activate cash basis
- Set a tax
Tax Due: Based on Payment
Include in Analytic Cost: true
- Create an invoice, add the tax and an analytic account on the invoice
line
- Validate and pay

The analytic account is correctly set on the tax line, but it is not set
on any of the cash basis entries.

Partial backport of 079a13a349.

opw-1971751

closes odoo/odoo#33236

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-08 12:41:00 +00:00
Nicolas Martinelli 6ff5498fc0 [FIX] base: barcode fallback
- Set a product barcode to a 8 letters value, e.g. 'AAAAAAAA'
- Print 'Product Barcode (PDF)' (or any other report containing the
barcode)

The barcode doesn't print.

All templates assume that:
- a 13 characters barcode is EAN13
- a 8 characters barcode is EAN8

But this assumption is too restrictive: one could want to generate
barcodes with such length without following the EAN13 or EAN8 structure.

We fall back on Code128 when the barcode generation fails.

Backport of 06cfdbaab8
opw-1981988

closes odoo/odoo#33240

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-08 09:02:45 +00:00