Commit Graph

94244 Commits

Author SHA1 Message Date
Denis Ledoux bd9cbdfc41 [FIX] web: sql constraint translation
The `check` decorator expects the context to be in the `kwargs`
or to be the last arguments of the method.

The `call_kw` route, which is decorated by the `check` decorator,
like every route,
expands its kwargs arguments.

Therefore, once in the `check` decorator,
the context is located in the `kwargs` key
of the kwargs.
(More simply, instead of
`kwargs.get('context', {})`
it's
`kwargs.get('kwargs', {}).get('context', {})`

As the context is not retrieved correctly,
the lang is not set correctly either,
and the sql constraints were not translated.

In 7.0, it worked, because there was a double
check, as the call_kw was called trough an rpc
(`dispatch_rpc`) call,
which was decorated by the `check` as well.

As a fix for 8.0, we apply the same logic,
we perform a double check, with an indirection.

The check decorator should probably be
refactored, but this cannot be done
in a stable release such as 8.0.

Closes #3634
2015-09-04 12:58:00 +02:00
Goffin Simon 64e1c28e35 [FIX] resource: get_working_intervals_of_day
To compute start and end date of a working interval this function replaced
hour in datetime object without taking into account the time zone. The start and end date
taking respectively from calendar_working_day.hour_from and calendar_working_day.hour_to are
in the time zone of the user and the datetime object are compared in UTC to avoid schedule's gap.
This is why the start and end must be converted in UTC after being replaced by these hours.
The tz_info must be removed from dates because it's forbidden to compare naive and aware dates.

opw:648349
2015-09-04 10:01:20 +02:00
Nicolas Lempereur a69af9c908 [FIX] addons: propagate context when get sequence
With 3e82c94d we use the timezone in the context to format date
sequences when formatting an ir.sequence.

This commit adds the other missing context when getting a sequence, so
these sequences are also dependant on the timezone.

closes #8351
opw-646487
2015-09-03 13:58:01 +02:00
Goffin Simon ea2745b866 [FIX] delivery: conversion rate according to the date
When using compute in model "res.currency", the date must be set in the
context to have the right conversion rate.

opw:647799
2015-09-03 11:35:24 +02:00
Nicolas Lempereur ea07b7dc2b [FIX] website: don't escape if embedded html field
We should escape arch ir.ui.view arch content, but we should not escape
embedded html field content.
2015-09-02 18:36:19 +02:00
Josse Colpaert 56a6483477 [FIX] stock: inventory filters check used the wrong groups 2015-09-02 18:21:31 +02:00
Matthieu Dietrich 1cfe1910db [FIX] account: Remove superfluous bracket for analytic account domain
With the bracket in place,
the domain does not consider the last part,
"('state','not in',('close','cancelled'))".

Closes #3714
2015-09-02 14:10:19 +02:00
Goffin Simon c3b847daa8 [FIX] delivery: total passed to get_price_from_picking
The total used to check which delivery.grid.line to apply must be in
the currency of the company because the delivery.grid.line records with
variable == Price are expressed in the currency of the company.

opw:647799
2015-09-02 12:17:01 +02:00
matt454357 f243a01795 [FIX] hr_timesheet_sheet: Attendances & timesheets timezone
When creating timesheet,
default from-date and to-date are adjusted for user timezone.
Fixes #3627

User timezone considered when assigning attendance records to timesheet
Fixes #3628

Closes #3632
2015-09-02 11:48:55 +02:00
Lionel Sausin a0d44f9952 [IMP] update the expiry dates when changing the product
Written in the new API even though the rest is in the old API, because otherwise we'd have to add an onchange in the views which may be a problem for existing custom modules.

We want this behavior because previously, in some cases the default values were only added at create() time, ie. possibily when the users close the pop-up, so they may never have an opportunity to see and adjust the default.
2015-09-01 18:04:45 +02:00
Denis Ledoux 3c0fe940aa [FIX] google_calendar: force internal id only on creation
This rev. is related to 1c533b193f

The reason why we force the event Google internal id is
explained in the above commit.

Forcing the internal id must be done only when creating the
event in Google, not when updating, for retro-compatibility:
if the event is already in the attendee calendar, with a different
internal id then the other attendee, we must leave it like this,
otherwise Google will be lost.
2015-09-01 17:36:52 +02:00
Denis Ledoux 1c533b193f [FIX] google_calendar: events disappearing
This rev. is related to a9e3d74713

This new revision is about the same use case than above, except
that both Google users login doesn't match the Odoo login email.

e.g.
User A: A@agrolait.com in Odoo, A@gmail.com in Google
User B: B@agrolait.com in Odoo, B@gmail.com in Google.

When A creates an event, with B in the attendees, and
syncs his calendar to Google, B is not automatically invited
Google side, as his attendee email is B@agrolait.com, which
doesn't match any existing Google User (doesn't match B@gmail.com)

