Commit Graph
142947 Commits
Author SHA1 Message Date
dht-odoo a7437aac10 [IMP] website_form: converts text data into html data
In website forms, for both html/text type of fields,
we provide simple textarea to users for entering the data.
And, we store the data as it is for both of them.
But with this change, we're trying to convert plain text
(entered by user in the online form for html type of fields)
into to html, so for example it can replace \n with <br> and
properly formatted data can be saved.

Task id: 2499504

X-original-commit: b8d5b61333b0e8570ea2eb0535e37a0025514812
2021-06-07 05:24:08 +00:00
dht-odoo 586ae4bcc4 [IMP] crm: improves description field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fields

1) crm.lead -> description
2) event.event -> note

Task Id: 2499504

X-original-commit: 524e2f089a611d897b98d86001bda5d17263db66
2021-06-07 05:24:08 +00:00
dht-odoo f247476155 [IMP] maintenance: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> fields

1) maintenance.request -> description
2) maintenance.equipment -> note
3) maintenance.equipment.category -> note
4) mrp.workcenter -> note
5) mrp.workorder -> operation_notes
6) mrp.routing.workcenter -> note
7) repair.order -> internal_notes
8) repair.order -> quotation_notes

Task Id: 2499504

X-original-commit: 0cca26b5358cd9d69a65c6b93cfecb33d7e659c5
2021-06-07 05:24:08 +00:00
dht-odoo 23483865b1 [IMP] account: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fields

1) account.move -> narration
2) account.payment.term -> note
3) account.fiscal.position -> note
4) res.company -> invoice_terms
5) res.config.settings -> invoice_terms

Task Id: 2499504

X-original-commit: 0f3c7f153e8bd20f83b7d1df031634996d36935b
2021-06-07 05:24:08 +00:00
dht-odoo c65289306e [IMP] purchase: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fields

1) purchase.order -> notes
2) purchase.requisition -> description

Task Id: 2499504

X-original-commit: 43958eff2b9346420104002d628d5ca9225f8090
2021-06-07 05:24:08 +00:00
dht-odoo b8fb33817b [IMP] website_slides: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fields

1) slide.channel -> description
2) slide.channel -> description_short
3) slide.slide -> description

Task Id: 2499504

X-original-commit: 6d914c005183aa5ae69650e3002a5a85ca83b4a6
2021-06-07 05:24:08 +00:00
dht-odoo dbf1ab157d [IMP] calendar: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Adding a new method convert_online_event_desc_to_text
Because online events have fixed format for the description,
this method removes some specific html tags, and converts it into
readable plaintext (to be used in external calendars).

Models -> Fields

1) calendar.event -> description

Task Id: 2499504

X-original-commit: 0d5ca6a6fe8821b4ec19dd603bde116518721792
2021-06-07 05:24:08 +00:00
dht-odoo 366aa2907e [IMP] stock: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fieldss

1) stock.location -> comment
2) stock.picking -> note

Task Id: 2499504

X-original-commit: 96f5316a219568add44bee528245c2c8e49c3bbc
2021-06-07 05:21:40 +00:00
dht-odoo bea5790713 [IMP] sale, product: improves field type from text to html
It replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fields

1) sale.order -> note
2) sale.order.template -> note

Task Id: 2499504

X-original-commit: 6a345c2695129a5cd907e5e23e057871ebf9ebfa
2021-06-07 05:21:40 +00:00
dht-odoo 1ef6fd9098 [IMP] web, {base}_setup: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

In this commit we replace report_footer and report_header field of
"base.document.layout, res.config.settings" model as
they are related fields of res.company models field
report_footer, report_header.

Task Id: 2499504

X-original-commit: 4c474d0d2055efe81fdc21502aa5957fe80af7ef
2021-06-07 05:21:40 +00:00
dht-odoo 18ad07c001 [IMP] web: add isHtmlEmpty method in kanban view
In this commit we have added new method name isHtmlEmpty in
kanban view. As we are convertting text field to html field,
we will need to check html field in if conditions.

As Html field will contain tags we cannot check it every time
perfectly. So, we need this method to make sure html field is
empty or not.

Task id: 2499504

X-original-commit: 2968dcea7fb58795eeb34949f4bbfc1029938cd1
2021-06-07 05:21:40 +00:00
dht-odoo 57261b100f [IMP] base, mail, portal: improves is_html_empty method
Before this commit there were few cases in which
is_html_empty method was not working as our expectation.
In cases such as "<p class=""><br/></p>", "<p id=""><br/></p>"
and many other cases.

