Commit Graph
127747 Commits
Author SHA1 Message Date
Sébastien Theys db7ea314ad [IMP] website_sale: allow drag & drop on extra product media
This makes the media easier to sort than manually manipulating their sequence.

task-2029597

closes odoo/odoo#34440

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-28 10:27:21 +00:00
qdp-odoo 7d19744f3e [MERGE] forward port branch saas-12.4 up to 3e3a244e1a 2019-07-01 13:55:24 +02:00
Laurent Smet bc131c0cfb [MERGE] manual forward port of accounting-pocalypse (beaa30a3d1)
This commit merges the following models
 * account.invoice and account.move
 * account.invoice.line and account.move.line
 * account.voucher and account.move
 * account.voucher.line and account.move.line

It was the opportunity for a big cleanup of the code, so it also restructures the whole account module, its different models/fields, the tests etc. for a better world and a better code readability.

==== Rationale ====
The rationale of this huge change is that we want journal entries / invoices to be easily edited, and changes reflected in the other model. It's a HUGE feature and very strategic for the fiduciary companies. For example, changing the account of a journal entry needs to be automatically reflected on the related invoice.

The same reasoning applies to sale/purchase vouchers.

==== Changes made in features =====
When creating an invoice, you are now creating a journal entry directly.
--> The object account.invoice no longer exists.
In the same fashion when creating an invoice line, you're now adding journal items directly in the journal entry representing the invoice. If this invoice line has some tax, it may create additional journal items as well.
--> The models account.invoice.line & account.invoice.tax no longer exist

Identically, when creating a sale/purchase receipt with its lines, you are now creating a journal entry directly and there's no more usability difference between encoding a receipt or an invoice.
--> The object account.voucher no longer exists.
--> The object account.voucher.line no longer exists.
--> The whole account_voucher module no longer exists.

Positive side-effects coming from these changes are
* draft invoices/bills/sale or purchase receipts now create a draft accounting entry. Validate these objects now simply post its journal entry. That means that draft invoices/bills/sale or purchase receipt can straightforwardly be included in reporting or budgets.
* opening a journal entry in form view will now always open the correct view: if it's a sale/purchase journal entry we will have a customer invoice/vendor bill view or a sale/purchase receipt view, whatever the menu we're coming from.
* code & business logic simplification. It is also condensed in a single place instead of being partially duplicated on invoices, vouchers and journal entries.

There should be no feature loss, except the one allowing to group multiple journal items together based on the same product during the invoice validation.

==== Changes made in models =====
* account.invoice: model removed. Instead, now use account.move with following mapping

field (account.invoice) 		field (account.move)
-----------------------			--------------------
name 					invoice_payment_ref
number 					name
reference 				ref
comment 				narration
user_id 				invoice_user_id
amount_					total_company_signed amount_total_signed
residual 				amount_residual
state 					state + invoice_payment_state 		/!\ selection changed
date_invoice 				invoice_date
date_due 				invoice_date_due
sent 					invoice_sent
origin 					invoice_origin
payment_term_id 			invoice_payment_term_id
partner_bank_id 			invoice_partner_bank_id
incoterm_id 				invoice_incoterm_id
vendor_bill_id 				invoice_vendor_bill_id
source_email 				invoice_source_email
vendor_display_name 			invoice_vendor_display_name
invoice_icon 				invoice_vendor_icon
cash_rounding_id 			invoice_cash_rounding_id
sequence_number_next 			invoice_sequence_number_next
sequence_number_next_prefix 		invoice_sequence_number_next_prefix

'invoices' subset of account.move can be accessed by using the selection field 'type' or one of the many helpers like is_invoice()

* account.move: now has a valid state 'cancel' that has to be excluded from all business logic
* account.move: field 'amount' renamed into 'amount_total'
* account.move: field 'reverse_entry_id' renamed into 'reversed_entry_id'
* account.move.line: now has a field 'display_type' that has to be excluded from all business logic, in order to support invoice layouting
* account.invoice.line: model removed. Instead, now use account.move.line with following mapping

field (account.invoice.line) 		field (account.move.line)
----------------------------		-------------------------
invoice_id 				move_id
uom_id 					product_uom_id
invoice_line_tax_ids 			tax_ids
account_analytic_id 			analytic_account_id

'invoice lines' subset of all account.move.line from a journal entry can be accessed by using the boolean field 'exclude_from_invoice_tab'

