Commit Graph
96801 Commits
Author SHA1 Message Date
Lucas Perais (lpe) 2e109db01b [FIX] web: context orderedBy not propagated to x2m
Have:
- Model A with a x2m to model B
- Object A with multiple objects B in x2m (that will be sorted)
- On the list view of model A, click on a column to sort by a field
- this field shall not exist in B
- open a record A (towards form view)

Before this commit, the sorting of the x2m crashed, because the key orderedBy was propagated
Due to commit e713ed2a69

After this commit, it doesn't crash

OPW 1913133

closes odoo/odoo#29094
2018-11-28 09:35:39 +00:00
Prakash Prajapati 679cf0d83f [FIX] purchase_requisition: Request Approval on exclusive requisition
Usecase to reproduce:
- Enable 'Managers must approve orders'
- Set agreement type as 'exclusive'
- Connect as purchase user
- Create a requisition and an RFQ linked to it
- Confirm the RFQ

It raises a usererror that ask to close other PO linked
to requisition.

It happens because the purchase requisition code do not take
care of double validation on PO. It will try to close the requisition
once button_confirm is called. However it will only write 'to approve'
on PO state and thus trigger the requistion error will be raise since
all linked PO are not 'done' or 'cancel'.

In order to fix it, the action_done on requisition should be call
on button_approve instead of button_confirm. (button_approve is
automatically called when double validation is not enable).

Task: #1884410
Closes #28068

closes odoo/odoo#29049
2018-11-28 04:51:02 +00:00
Andreas Perhab 54472d9c13 [FIX] website_sale: check that date_order is set before comparing it
closes odoo/odoo#28668
2018-11-14 11:17:15 +00:00
Martin Trigaux 4d89b5e70b [FIX] mail: invite: use proper translation terms
Fix translation placeholders in invite wizard, to make them easier to
understand for translators. Also rework the message generation code
to ensure proper XML structure.
2018-11-03 17:56:13 +01:00
XavierDo bb8df1b79a [FIX] mail: verify attachment access early to avoid errors later 2018-11-02 11:25:42 +01:00
Lucas Perais (lpe) a1ba5ba4b3 [FIX] account: view for invoice lines that doesn't rely on 'parent'
This commit tackles the issue of having the pseudo-object 'parent' in the
invoice lines views

In the regular o2m, parent refers to the current invoice

From commit eca030cc38
we learn that parent.get() is not a valid field according to python

From OPW 1912243, we learn that:
- when the invoice line form view is standalone (not popped from the o2m)
'parent' is not what we expect (in this case it will refer to the record list of all invoice lines, NOT the invoice)
- parent.type in that case is undefined and makes the JS crash

So, to make sure we retrieve the right field and value, we retrieve them through
related fields pointing to the invoice

closes odoo/odoo#29074
2018-11-27 14:41:27 +00:00
Lucas Perais (lpe) b1828c01d8 [FIX] hr_expense: create expense from email with taxes
Have an expense product with a supplier tax on it

Write an email to be caught by the thread model to create an expense for that product

Before this commit, the tax was not set up on the expense

After this commit, it is

OPW 1908596

closes odoo/odoo#29061
2018-11-27 11:00:55 +00:00
Lucas Perais (lpe) 23313583b2 [FIX] web: progressbar updates on field reset
Have a form record with a progress bar
Modify the max_value of the progress, as well as the current_value bar through an onchange

Before this commit, the new max_value was not taken into account

After this commit, it is.

closes odoo/odoo#29056
2018-11-27 08:53:17 +00:00
Lucas Perais (lpe) 4be90e98d7 [FIX] sale: sales team target set on kanban
Have a sales team without a target in the kanban view
click on define a target

Before this commit, the veiw wasn't rerendered, so the change apparently did not happen
(while the write was triggered)
Also, the Enter key did not work to validate the input

After this commit, the view is refreshed and the enter key works

OPW 1906938

closes odoo/odoo#29055
2018-11-27 08:49:48 +00:00
len-odoo c0f66d6c2d [FIX] mail: create attachments with the correct filename when using the popup editor
Send a message using the popup editor.
Drag and drop an image into the message content.
It will create an attachment for the inlined image.
To generate the values for the attachment, a regex is used to parse the content.
Besides summoning Eldritch abominations, it didnt't take into account the
original filename, whereas the default one (image) would have no extension.
We extend the regex to capture the filename and use it.

