Commit Graph
124195 Commits
Author SHA1 Message Date
RomainLibert 6dbdfb9bf7 [IMP] various: optimize _name_search
In the overrides of _name_search we should avoid creating domains with
huge lists of ids as it is inefficient.
We can also make sure that we optimize the empty search as in this case
the custom domain doesn't make sense, we can simply search on an empty
domain and, thanks to the limit argument, still keep a fast query.

Linked to task 1918906

Thanks to @odony and @nseinlet

closes odoo/odoo#30155
2019-02-05 11:44:21 +00:00
Robot Odoo 0b79687155 [IMP] board,web: cleaner layout and kanban/pivot integration on mobile
This merge improves the Dashboard app and make it more usable on mobile:
- The layout is fixed to 1 column.
- Embedded Kanban view is fitted to its content and handle correctly empty columns.
- Embedded Pivot view has smaller left indentation for readability purpose.

Task ID: 1904747

closes odoo/odoo#30467
2019-02-05 14:54:27 +01:00
Hetal Dhanak b8f7df1a6a [IMP] project: Clean timesheet related fields on task form
-Moved the share Button to the dropdown Action menu as it was better suitable there.
 -moved sale order item field to extra info as it was better suitable there.
 -changed display of settings for project to give it organized look.

Related Task ID: 1928422

closes odoo/odoo#30310
2019-02-05 12:09:14 +00:00
Parth ChoksiandMohammed Shekha 514d6fb90d [IMP] base: Hide Save/Discard on Settings until there are modifications
Purpose
=======

It only makes sense to display 'Save' and 'Discard' if the user actually
changed something in the settings.

So after this commit, the 'Save' and 'Discard' buttons of statusbar in
general settings will only appear when you make any changes.

Also when there are changes, there will be a message shown that will tell
the user that he/she has unsaved changes.

The commit is related to Task ID: 1917637

Co-authored-by: Mohammed Shekha <msh@openerp.com>

closes odoo/odoo#29726
2019-02-04 08:40:20 +00:00
Mohit Ghodasara bbd64c22ab [IMP] various: prevent unlink of automated activity types
Purpose of this merge is to update main addons and set activity types used
for automated activities as master data. This means they cannot be removed.
Indeed those activity types are used in business flow to generate activities
and removing them may break some flows.

This commit is linked to task ID 1907970 and PR #29257.
2019-02-05 11:32:14 +00:00
Mohit Ghodasara 0db0e66e96 [IMP] mail: improve usability of activities
Purpose of the task is to improve the usability of activity types and
activity scheduling.

Another purpose is alto to protect some master data activity types by flagging
them and preventing their deletion.

Containing
 * make the activity type as master data so deletion will be prevented;
 * improve the usability of the activity type;
 * prevent the deletion of activity type which are used for automated activity;
 * change the usability of activity scheduling modal;

This commit is linked to task ID 1907970 and PR #29257.
2019-02-05 11:32:14 +00:00
Darshil Trivedi 7214173f52 [ADD] l10n_ie: Introduce localization for Ireland
closes odoo/odoo#23031
2019-02-05 11:48:28 +00:00
Vandan Shah f757b5eccd [IMP] web: Improve calendar display when no partner is set on event
Task:- 1906798
PR:- #28669
Co-authored By:-  Mohammed Shekha <msh@odoo.com>
2019-02-05 11:45:29 +00:00
Nimesh Jethva 3272d2a384 [IMP] account: Display 'Draft Invoice' instead of false on name_get
name_get() override when payment in draft display the result false.

screenshot : https://drive.google.com/file/d/1dT22ysXmSOJvXMhzhyh_0tVW9z_v3b-s/view?usp=drivesdk

closes odoo/odoo#27537
2019-02-04 08:48:45 +00:00
Nimesh Jethva e12229f1d7 [IMP] account: Track some fields on payment
Purpose
=======

Every change to invoice is indicated in the chatter - the state, the
person, and the time is indicated in the chatter.

This is currently not the case for payment - It should be the
case, as if I were in charge of these things, I would like to know who
did what and when.

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

Add chatter followup on payment to know who
did what and when.

Related Task ID : 1880825
2019-02-04 08:48:36 +00:00
Siddarth Gajjar f3a390cb74 [IMP] generic: replace suds with zeep.
- Added new library zeep for soap request.
- Remove old suds library.

Task ID: 41696 Closes #26934
2019-02-05 11:42:18 +00:00
qsm-odoo b6db6b878c [REF] website, *: remove 'website.context' module
* website_forum, website_gengo, website_mail_channel, website_sale