* account.invoice.tax: model removed. Instead, now use account.move.line with following mapping

field (account.invoice.tax) 		field (account.move.line)
---------------------------		-------------------------
invoice_id 				move_id
account_analytic_id 			analytic_account_id
amount 					price_unit
base 					tax_base_amount

'tax lines' subset of all account.move.line from a journal entry can be accessed by using the relational field 'tax_line_id'

* account.invoice.confirm: model removed. Instead, now use the 'post()' function of account.move
* account.invoice.refund: model removed. Instead, now use account.move.reversal to reverse the entries with the same options as we had for invoices
* account.voucher: model removed. Instead, now use account.move of type in ['out_receipt', 'in_receipt]
* account.voucher.line: model removed. Instead, now use account.move.line

==== Changes made in functions ====
* on account.move, method _run_post_draft_to_post() renamed into _autopost_draft_entries()
* on account.move, method action_account_invoice_payment() renamed into action_invoice_register_payment()
* on account.move, method action_invoice_reconcile_to_check() renamed into action_open_matching_suspense_moves()
* on account.move, method _get_domain_edition_mode_available() renamed into _get_domain_matching_supsense_moves()
* on account.move, method _get_intrastat_country_id() renamed into _get_invoice_intrastat_country_id()
* on account.move.line, method _get_domain_for_edition_mode() renamed into _get_suspense_moves_domain()
* in account.bank.statement, contextual key 'edition_mode' renamed into 'suspense_moves_mode'

Was task 1917430
2019-07-01 13:45:57 +02:00
Aaron Bohy 3e3a244e1a [FIX] web: BasicModel: don't update default one2many records
Let's assume a one2many field in a form view with a default value
with commands 4 (link to). Before this rev., when saving the record,
the BasicModel generated a command 4 and a command 1 (update) for
each record, with the values of the record (directly coming from DB).
This can cause an issue when the related record can't be edited
(e.g. a posted journal entry in accounting).

closes odoo/odoo#33797

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-06-28 11:53:19 +00:00
Laurent Smet beaa30a3d1 [IMP/REF] accounting-pocalypse yeaaahh
This commit merges the following models
 * account.invoice and account.move
 * account.invoice.line and account.move.line
 * account.voucher and account.move
 * account.voucher.line and account.move.line

It was the opportunity for a big cleanup of the code, so it also restructures the whole account module, its different models/fields, the tests etc. for a better world and a better code readability.

==== Rationale ====
The rationale of this huge change is that we want journal entries / invoices to be easily edited, and changes reflected in the other model. It's a HUGE feature and very strategic for the fiduciary companies. For example, changing the account of a journal entry needs to be automatically reflected on the related invoice.

The same reasoning applies to sale/purchase vouchers.

==== Changes made in features =====
When creating an invoice, you are now creating a journal entry directly.
--> The object account.invoice no longer exists.
In the same fashion when creating an invoice line, you're now adding journal items directly in the journal entry representing the invoice. If this invoice line has some tax, it may create additional journal items as well.
--> The models account.invoice.line & account.invoice.tax no longer exist

Identically, when creating a sale/purchase receipt with its lines, you are now creating a journal entry directly and there's no more usability difference between encoding a receipt or an invoice.
--> The object account.voucher no longer exists.
--> The object account.voucher.line no longer exists.
--> The whole account_voucher module no longer exists.

Positive side-effects coming from these changes are
* draft invoices/bills/sale or purchase receipts now create a draft accounting entry. Validate these objects now simply post its journal entry. That means that draft invoices/bills/sale or purchase receipt can straightforwardly be included in reporting or budgets.
* opening a journal entry in form view will now always open the correct view: if it's a sale/purchase journal entry we will have a customer invoice/vendor bill view or a sale/purchase receipt view, whatever the menu we're coming from.
* code & business logic simplification. It is also condensed in a single place instead of being partially duplicated on invoices, vouchers and journal entries.

There should be no feature loss, except the one allowing to group multiple journal items together based on the same product during the invoice validation.

==== Changes made in models =====
* account.invoice: model removed. Instead, now use account.move with following mapping

field (account.invoice) 		field (account.move)
-----------------------			--------------------
name 					invoice_payment_ref
number 					name
reference 				ref
comment 				narration
user_id 				invoice_user_id
amount_					total_company_signed amount_total_signed
residual 				amount_residual
state 					state + invoice_payment_state 		/!\ selection changed
date_invoice 				invoice_date
date_due 				invoice_date_due
sent 					invoice_sent
origin 					invoice_origin
payment_term_id 			invoice_payment_term_id
partner_bank_id 			invoice_partner_bank_id
incoterm_id 				invoice_incoterm_id
vendor_bill_id 				invoice_vendor_bill_id
source_email 				invoice_source_email
vendor_display_name 			invoice_vendor_display_name
invoice_icon 				invoice_vendor_icon
cash_rounding_id 			invoice_cash_rounding_id
sequence_number_next 			invoice_sequence_number_next
sequence_number_next_prefix 		invoice_sequence_number_next_prefix

'invoices' subset of account.move can be accessed by using the selection field 'type' or one of the many helpers like is_invoice()

* account.move: now has a valid state 'cancel' that has to be excluded from all business logic
* account.move: field 'amount' renamed into 'amount_total'
* account.move: field 'reverse_entry_id' renamed into 'reversed_entry_id'
* account.move.line: now has a field 'display_type' that has to be excluded from all business logic, in order to support invoice layouting
* account.invoice.line: model removed. Instead, now use account.move.line with following mapping

field (account.invoice.line) 		field (account.move.line)
----------------------------		-------------------------
invoice_id 				move_id
uom_id 					product_uom_id
invoice_line_tax_ids 			tax_ids
account_analytic_id 			analytic_account_id

'invoice lines' subset of all account.move.line from a journal entry can be accessed by using the boolean field 'exclude_from_invoice_tab'

* account.invoice.tax: model removed. Instead, now use account.move.line with following mapping

field (account.invoice.tax) 		field (account.move.line)
---------------------------		-------------------------
invoice_id 				move_id
account_analytic_id 			analytic_account_id
amount 					price_unit
base 					tax_base_amount

'tax lines' subset of all account.move.line from a journal entry can be accessed by using the relational field 'tax_line_id'

* account.invoice.confirm: model removed. Instead, now use the 'post()' function of account.move
* account.invoice.refund: model removed. Instead, now use account.move.reversal to reverse the entries with the same options as we had for invoices
* account.voucher: model removed. Instead, now use account.move of type in ['out_receipt', 'in_receipt]
* account.voucher.line: model removed. Instead, now use account.move.line

==== Changes made in functions ====
* on account.move, method _run_post_draft_to_post() renamed into _autopost_draft_entries()
* on account.move, method action_account_invoice_payment() renamed into action_invoice_register_payment()
* on account.move, method action_invoice_reconcile_to_check() renamed into action_open_matching_suspense_moves()
* on account.move, method _get_domain_edition_mode_available() renamed into _get_domain_matching_supsense_moves()
* on account.move, method _get_intrastat_country_id() renamed into _get_invoice_intrastat_country_id()
* on account.move.line, method _get_domain_for_edition_mode() renamed into _get_suspense_moves_domain()
* in account.bank.statement, contextual key 'edition_mode' renamed into 'suspense_moves_mode'

Was task 1917430
2019-06-28 11:52:55 +00:00
Romain Derie 0bd61b5245 [FIX] website_sale: remove unnecessary code on test
559bdc976 was merged with an extra line of code to avoid a bug as the fix was
merged in lower version (9efc11c8da) and we could not wait for the forward
port.

Thus, we forced the redirect on `/my` after signup. This code should be removed
for the test to really test the behavior.

closes odoo/odoo#34406

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-28 09:34:36 +00:00
Yannick Tivisse 2eb374ea24 [FIX] hr: Correct implementation for 3be372c
This breaks the profile edition for non admin users
2019-06-28 08:48:49 +02:00
Christophe Simonis 5e81b18e24 [MERGE] forward port branch saas-12.3 up to 0247d2f35f 2019-06-27 20:45:52 +02:00
mgh-odoo c3a609eae4 [FIX] website_form_editor: retain selection field design while saving
In case of selection or many2one field, while saving the page, the field
is re-rendered and loses the applied design changes.

This commit fixes the behavior by re-applying those changes on a newly
rendered field.

task-1961733

closes odoo/enterprise#4657

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>

X-port/Cherry-pick of odoo/enterprise@298a9b3a94
2019-06-27 19:59:16 +02:00
Goffin Simon 0247d2f35f [FIX] sale_coupon, sale_coupon_delivery: Wrong discount on promotion program
Let's consider a product P with a unit price = 100€
When a price list PL with a discount of 20% was applied, and
a coupon program CP with a discount of 10% was also applied,
system still calculated the rate based on unit price of the product
and not on the discounted price.

So in this example, the amount of the CP discount was 10€ instead of
8€ because the CP discount was computed on the unit price 100€
instead of the discounted price 80€ (with 20% discount of PL)

opw:2006829

X-port/Cherry-pick of odoo/enterprise@23739e8a71
2019-06-27 19:14:28 +02:00
Christophe Simonis 6c5783bd5a [MERGE] forward port branch saas-12.2 up to 465909f0fd 2019-06-27 19:10:09 +02:00
Christophe Simonis 465909f0fd [MERGE] forward port branch 12.0 up to cd21c016b0 2019-06-27 18:01:07 +02:00
Christophe Simonis cd21c016b0 [MERGE] forward port branch saas-11.3 up to 2f2bc67c06 2019-06-27 17:24:24 +02:00
Andrea Ulliana 230bb2a84d [IMP] w_event, event_sale, event: check registrable events
Before this task, an event out of date was still registrable for a
customer. Now, an event is registrable only if the end date is not out
of date.

task-1973957

closes odoo/odoo#33389

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-27 14:46:42 +00:00
Lucas Lefèvre 3de5fce87c [IMP] hr_recruitment: Improve usability
Purpose
========

Modernize recruitment app, clean of menu, remove resume and letters feature
to integrate it with documents.

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

1) Menus

- Applications
-> By Job Positions (current job position menu
-> All Applications
- Reporting
-> Recruitment Analysis
- Configuration
-> ... does not change

2) Remove resumes and letters menus

3) Add a quick search on `hr.job` to "My Jobs Positions" based
on recruitment responsible = user.

