Commit Graph

83260 Commits

Author SHA1 Message Date
Christophe Simonis 4a3c4713e9 [MERGE] forward port of branch 7.0 up to 209ce6f 2015-03-09 11:24:32 +01:00
odoo-tac 209ce6f48c [FIX] Fixed a typo in project.py exception message 2015-03-06 17:11:57 +01:00
xmo-odoo d9c9ac72da [FIX] export: decode Field strings before comparisons
Allows exporting fields whose string is a non-ascii *byte*string (rather than unicode).

backport of 7286f4e424 fixing #773 to branch 7.0 by request of @flotho
2015-03-06 13:12:50 +01:00
Goffin Simon 6c9afff057 [FIX] account_payment: amount in payment order is not correct.
Amount in payment order is not correct if the account move
line has already been paid by another way. The right amount is
in the residual field related with move_id to the account invoice.

opw:628903, 628428
2015-03-05 15:37:20 +01:00
Denis Ledoux c9a72b79e4 [FIX] web: size of text fields textarea when invisible by default
Text fields, or char fields having widget="text",
were not sized correctly when the field was not
visible by default, ans was set visible thanks
to attrs and other fields values.

opw-629394
2015-03-04 17:56:05 +01:00
Goffin Simon ab9f02cdee [FIX] account_followup: overdue payments must exclude payments not yet due.
Before this revision, the overdue payments report contained all payments due,
including the ones in the future, that are not actually due yet.

opw-628874
2015-03-04 17:12:23 +01:00
Laetitia Gangloff f18304c0cd [IMP] account: Add auto_join on account move line
As the number of journal entries can grow quickly, domains such as
[('move_id.state', 'in', ['draft'])] will degrade very quickly.
Fixes #5573
2015-03-04 14:55:17 +01:00
jbeficent a81a7513b2 [FIX] purchase: prevent user to confirm a purchase order when there is a service product in it and invoicing is based on incoming shipments
Fix for issue 3492 and opw 628377
2015-03-04 11:37:54 +01:00
Stefan Rijnhart 4781deb5b6 [FIX] base: Replace unreliable reference count through ORM by SQL
When the ORM is cleaning up related attachments upon record deletion, the
search() method hides the attachment of the record that is being deleted.
If the same file is used exactly once in another attachment, the reference
count will be 1 and the file will be deleted.
2015-03-04 11:23:44 +01:00
Romain Deheele 56f3f01491 [FIX] crm: retrieve title and function of partner in leads
When setting a partner on the lead,
the on_change_partner method retrieves
the various partner field values.

title & function fields were omitted, without obvious reasons

opw-629374
Closes #5388
2015-03-03 17:59:46 +01:00
Denis Ledoux 1628050030 [FIX] board: board creation of users other than admin.
It wasn't possible to create a new dashboard,
as a user other than SUPERUSER_ID,
using the "Create board" menu specifically
Reporting > Configuration > Create Board
(Technical Features & Administration > Settings groups required)
Because it creates a new menu for this dashboard,
which lead to the automatic creation of an "ir.values" record
which is prevented for other users than SUPERUSER_ID

opw-629367
2015-03-03 17:10:04 +01:00
Olivier LAURENT 31194a59fb [FIX] analytic: parent of contract form view
unhide the parent_id field in the form view of analytic accounts of type
"contract or project"
Fixes #5513, lp:1237512, opw 598926
2015-03-03 11:50:54 +01:00
Laetitia Gangloff eda2736e4c [FIX] account: journal_id should be readonly when there is already invoice internal number
Closes #5162, #5167
2015-03-01 03:23:01 +01:00
Holger Brunn 323233dd02 [FIX] ir_filters: return _auto_init's result
Closes #5204
2015-03-01 03:06:03 +01:00
Denis Ledoux 3bf1615ad4 [FIX] hr_timesheet: worked hours summary when sign in without sign out
In a timesheet, when a sign in is added, and a sign out
is not following, the current time is took as sign out value.

Rev. dbb2a669f4 corrected an issue
regarding the worked hours summary not taking into account
the employee timezone.
This timezone has to be applied on the current_time also.

e.g: For an employee being in timezone UTC + 1
If the current_time is presently 12:00 (UTC+1)
If the employee set his sign in to 10:00
and do not entered a sign out
The hours summary table displayed 1:00 of worked hours,
based on computation (11:00 - 10:00)
11:00 being 12:00 but in timezone UTC

