Commit Graph
110224 Commits
Author SHA1 Message Date
Thibault Delavallée dd0533897e [FIX] sale_payment: move method in right module
Commit 8911be11d1 moved code from website_portal_sale to
a new sale_payment module, in order to move code down and ease its use in
variou addons. However a called method was forgotten in the process leading
to some issues when using sale_payment. This commit fixes that.
2017-06-08 11:22:02 +02:00
Parth Patel 1afe6dc725 [IMP] Sale: remove sequence field on pricelist item
PURPOSE
=======

It's confusing as it's not used. We had a customer with two exact same rules; he complained to the
support today because Odoo decided to use the other rule. (he was confused because he thought
priorities were based on sequences as there is a sequence field that allow drag & drop)

Order is based on "applied_on, min_quantity desc, categ_id desc", not on sequences. (since v9
and it's better that way; but we forgot to remove the sequence field)

SPECIFICATION
=============

Remove field
2017-06-07 15:14:24 +02:00
Jeremy Kersten 1af6a5bc26 [IMP] website_project_issue: display issue_id as string and not as int
That will avoid to have thousand separator.

Task-33646
2017-06-07 11:28:36 +02:00
Christophe Simonis 99c34c4119 [MERGE] forward port branch saas-16 up to 6f3eada2c3 2017-06-06 19:38:29 +02:00
Christophe Simonis 6f3eada2c3 [MERGE] forward port branch saas-15 up to f687a27b79 2017-06-06 19:23:03 +02:00
Christophe Simonis f687a27b79 [MERGE] forward port branch saas-14 up to c0e7f9b0b1 2017-06-06 18:57:56 +02:00
Christophe Simonis c0e7f9b0b1 [MERGE] forward port branch 10.0 up to a85790be5c 2017-06-06 18:49:36 +02:00
Richard Mathot a85790be5c [FIX] stock_landed_cost: disable test with an invalid CoA
For now, these tests do not work with another CoA than the generic one.
Depending on your testing infrastructure, they may or may not pass.
We skip then invalid CoA's and plan to make them work in master.
2017-06-06 18:28:45 +02:00
Jérome Maes 7095cb5af5 [FIX] sale_timesheet: avoid currency rate based on demo data
On the 6 June, the rate from EUR to USD change
in demo data. This cause problem in test, when
comparing amount.

We choose to not used currency rate defined in
demo data and that are time-dependent.
2017-06-06 17:47:40 +02:00
stefanorigano 3ac160aa09 [IMP] website: company logo sizing
Rather than use a fixed height, make the logo fill the navbar height.
2017-06-06 17:37:33 +02:00
Christophe Simonis 460cb3ba9e [MERGE] forward port branch saas-11 up to 7d7a45a921 2017-06-06 17:28:59 +02:00
stefanorigano c705169b20 [IMP] base: replace default "no logo" image 2017-06-06 17:11:00 +02:00
Christophe Simonis 78d4202503 [FIX] tools.config: do not interpolate the config. 2017-06-06 16:55:13 +02:00
Olivier Dony e2e23142e9 [FIX] base_import_module: make low-level method private
The import_module() method does not need to be public,
so let's mark it private. It's not called by anyone
except import_zipfile().

After 76cd8d2558 it would
fail anyway because addons_path would not be prepared by
import_zipfile().
2017-06-06 16:32:37 +02:00
Christophe Matthieu 1b07daf2ed [FIX] calendar: can create an event with start_date as readonly
Before this fix, if the start field is readonly, the user could not create
an event. With this commit, it is also ensured that the context sends the
right default values to the view
2017-06-06 16:17:30 +02:00
Martin Trigaux ebc23b594a [FIX] web: display full error message
In case of a MemoryError, there is no error message, the user gets a
"Database restore error: "

without any details.

Instead fallback to the repr.

This way, a wrong password is
"Database restore error: Access denied"
and a memoryerror

"Database restore error: MemoryError()"

Closes #17393
2017-06-06 15:42:37 +02:00
Christophe Simonis 7d7a45a921 [MERGE] forward port branch 9.0 up to fffcfcc519 2017-06-06 15:18:52 +02:00
Christophe Simonis fffcfcc519 [MERGE] forward port branch saas-6 up to 8958bfe557 2017-06-06 13:40:34 +02:00
Denis Ledoux b43151c11c [FIX] product: pricelist item deterministic order
On a pricelist, if multiple rules were set with the same
set of rules condition, the choice of which rule/item
is used was random, according to the postgres database
state.

Adding the `id` in the order force to always use the same
rule/item (the first that was created).

opw-744865
2017-06-06 12:55:29 +02:00
Raphael Collet 1095744e7f [FIX] base_vat: invoke method on record as expected
OPW 744859
2017-06-06 12:22:01 +02:00
pka-odoo ab0bd7be25 [FIX] (hr_)gamification,sales_team: one2many with many2many widget
with the new views, we removed the many2many_kanban widget on many2manys, since it is the default behaviour anyway, but we also removed it for a few one2manys.  And this is a mistake, some one2manys have to behave like many2manys.

(PR #17190)
2017-06-06 11:33:31 +02:00
Thibault Delavallée 6e3392b341 [MERGE] payment, website_(portal_sale/quote): separate payment and account code from portal_sale/quote
This commit separate code from website_portal_sale, website_sale and
website_quote in order to extract common code, separate payment code
from sale model and controller code and ease reusing of payment code
in various addons.

Main features are

 * move account-related code from website_portal_sale to a new
   website_account module
 * move payment related to sale in a new sale_payment module
 * factorize JS code to handle payment through form and tokens
 * use generic sale payment code in website_sale and website_quote

Refer to individual commits for more details on the branch content.
This commit Closes #16956.
2017-06-06 11:11:29 +02:00
Thibault Delavallée faa9ace977 [REF] website_payment: remove website published mixin on payment acquirer
Indeed payment module already adds a website_published button to ease
acquirer management directly in payment without link to website. The
mixin added in website_payment adds a website_url field that has no use
for payment acquirers and is not used at all in the current codebase.
As there is no website url the website publish button method is not
different than the one already implemented in payment. There is
therefore no need for this override, lessening model code in
website payment.
2017-06-06 11:05:33 +02:00
Thibault Delavallée ef2d828463 [REF] website_quote: use new sale_payment module
Online quote now uses JS code from payment module in order to make online
payments. Front-end template is updated to use o_payment_acquirer_button
generic class for payments and data is added to be managed by payment.js.
This allows to remove some strange code parsing the url to find the order
ID and token instead of using rendered values.

A payment controller is removed because it was only a shortcut to another
one. In transaction controller token parameter is renamed to access_token
to avoid confusion with payment token and match the payment and website
sale naming.

Online Quote controller now uses tools method from sale_payment module
like website_sale. This way it is now standardized and moved out of
controllers that should not perform so much model-level computation.
2017-06-06 11:05:25 +02:00
Thibault Delavallée 8564f1e8a1 [REF] website_sale: use new sale_payment module
Previous commit added tools method related to sale transactions and
token management. This commit makes website_sale use them.
2017-06-06 11:04:35 +02:00
Thibault Delavallée 40cf03e4a0 [IMP] sale_payment: add tools methods for sales and payments
This commit adds tools method in sale_payment related to sale order
confirmation, token and transaction management. Purpose is to be able
to use them in frontend sale module like eCommerce and Online Quote and
have it standardized at model-level instead of done custom in controllers.
2017-06-06 11:04:34 +02:00
Thibault Delavallée dee9b5cf3c [REF] payment, website_sale: make payment_transaction js code generic
JS code managing transaction creation through acquirer 'Pay Now' form
button is improved in order to be less website-sale dependant. It now
takes parameters for access token and URL to call in Json. Class used
to bind JS is now o_payment_acquirer_button in order to be more generic.

eCommerce module is updated accordingly. Future commits will probably
make Online Quote (website_quote) use it.
2017-06-06 11:04:34 +02:00
Thibault Delavallée 8e733b22f8 [REF] sale_payment: clean code related to so confirmation and invoice generation
Indeed this code is difficult to understand and uses unnecessary
variables. Both confirm_so and generate_and_pay_invoice methods now work
on payment.transaction records as they belong to that model. Finally
less code is put in the try/except of confirm_so to avoid hiding real
errors and issues.

One interesting thing would be to correctly manage so confirmation errors
and mail sending errors. This is currently not done and will maybe be
done in future commits.
2017-06-06 11:04:34 +02:00
Thibault Delavallée b5146643b5 [REF] website_(quote/sale), sale: move access_token in sale
Access token field is moved directly in sale module. Indeed future commits
will improve customer portal and access tokens will be used in other module
than website_quote. This commit already moves the field.

Moreover some strange code in website_sale already uses access_token even
if it does not exist in that module. Moving the field solves that issue.
Finally so_token defined in stripe is renamed to access_token to have the
same naming through all addons.
2017-06-06 11:04:29 +02:00
Nicolas Martinelli 75c803bbbd [FIX] account: create taxes at reconciliation
- Create an excluded tax of 20 %
- Create a customer invoice of 1000
- Create a payment of 900
- Make the matching between the invoice and the payment:
  Write-off of 83.33, with the 20 % tax

Error: 'Cannot create unbalanced journal entry'

After commit 89cbef8540, the tax are by default not created
automatically anymore. We should make sure to pass the context key
`apply_taxes`.

opw-744266
2017-06-06 10:49:28 +02:00
Denis Ledoux 175a5d7808 [FIX] sale: sales order email template without portal_sale
When disabling the customer portal
in the general settings
(or uninstalling the `portal_sale` module directly),
the model `sale.order` no longer has a method
`get_signup_url`, and it therefore leads
to the fail of the email template rendering which is
still referencing this method.

Besides, the `access_url` is actually used only if
`is_online` is True,
(see the `% if is_online:` few lines later)
and in this case `get_signup_url`
was not used at all.

Therefore, we can assume `None` is a good alternative,
as the resul of `get_signup_url` was actually no longer
used.

opw-710481
2017-06-06 10:30:18 +02:00
Denis Ledoux fef6694442 [FIX] product_margin: division by zero in case sum of quantities is 0
If you have two invoices with a same product,
 - one having 1 unit of a product,
 - the other -1 unit of a product,

The sum of these quantities will be 0, and it will lead
to a division by zero in the former sql request.

The nullif should be applied on the sum, not on the line quantity.

opw-745073
2017-06-06 10:18:33 +02:00
Damien Bouvy 18910e926f [FIX] website_portal_sale: let errors bubble when confirming a quote
This try except block was added in another era, where the piece of code
in the block was far less ambitious (and not for good reason since
adding a try except block because of a malformed mail template seems
overkill).

Even worse, this block actually prevented errors from bubbling, which
could have adverse effects.

Example: a long transaction confirmation (several seconds since it
implies S2S communication, invoice creating/validation, etc.) is
rollbacked because a mail message is recorded on the quote during
the processing time. The quote confirmation then crashes because of a
concurrent update error in postgres. This try except block does not
re-raise the error, which means that instead of retrying the operation
like the ORM would normally do, we have an incomplete traceback in the
system (since the error message crashes itself) and the transaction is
not validated (as far fetched as it may seem, this is in fact how this
bug was discovered).

This try-except block offers no gain in error logging (on the contrary,
since we have lost the initial error-causing statement) and prevent the
orm from correctly managing errors.

This commit removes it and let the orm handle the errors like a grown up
man; either crash for real (because it should crash to know if there's a
problem) or retry the transaction if it's a serialization issue.

opw-744629
2017-06-06 10:03:34 +02:00
Odoo Translation Bot 9ca236685d [I18N] Update translation terms from Transifex 2017-06-04 07:07:18 +02:00
Odoo Translation Bot 40f8a92d88 [I18N] Update translation terms from Transifex 2017-06-04 04:27:19 +02:00
Odoo Translation Bot c3e282852d [I18N] Update translation terms from Transifex 2017-06-04 00:28:17 +02:00
Olivier Dony 45336d7486 [FIX] tools: verify path before opening 2017-06-03 01:30:57 +02:00
Olivier Dony de38d0262b [MERGE] Forward-port 10.0 up to 76cd8d2558 2017-06-03 01:24:21 +02:00
Olivier Dony 711530e036 [MERGE] Forward-port 9.0 up to 98f5f1b888 2017-06-03 01:16:50 +02:00
Olivier Dony 8958bfe557 [MERGE] Forward-port 8.0 up to d18d606a55 2017-06-03 01:08:20 +02:00
Olivier Dony d18d606a55 [FIX] tools: verify path before opening 2017-06-02 22:29:47 +02:00
Olivier Dony 98f5f1b888 [FIX] tools: verify path before opening 2017-06-02 22:28:39 +02:00
Olivier Dony 76cd8d2558 [FIX] tools: verify path before opening 2017-06-02 22:13:36 +02:00
Thibault Delavallée 8911be11d1 [MOV][ADD] sale_payment: bridge module between sales and payment
Move sale and payment bridge code into its own module. This commit mainly
moves (and reorganizes without changes) code from website_sale related
to payment and SO confirmation.

Only change is that payment_acquirer_id field on sale order is now a
related on transaction.acquirer_id . Indeed in website_sale and
website_quote both values were written but only managing transactions
and getting its acquirer is more efficient and ensure values are coherent.

JS part controlling payment form management is moved directly into
payment to reuse later on in future commits. Probably.
2017-06-02 17:30:28 +02:00
Thibault Delavallée 5a86365439 [MOV][ADD] website_account: move account code out of website_portal_sale
Purpose: separate and locate website code for main addons in their
correct module. This commit targets accounting related customer portal.

This commit adds a new bridge module between website and account. It
contains code related to website portal of invoices. It was located
in website_portal_sale but this one should only be the quotation and
sales portal.

A dependency from website_sale to website_account is added to ensure the
behavior and available features of eCommerce are not impacted by this
commit.

No code modification is performed in this commit except one unnecessary
less rule. It contains only code move.
2017-06-02 17:28:52 +02:00
Florent de Labarre 9675c0fcfb [FIX] hr_holidays: fix gray color on saturday/sunday not working with other language than English
Instead of checking that the day short name is effectively Sat or Sun
it now checks that it is the saturday or sunday based on weekday. It is
located in a method to ease inheritance or implementation of specific
behavior based on some calendar if necessary.

Closes #17294 .
2017-06-02 17:19:57 +02:00
Дмитро Катюха 380f59bd16 [FIX] website_sale: filter products by attributes
The attribute filters based on all products matching current domain was limited
to the first page of result only.
If all the products of the current page had no variant, no filter was displayed.

Closes #17361
2017-06-02 16:59:36 +02:00
Yannick Tivisse 54e469c41d [MERGE] payment,website_sale: Ease payment setup & flow of ecommerce
Purpose
=======

Ease payment setup & flow of ecommerce

- In Odoo, we have 3 ways to sell:
    - sales -> invoice is needed when you issue quotations
    - eCommerce -> invoice is mostly for B2B but is part of the flow in any case
    - PoS -> invoice is mostly for B2B. It's an option
-> make invoicing an option in ecommerce (still working but invisible)

- Config of payment acquirers is tough to understand: remove order confirmation
    - the invoicing process depends on the company, not on the payment acquirer -> simple invoicing option in ecommerce settings
    - capture manually: only for authorize.net! Somehow it shouldn't be visible for other acquirers

- terms are confusing
    - payment method: payment method is something else in accounting payments.  -> rename to payment acquirers
    - transaction: the difference with payments is not obvious -> rename to payment request

Specification
=============

- New module to add invoicing fields, buttons and menus: account_invoicing -> hide invoicing stuff when starting with eCommerce (not Sales app)
    - new setting in website:
    - keep behavior of current setting
    - if automatic generation of invoice is checked (default value), an invoice must be generated, validated and reconciled when the order is confirmed
    - If "Invoice what is delivered (manual)", users will create the invoice manually from the order.
    - tooltip: Choose the automatic mode if you use to issue an invoice whenever an order is placed. The manual mode allows you to invoice based on what is really delivered. That way you can invoice in several steps, etc. The mode selected here applies to any new product created but not to products already existing. If you want to invoice delivered quantities, you must update the invoicing policy of those products.

- New primary button "Mark as Paid" on SO if status = quotation sent and payment acquirer provider = wire transfer or manual config
    - when you press "Mark as Paid" -> mark payment.transaction as done.

- easy way to cancel payment -> when clicking Cancel Order button: reset the transaction to Pending, break the reconciliation receivable (=invoice) / payment, cancel the payment with an opposite entry. That way everthing comes back to initial state.

- when a payment.transaction is 'authorized' or 'done' -> confirm the SO
- when the transaction is 'done' -> register also a payment in the payment journal set on the payment acquirer (mandatory field, see next item).
    - must work for any payment acquirer, even if provider = wire transfer or manual configuration

- restructure options of payment acquirers:
    - replace Order Confirmation by:
        - Payment Journal
            - existing m2o (journal_id), make mandatory, only show account.journal whose type = bank + context when you create a journal from the field, default value = Bank, display only if account_invoicing is installed
            - tooltip: Payments will be registered into this journal. If you get paid straight on your bank account, select your bank account. If you get paid in batch for several transactions, create a specific payment journal for this payment acquirer to easily manage the bank reconciliation. You hold the amount in a temporary transfer account of your books (created automatically when you create the payment journal). Then when you get paid on your bank account by the payment acquirer, you reconcile the bank statement line with this temporary transfer account. Use reconciliation templates to do it in one-click.
    - Capture Amount Manually   [  ]
        - only visible if acquirer type = Authorize.net
        - tooltip: Capture the amount from Odoo, when the delivery is completed.
        - must be compatible with "Create Invoice Automatically". -> The invoice must be created when the payment transaction is "done"
    - Specific Countries  [  ]
        - if checked show the country field just below
        - tooltip checkbox: Make this payment acquirer available for customers of specific countries.
        - tooltip Countries: If you leave it empty, the payment acquirer will be available for all the countries.
    - Add Extra Fees       [  ]     move up the fees fields

- Relabelling:
    - Payment Methods -> rename to Payment Acquirers (menu items, views, etc.)
        - real payment methods already show up in the Register Payment modal of invoices.
    -   Transactions -> Payment Requests
        - "Transaction" is too close to "Payment". People think it's the same. With payment request, it makes think about a process: payment request -> payment

- Add a "Payment Requests" stat button to SO form to see all the payment attempts + show the status in this list view.
    - if only one payment request, display it in form view
    - + remove payment method + transaction fields below the SO total

Additional remarks:
- mark as paid button only when you can do it
- mark as paid should confirm the order (+ hide Confirm button)
- invoicing settings: faut un peu changer le truc pour séparer la génération automatique de la facture du mode de facturation des produits
- hide radio options when Invoicing option is not checked
- to hide if account_invoicing is not installed:
    - invoicing options in product form
    - SO invoicing status in list view
    - invoicing status in SO form
    - invoice link once order paid + invoice notification in the SO chatter + hide mark as paid button if already done
    - create invoice button in SO
    - orders to invoice in website dashboard
    - in automatic invoicing > mark order as paid > cancel order > reset to quotation -> no way to record the payment again
    show MARK AS PAID in draft quotation status IF payment transaction is set ?
2017-06-02 16:07:36 +02:00
Yannick Tivisse e4152792ff [IMP] payment: Set automatically a default value for journal_id if not set
Purpose
=======

The field journal_id on a payment.acquired is required on the view. The only issue is that the journals cannot be created before having installed a localization. When the payment acquire module is installed before the localization, the journal id is not set on the payment acquire and it's impossible to make a call to `write` (For example publish the acquire)

Specification
=============

When making a write or a create on a payment acquire, udpate the journal_id with a default value if not set.
2017-06-02 15:53:09 +02:00
Yannick Tivisse 783746f579 [IMP] account,sale,...: Hide invoicing stuff until sale_management or account_invoicing is installed 2017-06-02 15:53:09 +02:00