Commit Graph
126725 Commits
Author SHA1 Message Date
Robot Odoo 079fcd6232 [MERGE][IMP] project, *_timesheet: link analytic account and project
Impacted modules: hr_timesheet, project, sale_timesheet and sale_timesheet_purchase

Currently, the link between the Analytic Account and the Project is non existant if
Timesheets is not installed, and we track any cost linked to the AA set on the Project,
but we only track the revenues linked to Timesheets.

The purpose of this merge is to allow simple project (no timesheet installed or
activated) to track their costs and revenues. This is done through the analytic account; indeed, all
purchase order, sales order, invoices and vendor bills can generate analytic entries. It could
then be interessting for user to see the costs and revenues for a project.
We decided to redirect user from the project dashboard to the "costs/revenues" action of the analytic
account itself, or (if timesheet is allowed on project) to the overview.
This commit also integrates purchase orders on the project overview.

Implementation:
This PR aims to improve the link between Project and Analytic Accounting, by several actions:
* Move all the analytic account business to project
* Add an Other Revenues field in Project Overview,  which represent the positive analytic entries
from the AA set on the Project AND that are not linked
to a Timesheet
* Add two smart buttons on Project Overview to Purchase Orders and Vendor Bill of the project's AA
* Add the results (Sales Orders and Timesheets) linked to the project's AA in the respective smart
buttons of Project Overview
* Add a "Profitability" link on the Kanban card of the Project bringing to the Costs & Revenues of
the AA set on the Project to allow profitability tracking when there are no Timesheets.

To do so, it was required to move back the analytic dependency from hr_timesheet to project, like
before 3dd3e26483 (but without the inheritS).

Limitation:
This will only make sense for project having a "one-to-one" relation with analytic account. If 2 projects
are linked to the same AA, we have no way to deduce from which project the cost entry is linked.

Task-1975022

closes odoo/odoo#33237

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-05-24 14:15:52 +02:00
Lucas Perais (lpe) af86bc7288 [IMP] point_of_sale: restrict print sale datails
Have two pos config opened, with at least one connected to a POS box with a printer
Do some sales on both
Click on the printer icon in the pos UI to print today's sales

Before this commit, the ticket that was printed contained sales for
both point of sales

After this commit, it only contains sales of the point of sale from which
the print request has been sent

OPW 1958885

Before this commmit everyone could print the sale datails for all day
for the current PoS Config from the UI.

After this commit cashiers can only print the current session,
disregarding the date.

TASK-ID: 1978713

closes odoo/odoo#33036

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-05-24 09:51:01 +00:00
Geoffroy Larue 3ab9b5192c [IMP] project, sale_timesheet: usability
Fix a tiny typo in project and rename two fields in Project Overview
to improve usability.

Task-1975022
2019-05-24 09:46:46 +00:00
Geoffroy Larue 5837b6c320 [IMP] project, hr_timesheet: profitability link
In order to improve the tracking of costs and revenues on projects,
this commit adds a "Profitability" link on the Kanban card of the
Project which appears for analytic accounting users when the
"Timesheets" / "Overview" link does not appear.

This link brings to the  tree view of the lines from the analytic
account linked to the project.

Task-1975022
2019-05-24 09:46:46 +00:00
Geoffroy Larue f3999314af [ADD] sale_timesheet_purchase: bridge module
Add two smart buttons in project overview : purchase orders and vendor
bills, linking purchases and bills pointing to the project's analytic
account.

Task-1975022
2019-05-24 09:46:46 +00:00
jem-odoo db92ca5fce [IMP] project,hr_timesheet: move analytic account business to project
When we remove the inheritS between project and analytic account, we move the
analytic_accound_id field in timesheet because it was the only use case for
a project to be linked to an analytic account.
This commit prepares new cost origin for a project (other that timesheet).
Register costs on project will required an analytic account to keep analytic
costs tracking. The analytic account management is now moved to project, like
it was in 10.0, but without the inheritS.

Task-1911581
2019-05-24 09:20:06 +00:00
Geoffroy Larue 299a61ecbc [IMP] hr_timesheet: remove useless field
Remove the field company_uom_id as it is not used anymore.

Task-1975022
2019-05-24 09:20:05 +00:00
Vincent Schippefilt 9d9a866cc3 [REF] web: remove hardcoding of maxage for load_menu
use CONTENT_MAXAGE to define the max-age instead

closes odoo/odoo#33634

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-24 07:09:57 +00:00
Pierre Paridans 0771f008ff [IMP] web: searchpanel's categories should unfold when clicked
In the SearchPanel there was a separation between selecting and
unfolding a category with children.

