Commit Graph
126702 Commits
Author SHA1 Message Date
Raphael Collet d0bb596f1d [IMP] fields: x2many fields of new records are new records
The value of an x2many field on a new record are new records, possibly
related to a real record, called its "origin".
2019-05-23 05:47:11 +00:00
Goaman 60be9f2c09 [IMP] account: add test for writeoff in the reconciliation widget
Test that there is no conversion of debit/credit when creating a
writeoff with the method process_move_lines of the model
'account.reconciliation.widget'.

See 7b636f3342

closes odoo/odoo#33588

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-05-23 09:39:13 +00:00
Robot OdooandJulien Mougenot 99821fdcf8 [IMP] web: Use browser cache to improve startup time of webclient
Today, some resources that varies very infrequentely are requested on
every page load: the menus, the translations and the qweb templates

After this commit, there will be 2 improvements that will make the
loading of the webclient faster:
1. cache almost static resources forever
when loading the /web/ page, the user session will
contain the cache key to be used to fetch these resources. As the content
of the resource itself it used to compute the hash, the request can be
put in cache by the browser forever (for a year).

The up side is that in general less requests are needed to load the web client
The down side is that the load time and number of queries of /web page
has increased to include what is needed to compute the hash of translations,
menus and qweb templates

2. trigger the loading of the menus before the download (and startup) of
the JS and CSS assets:
The menus contains the definition of the action, wich is the first thing
needed to load a page in odoo. Starting the loading of the menu much
earlier means that when they are not yet in the browser cache (see point 1),
the browser does not need to wait for the entire assets to be downloaded
and parsed before starting the 'load_menu' request, but instead start it
immediately and hold onto a promise to be used instead of the rpc 'load_menu'.

Because the request is done before anything else is loaded, including
JQuery, it is made in vanilla JS.

task-id: 1943338

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#33291

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>

Co-authored-by: Julien Mougenot <jum@odoo.com>
2019-05-22 17:02:28 +02:00
Hetal Dhanak d9b0b09bd2 [REF] stock, stock_account: to_refund in return
Make `to_refund` true by default as this is ideal for most users. An
override of `default_get` won't work because the field is present in the
view only in debug mode.

Task-1962183

closes odoo/odoo#32495

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-22 11:40:41 +00:00
Martin Geubelle c54caca54d [IMP] website: Cache translations forever
Generate a unique URL for translations and cache them forever in the
browser. This reduces the number of requests, in exchange for computing
the hash of the translations when the session object is added to the page
2019-05-22 07:52:07 +00:00
Vincent Schippefilt b11b6bc902 [IMP] base: change cache busting middleware
In the HTTP pipeline, there is a middleware called DisableCacheMiddleware
that is called on every request to check if we are in debug mode, to remove
the cache headers and replace them with a static 'no-cache' so the browser
has to contact the server and check for a new version of every ressouce.

There were 2 problems with it:
1. it was doing more work than strictly needed when not in debug, like
rebuilding a list of headers for every request
2. it was removing Etag (case sensitive) with a typo and other headers
that could have been left in place.

This commit fixes those 2 issues by only modifying the headers if we are
in debug mode, and only removing the header 'cache-control' and replacing
it with 'cache-control: no-cache'
2019-05-22 07:52:07 +00:00
Sébastien Theys 822b05d1da [IMP] tools: limit image quality to 95
Values above 95 do not increase the quality but they disable optimizations that
increase the file size unnecessarily.

See `quality` parameter at
https://pillow.readthedocs.io/en/4.0.x/handbook/image-file-formats.html#jpeg

Part of task-1930726

closes odoo/odoo#33507

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-20 13:54:34 +00:00
Sébastien Theys d445f46806 [FIX] *: convert image route size param to int and use named param
* = tools, base, web, website_profile, website_slides

Before this commit it was impossible to pass those parameters in the URL because
they were received as string but expected as int.

The opportunity is also taken to properly use named parameters when calling
`image_process`.

closes odoo/odoo#33506

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-21 10:34:40 +00:00
Prakash Prajapati 9613483241 [IMP] mail, calendar: today's meeting in systray dropdown
The whole cell is now clickable, not only the first line and it opens
the calendar view.

The meeting title is now displayed on the left, and the time on the right.
Morever, the exact hour is now displayed, not "In 4 hours".

