Commit Graph
142407 Commits
Author SHA1 Message Date
Sébastien Mottet (oms) 094c94fcd3 [IMP] website: change some wordings in configurator features screen
Some feature descriptions and titles have been reworded.
A sentence has been added below the title to indicate
that choices made on this screen are not definitive.

Task ID: 2451965

closes odoo/odoo#70252

X-original-commit: 63195ba03ccc1bf40b4682fc7c9aa4a1a55f1e43
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
2021-05-03 11:40:09 +00:00
Sébastien Theys 7de0a02980 [IMP] mail: flag JS "on change" fields as such
There is currently a limitation with required fields because an "on change"
compute might trigger the check for "required" before all the actual computes
have been done, leading to the required field check incorrectly failing.

The main goal is to ensure the "on change" computes are done after all the other
computes and after the check for required fields.

A check has also been added to ensure no "real" compute can trigger update cycle
side-effects anymore.

Opportunity is also taken to prevent from checking for required fields on a
record that was deleted as part of the same update cycle.

Somewhat part of task-2278551

closes odoo/odoo#70204

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-05-03 11:52:26 +00:00
Adrien Widart d448db602a [FIX] point_of_sale: use lot's location for SML's location source
When selling a tracked product that comes from a specific place in the
warehouse, the module will ignore this information and set the parent
warehouse as source location.

To reproduce the error:
(Use demo data)
1. In Settings, enable "Multi-Warehouses"
2. Create a product P:
    - Product Type: Storable Product
    - Available in Pos: True
    - Tracking: By Unique Serial Number
3. Update its quantity:
    - Location: WH/Stock/Shelf 1
    - Serial Number: USN01
    - Qty: 1
4. Start a POS session
5. Sell P
    - Enter the same serial number
6. Go back to quantity update page for product P

Error: The quantity for "WH/Stock/Shelf 1, USN01" is still 1, it should
be 0. Moreover, a new line appeared: "WH/Stock, USN01, -1" which is
incorrect. The POS module considered that the product sold came from
WH/Stock instead of WH/Stock/Shelf 1.

OPW-2473002

closes odoo/odoo#70194

X-original-commit: 02a68278a9af2c477cc9a30716feabb0b533b7e7
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-04-30 15:22:10 +00:00
Djamel (otd) d413524dc8 [FIX] stock_landed_costs: use the correct split method landed cost
Steps to follow to reproduce the bug:
- Install Inventory and Purchase
- In the inventory settings, Enable the "Landed Costs" option
- Go to Purchase > create a Service type product
- In the Purchase tab > Enable "is landed cost" option and choose "by quantity" in the default split method
- Go to Orders > Requests for quotation > Create a new RFQ > add Any product and confirm the order
- Validate receipt of the product
- Create a bill > add the Service you created at the beginning
- Create Landed Costs

Problem:
we do not use the split method landed cost of the product, we automatically set it to "equal"

opw-2465753

closes odoo/odoo#70247

X-original-commit: 5da8c593353edcae4540bec696e259031f2d60f5
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-05-03 11:00:22 +00:00
Swapnesh Shah 2511100232 [FIX] mrp: allow to select product w/o bom
Without this commit, User was not allowed to create Unbuild Order
for the product without BoMs from Unbuild Orders menu.
But User was able to create Unbuild Order using 'Unbuild Order' button
on MO.

With this commit, We are allowing user to select Products without BoMs
to make this behavior consistent so user can create Unbuild Order from
Unbuild Orders menu.

closes odoo/odoo#70246

X-original-commit: eb332de42a36b7235d5578d39d345a5ff1df7759
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-03 10:58:11 +00:00
Florent de Labarre b6ad74e956 [FIX] stock : wrong float_compare
add the name of argument, if not precision_digits is used.

closes odoo/odoo#70242

X-original-commit: 2e7dfec50e9104adf8efbc64e0342359dc8947a7
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-03 10:24:45 +00:00
Samuel DegueldreandTom De Caluwé 2cfb8658bf [FIX] web_editor: fix default shapes not reacting to palette changes
Previously, when toggling on background shapes, they always had the
default colours. In [1] we made it so that when you toggle on a shape on
a section, it would automatically reuse the colors of the surrounding
shapes if any.