Retrieving the global context is now the root's job, this will prevent
problems when trying to extend the values the context has.

See upcoming improvements with https://github.com/odoo/odoo/pull/29442

closes odoo/odoo#30816
2019-02-05 11:39:11 +00:00
Christophe Simonis 99499589ea [FIX] website: correct module import
Oversight of previous forward-port
2019-02-05 11:33:07 +01:00
Christophe Simonis ba0fe3437f [FIX] website: skip broken tests
Theses tests does not works with latests changes.
Skip these to allow other changes to be commited.
2019-02-05 10:34:29 +01:00
Christophe Simonis 4400cce820 [MERGE] forward port branch saas-12.1 up to 4524ad06a8 2019-02-04 13:27:22 +01:00
wan ceb0548930 [IMP] account: add chatter in account.journal and account.move
Task 1915154
The chatter will mainly be used for communication / messages
Add the chatter to account.move

    Do not generate message at the record creation
    Do not track any field

closes odoo/odoo#29274
2019-02-01 08:20:23 +00:00
Prakash Prajapati 8a25e58ed2 [FIX] purchase_requisition_stock: onchange and picking type
Issue:
- Create a RFQ for a stockable product
- Try to validate
- A required field "deliver to" (picking_type_id) is not set

Rev [1] moved the stock related part of purchase_requisition to
purchase_requisition_stock.
It implements an onchange on the purchase order setting the
picking_type_id of the one of the requisition. When no requisition is
set, it wiped the default one.

We fix the issue by only using the picking type of the requisition if a
requisition is actually set.

[1] 826f927a1e
Task: 1935077

closes odoo/odoo#30685
2019-02-01 10:36:14 +00:00
Sébastien Theys ff368fdbd5 [IMP] portal,sale: toggle sign button depending on signature state
Before this commit, it was possible for the user to click on the Sign button
even when the signature area was empty, which would lead to an error message.
Now we disable the button when the area is empty.

Related to enterprise PR: https://github.com/odoo/enterprise/pull/3535

PR: #30653
2019-02-01 12:10:13 +00:00
Lucas Lefèvre 20bc2bbab5 [IMP] hr_payroll: add multi contract support
Purpose
=======

We would like to be able to manage multi contracts payslips and contract transitions.

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

General flow:
1/ Benefits are generated based on contracts's calendar.
2/ When validating additionnal benefits, calendar.attendances are created in the contract's calendar
3/ Create one payslip per contract in state [open|pending|close]
4/ For each payslip, generate worked day lines based on the contract's calendar

New Constraints:
1/ An employee cannot have more than one contract at the same time (excluding draft, closed and cancelled contracts).
2/ A leave cannot overlap multiple contracts.
3/ A contract cannot have starting and ending dates such that a leave become in the middle of
   two contacts.

New state for a contract: Incoming. It means it's ready and will be running soon.
An incoming contract automatically becomes 'Running' if the start date is passed (cron)

