Commit Graph

83235 Commits

Author SHA1 Message Date
Joao Alfredo Gama Batista 2e123fbb85 [FIX] Fix exception translation 2015-05-20 11:22:25 -04:00
Nicolas Martinelli ba896aabe7 [FIX] stock: if cost_method of a product is 'average' do not round the currency conversion
This prevents rounding errors if product decimal precision is different from
currency precision.

Fixes #6547
opw-634390

Do not fowardport since already done in v8.0:
https://github.com/odoo/odoo/blob/8.0/addons/stock_account/stock_account.py#L310
2015-05-20 17:00:37 +02:00
Nicolas Martinelli 9c6ae3cf6c [FIX] mrp_operations: adapt the date_planned of the WO when date_planned of MO is changed
Changing the scheduled date (date_planned) of the MO triggers a computation
of the scheduled date of the associated WO in order to keep the data
consistent.

Fixes #6694
opw-639771
2015-05-20 16:57:09 +02:00
Denis Ledoux 54a90179bb [FIX] expression: ensure tuple to compare leaf with TRUE/FALSE leaf
When setting a custom filter with as domain
[(0, '=', 1)]

the domain was rejected, because (0, '=', 1) wasn't
considered as a valid leaf, while it is.

This is because the Javascript converts this domain
using list instead of tuple
[(0, '=', 1)] -> [[0, '=', 1]]

And therefore, comparing the "list" leaf
to the TRUE/FALSE leaf tuple failed.

Ensuring "element" as a tuple solves the issue.

opw-640306
2015-05-20 15:33:35 +02:00
Denis Ledoux 6026c2f4d0 [MERGE] forward port of branch 7.0 up to cc61d46 2015-05-20 13:39:39 +02:00
Goffin Simon cc61d467fa [FIX] purchase: validate invoice
A user that has the rights in Accounting & Finance equal to Invoicing & Payments
must have the right to validate a supplier invoice.

opw:634601
2015-05-19 14:14:07 +02:00
Denis Ledoux 70f22254f5 [MERGE] forward port of branch 7.0 up to 335a8af 2015-05-19 10:26:33 +02:00
Christophe Simonis 0f5b6cf60b [MERGE] forward port of branch 7.0 up to c435b84 2015-05-18 17:13:18 +02:00
Nicolas Martinelli 335a8afe79 [FIX] stock: remove state modifiers for field note in stock.picking
Remove the state modifiers for field note in stock.picking in order to have a
behavior which is consistent with sales orders or invoices.

opw-639956
2015-05-18 14:52:06 +02:00
Goffin Simon c435b8438e [FIX] web: With safari, UnicodeDecodeError
The headers returned by content_disposition must be either in Unicode or in ASCII.
The encode function expects a Unicode or ASCII string.
The quote function from urllib2 expects a UTF-8 string and retruns a ASCII string.

opw:634205
Fixes #6160, #6557
2015-05-13 16:56:12 +02:00
Denis Ledoux acd61f8f0e [FIX] purchase: deletion of PO lines in states other than approved/done
This is related to revision 65d7cc524d

The `order_line` field of `purchase.order` is readonly within states
aprroved, done. See the field definition. This means it should be
possible to remove lines of a `purchase.order` when the PO is in
any other state than approved or done.

Therefore, the deletion of lines shouldn't be prevented
when the PO is not in state approved or done

opw-634538
2015-05-13 11:42:09 +02:00
Denis Ledoux ffc40b611b [MERGE] forward port of branch saas-3 up to e2bfb96 2015-05-12 17:55:50 +02:00
Olivier LAURENT 242e61796b [FIX] mail: missing spaces in email subjects composed of several encoding
sometimes some blank spaces are lost in subject of some incoming messages

There is a bug in `decode_header` in Python < 3.3,
which leads to lost some spaces in the email subjects
when several encodings are used in this subject.

See
- Issue: http://bugs.python.org/issue1079
- Fix: https://hg.python.org/cpython/rev/8c03fe231877

Joining the strings returned in the result of `decode_header`
solves most cases. Only extreme cases, like having
a subject with several different encodings following
each other without white spaces between them could lead
to have extra spaces in the subject. It won't happen
most of the time.