Unfortunately, when the "implicit" colors were also the default colors,
they were still marked on the shape, and it got an explicit background
image that would no longer react to changes in the palette.

This was caused by the fact that the call to _getDefaultColors returns
an empty object when the section doesn't already have a shape-container,
this was not a problem before since we were not passing in any colors
when creating the initial shape previously, the the aforementioned
change made it so that we did.

This commit fixes the issue by creating the shape-container before
calling the method that will set the colors on the shape, this way
getDefaultColors works as expected, and the colors are not marked on the
section when they are the default ones, restoring the ability of the
shape colors to adapt to the palette

[1]: https://github.com/odoo/odoo/commit/875aca63f7dab287c61485ebe999b3b8dd89d91c

task-2500607

closes odoo/odoo#70054

X-original-commit: 63acc2b0d1957dedd40af2033722f9ea4ef2e597
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
2021-05-03 09:27:44 +00:00
Chong Wang (cwg) be2981324c [FIX] Calendar: fix avatar preview on hover
delete redundant '}' added by accident

The redundant '}' might be added by accident.
It makes the the correct avatar image cannot be found and shown as a default camera image when the user
* Open calendar
* Hover on on of the responsibles listed in the right side panel of the calendar view

closes odoo/odoo#69139

Taskid: 2504659
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-04-16 09:14:24 +00:00
Chong Wang (cwg) 85e1c447df [IMP] base: specify placeholder for company partners
set the specify placeholder for company partners from 'placeholder.png' to 'company_image.png'

After this commit, in the res.partner kanban view, if the company image of an individual is not set,
it will be shown as the 'company_image.png'(a company logo) rather than the 'plaeholder.png'(a camera logo).

closes odoo/odoo#68994

Taskid: 2491161
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-04-16 09:01:46 +00:00
Sébastien Geelen (sge) ed12ad006a [FIX] web_editor: update toolbar position on scroll
closes odoo/odoo#70221

X-original-commit: 044c047cee83c915b33d21aeddb08d1096ab8060
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-03 07:48:18 +00:00
Sébastien Geelen (sge) 7845a77c61 [FIX] web_editor: update odoo-editor lib to commit 77a1e98
X-original-commit: ea86110cc781b603a6665523cd4359a405f5babd
2021-05-03 07:48:18 +00:00
Pratima Gupta 0626ad78ef [FIX] mrp: suggest the qty to produce instead of 0 in workorders
Before this commit, if any workorder is stared to produce, qty
producing was 0. After this commit, if product tracking is none
then system will suggest the remaining qty of workorder to produce
when user is start it.

TaskId - 2480775

closes odoo/odoo#70207

X-original-commit: 5bbc234d43a415be18fcfa42dad33b1577644719
Related: odoo/enterprise#18086
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-04-30 17:48:13 +00:00
tsb-odoo 27ad0755b6 [FIX] l10n_fr: assets update on account.account.template.csv
425000 current assets rather than current liabilities.

closes odoo/odoo#70200

X-original-commit: 60b97ff46a790c2c6c490d78f6d1be103ff3182f
Related: odoo/enterprise#18081
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-04-30 16:07:40 +00:00
Samuel Degueldre 557a24e4f4 [IMP] web: allow lazy-loading asset bundles' templates
Previously, lazy-loading xml templates was only possible by fetching the
xml file directly, this meant that it was impossible to lazy-load an
entire bundle's templates with a single request. Additionally,
requesting the xml files directly meant that no inheritance was applied,
causing the need for a separate inheritance system using t-jquery on the
client-side.

This commit alters the /web/webclient/qweb route so that it now takes a
bundle id, meaning that it is now possible to lazy-load the xml from
arbitrary bundles.

task-2497943

closes odoo/odoo#70084

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-05-03 07:25:20 +00:00
Andrea Grazioso (agr-odoo) 830a28b6ad [FIX] sale_margin: avoid purchase price reset on order confirm
- Create a service product with cost 0
- Create a sales quotation
- Add the service product, change the cost to a positive quantity
- Save and Confirm.

Purchase Price (cost) will be reset to 0

opw-2481564

closes odoo/odoo#70036