Task id: 1965870

closes odoo/odoo#33862

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-28 13:01:23 +00:00
Robot Odoo 20ed8d4300 [MERGE] website, *: handle all website errors with beautiful design
* web, base, website_forum, test_website, account, gamification,
iap, mail, partner_autocomplete, point_of_sale, stock,
website_sale_comparison

All rpc errors are now displayed using the notification system recently
updated for website. For the redirections triggering an error that are
currently displayed as a 500 Error with an ugly white page, the error
page will be similar to 404/403 error but with code 400. All
exception_orm are now handled as a 400 except for the AccessError
which is a 403.

The error card on all the Error pages is now loaded on an open state
displaying clearly the reason of the error without clicking anything.
If there is no error message the error card is not displayed and the
traceback is open. The traceback is only displayed if we are in debug
mode. These changes are also effective for the 500, 404 and 403 error
pages.

KarmaError is now an except_orm exception.
Karma error message now contains the required karma.
All the alerts in website_forum will use the toast notifications
instead of alerts.

A test tour is located in test_website, visit /test_error_view to
trigger some errors manually and look at the result.

task-1894820

closes odoo/odoo#32132

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-28 14:51:01 +02:00
fja-odoo 6e55a3a496 [IMP] website_forum: display forum errors with notif
Previously the Forum errors were handled with a popover, now the
errors will be consistent with the crash_manager and display a toast
notification via the show_warning method.