In this commit we improves regex of is_html_empty method.
Mow from this commit all kind of attributes will be consider
in this method.

In this commit we also have added is_html_empty in mail template, portal
values and in report values also for rendering templates.

Task id: 2499504

X-original-commit: fd0a05f2955b9f7e9ae7233afebfd6240c9244dd
2021-06-07 05:21:40 +00:00
Aurélien (avd) 8c7e6d5dec [FIX] hr_employee: remove duplicates from working_hours computation
Since the computation of employees work intervals is done in batch,
i.e. 1 call to _work_intervals for each (tz, resource_calendar_id) pairs,
removing tz duplicates from mapped results improves
the perf of hr_presence_state/hr_icon_display computations.

This is especially true for grouped hr.employee kanban view as each column
search_read triggers a recompute for these fields.

closes odoo/odoo#71772

X-original-commit: be6d4a2523bb1a292908d09dfc5393bc0aa88a2d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-06-04 16:03:22 +00:00
Arnaud Joset 5b5cfd0beb [FIX] google_calendar: prevent traceback in error handling
Before this commit, when the start datetime of base_event_id in recurrences was not set, a traceback would occurs when trying to notify the user.

closes odoo/odoo#71724

X-original-commit: d5b9403c0023d8df49487293b217c59265189a7a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-06-04 07:38:24 +00:00
Julien Banken f0f1cf3902 [FW][FIX] crm: fix incorrect prefix removal from phone filter
When the user searches a phone number, the search function will generate
a pattern by removing the "+" sign as well as well as the prefix "00" from
the input string.

Problem:

If the input string starts with "+", it means that the phone number will
be prefixed by something different than "00". As the function will
systematically remove the first occurrence of "00" from the input string,
the function can remove part of the input string that does not correspond
to a prefix. The search results can hence be incorrect.

Example:

If the user types "+32485001122", the function will remove the "+" sign
and the first occurrence of "00" from the input string. In the provided
example, the function will search phone numbers matching with the pattern
"324851122" which is incorrect.

Solution:

The function should remove the first occurrence of "00" iff the phone
starts with "00".

Task id: 2479277
COM PR: odoo/odoo#69729

closes odoo/odoo#70954

X-original-commit: 53b4a7cf045df8828716e31e6d2a56cf93123bba
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-07 05:32:25 +00:00
Krzysztof Magusiak 74a5776482 [FIX] link_tracker: Compute URL with char tracking fields
Make link tracker handle other types than many2one for tracking fields.
Currently, when a field of type char is returned, an error occurs.

odoo/addons/utm/models/utm_mixin.py already handles other types than
many2one for tracking_fields(). This aligns to that behaviour in the
link tracker.

opw-2494686

closes odoo/odoo#71780

X-original-commit: a2068f9696917d7fa4848bc09d05eced84d0cc2f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-04 18:26:09 +00:00
nounoubensebia c89c5ff3ed [FIX] crm: rearrange settings
Move the lead mining section to the top right as we now have a lot more empty
space after the removal of the outlook plugin settings

Task-2531032

closes odoo/odoo#71544

X-original-commit: 1cb0c743c4c15d6817773d66a7ac27321b8bbada
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-01 12:10:21 +00:00
Carlos Valverde 276a51920d [IMP] project : rating mail template improvement
Rating mail template, from the 'project' module, has been improved,
by adding more margin to the top of the icons, which increase its
visibility.

--

task-2531541

closes odoo/odoo#71094

Closes: #71094
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-06-04 14:39:43 +00:00
Carlos Valverde 9e8a709f80 [IMP] rating : rating icons improvement
Previous rating icons had readability issues, especially when used in
small containers. For this reason, this commit includes the following
improvements:

- New rating icons have been designed and included in PNG and SVG, in
order to increase readability.
- 'Thank you for rating our services!' template, in the 'rating'
module, has been revamped, by removing the old '.card' template and by
improving the shadow effect cast on focus plus a better user
interaction.

--

task-2531541
Closes: #71094
2021-06-04 14:39:43 +00:00
Csaba Tóth bd4886446b [FIX] account: fix reference to currency object
rounding_line_vals is invoked directly with a .create(), so the "currency_id" key's value should be an integer. See line 810.