While the revision mentioned above, a9e3d74713,
expected the attendee to be automatically invited Google side, and therefore
expected the event to already exists in B's calendar.

Therefore, when B syncs his calendar in Odoo, as the event
was there in his Odoo calendar, but not in his Google Calendar,
the code actually think it's no - longer - there, and take the assumption
the event has been deleted Google side. So, it deletes the event
in Odoo side as well, for both users A & B.

To overcome this new issue, when the Google & Odoo users emails
do not match, while keeping the compatibility when the Google & Odoo
emails do match (and therefore the invitation is automatically sent
Google side, as the email matches an existing Google account, and
the event is automatically created in B's calendar without needing the
sync in Odoo), we now force the Google internal id to be the same
for all attendees of an event, event by Google side.

opw-645745
2015-09-01 17:15:43 +02:00
Denis Ledoux b8f630e59f [FIX] stock_account: context could be None
In the use case of a mrp repair ending, the
context when calling `_store_average_cost_price`
is None

opw-648254
2015-09-01 16:18:10 +02:00
Thomas Rehn 0fb00808b2 [FIX] account_bank_statement_extensions: lines confirmation
Confirm lines of account cash statement on closing

The `account_bank_statement_extensions` adds
a state field to account.bank.statement.line
and sets the status to 'confirm'
when a bank statement is closed.

When a cash statement is closed,
the lines remained in draft.

Closes #3584
2015-09-01 12:41:20 +02:00
Goffin Simon fdd08a8b4b [FIX] account: closed period in test
The period used to make the test must be closed.
2015-09-01 12:05:29 +02:00
Commandant Custo f26df86ea9 [FIX] portal_sale: fix default domains
Quotations/Sales orders menu in the portal must copy the behavior
of the menus in the regular back-end.
Backport of e5c5b1cc23

closes #8271
opw:648186
2015-09-01 09:58:41 +02:00
Commandant Custo e5c5b1cc23 [FIX] portal_sale: fix default domains
Quotations/Sales orders menu in the portal must copy the behavior
of the menus in the regular back-end.

closes #8271
opw:648186
2015-09-01 09:35:39 +02:00
Ravi Gohil 0c1e97895a [FIX] server: missing format string argument.
Introduced by 099ae0f70c

Closes #3356
2015-08-31 17:55:00 +02:00
Olivier LAURENT 017688cc29 [FIX] models: old api, prevent infinite recursion in stored function fields
The risk was introduced by b7f1b9c.
IF _store_set_values() recall another _create() or _write(),
the recomputation mechanism enter in an infinite recursion
trying to reevaluate for each call exactly the same fields
for the same records than the previous one

This revision replaces the loop of _store_set_values()
by 2 nested loops:

 - that not breaks the entire consumption
   of recompute_old queue
   (Tested thanks to revision a922d39),
 - that allows to clear the queue
   before each recomputations bundle fixing thereby the recursion

Closes #7558
2015-08-31 17:45:21 +02:00
Denis Ledoux 408ac6a5f0 [FIX] hr_timesheet_invoice: on_change_account_id expects context instead of user_id
This is related to 12c1993e03
2015-08-31 15:22:11 +02:00
Pedro M. Baeza 12c1993e03 [FIX] hr_timesheet_invoice: Call super on on_change_account_id of hr.analytic.timesheet
`hr_timesheet_invoice.py` overrides `on_change_account_id`
of model `hr.analytic.timesheet`.

The super call wasn't done, probably because this on_change
method in the base model was trivial:
`return {'value':{}}`

