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>
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#34603closesodoo/odoo#34877
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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
closesodoo/odoo#34748
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
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#34596closesodoo/odoo#34689
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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 #34633closesodoo/odoo#34734
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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
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
closesodoo/odoo#34709
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
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
closesodoo/odoo#34784
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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
closesodoo/odoo#34700
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The patch fa492d87f4 has been backported
from Odoo 12.0, that runs on Python 3.
The string '\n\n({} {}, {} {})' to be formatted is a byte-string in
Python 2, while the return value of _() is always a unicode-string.
As format() is (too?) nice, it attempts to convert the unicode-strings
into ascii in order to inject them in the format pattern.
With some languages that are written in ascii, this works -- by chance.
When you use non-ascii languages like Japanese, it fails.
We then fix that issue by using unicode-strings in the formatting
pattern.
#OneCharacterPatch B-)
opw-2032016
-----------------------------
For full technical understanding:
Python 2.7.16 (default, Mar 11 2019, 18:59:25)
[GCC 8.2.1 20181127] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> '{}'.format('test')
'test'
>>> '{}'.format(u'test')
'test'
>>> '{}'.format(u'エ')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\u30a8' in position 0: ordinal not in range(128)
>>> u'{}'.format(u'エ')
u'\u30a8'
closesodoo/odoo#34698
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
Insall website and mass_mailing, go to the `/sitemap.xml` url, the
`/unsubscribe_from_list` url is listed, it should not.
opw-2033251
closesodoo/odoo#34677
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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
closesodoo/odoo#34669
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
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
closesodoo/odoo#34652
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Before this commit, on a device with a "pen" (e.g. Surface Pro, ...),
it was not possible to sign a document on some browsers recently
updated (e.g. Chrome, Firefox, ...) only Internet Explorer was working.
Instead of drawing continuous lines only few dots appeared.
For Chrome and Firefox we have to catch events with "addEventListener".
For Edge we add touch-action property to convert touch events into click.
Steps to reproduce:
1) Go to sales app
2) Then go to quotations (menu Sales)
3) Create a new quotation
4) Click on preview
5) Click on the "Accept" button at the end of the preview
6) Use the "pen" to draw the signature (BUG)
We use a custom version of the jSignature lib (c.f. odoo/odoo@eddcb46),
so we have to patch the file in the Odoo repo with a mix of some
pull request found in the official repo and forks.
Link:
https://github.com/brinley/jSignature/pull/109https://github.com/brinley/jSignature/pull/159https://github.com/willowsystems/jSignature/pull/96
opw-2029684
Backport somewhat improved version of this fix (we don't need to check
for the existing extension since we're not doing anything if there is
an extension at all) merged into later branches, to avoid forward-port
conflicts.
closesodoo/odoo#34509
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Fix/improve commit d870749d79
that was removing line feed (\n).
In this one, we also remove carriage return (\r)
to address all cases.
closesodoo/odoo#34536
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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
closesodoo/odoo#30463closesodoo/odoo#34486
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
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
Steps to reproduce the bug:
- Create two variants V1 and V2 for procuct template V
- Set supplierinfo on V
- For V1, assign "vendor X" with a minimum order quantity= 10 and price = $10
- For V2, assign "vendor X" with a minimum order quantity= 2 and price = $1
- Create a RFQ for vendor X
- Set V1 on a PO line
Bug:
The minimum quantity of V2 was automatically set (10) instead of the minimum quantity
of V1 (2)
opw:2028527
closesodoo/odoo#34523
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
1. Create a purchase tax of 24 %;
2. Set rounding to "Round globally";
3. Create a new purchase receipt with two lines; unit price $115.98 and
unit price $69.98 and add 24 % tax on both lines.
Before this commit, the total was wrong $203.60, which generates also an
error message when trying to validate the receipt.
Now, the total is correct $203.59 (115.98 + 69.98 + tax 44.63).
opw-2031731
closesodoo/odoo#34560
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
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#34306closesodoo/odoo#34586
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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
closesodoo/odoo#34548
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Incorporate Deivis Laya (deivislaya) as Vauxoo's contributor
I confirm I have signed the CLA and read the PR guidelines at
www.odoo.com/submit-pr
closesodoo/odoo#34569
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- 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.
closesodoo/odoo#34323
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When an `IntegrityError` is raised, the user receives a cryptic error
message which doesn't provide much valuable information in order to
solve the problem.
However, such an error is raised in 3 cases:
1. A mandatory field is not provided at creation/update.
2. The deletion of a record makes a mandatory Many2one field NULL on a
referenced table (`ON DELETE SET NULL` on a not nullable field).
3. The deletion of a record raises a `ON DELETE RESTRICT` foreign-key
constaints.
In the first and second cases, we provide the table and field on which
the `NOT NULL` constaint is raised. We also suggest to archive the
record in case of a deletion.
In the third case, we provide the table and the constraint raised. We
also suggest to archive the record.
Notes:
- The IDs of the records causing the issue is not provided since the
information is not provided by PostgreSQL.
- Although cases 2 and 3 have a different root cause, the error
message raised is very similar. Indeed, from an end-user perspective
the solution is identical: archive the record. Another solution would
also be to manually edit the records raising the error, but most of
the time this is not an option: these records are locked and cannot be
edited anymore.
task-1970853
Closes#32949closesodoo/odoo#33922
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Co-authored-by: Sapan Zaveri <sza@odoo.com>
Co-authored-by: Pragya Ladda <pla@odoo.com>