Commit Graph
101834 Commits
Author SHA1 Message Date
Raphael Collet 1f559bf7a8 [IMP] ir_ui_view: make ormcache parameters more general
This makes methods use less cache, and invalidations are less frequently
necessary.
2016-04-28 16:47:33 +02:00
Raphael Collet 2550c26e29 [IMP] ir_translation: invalidate ormcache only when necessary
Specifically, do not invalidate the ormcache when modifying translations of
fields of models different from `ir.model.fields` and `ir.ui.view`.
2016-04-28 16:47:33 +02:00
Christophe Simonis 7b12757780 [MERGE] forward port of branch 9.0 up to 4f7d0da 2016-04-28 11:12:06 +02:00
David Monjoie 5b37e078c6 Merge branch 'saas-9' of github.com:odoo/odoo into saas-9 2016-04-28 10:32:54 +02:00
Yannick Tivisse 4f7d0da942 [FIX] crm: remove lead kanban view
Since the crm refactoring in V9, the stages doesn't make sense anymore on a lead,
as this step is only to validate an opportunity. We should remove this view as it
is confusing in this case : If I create a stage on the opportunity form view,
it appears also on the lead kanban view. Other side effects can also be encountered.
2016-04-28 10:24:30 +02:00
Goffin Simon 93aed40105 [FIX] sale: Invoicing several SO with same partner and different invoice address
When invoicing several SO with same partner and with different invoice address,
different invoices have to be created with each invoice address.

Used case:

-create a customer with two invoice addresses
-create a SO for this customer with the first address
-create a SO for this customer with the second address
-select the two SO in the SO tree view
-click on "Invoice Order"
-click on "Create and view invoices"

Results:

Before the fix: The two SO are merged in one invoice with the second
address.

After the fix: Two invoices are created, one for the first address and
one for the second address.

opw:675961
2016-04-28 09:15:16 +02:00
Nicolas Martinelli 6c9d92d783 [FIX] stock: missing picking_type_id field
The picking type is not defined on the stock move when a picking is
created manually. This can cause errors, for example in manufacturing: a
product sold in kit will not be replaced by its components.

opw-673741
2016-04-28 08:15:33 +02:00
Olivier Dony d6ec8f7bc3 [FIX] payment_ogone: transaction code for alias AFU
The Automated File Upload (AFU) Ogone API requires a transaction code to be set,
either:
 - ATR for automated transactions
 - MTR for maintenance operations

The default is ATR and is used for submitting transactions in batch.
However, the server-to-server mode of payment_ogone only uses the AFU
API to create new credit card aliases, and not to process transactions.

Using the ATR transaction code requires the ATR feature to be available
in the Ogone Merchant account - a paying option that is otherwise
unused. Using MTR as the transaction code is sufficient for adding
aliases, and the corresponding feature (MTR) is available at no cost
in most Ogone Merchant Accounts.

References:
 - Ogone Advanced Batch:
    https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/batch
 - Ogone Alias Management:
    https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/alias/bulk-alias-management-via-batch
2016-04-27 18:19:27 +02:00
Thibault Delavallée b362c7efd9 [FIX] stock: default_get waits for a field list
And not a 2-item dict that does not crash by chance. Hooray for python.
2016-04-27 18:13:38 +02:00
Yannick Tivisse 197a5cc8a8 [FIX] crm: take contact information on customer creation on opp
Conflicts:
	addons/crm/crm_lead_view.xml
2016-04-27 17:20:44 +02:00
Denis Ledoux 56d92213b8 [FIX] account: reconciled with forced amount_currency
This is possible to create bank statements
forcing the amount in the foreign currency,
along with the bank account currency, and therefore
to force the foreign currency rate.

In such a case, when reconciling the journal items,
the currency rate conversion must not be done
against the currency rates written in database,
in the rates records, at that date, but with
the rate that was forced in the bank statement.

opw-676048
2016-04-27 17:15:30 +02:00
qsm-odoo 324dbcde57 [FIX] web: editable list, up/down navigation on m2o
The current behavior was allowing going on the previous row if the
user is at the start of an editable element and on the next row if the
user is at the end of an editable element. The problem was, we did not
want this behavior when the editable element is a select or m2o (as
the up and down input should open the select/m2o dropdown instead).
2016-04-27 17:01:16 +02:00
Géry Debongnie 7922370f12 [FIX] mail: fix performance issue with large channels
When a user is subscribed to a channel with many messages,
the discuss initial rpc /mail/client_action can become very
slow (in production, the rpc took > 20s when subscribed to
the Community mailing list).  This is due to the query in
_get_message_unread, counting the number of unread messages.

