Commit Graph
141138 Commits
Author SHA1 Message Date
Nicolas Lempereur d10d0b2da4 [FIX] web_editor: don't save cropping tool on CTRL+Z
Scenario:

- start cropping of an image
- press TAB key
- do CTRL + Z

=> now the image cropping tool are inside the page and there is no way
to remove them.

Why:

The image crop tool was added inside the editable elemnt, so if we did
an action that changed history the cropping tools are saved in the
snapshot and going back to it will add them without any code handling
their removal.

opw-2394877
opw-2423445

closes odoo/odoo#66499

X-original-commit: ce93cbd78e282e6957aaeba6f06945f94bfffb26
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-18 16:52:29 +00:00
Francois (fge) f22cf20b71 [FIX] base: properly renegerate assets in debug=assets
Recently, the debug=assets mode was changed to use a bundle with
sourcemap instead of serving static files.  Therefore, when someone
modifies a javascript file, refreshing the browser does not load the new
code anymore.

We did not notice that because this is only an issue when the server is
not started in dev mode.  In dev=all (or xml), the assets code does not
use a cache and checks everytime the file checksum number to determine
if a new bundle needs to be done.

It is probably not common for developers to modify source code
without restarting the server and/or using dev=all, but it is a case
that is easy to handle anyway: we just need to make sure that in
debug=assets, the assets code does not use the cache and checks directly
the files checksum.

closes odoo/odoo#66460

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-02-19 09:15:29 +00:00
Martin Trigaux 7124d7012d [FIX] mail: translate report name field
When genrating an attachment in a mail message (e.g. the pdf attached
to a confirmation email), the filename was not translated into the
language of the recipient (unlink the email content).

The variable `template` has the contact language in the context while
`self` contains the language of the user executing the action.

Fixes odoo/odoo#66420

closes odoo/odoo#66498

X-original-commit: 6001e7584c28f8d028c782692caa644015c33e9c
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-18 16:51:12 +00:00
Xavier Morel 1f1da0508d [IMP] base: properly handle API keys on inactive users
closes odoo/odoo#66512

X-original-commit: baebf5814425cce6a9481b4efec5248bbba3ea64
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-02-19 01:00:16 +00:00
Anh Thao Pham (pta) 99101cbd8b [FIX] sale_timesheet: fix (re-)invoiced amount computed as other revenue
- Install sale_timesheet and hr_expense
- Create a Service Product with "Create a task in sales order's project" as Service Tracking (i.e. Service X)
- Create a Product with "Can be Expensed" and "At cost" as "Re-Invoice Expenses" (i.e. Expense X)
- Create a SO with Service X (i.e. Unit Price: 50.0) and confirm it
- Go to Expenses and create an Expense:
  * Product: Expense Y
  * Unit Price: 25.0
  * Customer to Reinvoice: [select the created SO]
- Create Report, Approve and Post journal entries
- From SO, create an Invoice (Service Y + Expense Y) and confirm it
In Project Overview, the expense is computed in Other Revenues and
Re-invoiced costs. Therefore, the amount of the expense is added twice
in the Profitability total.
In Project > Reporting > Project Costs and Revenues, for Project linked
to SO, Untaxed Amount Invoiced and Untaxed Amount Re-Invoiced are also
computed in Other Revenues.

opw-2444237

closes odoo/odoo#66490

X-original-commit: 4d9305d122f79792db780bbd97ae6732bf06ff9f
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-02-18 16:05:34 +00:00
Romeo Fragomeli d85f5ddeac [FIX] web: client report action mounted called twice
Before this commit, the 'mounted' method of the ControlPanel in
the client report action  was called twice.

It happened because the client report action updated the ControlPanel
before being actually mounted, so mounted was called once when the
traceability report was mounted, and once when the update was applied.

