Commit Graph
127612 Commits
Author SHA1 Message Date
RomainLibert 939f8e0534 [IMP] hr_payroll: add legal information to payslip report
This commit adds two fields:
	- compute_date on payslip (set once computed)
	- registration_number on employee (used to identify the
	  employee)

These fields are displayed in the payslip_report
It also adds the worked_days to the same report

These fields are a legal obligation in some countries (like Belgium)
2018-12-18 15:03:27 +00:00
RomainLibert d5fd84b89a [IMP] hr: add onboarding/offboarding activity plannings
Purpose
=======

Give the possibility to elaborate plans through Odoo. For instance, in HR,
you could create an onboarding plan when a employee is created. Someone manages
laptop and other equipment, someone check hr stuff, ... This feature is generic
but in a first time we will apply it only on the hr module.

Ease HR process in a company by creating plans: a plan is an assembly of Next
Activities that will be launched together whenever you need it.

Example of plan for an employee onboarding:

Activity: Prepare materials
Responsible: Alain
Deadline: At the contract signature

Activity: Manage Cars
Responsible: Cécile
Deadline: at the contract signature (both signature)

Activity: Plan Training
Responsible: Caroline
Deadline: After signature

Activity: Training
Responsible: Employee
Deadline: 1 week after the employement date

Specifications
==============

On HR Configuration: Add a menu "Activity Plans"

Activity plan object:
 - Name
 - Model (debug mode) (hr by default)
 - Activity Template o2m
    - Activity Type (only the one related to hr)
    - Deadline (come from Activity Type)
    - Responsible \/
        0  Coach
        0  Manager
        0  Other
        [Responsible_name] \/  (coach, manager or manually set if other)

Add datas, 2 plans:

Onboarding
    - Name: Onboarding
    - Plan lines:
        Activity: Setup IT Materials
        Responsible: [a user] (manager)
        Deadline: At the contract signature

        Activity: Plan Training
        Responsible: [manager]
        Deadline: After signature

        Activity: Training
        Responsible: [Employee]
        Deadline: 1 week after the employement date

Offboarding
    - Name: Onboarding
    - Plan lines:
        Activity: Compute Out Delais
        Responsible: [a user] (manager)
        Deadline: today

        Activity: Take Back HR Materials
        Responsible: [manager]
        Deadline: today

        Activity: Manage Car
        Responsible: [manager]
        Deadline: today

When to trigger it ?

HR specific use case:

1/ On employee, from the employee chatter:
when you create an employee, Odoobot will log a note with the following message:
"Congratulations ! May i recommand you to setup an onboarding plan?", with a link
create a plan from it.

2/ Add a button 'launch plan' to open a wizard to select the plan

3/ When archive an employee
Open a wizard with:
    - Reason (selection)
    - Action plan (m2o not required)

Error if employee not linked to a user.

Task : 1912681

closes odoo/odoo#29151
2018-12-18 11:20:54 +00:00
Olivier Colson e230050562 [IMP] account: remove useless payment term option
'after_invoice_month' and 'day_following_month' options did the same thing.

closes odoo/odoo#29603
2018-12-18 11:06:57 +00:00
jem-odoo c33ac778bd [IMP] project_timesheet_holidays: change test class
We try to define common classes in test with helpers to
set testing data. Here, we had a test extended a class
with test methods, making those tests executed twice:
when hr_timesheet was installed, and on project_timesheet_holidays
installation.
This is not very stable, as some behavior might change when
other are installed.

closes odoo/odoo#29538
2018-12-13 14:46:20 +00:00
Robot Odoo 1cb506c418 [IMP] account: non deductible taxes to inventory
Non deductible taxes (ones without an account set), increase the target
account of the product.

In case of a inventory operation, this means the inventory account.

To reflect this stock valuation wise, we need to calculate this incremented
values and rely on it during the inventory move price calculation.

This commit does exactly that.

**Description of the issue/feature this PR addresses:**
- Inventory value and accounting value diverge on taxes which are summoned upon the target account
- This is due to a inventory valuation based on the subtotal amount
- Meanwhile balance accounts are charged with subtotal + value of taxes without accounts

**Current behavior before PR:**
- Inventory valuation and accounting valuation diverege
- Consecutive accounting moves originated by stock moves do not reflect the accounting value at which the first move was charged (eg. by an invoice).
- There is always an "inexplicable" price difference when working with taxes that don't have an account set (cost increasing taxes)

**Desired behavior after PR is merged:**
- The stock move will take exactly the same valuation as has been accrued on the taxed accounting move.
- Balances do not diverge
- No "mysterious" price differences appear.