X-original-commit: 8a8ff03f6111f377bcd9c2b0f584c450b82a4182
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-04-28 14:50:22 +00:00
Francois (fge) c1abb1841e [DOC] web: export an object containing a comment is not supported
closes odoo/odoo#69407

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-04-23 10:01:41 +00:00
Andrea Grazioso (agr-odoo) cfdd7c3b5e [FIX] stock: allow destination address change in transfer
- Create SO with deliverable product, confirm
- Change delivery Address on SO and on Transfer
- Inventory > Stock moves (debug mode)
- Group by > Picking and Destination address

The address shows is the original and not the updated one.

opw-2429018

closes odoo/odoo#67407

X-original-commit: c813655074b3b83bdf9345ef12399b0b96feaf71
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-03-08 10:49:02 +00:00
Djamel (otd) 92d87907e8 [FIX]repair: fix invoice deletion
Steps to follow to reproduce the bug :
- Install the Repairs and Accounting application
- Create a new user and give him only access to Accounting
- Connect with this user
- Create a draft invoice
- Try to delete it
- Access rights error is triggered.

Problem:
When we delete an invoice and the Repairs app is installed, we check if it is not an invoice related to a repair.
But the user does not have access to “repair.order”, so we can not check the field "repair_ids".

opw-2507867

closes odoo/odoo#70095

X-original-commit: b5588246a0e032c92b8443e67875ff4146858fe8
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-04-29 10:59:14 +00:00
Antoine Guenet a502bb7223 [FIX] web_editor, note: autofocus the editor on load note form view edit
On creating a new note, the focus was automatically set into the "tags"
field. This was inconvenient and was replaced with an autofocus on the
note itself so we the user can immediately start typing.

closes odoo/odoo#70195

X-original-commit: 8fe89c5ebc138cb517938dbd6d975b8bec4eaf4d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-30 15:23:36 +00:00
Achraf (abz) 5b3010a3a0 [FIX] l10n_in_sale: Set automatically GST Treatment on invoice creation
What are the steps to reproduce your issue ?

    1. Create a contact and set 'VAT' to "20AAACT2803M2ZO". The 'GST Treatment' will be automatically set correctly.
    2. Create a sale order for this new contact. GST Treatment is automatically filled in correctly.
    3. Confirm the order.
    4. Create an invoice.

What is currently happening ?

    The related invoice does not fetch the 'GST Treatment' automatically

What are you expecting to happen ?

    The related invoice must set the 'GST Treatment' automatically.

opw-2499503

closes odoo/odoo#70131

X-original-commit: 36582d08dee3688ea6e839bccfeaf8877e812122
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2021-04-29 17:16:19 +00:00
Ivan Yelizariev adec68caa7 [FIX] attachment_indexation: fix error "cannot contain NUL (0x00)"
To reproduce:

* install python package ``pdfminer.six``
* install module attachment_indexation
* upload special attachment

BEFORE:

Error in client:

> TypeError: relatedTemporaryAttachments is not iterable

Error in logs:

> ValueError: A string literal cannot contain NUL (0x00) characters.

AFTER:

No errors

---

opw-2506038

closes odoo/odoo#70205

X-original-commit: 172b88fdd955ba591a9bdd5a93bf7285ce0e6520
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-04-30 17:04:38 +00:00
Richard deMeester a0887c6a48 [I18N] account_check_printing: translate in en_AU
Use Cheque instead of Check (American spelling)

closes odoo/odoo#70196

X-original-commit: 58966deb956ba87b3475cf3d359d732907331563
Related: odoo/enterprise#18079
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-04-30 15:26:07 +00:00
Nicolas (vin) 3973f766cc [IMP] account_reports: carryover improvements
Implements various small improvements in order to make the carryover
functionality a bit less hidden, with a cleaner UX.

Task id #2500684

closes odoo/odoo#69762

Related: odoo/enterprise#17908
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-04-30 15:37:35 +00:00
Jacky (trj) bb11164de0 [FIX] point_of_sale: create only one picking when validating order (if the option is activated)
closes odoo/odoo#70190

X-original-commit: 77267c265e6769cd90e8bc61d634b765e04a6829
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-04-30 14:34:18 +00:00
Nicolas Lempereur 849e0a5690 [FIX] im_livechat: 'Visitor' translated in livechat
Make translation work for "Visitor" that was appearing in livechat
session to the visitor.

opw-2504461

closes odoo/odoo#70175

