Commit Graph
121984 Commits
Author SHA1 Message Date
Pierre Masereel ba18cf7fdc [FIX] stock: use self instead of picking
In the compute function _compute_move_without_package, we use self
instead of picking variable, which leads to traceback when more than one
picking is computed

closes odoo/odoo#28482
2018-11-07 16:11:55 +00:00
lbs-odoo c99a6d2fb5 [IMP] hr_holidays: Add team leader group and leave_manager_id
Purpose
=======

1/ A team leader is not able to validate leaves for his own team.
2/ Another person than the manager can be supposed to validate the leaves for a certain employee

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

1/ New hierarchy: Team Leader < Officer < Manager

People in Team Leader access group will now be able to approve leaves for employees in their team.

- Added the new access group
- Added rules for people in this group to read or write appropriate records

2/ Add 'leave_manager_id' field on employees to refer to the Team Leader.

- Added the new field to Employee model
- Added the field to the view so that it is visible
- Modified a filter in a view so that it is more relevant according to its name (My Team Leaves)
- Added a filter in a view for managed employees

TaskID: 1888653

closes odoo/odoo#28352
2018-11-07 13:52:37 +00:00
Nimesh Jethva bc930e2e67 [IMP] hr_contract: rename 'Contract Type' into 'Employee Category'
Purpose :
=======

On the Contract form view the field label for the "contract type" is "Employee Category".

Then it will be good if we keep the same label on the group by also...

Right now on the Group By it is "Contract Type"

closes odoo/odoo#27560
2018-11-07 10:39:06 +00:00
mreficent c42a130a98 [FIX] base: logging_type remain
In fb7ac56 type field was renamed to logging_type
A few were missing

closes odoo/odoo#28447
2018-11-07 09:51:22 +00:00
Nirali Sapra e89ec1e5c5 [IMP] crm: manual assignation setting should be visible out of debug mode.
The "manual assignation" settings is usedful so it should be out of debug mode.

Related Task ID : 1903212

closes odoo/odoo#28130
2018-10-30 06:11:31 +00:00
Robot Odoo 6141df1b46 [ADD] hr_presence: New module to control employees presences
Purpose
=======

A lot of companies don't use the module hr.attendance but are faced
to employees distraction, they forget to record leaves.

In big companies, it is not easy to controle presence and
check if everyone is present in the office.

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

1/ Review Human Resources menuitems

- Employees
- Contract
- Department
- Reports
    - Employee Presence
- Configuration
    - Settings
    - Employee
        - Tag
    - Contract
        - Types
        - Templates
    - Challenges
        - Challenges
        - Badges
        - Goal History

2/ Add option in hr settings to decide the company policy

- [ ] Controle Presence of Employees
    - [ ]  According the system login --> Based on the bus presence (Present if 'away' or 'online')
    - [ ]  Following number of sent emails --> Based on the sent mail.message during the day
    - [ ]  According to the IP address --> Based on the ip address when requesting a long polling, stored on a res.users.log

3/ Add an employee presence view

This view is only for the hr manager and the data is computed when the hr manager goes to it

Clicking on this menu item will generate all kanban of employees grouped by state (present, absent, to define)

On each employee cart, an action can be requested as:
- Send a sms to the employee
- Send an email to the employee
- Create a leave for the employee

4/ Use this email template to contact the employee

Dear %(employee_name)s,

Exception made if there was a mistake of ours, it seems that you are not at your office and there is not request of leaves from you.

Please, take appropriate measures in order to carry out this work absence.

Do not hesitate to contact your manager or the human resource department.

Best Regards,

closes odoo/odoo#28307
2018-11-06 17:14:35 +01:00
Christophe Simonis b106b7ce0b [MERGE] forward port branch 12.0 up to dd70c68426 2018-11-06 16:40:07 +01:00
Yannick Tivisse 3c91ac425f [IMP] sms: Don't overwrite default recipients on default_get
If the recipients are passed by setting 'default_recipients' on the context,
then don't overwrite the content with the method '_get_default_sms_recipients'.

For example, as an employee is a mail.thread, then the method '_get_default_sms_recipients'
exists on it. Calling this method will erase the content of the field 'recipients' that comes
from the default_recipients key in the context.

If we want to use this wizard on something else than a partner, we should avoid this
kind of overwrite.
2018-11-06 15:18:06 +00:00
Yannick Tivisse c0c72f027d [ADD] hr_presence: New module to control employees presences
Purpose
=======

A lot of companies don't use the module hr.attendance but are faced
to employees distraction, they forget to record leaves.

In big companies, it is not easy to controle presence and
check if everyone is present in the office.

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