**Note:** Please do not close, even if not immediately accepted (`wishlist` tag). This PR is meant to be carried along and actively maintained, until this semantic will be completed this way or another.

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

@xoe-labs

closes odoo/odoo#26367
2018-12-13 16:50:22 +01:00
Thibault Delavallée e226ca4460 [IMP] test_mail: update counters to current runbots state
Some counters are a bit higher than real counters; test_mail help counters
are not up to date in some cases.

closes odoo/odoo#29518
2018-12-13 13:33:09 +00:00
Robot Odoo ff0c71f373 [MERGE][REF] mail: clean access right check on activities
This merge improves code of access rights checks when creating or updating
activities. Several points triggers this commit

 * we would like to use _filter_access_rules and override it on activities
   model in order to be more standard;
 * we would like to get rid of sudo used in various CRUD overrides as using
   standard ORM method allows to correctly use current user;
 * we would like to get rid of create_user_id field once we can keep the
   current user as create_uid;

Access rights are a bit updated. They are now the following

 * you can create activities for documents like posting messages (using
   _mail_post_access attribute; if not defined, write access on document
   is required);
 * you can read activities for documents you can read;
 * you can write and unlink activities either following the defined access
   rule (created OR assigned), and otherwise like posting messages (
   using _mail_post_access attribute; if not defined, write access on
   document is required);

In this merge we also hide edit / mark as done / cancel buttons for
activities the current user cannot modify.

Finally create_user_id field related to activities is replaced by create_uid
everywhere.

This commit is linked to task ID 1856417.

closes odoo/odoo#27619
2018-12-12 18:35:02 +01:00
Thibault Delavallée abc212f59a [REF] mail: remove create_user_id field on activity
As activities are created using the current user there is no need anymore to
have another field to store the activity creator. We can therefore remove
create_user_id and replace its use by the magic create_uid field.

This commit is linked to task ID 1856417 and PR #27619.
2018-12-12 12:45:24 +00:00
Sébastien TheysandThibault Delavallée b9c8ba83e6 [IMP] mail: clean activities access rights
This commit improves code of access rights checks when creating or updating
activities. Several points triggers this commit

 * we would like to use _filter_access_rules and override it on activities
   model in order to be more standard;
 * we would like to get rid of sudo used in various CRUD overrides as using
   standard ORM method allows to correctly use current user;
 * we would like to get rid of create_user_id field once we can keep the
   current user as create_uid;

Access rights are a bit updated. They are now the following

 * you can create activities for documents like posting messages (using
   _mail_post_access attribute; if not defined, write access on document
   is required);
 * you can read activities for documents you can read;
 * you can write and unlink activities either following the defined access
   rule (created OR assigned), and otherwise like posting messages (
   using _mail_post_access attribute; if not defined, write access on
   document is required);

In this commit we also hide edit / mark as done / cancel buttons for
activities the current user cannot modify.

This commit is linked to task ID 1856417 and PR #27619.

Co-Authored-By: Sébastien Theys <seb@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2018-12-12 12:44:03 +00:00
jem-odoo 13eb9b9c5b [IMP] crm: filters for activity reporting
This commit improves the CRM reporting by:
- adding new field on the report model
- providing new predefined filters for users
- renaming labels to be more precise
- reorganizing filter and group by
- remove wrong measure in report (probability and days
to close), as they were not correct when multiple
activity on a lead.

Main purpose is to ease finding usefull KPI for the
user, and make the activity reporting a bit less
confusing and limited.
It also now include all user messages (discussion
subtype) and note from activity (when marking activity
as done) in the reporting, so we can have a complete
analysis of action taken on the leads.

Task-1862209

closes odoo/odoo#27767
2018-12-12 11:01:51 +00:00
Xavier Morel 43e062fabf [FIX] *: JS doc/docstring errors & warnings
closes odoo/odoo#29439
2018-12-11 15:24:09 +00:00
Tejas Shahu 448ba01ae9 [IMP] stock, sale_stock: label & tooltip clarification
Rename shipping policy in the UI. Also adapt the stock picking
state's tooltip in order to explain the reservation process
according to shipping policy

closes odoo/odoo#24039
2018-12-11 16:09:55 +00:00
Tejas Shahu c1a5221ba2 [IMP] product: Dyanamic d.p. on Volume field
Decimal precision for volume on products is always set to 2.
Some users that work on more precise volume would like to increase it.
In order to do it without customisation we add another system parameter
for Volume.
2018-12-11 16:09:55 +00:00
Tejas Shahu 2590cf2e6d [IMP] mrp: Produce wizard save and produce another
When a user produces multiple finished products with SN/lots, he has to
save the wizard go back to the production order and click again on produce
button for the second SN/lot. It could be annoying with a huge number of
SN/lots to encode.

