Commit Graph
127612 Commits
Author SHA1 Message Date
Géry Debongnie a8cec47c93 [IMP] assets: remove css files split
Before this commit, our asset bundles had a special behaviour for
bundles of type css: because of an old limitation in IE9, css files had
to be split to make sure they had less than 4095 rules per stylesheets.

Since we no longer support IE9, this code can be removed, which should
slightly simplify the bundle code, and should slightly reduce the number
of requests required to properly load odoo.

closes odoo/odoo#27933
2018-10-19 09:18:28 +00:00
Vincent Schippefilt 2b0642d09e [IMP] web: remove es5 shim
The library es5 shim was usefull for older browsers that do not implement
completely the es5 specifications, like IE9.

As we do not support browsers older than IE11, that fully supports all
the features of es5, the library has become useless.

Removing this library will remove a little bit of noise in the callstack
when debugging.

closes odoo/odoo#27877
2018-10-19 08:49:56 +00:00
Fabrice Henrion 9d7ad0fe54 [FIX] terminology
The last time when a user connected to Odoo is a different concept than the last time when a user authenticated to Odoo. I can authenticate once and connect many times afterwards (cookie/session).

closes odoo/odoo#27963
2018-10-19 08:02:17 +00:00
Robot Odoo b262dc7c1c [MERGE][REF] various: rename columns "type" to be more business oriented
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.

Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.

This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.

closes odoo/odoo#27722
2018-10-19 14:16:32 +02:00
Robot Odoo 64971170d2 [IMP] hr_*: Improve the search views for department fields
1 Display department on manager list views
==========================================

On the manager list views (Leaves/Allocations to approve), the department
is not displayed. Display it on these list views, but keep it hidden for the
employee views.

2 Allow to search employees on allocations
==========================================

3 Search on department and on children departments
==================================================

Currently when searching on a department (on the employee view for example)
we only retrieve employees from the specific department. It should return
all the employees from the department and also from its children
departments, like for partners or companies.

Adapt all the search view where a department field is used by
specifying a 'child_of' operator.

TaskID: 1892639

closes odoo/odoo#27902
2018-10-19 11:44:40 +02:00
mreficent 46b2fe4db1 [REF] hr_holidays: rename hr.leave.report type to report_type
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.

Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.

This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
2018-10-19 09:13:15 +00:00
mreficent 35a5db92c2 [REF] survey: rename survey.user_input type field to input_type
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.

Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.

This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
2018-10-19 09:13:12 +00:00
mreficent b70ccc45bd [REF] survey: rename survey.question type field to question_type
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.

Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.

This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
2018-10-19 09:13:09 +00:00
mreficent 77e5e8b7ff [REF] base: rename ir.server.object.lines type field to evaluation_type
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.

Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.

This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
2018-10-19 09:13:06 +00:00
mreficent fb7ac56d65 [REF] base: rename ir.logging type field to logging_type
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.

Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.

This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
2018-10-19 09:13:03 +00:00
mreficent 529c1a2e28 [REF] fetchmail: rename fetchmail.server type field to server_type
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.

Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.

This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
2018-10-19 09:13:00 +00:00
mreficent 4f9afa6a64 [REF] calendar: rename calendar.alarm type to alarm_type
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.

Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.

This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
2018-10-19 09:12:55 +00:00
lul-odoo b952e1a197 [IMP] hr_holidays: Display department on manager list views
On the manager list views (Leaves/Allocations to approve), the department
is not displayed. Display it on these list views, but keep it hidden for the
employee views.
2018-10-19 08:22:48 +00:00
lul-odoo d7b505f09b [IMP] hr_holidays: Allow to search employees on allocations 2018-10-19 08:22:26 +00:00
lul-odoo a086761848 [IMP] hr_*: Search on department and on children departments
Purpose
=======

Currently when searching on a department (on the employee view for example)
we only retrieve employees from the specific department. It should return
all the employees from the department and also from its children
departments, like for partners or companies.

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

Adapt all the search view where a department field is used by
specifying a 'child_of' operator.
2018-10-19 08:16:55 +00:00
lul-odoo 584211b1c9 [IMP] hr_holidays: Update department on upcoming validated leaves
Purpose
=======

Currently if a department is modified on an employee, the department is
modified accordingly on the leave request if it still in 'draft' or
'to submit' states.

This should also be the case for confirmed leaves, if it is still planned
in the future.

Note: A test has been added for this specific use case.

TaskID: 1882544

closes odoo/odoo#27661
2018-10-19 08:04:51 +00:00
Robot Odoo ed322f76a2 [IMP] mail: Return a browse record in _track_subtype instead of xmlid
Purpose
=======

- A manager could want to follow only home working of its own department
- A HR officer could want to follow only sick leaves of all dpts.