Ideally, this should not be an issue (this isn't an issue with owl).
However, in Odoo, we mix layers of Owl Components and legacy
widgets. In these situations, the above scenario isn't properly
handled (and can't be).

As a consequence, in mobile (enterprise), it crashed because an
handler bound in mounted (thus twice) was only unbound once.

This commit avoids the issue as the update was actually useless.

Steps to reproduces (Mobile):
* Go to Inventory (Stock)
* Open the "burger menu"
* Select "Products" -> "Products"
* Select one product in the list
* Click on the "Forecasted" ("stat button")
* Select one "SO line" (sale order) to go to the form view
* Go back to the previous view using breadcrumb
* Optional: Go to another app if the screen can't scroll (e.g. go to Sales)
* Scroll the view => Bug

closes odoo/odoo#66497

X-original-commit: d3854dbf7a6e0c0f9ac00c11716908bc175808d7
Related: odoo/enterprise#16507
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-02-18 16:46:57 +00:00
Romeo Fragomeli 9de025b410 [FIX] stock: traceability report mounted called twice
Before this commit, the 'mounted' method of the ControlPanel in
the traceability report was called twice.

It happened because the traceability report updated the ControlPanel
before being actually mounted, so mounted was called once when the
traceability report was mounted, and once when the update was applied.

Ideally, this should not be an issue (this isn't an issue with owl).
However, in Odoo, we mix layers of Owl Components and legacy
widgets. In these situations, the above scenario isn't properly
handled (and can't be).

As a consequence, in mobile (enterprise), it crashed because an
handler bound in mounted (thus twice) was only unbound once.

This commit avoids the issue as the update was actually useless.

Steps to reproduces (Mobile):
* Go to Manufacturing (MRP)
* Open the "burger menu"
* Select "Products" -> "Lots/Serial Numbers"
* Select one product in the list (unfold group first)
* Click on the "Traceability" ("stat button")
* Select one line to go to the form view
* Go back to the previous view using breadcrumb
* Optional: Go to another app if the screen can't scroll (e.g. go to Sales)
* Scroll the view => Bug

X-original-commit: bbcd8ce097e62bd1d9ba3a61608324a80a111c24
2021-02-18 16:46:55 +00:00
Christophe Monniez 9fce3f83cb [IMP] tests: add data_dir support in test_module_operations
In some situations, like during tests on runbot, the data-dir location
may vary.

With this commit, the `data-dir` CLI argument is added to the
test_module_operations script.

closes odoo/odoo#66492

X-original-commit: 781c91784a0a997967a0152dca2c59a0cb2bab74
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2021-02-18 16:09:03 +00:00
Nasreddin (bon) 3f1a31c498 [FIX] website_sale, *: display error message in "Extra Info" step
*: google_recaptcha, website_form

Issue

        - Install 'Ecommerce' module
        - In settings, fill the "reCAPTCHA: Easy on Humans, Hard
          on Bots" option with random wrong site key and secret key
        - Open your ecommerce (go to /shop )
        - Add any product to cart and and open cart
        - Activate "Customize -> Extra Step Option"
        - Process to "Extra Info" step
        - Click on next

        Stuck at this step since next button does not react.

Cause

        There is an error due to re-captcha feature that
        does not allowed to go to next step.

        The second issue is that the error is not displayed
        because missing message area in form.

Solution

        Do not check recaptcha if 's_website_form_no_recaptcha' class
        present in form.
        Add span 's_website_form_result' to display error messages.
        Replace 'public' by 'site' in error message to fit google
        'field' name.

opw-2456098

closes odoo/odoo#66493

X-original-commit: eb9373522628fa01c3503fa802ded23adc1cbe1f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-02-18 16:09:24 +00:00
Nasreddin (bon) 8d3950d8d7 [FIX] sale: Display color tootlip in product configurator
Issue

	- Install "Sales" module
	- Go to settings and activate "Product Configurator" feature
	- Create a product X with mutilple color (variants)
	- Create a quotation
	- Add product X (Product Configurator should open)
	- Hover any color

	Popup with color name does not appear.

Cause

	'title' attribute value is removed.

Solution

	if element have 'value_name' data attribute, set it back as title else set no title.

opw-2438704

closes odoo/odoo#66479

X-original-commit: fc7ef284915641472722a7be06a75b1df3b8ca93
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-02-18 15:00:13 +00:00
Nasreddin (bon) f234b4fba4 [FIX] account_facturx: Parse pdf attachment
Solution is different in the case of the foward-port, see bellow.

Issue

	- Init an instances of Odoo v13.0 'A' and v14.0 'B'.
	- Install "Accounting" app on instance A & B.
	- Set your email server on instance A & B.
	- Activate 'External email server' in settings of instance A.
	- Set an email alias for "Vendor Bills" on instance A.
	- Send a "Customer Invoice" from instance B to alias of instance A.
	- Fetch for new mail (in case new vendor bill don't appear) on instance A.
	- Open the new Vendor bill on instance A.

	Data are not parsed from pdf attachment.

Cause

	No managing all attachements types:
	- list(tuple(str,str), tuple(str,str, dict) or int) attachments : list of attachment tuples in the form
          ``(name,content)`` or ``(name,content, info)``, where content is NOT base64 encoded
	- list id attachment_ids: list of existing attachement to link to this message
          - Should only be setted by chatter
          - Attachement object attached to mail.compose.message(0) will be attached
            to the related document.

Solution

	In this fw-port, we override `_message_post_after_hook` instead of
	`_message_post_process_attachments` because the later is also called
	from portal and with sudo rights. We don't want to update invoices with
	files coming from portal, since it could cause a security issue.
	Also, because of the way attachments are parsed for invoice, this could
	cause the OCR not to work any longer because at the time
	`_message_post_process_attachments` is called,`move.message_main_attachment_id`
	is not set yet, and OCR relies on it.
	The solution is rather to override `_message_post_after_hook` because
	it ensures that all the attachments have been properly treated and are
	present in `new_message.attachment_ids`, and `message_main_attachment_id`
	is properly set.

opw-2411002

closes odoo/odoo#66458

X-original-commit: 0f6ad2a690f76d6bbbe92106fc8360f99eaac6c2
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-02-18 12:48:34 +00:00
Goffin Simon d4b6ee53f9 [FIX] account: Printing journal entries"
This commit ba32244c10396ff8605e5533e08675a64fbf9d88 introduced an error when
validating pickings or reconciling

closes odoo/odoo#66366

X-original-commit: b20e689659a3e1c89279caf028592bf18a17c4f7
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-02-17 13:25:03 +00:00
Adrien Dieudonne b92ec789e2 [FIX] web: m2o extra button misaligned on mobile
Before this fix, the extra button was out of the right edge of the
screen.

On desktop, m2o external buttons have to overflow over the right padding
of the parent element. This is done to avoid to reduce the size of the
input when the button appears (when a value is set).

But on mobile, there is not enough padding and we therefore prefer to
reduce the size of the field if an extra button should appear.

To fix this, we simply ignore these rules on mobile.
Note that the css selector that really cause this issue was the one
related to '.o_row' and the second one has no effect.

Steps to reproduce:
- Go to "Inventory / Operations / Scrap"
- Click on "Create"
- Choose a product and set UOM field

Related task-ID: 1929043

closes odoo/odoo#66463

X-original-commit: 2fc36e91d95b81f79d0a23f3958011c55a7ff105
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-02-18 13:07:23 +00:00
Nicolas Lempereur 03f8dffebd [FIX] web_editor: shift+enter in editor add direct newline
Enter keypress browser event were removed in 3c372d1da8.

It was reintroduced in text fields with d2f024d254 and in source mode
of html field with b10ca1f6094b.

When doing ENTER in the editor, we do our special case of ENTER (eg. it
will split the container in two and have other custom behavior) but when
doing SHIFT+ENTER we let the browser handle it and add a normal newline.

With the "Enter" prevention, SHIFT+ENTER did not work.

opw-2463746

closes odoo/odoo#66455

X-original-commit: 27b84138b422f0dbb3e01c83bb817d0880e3eab3
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-18 12:34:23 +00:00
std-odoo 83e22fd063 [IMP] portal: improve the "grant access wizard" usability
Purpose
=======
Improve the "grant access wizard" usability, allow to re-invite the
partners and grant / access per partner and not in batch.

Specifications
==============
Add 3 buttons to grant / revoke the access and to re-invite the partner.
When the partner has an internal user linked, do not allow to manage
him in the view (disable the button) because we do not want to remove
the "internal user group" in the wizard, but only the "portal user
group".

When we revoke the access to a partner, if the corresponding user
belong only to the portal group, we archive it instead of deleting it.
So if we re-grant the portal access, he will have the same user as
before and keep his preference, etc.

Task 2381921

closes odoo/odoo#63024

Related: odoo/upgrade#2011
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-18 08:37:04 +00:00
svs-odoo 84f89d6ff8 [FIX] stock_account: currency in forecast report
Adds a test related to the fix 67d975be75963678d25ae54289b2f1de639c8bed

closes odoo/odoo#66430

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-18 11:04:47 +00:00
Nicolas Lempereur 1d2c6237d9 [FIX] stock: variant price on report Product Label (ZPL)
With this change, we show the variant price when printing ZPL
product.product report and not the template as we did before.

This way it is the same as what we see in Odoo as well as when printing
PDF label of the product.

targetting only 14.0 for now (but could be backported in stock_zebra)

opw-2455291

closes odoo/odoo#66415

X-original-commit: 7822b5bc76b2cbc1534b8df8d0bb3b5a3b50db0e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-17 18:24:16 +00:00
bit-odoo c2d20902f6 [FIX] project: filter when not required
Before this commit:

A method action_subtask is including the other actions context if have which
reflects while clicking on the Sub-tasks stat button. For examples:

- When click on the stat button 'Sub-tasks' of any task which one is clicked by
  systray activity icon results
- When click on the task menu in project there a default search filter 'My task'
  which also passes when click on 'sub tasks' stat button

After this commit:

Remove the context that startswith `search_default'.
Hence, now subtask will display with the correct context.

Task-2413127

closes odoo/odoo#66401

X-original-commit: b13fc817d150f642254c4738cfbd91ac2ecaa65f
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-17 16:51:41 +00:00
Éloi Rivard 72917b4a82 [IMP] auth_ldap: allow multiple '%s' in the filter.
Before this commit, the ldap filter can only contain a single
placeholder, and thus the `login` can only be matched against a single
LDAP attribute.

This change allows matching the `login` against multiple LDAP
attributes e.g. checking against either an email or a uid:

   (|(mail=%s)(uid=%s))

closes odoo/odoo#62134

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-01-28 08:12:30 +00:00
Éloi Rivard f8d865499b Added CLA email 2021-01-27 13:54:19 +00:00
Rémy Voet (ryv) e87d3b041f [FIX] stock: fix multi-archive
task-2439909

closes odoo/odoo#66411

X-original-commit: 91bd643125bd3fbcac98795b265e2d33bd03b710
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-02-17 17:55:32 +00:00
Rémy Voet (ryv) 1df4969d23 [FIX] stock: add warning when creating second warehouse
Add a warning to explain that create a second
warehouse will activate the multi-location automatically.

task-2439909

X-original-commit: 4964a9482b8b195f5b629ea5c91f7d7bfcce2163
2021-02-17 17:55:31 +00:00
Rémy Voet (ryv) 08d2b84674 [FIX] stock: avoid not logical settings
When we create a second warehouse on a company, the
multi-warehouse and the multi-location is automatically
activated. But a user can desactivate manually the multi-location
which leads to a misconfiguration (no sense to have multi-warehouse
without multi-location)
Add a UserError to avoid this case.

task-2439909

X-original-commit: e3549ae8eefe9bc3029ea7f50eed479d113b4687
2021-02-17 17:55:31 +00:00
Joseph Caburnay b61703ab1c [FIX] pos_hr: loading crash when employee record is deleted
To reproduce:
0. Login as admin.
1. Install pos_hr.
2. Open a pos session without activating the Authorized employees feature.
3. Make an order as Mitchell admin but **don't** validate, order is just
in the localStorage.
4. Go back to the backend (without closing the browser).
5. Close the session.
6. Edit the pos config and activate authorized employees.
7. Delete the employee record linked to the admin user.
8. Open a new session using the modified pos config.
9. [Crash] Because of missing employee.

Solution:
We just make sure to prevent field access on missing undefined object.

closes odoo/odoo#66408

X-original-commit: 176046304cc21daa839290df070170fa6ce2509d
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-02-17 17:37:09 +00:00
Tiffany Chang (tic) 6103258826 [FIX] stock: make package level package consistent
Currently a package level is created and has the newly created package
assigned to it when "Put In Pack" is used. Unfortunately if a move line
has its result_package_id changed after having a package assigned via
the Put In Pack, then the package level's package_id isn't correctly
updated. This leads to incorrect data in the db. This incorrect data
doesn't affect much since result_package_id from an entire package move
cannot be changed in any views, but it does mean that the created
package associated with the package level can never be deleted even if
it's never used.

Steps to reproduce:
1. active (delivery) packages in settings
2. create a picking and create some done values
3. use "Put In Pack" to put done move lines into a package
4. change the newly created Destination Package to another package
5. Go to Packages and try to delete the package created by Put In Pack

Expected result: able to delete the package
Actual result: Server error that package is still required by Stock
Package Level.

This is a short term fix. In the long run it would be better to fix the
package_level logic so it isn't unnecessarily assigned to moves/move
lines and/or updates in a cleaner way.

Task ID: 2418907

closes odoo/odoo#66406

X-original-commit: e5ab8cf9623bc436f43706926bc6ee596c549244
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-17 17:24:38 +00:00
Ipsita Borisagar d30deb1966 [FIX] mail: prevent message separator for new conversations
Before this commit:

When a new conversation is initiated, the 'new messages' separator is displayed.
This looks a bit weird as there is no history of conversation and thus no older
messages from which new messages should be separated.

After this commit:

The 'new messages' separator will not be displayed in new conversations.

LINKS

PR https://github.com/odoo/odoo/pull/65952
Task-2453511

closes odoo/odoo#66400

X-original-commit: ff44dbf31a3732a8ebced7ff907fff3b2440afc4
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-17 16:51:20 +00:00
Benjamin Vray adedf2b77c [FIX] website_forum: remove o_we_selected_image class on post images
Before this commit, the o_we_selected_image class was not removed from
forum post when saving.

task-2312878
Part of #66316

closes odoo/odoo#66399

X-original-commit: 876bb9cb06097db54d3c02a57a6d4b35eee0107c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-17 16:47:51 +00:00
Benjamin Vray bb1ca3e5d9 [FIX] website_forum: fix selector in event of the submit btn of a post
A comma was removed in the following commit for no reason
912996fe90 . Because of this, the click
event of the forum post submit button was not working.

task-2312878
Part of #66316

X-original-commit: 3509d438133de46ef02bb70255c7cd737a695f15
2021-02-17 16:47:50 +00:00
wan db6d031bba [FIX] account: wrong batching to compute the name
Reproduce:
* Create one move in a journal
* Create another move in another journal but in the same year
* Both journals should have a yearly sequence reset
* Post both moves at the same time

Bug:
They both are using the same sequence.

Expected:
Both should be using their own sequence.

closes odoo/odoo#66383

X-original-commit: f816c326f348ff78a982f91a736cc005d3e0cd31
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-02-17 15:02:29 +00:00
Nicolas Lempereur 115965fdc5 [FIX] base: mail signature CSS inlined for icons etc
The mail signature of an user did not inline the CSS like the body of a
message, so for example icons seemed to work but would not be seen
(unless the mail reader had the same font-awesome system).

With this change we inline the signature too.

On edition there was also an issue since the original icon was saved as
data-class which was stripped: so eg. when editing a mail.message with
working icon, the icons would disappear.

opw-2453912

closes odoo/odoo#66372

X-original-commit: 5e093b7a37984c8cc5aa73d1c0f7aa9c9345e6b1
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-17 14:13:29 +00:00
Goffin Simon 5bd031f3d3 [FIX] hr: Officer Access Right - Gamification
Steps to reproduce the bug:

- Let's consider a user U with employee officer access rights
- Log with U and go to Employee in debug mode

Bug:

The following menus

- Configuration/Challenges
- Configuration/Departments
- Configuration/Goals history

were not accessible

opw:2450931

closes odoo/odoo#66365

X-original-commit: 02d32aa9936cb0d9a1248bb866a31f4a40a0eac2
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-02-17 13:17:30 +00:00
Michael Mattiello (mcm) 446292e0d9 [FIX] pad: make pad quick editable
This commit makes the pad quick editable like a html field.
When we click on the pad, the form switches to edit mode but
not if we click on a link. A link has the priority over the quick edit.

closes odoo/odoo#66359

X-original-commit: c9e7c6bcde6a568bc5141a29644ab1f1e6a4a312
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-17 12:49:00 +00:00
Adrien Widart b63e4ad8de [FIX] account: set printed invoice as main attachment
When printing some invoices, they are not registered as main
attachment. Therefore, when sending a follow-up report, a UserError
message asks the user to print the invoices first.

To reproduce the error:
(Need account_accountant, use demo data)
1. Go to Accounting > Configuration > Invoicing > Follow-up Levels
2. Select "First Reminder Email"
3. Enable "Join open Invoices"
4. Create an invoice INV01 for customer C01 + Post INV01
5. Go back to Accounting > Customers > Invoices, select INV01
	- ! Do not open the invoice. Just select it.
6. Print > Invoices
7. Go to Follow-up Reports
8. Select C01
9. Send by mail

Error: An error message is displayed: "You are trying to send a followup
report to a partner for which you didn't print all the invoices" but it
does not make sense because the invoice has been printed.

For a follow-up report to be sent, the invoices must have the field
`message_main_attachment_id` defined (see
[code](https://github.com/odoo/enterprise/blob/476d862aba396c54c7a47950e02af7aed008a2db/account_followup/models/account_followup_report.py#L311-L313)).
There are two ways for this field to be set:
- When sending the invoice, `_message_set_main_attachment_id` is called,
select one attachment and mark it as main one
https://github.com/odoo/odoo/blob/437b49860b46b5abb8f55ced349fece984968998/addons/mail/models/mail_thread.py#L1918-L1924
- When opening the invoice, if the sreen is large enough, a pdf viewer
is opened next to the invoice. This pdf viewer will call
`register_as_main_attachment`, the latter marks the `ir_attachment` as
main one:
https://github.com/odoo/odoo/blob/e6a41b118a94c5b101d127f6b70fc54958e9346b/addons/mail/models/ir_attachment.py#L17-L20

However, when the user only prints an invoice, nothing will set the
`message_main_attachment_id` field. Thus, this fix will call
`register_as_main_attachment` when a pdf is generated and will mark it
as main attachment.

OPW-2427247

closes odoo/odoo#66356

X-original-commit: 643e7b06aee2a91190a3a7271211e70e4888d595
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-02-17 12:27:31 +00:00
Géry Debongnie 2716828f25 [IMP] web: display better tracebacks in debug=assets
The recent change in the way debug=assets works (which now bundles all
files in a bundle instead of serving them statically) had a negative
impact on the stacktrace displayed in the error dialog in debug=assets:
it now display the bundle/linenumber instead of the actual file/line
number.

This is not a huge deal, most of the time, because the errors displayed
in the console display the correct information, and the debugging
process should work as before.  But it can certainly be annoying in some
cases.

With this commit, we use the Stacktrace.js library to dynamically fetch
the sourcemaps and to decorate the displayed information with the
correct file and line numbers.

closes odoo/odoo#66318

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-17 11:52:40 +00:00
Yannick Tivisse 1bd73558da [IMP] hr: Add work location number field
Could be useful, for example in the DMFA declaration

closes odoo/odoo#65792

Related: odoo/enterprise#16228
Related: odoo/upgrade#2159
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-16 08:44:43 +00:00
wan c92332f555 [FIX] l10n_pe: depend on l10n_latam_invoice_documents
Part of task 2124952

This is needed in order to be able to create the demo data.
It was not done earlier because of stable policy but it was added to
l10n_pe_edi instead.

closes odoo/odoo#60148

Related: odoo/enterprise#15213
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-02-17 08:39:29 +00:00
wan 072558c43d [FIX] l10n_latam_invoice_document: compute document type multi
Part of task 2124952
2021-02-17 08:39:29 +00:00
wan da4f2b8966 [FIX] l10n_cl: manage document type for generic demo data
Part of task 2124952

Amend the demo data to populate required fields added in dependencies of
l10n_cl.

The field l10n_latam_document_number is not required if the journal is
not using Latam invoice documents.
2021-02-17 08:39:29 +00:00
wan de0c5f4b8c [FIX] l10n_ch: _is_qr_iban without bank
Part of task 2124952

Return False if the recordset is empty.
```python
self.acc_type == 'iban'
```
This already ensures there is at most one record.
We now have the same behavior as for `_is_isr_issuer` (False if empty
recordset)

Was needed after cb8b6db391 because it is
now calling _is_qr_iban on a possible empty recordset.

Revert 1b2aef65f4
2021-02-17 08:39:29 +00:00
wan 00ed98db4d [FIX] l10n_ar: add afip responsability for demo partner
Part of task 2124952

Populate fields that are required and added in dependencies of l10n_ar.

Remove an unused variable too as an act of kindness.
2021-02-17 08:39:29 +00:00
wan 7841777afa [FIX] purchase_stock: test independant from demo data
Part od task 2124952
2021-02-17 08:39:29 +00:00
wan 82c75aeff3 [FIX] point_of_sale,pos_hr,pos_coupon: adapt tests for localization builds
Part of task 2124952

By using AccountTestInvoicingHttpCommon, we have a setup independant
from the demo datas. This also prevents running tests with incompatible
localization: the tests for l10n with another currency than USD failed
because of the demo datas preventing the change of currency.
2021-02-17 08:39:28 +00:00
wan 7da284ea5b [FIX] account: assertTaxGridAmounts independent from demo data
Part of task 2124952

If another company uses the same tags, they showed up in the assert.
2021-02-17 08:39:28 +00:00
wan 3b086e75da [IMP] account: make test class usable for l10n without tax
Part of task 2124952

This is required to run tests defined in l10n_ar for instance
2021-02-17 08:39:28 +00:00
wan d31c5c70e0 [IMP] account: make demo data for all localization
Task 2124952

Extract all the demo data from `l10n_generic_coa` to a new way of
generating the demo data for accounting modules.
Because the data needs to be created multiple times, and right after the
chart template instanciation, it cannot be done the usual way. Instead,
we use python generators to declare the data. It allows us to reference
data that was not created yet at the start of the creation of the demo.
An xml_id is given, prefixed with the id of the company it is created
for (just like the instanciation of the chart template)

To find the correct accounts, a helper method has been added to
`account.account`. It will look for an account with the correct xml_id
(which is the one of the l10n_generic_coa, that we have to put on the
other l10n modules too, in the future). If it didn't find the xml_id, it
will look for an account with the correct type. If it still didn't find
one, just take any account.
2021-02-17 08:39:28 +00:00
Aaron Bohy 7f2a1c487e [FIX] web: list: correctly evaluate groupby modifier with m2o
Let's assume a <groupby> node in a list view containing a button
with an invisible modifier referencing a many2one field, e.g.

```
 <tree>
   <groupby>
     <field name="m2o" invisible="1"/>
     <button string="do it" attrs="{'invisible': [('m2o', '=',
False)]}"/>
   </groupby>
 </tree>
```

Before this commit, the m2o field was correctly read, but it's
value wasn't processed by the model, so the modifier wasn't
correctly evaluated.

Issue reported on PR https://github.com/odoo/odoo/pull/65316/

closes odoo/odoo#66330

X-original-commit: fa7a185663f21c1c4060765c8c137b296df3a350
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-17 09:57:44 +00:00
Goffin Simon 59e39db3b9 [FIX] hr: Impossible to create an employee
Steps to reproduce the bug:

- Let's consider a user U with a related partner P
- Log with an internal user IU without Admnistration/Settings and Employee Officer access rights
- Create an employee E with address_home_id = P and save

Bug:

An access right was raised because the mobile of P was written on P and
the error was raised at https://github.com/odoo/odoo/blob/13.0/odoo/addons/base/models/res_partner.py#L531

Due to this bug, only internal user with Admnistration/Settings access rights can create an employee
linked to a contact of an internal user.

opw:2445953

closes odoo/odoo#66014

X-original-commit: 7e50c8ae6aad3325163e8a30c4f2513d24b72b83
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-02-11 17:34:22 +00:00
Dhwani Patel 8c08d7be0b [IMP] website_sale, stock: add email in additional address
improved various things into this commit:

- added OPTIONAL email field on the new ship-to address for the eCommerce
- if the email field is empty on the shipping address,
  it will send the confirmation email only to their parent

task-2194014
Closes #47347

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-02-17 09:11:34 +00:00
Arnold Moyaux c8c30b0743 [FIX] mrp, mrp_subcontracting: traceback during unistall
The unlink fail in __init__.py uninstall hook is managed, however
when it fail, the error is catch but the cursor is not rollback and
do not accept additional transaction. That result in a traceback at
uninstall.

opw-2453939

closes odoo/odoo#66309

X-original-commit: 66d9dce9b6e6e65000ba0b62efcb153f2d3eec15
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-16 18:33:27 +00:00
Nicolas Lempereur 6cdcd9a3c0 [FIX] web_editor: stop loading button once ace saved
When we edit a view with ace in eg. studio, if it works the saved button
would never be enabled again because of missing callback.

Match the behavior of dom.addButtonLoadingEffect other usage (80592abd).

opw-2457046

closes odoo/odoo#66301

X-original-commit: 5324f7a6aa757ff6a728258ea1877ded4a6f86cd
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-16 17:39:04 +00:00