Commit Graph
140385 Commits
Author SHA1 Message Date
Thibault Delavallée b3e7fd040b [MOV] mass_mailing: reorganize module according to guidelines
PURPOSE

Mass mailing is currently a bit messy. As SMS will be added as a way to notify
people in mass through SMS let us take this opportunity to somehow clean this
application: organization, light code cleaning, model renaming.

SPECIFICATIONS

Guidelines: re-organize model files and split them according to main
models. Also reorganize views.

Done in this commit

  * split big python file by main models;
  * split views according to python files;
  * move statistics report to /report;
  * merge some exploded view files (assets, snippets, application menus);

LINKS

Task ID 2037906
Preparing task ID 1997464 (SMS addition in mass mailing)
PR #34938
2019-07-17 15:39:06 +00:00
Simon Lejeune 69276607cc [FIX] stock_account: valuation layer description on valuation change
The layer created to handle the valuation and costing change share the
same code but they should not share the same description.

closes odoo/odoo#34952

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-17 14:28:30 +00:00
Thanh Dodeur 60bd0a64a1 [IMP] web: set field_name data on search panel sections
adds field_name data on category and filter lists in the
search panel template so it can be used to identify their field.

this improvement is used in the drag & drop features introduced
in the documents search panel (https://github.com/odoo/enterprise/pull/4805).

Task: #1998014

closes odoo/odoo#34813

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-07-17 13:04:33 +00:00
Aaron Bohy 363c6f1d90 [IMP] web: list: display help in header cell tooltip
Task 2036832

closes odoo/odoo#34939

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-17 10:10:09 +00:00
Arnold Moyaux b311d9ccba [ADD] stock: report forecast quantity
Create a new report in order to see quantity in the past
and in the future. Also display the planned in and out moves
at their schedule date. The view available for this report is
a graph view even if it could be display with other views.

Technically it's an SQL views based on stock.quant and stock.move
Currently the interval for the report is -3 months, +3 months because
the forecast quantity is based on quants - moves during this interval
in order to keep a linear performance that's not growing with the data.

task: 2000948

closes odoo/odoo#34898

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-16 15:20:49 +00:00
Arnold Moyaux dc35b88411 [DEL] stock, mrp: remove report forecast
It will be replaced by an easier report that will
dispaly the cumulative forecast and the planned in/out
moves.
2019-07-16 08:26:54 +00:00
Arnold Moyaux 425d337cbc [IMP] stock: clean useless move view
The move form view from 'stock move' menu item and the form_view_ref
from the picking's operations was different. However we would like the
same kind of information from each side.

This commit remove the view from picking and complete the view from
menu item.
2019-07-16 08:19:45 +00:00
Lucas Lefèvre 50043cc3ad [IMP] lunch: Add multi-company ir.rule
- Add a related on the lunch.supplier to the company id of the linked res.partner
- Add related on the product: to the company id of the linked lunch.supplier
- add multi company Record rules

closes odoo/odoo#34859

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-17 13:17:59 +00:00
Mitali Patel 556f8389b1 [FIX] sale_management: reset the optional product
Purpose of this commit is to reset the optional product
when user change the quotation template

task-2005838

closes odoo/odoo#34048

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-06-12 05:19:40 +00:00
Nikunj Ladava cd76c0b23e [IMP] payment_paypal: remove deprecated fields
task- 34668

closes odoo/odoo#20053

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-17 05:06:47 +00:00
Nikunj Ladava 55051a1dd7 [IMP] payment_paypal: onboarding checkout
Accept payment on Paypal without having a merchant account
The merchant only need an email address to accept payment from Paypal
Paypal will send email to the merchant to create an account with the details
Odoo will send mail to the merchant to fill all the credentials after creating an account

Note: why used rm? - If IPN is disabled in the profile (case for the new user), the default action to call the return_url is a GET. This means that if your return_url is a script, you must set rm = 2 in order to have the IPN variable POSTed to that URL

task- 34668
2019-07-17 05:06:47 +00:00
Martin Trigaux 1866bd1900 [IMP] base: UX improvement of Load Languages
The activation of languages was changed at bd3a553ad9
This commit makes a few changes/fixes

- When executing the toggle_active method do not open the wizard but load
directly the language

- Rename the name of the button in tree view, Download was confusing as implies
the resources are downloaded while it is only loaded
- Remove duplicated help

- Add action button to load the language from the form view (as it the only way
from the form view was using the "Unarchive" action)

- Add label directly next to the field (was making a line return)
- Set the placeholder on the field (no effect on the label)
- Remove groups as the view is already restricted to system users

Follow-up of task id 2026150

closes odoo/odoo#34940

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-17 10:27:25 +00:00
Lucas Lefèvre 2e91d26194 [FIX] project_timesheet_holidays: Allow to create a company
It is currently impossible to create a company.
The reason being that the newly created company is
not yet in context `allowed_company_ids`.

Therefore, every consequent access to a record protected with
a multi company `ir.rule` fails for that company.

Here, the module automatically creates a project in that company
and later read that project to check a constraint.
The read raises an AccessError, hence the company is not created.

On the other hand, a user without project creation access rights
but erp manager could want to create a company. It should work
in that case too, as the project creation is transparent to the
user and the project is archived.

closes odoo/odoo#34920

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-17 10:25:54 +00:00
Aaron Bohy e2893ce386 [REF] web: factorize no content helper
Different templates were defined for graph, pivot and cohort views
for the no content helper. Those templates were similar (only the
message sometimes slighlty changed). This rev. creates one generic
template used by those three views.

closes odoo/odoo#34916

Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
2019-07-17 06:54:49 +00:00
Robot Odoo 00c966b69a [ADD] iot: add iot serial drivers
So far there are no IoT drivers for serial equipment.

This adds a base IoT serial driver as well as a base IoT serial scale driver and drivers for the two previously supported scales. For the moment the scale drivers support both the old routes and the new event and action routes.

Task: 1892412

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

closes odoo/odoo#33800

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-07-17 15:34:26 +02:00
pha-odoo f87a443551 [IMP] pos: use iot scale
Before this commit the continuous reading of the scale
was started directly in `show`.

In order for us to be able to use the scale with IoT drivers
this piece of code needs to be overriden, so it was moved to a separate function.

Task: 1892412
2019-07-17 08:02:13 +02:00
pha-odoo c4aade63fd [IMP] iot: add iot serial drivers
This commit adds a base serial and a base serial scale iot drivers,
as well as drivers extending them for the two previously supported scales
(ADAM EQUIPMENT AZEXTRA and TOLEDO 8217).

Since just adding the new drivers creates a race condition
between the old drivers and the new, the old drivers need to be removed.

The IoT scale drivers need to be backward compatible and compatible with the community version,
so client using an IoT box with those versions can still connect a scale to the PoS.

Task: 1892412
2019-07-17 08:02:13 +02:00
David Beguin a0fc2210e6 [FIX] mail : enable to start livechat conversation
The public user doesn't have an email address.
To start a livechat conversation, the email of the user that start the
conversation is used. As the conversation was started in sudo,
the system user's email address was used.

But, since changes with sudo() and with_users(),
the public user is not able to start a livechat conversation
as the system email is not used anymore in this case as sudo is not
changing the user but only skip the user's access right.

To start a livechat conversation, and to post a message, at least
email_from must be filled in.
Anonymous name is used to fill in email_from to bypass the checks
and to build the author given back the thread window.
If anonymous name is empty, we fallback on the company's catchall email
from the mail.channel create user.

Pre-required for task ID: 2028059
Fix Task : 2037048
PR #34918

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-16 15:23:36 +00:00
Simon Lejeune ee50b4a20c [REF] stock_landed_costs: enabled for AVCO
mostly thanks to rev 168f4d75ef

task-1985422

closes odoo/odoo#34795

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-16 14:19:41 +00:00
Thomas Binsfeld d7b0e4b5b7 [IMP] point_of_sale: add hook for load_new_partners domain
To be able to change the domain

closes odoo/odoo#32982

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 13:26:45 +00:00
Martin Trigaux 5d57e1862f [MERGE] Forward port of saas-12.4 to master up to beba36416f
closes odoo/odoo#34924

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 15:45:24 +00:00
RomainLibert 02c48e71f0 [IMP] hr_timesheet: Improve general module UX (back2basics)
TaskID: 2025197

closes odoo/odoo#34855

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-16 12:03:42 +00:00
Simon Lejeune 22221a2b57 [REF] server: better warnings when using --test-file
We add two warnings to make the --test-file argument more user friendly:
- one when the test file does not exist
example:
./odoo-bin -d master --test-file ./addonss/stock/tests/test_quant.py
before:
INFO master odoo.service.server: loading test file ./addonss/stock/tests/test_quant.py
after:
WARNING master odoo.service.server: test file ./addonss/stock/tests/test_quant.py cannot be found
- one when the test file is not a python file

In both cases, nothing was being tested but the server did not say why.

closes odoo/odoo#34808

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-07-12 07:14:38 +00:00
Kevin Baptiste 50163143a9 [IMP] lunch: Improve the general UX (back2basics)
- Reorganize configure your order screen
- Alert users through chat: Alerts can now be configured to
send a chat message to the employees.
- Replace toppings by extras

closes odoo/odoo#34470

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-16 11:44:35 +00:00
Victor Feyens 8f137f66bc [IMP] purchase: responsiveness (+mobile)
> support kanban view for order lines in puchase form view.

closes odoo/odoo#34737

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-16 08:38:30 +00:00
Ravi Gadhia 561829849f [IMP] purchase: add section and note on order line 2019-07-16 08:18:55 +00:00
mgh-odoo 6b7d9901eb [IMP] sale_coupon: add quick search to coupon programs
- after this commit, a user can search for the coupon by name from
the search panel.
- some typo fixed

task-1972686

closes odoo/odoo#34372

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-16 07:45:15 +00:00
RomainLibert f732984da2 [FIX] various: fix typos
In https://github.com/odoo/odoo/commit/8514ef827e1fcc2224aa0f4e6c2849819005c27d
noCreate should have been spelled as no_create to work this commit fixes
that

closes odoo/odoo#34897

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-07-16 07:55:57 +00:00
Sébastien Theys 87f2004902 [IMP] product: optimize create_variant_ids by doing batches
Perf for the creation
=====================

The biggest impact of this change is when each template has only very few
variants to generate and there are a lot of such templates.
And when few templates generate a lot of variants this is potentially just a bit
better than before, and not definitely not worse.

The opposite change was done in commit f8dad1bb4b
due to an issue with unlink but since the unlink is changed to use dichotomy now
we have the best of both solutions.

For example when creating 10000 products, few with a lot of variants (max 1000)
and many with few variants (or only one), the time it takes goes down from at
least 10min (the attempt was canceled before the end) to only 25s.

Perf for the unlink
===================

For the following test case:

- create a template
- give it 3 attributes, 10 values each
- -> that generates 1000 variants
- add the first variant to an order to test it
- not happy with the config, remove one of the attributes from the template
- -> that removes the 1000 variants

This is slow because of the `savepoint` used to archive if `unlink` fails.

With dichotomy it takes 14s.
With a loop (one by one) it takes 5min.

Part of task-1918881

closes odoo/odoo#34650

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-15 16:28:35 +00:00
RomainLibert 8514ef827e [IMP] various: Make some small tree views editable
Purpose
=======

Some formviews are useless since there are so few relevant fields https://nimb.ws/1EdMV7

For instance, to create a new lost reason the user is forced to:
1. Hit create
2. Type in the name of the record
3. Hit save
4. Go back to the treeview
While he could simply type them away in an editable treeview.

The goal of this task is to allow for creation/edition of records in such models
directly from the treeview.

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

Modify tree views from a given list of models for which the
treeview has to be made editable bottom.

If not specified otherwise, the content treeview should stay the same.

If a field is readonly/required/etc. in the formview, it should be in the
editable treeview as well.

Relabeling has to be done of the field itself, not in the view.

TaskID: 2026126

closes odoo/odoo#34577

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-15 12:47:03 +00:00
Yannick Tivisse 14067543d0 [IMP] uom: Remove parentheses on uom names
Purpose
=======

Parentheses in the label of units of measure sometimes make
reading needlessly uncomfortable.

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

Remove parentheses in the name of every standard uom.uom and hardcoded
occurence on views/field names.

TaskID: 2030444

closes odoo/odoo#34492

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-15 12:57:34 +00:00
Ghuen Lee 0ab2a7b373 [IMP] account: allow extension of SectionAndNoteListRenderer
Explicitely return the extension of the listview to allow to modify it
in other modules

closes odoo/odoo#34672

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 10:22:22 +00:00
Shreya Modi 783a9b1921 [FIX] lunch: Allow to create and import products on kanban view
-In Kanban view of products, it should allow to create a
product or import it

task-2032878

closes odoo/odoo#34660

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-15 10:44:37 +00:00
Nicolas Seinlet 99b22078de [IMP] point_of_sale: pos order report performance
This inner join permit to have filters on orders to be executed earlier in the query plan
In a multi-company environment with millions of pos lines, the difference is about 10% faster
As you cannot have a line without order, this doesn't introduce reggression.

closes odoo/odoo#34849

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-15 08:01:12 +00:00
Lucas Lefèvre afa4c09129 [FIX] sale: Don't compare id and NewId
On runbot, edit SO131 and change the company
=> traceback

An onchange is triggered (=> self.id is a NewId).
But while recomputing the quantity delivered, a
read_group is performed which gives real ids (int).

The ids are then used to retrieve some so_lines in a
dict where each key is an id (but actually NewId
in onchange) of self.
=> the keys are NewIds but try to get the value with an (int) id
=> KeyError

closes odoo/odoo#34818

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-12 09:05:54 +00:00
Thibault Delavallée 20fb024a33 [REF] website_crm: include website_crm_phone_validation
Website crm phone validation does not hold code that cannot be located in
website_crm as dependencies are now the same. Let us merge those two
modules !

Linked to task 2033777

closes odoo/odoo#34744

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-15 08:29:50 +00:00
Pierre Masereel 35b600cd37 [IMP] point_of_sale: sessions not depending on user
As multiple users will be able to login in the main session, we
shouldn't use the user_id of a session to find the correct session, but
we are only depending on the pos_config

closes odoo/odoo#34623

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-15 08:20:18 +00:00
Pierre Masereel 41e1c3ac57 [REF] point_of_sale: refund remove wrong session_id 2019-07-15 08:20:18 +00:00
Pierre Masereel 299416637c [IMP] point_of_sale: set values depending on session
Before, when a pos order was created, some of its values were were
completed through the default mechanism that was looking for a session
opened by the current user, which could lead to wrong values when with
recovery session. Since in near future we'll allow one user to open
multiple sessions, this behavior won't work anymore, as you could get
the config od another session than the one you are working on.

We also removed the '_default_session' on field session_id, as the
method 'create_from_ui' which creates the orders from the frontend
allways set the session_id when it creates a new order.

TASK-ID: 2032769
2019-07-15 08:20:18 +00:00
Parth Choksi abcc8a58f0 [IMP] stock: added PDF version in the report of Barcodes
In Inventory, we have an option to print the report of Barcode in ZPL but we do
not have option to print the same in PDF.

After this commit, there will be a PDF version of the report of Barcodes
available just similar to the report in ZPL.

task-1970506

closes odoo/odoo#32935

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-12 05:35:39 +00:00
Robot Odoo cc62447a44 [MERGE] api.py: remove calls to @api.multi and deprecate its explicit usage
depends on https://github.com/odoo/odoo/pull/34556

closes odoo/odoo#34775

Signed-off-by: Adrian Torres <Elkasitu@users.noreply.github.com>
2019-07-17 14:17:57 +02:00
Adrian Torres a8767716cf [REM] core: remove @api.multi
kw_multi is the default API, so the decorator is no longer necessary and
hasn't been for a long time
2019-07-17 14:13:12 +02:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Lucas Lefèvre f6fdde96bd [IMP] hr_*: Improve employee presence state
Purpose
=======
There are currently multiple ways to determine if an employee is presence
or absent:
- login state (user status on chat)
- checkin/checkout from the Attendance app
- leave
- hr_presence (email, ip)
Those states are displayed in several different places and can be inconsitent.
e.g. Logged in -> green in the chat
Not checked in -> red on the employee kanban view.

The multiple ways to determine employee presence described above
should be aggregated together to have a better consistency.

Specification
=============
There are 3 presence states (previously defined in module `hr_presence`),
namely `present`, `absent`, `to_define`. They are now defined as soon as
`hr` module is installed.

The state computation can have several behaviors according to which apps
are installed:

1. `hr` is installed
Check employee presence based on login by default (only for employees with
a user).
Kanban state (private and public): should be green when logged in, red when logged out and
orange when the user is away.
Private employee form: Display a stat button "Connected" on the form view
when the user is logged in or "Last Activity xx/xx/xxx" otherwise.

2. `hr_attendance` is installed:
when the user is logged out, the state
is determined from the checked in/out state. But when the user is logged in,
consider the user as present (even if he checked out).
Kanban state: green for checked in, red for checked out
Private form view: attendance stat button.

3. `hr_holidays` is installed:
Has the highest priority if the employee is on leave.
Kanban state: red if employee is on leave.
Private form view: stat button "Absent Until xx/xx/xxxx" if employee
is on leave.

4. `hr_presence` is installed:
Two additionnal presence checking option: emails sent and IP address connected.
Once a user sent an email or the IP address was connected, he is considered
present for the entire day.

There should be at most one stat button on the employee form view, with the
relevent information.

Task id: 2024482

closes odoo/odoo#34933

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-17 09:11:18 +00:00
Lucas Lefèvre 008634730a [IMP] hr_holidays: Clean leave stat button
1/ Change stat button landing page
----------------------------------
Currently when clicking on the leave stat button
of an employee, the landing page is the leave dashbord of the current
user.

It's more usefull for HR people to land on the reporting
view of the employee.

2/ Remove stat button from public employee
------------------------------------------
It's useless for regular employees to know how
many remaining leave others have.
Hence the stat button is removed from the public
employee form view.
2019-07-17 07:33:11 +00:00
Lucas Lefèvre 0954ead4a6 [FIX] hr_attendance: Allow Marc Demo to checkout
As Marc Demo, at the begining of the month, through
the client action, you can checkin but not checkout.

There is one limitation in the way the attendance state is computed:
It uses the attendance with the most recent checkin date.
Therefore, if an attendance is created in the future, it's the later
attendance which is taken into account, not the current attendance.

Steps to reproduce the problem:

1. Create an attendance in the future with both start and end
date set.

2. Through the client action: checkin

=> the client action stays on the checkin screen because you are
considered as checkout. Hence you cannot checkout.

It's difficult to change the way the state is computed, especially
having the right triggers.

Adding a constraint to avoid attendance in the future is probably a
bad idea. It could unintentionaly fail if the user's time is off by
a few minutes on his computer.

On the other hand, this situation should rarely happen (only when manually
creating an attendance, which has little functional sense).

Solution: Fix demo data to avoid attendances in the future.

Tests needed to be adapted because they used demo data. They no longer
use demo data.
2019-07-17 07:33:11 +00:00
Robot Odoo 1b3db79273 [IMP] gamification, survey : auto create challenge on certification survey badge
This PR allow gaining a badge at the end of a certification survey if succeeded.
The badge can be configured on the survey if the certification mode is activated.

The badge is linked directly to the survey and not the challenge,
because it makes more sense to configure directly the reward on the survey and
not the way to gain this reward. As the way is always the same.
Only one badge can be set on the certification survey.
Only the name, description, image and badge level can be configured.
The rest of badge configuration is automatically set to correspond to the use case.
When a badge is configured on a certification survey, the needed challange, goal
and challenge line are autogenerated.

The badge is available on the user's profile page if he gained it.

Note : To avoid having to create a bridge module only to display the
certification badge on the user's profile page, the default website_published value
of the certification badge is defined directly in the survey module even if
survey does not depend of website. This attribute will be ignored until website
module is installed.

Task ID : 1935136

closes odoo/odoo#31486

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-17 12:09:17 +02:00
asa-odoo c27169f0a2 [FIX] point_of_sale,stock: Change demo data uom
delivery: fix test data

closes odoo/odoo#34934

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-17 06:49:21 +00:00
Damien Bouvy d629f90eb5 [IMP] sale_management: no client reload when adding optional product
Purpose
=======

Avoid a complete reload of the web client when adding a optional
product, which loses searches, breadcrumb, etc.

This is achieved by adding a non-stored 'is_present' computed field
which is computed depending on the presence of a SO line linked to the
option line - that way its is dynamically adapted when the option is
added to the SO. Since we wanted a clear feedback when the option was
added to the quote, green colouring and the disappearance of the 'add
to quote' button have been added.

Note that this field *cannot* be stored - since the line_id field on the
option bypasses the ORM (`set null` for the on_delete attribute), it
would not recompute properly upon deletion of the linked SO line.

Task#1950410

closes odoo/odoo#34929

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-17 05:12:39 +00:00
Kevin Baptiste 81a2ad4e05 [IMP] hr_recruitment: Improve general usability (back2basics)
TaskID: 2033500

closes odoo/odoo#34858

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-17 07:02:01 +00:00