Also the KarmaError were previously not displaying the karma needed to
perform the action. Now it will display the amount in the error message.

The CrashManager show_warning method will now take an options dictionary
as a second argument to override it's default behaviour.

Part of https://github.com/odoo/odoo/pull/32132
task-1894820
2019-06-28 08:53:53 +00:00
fja-odoo e26d23cb97 [FIX] website_forum: remove unused close notif event
This code was not used properly and was triggering useless rpc.
This code was used in the deprecated badge system and we forgot to
remove it.

Commit where the code should have been removed:
ec212de5c7

Commit where a quick fix was made:
1e1ea00e66
2019-06-28 08:53:53 +00:00
fja-odoo 283f8fed6e [IMP] web, *: display rpc warnings with toasts
* = test_website, partner_autocomplete

- All the rpc warnings are now displayed using the notification system
  of https://github.com/odoo/odoo/commit/b94395b50175925fc7d1bd3655e5facb78a8ba2b

- test_website is up to date

Part of https://github.com/odoo/odoo/pull/32132
task-1894820
2019-06-28 08:53:53 +00:00
fja-odoo 0d1407a715 [IMP] base, web, *: make KarmaError an except_orm
* = gamification, test_website, stock

- KarmaError is now handled as a 400 exception.
- test_website has been updated.
- NO_POSTMORTEM is now clean it was referencing duplicates as most the
  exceptions inherit from except_orm.
