Commit Graph
107501 Commits
Author SHA1 Message Date
amoyaux 447356f7ee [FIX] calendar: set correct recurring start_date
A recurring event with a start date and a time duration had a wrong start and
stop date computed.

Introduced at 76b724294a.
Previously the r_date contained only the start_date but now it contains both
start and stop dates. This implies that the method 'get_recurrent_ids' could
use 'get_search_fields' with a stop_date (depending on the domain order) and
returns incorrect dates.

This commit ensure to launch the get_search_fields with the start date.

Closes #15922
2017-03-20 10:25:30 +01:00
Nicolas Martinelli 51613744f5 [FIX] account_asset: default account in invoice
- Define a user with accounting rights "Billing"
- Create an invoice or vendor bill
- Add an invoice line without product

It is impossible to save because the mandatory field "Account" is hidden
and empty.

This is because of an onchange which overrides the default method.

opw-716208
2017-03-20 08:29:36 +01:00
Odoo Translation Bot 6e363a5756 [I18N] Update translation terms from Transifex 2017-03-19 04:33:46 +01:00
Christophe Simonis 7043fd529f [FIX] test_converter: use unicode string for comparison 2017-03-18 23:35:58 +01:00
Christophe Simonis 31ebb07773 [MERGE] forward port branch saas-11 up to aefdf96c25 2017-03-17 17:55:30 +01:00
Christophe Simonis aefdf96c25 [MERGE] forward port branch 9.0 up to af64780a2d 2017-03-17 17:06:32 +01:00
Martin Trigaux 2c1257fe88 wow 2017-03-17 14:40:45 +01:00
Martin Trigaux 13bfc8ee50 [FIX] crm: remove unused field from fields to merge
The field email is no longer present on the crm.lead object

opw-725112
2017-03-17 14:33:44 +01:00
qsm-odoo 7401807510 [FIX] web_editor: copy/paste in the editor
Commit 906875fc78 (followed by commit
76be5eed44) tried to tweak to copy/paste
functionality of the editor.
Indeed, in PDF file, when copying a paragraph, a line feed is added at
each forced line break (page width end). This forced a line feed and
a new paragraph in the pasted text. The goal was to get rid of those
useless linebreaks when pasting.

The ideal solution would be to detect that the text was copied from
a PDF but it is not possible. However, this commit improves the
heuristic: if this is not plain text, then nothing is done, the content
is pasted normally. If it is plain text (like when copying from pdf),
then each line break which is surrounded by letters or numbers is
considered an useless line break and replaced by a space. This is
obviously not perfect but the previous implementation was really wrong
(it was removing line breaks which were not preceeded by punctuation in
all cases, which was removing lots of useful line breaks).

Note: this commit also fixes a bug -> text was not able to be pasted
with Internet Explorer.

opw-715920
2017-03-17 11:44:28 +01:00
Martin Geubelle 22e7b6befb [FIX] web_kanban: only give fields in view to record
This commit partially reverts 5b4f7c1 where `fields_view.fields`
had been replaced by `fields`, which could have been set to all
fields in the model.