Nevertheless, if another module overrides this on_change,
according to the module dependences,
this method could have been called first in the calling chain,
discarding the changes from the other overriden
`on_change_account_id` methods, preventing
any customization in this on_change according to the
current database state.

Closes #8248
2015-08-31 14:25:07 +02:00
Goffin Simon f4e6dba097 [FIX] point_of_sale: barcode_reader
In the POS, when trying to add a new product in an order
with an already printed ticket, the added product must be
add in a new order.

opw:647499
2015-08-31 13:43:33 +02:00
Antonio Espinosa f310a82a20 [FIX] membership: Membership dates on children propagation
When creating a new contact for an existing member
partner, the membership dates were not correctly
computed, while the state was.

Closes #8207
2015-08-31 13:09:42 +02:00
xmo-odoo 134c3b80e7 Merge pull request #8290 from Yenthe666/patch-1
[IMP] hr_jobs: better grammar in demo data
2015-08-31 09:32:51 +02:00
Goffin Simon 283bffd054 [FIX] website_sale_delivery: display of the delivery price
In the shop, the price of the delivery must be displayed in the currency linked
to the pricelist of the sale order.

opw:647799
2015-08-31 09:18:48 +02:00
Yenthe feb5aebc8d Incorrect english terms
Updated
"Good language skills in an other langages"
to:
"Good language skills in another language"
2015-08-30 15:55:28 +02:00
Odoo Translation Bot b79d492ec4 [I18N] Update translation terms from Transifex 2015-08-30 01:51:03 +02:00
Nicolas Lempereur 898cae5684 [FIX] calendar: manage export of recurring event
When we export a recurring event, there was an error since there is
virtual ids (like '{real_id}-{date_of_the_event}').

Events steming from a recurring events are in fact shown virtually. In
the database there is really only one event and a suffix is appended to
the id to target a given instance of a recurring event.

If we want to separate a recurring event from the instances, we can edit
the instance and use the link "Update only this instance", once done
this instance is separated for the recurring event.

This commit if one or more recurring events instances are selected when
an export is done, will only export one source event of each of the
events occurences.

fixes #7932
closes #8262
opw-647676
2015-08-28 17:24:47 +02:00
Antonio Espinosa e1d59f8f82 [FIX] resource: Schedule days backwards when days is negative number
Regarding _schedule_days, similar thing was done in
saas-6, @ fd5e7f2.
When the argument `days` was negative, the
returned intervals were wrong.

Regarding `get_working_intervals_of_day`,
calling this method without
`default_interval` and calendar
set crashed.

Closes #8208
2015-08-28 12:33:46 +02:00
Christophe Simonis 416364fcca [FIX] sale: typo in field context 2015-08-28 11:03:34 +02:00
Christophe Simonis d744923b63 [MERGE] forward port of branch saas-3 up to 1783a7d 2015-08-27 18:01:52 +02:00
Christophe Simonis 1783a7d005 [MERGE] forward port of branch 7.0 up to 411a07a 2015-08-27 18:01:14 +02:00
Colin Newell 84857a3f4f [FIX] currency: simple quote in currency symbols
Escape the currency symbol to prevent javascript errors,
for instance when reconciling a bank statement
(with the special reconciliation widget)

Closes #8216
2015-08-27 17:45:59 +02:00
Pedro M. Baeza 617ef49959 [IMP] purchase: Hook for the base price of a purchase line
To be able to change the logic without copying large chunk of code
Closes #1468
2015-08-27 17:42:20 +02:00
Pedro M. Baeza cbe85f42d0 [IMP] sale: hooks for the base price and the quantity
To make it easier to override without rewritting the full method
Closes #1470
2015-08-27 17:42:20 +02:00
Nicolas Lempereur 8c77c711ee [FIX] website: escaping saved html content
Escape text nodes changed via the web editor before sending the content
it to the server controller.

It is done since the content is unescaped one time when being displayed,
and it is not done for inline style and script tags (which may be
injected by dropping a snippet) since that would break them.

replacing the solution in cdb900044.
2015-08-27 17:27:39 +02:00
Goffin Simon 96be5b404a [FIX] gamification: Refresh Challenge
When clicking on the button "Refresh Challenge" in the "gamification.challenge"
view form, all the "gamification.goal" records linked to this challenge must
be updated.