This commit adds a 'Continue' button that saves the wizard and directly
opens a new with the new lot/SN.
2018-12-11 16:09:55 +00:00
Tejas Shahu 38b1debece [IMP] maintenance: Duration tooltip improvement
The view on maintenance show the duration with the hours as
UoM. However the tooltip explains that the duration is set
as minutes and second. This commit modify the tooltip in
order to be coherent with the view.
2018-12-11 16:04:35 +00:00
Robot Odoo b57f4411b8 [MERGE] mass_mailing: improve click / link demo data
Purpose of this merge is to ease first steps with mass mailing application by
improving demo data about links and clicks. Demo data now call convert links
and add click in order to generate statistics.

Small improvements are also done on mass mailing views, adding responsible
field and grouping by default in kanban.

This merge is linked to task ID 1907994 and closes PR #28533.
2018-12-11 14:44:49 +01:00
Thibault Delavallée 3200402afa [IMP] mass_mailing: improve demo data
Purpose of this commit is to improve a bit demo data in mass mailing. This
includes notably

 * having real links and UTMs generation for them calling manually
   convert_link in demo data;
 * having real statistics about clicks by calling add_click in demo data;

It will help having demo data feeling like a real mass mailing has been
sent.

This commit is linked to task ID 1907994 and PR #28533.
2018-12-11 12:52:13 +00:00
Thibault Delavallée d3464d299f [FIX] odoo: effectively allow to use 'use' in value xml tag
Purpose is to allow to use the 'use' tag allowed by _eval_xml (see convert.py
for more details). It allows to read a specific field instead of id when using
a search tag in xml. Feature is already supported; this commit just enables
it in order to use it in demo data notably.

This commit is linked to task ID 1907994 and PR #28533.
2018-12-11 12:51:41 +00:00
Thibault Delavallée 284ce064f9 [IMP] mass_mailing: group mailings by state by default
It eases daily use of mass mailings to have them ordered by state by default.

This commit is linked to task ID 1907994 and PR #28533.
2018-12-11 12:51:38 +00:00
Thibault Delavallée 80387458ba [IMP] mass_mailing: add responsible in mailing view
Otherwise it is not possible to change it in order to re-assign the mailing.
Also update the field label in order to better match its intended use.

This commit is linked to task ID 1907994 and PR #28533.
2018-12-11 12:51:35 +00:00
Christophe Monniez ab376d60cb [FIX] web: adapt clickeverywhere test to the controlpanel refactor
Since 4cd379cf6e the ControlPanel is now a child of the viewController.
This breaks the clickEveryWhere test.

With this commit, the view_controller selector is adapted in the clickEverywhere
test.

cheery-pick of 5e92adb39c

closes odoo/odoo#29396
2018-12-10 15:59:07 +00:00
Thibault Delavallée d3357836bc [FIX] survey: fix test url redirection
closes odoo/odoo#29382
2018-12-10 10:33:18 +00:00
Xavier Morel 66f0e26f6f [CHG] *: make binary fields default to attachment=True
Check that it makes custom binary fields into attachment as that's the
main reason for the change: when users create binary fields via Studio,
they're necessarily db-stored (as the interface doesn't allow altering
the attachment attribute and it's unclear how we'd handle users
switching it on/off every time), which significantly bloats their
database (and burns storage & backup space), especially as the primary
use case for binary fields is adding images and documents to records.

* check that binary fields are properly created as attachment=True
* add attachment=False on fields where that seems relevant (most but not
  all of the fields previously using the default)
* remove occurrences of attachment=True

closes odoo/odoo#29308
2018-12-07 13:37:34 +00:00
David Arnold b6a34384a4 [IMP] add valuation test 2018-12-03 15:16:32 +00:00
David Arnold 0459e9b1c5 [IMP] add unit test 2018-12-03 15:16:32 +00:00
David Arnold 3858fb8498 [IMP] account: non deductible taxes to inventory
Non deductible taxes (ones without an account set), increase the target
account of the product.

In case of a inventory operation, this means the inventory account.

To reflect this stock valuation wise, we need to calculate this incremented
values and rely on it during the inventory move price calculation.

