Commit Graph
117975 Commits
Author SHA1 Message Date
Christophe Simonis 37eed7c509 [MERGE] forward port branch saas-11.2 up to 58e3552246 2018-05-25 14:34:18 +02:00
RomainLibert 8db7869f4d [FIX] hr_expense: change _employee_filter into _get_employee_id_domain
The change was done at one place but not the other
2018-05-25 12:45:34 +02:00
Nicolas LempereurandGoffin Simon 7703f1fb16 [FIX] mass_mailing: have unsubscribe in multi lang
Since 953a693df link not corresponding to a route are tought multilang
by default.

Thus in the mass mailing, if the user had not the default language on
the website he would have eg. a /fr_FR/unsubscribe_from_list placeholder
in the mail.

The placeholder is replaced by a real link pinpointing to the items the
given person would unsubscribe to, but having /fr_FR/ part prevented
that.

With this PR, there is a dummy route so /unsubscribe_from_list is
explicitely known as not multilang.

opw-1850696
closes #24912

Co-authored-by: Goffin Simon <sig@odoo.com>
2018-05-25 12:16:30 +02:00
RomainLibert 5c24368e33 [IMP] hr_expense : improve access rights of manager/officer
Currently the distinction between expense officers and expense managers
doesn't make sense because they both have the same rights.

This commit aims at making a clear difference between an officer and a
manager.

After this commit the rights will look like this :

  * Expense Manager :
  	- See and approve any expense

  * Expense Officer :
  	- Can see and approve the expenses of employees in his department
	  or employees for which he is the manager (field parent_id on
	  hr_employee)

	- Cannot approve his own expenses

  * Simple user :
  	- Can only see his own expenses

	- Can only send his expenses to a manager (either the manager of
	  his department, his direct manager [parent_id field] or an
	  expense manager)

Related to task #51520
Closes #23033
2018-05-25 11:52:17 +02:00
Christophe Simonis 58e3552246 [MERGE] forward port branch 11.0 up to 2ca7296000 2018-05-25 11:50:02 +02:00
Christophe Simonis 2ca7296000 [MERGE] forward port branch saas-15 up to dbb2b9bf73 2018-05-25 11:08:39 +02:00
Thibault Delavallée d58c77b1ee [MERGE] mail, calendar: improve daily use of activities through usability improvements
See subcommits for more details. Related to task ID 1838315. Closes #24513.
2018-05-25 11:02:33 +02:00
Darshil Trivedi 788feb9537 [IMP] calendar: set record name as default when scheduling a meeting-based activity
Purpose of this commit to improve scheduling of meetings with activities.
If summary is empty use record's name as name of meeting to speedup the
flow.

This commit is related to task ID 1838315
2018-05-25 10:59:59 +02:00
Darshil Trivedi 03fe5a8a70 [IMP] mail: improve usability of activities
This commit improves the daily use of activities through some small updates

 * on hover of clock icon in kanban card display tooltip. Purpose of this
   change is to clarify meaning of colors displayed in kanban view. Otherwise
   just havign a color is not very meaningful;
 * add days string in planned in column;
 * add space between number and days in planned in field;

This commit is related to task ID 1838315.
2018-05-25 10:58:24 +02:00
Aaron Bohy 04ba755f82 [FIX] web: AbstractController: handle concurrent reloads
Let's assume the following scenario in a Kanban view with a default
filter. The user removes the filter, and quickly adds a new one.
On a slow network, it may happen that the second reload request
returns before the first one. On odoo.com, this is easy to
reproduce on the tasks Kanban view.

Before this rev., when this occured, the result of the first
request was displayed, whereas it should have been ignored as
another request was done later on.
2018-05-25 08:11:49 +02:00
Christophe Simonis dbb2b9bf73 [MERGE] forward port branch saas-14 up to cafe56da80 2018-05-24 19:40:05 +02:00
Toufik Benjaa b2aab354c4 [FIX] payment: Remove lang when creating payment transaction
- Having a lang set when trying to create a payment transaction can cause issues due to uninstalled langs on the database.
2018-05-24 19:24:26 +02:00
Christophe Simonis cafe56da80 [MERGE] forward port branch 10.0 up to 3051d1dd2f 2018-05-24 18:24:12 +02:00
Christophe Simonis 3051d1dd2f [MERGE] forward port branch 9.0 up to 34f567dd39 2018-05-24 16:55:28 +02:00
Christophe Simonis 34f567dd39 Revert "[FIX] mass_mailing: unsubscribe not working in multi lang"
commit a3ab33f212 introduced invalid code
2018-05-24 16:50:09 +02:00
LofbergValentin 6e1b660f9c [FIX] hr_attendance: Keep the kiosk session alive
closes #1800442