The next activity background color has also been adapted (goes to white).

Task 1948737

closes odoo/odoo#32215

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-21 12:45:45 +00:00
Vincent SchippefiltandJulien Mougenot 8a28cc22fd [IMP] base,web: Improve webclient startup
Today, some resources that varies very infrequentely are requested on
every page load: the menus, the translations and the qweb templates

After this commit, there will be 2 improvements that will make the
loading of the webclient faster:
1. cache almost static resources forever
when loading the /web/ page, the user session will
contain the cache key to be used to fetch these resources. As the content
of the resource itself it used to compute the hash, the request can be
put in cache by the browser forever (for a year).

The up side is that in general less requests are needed to load the web client
The down side is that the load time and number of queries of /web page
has increased to include what is needed to compute the hash of translations,
menus and qweb templates

2. trigger the loading of the menus before the download (and startup) of
the JS and CSS assets:
The menus contains the definition of the action, wich is the first thing
needed to load a page in odoo. Starting the loading of the menu much
earlier means that when they are not yet in the browser cache (see point 1),
the browser does not need to wait for the entire assets to be downloaded
and parsed before starting the 'load_menu' request, but instead start it
immediately and hold onto a promise to be used instead of the rpc 'load_menu'.

Because the request is done before anything else is loaded, including
JQuery, it is made in vanilla JS.

Co-authored-by: Julien Mougenot <jum@odoo.com>
2019-05-20 08:52:18 +00:00
Yenthe666 6f682e9ac7 [FIX] gamification: set record name for goal titles
closes odoo/odoo#30628

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-08 11:52:51 +00:00
Sébastien Theys 9dec7ba7e9 [IMP] web, *: add utils to get dataURL (base64) from file/blob
* = partner_autocomplete, point_of_sale, web_editor,
website_forum, website_slides

This can be used for example to preview an image from a file input field.

It can also be used to send the base64 content of the input by RPC instead of
having to rely on form submit as POST with multipart/form-data.

Technically wrap FileReader.readAsDataURL in a Promise.

This will also be used in task-1930726

PR: #33508

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-21 11:37:20 +00:00
Thanh Dodeur 923701851e [IMP] web: conserves record order in the search panel
After this commit, the order of the elements of the search panel
categories follow the original order received from the back-end.

This is achieved by getting the order from the Array received
from the backend instead of the dictionary used to store the record data.

Task: #1972698

closes odoo/odoo#33358

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-05-21 10:33:52 +00:00
mreficent 42c41052de [FIX] website_payment: typo in a view id
closes odoo/odoo#33407

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-15 17:23:44 +00:00
Raphael Collet 3f555c9068 [FIX] fields: enforce compute_sudo on fields
closes odoo/odoo#33493

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-20 13:57:49 +00:00
Raphael Collet 7a330b5068 [FIX] *: x2many value in tests 2019-05-20 11:00:40 +00:00
Raphael Collet 6ad43a44a2 [IMP] models: new records return default values 2019-05-20 11:00:40 +00:00
Laurent Smet 7f1a1fee49 [REM] account: Remove the cash-basis feature in reports
This feature was too greedy in term of performance to be computed and not very used.

-task: 1888408

closes odoo/odoo#33500

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-05-20 09:55:28 +00:00
Martin Trigaux 76aa319909 [IMP] base: translate printed report name
The report name was already translatable but not the filename

opw-1964505

closes odoo/odoo#33499

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-20 09:42:28 +00:00
Adrien Dieudonne e3a0217c63 [FIX] web: typo: missing bracket
This fix an issue in the mobile app in iOS.
Safari is less permissive and a blank page was shown.

closes odoo/odoo#33498

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-05-20 09:38:56 +00:00
Aurélien Warnon d6f07e659d [REF] survey: add a "_mark_done" method to improve answers state management
As other modules than survey (namely hr_skills) now need a hook to add specific
behavior when a survey answer is marked as 'done', we removed the '_send_certification'
method and replaced it with a '_mark_done' method.

It will make it easier to override this method as it has a more generic meaning.

closes odoo/odoo#32880

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-23 12:05:29 +00:00
Xavier-Do 62533ec752 [FIX] core: improve ready code warning timeout
The ready code warning timeout of 2 seconds can be confusing since
it is triggered just after the 2 seconds. We can log this message
at the end in order to give the real timeout.

