Commit Graph
127656 Commits
Author SHA1 Message Date
Xavier Morel e09a5fb3ea [FIX] base: don't overwrite existing extensions
The point was to fix files attachments without an extension,
potentially appending to existing extensions was not a smart idea.

See #34299, 5eb15c01b5
2019-07-02 10:06:50 +02:00
Pierre Masereel f72a016389 [FIX] pos_hr: barcode and pin code access rights
Since groups added on fields 'barcode' and 'pin' on hr employee in
rev: c9ca376146

It is not possible anymore to launch the POS when 'pos_hr' module is
installed. Because we don't want to allow users to access in read on all
pin codes and barcodes of employees. We've made a function that will get
a sha1 signature of the barcode and pin code of all employees to store
it in the frontend of POS.

We don't have other solutions concerning the security if we want to keep
the POS working offline. We also know that it is not brute force proof,
as pin code are composed of only digits and you can easily generate the
signatures of all pincodes.

closes odoo/odoo#34447

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-01 14:58:44 +00:00
Yannick Tivisse c78960de88 [FIX] base: Allow to create an user
Now that an onchange set its result into the cache, we
cannot create a user because the onchange tries to put
the reified fields (eg: sel_4_7) into the cache.

As those field don't exist and are pseudo-fields used
to manage groups into the res user form view, we should
replace the values by ORM commands on the groups_id field,
as this is already the case in the create and the write
methods.

closes odoo/odoo#34487

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-01 12:13:53 +00:00
Raphael Collet 569bbd7c22 [FIX] models: onchange handles inconsistent data in all cases
closes odoo/odoo#34451

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-06-28 14:55:18 +00:00
Thibault Delavallée c0dad1ed4d [FIX] mail: fix computation of needaction for partners coming from channels
This is mainly a typo / wrong computation introduced at 581a74143e.
This commit also fixes some typos in comments.

closes odoo/odoo#34443

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-01 08:29:11 +00: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
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
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
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
Nicolas Martinelli 6387614dca [FIX] product: create variants in multi-company
- Install stock module
- Activate multi-company and variants
- Create a second company
- Create a product with 2 variants
- Create a picking with the product for both companies
- Add an attribute on the product with 2 values
- Save

An AccessError is raised on `stock.move`.

It arises because the field `product_qty` on `stock.move` must be
recomputed but is on a record in a different company.

The `try` / `except` clause doesn't protect against the recomputation.
Indeed, what happens is:
- try to unlink in batch => AccessError due to recomputation
- try to unlink individually => AccessError due to recomputation
- try to write individually => the field couldn't be recomputed before
(flagged as dirty), so try again to recompute => AccessError

We perform the operation as sudo, and take care of checking the access
rights beforehand.

opw-2009450

closes odoo/odoo#34369

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-26 07:21:22 +00:00
Romain Derie 762b809f71 [FIX] website_sale_delivery: adapt test to 55ed70f405
There is a conflict in saas-12.3.
Indeed, the optional popup on a product when adding to cart got encapsulated
into a new module with 55ed70f405.

But 9308180089 introduced a new test in 12.0 about free delivery.
The tour expects the popup to be shown, but it is not the case anymore.

The tour needed to be adapted. Standard runbot was green since the test would
luckily be executed after `website_sale_product_configurator` would be
installed. That was not the case on runbot theme.

The chance is also taken to ensure the test is executed on the correct
delivery.

closes odoo/odoo#34367

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-25 16:53:08 +00:00
Nicolas Seinlet 33f47e0ae9 [FIX] sale: larger terms and conditions field
In edit mode, the terms and condtions field is too small

closes odoo/odoo#34332

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-06-26 10:39:20 +00:00
Olivier Colson 8c7d7e0c2f [FIX] account: correct default country on new tax repartition lines
When creating a new tax, before saving, the default-computed repartition lines had no country_id associated. It only 'appeared' when saving the record.