X-original-commit: 3b199007bd5a472d57f823a63b2b77841b14c7fc
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-30 14:00:17 +00:00
Sébastien Theys 8f6603db45 [IMP] mail: compute messaging menu counter with dependencies
It was the last remaining usage of the deprecated `_updateAfter` which is
therefore removed too.

Part of task-2258617

closes odoo/odoo#70170

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-04-30 12:02:20 +00:00
Rémy Baranx (bar) 5a1905ee7d [FIX] gamification: apply res.users ir rules when retrieving badge owner info
When retreiving the list of badge owners in `_get_owners_info()`,
we should apply `res.users` ir rules to be sure to respect multi-company
rules.

upg-7081

closes odoo/odoo#70182

X-original-commit: d75deff4791702e1f085b2b16247d7f7c5335720
Signed-off-by: Christophe Simonis <chs@odoo.com>
2021-04-30 13:33:42 +00:00
Sébastien Geelen (sge) 86dbb2f4ae [FIX] web_editor: prevent linktool destroy on autocomplete click
closes odoo/odoo#70167

X-original-commit: 3acf90df2f70793554ff13e262cb4ad0e38308bd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-30 11:31:23 +00:00
Nicolas Lempereur 1f14a6b8ed [FIX] website{,_livechat}: 'Website Visitor' translated
Make translation works for "Website Visitor" that was appearing when a
logged-out user open a livechat session.

note: list comprehension has to be removed since translation only search
language in direct calling method closure.

opw-2504461

closes odoo/odoo#70146

X-original-commit: 7d28f32d9be1590764883f4621df04e04c4e1f12
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-30 08:45:00 +00:00
Adrien Widart c175652762 [FIX] point_of_sale: post journal entries of cash in/out
When closing a POS session, if there was no sale, the journal entries of
cash in/out will not be posted.

To reproduce the error:
(Need account_accountant)
1. In Point of Sale, open Shop's settings:
    - Enable "Advanced Cash Control"
2. Start a new session:
    - Open POS
    - Close, Confirm
3. Close session
4. Click on "End of Session"
5. Add a "Cash In/out"
    - +$10
6. Set Closing Cash
7. Close Session & Post Entries
8. Accounting > Cash

Error: The $10 line is present but its status is "New". It should be
"Processing".

Since there was no sale during the POS session, the module ignores all
the accounting part. When the session is closed, the accounting part is
ignored because there were no sales. As a result, it does not post the
cash in and out.

OPW-2456395

closes odoo/odoo#70160

X-original-commit: 985f1bf5b187513f71e65ab7d2b68e25ff1bfdf1
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-04-30 10:29:22 +00:00
Sébastien Geelen (sge) 0c5c4664f6 [FIX] web_editor: fix icon replacement when using toolbar replace button
closes odoo/odoo#70143

X-original-commit: b5ed6558185bb4686d6be6e8c1c4e8c4573c6e14
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-30 08:06:32 +00:00
Sébastien Geelen (sge) d54959bd9d [FIX] web_editor: fix icon link edition
X-original-commit: 8bb7610e8893cad692cf9ad2f5a89a503a6175ef
2021-04-30 08:06:31 +00:00
Olivier Dony d08db821bc [IMP] web: simplify font loading code
Can be simplified a bit by using the newer features of
`tools.file_open()` and `tools.file_path()`.

Let's do it since the PR is touching these lines anyway
for the change of resource paths.

closes odoo/odoo#69614

Related: odoo/enterprise#17855
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-04-29 07:34:40 +00:00
Simon Genin (ges) ecfe85db84 [REF] web: static/src/(img|fonts) => static/(img|fonts) 2021-04-29 07:34:40 +00:00
fw-bot f6c03b7097 [FIX] calendar: improve calendar recurrency creation performances
Turn off calendar.attendees notification during synced_events creation
to improve performances. The calendar notification are only computed
once after all the synced events have been created.

Add a flag in google_calendar.js to avoid retriggering synchronization
while navigating the calendar view if the past synchronization is still
pending.

opw: 2450259 + fixes/adaptations to 14.3 branch

FW of https://github.com/odoo/odoo/pull/69619

closes odoo/odoo#70035

X-original-commit: 28ccb2b88a7793058c81aabffb43071165886f40
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-04-30 06:47:00 +00:00
Yannick Tivisse fa90f97627 [FIX] hr_holidays: Add method to allow inheritance
closes odoo/odoo#70125