This is hard to catch, i use Sentry on my servers and i found this bug. I cannot provide steps to reproduce, as i just see this bug report in Sentry.

closes odoo/odoo#71771

X-original-commit: 38de8fc52b4d6f6bdab4dd5e28eb9e3e5315145c
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-04 16:02:31 +00:00
wan 9e743cb31c [FIX] l10n_in: do not specify payment method in demo data
This is computed automatically since
04522f01e6

closes odoo/odoo#71777

X-original-commit: f6a2c5f1ebfefc16a91d7a6103704fbace955620
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-04 16:55:06 +00:00
Géry Debongnie 0a525e16b3 [FIX] web: update owl from 1.2.6 to v1.3.0
This commit updates owl to the latest release. It contains an
improvement: the support for the t-tag directive, which allow us
to have dynamic tagname in templates

Release on github: https://github.com/odoo/owl/releases/tag/v1.3.0

closes odoo/odoo#71775

X-original-commit: a1c173ef6d3808a7c70b7e758e7e65fc6a40b2c7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-06-04 16:51:07 +00:00
Pierre Masereel 2bd3ab2333 [FIX] point_of_sale: duplicated reference in POS
When you are opening a POS session, a number corresponding to count of
connection to this session is incremented, to be sure to have a unique
identifier on receipts.

In recent browsers, when you are reopening a recent tab (Ctrl+Shift+t)
the browser will load the response of last request and won't perform the
request. So the count of login won't be incremented, and this will
result of duplication of receipt number.

To avoid this behavior, we are explicitly say to the browser (through
the response header) that we don't want to cache the request result.

closes odoo/odoo#71770

X-original-commit: 21c92bf4d1a469f5ec1d0edcf2b2e08102df5b20
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-06-04 16:01:48 +00:00
Yannick Tivisse 9a5b2e2549 [MOV] fleet: Split model files according to coding guidelines
closes odoo/odoo#70612

Related: odoo/upgrade#2493
Related: odoo/enterprise#18250
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-04 08:47:45 +00:00
William Braeckman 32a8dc42f8 [IMP] fleet: add trailer_hook field to vehicles
Task ID: 2487706
2021-06-04 07:20:15 +00:00
William Braeckman e85763d982 [IMP] fleet: minor changes to views
Adds two new columns to the vehicle model tree view.
Changes the name of the vehicle model action.
Modifies the order by which vehicle manufacturers are ordered.
Adds filter and modify goupby on vehicle, vehicle model/brand.

Task ID: 2487706
2021-06-04 07:20:15 +00:00
William Braeckman 9b5768688a [IMP] fleet: add vehicle model categories
Adds categories to vehicle models

Task ID: 2487706
2021-06-04 07:20:15 +00:00
nie afda1c359c [FIX] point_of_sale: reload order with negative price
Steps:
- Go to Point of Sale
- Open a new session
- Add an item to the cart
- Click [+/-], [1] to get a negative price
- Reload the page
- Click Payment
- Click Cash
- Validate
- Close the UI and go back to the backend
- Click the three dots on the POS
- Click View / Orders
- Open the last order

Bug:
The order is still in "New" state and two payments of the same amount
have been registered. This results in the order not being fully paid.

Explanation:
`get_change()` returns the amount to be given back to the customer. It's
usually set back to 0 when the payment lines are created (e.g. when
clicking "Cash"). `amount_return` is then sent to the backend with the
order.
However, when reloading the page before clicking "Cash", no payment
lines are made and `amount_return` has been saved in LocalStorage with
the result of `get_change()`. `amount_return`, which is usually
undefined is now set back to its old value when reloading from the saved
JSON.
Because `amount_return` is not undefined in this case, it doesn't change
the result sent in the JSON when clicking "Cash"; it's not updated with
0 from `get_change()`. This results in two payments being recorded in
the order after validating and sending it to the backend.

This commit always uses the result of `get_change()` when sending the
order to the backend.

opw:2446563

closes odoo/odoo#71757

X-original-commit: 5d1640d05442613963426adc1d83fe066480c1a4
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-06-04 13:59:57 +00:00
Djamel (otd) d6c409444d [FIX] website_slides: set PdfFileReader to strict=False
Steps to reproduce the bug:
- Go to elearning app > Courses > content
- Create new slide > Upload a PDF file with faulty content