This commit adds an index on the relation mail_channel_partner,
this allows postgres to perform only index lookups, and speeds
up the query by 2 order of magnitudes.
2016-04-27 17:00:20 +02:00
Nicolas Martinelli 7d25dd5618 [IMP] payment_adyen: support autogenerated HMAC SHA-256 key
From v4.1.0 of the documentation (2015-06-29), the HMAC SHA-1 key is
deprecated. Indeed, it should be considered as a legacy option to
guarantee compatibility with older skins.

The HMAC SHA-256 key should be used instead, and moreover, it seems that
any new skin created does not support SHA-1 at all, even if the option
is available.

The merchant signature code is inspired from the documentation example.

Source: https://docs.adyen.com/developers/hpp-manual

Fixes #9786
opw-676081
2016-04-27 11:29:51 +02:00
Denis Ledoux 4606250d91 [FIX] account: amount currency in journal items list view
In 8.0, the amount currency field was displayed
in the journal items list view
when choosing, thanks to the `quick add` widget,
a journal with a currency set.
Otherwise, if the journal had no currency set,
the column was not displayed.

It was done thanks to the key
"currency" passed in the context.

From 9.0, the `quick add` is no longer used,
and, due to that, the amount currency field
was no longer displayed in the journal items
list  view at all, despite if the journal
had a currency set or not.

In technical words, `currency` was
no longer passed in the context,
making the invisibility property
set with
`invisible="not context.get('currency',False)"`
useless.

As this widget is no longer used, there
is no other choice than either
always display the column, either never.

We choose to display it only if you have
the multi-currency group (as this is the case
in the journal item form view)

We also take the opportunity to move the column
next to the debit & credit column, this is more
meaningful.

opw-676059
2016-04-26 15:57:27 +02:00
Christophe Simonis 20757c927e [MERGE] forward port of branch 9.0 up to 7f9a973 2016-04-26 15:57:05 +02:00
Christophe Simonis 7f9a973f51 [MERGE] forward port of branch saas-6 up to f811fff 2016-04-26 15:43:08 +02:00
Christophe Simonis f811fffbbe [MERGE] forward port of branch 8.0 up to 7e51d98 2016-04-26 15:15:22 +02:00
Goffin Simon 64e822c825 [FIX] account_asset: asset_create
When creating assets from invoice lines, the system must check
that assets have not already been created for the related invoice.
If assets already exist then these assets have to be removed.

Used case:

- In the purchase journal, tick "allow canceling entries"
- On a supplier invoice line, set an asset category
- validate the invoice
- cancel the invoice
- set to draft
- validate the invoice

Before the fix: the asset is created twice.
After the fix: the asset is created once.

opw:674674

Note: This is a cherry-pick of commits 9d14230 and 58a5b5e
2016-04-26 15:12:55 +02:00
Martin Trigaux 842a8e6952 [IMP] doc: add guidelines warning
To prevent huge chunk of modifications for styling reasons (e.g. mass PEP8
commits)
2016-04-26 14:58:31 +02:00
Martin Trigaux eae045949d [IMP] doc: simpler coding: utf-8
According to PEP-263, the -*- is just a variant "using formats recognized by
popular editors".
2016-04-26 14:58:31 +02:00
Christophe Simonis 7e51d98553 [FIX] calendar: correct search on mail.message and ir.attachment
Handle the case of immutable (tuple) domain leafs.
2016-04-26 14:55:41 +02:00
Christophe Simonis 28e9256912 [MERGE] forward port of branch 9.0 up to 3108a49 2016-04-26 14:11:20 +02:00
Nicolas Martinelli 2dfedb5b67 [FIX] purchase: delete unnecessary PO line
In v8.0, when a procurement is cancelled and the quantity remaining on
the PO line is zero, the line is deleted. It was not the case anymore
after the Purchase refactoring.

opw-675493
2016-04-26 14:09:41 +02:00
Goffin Simon 571d97e62e [FIX] res: Creating a partner with an invoice contact
When creating a partner with company_type='person' and with an invoice
adress, the created partner must stay a person.
Now a partner which is not a comany can have an invoice address.
Fixes #11730

