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.
closesodoo/odoo#33724
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
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
closesodoo/odoo#33792
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- 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
closesodoo/odoo#33767
Signed-off-by: Christophe Simonis <chs@odoo.com>
If the company is not set on the SO, the creation of a SO line crashes
because `currency` is empty.
opw-2005143
closesodoo/odoo#33783
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- 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
closesodoo/odoo#33758
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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.
- 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
closesodoo/odoo#33804
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- 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
closesodoo/odoo#33794
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#33753
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
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>
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.
closesodoo/odoo#33746
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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
closesodoo/odoo#33706
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
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
closesodoo/odoo#33708
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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`.
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
closesodoo/odoo#33736
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
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
closesodoo/odoo#33707
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
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
Fixesodoo/odoo#33641Closesodoo/odoo#33722
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
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..."
closesodoo/odoo#33312
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
- 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
closesodoo/odoo#35883
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When a journal entry is duplicated, `reverse_entry_id` should not be
copied for obvious reasons.
opw-2055947
closesodoo/odoo#35847
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#35859
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#35846
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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
closesodoo/odoo#35761
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#35827
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#35836
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#35797
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#33702
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
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.
closesodoo/odoo#33679
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
There was no way to inherit properly action_move_create method.
opw:1974069
closesodoo/odoo#33488
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#33028
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>