opw 1903194

closes odoo/odoo#28527
2018-11-09 12:09:51 +00:00
len-odoo 5c2f96d0dd [FIX] mail: create attachments on the correct record when using the popup editor
Send a message using the popup editor.
Drag and drop an image into the message content.
It will create an attachment for the inlined image.
However it did give a res_model value of mail.message but no res_id;
add_missing_default_value would fill in the res_id from the _context, which is
not the mail_message but the current object on which it applies
(e.g. helpdesk.ticket).
We put the correct res_model along with the res_id.

opw 1903194

closes odoo/odoo#28526
2018-11-09 13:28:07 +00:00
Lucas Perais (lpe) ac5a1662f2 [FIX] web: propagate can_create into the search popup
When creating a SO line and clicking on search more for product_id

Before this commit, every user had the button "Create" to create a product.product

After this commit, only user in groups that actually can create a product have the button

OPW 1910371

closes odoo/odoo#28924
2018-11-26 14:54:21 +00:00
Julien (juc) Castiaux 5c38c87ddd [FIX] mail: access error for the id of another company
When creating a mail for a user in an other company then the
record, the "send" button fails with a traceback because on
specific template try to access the company.id of the user
which is not accessible due to the access controle.

This PR fixes the problem by sudoing the access to company id.
The mail now sends without problem.

Step to reproduce:

1. Use two companies (comp1 and comp2)
2. Use 3 users (user1, user2, user3)
3. Be sure every user has a confirmed account
4. Change the users to set both company as allowed.
5. Set the current company of the users as follow:
   user1: comp1
   user2: comp2
   user3: comp2
6. Install the project module
7. In `settings > security > record rules`, archive the rules named:
   - `Project: multiple-company`
   - `Project/Task: multiple-company`
   - `user rule`
8. Using user1, create a new project and a new task.
9. Using user2, go to `Project module > Search`, remove `My tasks` filter,
   select the task created by user1, in the chatter add user3 as follower.
10. Send the mail => access error.

The `AccessError` is due to user2 trying to access comp1, in particular
`company.name`.

By adding a `sudo`, we also make sure that the template rendering won't
fail bacause of a similar `AccessError`.

opw-1907844

closes odoo/odoo#28710
2018-11-26 09:49:50 +00:00
Lucas Perais (lpe) c9e32872c0 [FIX] web: list default_sort with multiple fields
Define a x2m tree view with a default_sort including more than 1 field to order the list against

Before this commit, the second field was never used

After this commit, it is used

OPW 1909785

closes odoo/odoo#28840
2018-11-26 09:28:55 +00:00
Odoo Translation Bot 387c1edb9c [I18N] Update translation terms from Transifex 2018-11-25 03:17:33 +01:00
Nicolas Martinelli 63f077b888 [FIX] account: sort partners in manual reconciliation
When opening the Manual Reconciliation widget, all partners with opened
invoices and payments are fetched.

In some cases, the database might contain a lot of partners without any
reconciliation suggestion; therefore, the partners with suggestions are
'lost' in the view.

This commit sorts the data: we first display the parters with a
suggestion, then the others. This should improve the usability of the
view.

opw-1903575

closes odoo/odoo#28958
2018-11-22 14:08:57 +00:00
len-odoo 264f89f63f [FIX] web_editor: remove video option when composing email
Embedding a video can't work because it embeds an iframe, which is not supported
by most email clients for security reasons.
(What happens when Gmail shows embedded videos in displayed emails, is that you
send a link in the email body, and it is at rendering that Gmail adds the iframe
into the page.)
So the bugfix solution is to hide the button.

Since there is an option "res_model" that allows us to know when we are in that
case, we remove the video option.

opw 1905497

closes odoo/odoo#28911
2018-11-23 10:32:45 +00:00
RomainLibert 06373dde4e [FIX] resource,hr_payroll: disable timezone conversion
In the case of calculating payroll, we don't want to convert the
datetimes using the timezone of the user as we really want to see what
the employee has done from one date to another (usually from the start of
the month to end of the month)

Closes #26256

closes odoo/odoo#28977
2018-11-23 09:48:08 +00:00
len-odoo db1ce8b591 [FIX] stock_account: add a force_company to update the correct price in FIFO costing
Fine-tuning of commit: o50f77ba091189bd785d459c042a6cec04a125fdb
When costing is in FIFO mode, product price can be updated whereas the current
user doesn't have the right to modify the products.
It therefore introduced a sudo() to make this computation;
however since this is modifying a company-dependent field,
a force_company was missing to update the correct one.

