Commit Graph
111138 Commits
Author SHA1 Message Date
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
Yannick Tivisse b9980eda5c [IMP] payment,*: Relabel 'Payment Method' into 'Payment Acquirer' 2017-06-02 15:31:47 +02:00
Yannick Tivisse 4aa2fad313 [IMP] payment: Remove auto_confirm field and simplify views.
PURPOSE
=======

The field auto_confirm is complicated to understand for common users. Furthermore, on of its options is only useful for authorize module.

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

Remove the auto_confirm field. The destinies of its options are the following:
- none: Simply disappear.
- authorize: Become capture_manually. It has nothing to do with the auto_confirm field has it's related to the autorize module (And could be extended to other payment acquirers too).
- confirm_so: Remove it. Will be automatic, and we will always validate the sales order and generate the accounting entries on acquirer validation.
- generate_and_pay_invoice: Is linked to the journal_id. The field journal_id is always set and we will use it to validate the sales order and generate the accounting entries on acquirer validation.

Bonus: website_sale: Allow to create/validate invoice automatically on `Mark as Paid`
2017-06-02 15:31:47 +02:00
Yannick Tivisse 4fe4c1e851 [MOV] website_sale: Move override of website from sale_order.py to website.py 2017-06-02 15:31:47 +02:00
Yannick Tivisse 8d37f49cb7 [IMP] payment: Remove payments stat button on payement providers
Purpose
=======

Useless here because it is a configuration form.

Replace it but a menu with all the payment transactions, available for employees
2017-06-02 15:31:47 +02:00
Yannick Tivisse 2d71a0f4f4 [IMP] website_sale: Add an option to install account_invoicing
The invoicing mechanism can be tranparent for the end users, and can ben activated on the website settings
2017-06-02 15:31:47 +02:00
Yannick Tivisse 8cd4f48867 [ADD] account_invoicing: Hide account menuitems if only website_sale installed
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 unvisible)

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

Hide the menuitems of account, and add a module account_invoicing that will display them.
2017-06-02 15:31:47 +02:00
Yannick Tivisse 39d8c40682 [IMP] sale: Hide all sale menuitems while sale_management isn't installed
Hiding the Sales root menuitem isn't sufficient to hide all the menuitems from the sales module.

Example:

1/ Install Ecommerce, you don't have any menuitems from sale as sales_management isn't installed
2/ Install CRM, the root menuitem is activated by the sale_crm, and all the menuitems from sales are displayed

Specification:

Add the attribute active=False on all the menuitems from sales
Activate them on sale_management
2017-06-02 15:31:47 +02:00
Yannick Tivisse 83608995e1 [IMP] base: Add 'active' attribute on menuitem tag
This attribute will be used in the next commit to hide by default account menuitems in the account module to finally display them in the account_invoicing module.

Without this attribute, we should create the menuitems with the <menuitem> tag and after that make them inactive by using a <record> tag
2017-06-02 15:31:47 +02:00
David Monjoie 2d26ed05a7 [FIX] web: fix handle widget functionality
Also added tests for handle in list view and inside an x2many.
2017-06-02 15:12:55 +02:00
David Monjoie 31f5819724 [FIX] web: fix mock server dropping x2many on update
Previously, when an update operation was performed, the list of
ids in the x2many field was emptied beforehand.

It kinda worked in lots of cases where one would expect it to
fail because in thoses cases the widgets send link_to commands
along with the update one, thus re-adding the removed line.

Now the behavior is more consistent accross the board. We start
with the current list of ids and apply the requested changes.
2017-06-02 15:12:43 +02:00
Nicolas Martinelli 3a826bb772 [FIX] point_of_sale: fix zoom
When the user zooms with the browser, the bottom left pads are
misaligned for some zoom levels.

By slightly reducing the width of the action pad, this can be solved for
all acceptable zoom levels.

opw-745074
2017-06-02 13:30:25 +02:00
Nicolas Martinelli 46c85b4a82 [FIX] product_extended: time cycle
Use the field `time_cycle` for cost computation, which takes into
account the routing configuration (fixed time of computed based on
previous operations).
2017-06-02 12:20:08 +02:00
Nicolas Martinelli 7cc8420ea0 [FIX] product_extended: workcenter cost
- Create a work center with a capacity of 1, an efficiency factor of
  100% and a cost per hour of 40$
