Commit Graph
124518 Commits
Author SHA1 Message Date
Goffin Simon d18336bcd7 [FIX] product_margin: Product margin
Steps to reproduce the bug:
- Install accounting.
- Go to Accounting Settings and activate multi-currencies and margin analysis.
- Company currency in EUR
- Currency rate for EUR is 1.0 and 1.5 for USD
- Create two invoices, one in USD and the other in EUR. Both for 30 and for product P.
- Confirm and register payment to make them fully payed.
- Go to Accounting > Reporting > Product Margins > Open Margins.

Bug:

The average sale unit price for P was 60 instead of 25

opw:2035968

closes odoo/odoo#34998

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-22 11:13:59 +00:00
Nimesh Jethva a9819b0f20 [FIX] point_of_sale: Customer display choose image
You are not able to choose an image for the customer display because of
the bold tag, so we removed it and applied a css class instead.

closes odoo/odoo#34854

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-22 09:49:12 +00:00
Nimesh Jethva de61fc0c99 [FIX] point_of_sale: Customer display snippets issue
We were not able to choose the colors of customer display anymore.
2019-07-22 09:44:12 +00:00
Mohammed Shekha 0ac4055504 [IMP] web: do not set focus on form when lastActivatedFieldIndex is not set
When opening a dialog using mouse and closing it, form_dialog_discarded is
triggered, which tries to set focus on form while lastActivatedFieldIndex
is -1, as dialog is opened using mouse directly

do not set focus back to form widget if lastActivatedFieldIndex is -1

task-2031706

closes odoo/odoo#34684

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-22 10:23:29 +00:00
Martin Trigaux 324d3fc93a [MERGE] Forward port of saas-11.3 to 12.0 up to 06f8f04699
closes odoo/odoo#35064

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-22 11:43:54 +00:00
Martin Trigaux 06f8f04699 [MERGE] Forward port of 11.0 to saas-11.3 up to eb4700f17f
closes odoo/odoo#35054

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-22 09:47:11 +00:00
Goffin Simon f58fa65c2b [FIX] hr_expense: Encoding negative amount in expense
Before this commit: 15fa0c23d9
It was possible to encode negative amount for an hr.expense.

Before the fix, it raised a Error saying:

"Cannot create unbalanced journal entry."

opw:2036620

closes odoo/odoo#34953

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-22 07:38:53 +00:00
Martin Trigaux eb4700f17f [MERGE] Forward port of saas-14 to 11.0 up to 160b7c87bb
closes odoo/odoo#35044

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-22 07:17:43 +00:00
Martin Trigaux 160b7c87bb [MERGE] Forward port of 10.0 to saas-14 up to f7b6d3b0b8 2019-07-22 08:32:52 +02:00
Odoo Translation Bot 1e66c38238 [I18N] Update translation terms from Transifex 2019-07-21 03:09:04 +02:00
RomainLibert 5e699c65dc [FIX] payment: Do not show stat button if no token
If there is no token to be shown, don't show the stat button as this
might confuse the end user

closes odoo/odoo#32548

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-07-19 12:44:14 +00:00
Nans Lefebvre d727adcd70 [FIX] sale, website_sale: push record rule lower in module dependencies
Some modules expect the users having the sales_team.group_sale_salesman group
to be able to read payment tokens (credit cards).
Payment tokens are defined in payment.
Both are a dependence of sale, which is thus the lowest common denominator.

opw 1965213
2019-07-19 12:44:14 +00:00
Lucas Perais (lpe) 51a9f30e19 [FIX] account_asset: entries should have the commercial partner if exist
Have a partner, who is an individual, but also a child of a company
Make a deferred revenue as that partner as customer
Validate, and make some entries

Before this commit, the literal partner (the individual) was the one set
on the account.move.line

after this commit, and following what is done for invoices entries,
the commercial partner is set on the account.move.line

OPW 2038774

closes odoo/odoo#34969

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-07-18 08:34:13 +00:00
Martin Trigaux 98a92dc1aa [FXI] delivery,payment: translate boolean button terms
The terminology of the boolean_button is translated with

_t(opt_terms.string_true)

which can work only if the variable content is already present in the
translation map.
This commit adds js files that do nothing but add the terms in the
translation map. This way it will be exported by babel js export and
the translation will be loaded by the web client

Closes odoo/odoo#34774

closes odoo/odoo#34954

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-18 08:58:20 +00:00
Goffin Simon f4563d0710 [FIX] stock: Cancel transfer with scrap
Step to reproduce:
- Create a transfer T with quantity for the initial demand
- Scrap all the products

Bug:

At this point, it was impossible to validate or cancel the transfer.

opw:2032714