Number of hours and days are always correct (according to the contract's calendar) on payslips as the
flow starts from the contract's calendar.
However, it is not correct in the Time Off app because it's counted based on the employee's calendar.
The number of days/hours for hr.leaves should be computed according to
the contract at the time of the leave.
e.g. If I currently work full time and I request 2 weeks off next month where I'll be working only
3 days/week and 5hours/day (other contract), It should count 6 days and 30 hours.

- in hr.benefits form view show the contract (below employee field)

TaskID: 1903483

closes odoo/odoo#30181
2019-02-01 12:16:54 +00:00
William Henrotin f5bca867ac [IMP] mrp: lot restriction from the second WO
The user have to enter the final lot number on workorder when he process
a component. The purpose is to register the use of components for
tracability report. However currently the user could create different
final lot during the process. It would result in inconsistencies since
components could be used for lot/SN not produced and a wrong
tracability.

This commit ensure that once a lot/sn is created during a WO, it has to
be used in the following workorders.

closes odoo/odoo#27984
2019-02-01 08:13:25 +00:00
Arnold Moyaux 356175230d [IMP] stock, mrp: hook on ml to reservate
Currently _action_assign will try to add new reservation to existing
move lines. With mrp it could be problematic with the following usecase:
- 2 product A in stock
- Create a MO for 2 final product tracked and consuming 4 products A
- Reserve -> It will create a ml with 2 product A.
- Product -> It will fill the ml with 2 quantity done for first lot
- Add 2 product A in stock (4 in total)
- Reserve -> It will increase the reservation on the existing move line.

It's a problem since the new produce (wizard or wo) will create a new
move line because the existing move line have a lot_produce_id and can't
be used for a different lot/SN anymore.

This commit only increase reservation if the move line has not been used in
order to create a lot.
2019-02-01 08:13:25 +00:00
William Henrotin 24f05151f4 [FIX] mrp: uom management in workorder
Usecase : create a bom in unit with a component tracked by serial and
quantity to produce = 1 unit

Create a manufacturing order with a UoM different that the bom one
(e.g. Production request = 1 dozen)

Launching the produce wizard or a workorder will show to the user
a workorder line with 12 component units to consume. But as the
component is tracked by serial. We would like to get 12 differents
lines of 1 unit. This commit take care of this specific case.
2019-02-01 08:13:25 +00:00
William Henrotin 5ef46664a2 [IMP] mrp: add production lines
To record a production via a manufacturing order, the user can either
use the produce wizard or the workorders views. Those two objects was
technically different but act more or less the same. This commit aims to
merge the similar behaviors in common code

We introduce two new abstract models :
 1. Abstract workorder to share workorders and the produce wizard
 2. Abstract workorder lines to share active_move_line on workorder and
    product_produce_line on the wizard. Those abstract line keep the information
    about the quantities and lot number to put on component move lines and
    finished product move lines

Task : 1891864
2019-02-01 08:13:25 +00:00
qsm-odoo 0abfaeda96 [FIX] website: prevent animation of anchor links with invalid fragment
Also secure the anchor creation to only allow valid names, that is
letters, digits, underscores and hyphens.

task-1913458

closes odoo/odoo#30701
2019-01-31 17:35:07 +00:00
mgh-odoo 43888662ff [FIX] web: unaccent default params fixed
purpose of this commit is to remove default parameter of "casesensitive",
because default parameter is ES6's feature. it's not supported in IE9.

closes odoo/odoo#30751
2019-02-01 06:50:54 +00:00
qsm-odoo e4e1c01f69 [REF] website: merge BodyManager and WebsiteRoot
Following the new editor's merge at https://github.com/odoo/odoo/pull/29775,
'web_editor.BodyManager' stopped being used by the editor and the
related file was moved to website without being renamed or considered.

Hopefully, the editor replaced it by something else so the `BodyManager`
makes no sense on its own anymore. This commit merges its features
with the only other component which still used it: `WebsiteRoot`

See upcoming improvements at https://github.com/odoo/odoo/pull/29442
(related to task-1932066)

closes odoo/odoo#30740
2019-01-31 16:20:35 +00:00
Pierre Paridans de26abf214 [IMP] board: single column layout on mobile
Improve the dashboard app on mobile by :

- Hide the change layout button
- Force one column view layout

Task Id: 1904747
2019-01-31 11:30:54 +00:00
Romain Estievenart 7d1dafa3e2 [IMP] web: improve kanban mobile
Improve the mobile kanban when it's embedded in another view like
the Dashboard app

- Improve swipe: Allow to swipe on empty space
- When it's embedded :
     - The Kanban column height now is fit to the content
     - A empty space is now display if the Kanban column is empty

Task Id: 1904747
2019-01-31 11:30:54 +00:00
Romain Estievenart 635944443c [IMP] web: allow customize tab padding on pivot view
Allow the customization of the pivot header cell's left padding in mobile.

Task Id: 1904747
2019-01-31 11:30:54 +00:00
Martin TrigauxandRaphael Collet ba58888ced [IMP] models: remove orphan translations
Same logic as for the mail.message or ir.attachment, when a record is deleted,
drop the ir.translations linked to it as well.

Fixes odoo/odoo#25105

Co-authored-by: Raphael Collet <rco@odoo.com>

closes odoo/odoo#30721
2019-01-31 10:22:16 +00:00
Vincent Schippefilt 2e57f90bd1 [FIX] web: fixed leak on image fields
During the unit tests, I have noticed that the test window was doing a
lot of work after the test were completed, it was using CPU and using RAM
in jigsaw pattern. Eventually after being left alone for a few hours,
the window would just crash.

This was due to an unlimitted chain of deferred running when an image
field had a load error.

The situation is as such:
1. The image is put in the DOM with an onError handler
2. There is an error, as the image is a dummy text for the tests
3. The onError is called, it clears the image field, then calls _render
4. _render re-adds an image with the same onError handler   <----------
5. The onError is called - again - it clears the image field - again  |
   (wich does nothing this time because the value is the same) -      |
   then calls _render - again                                         |
6. The second time _render is called, go to step 4 --------------------

... In the meantime, the widget has been destroyed by the test,
so it should not do anything anymore.

This fix breaks the loop, as well as bind the onError handled with 'one'
instead of 'on'.

closes odoo/odoo#30716
2019-01-31 09:38:31 +00:00
Deep Patel d989016a26 [FIX] point_of_sale: unbind keydown event when close product screen
closes odoo/odoo#30671
2019-01-31 09:54:06 +00:00
Yenthe666 5ae4941bde [IMP] account,sale{_management}: set name on create elements
For easier xpath

Followup of odoo/odoo#30534

closes odoo/odoo#30711
2019-01-31 08:25:13 +00:00
Thibault Delavallée 0748e13426 [REF] survey: improve existing answer management in invite wizard
Purpose of this merge is to clean the way we manage exiting answer when
inviting partners or emails to participate to a survey.

When wizard finds that some recipients are already linked to answers it
displays a bootstrap warning with the name of duplicate recipients and
display the field allowing to choose between two options

 * resend: send the same token and answer;
 * new: create a new token and answer;

It will be useful notably with certifications support as number of attempts
to succeed is limited. Allowing people to retake certifications should be
made clear to survey managers.

This commit is linked to task ID 1935176 and PR #30689 .
2019-01-31 12:00:52 +00:00
Thibault Delavallée 0e91762c99 [IMP] survey: rename and improve statistics fields
Purpose is to clean a bit those fields. A field holding the number of send
invitations is added as well as a button. It allows to directly jump on
answer linked to an invite which helps dealing with private surveys.

This commit is linked to task ID 1935176 and PR #30689 .
2019-01-31 11:53:44 +00:00
Thibault Delavallée 35df807db8 [FIX] survey: correctly flag answers done with invite
A field exists to differentiate answers done manually through frontend of
survey and answers created through invitation. The field was not correctly
set by the invite wizard. This commit fixes it.

This commit is linked to task ID 1935176 and PR #30689.
2019-01-31 11:53:38 +00:00
qdp-odoo 3ef3aeb640 [FIX] account: Added missing method to save template 2019-01-29 14:18:58 +00:00
Julien (juc) Castiaux e65446fe42 [FIX] mail: Force the writing of the attachment when the user can post
To reproduce:
1) Enable multi-company
2) Create two companies: c1, c2
3) Create two users: bob in c1 and alice in c2
4) Install subscription
5) Remove the ir.rule that forbid users from accessing subscriptions
   made in other companies: "Subscription multi-company"