Problem :
Pypdf2 throws errors because it does not support some content or syntax.
In our case we are just trying to get the number of pages in the PDF, so if we put `strict = false`
we just determine that the user should not be informed of all the errors that pypdf2 encounters,
the flag `strict` is not a security indicator.

FYI: https://pythonhosted.org/PyPDF2/PdfFileReader.html
``` strict (bool) - Determines whether user should be warned of all problems and also causes some correctable problems to be fatal. Defaults to True.```

opw-2530829

closes odoo/odoo#71756

X-original-commit: 3acd0d666af56c39e34fc551e182468cc7bedc42
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-06-04 13:33:25 +00:00
Priyanka Kakadiya 14d177c3f3 [IMP] mail: added test case for message clicked status
- added test case for click on author name and on author avatar.

task-2391179

closes odoo/odoo#71746

X-original-commit: df2f110df0fb7cbfee55e611cb0ceee4aceefdcf
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-04 11:58:18 +00:00
Didier (did) 8447162d8e [IMP] mail: use a generic formatter for ir.attachment
This allows to reuse this formatter.

Part of task-2365881

closes odoo/odoo#71676

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-04 14:01:43 +00:00
Barad Mahendra 29147681a7 [IMP] project: do not display the archived sub-task in list
Currently, when go to project > settings > enable 'sub-tasks'
create a task >> add a sub-task and archive the sub-task
then the archived sub-task is still displayed in the sub-tasks list

so in this commit, removed the active_test context from the field to
hide the archived sub-task. also include the timesheet of archived
task while calculating the subtask_effective_hours and on click
of sub task hour open the timesheet of archived tasks.

PS: revert of the commit: https://github.com/odoo/odoo/commit/7a2cba3c8934064b311da4312ef2fbd07c6329ec
As we would deduct archived tasks from the count and the number of planning hours,
and keep them included in the timesheets.

closes odoo/odoo#71719

Taskid: 2534898
X-original-commit: e527ed80e25f638390fd8c56296e690b1630ec49
Related: odoo/enterprise#18744
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Signed-off-by: Mahendra Barad <mba-odoo@users.noreply.github.com>
2021-06-04 06:58:57 +00:00
Pierre Masereel 7dcb57181e [FIX] point_of_sale: correct payment method when price updated
When the selected payment line is updated but is in state 'paid', it
adds a new line with the first payment method. Since we load more
payment methods than the ones in the pos config, we should only take the
ones that are on the pos config

closes odoo/odoo#71736

X-original-commit: 8e7739fd2299246e963e8da3f4c53b699b84c1eb
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-06-04 10:41:07 +00:00
Anh Thao Pham (pta) 9ec1b599fe [FIX] stock_account: do not create aml when updating cost of consumable
- Create a Product Category: (i.e. Category X)
  * Costing Method: Average Cost (AVCO)
  * Inventory Valuation: Automated
- Create a Consumable Product with Category X (i.e. Product X)
- Create PO with Product X and receive products
- On Product X form, update Cost
- In debug mode, go to Accounting > Accounting > Journal Items
Account move lines have been created for stock valuation on cost change,
but it shouldn't for a consumable product.

opw-2510315

closes odoo/odoo#71723

X-original-commit: b8e6f77101d28d05dd3d79c5b6de56da4dd5d2e6
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-06-04 07:27:17 +00:00
Benjamin Vray 9371715fdc [IMP] web_editor, website: not display edit link popover if not needed
This commit allows not to display the popover where we don't need it.
Like on the next or prev buttons of the carousel for example.

task-2537840

closes odoo/odoo#71721

X-original-commit: 60853837a234f9fbfee5816f8a4766cc5a0b7d19
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-06-04 08:42:20 +00:00
Antoine Vandevenne (anv)andToufik Ben Jaa 1969d48f15 [FIX] payment: don't send customer IP address when running a cron
If a payment request is made from a cron (e.g., Subscriptions' cron for
recurring payments), the worker is not bound to an HTTP request and
therefore the value of `request.httprequest.remote_addr` is an instance
of the 'LocalProxy' object, which is not serializable.
If we're in this scenario, don't send the customer IP address.

task-2494916

closes odoo/odoo#71717

X-original-commit: e85464ad2281f25cbaf7ded0c1e5d7659a322696
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Co-authored-by: Toufik Ben Jaa <tbe@odoo.com>
2021-06-04 06:54:28 +00:00
Qiuyu (QHO) 60b013e6b1 [IMP] mail: change timestamp color in the systray
The timestamp color should be gray instead of primary green even when the thread is unread or needs action.