- serialize_exception from http.py has been moved to ir_http
  to take advantage of the odoo inheritance system. We can then
  extend ir_http serialize_exception method to add the KarmaError
  logic if and only if gamification is installed.
  Places where serialize_exception was previously used are updated.

Part of https://github.com/odoo/odoo/pull/32132
task-1894820
2019-06-28 08:53:53 +00:00
fja-odoo 90818fd083 [IMP] test_website: add test tour for the website errors
The purpose of these tests is to verify that errors informations
are displayed correctly on the website.

Part of https://github.com/odoo/odoo/pull/32132
task-1894820
2019-06-28 08:53:52 +00:00
fja-odoo 83c1d56d2f [REF] mail, website, *: remove useless "in" classes
* website_sale_comparison

Just removing old "in" class from bootstrap3 wich has been replaced by
"show" in bootstrap4.

Part of https://github.com/odoo/odoo/pull/32132
task-1894820
2019-06-28 08:53:52 +00:00
fja-odoo dc561aae03 [IMP] website: enhance http error pages
- The traceback is only visible if in debug mode or if edit mode.

- All except_orm exceptions are now displayed as a 400
but the AccessError wich is a 403. There is now a dedicted page
for the 400 error.

- Errors messages are no longer the exception args but its name if the
exception is an except_orm. Else there is no message since the current
logic override exceptions of type Exception in ir_http thus we have
no message to display.

Part of https://github.com/odoo/odoo/pull/32132
task-1894820
2019-06-28 08:53:52 +00:00
fja-odoo f8fe314e78 [IMP] web, *: display warning/error in frontend
* = account, iap, point_of_sale

Removing the CrashManager templates from base.xml and moving
it to a new file (crash_manager.xml) to allow lazy loading the required
xml only when a crash occurs (necessary for the frontend as no xml is
pre-loaded).

All rpc errors/warnings are now displayed using the same modal system as
the backend (crash_manager.js).

CrashManager will now return the WarningDialog and ErrorDialog
in addition to the CrashManager itself.
In some cases an instance of CrashManager was created just to
display a warning/error dialog.

In the backend all rpc errors but sessionExpired will be logged.
If the exception is a warning, NotFound (403) or except_orm, it will be
a warning log. The rest will be exception log.

In the frontend all rpc errors will be logged using console.debug
instead of console.warn and console.error. This way we can trigger
rpc errors in tests without failing them. If a real error happend
during a test it will fall back on the backend logger to fail the test.

Part of https://github.com/odoo/odoo/pull/32132
task-1894820
2019-06-28 08:53:52 +00:00
fja-odoo e6d4ab84da [REF] web: move rpc_error binding into the crash_manager
Moving the rpc_error binding into the crash manager is mandatory for it
to be used in the website.

Part of https://github.com/odoo/odoo/pull/32132
task-1894820
2019-06-28 08:53:52 +00:00
jem-odoo 2cbbc88dab [IMP] tools: introduces format_duration
As some formatting tools already exists, it is time for float_time
conversion to have its own. Purpose is to extract formatting logic
from the float_time qweb widget to tools, in order to reuse it
in mail.template (jinja).
We named it 'format_duration', to follow babel convention. This
can bring confusion with the duration qweb widget, but this widget
should be called 'timedelta', as it is more generic than this one.

Task-2025396

closes odoo/odoo#34417

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-06-28 06:51:17 +00:00
Thibault Delavallée ef7871826e [REF] mail: template: move formatting to tools
This commit moves formatting helpers method used in mail.template to tools. The goal
is to reuse them anywhere in odoo, and not only in mail templates. Thoses method are
used to format date, datetime, amount, ... according to user localization (currency,
language, pattern, ...).

This commit also improve the formatting methods of 'date' and 'datetime': we are now
taking the 'lang_code' into account. Indeed, as the implementation uses `babel` lib,
it is easy and usefull to add the language option, to display the given dates into a
particular language. This parameter is optional to keep compatiblity with existing
code.

Task-2025396

Code Courtesy of @tde-banana-odoo
2019-06-28 06:51:16 +00:00
Kevin Baptiste f17655dd77 [IMP] hr_contract: Replace some contract states by kanban status
Purpose
=======

Having some usability check to be sure to make the pay
for everyone, and don't loose contracts.