X-original-commit: 12ba83ce60c74a8dcfb773a2c21bbf31b681ab30
Related: odoo/enterprise#18044
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-04-29 16:56:17 +00:00
david f27111e767 [FIX] mail: tracking_value_ids field group
Give a coherent group as otherwise we could have access errors. Simple
case: an Admin Rights user goes into a mail message form which is only
available in debug mode which sets `group.no_one` into such user. This
model is only readeable by `base.group_sytem` so an AccessError will
raise.

closes odoo/odoo#70119

X-original-commit: 8930e08213d0b6805e6fc91fa07561107ef43acc
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-29 15:05:12 +00:00
Romeo Fragomeli 7a40d528e7 [FIX] web: pdfjs: hide buttons that doesn't work in webviews
Some features of the PDF.js library doesn't work in the
webview of the mobile apps.

Initially 'window.print' is defined as an empty function in
webviews unlike browsers where it is already ready.
After that, PDF.js needs to monkey patch 'window.print' and
saves a reference to the original definition, which is not
yet fulfilled in by the mobile app (Java part).
So the print of PDF.js doesn't work in webviews and end
users will need to download the file before printing it.

Regarding the Download button, the 'download' attribute is
not supported by the webview as you can see in:
https://bugs.chromium.org/p/chromium/issues/detail?id=432414
As there's many ways to download a file in Odoo it's not
a big deal to simply hide it in PDF.js.

Because it's quite complicated to fix this, we decided
to hide the features that don't work (Download / Print)
or don't make sense (Open file).

Note that a refactoring is already in progress in order to
avoid to patch this library in master.

closes odoo/odoo#70110

Task-id: 2200168
X-original-commit: 39225827035efe11cdc90b2a7f1ae1f24a54b136
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: rfr-odoo <rfr-odoo@users.noreply.github.com>
2021-04-29 14:27:31 +00:00
dht-odoo f37e4f675f [IMP] website_mass_mailing: remove horizontal scrollbar in popup
Sometimes while dropping a newsletter popup (for ex in blogs, events etc),
there's a horizontal scroll-bar on the pop-up due to bootstrap gutters.

This commit improves the behavior by removing the gutters on the div causing
the horizontal scroll-bar on the popup.

Task-ID - 2312996

closes odoo/odoo#61855

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-22 09:02:01 +00:00
dht-odoo e3ccb454b9 [IMP] website_mass_mailing: improve 'Website popups' inline tree view
This commit improves the inline tree view for 'Website popups' for the
mailing lists with following changes:

- disables creation from the tree view as it should always be done with
  the fronend
- adds last updation date and create date in the tree view
- hide website popups page/menu in form view if no popup is there

TaskID - 2312996
2021-04-22 09:02:01 +00:00
Swapnesh Shahandsimongoffin f48ae97c2c [FIX] hr_recruitment: allow to restore Application
Steps to reproduce the bug:

- Create a Job Application without Applied Job
- Refuse/Archive it.
- Restore/Unarchive it

Bug:

- KeyError raised due to missing `False` in `default_stage`

Fix:

- Add `stage_id` if Applied Job is selected on the application.

opw:2513147

closes odoo/odoo#70077

X-original-commit: b0dc16e44d027bf27ec501d922459bf0f1db8550
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: simongoffin <sig@odoo.com>
2021-04-29 08:55:13 +00:00
Goffin Simonandsmetl 45710b17da [FIX] account: Wrong amount of tax with different currency
Steps to reproduce the bug:

Create an accounting entry AE with $ as default currency
Add a line L1 with 10 € and a tax of 15%
Bug:

The added tax line was 0.75€ instead of 1.5€

opw:2510338

closes odoo/odoo#69995

X-original-commit: 28e85cdbbd499b3fa826c15d4058aa4b83b993c9
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Co-authored-by: smetl <las@odoo.com>
2021-04-28 11:38:09 +00:00
Swapnesh Shah 394c5f9544 [FIX] hr_attendance: compute worked hours when needed
Steps to reproduce the bug:

- Go to Attendances > Manager > Attendances
- Remove Check in value of an hr.attendance record A
- Set Check out to A

Bug:

A traceback was raised

opw:2513143

closes odoo/odoo#70088