We have to improve what people follow and how they follow it in the leaves module

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

Subtype on department
---------------------

In department form view, right now, people can follow approvals

Instead we should have some generic and specific subtypes depending on the leave type

For instance, a HR Officer wants to follow only sick leaves and a manager only home working

Following mechanism
-------------------

Remove first / second approval subtype differences
if a leave type is not linked to a specific subtype, consider only classic
people follow it (employee and assigned HR people / manager)

Link leave type to subtypes, with some by default (i.e. home working, ...), not mandatory

When creating a leave type, link it to the department to be able to
activate the subtype for only one department.

closes odoo/odoo#27620
2018-10-19 11:44:24 +02:00
TWA 398f0eb8e9 [IMP] hr_holidays: Define notifications by leave type
Purpose
=======

- A manager could want to follow only home working of its own department
- A HR officer could want to follow only sick leaves of all dpts.

We have to improve what people follow and how they follow it in the leaves module

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

Subtype on department
---------------------

In department form view, right now, people can follow approvals

Instead we should have some generic and specific subtypes depending on the leave type

For instance, a HR Officer wants to follow only sick leaves and a manager only home working

Following mechanism
-------------------

Remove first / second approval subtype differences
if a leave type is not linked to a specific subtype, consider only classic
people follow it (employee and assigned HR people / manager)

Link leave type to subtypes, with some by default (i.e. home working, ...), not mandatory

When creating a leave type, link it to the department to be able to
activate the subtype for only one department.
2018-10-19 07:52:41 +00:00
TWA e61286ecd4 [IMP] mail: Return a browse record in _track_subtype instead of xmlid
Purpose
=======

It's possible to gain some requests with returning a browse record instead of
an xmlid. It's also cleaner.
2018-10-18 13:07:30 +00:00
Gert Pellin 9e90817530 [FIX] point_of_sale : display discount on ticket
According to the setting set on the pricelist

More the discount_policy field from sale to product to be usable in point of
sale, even without sale installed

Task id: 1853454

closes odoo/odoo#27310
2018-10-18 06:09:03 +00:00
Yenthe V.G 83dee8e449 [IMP] hr: add sheet to employee tags form view
closes odoo/odoo#27332
2018-10-17 12:21:14 +00:00
Yenthe V.G ea4c27233f [IMP] mrp: add missing sheet to Productivity Loss form view
closes odoo/odoo#27329
2018-10-17 13:11:31 +00:00
Martin Trigaux 7e5afbefa7 [IMP] base: remove duplicated entry
Twice in the file

Coutresy of dhamedic, cf odoo/odoo#27826

closes odoo/odoo#27858
2018-10-16 16:01:41 +00:00
Robot Odoo c487334b58 [IMP] stock: backorders created only when needed
Description of the issue/feature this PR addresses:
Creation of backorders only when needed

Current behavior before PR:
- When the option "No Backorder" was selected, a backorder was created then cancelled.

Desired behavior after PR is merged:
- When the option "No Backorder" was selected, no backorders are created.

( Task ID : 46981 )

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

closes odoo/odoo#27624
2018-10-16 13:17:41 +02:00
arbaes 35a27f5151 [IMP] stock: Doctring update and useless kwargs deleted
- The docstring for the method `create_backorder(self)` was updated to a more convenient one.
- The kwargs `backorder_moves` was remove since it was useless.
2018-10-16 10:45:23 +00:00
arbaes 9764f04a3c [IMP] stock: backorder created only when needed
Before this commit, when the user chose to not make a backorder, a backorder was created then immediatly canceled.
This behaviour is now changed as in such a case the backorder is simply not created anymore
2018-10-16 09:14:48 +00:00
arbaes 3747f36802 [IMP] stock: Doctring update and useless kwargs deleted
- The docstring for the method `create_backorder(self)` was updated to a more convenient one.
- The kwargs `backorder_moves` was remove since it was useless.
2018-10-16 09:14:48 +00:00
Géry Debongnie d91f0ce95d [IMP] web: log error when module crashes at loading
Before this commit, if a JS module caused an error while being
evaluated, the error was silently swallowed (and only logged in debug
mode, in the extra information about the state of all modules).

With this commit, we always log the error in the console.  Note that
this only applies to JS execution errors.  If a file has invalid
javascript structure, then a parsing error will happen, even before the
module system has the possibility to do anythin.

closes odoo/odoo#27836
2018-10-16 08:44:29 +00:00
Robot Odoo a19eb47caa [FIX] point_of_sale: fp map 2m taxes // align with account + Tests
Before this commit, it was not possible to map one tax to multiple taxes
in the point of sale, just as it is in the account module.

This commit implements fiscal positions that can map to various taxes
on POS.

Furthermore, id adds test to secure that somewhat implicit feature on which
several localisations seem to depend upon.