1/ Review Human Resources menuitems

- Employees
- Contract
- Department
- Reports
    - Employee Presence
- Configuration
    - Settings
    - Employee
        - Tag
    - Contract
        - Types
        - Templates
    - Challenges
        - Challenges
        - Badges
        - Goal History

2/ Add option in hr settings to decide the company policy

[ ] Controle Presence of Employees
    [ ]  According the system login --> Based on the bus presence (Present if 'away' or 'online')
    [ ]  Following number of sent emails --> Based on the sent mail.message during the day
    [ ]  According to the IP address --> Based on the ip address when requesting a long polling, stored on a res.users.log

3/ Add an employee presence view

This view is only for the hr manager and the data is computed when the hr manager goes to it

Clicking on this menu item will generate all kanban of employees grouped by state (present, absent, to define)

On each employee cart, an action can be requested as:
- Send a sms to the employee
- Send an email to the employee
- Create a leave for the employee

4/ Use this email template to contact the employee

Dear %(employee_name)s,

Exception made if there was a mistake of ours, it seems that you are not at your office and there is not request of leaves from you.

Please, take appropriate measures in order to carry out this work absence.

Do not hesitate to contact your manager or the human resource department.

Best Regards,
2018-11-06 15:18:06 +00:00
Pierre Paridans dd70c68426 [FIX] mail: content override toolbar in mobile landscape
On mobile (specifically in landscape orientation as the height of the
viewport is narrower), the content appear over the bottom toolbar
instead of going below.
Solution is in 2 parts:
* raise the toolbar way above the content
* make the toolbar opaque

closes odoo/odoo#28429
2018-11-06 13:06:16 +00:00
Christophe Simonis 3b3a65bef0 [MERGE] forward port branch saas-11.4 up to dc35de9d30 2018-11-06 14:12:51 +01:00
Robot Odoo e220721a8e [FIX] web: accept field name as a groupby descriptor
In some cases, and for historical reasons, the groupby property can be
expressed as a string (for example, 'stage_id') instead of a list of
strings (for example, ['stage_id']).

However, the support was not complete. A crash could happen in some
cases. For example, if there is a group_by: 'stage_id' property in the
context of an action, it works in list view, but adding that view to the
dashboard would result in a crash, without this commit.

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

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

closes odoo/odoo#28408
2018-11-06 12:51:37 +01:00
Andrey Troitskiy 764bd645fc [FIX] hw_scale: added field 'disable' to namedtuple 'ScaleProtocol'
Introduced at bb015818ea
Getting error
TypeError: __new__() got an unexpected keyword argument 'disable'

closes odoo/odoo#28202
2018-11-06 10:12:50 +00:00
Géry Debongnie 6e9c1d92d7 [FIX] board: use correct context in sub board views
Before commit 60f143c8e7, the dashboard
parameters did not use the parameters from the action, so some important
information could be lost.

However, in this same commit, the action context overrides the context
from the user defined views, which means that some information is lost.
For example, customized group bys are ignored.

This commit fixes the issue with some careful context manipulation.
Some special care was done to remove the groupby from the action context
if it is not empty, because that same logic is used in views.
2018-11-06 09:17:05 +00:00
Christophe Simonis dc35de9d30 [MERGE] forward port branch saas-11.3 up to f66a9cdbcf 2018-11-06 10:16:30 +01:00
Goffin Simon 7f5180578f [FIX] sale: Changement of behavior from 11.0
Introduced by: 3d46887d38

Before this commit, creating an invoice from a SO always chose
the payment_method=all when the number of invoice linked to the SO >0
OR all the lines of the SO were with invoice_policy = 'order'

After this commit, creating an invoice from a SO just choose the payment_method=all
when the number of not canceled invoice linked to the SO > 0 AND when there are at
least one downpayment in the SO

SO:

Steps to reproduce the changement of behavior:

- Create a SO for 10 units (invoicing policy based on ordered quantities)

- Create the invoice for 10 units (from SO) and validate it

- Change ordered quantities to 5 units

- Click on create invoice on the SO

The payment method chosen was delivery instead of all. So choosing the default option
lead to a user error saying: there are no invoicable line instead of creating a credit note.

opw:1904258

closes odoo/odoo#28426
2018-11-06 09:15:53 +00:00
Géry Debongnie baeb1a1938 [FIX] web: accept field name as a groupby descriptor
In some cases, and for historical reasons, the groupby property can be
expressed as a string (for example, 'stage_id') instead of a list of
strings (for example, ['stage_id']).