closes odoo/odoo#33478

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-05-18 10:29:02 +00:00
Swapnesh Shah f3255f1091 [IMP] stock: Make Scheduled Date required
Follow up of d5ec467bafe62381 which added a default value in stable
This commit targets master branch where the field can be required

closes odoo/odoo#33025

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-17 15:10:05 +00:00
Pierre Rousseau 23e5f93ca2 [FIX] web: re-highlight form-uri
Since ea1b3254bb, the phone widget was no more highlighted as it is not contain in a 'span'.
This commit reintroduce the correct behavior for the phone widget.

closes odoo/odoo#33460

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-17 10:44:16 +00:00
Robot Odoo 33b2ac0000 [IMP] hr_holidays: Improve usability
This commit improves screens usability in the Time Off app.
The following points have been changed:

1. For leaves and allocations, add buttons on the kanban
card to directly approve or refuse if it's not already
validated.

2. On the leave kanban card, only display the dates,
not the full datetime.

3. Add a description to the activity created when a
leave/allocation needs to be approved by someone.

4. Allocation are now sorted in the list view by date_from,
more recent firsts.

5. In the allocation form view, add a stat button to know
how many leaves has been allocated and how many has been taken
for the leave type.

6. In the leave form view, in , there are currently two duration
for managers. The readonly duration is an informative field for regular
employees and the editable duration is meant for managers, it the
number of days needs to be manually set for some reason.
Make sure, the manager only sees the editable duration fields.

7. From "My Dashboard", the creation form view should not be the
manager form view (default view) which has additional unecessary fields
when requesting a leave for yourself (`employee_id`, `holiday_type`, ect).
It's now showing the form view for regular employees.

8. When approving a leave, to make an informed decision, it might
be needed to check leaves already taken by the employee or leaves
of its collaborators. This commit adds a widget displaying some stats
in a leave form view. This widget is only displayed in the context of the action leading
to leaves to approve. Stats displayed are:
- the number of days taken
by the employee this year, grouped by leave type
- Leaves taken by employees in the same department in the current month.

Task 1961713

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#32409

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-17 13:17:15 +02:00
Lucas Lefèvre fac0df86cb [IMP] hr_holidays: Display approve view from systray
When clicking on an activity on the systray, the form
view should be the "approve view" (with the stats widget).
The view loaded by the systray JS is the default view.
Hence the approve view need to become the default view.
A few action that used the default view need to be adapted
since that default view has changed.
2019-05-17 11:22:10 +02:00
Lucas Lefèvre 2b9aec2415 [IMP] hr_holidays: Add leave stats widget
When approving a leave, to make an informed decision, it might
be needed to check leaves already taken by the employee or leaves
of its collaborators. This commit adds a widget displaying some stats
in a leave form view. Stats displayed are:
   - the number of days taken
   by the employee this year, grouped by leave type
   - Leaves taken by employees in the same department in the month
   of the leave.
This widget is only displayed in the context of the action leading
to leaves to approve.
2019-05-17 11:22:10 +02:00
Lucas Lefèvre 09e515eecc [IMP] hr_holidays: Improve usability
This commit improves screens usability in the Time Off app.
The following points have been changed:

1. For leaves and allocations, add buttons on the kanban
card to directly approve or refuse if it's not already
validated.

2. On the leave kanban card, only display the dates,
not the full datetime.

3. Add a description to the activity created when a
leave/allocation needs to be approved by someone.

4. Allocation are now sorted in the list view, more recent firsts.

5. In the allocation form view, add a stat button to know
how many leaves has been allocated and how many has been taken
for the allocation leave type. The button redirects to the employee's
leaves of the leave type. Only shown for holiday type 'emloyee'.

6. In the leave form view, there are currently two duration fields
for managers. The readonly duration is an informative field for regular
employees and the editable duration is meant for managers, it's used if
the number of days needs to be manually set for some reason.
Make sure the manager only sees the editable duration fields.

7. From "My Dashboard", the creation form view should not be the
manager form view (default view) which has additional unecessary fields
when requesting a leave for yourself (`employee_id`, `holiday_type`, ect).
It's now showing the form view for regular employees.

