Commit Graph
126133 Commits
Author SHA1 Message Date
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
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
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
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
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
Martin Trigaux 00626905af [FIX] sale: use name_search on product search
Before 762adedece the search was done on the related field product_id
This was equivalent to make a search on the records order_line.product_id
and to use the name_search of product to find it.

With the filter order_line.product_id.name, it was explicitly searching on the
name of the template

Fixes odoo/odoo#28344

closes odoo/odoo#28390
2018-11-05 10:07:17 +00:00
Goffin Simon f7aa7cebf9 [FIX] stock: Cannot add company to push/pull rules
When creating a rule, the company of the route must be taken when
the route has a company.

opw:1903996

closes odoo/odoo#28387
2018-11-05 08:52:11 +00:00
RomainLibert 536c65bc7c [FIX] l10n_fr_hr_payroll: update data
Since commit https://github.com/odoo/odoo/commit/bd5b2c9466eabe56bbb1e91d29a7e422e957550f we removed
the field limit, replacing it by allocation_type.

closes odoo/odoo#28398
2018-11-05 12:13:44 +00:00
Nicolas Martinelli cf35835b8b [FIX] account: no account in manual move creation
- Activate multi-currency
- Create an Journal Entry manually
- Create a line
  Do not fill Account
  Fill in Amount Currency
  Fill in Currency

A traceback occurs because `line.company_currency_id`.

An extra condition `and line.company_currency_id` is not sufficient to
have the onchange working properly. Indeed, the related field
`company_currency_id` goes through another related field (`company_id`),
leading to an empty value in some cases.

opw-1904854

closes odoo/odoo#28389
2018-11-05 09:59:02 +00:00
Nicolas Seinlet 672bc57c1d [FIX] mail: access error when reading a channel
When a record inaccessible by the user is linked
to a message in a channel accessible to the user,
Avoid to raise an access error due to this linked record.

Also need an aditional query in test query_count.

closes odoo/odoo#28312
2018-11-02 08:32:50 +00:00
Goffin Simon e2db39e96b Revert "(FIX] account: Impossible to make a partial credit note"
This reverts commit bb939ffac0.

closes odoo/odoo#28321
2018-10-31 14:48:14 +00:00
David Beguin f20cd3db75 [FIX] hr_attendance : kiosk mode multi scanning
- Scan a barcode for employee 1 in kiosk mode
- At greetings message, scan a barcode for employee 2

2 attendance entries are created for employee 2 instead of 1.

When scanning the barcode for employee 2, the event listener
`_onBarcodeScanned` is still active on `KioskMode`. Therefore, the RPC
call to `attendance_scan` is performed twice.

We deactivate the event listener after scanning, and reactivate on
`KioskMode` only if there is an issue. This is sufficient since the call
to `do_action` in `GreetingMessage` will create another instance of the
client action. In `GreetingMessage`, we add back the redirection to
`KioskMode`.

Co-authored-by: Nicolas Martinelli <nim@odoo.com>

Linked to Task ID 1878251
opw-1878632
opw-1888402

closes odoo/odoo#28150
2018-10-31 14:35:27 +00:00
len-odoo 180f528528 [FIX] web: reload many2one data if the context has changed
When a view is loaded, it checks which fields it has to load.
In the case of a many2one, it could be the case that a context key is present in
one view and not in the other; if it happens, we should reload the data, as a
name_get result could vary.

opw 1891295

closes odoo/odoo#28298
2018-10-31 12:52:36 +00:00
len-odoo 622eb6b747 [FIX] sale_stock: compute quantity differentiating incoming and outgoing pickings
Suppose that you have a SO that you deliver.
Then the client returns the products, getting a refund,
which creates an incoming picking.
If you do then update the product sold quantity, the quantity to deliver is
computed by summing the relevant picking.
We now discriminate incoming and outgoing picking, respectively substracting and
adding the quantities.

opw 1903559

closes odoo/odoo#28315
2018-10-31 12:23:33 +00:00
Goffin Simon 93d69933ac [FIX] stock: Wrong production/scrap/adjustment location used in multicompany
- When using perpetual inventory valuation, the accounts used for scrap, manufacturing,
and inventory adjustment operations are set on the corresponding locations .
- In a multicompany environment, you will have a separate chart of accounts for each company.
- Account fields on locations are not property fields.
- Therefore, in order to separate the accounting of manufacturing, scrap, and inventory
adjustment operations, you must use a location for each operation for each company.
- Set up one location for each company for scrap, production, and adjustment
locations, setting the company field on each.

