Commit Graph
121737 Commits
Author SHA1 Message Date
jbm-odoo 22ee6ebbfc [ADD] hr_fleet: Add claim report and cars history per employee
Purpose
=======

When an employee leaves the company, the fleet manager must ask to the insurance company
a claim report for this employee. But in oddo, there is no easy way to have an history
of the drivers.

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

1/ On the employee form, add a stat button: "x cars". The button shouldn't be displayed if the count = 0.
   Make a bridge (auto_install: True in the manifest) depending on hr (hr.employee) and fleet (fleet.vehicle.assignation.log)
   - Add a field employee_cars_count (computed) to count the amount of cars the employee drove.
   - Add an method action_open_employee_cars, that return an action (ir.actions.act_window)
     that open on the fleet.vehicle kanban filtered on cars the employee had driven.
2/ In this bridge module, add on the fleet.vehicle.assignation.logs a button (like in expense) to upload
   documents about the car for a particular employee (PV, rapport d'assurance, blabla). On the employee
   form view, add an action button (with groups fleet_manager) to print all the related documents
   (all the attachements on the fleet.vehicle.assignation.logs for the employee).

closes odoo/odoo#28077
2018-11-06 13:01:57 +00:00
Robot Odoo 564c3867de [IMP] hr_holidays : add demo data
The module lacks demo data to have a nice visual display when testing the application

Add allocation requests and leaves request for several employees

TaskID: 1906478

closes odoo/odoo#28427
2018-11-06 13:51:04 +01:00
Yannick Tivisse 8643dc4fe8 [FIX] hr_holidays: Reintroduce manager_id lost at a0f4f65
Since the split between hr.leave and hr.leave.allocation (See https://github.com/odoo/odoo/commit/a0f4f6548bdb9a26151fc8a292d152fc67d1a13c),
the field manager_id has disappeard from the hr.leave.allocation model.

When modifying the parent_id field on an employee, the change is reflected
on the related employee leaves and allocation by overriding the write method.

As the field doesn't exist anymore, this obviously leads to a warning.

The correct fix it to reintroduce this field.
2018-11-06 12:08:46 +00:00
jbm-odoo 863713b5bd [IMP] hr_holidays: add demo data
The module lacks demo data to have a nice visual display when testing the application

Add allocation requests and leaves request for several employees

TaskID: 1906478
2018-11-06 12:08:46 +00:00
Martin Trigaux 5fe87d01ff [IMP] sale: use correct line name
A down payment is not an "advance", this is Frenglish

opw-1882810

closes odoo/odoo#28386
2018-11-05 08:38:41 +00:00
Robot Odoo 8b12e1d03f Master fix package pim
[IMP] stock: don't show move fully in package

When the move lines in a move are all linked to a package level,
we don't want to see the move anymore. We cannot keep only a domain on
moves their-selves as it depends on the move lines linked to it.

So we use a compute field to filter the moves to show, and the inverse
function just appends the new/modified moves to the move_lines.

TASK-ID: 1865671

closes odoo/odoo#28401
2018-11-05 17:14:33 +01:00
Pierre Masereel 43b96cf302 [REF] stock: remove unused field 2018-11-05 14:42:08 +00:00
Pierre Masereel 07bef887af [IMP] stock: don't show move fully in package
When the move lines in a move are all linked to a package level,
we don't want to see the move anymore. We cannot keep only a domain on
moves their-selves as it depends on the move lines linked to it.

So we use a compute field to filter the moves to show, and the inverse
function just appends the new/modified moves to the move_lines.

TASK-ID: 1865671
2018-11-05 14:42:07 +00:00
Nicolas Seinlet 35169b73d6 [IMP] account: index full_reconcile_id on account.move.line
closes odoo/odoo#28206
2018-11-05 09:01:44 +00:00
Olivier Dony b9ec95a8cb [FIX] fields: delete o2m lines before creating new ones
After 12744bc81ebdaa1671a953c14ba54c637d6a9255, x2m operations are
fully batched, and deletions are processed last when the operations are
flushed, regardless of the order in which they were specified by the
write() or create() call.

This carries a risk of violating (non-deferred) unique SQL constraints,
when the operations for deleting previous lines and re-creating new
ones are processed in the same batch.

This patch executes the deletions before other operations during a
flush, which should be safer with regard to SQL constraints.

An extra constraint is added in test_performance.line to simulate this
corner case, then covered by an extra unit test.
Another unrelated test had to be altered to avoid violating the
new constraint.

This can be reproduced easily by upgrading the `project` module in master,
due to the unique constraint[1] on `ir.actions.act_window.view`, that
gets violated when processing the batch write on this o2m[2].

[1] https://github.com/odoo/odoo/blob/ccc42f16/odoo/addons/base/models/ir_actions.py#L288-L289
[2] https://github.com/odoo/odoo/blob/ccc42f16/addons/project/views/project_views.xml#L394-L396

closes odoo/odoo#28314
2018-11-05 11:11:26 +00:00
Daniel Reis fc3088d90c [IMP] base: ir.mail_server order by sequence
The ir.mail_server Model includes a sequence field, promising that the
lower sequence number have higher priority when multiple server
configurations are available.

The servers are already used based on that parameter since 00bd7274c4 but this
was not enforced at the _order level.
Make it coherent everywhere

closes odoo/odoo#28313
2018-11-02 12:41:02 +00:00
gla 42c6db1ece [IMP] mass_mailing: warn when unsubscribing
Current behavior before PR:
When a lead or res.partner click in the 'unsubscribe' link in a mail that was sent to him via the mass mailing module (not via a particular mailing list), he is blacklisted from the whole mass mailing system. The only message he gets is "you have been successfully unsubscribed".

Desired behavior after PR is merged:
The user is told that he was unsubscribed, but in addition a warning is displayed telling him explicitly :
 - to which mailing lists he was subscribed
 - that he won't receive any mail from them anymore.

Purpose : Warn the user that unsubscribe via a lead or res.partner mass mailing that he won't receive any mail from the mailing lists (listed in the warning) he had subscribed, if any.

closes odoo/odoo#27678
2018-10-26 15:03:29 +00:00
svs-odoo e10fd34682 [IMP] web: load tags in kanban view in one batch
Add an 'enableRelationalFetch' option in _readGroup who force to make
only one rpc for x2m and reference fields.
Usefull to avoid useless (and blocking when too numerous) rpcs (tags
field in a kanban view for example).

Task #1878113 (2/2)

closes odoo/odoo#27731
2018-10-30 12:58:36 +00:00
Yenthe V.G f9b93e867a [IMP] base: add sheet and group names
closes odoo/odoo#27191
2018-10-30 17:16:40 +00:00
qsm-odoo 1058c3cb30 [REF] web_editor: improve code for snippet editor activation
closes odoo/odoo#28292
2018-10-30 13:06:50 +00:00
Robot Odoo 3219171bab [IMP] doc: improve delegation docs example
The model inheritance concept was explained with abstract example which is
often confusing.

Change to a real world example that will be better understood.

closes odoo/odoo#27396
2018-10-30 17:58:38 +01:00
Yenthe V.G 64c47cdbd6 [IMP] lunch: add sheet and group names to form views
closes odoo/odoo#27343
2018-10-30 16:13:48 +00:00
Bruno Paulino 9e7d6a3e7e [IMP] doc: add a more meaningful example
update Model Inheritance Delegation docs with a more meaningful example
2018-10-30 16:09:21 +00:00
Bruno Paulino 72cc07aae2 [CLA] signature for Bruno Paulino 2018-10-30 16:09:21 +00:00
Raphael Collet 650074e8b2 [IMP] fields: faster x2many fields
Perform all operations in batch, except for updates (command (1, id, vals)).

closes odoo/odoo#28029
2018-10-30 15:08:02 +00:00
jem-odoo 3e3d6c3ce0 [REF] purchase_*: change received qty api
The received quantity on Purchase Order line can be compared
to the delivered qty on Sales Order line. It is now time for
both to share the same mecanism (introduced in
3bf8a62e0d).

This commit sets `qty_received` as a computed field, depending
of a method (`qty_received_method` field) to compute it. The
value can be computed based on
 - manual value; for services (all the time), and consummable
 products (when stock is not installed).
 - stock moves; for stockable and consummable products (when
 stock is installed)

This is now easier to extend the way the received quantity
need to be computed (like in sale).

Task #1850689

closes odoo/odoo#27663
2018-10-30 12:43:53 +00:00
Yenthe V.G 7c1ae0cf49 [IMP] hr_recruitment: add missing sheet to form views
closes odoo/odoo#27341
2018-10-30 13:20:55 +00:00
Yenthe V.G dfbc85cae0 [IMP] account_analytic_default: add sheet to analytic defaults form view
closes odoo/odoo#27349
2018-10-30 11:08:18 +00:00
Yenthe V.G 2f4ca47c43 [IMP] account: add missing sheet to account group form view
closes odoo/odoo#27346
2018-10-30 10:54:08 +00:00
eLBati 95cda104e6 [FIX] digest: resolve unmet dependency on resource module
This commit fixes the following bug:
* On a new DB, install account
* Settings > Technical > Email > Digest emails
* Open Weekly Digest, set Next Send Date to current day
* Settings > Technical > Scheduled Actions > Digest Emails
* Run manually

AttributeError: 'res.company' object has no attribute
'resource_calendar_id'

The field resource_calendar_id is provided by the module resource

closes odoo/odoo#28239
2018-10-29 14:33:17 +00:00
Yannick Tivisseandblaggacao 49fa9973b0 [IMP] hr_holidays: Add leave code for payslips
Purpose
=======

Before this commit, it was not straightforward to use leave records in salary
rules programatically.

This commit implements the standard and python-code compatible way of defining
leave codes which then can be used in the salary rules in the used way.

This way, the naming of leaves will not be restricted to python-attribute
compatible naming, when one wants to use this feature.

Leave names (translatable) are an unreliable identification in python code salary rules.
A language switch would break python salary rules that use a leave type as input

TaskID: 1903964
Closes #28240

Co-authored-by: blaggacao <david@elaleman.co>
2018-10-29 10:52:41 +00:00
Robot Odoo 45c2c3761d [MERGE] utm, link_tracker, mass_mailing: improve views usability and lint module
Purpose of this merge is to clean a bit link_tracker and utm as well as their
use in mass mailing. Main things done in this merge are

  * reorganize link_tracker and utm according to guidelines. Purpose is
    to ease code understanding and prepare future improvements in those
    modules;
  * clean views, add missing fields in views;
  * better integration of link menus and views in mass mailing;

This commit is related to task ID 1896681.

closes odoo/odoo#27975
2018-10-29 13:09:17 +01:00
Robot Odoo d9c1cd4256 [IMP] hr_payroll: Refactor methods and improve performances
Purpose
=======

Some parts of the code are quite old-api-style and could be modified to use recordsets and thus improve performances.

closes odoo/odoo#28182
2018-10-29 12:08:19 +01:00
Thibault Delavallée a758d517d8 [IMP] mass_mailing: better link tracker action redirection for mass mailing
Purpose is to ease use of mass mailing by improving the action linking to
statistics. Form / graph view is added as well as informations related
to mass mailing and campaign.

This commit is linked to task ID 1896681 and PR #27975.
2018-10-29 10:19:53 +00:00
Yannick Tivisse f37a40d74e [IMP] hr_payroll: Modify _get_payslip_lines to use recordsets 2018-10-29 10:09:59 +00:00
Yannick Tivisse e52c407b6e [IMP] hr_payroll: Refactor structures methods to use recordsets 2018-10-29 09:29:52 +00:00
Yannick Tivisse 225708a58f [IMP] hr_payroll: Move the BrowsableObject classes into a separated file
Purpose
=======

These classes are utils classes for the payslip computation.

It's better for the code readability to isolate them into a single file,
and keep the business logic into the payslip model code.
2018-10-29 09:29:52 +00:00
Yannick Tivisse 4d3db78d7f [IMP] hr_payroll: Remove useless method 2018-10-29 09:29:52 +00:00
Yannick Tivisse b1449d24a3 [IMP] hr_payroll: Move get_contract method to hr_contract module
Purpose
=======

This method has nothing to do on the payslip model.

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

Move the method on the hr_contract module, on the hr.employee model.

Rename the method and return and recordset instead of a list of ids.
2018-10-29 09:29:52 +00:00
qsm-odoo 1f37ec3b0b [REF] account, hr_org_chart: use correct sub-assets
Some variables were placed at the beginning of the backend helper.
While it was working, the normal convention is to place them at the
end of the variables helper.

closes odoo/odoo#28203
2018-10-26 14:13:41 +00:00
Thibault Delavallée 510bad0df3 [REF] link_tracker: clean module views
Purpose is
 * to clean a bit views;
 * to improve link.tracker form view to have information better displayed;
 * to remove unused views;

This commit is linked to task ID 1896681 and PR #27975.
2018-10-26 12:42:49 +00:00
Thibault Delavallée 37fcb1e6ff [REF] link_tracker: reorganize python according to guidelines
This was not correctly done when splitting the module at fd5361c0f7.
Future commits will clean a bit the code in order to better understand how
this module works.

This commit is linked to task ID 1896681 and PR #27975. No functional change
should occur with this commit as it contains only renaming / move.
2018-10-26 12:42:49 +00:00
Thibault Delavallée ae2866a11e [MOV] link_tracker: organize module structure according to guidelines
This module still holds old code and deserves some love. This commit cleans a
bit the init and manifest files as well as renaming view file according to
guidelines.

This commit is linked to task ID 1896681 and PR #27975. No functional change
should occur with this commit as it contains only renaming / move.
2018-10-26 12:42:49 +00:00
Thibault Delavallée 89d50fc3b1 [REF] utm: clean and lint views
Purpose is to give a quick polish to this module code concerning views.
Some ids are updated, indentation is fixed.

This commit is linked to task ID 1896681 and PR #27975.
2018-10-26 12:42:49 +00:00
Thibault Delavallée 65f9840fd2 [MOV] utm: organize module structure according to guidelines
This module holds old code and is still not updated according to guidelines.
Let us update a bit the naming in this module to have readable code.

This commit is linked to task ID 1896681 and PR #27975. No functional change
should occur with this commit as it contains only renaming / move.
2018-10-26 12:42:49 +00:00
qsm-odoo 8c756a32a0 [REF] website: review theme dialog engine
Refactor the code to remove useless parts, simplify behaviors and allow
more customizations in future tasks.

closes odoo/odoo#28167
2018-10-26 09:29:53 +00:00
David Arnold 1bf58d282f [IMP] db: set default user tz through country code
Given a country code is specified and the country only has one timezone, it is
safe to assume that the admin user is operating from that timezone.

Set the default timezone to simplify the onboarding in such particular case.

If a country has more than one timezone, we can not make safe assumptions and
don't provide a default tz.

closes odoo/odoo#26365
2018-10-26 07:21:47 +00:00
Robot Odoo 653b4289c6 [MERGE][FIX] purchase: include refunds in invoice count
If a supplier had a refund, it was not included in the supplier invoice count
nor in the results in the statbutton

On the customer side, fields like total_invoiced works on both the out_invoice
and out_refund

closes odoo/odoo#28161
2018-10-26 09:21:05 +02:00
Cas Vissers 43edf08b26 [FIX] purchase: include refunds in invoice count
If a supplier had a refund, it was not included in the supplier invoice count
nor in the results in the statbutton

On the customer side, fields like total_invoiced works on both the out_invoice
and out_refund
2018-10-25 14:41:14 +00:00
Cas Vissers 3f6deb24ee [CLA] Brahoo signs Odoo CCLA 2018-10-25 14:39:21 +00:00
jem-odoo 3baf8c41e9 [FIX] website_sale: change invoice_policy of a demo data
Otherwise, the product is a service based on delivered
quantity which is not a covered case by the service_policy
field on product form view (the selection will be empty).

Asked in Task-1859308

closes odoo/odoo#28162
2018-10-25 09:28:51 +00:00
Géry Debongnie 5ab5ccba40 [REF] web: remove useless code
The utility function xml_to_json, which is mainly used by the views to
parse their arch (from string to xml tree) had a peculiar behaviour: it
tried to process some attributes as json.  If by chance, these
attributes are valid json, then they are replaced by their parsed value.

It is difficult to say why it could be useful.  Maybe this was done to
prevent using pyeval many times later on.  But if that is the case, it
should be done by the view code and not the utility function (the view
can precompute all attributes once).

Also, this behaviour is annoying for code later in the chain, which
needs to check if what it gets is an object or a string.  With this
change, attributes are always returned as string (at this point).

closes odoo/odoo#28133
2018-10-25 07:56:30 +00:00
mreficent 2924b77b6f [REF] website: rename website.redirect,type to redirect_type
Part of odoo/odoo#27599 to rename fields named 'type' which may conflict

closes odoo/odoo#28112
2018-10-24 14:32:49 +00:00
Yenthe V.G b6c3ad1b8d [IMP] sale_management: allow easy xpath on tab
closes odoo/odoo#27771
2018-10-24 08:21:29 +00:00
David BeguinandFMDL 0b1a3da01f [IMP] base : adds direct access to groups, record rules and access rights from user form
Adds 3 smart buttons with count to see :
- Groups
- Access Controls
- Record Rules
Buttons available in debug mode only
Every user that have access to user form has at least admin / Settings or Admin / Access rights.
Admin / Settings includes Admin / Access Rights

Create and delete are not allowed for those views.
Indeed users may think they are modifying current user's access
whereas they are modifying the whole group access.
To avoid confusion, the user's access rights list is now not editable.
Clicking on a row redirects to form view that can be edited.
A warning has been added on access rights form to be sure the user
is aware of what he is doing.

Task ID : 1830142
Closes PR #25587

Co-authored-by: David Beguin <dbe@odoo.com>
Co-authored-by: FMDL <florent.mirieu@gmail.com>
2018-10-24 07:31:06 +00:00