closes odoo/odoo#34950

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-17 15:02:59 +00:00
Odoo Translation Bot 72339a5301 [I18N] Update translation terms from Transifex 2019-07-21 01:18:28 +02:00
Julien Castiaux 8a6e2caa04 [FIX] project: dup with subtask in another project
Enable the subtasks in the settings. Create two project "A" and "B",
create two tasks "A.a" and "B.b". Set the parent task of "B.b" to "A.a".

╭─ Project A ─╮         ╭─ Project B ─╮
│             │┏━parent━┿━━━▶ B.b     │
│     A.a ━━━━┿┛        ╰─────────────╯
╰─────────────╯

In normal situation, each task and subtasks are in the same subproject,
in such case, the parent task has been duplicated and it is important to
relink duplicated subtasks to the new parent task. In the case the
parent task is not within the current project, the subtask cannot be
relinked to a duplicated parent as it does not exist.

We could either let the link as is or remove it, we decided to remove
the link.

opw-2037623

closes odoo/odoo#35023

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-07-19 19:44:09 +00:00
Nans Lefebvre 5621ae3d6b [FIX] account: bulk send invoice in each partner language
Select invoices with partners with different languages.
Execute the 'Send' action, and choose send_mail.
The mails are all sent in the same language.

The composer extracts the template's body to put it as self.body
(note that everything also applies to the subject field).
This is done with one language.
Down the line, mail_compose_message renders the values with the object,
using self.body (which can be manually edited).
Therefore the lang parameter is ignored at this point.

This should ideally be fixed at the mail level, which is riskier in stable,
so it may be fixed either later or in master.
So this fix only intends to fix the consequences for this specific use-case,
in a much safer way, but it could be removed once the true fix is one.

opw 2035525

closes odoo/odoo#34975

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-19 12:46:39 +00:00
Jairo Llopis e6225eeb12 [FIX] portal: Make .text-muted inside colored sections work
This was working fine previously in v11.

Now in v12 it stopped working because Bootstrap 4 adds `!important` to `.text-muted`.

Adding `!important` makes these styles useful again.

closes odoo/odoo#35011

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-07-19 11:18:28 +00:00
Aaron Bohy f13a6e5b6a [FIX] account: do not propagate context to new action
Let's assume the following scenario:
- open a pos session, sell a product, leave the session and close
it
- on the session form view, validate it and open the
account.bank.statement
- in the dialog, click on the "Journal Entries" stat button
A traceback is raised, because context keys specific to the current
action (e.g. *_view_ref) are propagated to new action.

The python method should only put new keys in the context, and the
JS framework combines them with the current context, from which
action specific keys are filtered out.

Closes #34893
Issue 2034970

closes odoo/odoo#34970

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-19 11:48:30 +00:00
jev-odoo 20eca78cb9 [FIX]delivery_ups: section in SO
When there is a sale_order_line that has either no product_id nor
product_uom nor product_uom_qty (typically a section line),
the computing of the product_qty used in delivery return 0 for each
line below that sale_order_line.

OPW-2034915

Steps:
Create a SO
Add some lines
One should be a section (not the last line)
Save

Check product_qty on each line. The lines after the section will
have a product_qty = O

closes odoo/odoo#35010

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-19 11:14:14 +00:00
Jorge Pinna Puissant c492cecfc0 [FIX] stock: open quants in product
Before this commit, there was a different when opening the quants (the
'On Hand' button)  from the product or from the product template. Only
from the product template, the functions _merge_quants and
_unlink_zero_quants were called. This means that when opening from the
product, the quants were not merged, and the empty quants were not
removed.

Now, from the product or from the product template when opening the
quants both functions are called.

Fine-tuning of cdd5b78c63

opw-2035001

closes odoo/odoo#34987

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-07-19 06:57:23 +00:00
Simon Lejeune 7f54a246b7 [ADD] stock_account: test avco and inventory loss with company
opw-2027859

closes odoo/odoo#34912

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-16 11:52:30 +00:00
Jorge Pinna Puissant 07b8eff60f [FIX] mrp: recursive bom with different quantities
Backport from 12 to saas-11.3 (original commit : 97b44806f5)

Having 4 products and 3 BoMs:
BoM 1:
product = Finished
quantity = 100 units
- Semi-Finished 10 units

BoM 2:
product = Semi-Finished
quantity = 10 units
- Assembly 10 units

BoM 3:
product = Assembly
quantity = 10 units
- Raw Material 10 units (product.product 5$/unit)

Before this commit, the price for 100 units of Finished product was
500$, which is wrong. The price was calculated using 100 units of
Semi-Finished product and not 10 units as it should be.

Now, the price is 50$

opw-1973347

closes odoo/odoo#33115

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>