Task 1961713
2019-05-17 11:22:18 +02:00
Lucas Lefèvre 29e6a42df4 [IMP] hr_holidays: Set request_date_from|to in demo data
The two fields of leaves `request_date_from` and
`request_date_to` are not set in demo data.
These fields are displayed in the form view and are
empty.
This commit add values for these fields to have
a nice and complete form view.
2019-05-17 11:22:15 +02:00
Lucas Lefèvre 3b0fa142fa [IMP] resource: Order leaves by date
Purpose
=======

Currently, `resource.calendar.leaves` are ordered
by creation date. In a list view,this is counter intuitive
if leaves are not created in the order in which
they will happen.

Specification
=============

Order `resource.calendar.leaves` by `date_from`
instead of creation date.
2019-05-17 11:22:10 +02:00
William Henrotin 7710e94c09 [FIX] stock: remove 'self' in view
Commit ca35f98 change the picking view but introduce an error by
calling 'self'

closes odoo/odoo#33438

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-16 14:04:45 +00:00
Lucas Lefèvre ca2c0b583f [IMP] hr: Keep employee name on user change
Purpose
=======

Managing people's names is hard.
The full name is stored in a single field.
But is it first name first? Last name first? How many names?

We don't want an onchange to automatically change names
for which we might have spent a lot of energy correctly
formatting in the database.

Specification
=============

Remove the automatic sync between the user's name
and the employee's name when a user is linked to
the employee.

TaskID: 1953003

closes odoo/odoo#32521

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-16 14:31:22 +00:00
Martin Trigaux c498d35890 [FIX] website_sale_wishlist: correct typo
_sql_constrains does nothing

closes odoo/odoo#33437

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-16 13:57:34 +00:00
559bdc976e [ADD] website_sale: adds a complete ecommerce tour/flow
This commit adds `website_sale_tour` test which is testing the whole ecommerce
flow.

This tour will test b2b and b2c flow using public user, tests website sale
flows with tax included and tax excluded price. Also test address management.

Also, the signup URL needed to be modified as PhantomJS run all tour on domain
127.0.0.1 but ignup button has absolute URL.
Runbot stores next step to be executed on `localStorage` and due to domain
name change during tour execution, it will lose track and runbot will fail.

Closes: #24179
Task-1829827

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>


Co-authored-by: Ravi Gadhia <rga@odoo.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
2019-05-16 05:41:21 +00:00
Jinal Patel 60a609fa8d [IMP] purchase: keep purchase representative empty in the purchase order
purpose of this task is do not set default purchase representative in the purchase order when the PO is created automatically.
When the purchase order is created automatically, this purchase order would be assigned to odoobot.
Odoobot is not a real user. so nobody notified any activity of that purchase order.
so keep the responsible field empty when the PO is created automatically.
Purchase manager can easily filter "unassigned" purchase order and he can assign unassigned PO to someone (real user).

Task-1940489

closes odoo/odoo#31729

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-16 04:59:50 +00:00
Mohammed Shekha dd182c8eb3 [IMP] delivery: use convert method instead of deprecated _compute
As _compute has been deprecated and this does not make runbot happy

Comign from: #24179
Task-1829827
2019-05-16 04:32:43 +00:00
Dharmraj Jhala 35b778590a [IMP] web: always use record data for signature widget 'full_name'
For signature field widget, we can set 'full_name' node option, which can be
used to auto fill the sign. However, current implementation for getting data
for field provided in 'full_name' (mainly, a string) has some flaws.

For example :
-In case of m2o fields, the string is not properly fetched due to different
structure than regular 'input' fields
- In case of x2m views inside a form view, field with same name can exist in
both parent record and child records. This is already the case with form view
of res.partner, where 'phone' field is there in both parent's form as well as
children's kanban view (for field 'child_ids').  With current implementation,
if we add signature on the form view, and  set 'phone' as 'full_name' node
option, instead of form view, we will get phone number from 'child_ids'.

This commit improves the behavior by getting data from the 'recordData' instead
of searching them from the DOM. To have recordData in it's latest state, we've
set 'resetOnAnyFieldChange' flag to true.

task-1948364

closes odoo/odoo#33105

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-16 09:15:13 +00:00
Barad MahendraandMohammed Shekha 894b9f53dc [IMP] web: editable list view when no access rights
Currently, an editable list view (`editable` set) makes its cells editable. However, if
the attribute `edit=false` is set (from context key or from access right restriction.
See _postprocess_access_rights method of `ir.ui.view` for more details), the list view
should not be editable, but is still.