Besides, another issue was present when entering
a sign in at midnight exactly without a sign out:
If the employee set his sign in to 00:00:00
and do not set a sign out, worked hours displayed 0 worked hours
whatever the current time.

Fixes #5379
Closes #5378
Closes #5503
2015-02-27 12:04:49 +01:00
Martin Trigaux e2fa66b05d [FIX] web: avoid incoherent actual_mode after refresh
When accessing an existing record in form mode directly (enter the url or refresh a page), the daterecord has not been initialized yet. This means that the value of actual_mode will be set to 'edit' before loading the current record (method _actualize_mode() called from do_show()).
This was problematic for one2many fields that we loaded in edit mode, showing add/delete icons/buttons in readonly views. (opw 607910)

Backport of 7ec7f1ba40 for 7.0 and saas<6. (opw 627885)
2015-02-26 13:55:48 +01:00
Aaron Bohy e73a3c6898 [FIX] Web: view_list.js: pager next and previous actions
When the number of records n and the limit l were such that n%l = 0
(e.g. 16 records total, 8 displayed per page), clicking on the
previous button on the first page, or on the next button on the
last page produced a bug because the total number of pages
computed for this edge case was incorrect.
2015-02-25 14:35:19 +01:00
Lionel Sausin (Numérigraphe) 5be3ac1fd0 [FIX] sale_stock: use current product's UoM to check availability
When selecting a product in a sale.order, the asked quantity is verified against
the available quantity.
If the user changes the UoM or the onchange from super call changes it,
the context should be updated accordingly.
Fixes #2559
2015-02-25 18:32:26 +05:30
Frédéric van der Essen 717e4106ad [FIX] product: backport of 0059d7b, avoid rounding 0 for kg
The precision 'Product Unit of Measure' was defined after the declaration of kg.
Since fc85a7ee, the precision of kg is set in data to 0.001.
As the Product Unit of Measure was not defined yet, the rounding was stripped to
(16,2) precision, so getting a rounding of 0.0 for the kg unit of measure.

[FIX] product: the declaration of decimal precision was done after
the declaration of uom precision, preventing uom precision from going above
the default decimal precision. + made the Kg unit precise up to grams by default.
2015-02-23 16:46:46 +05:30
Denis Ledoux 56c73bf6f3 [MERGE] forward port of branch 7.0 up to 0bbd835 2015-02-23 11:47:25 +01:00
Denis Ledoux 0bbd8351f1 [FIX] web: on_item_action_clicked, self.dataset is not always defined.
27a48f8026 introduced the use of self.dataset
It appears it is not always defined.
Few lines above, self.getParent().dataset is used,
and looks to be always defined.
We therefore now use this dataset in order to get the context,
to correctly pass the current session language.

Closes #5416
2015-02-23 11:44:48 +01:00
Christophe Simonis 4433825dbb [MERGE] forward port of branch 7.0 up to 4305aad
Yes, this commit is empty. This is not an error.
2015-02-20 17:06:37 +01:00
Nicolas Martinelli 4305aad02f [IMP] Packaging: version number in docker image name 2015-02-20 16:40:37 +01:00
Denis Ledoux aae75f1e29 [FIX] hr_expense: deprecated use of LocalService()
Introduced in a test, during the forward port 7613d5d499
2015-02-20 16:19:44 +01:00
Denis Ledoux 7613d5d499 [MERGE] forward port of branch 7.0 up to 27a48f8 2015-02-20 15:57:51 +01:00
Denis Ledoux 27a48f8026 [FIX] web: action translation (menuitems & more menu)
This rev. reverts partially 1d76586a1b
This rev. is related to #3462

Regarding addons/web/controllers/main.py
---
name of model ir.actions.actions is not translated
it's the name of server actions, client actions and window actions
that are translated.
Meaning the name of the ir.actions.actions will always be in English,
even when passing the user language within the context.

Regarding addons/web/static/src/js/views.js
---
There is no reason to pass the field values within the context
of the /web/action/load call: The read methods of actions are
not overidden to use the field values. Besides, it pollutes
the context of the action, leading to unwanted behavior, such
as the translation of the action name within the lang available in the
fields of the form view (e.g. the partner form).