Purpose
=======

Odoo sessions are expired when no action has been triggered
for the last 7 days. For kiosk mode, this doesn’t make sense.

It means that once a week, a person with the rights to the
employee under kiosk mode, has to come to the screen and log in again.

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

Trigger an action to keep the Odoo session alive.
2018-05-24 16:47:12 +02:00
Christophe Simonis 299b613da3 [MERGE] forward port branch 9.0 up to 919a1af936 2018-05-24 16:31:23 +02:00
Goffin Simon f9ce42c763 [FIX] sale_timesheet: ZeroDivisionError
To avoid a division by zero.
Courtesy of @tbe-odoo

opw:1850023
2018-05-24 16:29:12 +02:00
jem-odoo 919a1af936 [FIX] purchase: correct product cost in reporting
product.product inheritS from product.template, and they both
define the 'standard_price' field, but implement it differently;
 - product: the field is a company dependent one (so non stored)
 - template: the field is a computed one based on tis variants

For the first case, since the field is not stored in database, when
doing SQL query, we have to get the value from the table ir_property.
That is what purchase report does, but instead of searching on resource
'product.product', it does it on 'product.template'. There are
obviously no entries in ir_property table for 'standard_price' field
on product template. As consequence, the "product value" (cost)
is always null in purchase reporting.
This commit fixes that by modifying SQL query to get the good
value from ir_property table.
2018-05-24 16:21:06 +02:00
Rémi Rahir 58acf26ea4 [IMP] web: improve act_url
By default, Chrome browser will block pop-up windows which will block
all actions from type act_url with a different target than 'self' (i.e.
'_blank').
This commit adds a check when such an action is called and sends a
warning in the web client when it fails to open. This mimics the
behaviour already present for the report actions.
2018-05-24 15:47:43 +02:00
Nicolas Lempereur 56e3100a0b [FIX] stock: remove return return test dead code
In saas-11.2, the traceability has been rewritten and there is no notion
of upstream/downstream, also the code tested seems to have become dead
in some instance (in particular: the one this test tested), so will be
improved soon.

opw-1845444
closes #24887
2018-05-24 15:35:58 +02:00
qdp-odoo 2a3048316e [REF] account: removed company_id on account.tax.template
Because this field doesn't have any meaning on a template object...
2018-05-24 15:14:54 +02:00
xmo-odoo 4ac7820afb [IMP] export: move XIDs management to end of export & batch further
* export benches for m2o
* tag benches instead of requiring editing the source to enable them
* dump the profiling stats intead of saving to disk (less convenient
  for complex analysis but way more so for simple overview)
* add M2O benching in addition to the existing integer-based one in
  order to expose problematic behaviour when exporting significant
  numbers of non-shared relational records (& quantify impact of
  creation v read)

Following odoo/odoo#22493 the performances of exporting XIDs was
greatly improved by batching XIDs and avoiding the ~3 SQL queries per
xid/record when no xid exists yet.

*However* the batching was done per call of _export_rows and to handle
relational fields _export_rows calls itself recursively leading to
sub-standard xid batching:

* for M2M and O2M fields, some batching would happen on a
  parent-record basis, each M2M or O2M field (in a parent) would be
  xid-batched, but two parent records wouldn't see their children
  xid-batched together
* for M2O, there would be essentially no batching with a call to
  __ensure_xml_id per record and while less queries than before in the
  worst case more complex ones in fact

Change: rather than ensure XIDs exist when performing the export, add
XIDs export as a post-processing of the exported records table. This
way, each involved model can be entirely batched and exporting 10000
records's (id, value_id/id) 2 calls instead of 10001.

Also rename _export_rows's recursion parameter for clarity, it has
clearly outgrown its use as a batch invalidation flag and the name
is now less than clear.