closes odoo/odoo#34900

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-16 11:51:57 +00:00
Simon Lejeune 0f57f0705a [FIX] stock: qty_available at date company owned
should take into account inventory/production location with companies

used in avco/standard at date

followup of rev 67ea26460f

opw-2027859
2019-07-16 11:48:12 +00:00
Simon Lejeune a2c60263fc [FIX] stock_account: production location with a company
Complete rev 67ea26460f

opw-2027859
2019-07-16 09:27:35 +00:00
Lucas Perais (lpe) b426b2f023 [FIX] account: invoice context from payment smart button is correct
Register a payment on a vendor bill.
From the menu Account > Purchase > Payment, clik to see that payment
click on the smart button to see the invoices
Create a new Bill

Before this commit, the default type and journal of the new bill were actually the ones of a customer invoice

After this commit, those defaults are the ones of a vendor bill

OPW 2038786

closes odoo/odoo#34967

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-18 07:59:46 +00:00
Dhawal Limbuwala 1ae356146c [IMP] doc: add some documentation of the attributes operation
closes odoo/odoo#20818

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-07-18 06:59:42 +00:00
Lucas Perais (lpe) e342f1ae84 [FIX] account_payment: portal payment invoice right partner
Activate option to pay invoice on the portal
Activate an acquirer with the mode: handle payments in Odoo

Make an invoice for a partner
Access that invoice through the route with the access_token
You should not be logged in !

Try to pay, with stripe for example

Before this commit, there was a cryptic error syaing that the credit card ID was invalid
This was because the transaction token was created on the public user
While we tried to access it as the invoice's partner

After this commit, there is no error as the transaction token is on the invoice's partner

OPW 2034691

closes odoo/odoo#34919

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-16 14:48:50 +00:00
Damien Bouvy f7b6d3b0b8 [FIX] payment_authorize: md5 to sha512 compat
This commit extends the changes introduced by 88de93114 to adapt
Odoo payment flows to the switch in transaction signature done
by Authorize.net.

The initial fix was not sufficient for flows that mixed redirection
payment flows and server-to-server flows (e.g. paying a quote with a
card that gets saved then using the token to pay for a subscription).

The problem comes from the fact that the server-to-server API uses
the API Transaction Key and API Login ID as credentials to authenticate
requests; there is no need for a signature since this data is never
publicly exposed on the website and a MITM is mitigated by the fact
that it would need to be done between the Odoo server and the
Authorize.net servers (both of which use https in a normal deployment)
which is admitedly more complex than doing a MITM on a Starbucks wifi.

On the other hand, the 'redirection' flow will include all transaction
parameters as inputs in an html form, therefore the signature is
required to ensure that the values have not been modified by a website
user or a mitm.

Since both flows can coexist on the same configuration, we cannot use
the same field depending on the payment flow configuration - we need
both fields to be stored for the provider.

This commit therefore has to introduce new fields on payment.acquirer
record that can store the signature key for authorize in addition to the
usual authorize fields. Instead of adding a new module, this commit uses
non-stored computed fields that will generate System Parameters entries
for any acquirer of the 'authorize' kind when set through the interface.

closes odoo/odoo#34670

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-16 05:25:09 +00:00
Lucas Perais (lpe) 565cb99ec0 [FIX] l10n_be_intrastat: weight must be > 0.01
Fine tuning of 06d149a3b1
It appears that according to
https://www.nbb.be/doc/dq/f_pdf_ex/nieuwsbriefintrastat_n28_2018_fr.pdf
minimum weight  is 0.01, and that anything below should be rounded to 0.01

OPW 2031682

closes odoo/odoo#34951

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-17 14:03:40 +00:00
Nicolas Lempereur 1a62c2ed47 [FIX] fleet: recurring cost => required expiration
If "Recurring Cost Amount" is set on a frequency and the date field
"Contract Expiration Date" is not set, the configuration makes no sense
since we would have an infinite cost, and infinite fleet.vehicle.cost
records and so on which is not possible.

With this changeset, the expiration will be required if there is a
recurring cost set.

opw-2036071
closes #34883

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-15 14:49:38 +00:00
Julien Castiaux 30b9a590fc [FIX] website_sale: reuse category on attr change
Enable "eCommerce Categories" in the website shop customize menu, select
a category, sort by catalog price, filter on an attribute, the category
is lost.

When you sort the records, the url changes from `shop/category/x` to
`shop?category=x`. As the attribute form is a plain get action, the
elements from the query string are lost.

We include the category in an hidden input so it is used by the get.

opw-2032477

closes #34603

