Commit Graph
103195 Commits
Author SHA1 Message Date
Nicolas Lempereur cd2b07ea44 [FIX] pad: remove wrong warning at pad creation
When creating a pad before this change these were the steps:

- modify pad URL for new pad URL
- end of record loading

This caused an issue because modifying the record at this point would
mark it as dirty before displaying it (which would result in a erroneous
warning "The record has been modified, your changes will be discarded.
Are you sure you want to leave this page ?").

With this fix:

- modifying the pad URL is done after the record is ready

- deferred have been unified (to remove possible race conditions)

closes #15239
opw-702797

forward port note: this change is needed up to saas-15, over saas-15
only a small part is needed (because x2many views are loaded with the
root view and there is one widget instance per record).

code note: it would be better to modify load_record of form view and
delay `record_loaded` upto after x2many views are loaded, but possible
impacts have been judged too risky so this is done only in pad widget.
2017-04-26 18:32:18 +02:00
Nicolas Martinelli ec8699db17 [FIX] account: performance in issued total
When a partner has a lot of contacts, the computation of the issue total
takes a lot of time. Indeed, it performs the computation for the
partner, but also for all the children, despite the fact that the amount
is not displayed.

opw-726355
2017-04-24 13:27:02 +02:00
Xavier Morel 577d986391 [FIX] account: subtract refund amount from "awaiting payments" total
Currently the amounts of all invoices (linked to sale or purchase
journals) is summed regardless of these invoices being bills or
refunds, this means e.g. if you create an invoice for 1000 then a
refund for 500 on this invoice, the dashboard will display an
"awaiting payment" total of 1500 which while technically correct is
not really logical or helpful from a user's POV.

Fix summation to take in account the invoice type (invoice or refund)
and remove refund amount from the total amount.

Intent validated by @lap-odoo, also not ignoring or removing refunds
from count to avoid situations like "0 Awaiting Payments [for] $-1200"
which would be really strange.

OPW-728860
2017-04-24 11:58:42 +02:00
Goffin Simon 5b50284127 [FIX] point_of_sale: fiscal position with included taxes in POS
To substract the included tax from the unit price when it's mapped
by a fiscal position in the POS.

To keep the same behavior introduced by this commit odoo@503820a

opw:710437
2017-04-24 11:40:25 +02:00
Nicolas Martinelli 9e6860a228 [FIX] web: make DB name more flexible 2017-04-24 08:02:22 +02:00
Odoo Translation Bot 91c00bc011 [I18N] Update translation terms from Transifex 2017-04-23 00:31:08 +02:00
Christophe Simonis 8de514f805 [MERGE] forward port branch saas-6 up to b084ffd7f1 2017-04-21 14:07:02 +02:00
Christophe Simonis b084ffd7f1 [MERGE] forward port branch 8.0 up to 716ceede16 2017-04-21 14:05:52 +02:00
Christophe Simonis 144ff9a61a Revert "[FIX] web: refuse DB name with space"
This is too restrictive.

This reverts commit 606712a5d2.
2017-04-21 14:02:58 +02:00
Oliver Dony 60d7e9a307 [FIX] point_of_sale: avoid creating multiple rescue sessions
If multiples orders are sent when the original session is already closed

Replace and closes #16525
2017-04-21 12:37:26 +02:00
Christophe Simonis 53288aa837 [FIX] base: show "Contact Creation" group option in non-debug mod 2017-04-21 12:20:00 +02:00
Pedro M. Baeza e7a2a542b8 [FIX] account: filter 'Due Payments' report on reconciled flag
SQL that retrieves data for the "Due Payments" report doesn't include
any filter for excluding AR/AP move lines already reconciled, which
shouldn't be presented in this report.

Courtesy of Pedro Baeza. Was PR #16440
2017-04-20 17:50:36 +02:00
Nicolas Lempereur 716ceede16 [FIX] web_enterprise: kanban_state_selection ie
On IE (from 9.0 up to at least IE EDGE 14) we have this behavior
for the method serializeToString of XMLSerializer:

> (new XMLSerializer()).serializeToString($('<b>"</b>')[0])
  '<b xmlns="http://www.w3.org/1999/xhtml">"</b>'
> (new XMLSerializer()).serializeToString($('<b>"</b>')[0].firstChild)
  '&quot;'

Whilst browser such as chromium or firefox have:

> (new XMLSerializer()).serializeToString($('<b>"</b>')[0])
  '<b xmlns="http://www.w3.org/1999/xhtml">"</b>'
> (new XMLSerializer()).serializeToString($('<b>"</b>')[0].firstChild)
  '"'

Hence for IE9 and over, if in a `<t t-extend/>` a `t-jquery`
sub-directive (without `t-operation`) is available, we can have
broken javascript if a " is transformed into an &quot; at a unfortunate
location.

This commit favour node.data over XMLSerializer serializeToString to
avoid the possibility of this issue when a text node is processed.

opw-727283
2017-04-20 17:08:17 +02:00
Goffin Simon 0ae30c5997 [FIX] base_partner_merge: deduplicate contacts in multi company
When deduplicating contacts, the function _process_query doesn't use
the orm to fetch the partners to merge according to the criteria.
So there were some access error in multi company when trying to merge
contacts from a not allowed company.

Now a check is made with the orm before merging the contacts.

opw:708457
2017-04-19 15:45:38 +02:00
Ankit Joshi 7591f59c5e [ADD] stock: add the field 'description_picking' in picking report
The field is defined but never user. It could be useful to indicate
to the delivery guy that the product is 'fragile' or whatever.

opw-728874
2017-04-18 14:36:32 +02:00
Nicolas Martinelli b4193cd35b [FIX] sale: set timesheet line to zero
- Create a SO with a product that is a service and will be invoiced
  based in delivery quantities and will be tracked on timesheets and
  contract.
- Confirm
- Use a simple user that only has for rights: "Employee"
- Create a timesheet as the employee for the contract created by the sale
- Log some time
- Save it
- Check the SO: ok the number of hours should be "to be invoiced"
- Edit the timesheet and set one day to 0 hours => Access Error

In case of a zero value, the timesheet widget sends an unlink command
for the corresponding entry. In this case, the `sudo` is not set at the
appropropriate moment since the context key `force_so_lines` will resue
lines which are not defined in the `sudo` environment.

opw-728453
2017-04-18 11:55:16 +02:00
Odoo Translation Bot 5d5bd2c404 [I18N] Update translation terms from Transifex 2017-04-16 02:54:21 +02:00
Odoo Translation Bot 2c75ad396f [I18N] Update translation terms from Transifex 2017-04-16 00:30:18 +02:00
Ronald Portier e479828025 [FIX] account_voucher: add missing context
Fixes #16420
Closes #16421
2017-04-14 15:11:30 +02:00
Raphael Collet 975086c039 [FIX] fields: avoid invalidation of fields computed on new records
Issue: when a field is computed on a new record, the record is not marked as
"being computed", and it could therefore be invalidated.  The fix consists in
using the standard method that marks records before calling the compute method.
2017-04-12 17:15:03 +02:00
Christophe Simonis f10ef71f06 [MERGE] forward port branch saas-6 up to 87b21d19eb 2017-04-12 12:58:19 +02:00
Christophe Simonis 87b21d19eb [MERGE] forward port branch 8.0 up to ded636eae1 2017-04-12 12:56:09 +02:00
Nicolas Martinelli eb9b888c5a [FIX] point_of_sale: empty picking
- Create 2 stockable products (A & B).
- Sell these products in the POS, but leave the qty of Product A to
  zero.
- Validate and pay
- In the backend, return the products and register payment

Two pickings are created, and one of them is empty.

Products with a quantity of zero are not included in a picking.
Therefore, we should ignore them when the pickings are created.

Fixes #16292
opw-728101
2017-04-12 09:33:01 +02:00
Raphael Collet 4f98311623 [FIX] fields: recompute recursive stored fields
This is a backport of rev 3481f0faff.
2017-04-12 09:18:23 +02:00
Goffin Simon a0fed3b845 [FIX] sale: _compute_analytic with amount=0
Steps to reproduce:
-Create a product P  with a standard price = 0 and its internal category
is in perpetual valuation
-Create a SO with an analytic account and a line with one product P
-Confirm the SO
-Create and validate the invoice

Bug: The delivered qty on the SO was equal to 2 instead of 1 because two
analytic lines are created by function create_analytic_lines with amount=0.
So in function _compute_analytic, the domain was [('so_line', 'in', self.ids), ('amount', '<=', 0.0)]
and it summed the two analytic lines for these two lines. Now analytic lines with amount=0 and linked
to a move line are summed if the they are linked to entries for an account of type "Expenses"(user_type_id).

opw:727302
2017-04-11 15:00:14 +02:00
Goffin Simon 1dc361704e [FIX] account: Making a refund with modified taxes
Step to reproduce the bug:
1.Create a product with a customer tax(15%) for a price=100
2.Create a customer invoice with this product
3.Change the amount of the tax to 10(instead of 15)
4.Validate the invoice
5.Click on "Refund invoice"
6.Select the refund method "Modify: create refund, reconcile
and create a new draft invoice"

Bug the new draft invoice has 15 as amount of tax

Now all the taxes from the invoice when preparing the refund in function
_prepare_refund, in this it keeps all the modified taxes.

opw:726491
2017-04-11 14:15:39 +02:00
Nicolas Martinelli 8c326c5cc5 [FIX] stock: reordering rules of archived products
When the scheduler is run, the reordering rules of archived products are
selected.

opw-728316
2017-04-11 13:19:44 +02:00
SEINLET Nicolas ded636eae1 [FIX] ir.rule: use rules at most once (#15843)
When a user belongs to multiple groups, and an ir.rule is applicable for some of
them, the rule is added multiple times in the domain. Just do it once. This
makes the query shorter and easier to debug.
2017-04-11 09:27:58 +02:00
Tran Thanh Phuc 6108778497 [FIX] point_of_sale: wrong group by
Both group by filters are the same
Closes #16338
2017-04-10 12:07:00 +02:00
Tran Thanh Phuc 8600ae34df [CLA] signature for ttpphuctran
Done at #16337
2017-04-10 11:51:43 +02:00
Odoo Translation Bot 8f7791fcee [I18N] Update translation terms from Transifex 2017-04-09 02:54:13 +02:00
Odoo Translation Bot 086723152e [I18N] Update translation terms from Transifex 2017-04-09 00:30:47 +02:00
Christophe Simonis 51fe54dd8d [MERGE] forward port branch saas-6 up to d92c048f9a 2017-04-07 16:30:03 +02:00
Christophe Simonis d92c048f9a [MERGE] forward port branch 8.0 up to 6595cfdf0c 2017-04-07 16:16:03 +02:00
Jérome Maes b99311b0e9 [FIX] mass_mailing: use correct regex to detect href content
link_tracker use a regex to determine the content of
a 'href' tag, taking the 'mailto:xxxx@yyyy.zz' case
into account. mass_mailing use another regex that simply
don't.
So when sending a mass mailing containing email link,
the email will be appended by url path of tracking
url '/m/<stat_id>'.

This commit makes mass_mailing use the same regex as
link_tracker (which is in the dependencies of mass_mailing).

opw-727779
2017-04-07 15:52:13 +02:00
Christophe Simonis d4d5181285 [MERGE] forward port branch saas-6 up to 271067f50c 2017-04-07 15:11:50 +02:00
Nicolas Martinelli 606712a5d2 [FIX] web: refuse DB name with space
In v8, it was not allowed to create a DB with a name containing a space.
This should still be the case from v9 since it causes issuesfor backup
scripts, for example.

Reintroduces 1a0e9063d4

opw-727613
2017-04-07 14:53:01 +02:00
Fabien Meghazi a859c3b6b3 [REM] Remove 'state' group_by filter in purchase order line search view (opw: 727796)
The group by on state in this search view cannot be used due to a typo
in the 'state' field's attribute "stored=True" dbe3d8035f

It can't be fixed in 9.0 as it would change the schema, hence the only
option is to disable this filter in 9.0

This should not to be forward ported to 10.0 as it is already fixed for
this version in 3451ac5254
2017-04-07 13:17:36 +02:00
Joren Van Onder d17c302c0a [FIX] point_of_sale: undo mobile browser autoscroll in client list
Mobile browsers attempt to scroll invisible input elements into
view (eg. when they end up hidden behind the on-screen keyboard). The
browser does not always correctly undo this. This is problematic
because the main window in the client list is not actually scrollable
for the user, so you ended up with part of the widget cut off. This
implements a workaround that scrolls to top when input elements are
blurred. Removing the blur handlers is not necessary because the input
elements get removed.

opw-706781
2017-04-06 17:01:22 -07:00
Goffin Simon c8a434306f [FIX] website_sale: Updating price on Optional Products
When changing the quantity of a product in Optional Products modal
in the shop, the price was not updated according to the pricelist.

opw:726686
2017-04-06 17:37:19 +02:00
Raphael Collet 6595cfdf0c [FIX] expression: avoid useless query when searching on x2many sub-field
Searching on a domain like `[('m2m.sub', operator, value)]` currently does
something like:

    right_ids = comodel.search([('sub', operator, value)]).ids
    table_ids = model.search([('m2m', 'in', right_ids)]).ids

and reduces the domain triple to `('id', 'in', table_ids)`.

The domain triple can actually be reduced to `('m2m', 'in', right_ids)`.  With
this reduction, the search on the field `m2m` will be done as part of the main
query.  And this will also enable the optimization of the former fix!
2017-04-06 16:46:46 +02:00
Raphael Collet 3c2065c89d [FIX] expression: use sub-select when searching on many2many field
Avoid pathological performance issue caused by injecting ids retrieved with
another query.

Consider a domain like `[('m2m', 'in', ids)]` on a many2many field.  The
current implementation will perform the subquery:

    SELECT m2m_id1 FROM m2m_table WHERE m2m_id2 IN (ids)

and inject its result into the main query as:

    SELECT id FROM ... WHERE id IN (result_ids)

The latter may be very slow if `result_ids` is a huge list of ids.

The fix injects the first query into the main query as:

    SELECT id FROM ... WHERE id IN (
        SELECT m2m_id1 FROM m2m_table WHERE m2m_id2 IN (ids)
    )

As a result, the database will typically JOIN both tables, and avoid generating
the whole list from the subquery.
2017-04-06 15:59:50 +02:00
Thomas Binsfeld 01add1fe15 [FIX] account: browse only one record
Part of #16282
2017-04-06 15:11:31 +02:00
Christophe Simonis 271067f50c [MERGE] forward port branch 8.0 up to 3128e84243 2017-04-06 14:46:56 +02:00
Goffin Simon d444fbcc1a [FIX] l10n_at: Vorsteuer 2500 account
The type of account Vorsteuer 2500 is Non-current Assets(like in l10n_be).
In this way, the amount due will include the taxes Vorsteuer 10%
and Vorsteuer 20% when computing the amount due with _compute_residual
because the account is not receivable or payable.

opw:725619
2017-04-06 09:21:21 +02:00
Nicolas Martinelli 3128e84243 [FIX] account: aged receivable
- Create an invoice of 10000 at date 2016-11-30, due 2017-02-28
- Make a partial payment of 1500 at date 2016-11-09
- Make a partial payment of 1000 at date 2016-11-30
- Make a partial payment of 2000 at date 2017-01-30

At current date (e.g. 2017-04-04), run the Aged Partner Balance. 5500 is
still due, but set to the +120 days period instead of 30-60.

opw-725890
2017-04-05 11:50:03 +02:00
Jerther 33076f7394 [FIX] stock: set AML date same as move date
Based on v9 fix: f6b6eb906d

Closes #16217
2017-04-05 11:31:19 +02:00
Nicolas Martinelli 8f39ad2be6 [FIX] point_of_sale: action_assign before force_assign
This allows the reservation in sub-locations before forcing the
availability.

opw-726060
2017-04-05 11:09:26 +02:00
Jerther 52c58fd218 [CLA] backport signature to 8.0
Done at #16240
2017-04-05 10:48:35 +02:00
Nicolas Lempereur 0b2fd60041 [FIX] web: editable list view regression bc031379 (9.0)
In 9.0 in some particular instances with embedded views, if:

- an x2many list view is editable,
- we go from a form view of an existing record to creating a record,
- the timings of deferred resolving are in a certain order

the x2many list view could be tought as loaded whilst in reality it is
the 'editable list view' row editing 'form view' that has been loaded.

This could cause sometimes issues after bc031379 because the onchange
computation would happen before the list view is really loaded.

This is probably an issue with the deferred system in one of the views,
but it would be rather hard and dangerous to change it.

So this fix introduce an additional test which ignore relational views
if there is an embedded view.

opw-726701
opw-726768

note: only needed for 9.0, the relational views have been changed as of
saas-11 and this issue is not present.
2017-04-04 17:29:53 +02:00