- Create a routing with two operations: one with a fixed duration of
  30:00 minutes (OP1) and another with a duration computed on real time
  but with a default of 30:00 minutes (OP2)
- Create a component with UOM "m" and a cost of 10$
- Create a finished product with an associated BoM
- The BoM has a first line with 0.8m of component in the OP1 and a
  second line with 0.4m of component in the OP2
- Activate the Compute from BoM option on the finished product
- The proposed cost is 32$

Expected cost: 52$
(30 minutes @40$/hour + 30 minutes @40$/hour + 1,2m @10$/m)

We divide the WC cost by the number of operations, which does not make
sense.

opw-741032
2017-06-02 12:20:08 +02:00
Nicolas Martinelli 844d609cc9 [FIX] web_tour: hide tooltips on printing
opw-745872
2017-06-02 12:17:13 +02:00
Devvrat Sharma e50571ca25 [IMP] sale,purchase: Correct placeholders for note field
PURPOSE
=======
Correct wrong placeholder

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

1. On SO, field "Note", replace the current placeholder by "Setup default terms and conditions in your sales settings ..."

2. On PO, field "Notes", replace the current placeholder by "Define your terms and conditions ... "
2017-06-02 11:32:23 +02:00
Nicolas Lempereur b5aeaa910d [FIX] website_forum: archived forum -> no ask
An archived forum could still be posted in, something better should be
done in the next version (eg. website published present on a lot of
record type) but as of 10.0 just this improvement is done.

opw-745510
closes #17365
2017-06-02 11:07:19 +02:00
David Monjoie 6d75ccdb59 [FIX] web: mock server should not catch errors
Otherwise some changes can create rpc errors that are silently caught
and never seen as long as, out of (un)luck, the end result is the same.

Tests which need to create a server error can just simulate it using
the mockRPC mechanism.
2017-06-02 11:06:44 +02:00
Dharmraj Jhala c11723d4ef [IMP] website: hide homepage editor tooltip in mobile
As edition is not allowed in mobile mode, only show "Welcome to your
homepage" instead of indicating what to do to edit the page.
2017-06-02 10:26:39 +02:00
Dharmraj Jhala 288a471a26 [IMP] website: improve snippets' design
- Feature grid snippet: enable copy and move of inner containers

- Accordion snippet:
    - add the ability to change box headers & background colors
    - improve the text contents

- Comparison snippet:
    - add ability to change header colors
    - prevent unwanted text color changes
2017-06-02 10:26:38 +02:00
Dharmraj Jhala a33ec972ab [FIX] web_editor, website: allow to detect indirect clones
When cloning a snippet section thanks to the editor, the associated
snippet options' `on_clone` methods are called. Now these methods
receive a new argument `options`. The option this commit introduces
is the `isCurrent` one. It allows the method to know if the snippet
section it is associated to is the one that was cloned or if it is a
child of the one that was cloned.

This is useful to solve a known bug when cloning elements which have
bootstrap columns:

- When one column is cloned we want it to lose its col-*-offset-*
  classes so that the offset is not duplicated (only the column).

- When a container with column children is cloned we do not want
  these column' offsets to be removed (we want the whole cloned
  container to be the same).
2017-06-02 10:26:24 +02:00
Aaron Bohy 719e040dee [FIX] web: Many2One: search with input's value
When the user writes something in a Many2One input, after a short
delay, a name_search RPC is done with the value written in the
input, and results are displayed in a dropdown. Then, if the user
clicks on the input, the dropdown closes. If he clicks again, it
should do again a name_search RPC with the value of the input.
Before this rev., it was doing it with the empty string.
2017-06-01 20:45:06 +02:00
Aaron Bohy 1749ac2cd1 [FIX] web: allow to unset and reset same many2one value
Suppose that we have a many2one which is set (has a value) in
a form view. Before this rev., if the user unset the value (by
erasing the input content in edit mode), and then reset the same
value, the input remained empty, and the old value wasn't actually
reset.
2017-06-01 20:45:06 +02:00
Aaron Bohy 9966e4b333 [FIX] web: don't scroll when navigating in editable list
Problem occured with checkboxes in editable lists: when pressing
up, down, right or left with the focus on a checkbox, in addition
to navigating in the requested direction in the list, the page
scrolled (if there was a scrollbar of course). This was because the
event wasn't 'preventDefaulted'.
2017-06-01 20:45:06 +02:00
Dharmraj Jhala 29ac4004cf [IMP] website: allow to detect the active menu on a slugified URL
Some default website menu were not marked as active when landing on
their associated page, e.g. clicking on "Blog" loads the blog page
but the "Blog" menu is not marked as active.