closes odoo/odoo#34877

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-15 14:08:09 +00:00
Martin Trigaux d8072d54ac [MERGE] Forward port of 11.0 to saas-11.3 up to d5dd136ba0
closes odoo/odoo#34872

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 13:32:07 +00:00
Martin Trigaux d5dd136ba0 [MERGE] Forward port of saas-15 to 11.0 up to 1d9f64c91e
closes odoo/odoo#34868

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 11:56:22 +00:00
Martin Trigaux 1d9f64c91e [MERGE] Forward port of saas-14 to saas-15 up to 5d4c30cb59 2019-07-15 13:15:12 +02:00
Martin Trigaux 5d4c30cb59 [MERGE] Forward port of 10.0 to saas-14 up to bb712ad701 2019-07-15 13:10:00 +02:00
Goffin Simon bb712ad701 [FIX] account: Incorrect due date for credit notes
Steps to reproduce the bug:

- Create an invoice I
- Set the invoice date in the past and  add payment terms
- Validate I
- Create refund from I

Bug:

The invoice date is set as today but the due date was set in the past.

opw:2033438

closes odoo/odoo#34748

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-10 12:14:57 +00:00
Romain Derie 01c34a512c [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.

Fixes #28853

Backport from odoo/odoo#34596

closes odoo/odoo#34689

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-10 10:42:43 +00:00
Romain Derie d24c196397 [FIX] website_sale: don't handle pl promo code if already applied
When a pl promo code is applied, the code is shown in the promo code input.

Before this commit, if the user clicked on "Apply" (so with the same code) it
would remove the pl as it would go in the `if` condition that is supposed to
handle empty code modo to reset pl.

Coming from #34633

closes odoo/odoo#34734

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-10 10:25:20 +00:00
Jorge Pinna Puissant 3360f9313d [FIX] website_payment: consider authorized transactions as done
Forward port of a8dfc7fb73

Before this commit, when a transaction has as status 'authorized', the
transactions' confirm page gives an error : 'Oops! There was a problem
with your payment.'

Now, the page gives the same message as when the transaction has the
status 'done' : 'Your payment was successful! It may take some time to
be validated on our end.'

opw-1984325
2019-07-10 10:03:21 +02:00
Martin Trigaux db5261b19e [MERGE] Forwardport of 11.0 to saas-11.3 up to 198b5ecce2
closes odoo/odoo#34719

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-10 07:14:38 +00:00
Martin Trigaux 198b5ecce2 [MERGE] Forwardport of saas-15 to 11.0 up to 239af6ee99 2019-07-10 08:58:50 +02:00
Martin Trigaux 239af6ee99 [MERGE] Forward port of saas-14 to saas-15 up to e5ec5f5f612 2019-07-10 08:46:12 +02:00
Martin Trigaux ce5ec5f5f6 [MERGE] Forward port from 10.0 to saas-14 up to 0ec0a4a32e 2019-07-10 08:35:05 +02:00
tdi-odoo 2c896f8ed0 [FIX] stock: stock.backorder.confirmation with multiple backorders singleton error
Prevent singleton error when validating stock.picking with option cancel_backorder
in case there are multiple backorders involved by displaying all the backorder's names separated by commas.

opw: 20337021

closes odoo/odoo#34709

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-09 14:43:39 +00:00
Odoo Translation Bot e26d478f49 [I18N] Update translation terms from Transifex 2019-07-14 03:08:16 +02:00
Lucas Perais (lpe) 8aaab680a9 [FIX] account_voucher: handle tax included in round globally
Have a Tax 24%, included
Have account.voucher with a line reading:
`Price: 64.93; Tax: 24% Incl`

Validate the voucher

Before this commit, the account.move.lines created were wrong and unbalanced
as the amounts that should have been affected by the tax included haven't been

After this commit, the move and its lines are correct and balanced

OPW 2031751

closes odoo/odoo#34784

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-11 09:10:46 +00:00
Julien Castiaux 5038f777a0 [FIX] web: prevent db_manager modal close on empty pwd
Go to the database manager, configure a password either via the
interface either via the `admin_passwd` `.odoorc` config file. Click on
the backup menu, let the `password` field empty and submit the form. The
modal is closed without any warning and no query is sent.

The problem is that even if the field is marked as `required`, there is
a event listener that catch the `onsubmit` event and close the modal
even if it is not valid.

opw-2031461

closes odoo/odoo#34669

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-07-09 13:44:41 +00:00
Lucas Perais (lpe) 06d149a3b1 [FIX] l10n_be_intrastat, _2019: support rounding to 2 decimals
Before this commit, values were rounded to the unit, which was part of the former specs
of the Intrastat report

After this commit, we make the intrastat 2019 comply with the new spec, which is to round
value, price and weight to two decimals

See the spec here: https://www.nbb.be/doc/dq/f_pdf_ex/nieuwsbriefintrastat_n28_2018_fr.pdf

OPW 2031682

closes odoo/odoo#34700

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-09 13:08:31 +00:00