Closes #28487
opw 1907377

closes odoo/odoo#28662
2018-11-14 10:38:57 +00:00
Christophe Simonis 263b388c50 [MERGE] forward port branch saas-15 up to e44c35f407 2018-11-22 17:06:31 +01:00
Christophe Simonis e44c35f407 [MERGE] forward port branch saas-14 up to a9752d3ad3 2018-11-22 15:03:01 +01:00
Christophe Simonis a9752d3ad3 [MERGE] forward port branch 10.0 up to af476c6949 2018-11-22 14:39:08 +01:00
Lucas Perais (lpe) dc23365048 [FIX] calendar: detaching event makes recurring attributes irrelevant
Have a recurring meeting, repeated until some date

Edit one of the instances and detach it (click on "update only this instance")

Edit the detached event and change some value

Save

Before this commit, a JS error was thrown saying that the field final_date was invalid
This was because the required attribute on this field was set to True, but the python
put the value of the final_date to False

After this commit, there is no error as we set this value to false, since the field
doesn't make sense for a non-recurring event anyway

OPW 1892426

closes odoo/odoo#28850
2018-11-22 10:06:06 +00:00
Denis Ledoux af476c6949 [FIX] report: support for wkhtmltopdf 0.12.5
This revision brings the compatibility for our reports
using wkhtmltopdf 0.12.5.

Up to now,
the supported wkhtmltopdf version was 0.12.1.

The goal of this revision is to add the compatibility
to wkhtmltopdf 0.12.5,
while keeping the same exact rendering than in 0.12.1.

There is a behavior change with the `--dpi` parameter,
which no longer has a "zoom" level effect as it did with 0.12.1.

To deal with it, we pass the `--zoom` parameter when
the detected version installed of wkhtmltopdf is after 0.12.2,
with a ratio 96:dpi. 96 being the default dpi of wkhtmltopdf.

This trick allows to render the reports with the exact same
zoom level, whatever the dpi value configured in the reports paperformat.
(at least with dpi values up to 149, after 150, included,
the dpi parameter with wkhtmltopdf 0.12.1 as a weird behavior,
it no longer zoom out)

opw-1907346

closes odoo/odoo#28864
2018-11-21 09:30:02 +00:00
Nicolas Lempereur 1f8788deef [FIX] purchase: es_AR translation typo
Fixing it directly by commit since there is no es_AR on transifex.

The issue of the ticket has been solved by transifex, this is for
another similar issue that has been found.

opw-1907924
closes #28923
2018-11-21 17:37:35 +01:00
Denis Roussel e81809b89d [FIX] mrp: Allow mrp user to delete stock_move_lot links
With an mrp user, add lots lines to mrp production order moves. Then,
try to delete one line, the dustbin icon does not appear.

opw-1908930
2018-11-21 14:08:47 +01:00
Denis Roussel 8a6162d00d [FIX] mrp: User with no products write access cannot create production order
As the product_tmpl_id field is related one but not readonly, the creation
of production order triggers a write on product.product model
2018-11-21 13:16:45 +01:00
Goffin Simon 7b8c415fc5 purchase_mrp: qty_received not updated on a PO
Steps to reproduce the bug:

- Let's consider a product P with a BOM in kit
- Create a PO with P and confirm it
- Cancel the shipment and the PO
- Reset to draft the PO and confirm it
- Valide the new shipment and receive P

Bug:

The qty_received was not updated

opw:1904678
2018-11-19 15:23:00 +01:00
Christophe Simonis 3c78026dc0 [MERGE] forward port branch saas-14 up to 55104b915e 2018-11-15 18:15:47 +01:00
qsm-odoo 55104b915e [FIX] website_event: restore event list layout
Commit https://github.com/odoo/odoo/commit/b43364af7258e45ad846fbbf1f375ad26e58eb0d
introduced a row in a row. On a standard database, the bug is invisible.
When the user wants to edit that event list page, the right column... is
not on the right anymore.

Note: in 12.0, thanks to BS4, the bug was revealed even more as even on
a standard non-edited database, the bug is visible.