Task id: 2383054

closes odoo/odoo#71034

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-05-19 12:57:31 +00:00
Priyanka Kakadiya 6c83017e70 [IMP] mail: small improvement on systray activity
PURPOSE

- A helper should be aligned vertically in the systray menu.
- A sentence should also be changed by
  "Congratulations, you're done with your activities."

SPECIFICATION

A helper changed and also it will be appeared in the
middle of the dropdown.

Task- 2525928

closes odoo/odoo#70832

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-05-17 13:36:02 +00:00
Simon Genin (ges) 62f99565be [FIX] web: remove debug comment on qweb template extension
Owl 1 has some issues handling comments. So when people were in odoo
debug mode, inheriting in extension mode a t template, the comment
added from the server would throw a frontend error.
For now, we comment it, waiting for better comment handling in owl.

closes odoo/odoo#70227

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-03 14:30:51 +00:00
Nicolas Lempereur 25ef82ca80 [FIX] l10n_latam_invoice_document: header/footer in mutli-print
When l10n_latam_invoice_document is installed and the current company
does not have a custom header (in stable, only Chile and Argentina with
their localization installed use custom header), printing multiple
invoice at once, one out of two had no header or footer.

This is because `<div class="header"/>` and `<div class="footer"/>`
should be unique per record being printed, and when a custom header was
not used they were duplicated with the duplicate empty.

As an example, if we had 3 documents:

- record 1 : good header
- record 1 : empty header
- record 1 : body
- record 1 : good footer
- record 1 : empty footer

- record 2 : good header
- record 2 : empty header
- record 2 : body
- record 2 : good footer
- record 2 : empty footer

- record 3 : good header
- record 3 : empty header
- record 3 : body
- record 3 : good footer
- record 3 : empty footer

When we give them to wkhtmltopdf, it would be mismatched:

- headers:
  - record 1 : good header
  - record 1 : empty header
  - record 2 : good header

- bodies:
  - record 1 : body
  - record 2 : body
  - record 3 : body

- footers:
  - record 1 : good footer
  - record 1 : empty footer
  - record 2 : good footer

so record 2 will have empty header/footer, and record 3 will get those
of record 2.

opw-2507137

note: the master forward-port also remove t-if that are no longer
necessary since the same t-if is on an ancestor tag now.

closes odoo/odoo#69718

X-original-commit: 90bdb5c7b7aa6a9b98e9acb1774d449ae65a3918
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-06-04 08:18:21 +00:00
Antoine Guenet 33e021c2cd [FIX] website: allow editing empty non-arch fields
987fc1190a had added a rule that made
empty fields non-editable so that a snippetless website would not be
editable. This makes empty t-fields non-editable as well which is - to
say the least - not welcome.
This commit fixes that problem by making the rule more restrictive: what
we don't want to be able to edit are empty _arch_ field specifically.

closes odoo/odoo#71718

X-original-commit: 6886c2a2a2ad47d1150dd072888c39ccfb59b163
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-06-04 06:55:10 +00:00
Prakash Prajapati 9ec2f4cb44 [FIX] mail: fix the attachment traceback sync attachment
Currently, traceback occurs when same attachments are sync with
form view and bottom chatter and removed from chatter.

So in this commit, on click of remove attachment dialog wait
till the attachment id is removed from list of attachments.

closes odoo/odoo#65093

Taskid: 2431478
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-04-13 13:38:31 +00:00
Barad Mahendra 51399445a3 [IMP] hr_holidays: support document on Time Off based on Time Off type
Currently, it's possible to add supporting documents on the chatter of
the time off. But it's not easy to use and doesn't make really sense.
So we will add the possibility to add it more easily.

So in this commit,
 - Added 'Supporting Document' on Time Off type to support the
attachment based on types.
 - On new Time Off, if the Time Off type has a support document then allow
uploading the supporting document in form view.
 - The File is recorded on the chatter of the Time Off request.
 - There will be synchronization between chatter and form attahcments.

PS: added non-stored m2m field to display the attachment view(m2m_binary)
in the form view as o2m does not support it.