closes odoo/odoo#34359

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-06-26 08:11:17 +00:00
Yannick Tivisse 88360a95f2 [FIX] hr: Add missing group on private employee model
closes odoo/odoo#34366

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-25 15:26:22 +00:00
Christophe Simonis ed40b8409b [FIX] web: avoid using unknown fields
Oversight of previous forward-port.
2019-06-25 15:37:12 +02:00
Christophe Simonis cf51b5f25d [MERGE] forward port branch saas-12.3 up to 793933a128 2019-06-25 14:23:48 +02:00
Bohdan Lisnenko 7742887e96 [FIX] http_routing: slugify_lib - max_length param should be int
closes odoo/odoo#33858

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>

closes odoo/odoo#34363

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-25 12:15:37 +00:00
Vincent Schippefilt 793933a128 [FIX] web: fix wrapping of many2one in list view
Before this fix, the many2one text in the list view was not wrapping.
After this fix, the text will wrap according to the available space
(managed automatically by the browser).

closes odoo/odoo#34345

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-25 08:34:11 +00:00
William Henrotin 1c542adf86 [FIX] stock: calling 'get()' on None
This commit tests that values is not falsy before accessing a key

closes odoo/odoo#34343

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-06-25 08:00:30 +00:00
Christophe Simonis fbd874368a [FIX] website_sale_comparison: correct product removal from comparison list
Oversight of previous forward-port.
2019-06-24 14:48:54 +02:00
Xavier Morel 5fd75da0e9 [FIX] base: ir_rule don't not cache _compute_domain
Following the revamp / contextualisation of multi company, the list of
allowed companies from the context is now used as part of the ir_rule
caching key.

Sadly that list is a list, and thus not hashable, meaning
_compute_domain was not cached anymore. Sadlier, type errors would be
silently ignored (just increasing the error counter of the cache stats).

Fix both issues:

* Store lists from the context as tuple. Technically could be a
frozenset but that might not always be the case so it doesn't feel
future-proof, a tuple might lead to slightly less hits but seems safer
* Log a proper warning in case of an ormcache TypeError (non-hashable
type used as cache key). It should never routinely happen.

closes odoo/odoo#34330

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-24 12:29:41 +00:00
Goffin Simon 3d27337f6d [FIX] account: correct communication when registering payment for multiple invoices
When registering a payment against multiple vendor bills and change the memo,
the memo must be populated to all the payments. This behavior has been introduced
with the following commit in stable 11.0: c04065abd8

opw:2024652

closes odoo/odoo#34322

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-24 11:29:08 +00:00
Jorge Pinna Puissant 49b949759f [FIX] crm: change team with the default one
Backport from 12.0 to 11.0 (commit: 3cbdfe8807)

- Have two crm teams with the same team leader, and without team members
(team1, team2 as instance).
- Create a new lead, add as Salesperson the team leader, and as Sales
team the second previously created team (team2).
- Save the new lead.

Before this commit, when we save the lead, the sales team will change,
to set the default sales team for the chosen Salesperson, in this case
team1.

opw-2005924

closes odoo/odoo#33898

closes odoo/odoo#34327

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-24 11:22:23 +00:00
qmo-odoo cd8afe8546 [IMP] website(_sale)_slides: Add login,join,buy button on quiz
This commit improves the elearning onboarding on the quizzes

If the user is not logged in, a log in button will show up under
the quiz

If he is logged in but not a member of the course and the course is public,
a join button will appear under the quiz

If the course needs to be bought, a buy button will appear under the quiz.

If the course is on invite only, a message under the quiz will inform the
user about it

TaskID: 2003986
PR: #33861

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-06-24 10:51:27 +00:00
sri-odoo d334313125 [FIX] website_profile: fix ranks' imgs alignment
task-2025167

closes odoo/odoo#34238

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-27 10:24:50 +00:00
Christophe Simonis 0862963877 [FIX] sale_mrp: adapt test to new version
Since 9df79f42d0, you cannot confirm MO
without raw moves.

Oversight of previous forward-port.
2019-06-24 10:58:32 +02:00
Odoo Translation Bot eaeb75a3fb [I18N] Update translation terms from Transifex 2019-06-23 06:15:20 +02:00