This modification can sometimes lead to a problem, during the
fields value transformation. The ID, which wasn't given previously
is now parsed. When creating a new record, the field ID is not an
integer but a string (representing the virtual ID). If the field
is in the arch, it will be postprocessed
(see https://github.com/odoo/odoo/blob/saas-11/addons/web/static/src/js/framework/data_manager.js#L201)
and its type will become `id`. As this postprocessing is not done
if the field in the view, the parsing was on the original type
(integer) and not the special id type.
2017-03-17 11:13:49 +01:00
Nicolas Martinelli af64780a2d [FIX] base: no-break hyphen
- Create an invoice with two products
- Each line has a long description (spread on 2 lines)
- The second line has a negative value
- Print the invoice (PDF)

The amount spreads on two lines, split as:
$ -
1,000.00

This is due to the wkhtmltopdf version with patched QT. Unfortunately,
upgrading to the latest version 0.12.4 doesn't solve the problem.

The solution is to replace the '-' by a non-breakable hyphen.

opw-711002
2017-03-17 09:07:15 +01:00
Nicolas Lempereur 508a002e69 [FIX] web_editor: glitch english several times
When using the iframed editor with multilang selector (present if there
is another lang installed than en_US) an "English" language was present
before each translation language.

opw-696891
2017-03-17 08:10:52 +01:00
Nicolas Lempereur fb05d8845d [FIX] web_calendar: events not appearing in arabic
Fullcalendar expect as `start` and `end` property of an event object:

> When specifying Event Objects for events or eventSources, you may
> specify a string in IETF format (ex: "Wed, 18 Oct 2009 13:00:00 EST"),
> a string in ISO8601 format (ex: "2009-11-05T13:15:30Z") or a UNIX
> timestamp.

(as seen in https://fullcalendar.io/docs1/event_data/Event_Object/)

Before this commit we could for example in arabic provide an invalid
date string "٢٠١٧-٠٣-١٦ ١٦:٠٠:٠٦" instead of "2017-03-16 16:00:06".

This commit solves this by always providing fullcalendar an ISO8601 date
string.

opw-705752
2017-03-16 22:07:29 +01:00
Nicolas Lempereur f50ba68be7 [FIX] web_editor: handle margin:initial correctly
The transcoder (which transforms stylesheet rules to inline style) did
some compression of the padding and margin css properties to not always
have margin-top + margin-right + margin-bottom + margin-left.

This could cause an issue when the value of margin or padding contained
an initial or inherit value because browsers (at least firefox and
google chrome) doesn't allow it. Thus the preview could for example have
bigger veritcal spaces arround `<p />` tag than what was seen when
editing.

With this fix instead of invalid:

    margin:initial initial initial initial

we have:

    margin:initial

And instead of invalid:

    margin:initial 5px 6px 7px

we have:

    margin-top: initial; margin-right: 5px; margin-bottom: 6px; margin-left: 7px;

opw-706535
2017-03-16 18:26:32 +01:00
Simon Lejeune be9dce625c [FIX] stock: inventory adjustment and negative quants
It is still possible to have negative and positive quants in the same
location because of returns: if you send something to the customer that
is not there and you return it, you will still be able to reserve the
returned goods to send to another client.

Before, if you would do an inventory adjustment, it would not take into
account these returned quants and their negative counterpart, which made
them difficult to get out of the system.

This fix takes them into account by creating two movements for one
inventory line: move the positive counterpart to the inventory location
before getting back from this location the same quantity.

This way, even if you have 0 as quantity on hand but you have those 2
quants, it will eliminate them. (if you are increasing the stock, part
of the process might have done it automatically already).

Test cases contributed by @jir-odoo
2017-03-16 17:30:02 +01:00
Christophe Simonis 5f9d382ed4 [MERGE] forward port branch 9.0 up to e542b450a3 2017-03-16 16:01:56 +01:00
Nicolas Martinelli 0590af8b3f [FIX] mrp_repair: tax included
- Create a product with price tax included
- Create Repair order
- Add the product in tabs "Operation" or "Invoicing"

The tax is added twice in the total.

opw-709608
2017-03-16 13:23:33 +01:00
Nicolas Martinelli e542b450a3 [FIX] sale_stock: duplicate qty
- Create a stockable product, create a SO selling 1 unit.
- Confirm the SO, validate the Picking 1 => delivered qty is 1
- Return Picking 1 and validate Picking 2 => delivered qty is 1
- Return Picking 2 and validate Picking 3 => delivered qty is 2

The delivered quantity should remain 1.

opw-715685
2017-03-16 13:15:46 +01:00
Nicolas Lempereur cc1c15327c [FIX] expression: improve o2m with m2o integer
We sometimes use in Odoo a One2many field with an inverse Integer
field instead of a usual Many2one.

This allow for example in several instances to have a "Many2one" which
can be reference from several models, eg:

Model Ranking:
	name = String field
	res_id = Integer field
	res_model = String field

Model Toy:
	rank = One2many [inverse: Ranking -> res_id]
                        [domain: res_model == Toy]

Model Tool:
	rank = One2many [inverse: Ranking -> res_id]
                        [domain: res_model == Tool]

This enable us to have a shared feature between otherwise unrelated models.

But there was several issue when searching on these One2many:

1) if the Integer Many2one was not stored (eg. it came from an inherits) on
   the searched model, this could lead to an error.

2) when we searched:

   - by IDs (rank in ['55']) with at least one id not respecting the domain
   - by IDs with a negative operator
   - with a negative operator on unfound string (rank != "no rank has this")
   - with a false value (rank = False)

   we would not apply the One2many domain (eg. res_model == Toy) and thus
   possibly getting Toy 3 errenously because a Tool 3 was found without
   the domain being applied.

This fix modify the search on One2many and for:

1. if the inverse is an Integer not stored field instead of Many2one
   manage it.

2. if the field is an Integer field instead of Many2one and there is a
   domain on the One2many: apply the domain on the inverse model found.

So only some search on One2many with a domain whose inverse field is an
Integer could be impacted.

This would also be nice to have for all One2many with a domain but the
probability of it being useful versus risk for performance is not judged
high enough.

opw-710508
2017-03-16 11:57:04 +01:00
Nicolas Martinelli 27f656a23e [FIX] mrp: duplicated raw materials
- Create Product A with a BOM which depends on a product with tracking
  "By Unique Serial Number" (Product B).
- Create a MO for Product A
- In the "Register lots" wizard, add two lines for "Product B", with the
  same serial number.