6) Using u1, create a new subscription in c1
7) Using u2, follow the chatter of the newly created subscription
   allowing the user to post messages/log notes.
8) Using u2, send a message with an attachment. Access Error.

The problem raises only for the **first** attachment. That
attchement is written on the record as the main attachment thus
raises an error if the user doesn't have write access.

There is no problem to add attachment to any following record or
when the user has write access on the model. If the user doesn't
have access to the chatter, he is blocked before accessing the
write thus it is safe to sudo it.

opw-1915606

closes odoo/odoo#30659
2019-01-30 10:46:01 +00:00
Nicolas Martinelli 1dbe4ea0d7 [FIX] web: current date
- Set the OS in a timezone such as the current day is different from the
  day in UTC (e.g. America/Nome before 10:00 AM or Australia/Melbourne
  after 3:00 PM)
- Open any datepicker
- The 'little triangle' indicating the current day is wrongly set (one
  day before or after)

Knowing that Odoo always creates momentjs date and datetime with the
`UTC` flag set to `true`, the `bootstrap-datetimepicker` does something
which seems inconsistent.

First, it retrieves the `viewDate`, and sets it to the beginning of the
month and week in:

https://github.com/odoo/odoo/blob/1c6c504215f3ef09e6336c92c9d350e87599eaa1/addons/web/static/lib/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js#L725

In this part, it is important to note that each `startOf` functions
called sets the hours/minutes/seconds to zero. It means that the
reference time is changed.

Then, it iterates on this newly created date, and determines `today` by
comparing it to `getMoment()` in:

https://github.com/odoo/odoo/blob/1c6c504215f3ef09e6336c92c9d350e87599eaa1/addons/web/static/lib/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js#L748

However, `getMoment()` returns the current date and time, but with the
`UTC` flag set to `false`.