opw:675322
2016-04-26 14:06:51 +02:00
Goffin Simon 3108a49ab2 [FIX] crm_claim: access rights for portal user
The portal user is not allowed to read the crm.team model.

opw:673480
2016-04-26 12:50:51 +02:00
David Monjoie 02fd74a3fa [FIX] website_form: prevent users from crazy clicking
If the feedback of a form is too slow, people might be tempted to
click a second time, trigerring a second request. If, after that,
the result has not been received yet, the user might be tempted
to click a lot of time because he is angry at such slowness. This
behavior would trigger a record creation each time the user clicked
the submit button. This fix disables the button once it has been
clicked once, and re-enable it if the record could not be created,
which means that there was an error in the input and the user needs
to change the values and try again.

The button has been changed to a span to avoid the default browser
behavior to post the form when no function is bound on the send button.
2016-04-26 12:07:30 +02:00
Goffin Simon 58a5b5e453 [FIX] account_asset: Typo error 2016-04-26 11:30:55 +02:00
David Monjoie 6e3389ca73 [FIX] website_form: prevent users from crazy clicking
If the feedback of a form is too slow, people might be tempted to
click a second time, trigerring a second request. If, after that,
the result has not been received yet, the user might be tempted
to click a lot of time because he is angry at such slowness. This
behavior would trigger a record creation each time the user clicked
the submit button. This fix disables the button once it has been
clicked once, and re-enable it if the record could not be created,
which means that there was an error in the input and the user needs
to change the values and try again.

The button has been changed to a span to avoid the default browser
behavior to post the form when no function is bound on the send button.
2016-04-26 11:21:20 +02:00
Goffin Simon 9d14230d74 [FIX] account_asset: asset_create
When creating assets from invoice lines, the system must check
that assets have not already been created for the related invoice.
If assets already exist then these assets have to be removed.

Used case:

- In the purchase journal, tick "allow canceling entries"
- On a supplier invoice line, set an asset category
- validate the invoice
- cancel the invoice
- set to draft
- validate the invoice

Before the fix: the asset is created twice.
After the fix: the asset is created once.

opw:674674
2016-04-26 10:43:26 +02:00
Goffin Simon d812175390 [FIX] account_asset: asset_create
When creating assets from invoice lines, the system must check
that assets have not already been created for the related invoice.
If assets already exist then these assets have to be removed.

Used case:

- In the purchase journal, tick "allow canceling entries"
- On a supplier invoice line, set an asset category
- validate the invoice
- cancel the invoice
- set to draft
- validate the invoice

Before the fix: the asset is created twice.
After the fix: the asset is created once.

opw:674674
2016-04-26 10:39:27 +02:00
Nicolas Martinelli f5eae92f12 [FIX] website_sale: log if no pricelist
The pricelist field is not a mandatory field on the partner. A default
value is usually defined for any new partner created. However, if the
pricelist is manually removed from the partner, errors (tracebacks) will
occur in the eCommerce when no pricelist is found.

We cannot make the field mandatory, as it could potentially break the
workflow of some users which are not using eCommerce. Therefore, we
simply log an error message to help debugging.

opw-673453
2016-04-26 10:14:56 +02:00
Damien Bouvy a84342441d [FIX] hr_recruitment: no create on ir_attachment action
The "Resumes and Letters" action simply displays ir_attachments
linked to hr_applicant objects; but there is no default_res_model
in the context so no ir_attachment you create is actually
displayed in the kanban view.

Since the goal of this action is simply to display attachments
linked to applicants, it makes more sense to disable the create button
and to force people to upload resumes and cover letters through
the applicant record.
2016-04-26 09:54:27 +02:00
Damien Bouvy ccd7a15709 [FIX] base: fixes previous fix
In fix e248882, the previous elif statement prevented the
execution of the fix code. This fix fixes the fix.
2016-04-26 08:12:33 +02:00
Olivier Dony e1ed2c6ddc [FIX] mail: visibility rules for channel notifications
Avoid raising an access denied error for messages that
the user has indeed be notified about.

The issue arose when a message posted on a document inaccessible
to the user was notified to one of the channels the user
is subscribed to.

The access control logic on messages relies on 2 heuristics
to grant read access to a message:
 a. either the user was notified about the messages, by being
    a follower of the document, or a subscriber of a channel
    following the document (in that case the user can see the
    message but not the document)
 b. or the user has read access to the document on which the
    message is posted (in that case the user can see both
    the message and the document)