Closes https://github.com/odoo/odoo/pull/28693
2018-11-15 17:15:54 +01:00
Christophe Simonis 5523e6b1c9 [MERGE] forward port branch 10.0 up to 8a9569b31e 2018-11-15 17:00:52 +01:00
Nicolas Lempereur 258eaa7a3c [FIX] web_editor: firefox `´ accent no break position
On firefox if we do for example:

ALT+GR + [ALT+GRable ´ key]

Firefox may send keys "AltGr" and "Dead" instead of just "AltGr".

This was possibly causing caret to go a position too low when writing
speedily with diacritical marks.

opw-1903865
closes #28739
2018-11-15 16:52:31 +01:00
mao-odoo 8a9569b31e [FIX] auth_signup: Error when sending quotation
Fine tuning of this commit:https://github.com/odoo/odoo/commit/7501691da9a9dae832b7d6e78c6a5f57fc983b5c
Fields signup_token, signup_type, signup_expiration are protected
When sending a quotation (mail template 'Sales Order - Send by Email'):
the token needs to be read (and sometimes written)

opw:1907157
2018-11-15 15:28:48 +01:00
RomainLibert 8cdfe1d8fe [FIX] product: use product.pricelist in report product_pricelist
We were using hr.contribution.register as a doc_model on the
product.pricelist report which makes no sense since it should show
pricelist informations
2018-11-14 13:06:58 +01:00
Gert Pellin 0db2d4b307 [FIX] point_of_sale: order selector buttons
On to many open orders the + and - buttons will be pushed out of view.
This makes it impossible to close orders without checking out.
2018-11-14 09:31:42 +01:00
Lucas Perais (lpe) 7525455534 [WIP] looking good babe 2018-11-13 16:40:30 +00:00
qdp-odoo 069c2f2304 [FIX] account: fix invoice access rights
removed the access right that was granting the read access on invoices to any internal user, because there's no reason to do so.

Fixes #28486
2018-11-13 17:18:43 +01:00
GabbasovDinar 127c6d1f0d [FIX] check mp_dirty to avoid repeated rendering
The patch fixes the issue related to repeated orderline rerendering. It means
that if products of the order were printed before, those will not be rendered
again when new updates of order is sent to the kitchen.

Closes #28577
2018-11-13 11:29:31 +01:00
Lucas Perais (lpe) 293f9d27ad [WIP] another testable solution 2018-11-12 16:12:29 +00:00
Lucas Perais (lpe) bd83517fec [FIXUP] testable solution 2018-11-12 15:29:07 +00:00
Lucas Perais (lpe) c346428397 [FIX] web: search input date in another timezone
Put the browser in timezone Sao Paulo (Or like West of UTC)

Trigger the autocomplete (and the subsequent search) on a date field
by writing a date (in the locale format) in the search view

Before this commit, the domain sent to the server contained the date as the day
**before** the one asked for in the input

This is because, the string input is parsed and gives:
input = 12/02/2018
When creating the moment object:
> since there is no explicit time, moment will interpret it as 12am (midnight)
> We force moment to consider the string as being UTC (function: moment.utc())
> the moment contains, as output the time ** 2018-02-12T00:00:00 UTC **

When getting the facet value for making the domain
> we call toDate on the moment object, which, according to the browser is UTC and will
be converted to the locale timezone before formatting
> And the domain will use the date 2018-02-11T22:00:00 Brazil/SaoPaulo
which gives the day before the one we asked for

After this commit, this issue doesn't arise, because we use the string representation of
the moment object in search_inputs (i.e 2018-02-12T00:00:00 UTC), to create a new one
*BUT* we create it with a date format that excludes the time from being interpreted.
Also, the resulting moment object in this case is not flagged as UTC anymore

OPW 1903224
2018-11-12 14:07:36 +00:00
Дмитро Катюха f68c5261f9 [FIX] resource: Fix work/leaves hours count methods
Purpose
=======

Buggy example:
I have a 35h working schedule. I work every week day:
- From 8h to 12h
- From 12h to 16h

Let's say that I want to retrieve the working hours from Wednesday 14h03
to Thursday 11h03.

The working hours are:
- From 14h03 to 16h --> 1h57
- From 8h to 11h03  --> 3h03
----------------------------
TOTAL                   5h

Currently the result will be 1.95, i.e. 1h57 because the second day
is not taken into account as start time > end time, and thus rrule
doesn't manage this correctly and returns only the datetime corresponding
to the first day.

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

Force the until parameter of rrule to be set at the end of the day, do
avoid skipping the second day. Do this in the methods that compute the
work hours and the leave hours.

Add a test to ensure the robustness of the fix.

Closes #21297

closes odoo/odoo#28920
2018-11-21 15:42:48 +00:00
len-odoo 0081321136 [FIX] website_sale_digital: display download links on free digital orders
Create a coupon/promotion that gives a 100% discount on some digital product.
If the total of the order is 0, then the client won't have the possibility
to download the product(s), since the download links appear on invoiced lines;
and no invoice has been created.

We display the download link on the products if the order total is 0,
as the other cases are already covered by the existing code.

opw 1905682

closes odoo/odoo#28799
2018-11-19 13:46:02 +00:00
Denis Ledoux 8ea10d42ba [FIX] website_sale: performance imp to search abandoned carts
By removing the `.id` from the `partner_id.id` domain leaf,
the ORM avoids to do a useless `SELECT` to read
the id of all partners different from the public partner,
as it already got the information from the `sale_order` table

e.g
Here is the SQL request before the revision:
```
SELECT "sale_order".id FROM "sale_order" WHERE ((((("sale_order"."date_order" <= %s)  AND  ("sale_order"."team_id" in (%s)))  AND  ("sale_order"."state" = %s))  AND  ("sale_order"."partner_id" in (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)))  AND  ("sale_order"."id" in (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s))) ORDER BY "sale_order"."date_order" DESC,"sale_order"."id" DESC
```
Here it is after:
```
SELECT "sale_order".id FROM "sale_order" WHERE ((((("sale_order"."date_order" <= %s)  AND  ("sale_order"."team_id" in (%s)))  AND  ("sale_order"."state" = %s))  AND  ("sale_order"."partner_id" != %s))  AND  ("sale_order"."id" in (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s))) ORDER BY "sale_order"."date_order" DESC,"sale_order"."id" DESC
```

closes odoo/odoo#28927
2018-11-21 17:05:13 +00:00
Florent de Labarre baf48ee1f9 [FIX] project: remove unused and slow field
closes odoo/odoo#28887
2018-11-21 12:17:22 +00:00
Nicolas Martinelli 89927b7725 [FIX] point_of_sale: fine tune test
Remove false-positive errors based on the order of the data.

opw-1910248

closes odoo/odoo#28880
2018-11-21 11:18:26 +00:00
Katherine Zaoral d1b85c8d9a [FIX] mail: Future Activities filter in the mail activity search view.
closes odoo/odoo#28768
2018-11-16 16:39:15 +00:00
Adrian Torres 407f6e3532 [FIX] stock: do not prefetch stock.move fields
For a SO of 300 lines, when confirmed, it takes 195s to process stock
moves for the SO, which is an insane amount of time for any kind of
process in Odoo.

This happens because stock.move is a heavy model with lots of fields,
prefetching all these fields at once can hinder performance when
processing a lot of stock.moves.

To reduce the processing time, the prefetching is disabled in the
specific scenario of processing stock moves and pickings on SO
confirmation.

This patch increases the performance of SO validation (with stock
installed) by ~30%.

Pre-patch: 195s (300 SOL)
Post-patch: 135s (300 SOL)

closes odoo/odoo#28835
2018-11-20 10:51:07 +00:00
Julien (juc) Castiaux 124b5b8fee [FIX] product: disable "create & edit" shotcut for product variants
With the purchase module, when you create a new vendor, you can
select what variant of the product the vendor sells. The droplist
has the "Create & Edit" button to quickly create/edit variants.
This is not the wanted behavior. This PR removes the "Create & Edit"
suggestion.

opw-1909009

closes odoo/odoo#28845
2018-11-20 14:05:52 +00:00
Lucas Perais (lpe) e713ed2a69 [FIX] web: implement filter orderedBy
related to: #28446

On a pure list view, click on a column to sort the records by that field.

Save the filter as favorite

Reload, now apply the filter

Before this commit, there were two issues:
1. The order of the list was never propagated to search view, which couldn't save
the filter with its attribute "sort"

2. There was no mechanism to load the attribute sort from a loading Filter

After this commit, those two issues are corrected
Unfortunately, complex search view flows are not testable in v11.0

OPW 1906968

closes odoo/odoo#28766
2018-11-20 13:53:52 +00:00