Therefore, we compare a UTC datetime on which the reference time has
been changed to a non-UTC datetime, which fails to give the appropriate
current day.

There are two approaches to solve this. The first possibility is to
change the way Odoo defines momentjs dates and datetimes, maybe by
removing the `UTC` flag at creation. This sounds like a bad idea, since
other widgets or views (such as the calendar or the pivot view) make use
of them. This is likely to introduce a bunch of new issues with TZ in
these views. The second approach is patching the library to fit our use.
Although we usually don't do such a thing, this allows to specifically
solve this use case, and in particular placing the 'small triangle' at
the appropriate date without impacting any other part of the system or
the library. It can be easily performed by comparing the dates and the
months to make it work.

opw-1915251

closes odoo/odoo#30538
2019-01-29 13:26:22 +00:00
sbbaro 7e0603785b [FIX] base.ir_actions_report print ordered pdfs
When printing multiple reports with the "Reload from Attachment" option
selected, the order of the rendered pdfs was not respected. Using an
ordered dictionary instead of a randomized one solves the problem.

opw 1915685

closes odoo/odoo#30690
2019-01-30 09:42:20 +00:00
Moens Alexandre 877fe07f74 [FIX] base: optimize the reading of many2one property fields
back port of commit 9820191d33f773ae21ca405da0e1226b6657ef5b
(made for v11)

project : Performance Issues
task : Geostaff : Success Pack 5 (100h) (opw-1912303)

closes odoo/odoo#29689
2019-01-29 13:12:49 +00:00
Moens Alexandre 917127ff70 [FIX] product: batch process _compute_product_pricelist
back port of commit 961a171341dabf428d5e86753b520481fd194558
(made for v11)

project : Performance Issues
task : Geostaff : Success Pack 5 (100h) (opw-1912303)
2019-01-29 13:12:21 +00:00
Moens Alexandre 26e5d0f219 [FIX]performance issue: _compute_sale_order_count
This commit simplifies the code and improves the performance
of _compute_sale_order_count.

execution time from O(n^2) to pretty close to O(n)

Project : Performance Issues
Task : Geostaff : Success Pack 5 (100h)  (opw-1912303)
2019-01-29 13:08:43 +00:00
qsm-odoo cc4d57ff14 [FIX] website_event: restore country events option
With https://github.com/odoo/odoo/commit/ac8b0fcfc5299b5ea62543b8382cb419fed4868e,
the 'country_events' class was renamed to 'oe_country_events'. This was
done correctly for JS animations and snippets but not for the 'Country
Events' option in the customize menu. This made the option useless.

This commit solves the problem by supporting the two classes (as it
is a stable fix).

closes odoo/odoo#30662
2019-01-29 15:50:07 +00:00
Christophe Simonis cd5c8a02f9 [MERGE] forward port branch 11.0 up to 36d96e0150 2019-01-29 13:17:12 +01:00
Christophe Simonis 36d96e0150 [MERGE] forward port branch saas-15 up to 788684a5dd 2019-01-29 11:57:06 +01:00
Jeremy Kersten d609dbdd11 [FIX] website: make "Edit in backend" always go to website backend
Before this commit, clicking "Edit in backend" from the website could randomly
lead to the backend under another menu or without module, depending on the
other modules that are installed or version com/ent used.

After this commit, it will always open the backend under the specifiec menu
or website menu if not defined.

+ uses existing website dedicated action for product.template in 'Edit backend'

task-1919436
closes #30555

Co-authored by seb@odoo.com

closes odoo/odoo#30657
2019-01-29 10:54:56 +00:00
Jeremy Kersten 09be5b235c [FIX] website: force web.layout inheriting later
Before this commit, if you installed website in community you was not able to
install web_enterprise, because the web.login_layout was replaced (by hinerit)
by website and break the xpath from enterprise login.

Now we apply the Enterprise login xpath before that website replace it.
2019-01-29 10:46:09 +00:00
Jeremy Kersten cbe0dd66af [FIX] website_forum: fix intro msg 2019-01-29 10:45:57 +00:00
Nicolas Martinelli a5edf7ec09 [FIX] mail: user signature
- Install Invoicing
- Multi company Set up with no common contact book
- Create & validate an invoice with user A in company 1
- Change to company 2 with user A
- Connect with user B in company 1
- Send & Print the invoice

An error is raised on the template rendering because user B cannot read
info from user A.

opw-1928676

closes odoo/odoo#30649
2019-01-29 12:22:29 +00:00