We would like to remove incoming and to renew columns in
hr.contract and replace them by a kanban state.  In employee, we would
like to add warning on the kanban to warn the hr responsible there
is no contract or a contract is about to expire

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

hr.contract kanban:

- add a kanabn state
- it becomes red automatically when the contract is in running and  expire in 7 days
- add aquick search in filter to filter on expered soon
- the kanban state can be changed manaually (in case of there is several rh)
- sort by contract end date set first (more close of today first)

Employee kanban

- add an red icon if there is no contract in Runnig status OR there is a
kanban state red in their contract (whatever the status).
- add a quick seaach on employee with warning

- State pending + green = incoming
- State confirmed + red = about to expire / to renew

closes odoo/odoo#33489

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-28 06:59:32 +00:00
Christophe Simonis 5548029fb7 [MERGE] forward port branch saas-12.4 up to 5e81b18e24 2019-06-27 20:51:59 +02:00
Nicolas Martinelli 52749f9a02 [FIX] payment_stripe: UserError
In case of failure at token creation, raise a proper UserError instead
of a generic traceback.

opw-2025723

closes odoo/odoo#34420

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-27 13:07:18 +00:00
Christophe Simonis 2f2bc67c06 [MERGE] forward port branch 11.0 up to b1d43cc80e 2019-06-27 14:40:32 +02:00
Christophe Simonis b1d43cc80e [MERGE] forward port branch saas-15 up to d090c92782 2019-06-27 14:25:31 +02:00
Nicolas Martinelli 7670c6c80a [FIX] pos_discount: change customer
- Enable general discounts for POS
- Create a POS session
- Add a product
- Create a general discount of 10%
- Change the customer

The discount is reset to the product price.

When changing the customer, the prices are reset:

https://github.com/odoo/odoo/blob/3b1699e02d4483913159681bf7e10839e6493244/addons/point_of_sale/static/src/js/screens.js#L1251

In the case of a global discount, the price is therefore reset to the
product price in:

https://github.com/odoo/odoo/blob/3b1699e02d4483913159681bf7e10839e6493244/addons/point_of_sale/static/src/js/models.js#L2304

To avoid this, we set the price as manually set. Conceptually, this is
indeed the case since we manually chose the percentage, therefore the
price.

opw-2009761

closes odoo/odoo#34416

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-27 11:51:54 +00:00
Christophe Simonis d090c92782 [MERGE] forward port branch saas-14 up to 1985a49b92 2019-06-27 12:41:55 +02:00
Christophe Simonis 1985a49b92 [MERGE] forward port branch 10.0 up to 5eb15c01b5 2019-06-27 12:41:15 +02:00
Nicolas Martinelli 365110e9eb [FIX] sale: no company
Avoid crash at currency conversion when no company is set on the SO

opw-2009044

closes odoo/odoo#34408

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-27 09:37:22 +00:00
Yannick Tivisse a5b08d5ea5 [MERGE] web, hr, test_website: Add multi-company tests
test_website: Add multi-company test
=============================

Purpose
------------

This commit tests some behaviors with multi company
mode after changes brought by f847a46.

Specification
-------------------

The website company should be automatically set in the
context as 'allowed_company_ids'.

That way, we can remove the switch company menu on the
website, which doesn't make a lot of sense.

This test enforce this behavior.

web: Add QUnit tests for the SwitchCompanyMenu
=========================================

Purpose
------------

This commit tests some behaviors with multi company
mode after changes brought by f847a46.

Specification
------------------

Ensure the robustness of the switch company menu for
multiple cases like:

- Bar rendering
- Switch to another company in mono/multi environment
- Toggle another company in mono/multi environment
- Remove a company in mono/multi environment

The widget itself has been slighty modified to make
it more testable:

- Reading from session is now in the `willStart` function
  instead of `init` to allow mocking the session (in tests,
  `init` is executed before the mock is applied).
- In the event handlers, don't use `bbq` to retrieve
  current allowed company ids. `bbq` is not easily nor
  cleanly patched.
- When reading allowed company ids from session, cast
  ids from string to integer. They are everywhere casted
  except there.

and some linting

hr: Add multi company tests
======================

Purpose
-------------

This commit tests some behaviors with multi company
mode after changes brought by f847a46.

Specification
------------------

Check that a report printing for several records on
different companies:
- Works if the context is correctly set, i.e. both
  companies are in the allowed_company_ids