TaskID: 2431478
2021-04-13 13:38:31 +00:00
Xavier-Do c217973137 [IMP] core: bump master release version to 14.5 alpha
closes odoo/odoo#71688

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-06-03 17:26:33 +00:00
Xavier-Do 245029c02a [IMP] base, profiler: add entry count
Entry count can be useful to estimate the size on disk of a profile
file.

The entry count would be quite expensive to compute and thus should be
stored. It is impossible to use a compute stored in this case, since
ir.profile shouldn't have any "business" logic upon insert.

closes odoo/odoo#71673

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-06-03 14:24:50 +00:00
Xavier-Do 73ac78f072 [IMP] profiler: remove parameter 'path'
Even if only accessible when writing some custom code, the path option
of Profiler looked a little dangerous from a security point of view,
since this option allows to write the result of the collector anywhere.
This shouldn't be a problem, since Profiler shoudn't be accessible
inside a safe_eval() and the path param cannot be user defined, but this
is still a risk.

An alternative option would have been to give a file descriptor instead,
so that the user must have access to `open()`, which is unlikely inside
a server action.  This alternative has some disadvantages, though,
because the file descriptor should be given when creating the profiler,
or at least before `__exit__()`, removing the possibility to add the
number of entries in the filename.

This commit proposes another solution: add a generic way to output the
profiler as a json text.  The result can thus be saved the way the
developer chooses.  A utility method format_path() will help to format
path the same way the profiler did before this change.
2021-06-03 14:24:50 +00:00
Xavier-Do 3b861dfe7f [IMP] http: better request context manager
The usage of an additional optional context manager leads to the usage
of ExitStack. Unfortunately, this changes the initial format quite a
lot, decreasing readability and adding a loop on context managers, even
if there should be only one most of the time (request).

This commit proposes to a nesting utility for the profiler, allowing to
nest another context manager inside a profiler.

This solution allows an easier integration into http.py, avoids to
manage the "enter_context" case when recovering the init stack and can
be useful in other cases.
2021-06-03 14:05:01 +00:00
Xavier-Do f2dbac8ef7 [IMP] http: tweak profiling conditions
Improvement of get_dispatch_context_managers conditions and styling:
 - Check profile expiration very first.
 - Add an additional check for odoo.evented. Profiling will crash on an
   evented server. Only longpolling should use evented servers, it but
   this is more future proof.
2021-06-03 11:22:19 +00:00
Xavier Morel 7b60db192e [FIX] web_editor: libsass warning and also incorrect / confusing @extend
Apparently libsass has never actually supported compound
selectors (or at least never the way people interpreted it should
work).

Therefore since libsass 3.5 (July 2017) that is deprecated and emits a
warning. Which is problematic because libsass is also hard-coded to
emit its deprecation warning to stderr[^1], resulting in a
few issues:

* because it's not decorated (let alone as a warning) it's not really
  noticeable on the runbot or in most dev logs
* but because it's not associated with a logger it's basically the
  only thing which shows up when running in `--log-level=warn` (as
  it's printed at least once per tour)
* and it's pretty gnarly to get the information back in Python as,
  again, hard-coded to stdout

odoo/odoo#70927 explored messing around with fds to intercept the
writes and re-emit them to the proper location, but that was
considered a bit too iffy.

And of course the intent was always to eventually fix the warning
itself, which qsm provided for in [a comment][fix-extend], the
important bit was the extension of `:disabled` so that's what's left
here to fix the warning. The logic of the fix is that the loader is
always used with the `form-control` class (internally) and the
`:disabled` part of the `form-control` styling is what we really want
to copy over. It's possible that third-party lose the styling if they
use `o_wysiwyg_loader` alone (without an explicit `form-control` next
to it) but that seems like an unlikely situation.

[^1] libsass 4 (sass/libsass#3135) surfaces warnings at the API level,
     and removes the hardcoded / direct stream writing

[fix-extend]: https://github.com/odoo/odoo/pull/70927#issuecomment-847964413

closes odoo/odoo#71667

X-original-commit: 5c2c6b881152630ffbf68d55c7c77fa2234f3ac1
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-06-03 10:57:59 +00:00
Benjamin Frantzen (bfr) 22e04c6d56 [REF] account_edi: remove test_mode from _post_invoice_edi and _cancel_invoice_edi
Before this commit, business logic was mixed with tests. This commit aims to replace the test_mode with mocks for all account_edi tests.

closes odoo/odoo#71650

Related: odoo/enterprise#18709
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-06-03 09:18:24 +00:00