Initially, the field values added in the context has been added
within the rev. 542928adde
Indeed, sidebar_context (or sidebar_eval_context nowadays), contains
the field values, and the additional_context passed to /web/action/load
is an extension of this sidebar_context.
We are not sure the reasons why the sidebar_context was passed to the
/web/action/load, but we believe it was to pass the session/user context
containing the lang, timezone, and so on, not to pass the fields values.
2015-02-20 15:36:47 +01:00
Somesh Khare 7f5bc3fdf0 [Fix] hr_expense: correct amount for included tax with negative sign
Setting an expense with a tax included with a negative base code sign was
getting the wrong amount (tax line as a credit instead of debit). So leading to
a total for the accounting entry superior of the total of the expense (should
not happend as the tax is included).
Add test to verify this scenario.
Fixes #4260, opw 618531
2015-02-20 11:10:32 +05:30
Denis Ledoux fc6ac83608 [FIX] mail: hide delete button when uploading attachment
This is not possible to interrupt the uploading of an attachment.
We therefore hide the 'delete' button during the upload
2015-02-17 15:36:03 +01:00
Denis Ledoux 4c7e078478 [MERGE] forward port of branch 7.0 up to 772b213 2015-02-17 10:59:25 +01:00
Anthony Muschang 772b213e69 [FIX] hr_timesheet_sheet: hide button "Add a Line" if readonly sheet
The 'Add a line' button should be hidden when the sheet is readonly.
For instance, for a submitted employee sheet.

closes #4297
opw-628160
2015-02-17 10:56:14 +01:00
Denis Ledoux 550910a8f6 [MERGE] forward port of branch 7.0 up to a87d60f 2015-02-16 18:26:45 +01:00
Denis Ledoux a87d60f70f [FIX] warning: no notes parameter in onchange_product_id
This is related to rev. 4606b4535a
2015-02-16 15:07:21 +01:00
Denis Ledoux 30d3f9605f [FIX] purchase: order line description being reset on qty change
Also set name as False for product_id field in the purchase order line form (popup)
This rev. is related to 11bd7a6774
2015-02-16 15:04:22 +01:00
Denis Ledoux 4606b4535a [FIX] warning: onchange_product method signature
Module 'Warning' overwrites onchange_product_id method of purchase.order.line

The signature in the warning module had 'notes', while there isn't any 'notes'
parameter in the original method, in the purchase module.

The super call was also wrong, ignoring the optional fields, which
were therefore always set to the default value
2015-02-16 15:01:12 +01:00
Denis Ledoux 11bd7a6774 [FIX] purchase: order line description being reset on qty change
The name must be changed when changing of product,
but not for other changes, quantity for instance.
The 'or not uom_id' is just for retro-compatibility concerns
uom_id being False actually means we just changed of product,
and the name must therefore be changed
name as been set as False in the onchange call in the view
for the product_id field, in this rev.,
so the name being False now means th change of product
Nevertheless, existing databases for which the view
is not up to date won't have this change
and we therefore have to rely on something else to know
when the product has been changed or not.

fixes #5295
opw-628138
2015-02-16 14:22:15 +01:00
Denis Ledoux 3fed8ca58d [FIX] base: Address must stay readonly when field use_parent_address is checked
When you change the country of your company, each field of a company address keeps
its attrs. This is why the company address stays on readonly when use_parent_address
is checked.

Closes #4808
opw: 627033
2015-02-13 16:01:07 +01:00
Géry Debongnie 4e2025719b [FIX] web: viewlist editable use correct record_id in dataset
When clicking on an element in a listview editable, the record_id
is not updated in the dataset, which means that when you switch to form
view, the list view does not display the last selected record.

Also, it should fix the issue solved by PR pull/2725
2015-02-13 10:01:42 +01:00
Christophe Combelles 34d4508535 [FIX] hr_payroll: nicer error message for some bad rule definitions
For example avoids a crash with:

    TypeError: can't multiply sequence by non-int of type 'float'

when setting the quantity field of a salary rule to `1,0`
instead of `1.0`.