This commit does exactly that.
2018-12-03 15:16:32 +00:00
Lucas Perais (lpe) 40b4584b00 [FIX] *: boolean in domains should have value True or False
Because the JS cannot handle 1 or 0 being equivalent to true or false, the views should comply
Issues specifically arise in the kanban view when, instead of reloading every record with python,
the JS actually computes which record should be displayed by reinterpreting the domain

From a user point of view, on a fresh db with CRM installed, go to the app kanban view
Click on the contextual menu of the CRM kanban label, click uninstall

The modal opens, but click cancel. The kanban label of the kanban view has disappeared

This is due to commit 33ba61bfdb, which prevents reloading all the view
for performance purposes

This commit prevents the label from disappearing

OPW 1903534

closes odoo/odoo#28484
2018-11-13 10:09:03 +00:00
Sebastien LANGE 0a6a1c149d [FIX] stock: readonly on show details operations
commit c6b0d36622 introduced a wrong
domain. The readonly should be added if the show_operations is false
OR state is done AND is_locked is true.

close #28595
2018-11-13 09:00:42 +00:00
Duc Dao 46b296dc4f [FIX] Update required version of num2words to have more languages
closes odoo/odoo#25982
2018-11-13 02:22:39 +00:00
Lucas Perais (lpe) 3a0f9da0eb [FIX] web: load SubViews without previous' view _view_ref context keys
On a form view (of model A), define a many2one (model B) with a [form|tree]_view_ref context key
In that view, have a x2m field (model C) with a different [form|tree]_view_ref context key

Before this commit, the second load_views (i.e. on the model C) crashed because
the wrong context key was sent to the server, which returned the view to which the _view_ref points
i.e. the view of the model B

After this commit, we clean the context of subviews loading, because those keys are only useful for the python
and one shot. Hence, there is no crash

OPW 1903780

closes odoo/odoo#28260
2018-11-13 09:02:24 +00:00
Humberto Arocha 09fde26854 [FIX] account: Calling oldname cash_basis_account instead of new field
closes odoo/odoo#28594
2018-11-12 20:16:10 +00:00
Robot Odoo 5f8d3c61be [MERGE][FIX] mail: preview not linked to any document
This fixes two issues relating to previews in the systray messaging menu
that are not linked to any document:

1. Clicking on such preview now redirects to Inbox

There was a traceback, because it was attempting to open a document.

2. Marking a read one of those previews now only marks this preview

It was marking all previews not linked to a document as read.

Task-ID 1891350
Task-ID 1907159

closes odoo/odoo#28462
2018-11-14 08:13:29 +01:00
Goffin Simon 8efa9e5fe9 [FIX] website_sale: Impossible to modify text in "shipping" area on e-commerce
Inspired from this commit: 90219a7e0a

It's not possible to modify the shipping area description on a product in
the e-commorce.

opw:1908308

closes odoo/odoo#28624
2018-11-13 12:43:46 +00:00
Vincent Schippefilt fe7fd9c0d7 [FIX] web: fix qweb test that fails on windows
When the qunit tests runs they are expecting the new line to be the character 10,
but in windows the new line is 10+13.
The test has been updated to ignore the character 13.

closes odoo/odoo#28599
2018-11-13 08:14:07 +00:00
Antoine Prieels (ANP) 8000638ade [IMP] iap: Add full div to Web Settings Dashboard
The IAP link in Web Settings Dashboard used to be a simple text link in DashboardApps, now we've created a full div

closes odoo/odoo#28566
2018-11-12 16:15:49 +00:00
Robot Odoo ddf2243d6e [IMP] stock, mrp, repair: locations per company
Each company should have their own inventory loss, production, scrap and transit locations in order to apply specific accounting configurations.

TASK 1882269

closes odoo/odoo#28508
2018-11-15 11:21:12 +01:00
qmo-odoo 7f0ca92bf6 [IMP] crm,hr,event: Allows linking in pivot views
Allows users to click on pivot cells and be redirected
to the corresponding list view

Task: #1895410
Closes: #28095
2018-11-14 13:51:44 +00:00
Gert Pellin 817441b091 [IMP] point_of_sale: remove barcode scanner bool
Remove the barcode_scanner Boolean and always load the default nomenclature if
no other is defined in pos.config.

Because barcode scanners are seen as keyboard by the computer, they always work
in the point of sale. Because of this some clients begin using them without
activating the nomenclature in pos.config. Barcodes get only recognized if
search-fields are selected this way, resulting in clients complaining about the
workflow.

Enabling the default Nomenclature by default will have almost no effect on the
loading time of the point of sale and has no influence on the work flow if not
using a scanner.