Nothing prevents the user to do it, even when the inventory is posted.

opw-709888
2017-03-15 14:01:04 +01:00
Goffin Simon 73de39150a [FIX] crm: Translation in crm.opportunity.report
The opportunity analyses displayed the stages always in English.

opw:708380
2017-03-15 10:50:12 +01:00
Goffin Simon 9f9657c04b [FIX] base: unlinking ir.model.constraint
When unlinking an ir.model, all the ir.model.constraint linked to this
ir.model must be removed to avoid to call unexisting model.

In stable version, the right fix would be to put an attribute ondelete=cascade
on the field model of ir.model.constraint.

In 10.0, the ir.model.constraint are created with module = the module where the related field
has been declared. But when unlinking the ir.model in function _module_data_uninstall, the related
ir.model.constraint to remove were chosen according to the removed modules. So with models
declaring constraints on inherited fields, some problems occured because the model could be removed
and not all the related constraints.

opw:716032
2017-03-15 09:17:53 +01:00
Pierre Masereel 945679176a [FIX] stock: warehouse check_reception_resupply
When we are trying to change the reception route of a warehouse when
there are existing resupply routes, we are getting a traceback.

This bug comes from a migration error introduced in rev: https://github.com/odoo-dev/odoo/commit/70e1d5d5bc1a3cb325dbcb091fc2135e23084145
2017-03-14 16:46:42 +01:00
Nicolas Martinelli a873890f28 [FIX] mass_mailing: link in kanban
- Go to Mass Mailing > Configuration > Mail Templates
- In the Kanban view, find a template which contains a link (http,
  mailto, whatever)
- Click on the link

You are redirected to the link instead of being redirected to the
record.

opw-706047
2017-03-14 16:19:04 +01:00
Martin Trigaux 8adc2ef440 [FIX] stock: do not write on picking type
When creating a stock.picking, the related fields picking_type_entire_packs and
picking_type_code were both updated.
This was an issue was required write access on stock.picking.type (warehouse
manager) to create a stock.picking (warehouse user).

The fields were updated as they were present in the view and filled with the
related value. Even if the value was unchanged, it was triggering a write
anyway.

The two fields were in invisible="1" and used only in attrs for other fields.

Making these two fields in readonly does not prevent to use it in the attrs but
avoid to send a value to the server and trigger a useless write.

Fixes #15769
2017-03-14 15:58:42 +01:00
qsm-odoo d32e275ad1 [FIX] web: force red color for invalid form elements
When an input is saved with an invalid value, it gets the
`o_form_invalid` class. This makes the border red. In enterprise, there
was a bug as required inputs have also a different border color and the
rule was more important. Unfortunately there is no avoiding
the !important rule here. Indeed, other solutions would require to make
more rules in enterprise or to change the order of files (which would
create many problems).
2017-03-14 14:47:17 +01:00
Martin Geubelle 5b4f7c13f3 [FIX] web_kanban: use string when group by selection
In the kanban view, if we try to group by a selection field that is
not defined in the arch, the key will be used as column name (instead
of the string).

A fix has already been pushed to load all the fields in this case
(see 0e6eb96) but these fields were not correctly used in this
particular case.
2017-03-14 13:23:44 +01:00
Moisés López 93bb6f322d [FIX] base: avoid variable referenced before assignment error
If the company currency is not active (that should not happen but nothing
prevents it, probably happening with some CoA installation), the variable
company_currency_format is undefined and an error is raised.

Closes #15799
2017-03-14 10:44:12 +01:00
Martin Trigaux 4c79aa8d9d [FIX] sale: translate default name at creation
When a sale order is created from the interface, the name field is read-only so
not given in the create call.

However, if the create values are filled with the default value, the string
'New' is translated and the condition is not met in the create method.

This commit makes the create consistent with the default `lambda self: _('New')`

Fixes #15839
2017-03-13 16:03:58 +01:00
Christophe Simonis 2ef43281c2 [MERGE] forward port branch saas-11 up to 2e972578b9 2017-03-13 15:53:55 +01:00
Christophe Simonis 2e972578b9 [MERGE] forward port branch 9.0 up to 73d6f9023a 2017-03-13 14:49:12 +01:00
Yenthe V.G e88bb57a1e [FIX] l10n_cn: load correct file for chinese accounting
The manifest loaded l10n_chart_china_standard_business_chart_data.xml but this file no longer exists in Odoo.
Changed to the new XML file.

Closes #15841
Fixes #15840
2017-03-13 14:47:18 +01:00
Christophe Simonis 73d6f9023a [MERGE] forward port branch saas-6 up to 31474efec2 2017-03-13 13:53:54 +01:00
Christophe Simonis 31474efec2 [MERGE] forward port branch 8.0 up to 7a15e52cea 2017-03-13 13:38:04 +01:00
Florent de Labarre 0ac303d12f [FIX] base_import : add xlrd to requirements.txt
Needed to import xlsx files

