Commit Graph
117363 Commits
Author SHA1 Message Date
Géry Debongnie 20454038d0 [IMP] web: small optimization in calendar view
In some cases, the calendar view sends a trivial domain, such as
["partner_id", "not in", []]

This is clearly not really useful, and it could hurt performances in
some cases (for example, if the partner_id field is a related on a large
table, and non stored).

This is clearly not a complete fix, but it is easy, safe and does not
hurt.
2018-05-29 09:34:55 +02:00
Gert Pellin 59636caeba [imp] sale_expense: Make expenses re-invoicing easier
Change the data of the product Expenses : https://drive.google.com/a/odoo.com/file/d/1N0jW9QDQ35-5EY13fAsDIwuW8HHUXi-3/view?usp=drivesdk
When creating a new expense product from the Expense app, the invoicing information should be Delivered and At cost by default  https://drive.google.com/a/odoo.com/file/d/1IoqYU8I5MBaeabQJOvQoO-NQl1RK2yPy/view?usp=drivesdk

project : RD for Dummies
task : [Expense] EXP product
2018-05-28 16:58:36 +02:00
Benjamin Stiens 6383120f3b [IMP] all: Improve error messages
Many error messages are misleading or too "vague"
This task aims to improve all error message.

Task #47042
PR #23321
2018-05-28 16:45:48 +02:00
William Henrotin c9735c75d6 [IMP] base: prevent to archive users linked to active partners.
An active user could not see messages in its inbox if his partner is
archived. With this commit, we cannot archiving a partner linked to an
active user anymore.

In the opposite way:

 -if we deactivate a user, warning message is given saying the related
  partner will stay active. A link to the related partner is also given
  if we really need to archive it;
 -if we activate a user, the related partner will be set as active;

This commit is linked to task ID 46158. Closes #24628.
2018-05-28 14:43:06 +02:00
Géry Debongnie d9c035ae42 [FIX] web: do not hide button in pdf viewer in some cases
The pdf viewer uses an external library to display a pdf file.  This
library displays a few controls, such as a 'Download' button.  However,
this button is sometimes displayed in the top bar, sometimes in the top
right dropdown menu (depending on the size of the widget).

For some unknown reason, the pdf viewer widget disabled the download button.
But this was inconsistent: the download button was only hidden when it
was in the tob bar, and not in the dropdown menu.  With this commit, we
simply remove this behaviour.
2018-05-28 14:33:07 +02:00
Siddarth Gajjar aa54457fe8 [IMP] auth_signup: make password set template a catchy first contact template
I think spec is pretty clear: "The current email to invite new users is poor
and not catchy! Such email is the first contact with Odoo for most users. It
needs to be perfect!""

This commit is related to task ID 1839609. Closes #24576.
2018-05-28 13:29:57 +02:00
Thibault Delavallée 6502c98b99 [FIX] web_settings_dashboard: lessen constraint on email when inviting
Even completely valid simple email like alfred+toto@example.com was not
considered as valid. As email may contain a lot of characters and strange
stuff let us be less strict on validation.

This commit is related to task ID 1839609. Closes #24576.
2018-05-28 13:29:48 +02:00
Christophe Simonis 42ad3da366 Revert "[FIX] l10n_be: fix installation of module"
This break installation of `payment` module.

This reverts commit 98fa196e00.
2018-05-28 11:35:29 +02:00
Pankaj KamaniandMohammed Shekha 1a7815f8b7 [IMP] web,base_setup: add option to disable special effects
Some people prefer not to be disturbed by any flashy information.  In
this commit, we add an option to do just that.  When the 'show_effect'
option is set to false, then the messages that would be displayed by an
effect will be displayed in a notification.

Task #37712

Co-authored-by: Mohammed Shekha <msh@openerp.com>
2018-05-28 11:14:20 +02:00
Christophe Simonis f65528a74e [IMP] http: avoid saving sessions for some endpoints
Endpoints can be explicitly marked as `save_session=False` (default is
true across the board). In that case they will have an in-memory session
(either the existing one or a brand new one) but the session won't be
persisted to disk.

Currently used for non-browser RPC endpoints: the APIs don't use
cookies/sessions and we can't assume the RPC libraries keep cookies
across calls. This means a new session is created and saved to disk for
each RPC calls, for no useful reason.
2018-05-28 09:48:29 +02:00
Thibault Delavallée caa1ead00a [MERGE] mass_mailing: improve action buttons and ease mass mailing scheduling
Purpose of this merge is to clearly distinguish sending a mass mailing from
scheduling it to a future date. Currently both options are a bit mixed and
not obvious. Now buttons are separated. Scheduling opens a small wizard
allowing to choose the date.

Some computation of sent and scheduled date are also fixed to be cleaner.

This merge is related to task ID 46932. Closes #24465.
2018-05-25 17:03:18 +02:00
qdp-odoo 98fa196e00 [FIX] l10n_be: fix installation of module
The previous commit https://github.com/odoo/odoo/commit/7a31a92afa9a2ad280a6ec110fc9547e48b89466 removed the liquidity transfer account template to replace it with a system of prefix like we already had for bank/cash accounts. However, that transfer account template was used as account_id in an account.reconcile.model.template object.

To fix that, at the creation of chart template (using _update() of ir.model.data, because we need to have the module/xml_id reference) we create the account.account.template and its xml reference in ir_model_data table