However, the support was not complete. A crash could happen in some
cases. For example, if there is a group_by: 'stage_id' property in the
context of an action, it works in list view, but adding that view to the
dashboard would result in a crash, without this commit.
2018-11-06 08:53:21 +00:00
Nicolas Martinelli 478691b95d [IMP] product, purchase: vendor reference in multi-company
- Create 2 companies A & B
- On a product P, define 2 suppliers (same vendor), one for each
  company, but with a different Vendor Product Code
- Create a PO in A for P

Both supplier codes are proposed in the Many2one widget, while only the
code for A is expected.

Fixes #27857
opw-1894952

closes odoo/odoo#28402
2018-11-06 08:34:26 +00:00
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
Romain Derie f9e34d98f1 [FIX] web_unsplash: do not fetch app_id if no Unsplash images
As empty arrays are considered truthy, the call to `/web_unsplash/get_app_id`
would always be performed even if no Unsplash images.

closes odoo/odoo#28421
2018-11-05 17:02:34 +00:00
Christophe Simonis f66a9cdbcf [MERGE] forward port branch 11.0 up to bab5ccfdd7 2018-11-05 17:51:04 +01:00
Christophe Simonis bab5ccfdd7 [MERGE] forward port branch saas-15 up to ca2b46c2d1 2018-11-05 15:52:38 +01:00
Christophe Simonis ca2b46c2d1 [MERGE] forward port branch saas-14 up to 03a35392da 2018-11-05 15:09:30 +01:00
Jigar Vaghela 4f8ed012c4 [FIX] stock: Hide Reserved column in done stage.
Before this commit:
    Reserved column appeared with 0 qty when Delivery Order goes to done Stage
After this commit:
     Hide Reserved column when Delivery Order goes to done stage.

This task is related to #1888361
Closes: #27223

closes odoo/odoo#28409
2018-11-05 13:33:14 +00:00
Nicolas Martinelli 656c1123d3 [FIX] sale: 'My Quotations' default filter
The filter should not filter on the state.

opw-1906405

closes odoo/odoo#28406
2018-11-05 13:36:38 +00:00
Christophe Simonis 03a35392da [MERGE] forward port branch 10.0 up to d3b86ab930 2018-11-05 14:11:40 +01:00
Mohammed ShekhaandPriyanka Kaakdiya 006c31b955 [FIX] web: re-evaluate column_invisible after onchange
Let's assume a form view with field A and B (a one2many list), with
a column with attrs column_invisible depending on A.

If the user sets A manually, everything works fine (the column is
hidden/shown directly). However, if A is updated by an onchange
(e.g. depending on the number of rows in B), it doesn't. This
rev. fixes that issue.

Related to Issue: 1851451

Co-authored-by: Priyanka Kaakdiya <pka@odoo.com>
2018-11-05 13:57:39 +01:00
Andreas Perhab d3b86ab930 [FIX] purchase_requision: fix syntax error
payment_term.id, creates a tuple wich works if payment_term.id is set
in case payment_term.id is False this creates the tuple (False,) which
is then converted by the Odoo ORM to a account.payment.term(False, )
record set, which in term may cause weird behaviour as this value does
not eval to false in cases like `if self.payment_term_id:`

Closes odoo/odoo#28397
2018-11-05 13:06:33 +01:00
Olivier Colson 714bf1b0ab [FIX] account: reconcile each account only once when reversing an entry
Before that, when reversing an account.move, if two lines of the move shared the same account, we tried reconciling them once for each line: it worked the first time but triggered an error message the second, since the lines had already been reconciled.
2018-11-05 12:29:08 +01:00
Arnold Moyaux ba239e4cac [FIX] mrp: subproduct price + rounding
On the BoM structure report the price on line with a
child BoM is inchoerent. Also the sum of all lines in
the report is not always equals to the total of the parent
line.

For the first issue, it happens due to commit 17b6256955
that use the number of operation cycle as quantity.
The second issue happens because sometimes the rounding is not done
at the smallest level and thus the rounding of the sum is different than
the sum of the rouding.
2018-11-05 10:02:09 +01: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
Odoo Translation Bot 60cdd13eb3 [I18N] Update translation terms from Transifex 2018-11-04 06:02:25 +01:00
Odoo Translation Bot 79b701230d [I18N] Update translation terms from Transifex 2018-11-04 03:16:30 +01:00
Olivier Colson 053a023fc7 [FIX] account: apply correct currency rate for taxes at account move creation
Before that, taxes were only applied with the most recent currency rate, which caused problems in multi currencies, when reconciling statement lines made in the past with invoices, causing the amount currencies in the payment account.move to be wrong.

