Commit Graph
110077 Commits
Author SHA1 Message Date
xmo-odoo ed4a899254 [IMP] config: better no interpolate 2017-06-12 11:02:36 +02:00
Christophe Simonis 78dc8f6871 [FIX] website_crm_partner_assign: correctly check value changes
Since fdc8749888, leads may have a
default team set. Correctly check fields against previous values.
2017-06-09 18:56:07 +02:00
qsm-odoo fc53b91b06 [FIX] web: adapt tests to 3741603495
The datepicker is now forced to be in the <body/>, so the tests had to
search it in there.
2017-06-09 17:55:52 +02:00
Christophe Simonis cc38b93ab2 [MERGE] forward port branch saas-15 up to 49f819a7a7 2017-06-09 16:43:27 +02:00
Jérome Maes fb504f3cbd [FIX] sale_timesheet: compute revenue in a determinist order
Since we handle rouding error with the last line as
the difference of total and the other (already computed),
the order of lines to process is important.
Calling 'sorted()' on the lines to process allow
to always have the same last one.

Hope this will fix the random rounding bug, and make
the multi currency test always green !
2017-06-09 16:27:15 +02:00
Jérome Maes c5df9b572c [FIX] sale_timesheet: use same method for delivered and ordered
Respect the same computation about rounding for
delivered and ordered services when computing
timesheet revenue.
2017-06-09 16:26:53 +02:00
Christophe Simonis 49f819a7a7 [MERGE] forward port branch saas-14 up to b6c7d71899 2017-06-09 16:21:15 +02:00
Christophe Simonis b6c7d71899 [MERGE] forward port branch 10.0 up to cd1a8f6252 2017-06-09 13:28:06 +02:00
Jérome Maes 287958b57d [FIX] hr_timesheet,project_issue_sheet: can see timesheet tab
Only timesheet user can see the timesheet tab
on tasks and issues. This will avoid them logging
timesheets and getting access errors.
2017-06-09 13:12:16 +02:00
Jérome Maes 56948bb245 [FIX] hr_timesheet: set correct default value for timesheet
When logging timesheet, no employee is set by
default on the UI. The employee is deduced
from the user_id in the create, but we want to
see it on the list view even if it is not saved
yet.
2017-06-09 13:12:07 +02:00
Christophe Simonis cd1a8f6252 [MERGE] forward port branch saas-11 up to 1d7260cbcb 2017-06-09 13:08:51 +02:00
Christophe Simonis 1d7260cbcb [MERGE] forward port branch 9.0 up to 77be3d8b39 2017-06-09 12:51:31 +02:00
xmo-odoo 74a89bcf5c [FIX] base_geolocalize: geocode errors out on empty address
It's unclear whether that's a recent change or a long-standing issue,
however currently if geocode is called with an empty address string it
will reply with a 400 Bad Request, which gets raised as an exception and
forwarded to the user. That is not a great experience.

Shortcut the entire thing and just return None (= geolocation failed /
no geolocation) on trying to geolocate an empty address.

OPW-746686
2017-06-09 12:26:38 +02:00
Goffin Simon 6edc0f7e6b [FIX] calendar: _get_recurrent_date_by_event
Let's create in google calendar a reccurent event with all day
set and a end date.

When synchronising google calendar with Odoo(by clicking on button
"Sync with Google"). It raised on error because the start date had
a time zone but not the end date(the UNTIL in the rrule).

Fine tuning of 20ed57f

opw:746549
2017-06-09 01:04:21 +02:00
qdp-odoo bd4da1b749 [FIX] sale, sale_expense, stock_landed_costs: fix nightly build.
stock_landed_costs: on nightly, the localization installed may not have stock properties accounts defined. If it's not, we create them on the fly with a random account

 sale, sale_expense: fix broken tests due to mismatch currency:
    On 10.0-nightly, the currency of the company is not the same that the product.list0
    that leads to assertion errors.
2017-06-08 17:40:21 +02:00
Nicolas Martinelli f66fb9061d [FIX] website_forum: karma link
The karma link is an hardcoded page from odoo.com. The information might
therefore not be correct depending on the configuration of the user.

We change to redirect to the FAQ, which also contains Karma information.

opw-746383
2017-06-08 17:01:17 +02:00
Goffin Simon e79eaecc46 [FIX] stock:Creating new lots when option "use only existing lots" is activated
When the field use_create_lots is set to False in a picking type, it is not possible
to create lot for a pack operation linked to this picking type.