Was OPW https://www.odoo.com/web?#id=1851523&action=333&active_id=1278&model=project.task&view_type=form&menu_id=
2018-05-25 16:49:08 +02:00
qdp-odoo 82592edaba [REF] account: removed company_id field on account.chart.template
Because that field doesn't have any meaning on a template object...
2018-05-25 16:49:08 +02:00
Barad Mahendra bd4daccb9b [IMP] mass_mailing: reset schedule_date when canceling mass mailing
Otherwise if you make a mistake, cancel and reschedule a mass mailing
schedule date is not correctly set.
2018-05-25 16:23:54 +02:00
Barad Mahendra 419b4659ca [FIX] mass_mailing: fix mass mailing sent date computation
Currently when you click on send now button or schedule button it will enter
current date as sent_date while the mailing list is still in queue. Actual
sent date will be the date when the mail is sent.

Related task ID : 46932
2018-05-25 16:23:48 +02:00
dip-odoo bbda48231c [IMP] mass_mailing: add schedule button that opens a wizard for scheduling date
Purpose of this commit is to re-arrange mass mailing buttons and to add
a button for scheduling mass mailing in future :

 * add schedule date in debug mode;
 * re-arrange all button;
 * add schedule in future button and on click open wizard to schedule future
   date;
 * on 'send now' button remove the useless '|' in domain;
 * add a small wizard to select the send date;

This commit is related to task ID 46932
2018-05-25 16:23:48 +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
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
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
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
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
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
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
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
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
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
jem-odoo 8d4609a1db [MOV] purchase: move file in purchase_stock 2018-05-23 10:13:48 +02:00
jem-odoo 9548d218f1 [IMP] purchase: make purchase report extendable
The idea is to do like the sale report: being
able for other modules to extend the report and
add their own fields. As we are going to split
stock from purchase, we will need this.
2018-05-23 10:12:45 +02:00
RomainLibert db649229a1 [FIX] pos: rename pos_pricelist_setting
To avoid two fields having the same label we rename this one.
2018-05-22 18:07:03 +02:00
Pierre Masereel 7e6b259c78 [FIX] stock: is_initial_demand_editable computation
When we perform a planned transfer (which is the default behaviour now)
we are not able to set a quantity done on move lines in a confirmed
move because, the field 'is_initial_demand_editable' is true but should
not.

To fix this, we set 'is_initial_demand_editable' to true when it is not
a planned transfer AND the state of the move is draft, which is the
desired behaviour.

This behaviour come from rev:https://github.com/odoo/odoo/commit/ffb79761c1225c8a9c9303db4781f1b40b5d9944
2018-05-22 17:13:45 +02:00
Ankit Joshi e434690fe3 [IMP] pos: ease starting steps by adding general settings
In order to facilitate the usage of the pos app, we need to add a global
settings menu (res_config_settings).

Related to task #34026
Closes #19443
2018-05-22 15:44:34 +02:00
Darshil Trivedi 4699f3c2bf [IMP] stock: scheduled date as current datetime on return.
When a picking is returned, the scheduled date stay unchanged. This date can be
in the past if the return is made at least one day after the transfer. This commit
set the return day as scheduled date
2018-05-22 15:00:30 +02:00
Darshil Trivedi 7eff8d39a7 [IMP] stock: add scheduled date on picking.
When a picking is in 'Done' state, we add the effective date on the form in
addition to the effective date. The user can know the date when the picking was effectively
made.
2018-05-22 15:00:30 +02:00
Mathieu Duckerts-Antoine e7ecdb8c46 [MOV] mail: move crons into their own data file
Purpose is to avoid mixing various data types in the same generic mail_data
file. We already have 2 crons and the upcoming moderation feature will add
some more. Let us put them in their file to ease the finding.

This commit is linked to task ID 29521.
2018-05-22 12:29:08 +02:00
William Henrotin f7cda99d20 [FIX] stock: correct picking view
The commit ffb7976 introduce a wrong domain in the picking form view.
This commit correct it to the previous value
2018-05-22 11:58:53 +02:00
Hiral Bhavsar 0ccf63cae4 [IMP] sale: new test cases for sale
This commit provides a test suite for sale flow and unit tests.
We split tests in different files to try regrouping them by
testing purpose:

1/ test_access_rights.py checks employee, sale person, sale manager
and portal access rights. It is executes in post-install mode to be
sure other addons does not break the security rules.

2/ test_onchange.py checks the onchange using the SFF mecanism in
order to simulate what a sale person really does in its day-to-day
job.

3/ test_sale_pricelist.py execute a sale flow with different pricelist,
as this is a delicate aspect.

4/ test_sale_to_invoice.py contains tests about refund, discount and
downpayment, as none of those were tested.

Task #43928
2018-05-22 11:52:51 +02:00
Hiral Bhavsar ef37686b2a [MOV] sale: 'test_product_id_change' to 'test_onchange'
Renaming this file as, in next commits, we
will add more tests about onchange in that
file.

Task #43928
2018-05-22 11:52:44 +02:00
jem-odoo 13a9e4d93a [FIX] sale: missing triggers on invoice_ids
As 'invoice_ids' on sale.order is a computed field, creating
a refund should invalidate this field as 'invoice_ids'
should contain invoices, refunds, ...
When using the refund wizard, the credit note will be linked
to the SO lines (see `_refund_cleanup_lines` override in sale).
Without the new trigger, invoice_ids will not be recomputed, and
executing 'sale_order.invoice_ids[1]' will not return the refund
account.invoice.
This commit fixes it.
2018-05-22 11:52:37 +02:00
jem-odoo c71ee8e2d2 [FIX] sale: stop browsing recordset
`currency_id` variable is a recordset, so stop browsing it again !
In the meantime, if those variable had a meaningfull name, this
error would never occured !
Coming from 7a282c9965
2018-05-22 11:52:30 +02:00