Bug:
- When attempting to create a MO, inventory adjustment, or scrap order while signed
in to the second company, you will receive a permissions error on stock.location.

Fix:
- Now the right location is taken according to the company of the user.

Backport of this commit: c7526407ab

opw:1817339
2018-10-31 11:51:09 +01:00
Olivier Dony 9cc8a8d0a4 [FIX] reqs: bump up recommended requests version
In light of CVE-2018-18074, using python-requests 2.20.0 is recommended,
or any distribution-specific version that was patched.

See also https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-18074
2018-10-30 18:49:35 +01:00
Joren Van Onder c2bc338150 [FIX] account_budget: properly calculate percentage sum in read_group
The percentage field is computed in _compute_percentage as a value
between 0 and 1. This is good because that's what widget="percentage"
in views expects.

This makes read_group also return a value between 0 and 1, instead of
0 and 100. Otherwise list views will show e.g. 5000% when grouping
lines that sum to 50%.

Introduced in saas-11.4 at odoo/odoo@9148960174.

*Do not forward port, already ported to 12.0 via
 odoo/enterprise#2975 (odoo/enterprise@a1484e650c)*

opw-1904481
2018-10-30 10:35:49 -07:00
Martin Trigaux 214975911b [FIX] l10n_ro: fix xml syntax 2018-10-30 18:28:00 +01:00
Duc Dao f978722503 [IMP] l10n_vn: fix syntax and allow reconcilation
for accounts 3341, 3348, 141, 1388, 3388
2018-10-30 18:24:15 +01:00
Olivier Colson d9448d7389 [IMP] l10n_ch: also detect postal account type when using the shorten form with -
This shorten form is aa-bbb-x. The a characters are the first two digits of the number, x is the mod10r verification digit, and b characters consist of all the intermediate digits, without the leading 0s. The chain of b characters' length can range between 1 and 6 characters.
2018-10-30 16:46:55 +01:00
Christophe Simonis ca3a1f51d8 [MERGE] forward port branch saas-11.3 up to 4f3a20bb33 2018-10-30 11:45:18 +01:00
Nicolas Martinelli edb648f6a1 [FIX] website_sale_delivery: allow hook at price update
A hook is necessary for a price update when TaxCloud is used.

opw-1894511

closes odoo/odoo#28281
2018-10-30 09:29:53 +00:00
Rémi Rahir a219bdb85e [FIX] web: consider correct viewtype when loading data
Before this commit, when loading the data and calling the prostprocess,
the viewType was not correctly passed which could lead to broken
behaviour. For example, if one was to load a record from a list view
embedded in a form view, the viewtype passed was the list which
prevented to load the data from the form view.

OPW 1891295

closes odoo/odoo#28279
2018-10-30 09:24:39 +00:00
Christophe Simonis 4f3a20bb33 [FIX] mail: adapt forward-ported test 2018-10-30 10:20:57 +01:00
Julien (juc) Castiaux 854208370c [FIX] web: creating a record in a grouped empty kanban view crash
When creating a record in a grouped kanban view, it tries to add
the record to the first column but if no column exist, it fails
to find the first one and raise an exception.

This PR correct that bevahior by checking it exists a column and
fallback to the view form when it does not.

opw-1902851

closes odoo/odoo#28262
2018-10-30 07:17:40 +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
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
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
Alexandre Kühn 91dfb15c3c [FIX] mail: mark as read only when accessing to chatter
Backport of 17bb0ca443

Before this commit, the user could not receive any notification
from the chatter of a document when having Notification Management
set to "Handle with Odoo".

This problem occurs when the user opens (or has opened) the document.
Any messages received from the document are automatically marked
as read, so it removes the notification right after receiving it.

In order to no longer have this issue, the user had to reload all
pages that have opened this document.

This commit slightly changes the behaviour of the chatter, so that
it automatically marks it as read only when accessing the document,
but not when the document is open (or has been opened). Consequently,
if the user has opened the document and then receives a notification
from this document, it won't automatically mark it as read.

Task-ID 1895359

opw-1890556

closes odoo/odoo#28113
2018-10-29 17:52:05 +00:00