Commit Graph
117341 Commits
Author SHA1 Message Date
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
jem-odoo dafb9b2638 [FIX] sale_expense: expense count of SO should be compute in sudo
Without this commit, reading all fields of sales
order will raise an access error if user does not
have access to hr.expense documents. An since
the expense count is displayed on the form view, this
can be annoying.
This commit makes the computation of the expense
count done by 'sudo', as there is not critical
informations at stake.
2018-05-22 11:52:19 +02:00
stefanorigano b637b5aeb8 [REF] hr_attendance: revamp design
Improve mobile layout, uniform templates design, simplify and revamp SCSS

Related to task #1822709
Closes #24645
2018-05-22 10:43:10 +02:00
stefanorigano 716640bb67 [FIX] hr_attendance: invert icons for sign-in/out
Set the right employee's possible states.

Before the restyling, the main title was always “Welcome!” regardless
of the user state (checked_in or checked_out). Using conditional titles
has exposed the issue.
2018-05-22 10:38:05 +02:00
Josse ColpaertandNicolas Martinelli bf65cd83ab [IMP] mrp: add check for unproduced finished lots
- Create a Finished Product tracked by SN
- Add a BoM with routing (in several steps) to that product: component A
  should be consumed in 1st step and component B in 2nd step
- Create a MO, plan it, go on the first WO and produce the finished
  product with SN 0001
- Then go on the second WO and produce the finished product with SN 0002
- Back on your MO, you'll see that
    Finished Product = SN 0002
    Component A has been consumed for SN 0001
    Component B has been consumed for SN 0002
- Mark the MO as done

No blocking error is raised so I'm consuming a product for a finished
product I'm not really producing. Traceability report will be wrong too.

We raise a blocking error to avoid this use case.

opw-1832098

Co-authored-by: Nicolas Martinelli <nim@odoo.com>
2018-05-22 09:45:47 +02:00
qdp-odoo e2864c87a2 [FIX] account: tax cash basis for supplier vendor bill
Fixes #24743
2018-05-18 17:04:09 +02:00
Prakash Prajapati 3cd7cf96d1 [IMP] im_livechat: improve live chat rating screen
Currently, layout for rating a chat is not looking so well.
This commit improves the rating layout. It will
 - Center the content (including smileys)
 - Enlarge the fonts (a little bit)
 - Underline the link instead of using italics (more intuitive)

Task : 1838321
PR : #24413
2018-05-18 15:00:15 +02:00
Thibault Delavallée ec5885ae5b [REF] mail: remove unnecessary headers in notification emails
Several contextual data is added in notification emails in their headers.
We consider as not necessary to put some of them, notably db uid. It should
not be used outside of Odoo and having Odoo-Objects should be sufficient
for people that want to categorize their emails.
2018-05-18 13:09:56 +02:00
qsm-odoo 7e59d30d9c [MERGE] web_editor: add the image cropping feature
Thanks to this merge, users are now able to crop their images using the
editor. This is done by clicking on a content image and then the crop
button appearing in the editor bar. Cropping an image will only crop the
image at the location it was clicked by creating a new image for that
location. Cropped images do not appear in the media dialog.

task-43706
Closes https://github.com/odoo/odoo/pull/22473
2018-05-18 12:16:28 +02:00
Kishan Gajjar d66e260391 [IMP] web_editor: allow cropping content images 2018-05-18 12:15:42 +02:00
Kishan Gajjar fd5cffe235 [ADD] web_editor: add new cropper lib 2018-05-18 12:15:42 +02:00
Olivier Dony 406df78f43 [FIX] hr: make field-level groups consistent
a696f84f1f adds a few extra fields to the
Private information tab of the employee form. As a result, HR personnel
and employees could reasonably expect these fields to be protected in
the same manner as the other private fields. Make it so.

Cherry-Pick of odoo/enterprise@533db05b5e

Fixes #18610
2018-05-18 11:21:46 +02:00
Darshil Trivedi ffb79761c1 [IMP] stock: rework of immediate transfers.
The transfers are either 'planned' or 'immediate' but the process are sensibly the
same. This commit separate clearly the two possible pickings (with a new boolean field)
and simplify the view of immediate ones. This kind of transfer is pretty straightforward
so only the 'Done' column remains and the text stays written in black.
2018-05-18 08:28:11 +02:00
Darshil Trivedi d9feb74ae8 [IMP] mrp: set default product quantity and unit of measure
At the creation of a manufacturing order, the default values for product_qty
and uom is respectively 1 and the product's one. We now use the the values
given by the bom
2018-05-18 08:28:11 +02:00
Darshil Trivedi 142e8fca2e [IMP] purchase: create purchase order without any purchase order lines.
On purchase orders, the scheduled date is mantadory. This date is computed from
the purchase order lines and hidden. If there is no purchase order line, the date
stays empty and it's not possible to save the PO.
This commit uses the order date as scheduled date if there are no PO lines
2018-05-18 08:28:11 +02:00
Nirali Sapra 47c34d2932 [IMP] stock: hide the source and destination location
This commit hide the column source location if the type is incoming and hide the
destination one if the type is outgoing. When picking type is 'vendor' then no
need of source location. If picking type is 'custmomer' there is no need of destination location.

This commit is related to task ID 59417
2018-05-17 15:02:05 +02:00
Nirali Sapra 2d8607bea7 [IMP] purchase : remove stat button with link to PO on the reordering rules
This commit is related to task ID 59417
2018-05-17 15:02:05 +02:00
Nirali Sapra fcb9fafcad [IMP] stock: remove force_assign method
This commit remove force_assign method in every tests of point_of_sale, purchase, sale_mrp,
sale_stock, stock and stock_account . This method is not longer used since V11.

This commit is related to task ID 59417
2018-05-17 15:02:05 +02:00
Nirali Sapra ec37a48013 [IMP] stock: 'validate' button in primary mode
This commit change the validate button in stock picking. It's now primary only when the
picking is in ready stage. Before this commit, this button was primary on waiting stage too.

This commit is related to task ID 59417
2018-05-17 15:02:05 +02:00
Nirali Sapra dc151cbd1c [IMP] mrp: remove the work order messages
This commit removes work order messages menu as it's not used anymore since V11 in the new WO screen

This commit is related to task ID 59417
2018-05-17 15:02:05 +02:00
Xavier Dollé f555bfeca3 [FIX] mail: correctly filter needaction on unread notifications in message_format
Previously to this commit needaction used by JS was not taking into account
read notifications. It means notably Inbox counter could be higher than
expected as taking into account read messages while Inbox displays only
unread messages. This commit fixes that by checking notification state when
giving needaction_partner_ids to message_format result.

This fix has a small impact on performances as message_format is used in
notification process for chat or push. A better implementation of message
format and its postprocess could probably lessen this fix impact. As we
target stable version we avoid rewriting other part of the code. Optimization
will be done in development version.

Related to task ID 1841243. This is a manual forward port of commit 69714fbeee
done in saas-11.2.
2018-05-16 16:17:59 +02:00
Raphael Collet 6a601fe6dc [IMP] test-pylint: check for undefined variables 2018-05-16 13:58:39 +02:00
Thibault Delavallée 96a223a5f0 [IMP] mail: prevent creation of activities to users that have no access to document
This commit is related to task ID 58968 . Closes #24176.
2018-05-15 15:42:54 +02:00