Furthermore _-prefix & mandate kwarg usage to make it clearer it's not
really a "public" parameter, and is intended as an internal recursion
flag.
2018-05-24 14:50:13 +02:00
xmo-odoo a06066b920 [IMP] merge auth_crypt into base
* store hashed passwords in the `password` column but gate it behind a
  computed field
* make the password field essentially write-only (SQL aside)
* add a "plaintext" hash type so it's possible to set the password in
  SQL directly & be able to login & have it automatically updated

Task 34211
2018-05-24 14:43:31 +02:00
Yannick Tivisse 28179bc8cb [IMP] base: Add support for private addresses
This is a backport of commit https://github.com/odoo/odoo/commit/2f15a5fa647d55df36c9019df467802a3aa9b4e3

Purpose
=======

Add the possibility to create private addresses, only accessible for a subset
of users.

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

- Add a new 'Private' partner type
- Add a res.groups in base 'Access to Private Addresses'
- Add ir.rules for the following behavior:
    - Every employees/internal users can read non-private addresses
    - Only users in group_private_addresses can access private addresses
- Add in base a simplified form view for private addresses

The following points won't be backported:
- A HR Officer is automatically granted in group_private_addresses
- Use the simplified form view to open the address_home_id form on employees
That's because it requires to update 'base' to make it work. If a user only
update 'hr', this will break his instance while 'base' isn't updated.