Case `a.` sometimes fail to match when a message got notified
to several channels including one the user was not subscribed
to. Depending on the order of the returned rows in the SQL
query, the "foreign" channels could shadow the channels of
the user, making `a.` a non-match.

If case `b.` did not match either, the user would have the
`read` access denied, even though the message was visible by
the `search()` method.

The fix explicitly makes case `a.` match if the user was
notified in *at least* one channel.
This was not done through a change of the SQL query ORDER,
for readability reasons.
2016-04-25 18:22:44 +02:00
Denis Ledoux dde1404cb9 [FIX] sale: Teams dashboard, sales to invoice count
From 9.0, a sales order to invoice is no longer a
sales order in the state `manual`, but with the
Invoice Status "to invoice".

Before this revision, the sales order to invoice
were simply not counted at all, and this
count always displayed 0.

opw-675919
2016-04-25 18:01:59 +02:00
Christophe Simonis da60ca91cc [MERGE] forward port of branch 9.0 up to e248882 2016-04-25 17:29:34 +02:00
Damien Bouvy e248882053 [FIX] base: fetch mimetype on ir.attachment for binary fields 2016-04-25 17:20:57 +02:00
Ludwik Trammer 61c808b774 [FIX] web: Allow for translation of a login error message
Closes #11815
2016-04-25 16:03:27 +02:00
Nicolas Martinelli e680f29560 [FIX] account, sale: modify invoice
When a user validates an invoice linked to a SO, he might want to modify
it afterwards thanks to the 'Modify' option in the refund wizard. This
will create a refund, reconcile and create a draft invoice.

The issue is that the draft invoice is not linked with the SO.

The fix is to link, in this specific case only, the draft invoice to the
SO. At the same time, we have to make sure to:
- unlink the first invoice (to prevent counting the quantity as invoiced
  in the SO)
- keep track of the first invoice/refund in the invoice list of the SO

opw-673446
2016-04-25 14:11:47 +02:00
Christophe Simonis 4d337f72ed [MERGE] forward port of branch 9.0 up to ac7beb3 2016-04-25 13:33:01 +02:00
Christophe Simonis ac7beb3d7b [FIX] test_new_api: adapt test to new x2many commands return by onchange 2016-04-25 13:08:03 +02:00
Christophe Simonis ac16454965 [MERGE] forward port of branch saas-6 up to ba34df1 2016-04-25 12:40:13 +02:00
Denis Ledoux dc1b8a5a51 [FIX] res_company: some information missed on company creation
On the `res.company` model, the fields
`name`, `phone`, `email`, `website`, `vat` are
related field on the `partner_id` of the company.

When creating a new company, the partner
associated to the company is created automatically,
it's handled in the overrided `create` method
of the model, but it forgots the values
`phone`, `email`, `website`, `vat` at the moment
the partner is being created.

opw-675526
2016-04-25 12:37:06 +02:00
Christophe Simonis ba34df1ead [MERGE] forward port of branch 8.0 up to 0410d11 2016-04-25 11:56:52 +02:00
Fahad Alqahtani fedfe85a58 [CLA] corporate signature for cloudland
Closes #11803
2016-04-25 11:40:53 +02:00
Aaron Bohy 47f27b8023 [FIX] web_kanban: column title hidden and config button
Use 'display: none' instead of 'visible: hidden' for the config button in
columns' header so that the columns' title can take full width if that button
is hidden.

Bonus: if the config dropdown is open, the button remains visible.
2016-04-25 11:28:00 +02:00
Adrien Dieudonne 68ba897ce9 [FIX] web_editor: fix svg issue
className should return a string but svg node returns an object
2016-04-25 10:34:18 +02:00
Nicolas Martinelli 9c5683dbfd [FIX] purchase: use purchase UoM
When a PO is created from a reordering rule, we should make sure to use
the purchase UoM of the product. Any PO line automatically created or
modified will be a PO line in the purchase UoM.

opw-673309
2016-04-25 08:46:24 +02:00
Nicolas Martinelli e6180e3543 [FIX] purchase: UoM for cancellation
When cancelling a procurement (e.g. from a SO), we need to make sure
that the quantity is in the UoM of the PO line.
2016-04-25 08:46:24 +02:00