A typical use case if one tax is not replaced but complemented by another.

**Description of the issue/feature this PR addresses:**
- Taxes can only be replaced in POS.
- Not complemented by a peer tax.
- Behavior not aligned with backend fp mapping.

**Current behavior before PR:**
- Tax cannot be mapped to several taxes (aka: complemented: "to itself and other") on POS

**Desired behavior after PR is merged:**
- Tax can be mapped (aka: complemented) to various taxes on POS

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

@xoe-labs

closes odoo/odoo#26415
2018-10-16 08:25:45 +02:00
Arnold Moyaux 17b6256955 [FIX] mrp: bom structure in batch
Usecase to reproduce:
- Create a BoM that create more than 1 finished product
- Use a routing
- Open the BoM structure report

The operations time from the routing are multiplied by the quantity show
on the report.

It should not happen since routing's operations are not by unit.
If a user create a BoM that produce 50 finished products then the
operation time is always the same when the user produce between 1-50
units. It then double from 51-100,... (workorder use the same process
for the expected duration).

This commit fix this behavior by using a rounding up on the
quantity asked on the report / BoM product quantity.
It also take care of the workcenter capacity.

opw-1890005
2018-10-15 13:04:49 +02:00
Christophe Simonis f026255f12 [MERGE] forward port branch saas-14 up to 5f3739aebd 2018-10-15 11:40:20 +02:00
Andreas Raster 956b3ce54d [FIX] server: ignore broken symlinks
Previously broken symlinks would cause a FileNotFoundError
exception in the filesystem watcher thread spawned when using the
--dev=reload argument.

This problem appeared when using emacs to edit python files while
they are being watched by an odoo instance for changes. Emacs
creates a broken symlink as lockfile in the same directory as the
python file that it edits.

This commit makes the filesystem watcher silently ignore any
FileNotFoundError that occurs when it tries to open a file.

Fixes  #21214, closes #21215
2018-10-15 11:15:42 +02:00
Andreas Raster d63de90a8a [CLA] Signature for rakete 2018-10-15 11:13:47 +02:00
Christophe Simonis 5f3739aebd [MERGE] forward port branch 10.0 up to 8fb61cd830 2018-10-15 11:03:34 +02:00
Lucas Perais (lpe) 8fb61cd830 [FIX] product_margin: sales and purchase in invoice's currency
Invoice price should be adapted to the invoice currency
Before this commit, it was not.

OPW 1889997

closes #27710
2018-10-15 09:24:20 +02:00
Odoo Translation Bot 156d099e32 [I18N] Update translation terms from Transifex 2018-10-14 06:02:03 +02:00
Laurent Smet 64fcd9748d [FIX] account: fix clause on accounts in reconciliation widget
The reconciliation widget must provide visibility on black lines having an account in
a different bank journal.

Example using Paypal:

Invoice:
Receivable: debit=x, credit=0 matching_number: A
sales     : debit=0, credit=x

Payment transaction:
Paypal    : debit=x, credit=0 matching_number: B
Receivable: debit=0, credit=x matching_number: A

Statement line payment:
Bank      : debit=x, credit=0
Paypal    : debit=0, credit=x matching_number: B
2018-10-12 15:42:00 +02:00
Simone Rubino d704d616f9 [REM] sale_stock: delete unused file
The file stock_config_settings_views.xml is not mentioned in the manifest, and
it is wrong as the model `stock.config.settings` which does not exist anymore

closes odoo/odoo#27540
2018-10-12 13:13:04 +00:00
Thibault Delavallée 56596e5240 [FIX] mail: avoid concurrent update of notifications
When sending notifications by batch one notification email can be send
up to 50 people. For one mail_mail entry to handle 50 emails can be sent
as those are sent independently for each recipient.

In some cases a bounce may occur while the whole batch of recipients is
not completely mailed. In that case the mailgateway will update the
notification status to bounced. When the cron finishes to send the whole
batch of emails it tries to update the notifications of all recipients.
However as a notification has already been updated due to the bounce we
face a concurrent update, meaning the transaction is rollbacked.

Emails have been sent but notifications are not considered as sent as they
have not been updated accordingly. Next time the cron runs it will send the
same batch again, with probably the same bounce and rollback. We could
therefore face an email loop.

This commit fixes that by setting notifications to a transient exception
state. Notifications are locked, meaning bounced will have to wait for the
transaction to finish before updating them. That way the cron can run
safely on the whole batch and we avoid having emails loop. It has an impact
on query count as a search and write is performed in the send process.