closes odoo/odoo#28537
2018-11-14 15:57:29 +00:00
Arnold Moyaux b6ba6038ad [IMP] stock: archive warehouse
Archiving a warehouse didn't archive its related locations, routes and
rules.

So we now archive the related objects and add some constraints to avoid
having an inconsistent state in stock with archived warehouse.

TASK-ID: 30659

closes odoo/odoo#26555
2018-11-14 12:23:33 +00:00
eco-odoo 116d45633b [ADD] account_analytic_default_hr_expense: default analytic account in hr.expense
When a product is selected for an expense, an analytic account (and analytic tags) can now be automatically selected based on the settings.

closes odoo/odoo#28673
2018-11-14 12:39:29 +00:00
Pierre Masereel b046f3ff6d [IMP] stock: transit location for each company
We have refactored the way transit locations are created to work as the
other company specific locations.

TASK-ID: 1882269
2018-11-14 10:52:03 +00:00
Pierre Masereel 46c2ac2fc9 [IMP] stock: scrap location for each company
Each company should have its own scrap location to allow specific
account on it.

TASK-ID: 1882269
2018-11-14 10:52:03 +00:00
Pierre Masereel ee1ea10c8c [IMP] stock, mrp, repair: production location for each company
Each company should have its own production location to allow specific
account on it.

TASK-ID: 1882269
2018-11-14 10:52:03 +00:00
Pierre Masereel 5df621f665 [REF] stock: missing warehouse creation
We move the code from the 'post_init_hook' into a function tag, to be
consistent with the way we populate missing data when stock module is
installed.

TASK-ID: 1882269
2018-11-14 10:52:03 +00:00
Pierre Masereel 6b95bb6a61 [IMP] stock: inventory loss location for each company
Each company should have its own inventory location to allow specific
account on it.

TASK-ID: 1882269
2018-11-14 10:52:03 +00:00
qdp-odoo 3c36745672 [IMP] l10n_ch: adds a res.config.setting field for config parameter
commit 68dafa0620 introduced a solution to hide the Swiss QR code by default, by conditionning its display on the existence of an ir.config.parameter that one could manually add.
This commits creates the ir.config.parameter and relates it with a field in the accounting settings for more convenience for when we'd need to enable it

closes odoo/odoo#28654
2018-11-14 08:38:42 +00:00
Aaron Bohy ce611ae439 [FIX] web: wrong tests
This commit fixes two tests that became meaningless after tweaks
in production code:

 - form_tests: use two char fields, as integer fields can't be
   unset since rev. c62a4edcb
 - pivot_tests: the button is disabled since rev. 4f4f111, but
   simulating a click with jQuery bypasses the disabled attribute

This commit also removes unecessary overrides of mockRPC. Those
overrides existed  because the attachments part of the sidebar
used to make a search_read RPC, but this has been removed at rev.
1dbb555.

closes odoo/odoo#28651
2018-11-13 20:00:17 +00:00
David Arnold d1fd939bdb [IMP] hr_payroll: Manage duplicated 'code' on input/worked_days lines
Purpose
=======

Before this commit, inputs (workdays or inputs) could not manage two lines having
the same code (Example: two holidays of the same type in the payslip period).

The result was a wrong computation as only one of the 2 lines was taken into account.
Without even warning the user.

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

Put recordsets on the local dictionaries, where previously only a browse record was set.

This requires a modification on the salary rules to make them work (with multiple lines,
otherwise it is still ok).

Example: <field name="quantity">worked_days.WORK100 and worked_days.WORK100.number_of_days</field>
Should become <field name="quantity">worked_days.WORK100 and sum(worked_days.WORK100.mapped('number_of_days'))</field>

closes odoo/odoo#26386
2018-11-13 17:05:00 +00:00
Gustavo Valverde b8c5637e7e [FIX] hr_payroll: Compute all payslips when closing batch
Closing a Payslip Batch has to ensure that all payslips inside of it
are well calculated and closed. Otherwise some helpers (as `sum`) won't
work correctly because there are open payslips from the last month batch.

This action ensures that if there's a Payslip Batch with 200+ employees,
closing the Batch will complete the whole process including the accounting.

closes odoo/odoo#25755
2018-11-13 17:33:23 +00:00
Yannick Tivisseandsimosuu bf03b4ba93 [IMP] hr_payroll: Avoid random payslip line order on display
Purpose
=======

If the lines have the same sequence, then the display could be random for these lines.

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

Order on sequence, then code.

Co-authored-by: simosuu <simo.suurla@simonit.fi>

closes odoo/odoo#27124
2018-11-13 16:30:52 +00:00