opw:744862
2017-06-08 16:16:28 +02:00
Jeremy Kersten fdc8749888 [FIX] crm, website_crm_partner_assign: recompute saleteam automatically
Add a constrains on user_id field to avoid to recompute manually the team_id.

Eg: action_foward didn't call the onchange manually, so the saleteam not updated.
2017-06-08 15:41:07 +02:00
qsm-odoo 78fee1c634 [FIX] website: restore some website rpc since new views
The website is not ready. It is still too young to understand what the
beautiful `_rpc` function can bring to its life. Someday it will, but
for now, it can at least rely on the `rpc.query` function or to the
'Ace' menu which now understands the beauty of `_rpc`.

---

-> Replace website `_rpc` calls with deprecated `rpc.query` as the
   website is not structured enough yet to handle 'trigger_up' events.

-> As the `_rpc` calls cannot be replaced for the ace editor because it
   is also used and tested in the backend, promote the 'Ace' menu (which
   instantiate the ace editor) to be a `ServiceProvider` so that the
   `_rpc` method works in this particular case.
2017-06-08 14:30:50 +02:00
xmo-odoo 45e94ec756 [FIX] web: CrashManager can crash if trying to show an empty message
If `d.message` is an empty string, `!!d.message` is false and the
crashmanager will try to display `d.error.data.message`… which does
not exist as it's a warning with an empty message not an upstream error.

That causes the crashmanager itself to crash, and even the warning
name/title to be lost.
2017-06-08 14:16:43 +02:00
Nicolas Martinelli 77be3d8b39 [FIX] account: avoid duplicated move name
Commits 9365482df0 and 8fc81b871d attempted to prevent the creation
of two moves with the same name during reconciliation. It works in most
cases, but it is still possible to reconcile the same statement line
with more than one line.

We add an extra check to make sure duplicate never happen.

opw-742018
2017-06-08 14:11:26 +02:00
Jairo Llopis c4c9347b99 [IMP] web: Expose char_domain dialog widget
This simple return allows submodules to be able to know when a dialog is shown and modify something in it.