Closes #15644
2017-03-13 13:27:56 +01:00
Christophe Simonis 7a15e52cea [FIX] base: check ir.ui.view recursion 2017-03-13 13:27:53 +01:00
Laurent Mignon (ACSONE) 6339a68db0 [FIX] purchase: add method _prepare_stock_moves
During the refactoring of Purchase, the method '_prepare_order_line'
available in Odoo 8.0 has been lost. It's therefore no more possible to
extend this method to covers use cases where we need to provide
additional data to the stock moves created from a purchase_order_line.

This restores the functionality thanks to the method
`_prepare_stock_moves`.

Closes #15842
2017-03-13 12:05:11 +01:00
Nicolas Martinelli cab436819f [FIX] hr_expense: expense of zero
- Create an expense of 0.00, validate
- The expense can never be set as paid since it's not possible to create
  a payment of 0.00.

An expense of 0.00 still makes sense in the following use case.

An expense is paid by salary before the expense is actually made, i.e.
I get 1000 EUR to redecorate my homeoffice, I get the money beginning of
the year. After that I want to book expenses against the initial payment
until the 1000 EUR is gone and I would like to make use of the expense
workflow to approve the costs.

opw-710695
2017-03-13 08:15:26 +01:00
Odoo Translation Bot 00435d6384 [I18N] Update translation terms from Transifex 2017-03-12 04:31:45 +01:00
Odoo Translation Bot 70cac4d474 [I18N] Update translation terms from Transifex 2017-03-12 02:54:51 +01:00
Odoo Translation Bot dcd78c2c39 [I18N] Update translation terms from Transifex 2017-03-12 00:30:59 +01:00
Christophe Simonis c9e3d93ad0 [FIX] website: correct redirect with correct lang
When forcing another language that the current one (the cookie one) in an
url, the requested lang wasn't set correctly in redirect url, but the
cookie was, resulting in multiple redirect which ends with initial lang.

A side effect of this error was the inability to edit website page when
default lang is not en_US and user not in default lang.

The request context must be reset before being used by
`request.redirect` (in `url_for` method).
2017-03-10 18:31:21 +01:00
Denis Ledoux 4e95474ca1 [FIX] website_event_track: Tracks in the wrong room in the agenda
When setting an event tracks like this:
- Track 1, 10:00 to 10:30 Room A
- Track 2, 10:30 to 11:00 Room B
- Track 3, 11:00 to 11:30 Room A

In the agenda of the event, on the website, the Track 2
was displayed as in the Room A, while it should be in the Room B

opw-715480
2017-03-10 17:09:11 +01:00
Denis Ledoux 466e2b8c9f [FIX] mail: URL regex to make links clickable in chatter messages
The former URL took way too many steps to resolve
`www.odoo.com(odoo-odoo-odoo)`, more than 1 minute
according to the case, and it stucked the web client
(the entire browser actually),
and it ended matching the whole sentence as a link,
included `(odoo-odoo-odoo)`

This new regex is much simpler, resolve the above case,
and does not match `odoo-odoo-odoo` as part of the link

opw-715797
2017-03-10 17:09:11 +01:00
Nicolas Martinelli beaea311e6 [FIX] stock: typo
In method `_check_delivery_resupply`, `new_location` is used in a
`write` call. This expects an integer (id).

However, `new_location` is the result of `_get_input_output_locations`,
which returns a recordset.

opw-716141
2017-03-10 10:39:20 +01:00
Nicolas Martinelli e6e6a8889f [FIX] account: typo
The context is created as a set, not a dict.

opw-716141
2017-03-10 10:28:23 +01:00
Nicolas Martinelli abf946086d [FIX] mrp_repair: fees
- Create a repair order
- In the "Fees" list, select a product

The default information is not loaded (description, price).

opw-709368
2017-03-10 09:21:49 +01:00
Goffin Simon 8be16e7a1c [FIX] product: group_product_variant on product kanban view
The number of variants doesn't have to be displayed if variant not enable on product.

opw:711034
2017-03-09 23:52:38 +01:00
Goffin Simon e6d790e340 [FIX] account: _onchange_partner_id not matching fiscal position
When changing partner_id on an invoice, the fiscal positions with auto_apply=True,
must be checked to apply the right one.

To have the same behavior as in 10.0

Backport of this commit: 4b11e3e3a5

opw:715511
2017-03-09 16:21:37 +01:00
Nicolas Martinelli 1d0d74bd89 [FIX] payment: transaction form
The transaction form has readability issues. It is improved by taking as
a example the partner form.

opw-711162
2017-03-09 14:43:01 +01:00