opw:647983
2015-08-27 16:41:52 +02:00
Denis Ledoux ed214a6681 [FIX] website, website_sale: alternative for images
Images should have an alternative
(the "alt" attribute") in order
to be W3C compliant (accessibility).

opw-648135
2015-08-27 15:46:14 +02:00
Denis Ledoux 399cbc7522 [FIX] account: due payments report, missing line returns
The lines breaks in the overdue payments message
(Settings > Companies > ... > Overdue payments)
were not respected.

opw-648133
2015-08-27 14:53:14 +02:00
Denis Ledoux 13010ed992 [FIX] purchase: timezone aware dates in PO emails
This rev. is related to b3e6065385a7ba5f914c258cd746b028d92801d

opw-647775
2015-08-27 14:34:58 +02:00
Nicolas Lempereur 411a07a64e [FIX] web: enable default_focus on html field
closes #8244
opw-647578
2015-08-27 13:20:41 +02:00
Goffin Simon 5a224497a9 [FIX] account: proposed invoices
In bank statement reconciliation, when selecting an other partner(with the pencil),
the possible invoices to reconcile must be suggested.

opw:647210, 647885
2015-08-27 13:16:54 +02:00
Nicolas Lempereur e2930e19a0 [FIX] web: glitch with scroll and list editable
On a first edition of a view list editable, scrolling before the first
edition might cause an issue: the editing fields are higher than they
should.

This commit solves this.

This issue stems from jQuery .offset({value}) function which is broken
if the element we want to position:

- is in absolute postionning,
- is inside a scrolled element in non static positionning,
- has not both top and left css property setted,
- has no ancestor element between itself and the scrolled not in static
  positionning.

This issue happens less (and probably not at all) in saas-6 since the
last condition is most often not met thanks to this change:
 https://github.com/odoo/odoo/commit/1ccd87a#diff-27c072074221456684bfc5f150ca0bc9R876

This issue of jquery is solved since jquery 3.0.0-alpha1:
 https://github.com/jquery/jquery/commit/2d71594

( the issue is shown in https://jsfiddle.net/wpjrnggf/ and we can see it
is solved with jQuery 3.0.0-alpha1 https://jsfiddle.net/L6ykpjgy/ )

closes #8251
opw-647622
2015-08-27 13:17:00 +02:00
Nicolas Lempereur 0c4905738e [IMP] web_kanban: enable widget float_time
Enable widget float time in web_kanban which format a float as
hours:minutes (the unit of the float being an hour).

closes #8255
opw-648068
2015-08-27 13:17:00 +02:00
Denis Ledoux 0f03699956 [FIX] auth_signup: login & name readonly if signup with token
In the case of a signup with token, the user login
already exists, and changing of login (email) is
therefore not allowed.

It's the same behavior than in the reset password
view (`auth_signup.reset_password`)

opw-648125
2015-08-27 12:22:21 +02:00
Pedro M. Baeza 675d09c005 [FIX] fields_view_get super arguments
The context argument needs to be passed as positional argument to avoid issues
when surcharging fields_view_get

Closes #7933
2015-08-27 11:07:11 +02:00
Pedro M. Baeza 6b98819948 [FIX] membership: Don't overwrite invoice lines for membership invoice
The invoice line is already linked to the invoice
as it has the invoice_id field filled in the
invoice line create method just above.

Closes #7971
2015-08-27 10:49:35 +02:00
Joren Van Onder 1db1027cd5 [IMP] point_of_sale: do more aggresive logrotate on rsyslog logs
/var/log/syslog gets filled up quicker than usual because of all the
crontab logs:
Aug 26 09:29:01 raspberrypi /USR/SBIN/CRON[21223]: (root) CMD (rm /var/run/odoo/sessions/*)
2015-08-26 15:12:40 +02:00
Joren Van Onder 02f0cbe353 [IMP] point_of_sale: keep as many scripts as possible in the odoo repo
This way we don't require a new image when we want to change eg. the
odoo configuration file.
2015-08-26 15:12:40 +02:00
Joren Van Onder f0551d2d8d [IMP] point_of_sale: get rid of avahi-daemon on posbox 2015-08-26 15:12:40 +02:00