X-original-commit: c462782f66d720266e7e8e7f616fc26c23f009c8
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-04-29 09:45:16 +00:00
Goffin Simon b60be49a56 [FIX] hr_timesheet: Analytic account without company
Steps to reproduce the bug:

- Let's consider a project P set with analytic account AA and company C
- Allow timesheet on P
- Let's consider a task T belonging to P
- Set AA with comapny = False
- Try to encode a timesheet on T

Bug:

A UserError was raised because the field company_id on account.analytic.line is required

opw:2486034

closes odoo/odoo#70086

X-original-commit: b3dc922cb45bdd4c2778bea784b540b1723c8fc1
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-04-29 09:40:05 +00:00
Odoo's Mergebot 6ee928bd30 [FW][FIX] *: AppStore Review compliance
The goal of this PR is to solve some issues with the last AppStore review.
Without these changes, we are no longer able to update the mobile app on iOS.

Here is a summary of the feeback we received:

> **Guideline 2.5.8 - Performance - Software Requirements**
> https://developer.apple.com/app-store/review/guidelines/#software-requirements
>
> Your app includes a dashboard view that presents multiple windows at once.
> The Apple iOS Human Interface Guidelines allow multiple screens in an app. However, access to these screens should always be sequential, not simultaneous.
>
> _Next Steps_
>
> To resolve this issue, please modify your app to provide an alternate way users can accomplish the same task in a single screen or sequence of screens.
>
> **Guideline 3.1.1 - Business - Payments - In-App Purchase**
> https://developer.apple.com/app-store/review/guidelines/#in-app-purchase
>
> We found in our review that your app or its metadata provides access to mechanisms other than in-app purchase for purchases or subscriptions to be used in the app, which does not comply with the App Store Review Guidelines. Specifically:
> Your app includes an account registration feature for businesses and organizations, which is considered access to external mechanisms for purchases or subscriptions to be used in the app.
>
> _Next Steps_
>
> To resolve this issue, please remove features, account registrations links, and any other fully qualified links to your site that could indirectly provide access to external purchase mechanisms.
> If you have any additional information to provide regarding the digital content and services in your app and how the guidelines apply to them, please reply to this message in Resolution Center and let us know. If there is information you'd like us to consider in our review of future submissions, please feel free to include it in the App Review Information section of App Store Connect.
>
> _Resources_
>
> Learn more about our policies for apps that offer paid digital content and services.

closes odoo/odoo#70093

Task-id: 2483253
Forward-port-of: odoo/odoo#70051
Forward-port-of: odoo/odoo#68351
Related: odoo/enterprise#18035
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-04-29 14:10:18 +02:00
Adrien Dieudonne e09608f929 [FIX] base: apps: hide learn more button on iOS
According to the app-store guidelines we are not allowed to sell from
the iOS app.

Our updates are currently blocked because of this.
In the rush, we have no choice but to hide the 'learn more' button
displayed on each app. This redirects the customer to the documentation
page where you can find subscription links.
And this is unfortunately not allowed by Apple...

Source: https://developer.apple.com/app-store/review/guidelines/#business

Related PR:
https://github.com/odoo/mobile-ios/pull/102
https://github.com/odoo/mobile-ios/pull/103

Task-id: 2483253
X-original-commit: a812660e284068802e24d9dd422e4dd15341e716
2021-04-29 10:07:36 +00:00
Adrien Dieudonne b13884fa7a [FIX] *: removal of any possibility of purchasing IAP credit in iOS
According to the app-store guidelines we are not allowed to sell from
the iOS app.

Our updates are currently blocked because of this.
In the rush, we have no choice but to hide certain elements related to
IAP services.

Source: https://developer.apple.com/app-store/review/guidelines/#business

Related PR:
https://github.com/odoo/mobile-ios/pull/102
https://github.com/odoo/mobile-ios/pull/103

Task-id: 2483253
X-original-commit: 657780cc7102c77cafe20998df0d7667cdc4c0df
2021-04-29 10:07:36 +00:00
Rémy Voet (ryv)andFeyensv eca2161f40 [IMP] sale: add populate
Add populate script for the `sale.order` and `sale.order.line`.

task-2446266
closes odoo/odoo#50566