But these modifications can be applied manually quite easily.
2018-05-24 13:53:46 +02:00
rrahir cb8682607e [FIX] web: correct style on btn-link class (#24889)
Due to the switch from less to scss, changes were made. Especially, the
class oe_link is now 'deprecated' and interpreted as 'btn-link'. The
previous style defined on the latter removed the padding which breaks
the style when several buttons follow each other.

This commit should fix the style while maintaining the intended behaviour, 
a vertical alignment between the button and the text inside the pane.
2018-05-24 12:52:06 +02:00
Romain Derie 683b432315 [IMP] website: add 'Delete Page' button in page properties dialog
With this commit, it is now possible to delete a page directly from it's page
properties dialog.

Before this commit, you had to go into the page manager and then find your page
that could take some time.

task-1850578
Closes #24861
2018-05-24 10:54:16 +02:00
Jeremy Kersten 0179b4370b [FIX] stock: error during fwd-port 2bc6ea1b37 2018-05-24 10:01:57 +02:00
oco-odoo c9b7cf140c [IMP] account: always properly display the invoices reconciled with payments
See https://github.com/odoo/odoo/issues/20804

We don't turn invoice_ids into a computed field, because we need it erverywhere for technical reasons. Instead, we use a new computed field only there to ensure consistency of the displayed data.

Was task: 1819501
Was PR #24290
2018-05-24 10:00:53 +02:00
Rémi Rahir 4c08e2a945 [FIX] iap: install web_settings_dashboard along with iap 2018-05-24 09:56:02 +02:00
Goffin Simon a3ab33f212 [FIX] mass_mailing: unsubscribe not working in multi lang
When installing the website with a lang  different than the one set
on the user, the button unsubscribe in the mass mailing snippets
didn't work because the unsubscribe link contains the code of the
language. The function send_get_email_dict in model mail.mail didn't
expect this behavior and so couldn't set the right unsubscribe link
in the mail.

opw:1850696
2018-05-24 09:46:36 +02:00
LofbergValentin 80c03bcd72 [FIX] website_sale: fix the missing action on checkout form
Remove wrong attr name '/shop/checkout' and add the action '/shop/address'.

It allow others routes to render the form, and that the submit form is handled
by the default checkout process.

Todo: make this 'action url' as an argument
2018-05-24 09:32:17 +02:00
Joren Van Onder 1e21b79feb [FIX] website_quote: install sale_payment together with website_quote
Stable version of 65a589eb54 (reverted
at 935043dda1) that doesn't cause the
following errors:

odoo.modules.graph: module website_quote: Unmet dependencies:
sale_payment

on existing databases without sale_payment installed.

A downside of this approach is that sale_payment can be uninstalled
without uninstalling website_quote. Adding an uninstall_hook to
sale_payment could solve that, but it wouldn't warn the user
website_quote would be removed in the "Uninstall module"
wizard. Keeping in mind this is only a temporary hack for stable,
keeping sale_payment installed in this case shouldn't cause any
issues.

opw-1847977
2018-05-23 13:51:15 -07:00
Christophe Simonis 2bc6ea1b37 [MERGE] forward port branch 11.0 up to 02ee3fd88e 2018-05-23 19:33:40 +02:00
Christophe Simonis 02ee3fd88e [MERGE] forward port branch saas-15 up to 1b81f1a5c9 2018-05-23 18:36:28 +02:00
Christophe Simonis 1b81f1a5c9 [MERGE] forward port branch saas-14 up to 373a1c1128 2018-05-23 18:34:28 +02:00
Christophe Simonis 373a1c1128 [MERGE] forward port branch 10.0 up to 682ae1cc64 2018-05-23 18:30:36 +02:00
Christophe Simonis a496ca981c [FIX] stock: move company initial setup logic in model
Followup of 4e71bd5caf
2018-05-23 17:07:28 +02:00
qdp-odoo 01216345e2 [REF] account,payment(_*),sale*: downgrade transactions into debug items
It was very confusing for the user to distinct account.payment and payment.transaction. From now on, the transactions are
technical objects and, in the backend, we only refer to it in log messages (Front end will be adapted in the same fashion
later on). They are hidden in debug mode in accounting\configuration\payments as their purpose is now purely technical/log

This commit also aims to reduce the gap between the accounting app and the transactions: account.payment objects are
created/validated upon completion of transaction.

To ease the capture/voiding of pending transactions, the related buttons are now displayed directly on the SO/invoice
instead of the transactions.

Was task: https://www.odoo.com/web#id=35857&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720
Was PR #24043

[FIX] add domain based on journal to payment tokens

Was opw: https://www.odoo.com/web?debug#id=1828206&view_type=form&model=project.task&menu_id=5200
2018-05-23 15:44:55 +02:00
Laurent Smet 7a31a92afa [ADD] account, l10n_*: create transfer account based on prefix.
This commit changes the mechanism to get the transfer account.
As the bank/cash accounts, the transfer account is now created automatically based on
a prefix.

-task: https://www.odoo.com/web#id=35857&action=333&active_id=967&model=project.task&view_type=form&menu_id=4720
2018-05-23 15:43:39 +02:00
Josse Colpaert 73e213edef [FIX] stock: non-tracked products should follow FIFO removal strategy too
In a warehouse, mostly most of the products have no lot.  It stays
important however to avoid having old products in stock, certainly if
we can distinguish them by pack or location.

As now in stable, in_date is not put on the quant for non-tracked products,
databases might mix quants with and without in_date of the same product.
We should see those without in_date as the oldest.
That is why we need to be able to apply a ASC NULLS FIRST (ASC is NULLS LAST by default) for FIFO
or DESC NULLS LAST for LIFO.

In order to do that, we copied the code from the _search method of the ORM to
be able to do this special order as the orm itself is restrictive as it
supposes the order itself has no spaces.

We adapted and added some tests to check it handles the combination of NULL/NOT NULL well.
2018-05-23 14:38:13 +02:00
Nicolas Martinelli 0b412c250a [FIX] website_sale_delivery: selection at first rendering
- Set up as a shipper with the highest priority one which will cause an
  error (e.g. service not available for customer address)
- Order a product on eCommerce, go to Payment page

Nothing prevents to click on the 'Pay Now' button, although the shipper
rating has failed. Moreover, the error is not displayed in the label of
the shipper.

Workaround: we force a click on the selected default shipper to trigger
the update. The good solution would probably be to have a completely
dynamic shipper rating integration, instead of some processing at first
rendering and then extra dynamic processing.

opw-1838765
2018-05-23 13:17:15 +02:00
Kishan Gajjar 5766fac388 [IMP] web_editor: highlight the selected image/icon
When we selected an image/icon, there was no visual feedback explaining
to the user that the image/icon had been selected (except for images on
chrome).

task-35020
Closes https://github.com/odoo/odoo/pull/24160
2018-05-23 11:57:49 +02:00
Goffin Simon 04dd688091 [FIX] account: wrong view from button "Invoices" from a payment
When clicking on button "Invoices" from a payment, it always displayed
the supplier views instead of taking care about the type of the payment.

opw:1849397
2018-05-23 11:37:35 +02:00
Yannick Tivisse 473c74f636 [IMP] various: Override _(name_)search instead of (name_)search
Purpose
=======
The method _name_search and _search add support to search as another user.

All the overrides of name_search and search redefine the behavior of the search.

This bring inconsistencies as the result of a call to _name_search and name_search
could differ on certain modules, which is not acceptable.

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

Example:
~~~~~~~~

If the name_search method is overridden to search also on the driver name,
then calling name_search with a label 'JF' will return all the cars with a name containing
'JF' or all the cars with a driver name containing 'JF'. Let's say that we have a ir.rule
preventing a user to read the cars of another company. Then the call to name search only returns
the cars satisfying the previous condition AND belonging to his company.

Now, we want to overpass this constraint. We call _name_search with the attribute name_get_uid=1.
Then the call to _name_search returns all the cars from all the companies with a name like 'JF',
but nothing is done about the driver_name.

Example of wrong search redefinition on a model
-----------------------------------------------

    @api.model
    def name_search(self, name, args=None, operator='ilike', limit=100):
        domain = args or []
        domain = expression.AND([domain, [('name', 'ilike', name)]])
        partners = self.env['res.partner'].search([('name', operator, name)])
        if partners and name:
            domain = expression.OR([domain, ['|', ('driver_id', 'in', partners.ids), ('driver_id', '=', False)]])
        rec = self.search(domain, limit=limit)
        return rec.name_get()

Example of correct search redefinition on a model
-------------------------------------------------

    @api.model
    def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
        domain = args or []
        domain = expression.AND([domain, [('name', operator, name)]])
        partner_ids = self.env['res.partner']._search([('name', operator, name)], access_rights_uid=name_get_uid)
        if partner_ids:
            domain = expression.OR([domain, ['|', ('driver_id', 'in', partner_ids), ('driver_id', '=', False)]])
        rec = self._search(domain, limit=limit, access_rights_uid=name_get_uid)
        return self.browse(rec).name_get()

The same logic should be applied on the overrides of the search method.
2018-05-23 11:15:46 +02:00
Simon Lejeune 565277acbb [REF] base: assets: fallback on sassc if libsass not present 2018-05-23 11:05:03 +02:00
Géry Debongnie d01787c19d [IMP] web,mail: improve search view for mobile devices
With this commit, we introduce a better screen to manipulate the search
view in a mobile device.

Note: most of this work was initially done by suh-odoo, then was adapted
and moved to community by myself.

task 31464
2018-05-23 10:48:36 +02:00
jem-odoo 4232eb7bcd [MERGE] purchase_stock: split stock from purchase module
For historical reason, purchase depends on stock module. We now
plan to add purchase feature for services. A service company will
not be interessted by having stock install when they do service
purchases. So this commit breaks this dependency by creating a
new bridge module named 'purchase_stock'.
No functionnal behavior should have changed, this commit only
move code.

However, some points need to be highlighted:
* The purchase report was split, the same way sale report is. Installing
stock will just add a few addionnal informations to the SQL views.
* Since test cases depends on stock demo data, the basic purchase
addon does not contain tests, but this will come in futur tasks.
* consu and service product's receieved quantity can be manually edited,
when stock is not installed. The same mecanism to compute this quantity
done
in sale (for delivered qty) will be implemented later.

Thanks to @amoyaux and @pimodoo for their reviews.

Task #47927
2018-05-23 10:20:06 +02:00
jem-odoo 0a5b1cef36 [IMP] purchase,purchase_stock: received qty edition
When stock is not install and using purchase alone, user
should be able to edit received quantity manually for
consummable (and services) products.
This is a direct consequence to the split of purchase
and stock module.
2018-05-23 10:13:49 +02:00
jem-odoo e38ed7c780 [MOV] purchase_stock: move code from purchase
We want to break the dependency between stock and purchase
for our furtur developpement. For more modularity, a new
bridge module 'purchase_stock' is created.
This commti move part of business code, views, data, ...
related to stock management from purchase into purchase_stock
without changing any feature.

Task #47927
2018-05-23 10:13:49 +02:00