Closes #6629
2015-05-12 17:53:16 +02:00
Matthieu Dietrich d1c4d16a3a [FIX] account: Don't copy many2many when copying statement line
When duplicating confirmed bank statement lines,
the many2many `move_ids` links were preserved, and,
therefore, there were links between the duplicated
lines and the move entries of the original lines.

Closes #6617
2015-05-11 16:54:30 +02:00
Christophe Simonis e2bfb969ed [MERGE] forward port of branch 7.0 up to 6e23b2a 2015-05-08 18:10:30 +02:00
Olivier Dony 6e23b2a807 [FIX] ir.model.data._update: create/modify XML IDs as super-user
When importing a CSV file with an "id" column containing
external IDs (XML IDs), the system automatically creates
or updates the corresponding ir.model.data entries.
This would fail for regular users who do not have
create/write access on this internal model.
2015-05-08 10:25:44 +02:00
Nicolas Martinelli f9d25973d0 [FIX] account: create statement from invoice line uses statement date instead of today's date
Using statement date is necessary in order to select the appropriate currency rate.

opw-634297
2015-05-07 13:52:21 +02:00
Denis Ledoux da93981cb0 [MERGE] forward port of branch 7.0 up to f300d64 2015-05-07 11:33:59 +02:00
Goffin Simon f300d648a8 [FIX] web: attachment with safari
With Safari, the function content_disposition must return "attachment; filename=\"%s\"" % filename
to avoid that Werkzeug raises an UnicodeDecodeError.

Fixes #6160
opw:634205
2015-05-07 10:13:10 +02:00
Denis Ledoux 8aa6aa0c78 [FIX] account: entries analysis with null values in debit/credit
In SQL, the addition/subtraction between NULL and an integer/numeric
returns NULL.

Therefore, if either debit or credit was set to null instead
of 0.0, debit-credit returned null, instead of the actual subtraction

opw-634044
2015-05-06 18:22:16 +02:00
Denis Ledoux ae634e7a04 [MERGE] forward port of branch 7.0 up to 567ade5 2015-05-05 17:51:31 +02:00
Denis Ledoux 567ade56df [FIX] account: import invoices wizard currency amount
Within the 'import invoices' wizard in bank statements
(addons/account/wizard/account_statement_from_invoice.py)

Prevent currency rate differences when the statement
currency is within the company currency (and therefore
the debit/credit fields are already within the currency
of the statement)

opw-631895
Closes #6504
2015-05-05 17:48:18 +02:00
Julien Legros 8e6f9be08f [CHG] web: odoo.com account fallback url
The default odoo.com account page is now located at
https://accounts.odoo.com/account.
2015-05-05 11:29:15 +02:00
Martin Trigaux 7dd2d201a0 [FIX] web: localisation for Lao and Bosnian
The datejs globalisation files are loaded based on the user's language.
If the file is not present, the loading crashed and the user could not access to
the web client.
Adding empty files for lo_LA and renaming bs-BS.js to bs-BA.js for bs_BA (see
65d92da) that were missing.

By the way, this is a 0 bit commit, beat that!
2015-05-05 10:28:17 +02:00
Denis Ledoux e552e09873 [MERGE] forward port of branch 7.0 up to e601a41 2015-04-30 14:38:17 +02:00
dufresnedavid e601a416ad [ÏMP] l10n_ca: complete Canadian chart of account
Fixes #5496
2015-04-30 14:35:02 +02:00
dufresnedavid f3339c6c51 [FIX] l10n_ca: tax signs of refund taxes
Fixes #5496
2015-04-30 14:34:48 +02:00
Denis Ledoux 1da5d89ba3 [FIX] web: advanced search on floats with ',' as decimal separator
When using another decimal separator than `.` (dot)
in the language settings,
it wasn't possible to build an advanced search specifying
the decimals.

e.g. with a language with decimal separator `,` and thousand
separator `.`,
if you want to search invoices with amount total 366,38
The advanced search "Total" "is equal to" obliged you
to enter your number with `.` as separator (366.38),
and then, when entering the search, the `.` was
regarded as the thousand separator, giving as domain
`('amount_total', '=', 36638)`, which is not what you asked.