Note from GED: I am aware that this is a IMP in a stable version, and I really don't like that... But it looks like it really helps many people, as shown by the PR, and the risk induced by this commit is definitely extremely low, so I will make an exception.
(PR: #15579)
2017-06-08 13:53:49 +02:00
xmo-odoo 1612f2cdf7 [FIX] website_forum: untranslatable strings
OPW-746261
2017-06-08 11:42:25 +02:00
Aaron Bohy 79e4a1f1b1 [FIX] web: ModelFieldSelector: add a way to clear the cache
The ModelFieldSelector keeps an internal cache for the fields_get.
This cache needs to be cleared in the tests environment because
a model with the same name may be defined several times accross the
tests modules, but they may contain different fields.

This could also be a problem with studio: when a field is created,
the ModelFieldSelector cache must be cleared as well (in addition
to the data_manager one).

We thus introduce a new 'clear_cache' event on core.bus. When
triggered, the ModelFieldSelector and the data_manager clear their
respective cache.

We use this event in the test environment to ensure that the cache
is cleared at the end of each test using a mockEnvironment. This
rev. also fixes an infinite loop in the override of destroy() in
the mockEnvironment, which occured when both session and config
were specified in the params.
2017-06-08 11:35:03 +02:00
nafex 8052869b19 [FIX] delivery: create_price_rules won't create unnecessary rules anymore
When updating a carrier that is not "fixed" or "base_on_rule", this
method was creating unnecessary delivery.price.rule at each write.
This patch fixes this issue.

Closes PR #17443
2017-06-08 11:16:17 +02:00
Denis Ledoux 11d6b5e15e [FIX] account: name search on journal with negative operators
In the journal items,
when performing a search
"Journal" "Doesn't contain" "Something"

Both its name AND its code must not contain "Something".
Therefore, with negative operator, the domain must
not be built with a OR connector but with an AND.

Same thing goes for "is equal" and "is not equal".

opw-726029
2017-06-08 11:15:42 +02:00
Aaron Bohy 8648d16e45 [FIX] web: correctly display nocontent helper if create='0'
When the root node of the arch has attribute 'create' set to '0',
the generated DOM element must have classname 'o_cannot_create'.
This is used to correctly display the nocontent helper (when there
is no record).

Before this rev., the helper indicated that the user can click on
'Create' to create a new record, even if the create action was
disabled. This was for example the case in Point of Sale > Orders.
2017-06-08 10:48:31 +02:00
Aaron Bohy 99ae418bf2 [FIX] web: Many2one: wait for name_create before saving
The problem occurred in form views with a many2one field, when the
user reproduced the following steps:
 - type some text in the many2one
 - click on 'Create ...' in the many2one dropdown to quick create
   (name_create RPC) the record
 - before the name_create returns, click on 'Save'.

When this happened, the record was saved before the many2one was
updated with its new value. So the record was incorrectly saved,
and the view was again dirty as soon as the name_create returned,
even if it was in 'readonly'. So after saving, a 'Changes will be
discarded' dialog opened when the user tried to leave the form.

We fix this issue by making the controller wait for the name_create
to return, and for the many2one to update its value, before saving.

This issue could also occur in list views.
2017-06-08 10:48:31 +02:00
Denis Ledoux b4863378ef [FIX] website, website_sale: product website price and pricelist without request
Attempting to read the field `website_price` directly
with the XMLRPC API failed because, in such a case,
the request is unbound, and attempting to read
anything from it (`request.session` whatever)
resulted to the raise of an exception.

e.g.
This prevented to perform a `search_read`
with all fields on the `product.product` model

Closes #14939
opw-745733
2017-06-08 10:29:16 +02:00
Goffin Simon 3d1fe33a36 [FIX] calendar: _get_recurrent_date_by_event
Let's create in google calendar a reccurent event with all day
set and a end date.

When synchronising google calendar with Odoo(by clicking on button
"Sync with Google"). It raised on error because the start date had
a time zone but not the end date(the UNTIL in the rrule).

Fine tuning of 20ed57f874

opw:746549
2017-06-08 10:27:44 +02:00
Olivier Dony c047b1619c [MERGE] Forward-port 10.0 up to 7d7d6ee5af 2017-06-07 23:48:08 +02:00
Olivier Dony 7d7d6ee5af [MERGE] Forward-port saas-11 up to fff4af36ab 2017-06-07 23:43:08 +02:00
Olivier Dony fff4af36ab [MERGE] Forward-port 9.0 up to ef82574fb1 2017-06-07 23:40:52 +02:00
Olivier Dony ef82574fb1 [MERGE] Forward-port saas-6 up to b604f3b3da 2017-06-07 23:29:41 +02:00
Olivier Dony b604f3b3da [MERGE] Forward-port 8.0 up to c6b9b69f6a 2017-06-07 23:11:38 +02:00
Olivier Dony c6b9b69f6a [FIX] base_import_module: allow selective access to module files
As a consequence of rev. 76cd8d2558,
imported modules were unable to access their resource files during
import.

Rather than further modifying the file_open API to whitelist paths
(the whole thing needs a redesign in master), we temporarily
whitelist the temporary directory by including it in the global
addons_paths, making sure to undo it afterwards.

This gives all lower level function access the resource files via
file_open, without having to pass around whitelisted paths
through many different calls.
2017-06-07 22:46:25 +02:00
Richard Mathot 65e49baede [DOC] website_event_sale: think multicurrency when writing tests 2017-06-07 16:13:06 +02:00
Nicolas Martinelli 506ac45537 [FIX] resource: get working hours
- Use the demo resource calendar (40h/week)
- Create a project forecast for the Administrator
- Set the 'Start date' and 'End date' to 2017-07-07
- Plan 8 hours

The % of time should be 100 %, but it's not always the case.

The core of the issue comes from `get_working_hours`.

Case 1:
Call with start_dt = end_dt = 2017-07-07 00:00:00
`get_working_hours_of_date` is called twice with the following start/end
dt:
- 2017-06-07 00:00:00, 2017-06-07 00:00:00        => 0 hours
- 2017-06-08 00:00:00, 2017-06-08 23:59:59.999999 => 8 hours

This is obviously not correct, we don't care about what happens on
2017-06-08. The number of hours is correct in total, but it comes from
the wrong day.

Case 2:
Call with start_dt = 2017-07-07 00:00:00 and end_dt = 2017-07-07 23:59:59
`get_working_hours_of_date` is called twice with the following start/end
dt:
- 2017-06-07 00:00:00, 2017-06-07 23:59:59.999999 => 8 hours
- 2017-06-08 00:00:00, 2017-06-08 23:59:59.999999 => 8 hours

This is obviously not correct either...

We change how the `until` parameter is computed. This way, the correct
call is the second call (Case 2), and `get_working_hours_of_date` is
calld once with the following start/end dt:
- 2017-06-07 00:00:00, 2017-06-07 23:59:59.999999 => 8 hours

opw-745253
2017-06-07 16:10:01 +02:00
qsm-odoo 3741603495 [FIX] web: restore broken datepicker since lib update
There were two main problems with the datepicker since the lib was
updated:
- it appeared broken in the search view "Filters" menu
- it did not overflow the parent which scrolls

Indeed, before the update, the datepicker was placed in the <body/>.
Now this is a lib option. Unfortunately, the option is broken (I don't
know why they broke it since it worked before the lib update...). As the
lib does not expose its internal functions, the only found workaround was
to patch the lib code itself.

opw-745311
opw-745625
2017-06-07 16:09:16 +02:00
Denis Vermylen c0f81be335 [FIX] hr_holidays: add short name_get possibility
it will be used for the gantt view in enterprise
2017-06-07 14:36:25 +02:00
Goffin Simon 2332df6bc7 [FIX] mrp: Post inventory button without finished product
Let's consider P1, P2 and P3 with a cost=1$, three stockable products where
P1 and P2 are in the same product category PC1 with a Stock valuation
account = SVA1 and P3 is in the product category PC2 with a Stock valuation
accout = SVA2. PC1 and PC2 are set with costing method in real price and
Inventory valuation = perpetual(automated).

Steps to reproduce this issue:

-Create a BOM where P3 is composed by 1 P1 and 1 P2
-Create a PO for P1 and P2 with a cost of 5$ for each one
-Create a MO to produce 1 P3
-Check availability
-Insert manually the consumed product(1 P1 and 1 P2)
-The button "Post Inventory" appeared, clicked on it
-Check the general ledger, two moves with debit=5$ has been created
for P1 and P2 in PC1(it's ok)
-Produce the MO and click on "Post Inventory" again
-Check the general ledger, two moves have been created, one with a credit of 2$
on PC1 and one of debit of 2$ on PC2(it was wrong)

The expected moves for the last step is:
a credit of 10$ on PC1 and a debit of 10$ on PC2 because the purchase price must be
considered as P1 and P2 are in real price.

NB: Everything is ok if the button "Post Inventory" is clicked after the production.

opw:741748
2017-06-07 14:35:37 +02:00
Nicolas Martinelli 7b21016760 [FIX] stock: unlink scrap
Forbids to unlink a done scrap.

opw-746294
2017-06-07 14:26:03 +02:00
Goffin Simon 86a0d31251 [FIX] account: Validating a statement with old posted moves
When validating a statement with old posted moves, the lock date
was checked by function, _check_lock_date and then it was impossible
to validate the statement even if all the moves were already posted.
2017-06-07 13:29:58 +02:00
Denis Ledoux c638fbdf23 [FIX] stock: ACL for product attributes for Inventory managers
If only Inventory is installed,
only the admin could create new product attributes
for products variants. Other managers couldn't.

This revision adds the ACL according to what is done in other modules,
such as in `sale`.

Mostlikely, we should create a product manager group, for which
this rights are given, and make the other groups (sales manager, inventory manager)
inherit from this one.

opw-745735
2017-06-07 11:21:07 +02:00
Harshad Modi 922a04dbd2 [FIX] project: fix traceback while setting cover image
from project task kanban view (PR #17165)
2017-06-07 10:15:04 +02:00
ppr-odoo ac1fad575e [FIX] web: apply modifiers on separator in FormRenderer
Before this commit, the separator tag ignored all modifiers.
2017-06-07 10:01:33 +02:00
Goffin Simon 20ed57f874 [FIX] calendar: _get_recurrent_date_by_event
Let's create in google calendar a reccurent event with all day
set and a end date.

When synchronising google calendar with Odoo(by clicking on button
"Sync with Google"). It raised on error because the start date had
a time zone but not the end date(the UNTIL in the rrule).

opw:745665
2017-06-07 09:30:36 +02:00
Aaron Bohy 5aa1cf1890 [FIX] web: re-introduce wow effect
When clicking on buttons with classname o_wow (e.g. when marking
an opportunity as won).
2017-06-07 09:25:48 +02:00
Aaron Bohy cb9a8bdc79 [FIX] web: ModelFieldSelector: less tweaks 2017-06-07 08:08:49 +02:00
Aaron Bohy 25e7014650 [FIX] web: Form: correctly autofocus fields
The autofocus worked fine when switching from 'readonly' to 'edit',
but not when clicking on 'Create' from the multi-record view. This
was because in this case, we were trying to focus the field while
the view wasn't in the DOM yet. This rev. ensures that we wait for
the view to be appended to the DOM before trying to set the focus
on the default field.

Also ensures that the first visible field is correctly focused.
Before this rev., if the first field was invisible (or simply
not focusable), no field was focused.

Credit goes to @msh-odoo for the preliminary work.
2017-06-07 08:08:49 +02:00