With this commit, when the user click to select a parent category the
children are also folded/unfolded.

This reduce the number of actions needed to reach a sub-category.

Task ID: 1917277

closes odoo/odoo#32660

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-05-23 13:12:58 +00:00
Pierre Paridans 4d1cce97a9 [IMP] lunch,web: don't disable SearchPanel on mobile
SearchPanel widget in kanban views has been introduced in commit
https://github.com/odoo/odoo/pull/30517/commits/25c9355c02485e85914430188f3281246fc54cda.
But this feature was disabled for mobile.

This commit removes unneeded differentiation between desktop and mobile
for the SearchPanel.

It also adapt related tests to reflect this change.

Task ID: 1917277
2019-05-23 13:12:58 +00:00
Pierre Paridans 627fd77248 [FIX] mail: DocumentViewer's buttons alignment on mobile
The action buttons in the document viewer were badly aligned on small
screens, and specifically when moving to multiple lines to fit on the
viewport.

This commit adjusts the positionning and margins between those buttons
to stay consistent on every screens size (smallest to biggest).

Task ID: 1917277
2019-05-23 13:12:58 +00:00
Pierre Paridans 71a2d7c06a [REF] web: don't destroy twice a widget's children
Widget class indirectly inherits from ParentedMixin (through
PropertiesMixin).

The Widget's children are destroyed in both the ParentedMixin and the
Widget's own destroy() method.

This commit prevents from trying to destroy already destroyed children
and specifically from looping again on those children (resulting into a
minor performance improvement).

closes odoo/odoo#32174

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-05-23 15:41:30 +00:00
Romeo Fragomeli e5c65b22ab [FIX] hr_holidays: don't use "object shorthand" (es6)
This commit fix non-compliant JS code syntax.

Currently Odoo JavaScript code base supports ECMAScript <= 5 only

Using ECMAScript 6 (2015) feature break compatibility with
Internet Explorer and Android KitKat (4.4)

Ref: https://eslint.org/docs/rules/object-shorthand

closes odoo/odoo#33605

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-05-23 13:02:08 +00:00
Andrius Laukavičius 62046a1d26 [FIX] base: update res.lang lt_LT date format
Lithuania uses date format `yyyy-mm-dd`, not `yyyy.mm.dd`.

LST ISO 8601:1997 (obsolete) LST ISO 8601:2006 (current)

https://en.wikipedia.org/wiki/Date_format_by_country
https://en.wikipedia.org/wiki/ISO_8601

closes odoo/odoo#33580

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-22 14:59:45 +00:00
Christophe Monniez 3f884fbe3f [IMP] loading: tests are allowed without demo data
As most of the tests are using demo data, a check is performed to verify
that they are loaded.

A best practice is to write tests that does not depend on demo data but
with this check, it's not possible to launch them without demo data.

With this commit, the check is removed, allowing to launch test even
without demo data loaded.

closes odoo/odoo#33531

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-05-22 06:59:39 +00:00
Prakash Prajapati d73f90f055 [REM] project: remove notes field from project.task model.
The notes field is not used anywhere so removed it.

task-1986384

Closes #33514

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-05-21 07:30:38 +00:00
Parth Choksi 00997c93a9 [FIX] web: pdf file not previewed
The pdf_viewer widget fails to load file and hence shows error.
This is due to the wrong controller called(wrong URI passed),
while loading a file using pdfjs.

For files other than images, /web/content controller should
be called since since odoo/odoo#31811.

This is similar to the enterprise fix 793c76298a2b301a2

task-1932190

closes odoo/odoo#33354

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-22 13:07:21 +00:00
Raphael Collet 047bc013e0 [FIX] sale: browsing [False] is not a good idea
closes odoo/odoo#32930

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-23 05:48:03 +00:00
Raphael Collet 1c1d0b3893 [FIX] mrp: onchange method with one2many field 2019-05-23 05:48:03 +00:00
Raphael Collet 4bc2b14248 [FIX] mail: computed fields with new records only 2019-05-23 05:48:03 +00:00
Raphael Collet d491dedb9a [FIX] account: deal with new records 2019-05-23 05:47:11 +00:00
Raphael Collet 76ee0afb29 [REF] api: remove deprecated env.in_onchange 2019-05-23 05:47:11 +00:00
Raphael Collet e70abb63d4 [REF] addons: avoid using NewId 2019-05-23 05:47:11 +00:00
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