opw-634201

PS: The `|| '.'` in the xml template are only for
retro-compatibility, so if the server sources are
updated, but the browser cache is not refreshed
(meaning the Javascript code isn't refreshed, and,
therefore, `widget.decimal_point is undefined)
it still works.
2015-04-30 13:39:30 +02:00
Denis Ledoux 2c3c2b57db [MERGE] forward port of branch 7.0 up to f2f4391 2015-04-30 10:50:51 +02:00
Denis Ledoux f2f4391e8b [FIX] account_followup: partial overdue payments
This is related to rev. ab9f02cdee

The above rev. take care to exclude payments that are not yet due;
meaning the ones due in the future, by checking the maturity
date.

Problem: Payments (e.g. move lines from bank statements)
do not have a maturity date. Only move lines that actually
have a maturity date, in the future, must be excluded,
not the one that do not have a maturity date.

opw-633930
2015-04-29 17:45:02 +02:00
Nicolas Martinelli fa01054ae0 [FIX] delivery: delivery price uses pricelist currency instead of company currency
opw-632574
2015-04-29 17:17:20 +02:00
Mohammad Alhashash a6a3db3188 [FIX] account: custom '_where_calc' method instead of 'search'
The domain on account.account was preprocessed in search method but it had no
effect on read_group. This lead to inconsistency or errors when using 'goup by'
filter.

Move domain processing in '_where_calc' method instead as this is used by both
'search' and 'read_group'.
2015-04-29 11:17:47 +02:00
Mohammad Alhashash 717a695317 Revert "[FIX] account: remove journal_id from account domains"
This reverts commit 24526b18a7.
The journal_id field is not present on account.account but is processed in
search method.
Next commit will improve the processing to also accept journal_id in read_group.
2015-04-29 11:06:29 +02:00
Mohammad Alhashash 24526b18a7 [FIX] account: remove journal_id from account domains
From invoice lines and move lines views.

The model 'account.account' has no field journal_id.
2015-04-28 16:34:29 +02:00
Denis Ledoux 39325842e4 [FIX] note: do not set self in args of a super call
This silly mistake prevents to group notes by
something else than stages.

opw-633980
2015-04-28 11:18:07 +02:00
Goffin Simon 3c055a769f [FIX] account: Taxes report
The Tax Report printed with details should not include draft accounting entries.
Technicaly, the account move lines include in a draft account move do not have to be
printed

opw:633642
2015-04-27 16:25:43 +02:00
Denis Ledoux 09b277c008 [FIX] crm: fp mistakes during d6ae7fb7db.
`crm.meeting`
has been replaced by
`calendar.event`

`base_calendar.view_crm_meeting_search`
has been replaced by
`calendar.view_calendar_event_search`
2015-04-27 13:21:51 +02:00
Denis Ledoux 70d28a69b9 [FIX] crm: silly mistake during forward-port d6ae7fb7db
type="object" was already there, no need to set it twice.
2015-04-27 12:46:01 +02:00
Denis Ledoux d6ae7fb7db [MERGE] forward port of branch 7.0 up to 3e7d3c7 2015-04-27 12:19:43 +02:00
Denis Ledoux 3e7d3c7ee4 [FIX] account: tax_amount can be null in database
The `tax_amount` of move lines is by default set to `0.0`.
Nevertheless, this default value is set by Odoo,
not by postgresql.

This is therefore likely that the `tax_amount` is set as
null instead of 0.0, in database.

Therefore, when getting this value directly with a SQL
request, this is possible that `null` will be returned.

Therefore, in this specific case, `res.get(record.id, 0.0`
could return `False`, if the sum of `tax_amount` is `null`,
and try to multiply a boolean with an integer is not possible:
`_rec_get(rec) * rec.sign`

opw-633903
2015-04-27 12:01:21 +02:00
Thomas Rehn e8ffc09b30 [FIX] ir.ui.view (diagram): do not depend on semi-random order of _columns
The ir.ui.view.graph_get() method depended on the natural
semi-random order of Python dict keys in the _columns dict.

When the number and/or names of the _columns happened to
yield the o2m field of the "incoming transitions" *before*
the "outgoing transitions" of the "Node model"
(e.g. workflow activity), it would swap the incoming and
outgoing transitions fields around, causing a crash later
in the `tools.graph.process` method (currently an infinite
loop in the `tree_order()` method of tools.graph.py).

Closes #3614
Fixes https://bugs.launchpad.net/openobject-server/+bug/1316948
opw-633765
2015-04-24 13:50:26 +02:00
Martin Trigaux 641c25b2e6 [FIX] project: typo 2015-04-24 11:19:34 +02:00
Josse Colpaert 6dcccae568 [FIX] project: use selected unit of measure in gantt display
Hack to use working time unit in gantt view. Similar to 533399f for project.task
Fixes lp:1108913, opw 613979
2015-04-24 10:53:54 +02:00
Martin Trigaux 316be12a3c [FIX] purchase: mark order as invoiced when fully invoiced only
Make sure the purchase order is marked as invoiced only when fully invoiced.
If the invoices are generated on delivery order (invoice_method picking), make
sure all products are delivered before setting it as invoiced.
opw 614256
2015-04-24 10:46:42 +02:00
Nicolas Lempereur 81a3f56651 [FIX] stock,event,pos: fix "today" filter with regard to timezones
The previous filters didn't take timezones into account, and
returned stringified naive datetime values in local browser
time. Those would then be interpreted by the server-side as
UTC date, and depending on the current timezone offset vs UTC,
yield partially incorrect results.

By returning directly a datetime.datetime object instead of
a stringified version (see previous commit 76881fb),
we can get the expected result regarless of the timezone.

Fixes #2972
Closes #6229

opw-621282
2015-04-23 14:11:24 +02:00
Nicolas Lempereur 76881fb226 [FIX] web: backport datetime.toJSON() so we can return local datetimes in search domains
This fix adds the toJSON() method to datetime.datetime,
so domain expressions can use datetime values directly,
without having to compute the stringified version
with convoluted strftime() and timezone calculations.

The datetime results are sent down to the JSON-RPC
level where the JSON.stringify() serialization will
convert them to UTC string, to be deserialized
properly as UTC datetime values on the server side.

Thanks to this we can use the browser's local midnight
timestamp in a filter expression, for example like this:

`datetime.datetime.combine(context_today(), datetime.time(0,0,0))`

and get the expected result regardless of the user/browser's
timezone.

related to issue #2972 and pull request #2914 and #6229

(Next commit will fix them)

opw-621282
2015-04-23 14:05:56 +02:00
Martin Trigaux 5267e3a158 [FIX] portal: share with group wizard
Correctly creates menu and add implied groups.
Since the conversion from res.portal to res.group, we lost the field
parent_menu_id so a search is needed to find parent menu.
To add the access of existing users to the new groups, implied id rules are
needed. opw 612594
2015-04-23 13:53:08 +02:00
Martin Trigaux ab65c388cd [FIX] crm: list of meetings from opportunity
When opening the list of meetings from an opportunity, show only the meetings
linked to the current opportunity.
Use search_default_ to be able to remove the filter if not needed.
Remove context on meeting button as it's ignored in action_makeMeeting (and
there is no field attendee_id linked to a crm.lead anyway)
opw 614039
2015-04-23 10:00:01 +02:00
dhr-odoo cb5f00f580 [FIX] orm: ordering on >1000 records
When reading over IN_MAX (currently 1000) records, the select is slip into
subsets of IN_MAX records. However the list of ids was split using set() method
which removes order that may have been pass. The subsets are ordered using
_order attribute but the subsets were not ordered between themself.
This is an issue in case of browsing a o2m field with more than 1000 lines as it
will return sorted blocked but the order of the blocks is the order of the
contained ids (e.g. split(2, [5, 4, 3, 2, 1]) -> [[2,1], [4,3], [5]]).

Removes the set() to make sure the order of the given ids is preserved.
opw 616070, linked to #439
2015-04-22 12:14:33 +02:00
Rifakat Haradwala ecdaf89469 [FIX] membership: shown customer invoice form instead of supplier
When somebody buys a membership, he is a customer, opw 615986
2015-04-22 09:10:28 +02:00