Commit Graph

83235 Commits

Author SHA1 Message Date
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
Denis Ledoux dd9d8b0c84 [FIX] hr_timesheet_sheet: prevent new activity on confirmed sheets
Once a timesheet confirmed, the activity hours should not be modified,
for any reasons.

The constraint _check_sheet_state prevents to modify activities
for confirmed timesheets, but does not prevent the addition
of new activities within the current, but confirmed, timesheet.

opw-627415
fixes #5128
2015-02-09 12:13:17 +01:00
Denis Ledoux f92b2f8d4d [MERGE] forward port of branch 7.0 up to 0b7db55 2015-02-06 14:02:43 +01:00
Denis Ledoux 0b7db5583f [FIX] share: action params in url is action, not action_id
When sharing a record to a share user (for instance, the quotation),
the action in the url was set to "action_id=" instead of "action=",
therefore, the link sent just leaded to nowhere.
2015-02-06 12:59:07 +01:00
Denis Ledoux 8bee3bbfad [FIX] share: mail.notification is also transversal
mail.message and mail.notification are transversal: they should not received directly the access rights
2015-02-06 12:52:47 +01:00
Denis Ledoux 0c9b8cd7af [FIX] survey: write expects a list of integers for ids arg
This is related to rev. 972b02397a
The reason is the same than in the above related rev.
2015-02-06 09:46:46 +01:00
Denis Ledoux 972b02397a [FIX] survey: write expects a list of integers for ids arg
In saas-3, at rev. c7afc04be3
an assert has been introduced, asserting the record_id of the record class
is an integer.

Therefore, write operations using a string as id lead to a crash
if they trigger a workflow
2015-02-05 17:34:34 +01:00
Denis Ledoux 764be06f44 [FIX] stock: obvious distraction error of previous rev. 8ff7d299f5 2015-02-05 15:09:06 +01:00
Denis Ledoux 8ff7d299f5 [FIX] stock: picking, Set date of reception if not set by user previously
If the date_done field of the model stock.picking is already filled in
it means the user do wanted to have this date of reception date
instead of the moment when the user clicked the receive button.

opw-627219
2015-02-05 15:04:58 +01:00
David Monjoie d7f30de9ae [FIX] product: moved pricelist_item ACL from stock to product
Otherwise if we install sale without stock, we can create pricelist and pricelist versions, but not pricelist items.
Fix for issue 626985
2015-02-04 16:17:36 +01:00
Denis Ledoux 2a162d9be7 [FIX] web: widget date handling user timezone
When converting a datetime field to date, using the widget date,
the date time value was just cropped, removing the hours,
therefore ignoring the user time zone.

For instance, if the user was in UTC + 1, for a date time 02/02/2015 00:30:00,
applying the widget date on this datetime had as result 02/01/2015,
due to the fact the UTC value of the datetime field was 02/01/2015 23:30:00

fixes #4420
opw-621281
2015-02-04 14:33:01 +01:00
Christophe Simonis 9abcb0cf2b [MERGE] forward port of branch 7.0 up to 9769279 2015-02-03 18:39:16 +01:00
Frédéric van der Essen 9769279e96 Merge pull request 4770 into 7.0
- Add the same behaviour in pos_order form view as in sale_order form view; (domain of partner is restricted to customer = True);
2015-02-03 18:18:14 +01:00
Sylvain LE GAL 94b429394a [REF] remove useless quotes 2015-02-03 18:14:55 +01:00
Sylvain LE GAL bfdf3f8744 [FIX] 'point_of_sale' add customer domain on partner field of pos_order; 2015-02-03 18:14:55 +01:00
Christophe Simonis dce1b83785 [MERGE] forward port of branch 7.0 up to e999f4c 2015-02-03 15:53:01 +01:00
Denis Ledoux e999f4c100 [FIX] base_vat: vat check for EU TIN.
Foreign companies that trade with non-enterprises in the EU
may have a VATIN starting with "EU" instead of a country code.

See
 - http://en.wikipedia.org/wiki/VAT_identification_number
 - http://www.becompta.be/forums/tva/ndeg-tva-commencant-eu
 - http://www.bruynfico.be/index.php/7-droit-comptable/19-connexion-asp?idart=159

opw-621177
2015-02-02 16:47:07 +01:00
Denis Ledoux ba5c972c3e [MERGE] forward port of branch 7.0 up to 05c907b 2015-01-30 16:52:41 +01:00
Denis Ledoux 05c907b60b [FIX] res: currency, rates name_search
In currencies, advanced search with "equals" or "not equals" on rates
was not possible for something else than a date, in server format (crash).

This is because the name field of the model res.currency.rate is a date

This is now possible to search rates with just a float and the equal operators,
it returns currencies which are having at least one rate set to this float value

This is also possible to search rates with the equal operators with a date in
user (context) date format.
2015-01-30 15:04:20 +01:00
Denis Ledoux a804d9a70f [FIX] web: possibility to autocomplete 'No' for boolean fields
In the search bar.

Besides, if the label value of the selection field is set to False,
which is quite dummy but accepted
The autocomplete crashed.
2015-01-30 13:40:31 +01:00
Olivier Dony c9b690f6b6 [MERGE] Forward-port latest 7.0 bugfixes, up to 4c2706d685 2015-01-29 13:50:51 +01:00
Olivier Dony a4c3670f66 [FIX] web: load translations for login/db manager screens
This was broken by mistake at rev. d6c6f31231
partially undoing the introduction of this feature at
rev. 49c0ed6467 (probably due to the
confusing name of that manifest option)
2015-01-29 13:40:49 +01:00
Denis Ledoux 4c2706d685 [FIX] web: saveas_ajax, correct filename when data passed directly
In cases where data is directly given to the saveas_ajax controller,
the filename was not correctly set, as no read method was performed.
(The read call is useless as the data is already avaiable in such a case)
In such cases, the filename must be given in advance

opw-626707
2015-01-29 12:51:47 +01:00
Manuel Vázquez Acosta a4597fe34f [FIX] ir_mail_server: use local envelope sender rather than spoofing it
Acting as a mailing-list-like distribution system, the system used
to set the enveloper sender (aka bounce address) to the From header
of the message, effectively pretending to be the original sender.

In some cases the domain of the From header explicitly forbids
sending emails from external systems (e.g. with a hardfail SPF
record), so this could cause the email to be rejected by some
spam filters, depending on their policies.

The system will now use a local bounce address in the form:
  mail-catchall-alias@mail-catchall-domain
or, if no catchall is configured:
  postmaster-odoo@mail-catchall-domain
(as soon there is a mail.catchall.domain configured)
It will only fallback to using the From header when no
catchall domain is configured.

Fixes issue #3347.
Closes #3393.
2015-01-28 15:51:23 +01:00
Olivier Dony 7a0451d649 [FIX] safe_eval: no shadowing of PostgreSQL's exceptions
Letting PostgreSQL low-level exceptions bubble up
ensures that the mechanism for automatically
retrying transactions will work.
In case of transient errors such as deadlocks or
serialization errors, the transaction will be
transparently retried. Previously they were
transformed into ValueError and caused a permanent
failure immediately.

The fallback to ValueError is meant for invalid
expressions or expressions that use variables not
provided in the evaluation context. Other
exception types should be preserved (this is
further improved in Odoo 8)
2015-01-28 14:34:54 +01:00
Denis Ledoux b3f3dafcb9 [MERGE] forward port of branch 7.0 up to c62a75a 2015-01-23 13:27:13 +01:00