closes odoo/odoo#68704

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Feyensv <vfe@odoo.com>
2021-04-29 09:28:39 +00:00
Rémy Voet (ryv)andFeyensv 2c1823514c [IMP] product: product_* population
- Improve product.product & product category population: Add "random"
types, prices, and product categories to product. Specify some product
categories as children of others (populate the `parent_id` field).
- Provide product template and product attributes population
- product pricelist population

task-2446266

Co-authored-by: Feyensv <vfe@odoo.com>
2021-04-29 09:28:39 +00:00
Odoo's Mergebot 4213386b6e [IMP] deprecate server-side t-raw & remove occurrences
`t-raw` is a relatively regular source of issues, not just because it
gets misused (though that happens) but because it's a form of action
at a distance: a commit adds a `t-raw` with a checked input, this gets
validated and merged, then the *input* gets modified or overridden or
... and the devs & reviewers don't realize it will end up in a
`t-raw`... and we've got an injection vector.

The markupsafe package (on which we already have a hard dependency)
turns out to have a solution for that: if the parameter to
`markupsafe.escape` has a `__html__` method, it will just call that.

It also provides `markupsafe.Markup` which defines exactly one method,
and furthermore will automatically escape the parameters to its
methods (which can be a bit disconcerting for some) as well as
formatting parameters e.g.

    Markup("foo %s %s") % (a, b)

will automatically escape `a` and `b` before they're merged into the
format string, and will return a markup. Obviously that doesn't work
the other way around (because `str.__mod__` and `str.format` always
return a string). It does work for concatenation though.

This means if we can use `markupsafe.escape` as the standard escape
function (which is a good idea since werkzeug [is deprecating
`werkzeug.utils.escape`
anyway](https://github.com/pallets/werkzeug/issues/1758)) we can
leverage this property by requiring the *sources* to be properly
tagged for them to be directly injectible, this means in the scenario
above the payload will either be properly escaped OOTB or it will
break the existing system, but either way it should not be a
*security* risk. And we can easily flag mentions of `Markup` or
`__html__` for security review.

This PR updates `qweb` to use `markupsafe.escape` as its escaping
function, and adds a warning to `t-raw`. It also updates a number of
APIs to make them markup-safe by default:

* html_escape (that's actually what `markupsafe.escape` does on all of its own)
* html_sanitize
* the output of HTML fields
* scriptsafe JSON
* nl2br (which internally escapes its input if necessary)
* qweb markup bodies e.g. `<t t-set="thing">body</t>` the value is markup-safe
* qweb *output*, however `qweb._render` returns *binary data*, for the
  most part this is invisible because we keep using `to_text` and
  `ustr` everywhere and those decode bytes to text automatically, but
  `Markup` inherits from `str` so we can't just have qweb return a
  `Markup`, it generates garbage. Therefore it returns
  `MarkupSafeBytes`

`to_text` was also updated to let `Markup` instances pass through
unmolested. `ustr`, however, was not.

New wrapper types:

`MarkupSafeBytes` is used as the output of `qweb._render`. It extends
`bytes` as `Markup` extends `str`, though it doesn't redefine all the
utility escaping `Markup` does. For the most part:

* It decodes to a `Markup`.
* It defines an `__html__` which decodes to and returns a `Markup`.

`_ScriptSafe` is the new output of the scriptsafe JSON module. It
defines its own `__html__` which applies script-safe escaping at point
of use, it doesn't use the `Markup` wrapper to avoid issues of
unescaping and double-escaping related to attributes, with which
script-safe escaping is not compatible.

A few other notes:

* `to_text` was updated to let `Markup` objects pass through
  unmodified, `ustr` was not updated thus.
* The `Text` fields used through `t-raw` were converted to `Html(...,
  sanitized=False)` (at least when they could not be sanitized
  e.g. header contents and friends).
* Digest was completely untested, but the test I added is not entirely
  reliable, sometimes records go missing and I'm not really sure why.
* Running Odoo with `-b` might be a good idea: while Python 3 removed
  implicit conversions between text and bytes, this means
  `str(b'foo')` now generates the value `"b'foo'"`. Because `Markup`
  extends `str` it has essentially the same behaviour, and passing
  *bytes* to `Markup` is basically a garbage generator.

closes odoo/odoo#68072

Related: odoo/upgrade#2315
Related: odoo/enterprise#17228
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-04-29 14:09:54 +02:00