- Doesn't work if the context is not correctly set
2019-06-27 11:34:29 +02:00
Priyanka Kakadiya 5eb15c01b5 [FIX] base, web: missing extension on binary downloads
It's currently possible for binary downloads to be missing an
extension entirely. Generate an extension from the mimetype and use
that. Also ensure the existing extension (if any) matches the
mimetype.

Warning: this may require adding new mimetype/extensions pairs to the
local mimetype database similar to
f413d155df.

Also fix missing or incorrect filenames on records without a filename
field: in some Odoo versions the client would send a filename of
"null", resulting in a download of e.g. "null.pdf" instead of the
attachment or inferred name.

Task 2025716

closes odoo/odoo#34299

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-27 08:26:49 +00:00
lul-odoo d8f95609eb [IMP] hr: Add a multi company report printing test
Purpose
=======

This commit tests some behaviors with multi company
mode after changes brought by f847a46.

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

Check that a report printing for several records on
different companies:
- Works if the context is correctly set, i.e. both
  companies are in the allowed_company_ids
- Doesn't work if the context is not correctly set
2019-06-27 10:24:44 +02:00
lul-odoo 1c99c251c9 [IMP] web: Add QUnit tests for the SwitchCompanyMenu
Purpose
=======

This commit tests some behaviors with multi company
mode after changes brought by f847a46.

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

Ensure the robustness of the switch company menu for
multiple cases like:

- Bar rendering
- Switch to another company in mono/multi environment
- Toggle another company in mono/multi environment
- Remove a company in mono/multi environment

The widget itself has been slighty modified to make
it more testable:

- Reading from session is now in the `willStart` function
  instead of `init` to allow mocking the session (in tests,
  `init` is executed before the mock is applied).
- In the event handlers, don't use `bbq` to retrieve
  current allowed company ids. `bbq` is not easily nor
  cleanly patched.
- When reading allowed company ids from session, cast
  ids from string to integer. They are everywhere casted
  except there.

and some linting
2019-06-27 10:24:40 +02:00
lul-odoo 7ea21adabe [IMP] test_website: Add multi-company test
Purpose
=======

This commit tests some behaviors with multi company
mode after changes brought by f847a46.

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

The website company should be automatically set in the
context as 'allowed_company_ids'.

That way, we can remove the switch company menu on the
website, which doesn't make a lot of sense.

This test enforce this behavior.
2019-06-27 10:24:32 +02:00
William Henrotin fdcabf19b2 [FIX] mrp: wrong message construction
The error message is built from string pieces except one that is a list.
This commit cast this list into a proper string to be able to build the
error message.

closes odoo/odoo#34402

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-06-27 08:23:59 +00:00
Christophe Simonis cf18c9bae1 [MERGE] forward port branch saas-14 up to 2a89adef2a 2019-06-26 19:26:58 +02:00
Christophe Simonis 2a89adef2a [MERGE] forward port branch 10.0 up to 7b16abbae1 2019-06-26 19:26:33 +02:00
svs-odoo 0fa9c07eaa [FIX] stock: can't select undefined record
Before this commit, on editable quant view list, when user tries to
create a duplicate line and save it with tab or enter key, the list
tries to go to the next line. But sometime, this line was moved cause of
the refresh, so it causes a JS error and raises a traceback.
This fix avoid to try to select something in case we refresh the list.

Task #2006337

closes odoo/odoo#33866

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-06-26 12:30:12 +00:00
Christophe Simonis b5beeb0901 [MERGE] forward port branch 11.0 up to 7742887e96 2019-06-26 13:52:44 +02:00
Nicolas Martinelli d870749d79 [FIX] l10n_fr_fec: remove new line
- Make a SO with a product that have a carriage return in its
description
- Export FEC report

The CSV contains new lines and is not correctly formatted.

opw-2026861

closes odoo/odoo#34385

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-26 11:45:57 +00:00
Nicolas Martinelli da986aa479 [FIX] l10n_fr_fec: backport fixes
Backport of:

a3519638a3
fe9e7d47b8

opw-2026861
2019-06-26 11:41:41 +00:00
Christophe Simonis d65953124c [MERGE] forward port branch saas-14 up to 61a51a8651 2019-06-26 11:15:32 +02:00
Christophe Simonis 61a51a8651 [MERGE] forward port branch 10.0 up to ea4ddff117 2019-06-26 11:12:36 +02:00