//Scenario to reproduce the issue (from customer ticket 1903497):

(for a company with USD as base currency)

1. Create a new bank journal for EUR payments

2. Create a new customer invoice for 90€

3. Create a new tax for the reconciliation model, price-included and amounting to 15%

4. Create a new reconciliation model using this tax

5. Use the currency rates from the demo data, add one that is closer to current date than the most recent one.

6. Create a new bank statement for the created EUR bank journal. Make sure that the transaction is less than the actual amount due on the invoice so that we can apply the reconciliation model. Also make sure to set a date on the transaction that lies in the past at some point when the currency rate was (significantly) different.

7. Hit the reconcile button, select the amount due from the invoice and apply the discount reconciliation model(take note of the amount on the created tax move line). Now reconcile.

What is the current behavior that you observe?

Now go back to the bank statement and check the created journal entries. You will see a difference in the amount currency values of the payment and the tax account move line. This difference should not exist.
2018-11-02 17:25:44 +01:00
Nicolas Martinelli bbeb126cf8 [FIX] sale_timesheet: UOM
Revert commits da2140b726, e65c8826ef and 06cd145a79. They
introduce an incorrect UOM.

The original issue was an `AccessError` due to the fact that the
employee chosen was not in the same company than the user. Therefore,
instead of changing the logic of the UOM selection, we make sure to
select the employee in the appropriate company first, then fall back on
any company then.

opw-1888299
2018-11-02 13:48:05 +01: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
Yoshi Tashiro 09a81894b1 [FIX] product: respect received args value instead of overriding it (#26594)
When doing a name_search, if a current search is already specified through args,
do not replace it

Closes #26594
2018-11-02 13:38:11 +01:00
Olivier Dony 717b7249d5 [FIX] server: always consume wakeup bytes from signals
Due to the implementation of PEP-475[1] in Python 3.5, revision
e98e8e9b1b used the recommended technique
of wakeup file descriptors in order to detect interruption of sleep() and
select() by signals, when running in multi-process mode (workers > 0).

The technique works well, however the initial patch never bothered to
read the byte that is written to the wakeup pipe when a signal is
processed. This does not matter when the signal is meant to shut down
the server, but it matters when the signal is SIGQUIT: it simply prints
thread dumps, and continues operating normally.
As a consequence, that byte remains in the wakeup pipe forever, causing
all the subsequent select/sleep calls to return immediately because
the wakeup fd *is* already ready. The symptom was that worker
processes would start cycling their main run loop very fast after
receiving a SIGQUIT signal, eating 100% CPU.

This patch ensures we always empty the wakeup pipe after an interruptible
call, to avoid this effect. It also refactors another occurrence of the
"empty pipe" pattern, in the PreforkServer, and incidentally uses readable
aliases for the file descriptors bound to the ends of the wakeup pipe
(wakeup_fd_r / wakeup_fd_w).

[1] https://www.python.org/dev/peps/pep-0475

closes odoo/odoo#28356
2018-11-02 11:04:35 +00:00
Yoshi Tashiro 7d2bc7d35a [FIX] website_sale: reset cart if checkout was done in another session
This commit extend commit https://github.com/odoo/odoo/commit/ef48b81ab127dd717a4a9d106edd5c51121bc8f7
When you have a cart on multiple session and confirm the card in one of them,
you could still access your cart from other session (note that you could not do
anything with it as it would be reset when adding product or changing qty).

Closes #28210
2018-11-02 11:10:52 +01:00
Romain Derie 3457d1a74b [FIX] website_sale_options: prevent other session crash after checkout
Check commit https://github.com/odoo/odoo/commit/ef48b81ab127dd717a4a9d106edd5c51121bc8f7

This commit is doing the same for website_sale_option as the optional product
is calling another route to add the product to the cart.
That route needed to be fixed too.

Closes #28209, related to #27508
2018-11-02 11:10:50 +01:00
Moises Lopez 8f36b246d0 [I18N] clean es_MX old translations
Only keep the useful ones

closes odoo/odoo#28351
2018-11-02 09:38:23 +00:00
jem-odoo 2aa87253d1 [FIX] sale_purchase: disable PO stat button on SO
Creating a service and stockable that create a PO on SO confirmation
(with different suppliers) will indeed work, but the status button
will only display 1 PO. The problem is that stock is not linking
the SO line with the PO line.
Thus, we prefer desactivated the button displaying the wrong value, as
it brings confusion to the user.
A proper bugfix should be done in master, to correctly link SO line with
PO line making the PO count correct.

opw-1905189

closes odoo/odoo#28410
2018-11-05 12:58:29 +00:00