This commit makes the 'editable' property of the listview checking the `edit` attribute
and provides some tests.

Task-32612

closes odoo/odoo#21613

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>


Co-authored-by: Mohammed Shekha <msh@openerp.com>
2019-05-15 09:11:54 +00:00
Divyesh Patel b0e715764c [IMP] base: replacing deprecated currencies with new one
- SDD: was put out of circulation in 2007, SDG is now used
- SRG: was replaced by SRD in 2004
- TMM: was replaced by TMT in 2009
- ZMK: was replaced by ZMW in 2012
- ZWD: ZML is now used

Closes odoo/odoo#24521
Task-id: 1823998

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-17 07:59:01 +00:00
Dharmraj Jhala 7317f174c7 [IMP] web: add description to signature field widget
task-1948364
2019-05-14 16:16:50 +00:00
Prakash Prajapati c33afb6d55 [IMP] fetchmail: local incoming mail server UI and default script
The purpose of this commit is to clean the user interface of local incoming
mail server and also update the script field default value
and configuration as per new script (from openerp_mailgate to odoo-mailgate).

task-1891157

closes odoo/odoo#33072

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-16 09:32:22 +00:00
Pierre Rousseau 5ec4121383 [FIX] crm_iap_lead: typo
Since c456228fa466982806355475079121f0b45c0166, the compute method was not the good one.

closes odoo/odoo#33414

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2019-05-16 08:03:13 +00:00
Varun Raval 4d7de56300 [IMP] mrp: improve labels for print buttons on bom structure report
Task ID: 1998237

closes odoo/odoo#33411

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-16 05:50:32 +00:00
shreya thakrar 4d50650750 [IMP] mrp: action improvement
When clicking on 'In Progress',  'To Launch'  will open a list view instead it
is needed that, clicking on those links will open tablet view in enterprise and
list view in community.
And also, to remove xpath (from enterprise) because they are not generic
and can only be applied at one element at a time. Instead, a method is defined
by this commit which is overridden in enterprise to open kanban view.

task - 1967745

closes odoo/odoo#32815

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-05-15 11:08:46 +00:00
Arnold Moyaux af795b64b0 [IMP] mrp: batch in form view
'batch' and 'batch_size' fields are community fields and their
features are also in community so we moved the form view inherit
that add both fields in form from enterprise to community.

Task 1967745
2019-05-15 11:08:46 +00:00
Arnold Moyaux 64cf0df5e0 [IMP] stock: label for partner and mts_else_mto
Task 1967745
2019-05-15 11:08:46 +00:00
Hardik Prajapati e963aaecca [IMP] stock,mrp,repair,point_of_sale: remove ability to create or edit stock location on the fly
task-1958487

closes odoo/odoo#33351

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-15 05:00:45 +00:00
Hetal Dhanak 43132ed5e6 [IMP] account: traceback in list view of account.move.line
removed move_id from view to prevent traceback.

added readonly and no_create attribute on account_id to be consistent with
form view.

Task-1974059

closes odoo/odoo#33269

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-05-14 08:51:10 +00:00
Adrien Dieudonne 3e1f2c7a0b [FIX] payment: update jquery.payment from 1.0.2 to 3.0.0
After deep comparison between majors versions, it seems that
there is no breaking changes and this fix a lot of issues in
mobile.

e.g.:
Before this update, the validity date wasn't correctly formated
and the end user had to enter the right format himself.
Some users were blocked at the payment process.

The root cause for this issue is the inconsistent list of native
events triggered by mobile devices.

Note that this library is only used for acquirer forms (S2S Form
Template) when "Redirection to the acquirer website" is checked
(payment_flow == 's2s') in the acquirer configuration.

We are aware that this library is deprecated and should be replaced
in the future.
See https://github.com/stripe/jquery.payment

opw-1986545

closes #33356

closes odoo/odoo#33376

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-05-15 07:19:18 +00:00
Victor Feyens f0182a0b16 [FIX] product_expiry: activities generation
This commit improves the performance of product expiry activities generation.
It also removes direct refs to activity types to ensure code stability in case of user deletion of system data.
The xml refs to activity types should only be used through mail methods to ensure fallback strategies can be managed in the mail module only.

closes odoo/odoo#33300

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-15 09:13:40 +00:00