Commit Graph

83022 Commits

Author SHA1 Message Date
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
Denis Ledoux c62a75a5f3 [FIX] report: line splitting compatible with reportlab > 3.0
While keeping the compatibility for reportlab 2.5.

Splitting the text node on line breaks '\n' leaded to orphans ending tags,
like '</font>', which is regarded by reportlab 3.0 as a paragraph,
and reportlab therefore surrounded these tags by <para> tags,
which leaded to not syntax correct html like
<para></font></para>

To test this patch:
 - While having reportlab > 3.0
 - Create a rml report containing (at least) '<font>\n</font>'
 - Then print the report. It must not crash (obviously)
2015-01-23 12:54:30 +01:00
Christophe Simonis c339fcc603 [MERGE] forward port of branch 7.0 up to d5c7234 2015-01-22 18:42:26 +01:00
Denis Ledoux d5c7234474 [FIX] point_of_sale: share is not a dependence of point_of_sale
This reverts commit d970cc40f8.

point_of_sale does not depends on share. This domain can therefore not be applied.
It works for new databases as the module share is auto installed.
But as soon as the module share is uninstalled, this domain will lead to a crash
There is no way to "solve" this issue, other than by a view customization
if the issue is critical for the customer.

I did not pay enough attention when I reviewed the PR.
2015-01-22 15:32:29 +01:00
Denis Ledoux c5775e56d3 [MERGE] forward port of branch 7.0 up to 25f5329 2015-01-22 14:43:06 +01:00
Denis Ledoux 25f5329deb [FIX] report: break lines and splitted words with reportlab > 3.0
From reportlab 3.0, empty plaintext paragraphs do not lead to a break line anymore.
Before release 3.0, paragraphs having tags but no plaintext leaded to a break line.
This patch aims to recover the behavior of reportlab releases < 3.0, as
<para><font color="white"> </font></para> is used in allmost all rml reports
The current patch is not considered as clean, but we did not find any better solution.
If someone find a parameter to pass to reportlab in order to bring back the old behavior of reportlab
he is welcome to provide the better patch.

Besides, in reportlab 3.0, splitlongwords has been introduced as parameter,
to allow to break long words. The default value is True.
This parameter seems to break the columns headers
(it splits the text within the column header)
We therefore take the choice to not activate it, as it was not present anyway in reportlab < 3.0

To test the good behavior of this patch:
While having reportlab < 3.0 (2.5 for instance), print a draft invoice
Then, upgrade to reportlab > 3.0 (3.1.8 for instance), print the same draft invoice.
The generated pdf must be (allmost) identical, in particular concerning spaces.
Specifically, the space between the partner address and his phone.
2015-01-22 14:23:38 +01:00
Martin Trigaux 9f8731ca27 [FIX] base: backport of 152c5c2 to 7.0
[IMP] base: safer locking at user login

When a users connects, a lock is taken on the res_user table to modify the last login date. If another running transaction uses a foreign key to res.users (e.g. write_uid column), postgres may detect the update as a concurrent update and rollback the transaction.
In pg 9.3, the lock_strength parameter 'NO KEY' allows a weaker lock which is less likely to break another transaction.
Fixes #552
2015-01-22 13:34:19 +01:00
Goffin Simon d970cc40f8 [FIX] point_of_sale: exclude share users from sale details wizard
opw-621749
2015-01-21 15:39:31 +01:00
Denis Ledoux 44b3faa428 [MERGE] forward port of branch 7.0 up to d7ddd0a 2015-01-21 12:02:45 +01:00
Denis Ledoux d7ddd0a093 [FIX] l10n_be_coda: match counterparty account number with iban format 2015-01-21 12:00:29 +01:00
Aaron Bohy a911265c12 [FIX] Packaging: RedHat: prompt overriden in docker
RPM packages did not pass the tests because the centos prompt changed
and thus did not match the regexp anymore. We now explicitely specify
the prompt in our Dockerfiles to prevent such issues.
2015-01-20 17:35:34 +01:00
Denis Ledoux dd72d1537f [MERGE] forward port of branch 7.0 up to fb4c822 2015-01-20 12:21:52 +01:00
Denis Ledoux fb4c822000 [FIX] account_asset: using attrs to hide method_* fields
In order to hide fields method_number and method_period to hide them according to the asset, fields_view_get method was overriden.
An issue was present: if a search view on model account.asset.asset was added, and did not contain these method_* fields, this overriden fields_view_get was applied, and tried to hide method_* fields, while they were not present in the search view, which leaded to a crash.

I could have solved this the easy way, to not apply the invisbility if the fields were not present in the view, or if the view was something else than form, but I prefered to solve this the cleanest way.
2015-01-20 12:17:45 +01:00
Christophe Simonis cdb48d39ba [MERGE] forward port of branch 7.0 up to 6c55a4b 2015-01-19 12:09:48 +01:00