This commit is linked to task ID 1893054. Done in collaboration with
@Xavier-Do .
2018-10-12 12:50:39 +02:00
Simon Lejeune 0b414cb814 [FIX] sale_stock: return of return and delivered quantity
The code ignored return of return when computing the delivered quantity
of a so line (in this part of the code, if a move has a destination
location set a customer, it'd be a return of return of a delivery).

We now update the delivered quantity is the return of return as the
`to_refund` flag enabled, meaning the user ticked the option to update
the quantity on the so line.

opw-1884683
2018-10-12 10:21:14 +02:00
Robot Odoo 94221c596b [IMP] data files: proper uid and context support
Linked to task 1887993, related to the de-magic-ification of the "admin"
user: currently data files are "executed" as the root user, re-linking
relevant records to the admin user is a PITA (e.g.
97b82ff7c1).

Just executing all demo files as the admin is not feasible (some things
a regular user literally can't do), but the ability to execute entire
data files as a specified user or with specific context keys set, and
furthermore override that at the function/record level, is useful.

This:

* refactors some of convert_xml to prep for the rest
* cleans up and fixes the handling of uid/context to use them in record
  and function tags and properly inherit them from data parents
* cleans up some of the rng & conversion code (unused features, dead
  code, broken features, …)

closes odoo/odoo#27383
2018-10-11 19:37:38 +02:00
Xavier Morel a8ee940e38 [REM] core: assert, ir_set and url tags from XML data files
* ir_set and url were accepted by the RNG despite ir_set having been
  removed back in 2015 or so and <url> having possibly never existed in
  the first place (could not find any reference to an <url> element
  outside of sitemap qweb templates)
* <assert> was essentially deprecated/removed in 2015 with the v9
  accounting having stopped running account_assert_test.xml, which was
  the last file using the tag so far as I can tell. The file itself
  remained as dead code until 2018
2018-10-11 15:01:59 +00:00
Xavier Morel 4d581e26c2 [REF] core: cleanup noupdate handling in XML import
Use the same pattern as for the envs: a stack of noupdate values pushed
and popped around data nodes.

Avoids re-parsing the same noupdate attribute on every node execution,
and completely removes the need to pass the nearest data node to every
_tag_ function.
2018-10-11 15:01:36 +00:00
Xavier Morel de86da2417 [FIX] *: remove id from various function tags 2018-10-11 15:01:04 +00:00
Xavier Morel bf0ed03d0f [FIX] core: support for uid/context in XML data files
* add tests for uid/context on record & function & root nodes (odoo,
  data, openerp) "inherited" by record & function
* add rng validation to the test cases to ensure technical
  capabilities are matched by validation capabilities (which was not
  the case as we could validate nonsense and import stuff which didn't
  pass validation or something)
* extact uid/context into its own rng pattern
  - add uid support to record validation
  - add uid support to root nodes validation
  - fix uid support on function validation: was typoed to @id, which
    is not used anywhere in function tags loading & makes no sense
    as far as I can tell
* replace get_uid/get_context by get_env & reimplement the whole mess:
  build a stack of environments from the root nodes (each root node =
  one env in the stack, though the exact same env can be present
  multiple times if none of the root nodes has a @uid or @context) and
  leaves can build upon this "ready made" environment for their own
  uses or use it as-is.

  As a result, all uid/context should now properly transfer from the
  root nodes to the leaves needing them
* fix support for context on functions: was not actually implemented
  as the context was not propagated into the old-style API call
* add uid support to record & context is now inherited from env
2018-10-11 15:00:22 +00:00
Xavier Morel 77b5911137 [IMP] core: convert_xml refactorings to prepare for improvements
* add _tag_ methods for root nodes (remove some of the parse special
  casing)
* remove unnecessary/useless returns
* remove cr & uid (there's an env)
* remove mode argument from callbacks (redundant and confused with
  self.mode)
* try to cleanup menuitem callback a bit
* make second callback param not optional (because it's not)
2018-10-11 14:59:51 +00:00
Christophe Simonis 1ade6675c3 [MERGE] forward port branch 11.0 up to 717f458394 2018-10-11 16:29:46 +02:00
Christophe Simonis 717f458394 [MERGE] forward port branch saas-15 up to 93c22558f3 2018-10-11 14:48:49 +02:00
Joseph CaburnayandNicolas Martinelli 3df584f5a6 [FIX] website_sale: click first image in carousel does not work
- Activate the `group_website_multiimage` in the website settings
- Add several images on a product
- On the eCommerce, click on the second image, then the first one

The click on the first image doesn't work.

This is because `t-att-data-slide-to="0"` is removed from the attributes
(probably because evaluated as falsy).

opw-1884368

Co-authored-by: Nicolas Martinelli <nim@odoo.com>
2018-10-11 14:25:05 +02:00
Christophe Simonis 93c22558f3 [MERGE] forward port branch saas-14 up to 77286e4296 2018-10-11 12:15:02 +02:00