This was because of slugified URL. Indeed, for the "Blog" menu for
example, the URL "/blog/1" redirects to the "/blog/my-super-blog-1"
URL.
2017-06-01 17:29:29 +02:00
Dharmraj Jhala 0485af3786 [IMP] website: properly preserve "style" when changing gallery snippet "mode" 2017-06-01 17:28:26 +02:00
Sagar Ahirrao 5d15bd76c6 [IMP] website: add "Company Team" snippet
Introduce a new snippet to show the company team.

This commit also introduces a new classe "s_no_resize_cols" to put
on a .row element to prevent the size and margins options to be used
on the .col-* children. This allows to build some complex layout without
having a deep hierarchy of snippet options.
2017-06-01 17:22:45 +02:00
Csaba Fazekas d18346a103 [IMP] website: fix gallery snippet paddings 2017-06-01 17:21:45 +02:00
Dharmraj Jhala 22745668cf [FIX] website: properly update parralax image
Fixed some issues with parralax image updates:

- Background updated without clicking
- Default wallpaper not coming back
- Background disappearring sometimes
2017-06-01 17:09:54 +02:00
Kishan Gajjar 79477b8d96 [FIX] web_editor: hide customize menu when there are no options 2017-06-01 17:08:49 +02:00
Dharmraj Jhala dbdbfa7432 [FIX] website: properly rebind background events
In carousel snippet, the target element for background snippet option is
being changed manually. So for the new target, we have to rebind the
associated events that were bound in `start` function of the snippet
option. For that, some code is extracted from the `start` function and
is used to rebind necessary events for new targets.

In particular, this was preventing the carousel slides' backgrounds to
be automatically removed when a background-color was selected.
2017-06-01 17:08:49 +02:00
Goffin Simon 6dc6b148ef [FIX] service: No context in function tr
The context is not in the kwargs when the integrity error is raised from
a rpc request. So the user lang was lost and the sql error message was not
translated.

The part treating the callable message in sql error is depracated.

opw:743259
2017-06-01 17:02:16 +02:00
Richard Mathot d6fc6b416a [FIX] base: keep a complete address for demo company
Orelse making a demo of a shipper become very tiresome as
you have first to set an address for your company.

(partial revert of dccfdb0ddb)
2017-06-01 16:42:48 +02:00
Christophe Matthieu a3874fce47 [FIX] account: reconciliation send all time propositions as partial
It is necessary to distinguish between the selected lines and the lines
with partial reconciliation.
2017-06-01 15:26:48 +02:00
Martin Geubelle 1561c5f660 [FIX] web: add o_input class on calendar dialog input
Since the rev 250e716
the class `o_input` needs to be set on an input to be correctly styled.
2017-06-01 13:57:53 +02:00
Thibault Delavallée 7eca402b11 [FIX] website_portal_sale: fix access rights issues when viewing quotes
Portal users do not have access on invoices or invoice lines. However when
viewing an online quotation in website_portal_sale some computation is
performed based on invoices and invoice lines. We therefore iterate on
invoice and invoice lines as superuser as we do not want to grant any
additional access on those models for portal users.
2017-06-01 13:54:04 +02:00
Thibault Delavallée 7736eabf0d [FIX] website_sale(_delivery): limit 'Setup payment / delivery methods' to group_system
When choosing a payment acquirer or a delivery provider there is a link
allowing to directly jump in the backend to configure them. It has been
introduced at 6c2535b9b6.

However it is displayed for every user going through the checkout process.
This commit limits it to group_system. It seems a better idea to not show
it to everyone as they don't have access to it anyway.
2017-06-01 13:53:56 +02:00