Fixes #5154
Closes #5155
2015-02-12 12:23:02 +01:00
Denis Ledoux fe8845ade6 [MERGE] forward port of branch 7.0 up to 0b5271e9 2015-02-12 11:04:36 +01:00
Denis Ledoux 0b5271e90d [FIX] account: always use a copy when altering a context
To avoid wrong context propagation
2015-02-12 11:03:54 +01:00
Christophe Simonis d73eeab5ba [MERGE] forward port of branch 7.0 up to 9fe040e 2015-02-11 16:39:11 +01:00
Denis Ledoux 9fe040e592 [FIX] account: invoice analysis residual amount
When having an invoice with multiple lines having the same
product_id and account_id, the residual amount was wrong.

This is due to the fact the residual amount of each line
was computed on the residual amount of the invoice divided
by the number of lines of the invoice, and the fact the main
select of the sql view was grouped by product_id, account_id.

So, for an invoice defined as
Product Account Total
A       1       10
A       1       10
B       1       10

The invoice analysis, grouped by product, account, computed
Product Account Total   Residual
A       1       20      10
B       1       10      10

The residual amount '10' of the first line being
30 (the residual amount of the invoice)
divided by 3 (the number of lines in the invoice)

The residual amount of the invoice should actually be divided by
the number of lines in the invoice * the count
of occurences in the group by clause
So, in this case, (30 / 3) * 2 = 20

Replacing the big jointure by
SELECT count(*) FROM account_invoice_line l where invoice_id = ai.id
to get the number of lines in the invoice
is just an optimization for performances

opw-621672
2015-02-11 13:10:54 +01:00
Géry Debongnie 2d524c947c [FIX] web: editable lists and read only fields bug
when the user press tab in editable list views, the focus is supposed to
go to the next cell unless it is at the last cell of the line.  in that
case, it is supposed to create a new record.

Sadly, when the last cell is readonly, this does not work.  This commit
make sure that read only fields are properly ignored when computing the
last_field state.
2015-02-11 12:46:13 +01:00
Denis Ledoux 48f527b860 [MERGE] forward port of branch 7.0 up to 368c674 2015-02-10 15:31:51 +01:00
Julien Laloux 368c674a9b [FIX] account_followup: formatted user language date in followup text
When using %(date)s in the follow-up text in the follow-up levels configuration
the date was formatted within server date format
instead of the partner language date format.

Closes https://github.com/odoo/odoo/pull/5168
2015-02-10 15:26:57 +01:00
Denis Ledoux c718661ba8 [FIX] hr_timesheet_sheet: default product in analytic lines
The module analytic_user_function allows to define a specific product
to use, when creating timesheet activities for a specific employee
with a specific contract

Nevertheless, the product was not set accordingly to this feature
for the first timesheet activity, because,
when initilialing the timesheet line,
the on_change_account_id, which returns
the product to use according to the user and contract, was called
without passing the user.

Besides, by default, on_change_account_id does not have a user_id parameter,
this parameter is added by the module analytic_user_function, overriding
this onchange, and adding a new user_id parameter (which is not a good pratice).

We therefore use multi_on_change_account_id, which allow to pass the user_id,
within the context
2015-02-10 11:54:55 +01:00
Denis Ledoux a8fdc60b88 [MERGE] forward port of branch 7.0 up to 1d76586 2015-02-09 17:57:39 +01:00
Denis Ledoux 1d76586a1b [FIX] web: context lang & active* in action buttons
This reverts rev. 9f9e7ef0e1

As explained in 9f9e7ef0e1,
if a field "lang" is present in the view, clicking in any action item
in the more menu leaded for the action title to be translated
in the lang value of the form, such as in the partner form.

9f9e7ef0e1 fixed the issue,
but has as side-effect to not update correctly the active* keys.
So, if "active_id" was used in the context of the action button,
and the active_id was set in the dataset context, for example
because you come from another form, trough another action button
(For instance, Customers > Opportunities > Logged Calls),
the active_id was not updated with the current id of the record.

opw-620293
opw-617321
fixes #3462
2015-02-09 17:53:11 +01:00
Julien Legros 318f254761 [IMP] fetchmail: process pop messages in subsets
Most pop servers don't perform deletions until QUIT. If for some reason
the process is killed while fetching a large quantity of messages, the
quit method isn't invoked, while the commit method has been. We may thus
end up with duplicated messages the next time we try to fetch. It therefore
helps to fetch the messages in small subsets and call the quit method between
those subsets.
2015-02-09 13:21:06 +01:00
Denis Ledoux 9003537222 [MERGE] forward port of branch 7.0 up to dd9d8b0 2015-02-09 12:14:09 +01:00