Commit Graph
109267 Commits
Author SHA1 Message Date
Yannick Tivisse fd089ee467 [IMP] base_import: Defer parent computation after record creation/update
Currently when importing files, the parent left and right are recomputed on each record creation/update, which could lead to a lot a request.

This commit will defer the parent field recomputation to the end on the `load` function by recomputing the values from the MPTT and inserting directly the new values on the records.

Tested on a customer instance, this will reduce the execution time when importing a thousand stock.location from 15 minutes to several seconds.
2017-08-14 15:02:52 +02:00
Christophe Simonis a2361e23ea [MERGE] forward port branch 10.0 up to 544aa9b04a 2017-08-10 15:45:07 +02:00
Christophe Simonis 544aa9b04a [MERGE] forward port branch saas-11 up to cfbac106b4 2017-08-10 15:00:33 +02:00
Christophe Simonis cfbac106b4 [MERGE] forward port branch 9.0 up to 1aed433f54 2017-08-10 14:58:24 +02:00
xmo-odoo d140f0ef0e [FIX] prefetch issues on computed/related fields (#18644)
When deciding to prefetch records (getting records from the cache with
no value for the field being fetched), if the field was computed
`determine_value` would just get all records, not limited by the normal
prefetch limit; for large recordsets this would generate gigantic
prefetch lists for records we may not need at all.

Fix by applying the `PREFETCH_MAX` limit to records from the cache as is
done in `_prefetch_field`.

Complementarily, when traversing related fields the prefetch
environment would be lost and every record would get an empty prefetch
environment, so the values would ultimately be read one by one.

Example: select (search) 1000 product.product records, access a
related field (e.g. categ_id) in a loop, on the first iteration the
system would first read 1000 templates, then it would read each
categ_id individually, resulting in >1000 SQL queries rather than the
~2 we would expect.

Fixes #18511
2017-08-10 14:51:27 +02:00
Nicolas Lempereur 354539942d [FIX] website_sale: no-cache IE11 cached cart XHR
IE11 seems to be always using cache when doin an XHR request with the
same GET request.

It can be changed in several ways:

- returning a header: "Cache-Control: no-cache"
- altering the GET request with a nonce
- using the POST method instead of GET

to solve it, in this change the HTTP header is added on the response.

opw-752270
closes #18787
2017-08-10 13:41:37 +02:00
Goffin Simon 1aed433f54 [FIX] website_event: Website Event Error when you encode a 0 value in the registration
The function registration_new must return a type json.

opw:765643
2017-08-10 09:27:05 +02:00
Nicolas Martinelli ac392096d8 [FIX] stock: recompute display name
The display name of a location should be recomputed when the name of the
parent location is changed.

opw-761463
2017-08-10 09:00:59 +02:00
Olivier Dony 08b75b7bcb [FIX] pad: do not crash during record creation
Backport of 0de067cae9
(and 9b8bc5e5a1)

Rev. c5bd509274 attempted to improve the
pad sync mechanism when merging records (tasks), but failed to consider
the case where the pad_url field is not set yet.
This happens at create(), due to the chicken-and-egg problem with the
pad URL depending on the record ID, and therefore set *after* creation.

Ignoring the sync when the URL is not yet set should be enough, as the
URL generation method also takes care of that first sync.
2017-08-09 18:51:16 +02:00
Christophe Simonis 80ac087d6e [MERGE] forward port branch 10.0 up to f69655829a 2017-08-09 15:53:37 +02:00
Christophe Simonis f69655829a [MERGE] forward port branch saas-11 up to acbcfa3703 2017-08-09 14:43:39 +02:00
Christophe Simonis acbcfa3703 [MERGE] forward port branch 9.0 up to baca743cc0 2017-08-09 14:14:44 +02:00
Christophe Simonis baca743cc0 [FIX] mail: force attachment type
Do not rely on default value. The context can contains a `default_type`
value intended for another model.
2017-08-09 14:06:13 +02:00
Christophe Simonis 6a767a8900 [MERGE] forward port branch 9.0 up to 3d119c44f3 2017-08-09 13:57:30 +02:00
Nicolas Martinelli 0c92b616e8 [FIX] website_sale: mandatory fields
All fields appears in bold (= mandatory) in the checkout form, while ony
some of them are.

opw-760328
2017-08-09 11:21:17 +02:00
Lucas Perais (lpe) 3d119c44f3 [FIX] point_of_sale: correct inheriting from pos_order_line being an issue
Before this commit, when creating a pos_order_line_pro_forma, which inherits from pos_order_line but in a different table, the create confused an overriden field (order_id)
When pos_blackbox was installed, pro forma lines would search for an pos_order instead of a pos_order_proforma upon their creation

This commit allows an inheritant of pos_order_line to use the super.create function

OPW 745685

Closes #18755
2017-08-09 11:09:35 +02:00
Jerther 64190abec5 [FIX] web: display full error message
Add missing parenthesis, fixes ebc23b5
2017-08-09 09:53:26 +02:00
Sylvain GARANCHER c29ac80c11 [FIX] product: Avoid browsing on product.product when using product.template
Steps to reproduce the bug:

On an empty database, install the sale module
-Activate product variants : Sales > Settings > Check Products can have
several attributes, defining variants (Example: size, color,...)
-Activate advanced pricelists : Sales > Settings > Check Advanced pricing based
on formulas (discounts, margins, rounding)
-Activate the developer mode
-Go to the product.templates list : Sales > Products
-Go to the debug menu > Edit TreeView and add the price field in the view
-Go to the debug menu > Edit Action and add the value 'uom': 1 in the context field
-Search for a pricelist : Type the name of an existing pricelist, then go to the pricelists
proposal, open the list of proposed pricelists, and select the pricelist

Bug:

The wrong value was sometimes displayed in the price field. To be more exact, the displayed
value for each product.template was the price of the product.product that has the same id.
If a product.template has an id which doesn't exist in the product_product table,
this product disapears from the list.

opw:762663
2017-08-09 09:13:50 +02:00
Sylvain GARANCHER 10f6e145dd [FIX] product: The pricelist variable must be a recordset, not a list
Steps to reproduce the bug:

-On an empty database, install the sale module
-Activate product variants : Sales > Settings > Check Products can have several attributes, defining variants (Example: size, color,...)
-Activate advanced pricelists : Sales > Settings > Check Advanced pricing based on formulas (discounts, margins, rounding)
-Activate the developer mode
-Go to the product.templates list : Sales > Products
-Go to the debug menu > Edit TreeView and add the price field in the view
-Search for a pricelist : Type the name of an existing pricelist, then go to the pricelists proposal,
open the list of proposed pricelists, and select the pricelist

Bug:

A traceback was raised.

opw:762663
2017-08-09 09:13:50 +02:00
Nicolas Martinelli 483a4fd8d7 [FIX] hr_expense: do not format total_amount
A `currency_id` field on a `hr.expense.sheet` only makes sense if all
expense lines are in the same currency. It is very likely to not be the
case, so don't format the total amount.

In master, the fild should simply be completely removed.

opw-761098
2017-08-08 18:14:46 +02:00
Goffin Simon a31820d0cb [FIX] account: Only 64 characters for the name of an entry
When creating a customer invoice with description/reference with more than
64 characters, the description was cut to generate the name of the account move
lines. But it's possible to create an entry with more than 64 characters as name
by the interface. The limitation is deprecated.

opw:760316
2017-08-08 15:54:41 +02:00
Lucas Perais (lpe) ea2568b19c [FIX] website_portal_sale: image on a portal SO should always be displayed
before this commit, when a portal SO was done with a product that hasn't been "website_published", a placeholder was displayed instead of the image
After this commit, the correct product image is displayed in base64 (always image_small though)

OPW 760880

Closes #18709
2017-08-08 10:35:08 +02:00
qdp-odoo 792a402126 [FIX] account: fix tax_ids computation on aml creation from invoice.
In case of a tax affecting subsequent taxes, the tax_ids field was wrongly set which led to errors in VAT reports. OPW 757072.
2017-08-08 10:29:57 +02:00
Christophe Simonis a6917c22b3 [MERGE] forward port branch 9.0 up to af7eb04fc7 2017-08-07 17:56:45 +02:00
Lucas Perais (lpe) 3cd4672272 [FIX] account_asset: on invoice from po select right account
before this commit, when a product had its asset_category set, the account attachement to the asset_categ was righfully selected on the invoice line when creating the invoice from scratch
Though, that was not the case when the invoice was created from the po

after this commit the right symmetric behavior is back: the default account that will be selected on invoice line is the asset_category one.

opw 761033

Closes #18687
2017-08-07 13:54:29 +02:00
Lucas Perais (lpe) 78014ff3ac [FIX] website_event, _sale: protect against inactive products
Commit 14d1f6f6c1 responded to the need to have clean server answers for SEO purposes
and specifically when the products on event tickets have been archived
BUT
it introduced an infinite redirect loop when the event was in state == done

This present commit normalize the behavior in a comprehensive manner and cleans up the code a bit

OPW 757117

Closes #18667
2017-08-07 09:51:15 +02:00
Odoo Translation Bot b5ce70e70e [I18N] Update translation terms from Transifex 2017-08-06 04:40:09 +02:00
Odoo Translation Bot af7eb04fc7 [I18N] Update translation terms from Transifex 2017-08-06 00:32:12 +02:00
Jairo Llopis e43d73c35a [FIX] base: preserve context when cancelling module install
Closes #18597
2017-08-04 14:47:45 +02:00
Lucas Perais (lpe) 2cd63aa2dc [FIX] account: reconciliation of payments and invoices, diff currencies and times
Use case:
- 2 invoices in foreign currencies, made at different times (and different exchange rates)
- 2 payments (same characteristics as invoices)
- allocate the 1st payment to inv A
- allocate the 2nd payment to inv A and then B so that A is fully paid, but B is not
- try to make the final payment on B to fully reconcile everything

Results (all in the payable account)
- let CB be the credit line of B
- let D2 be the debit line of 2nd payment
- let D3 be the debit line of the 3rd and final payment

Before this commit, the exchange difference computation dailed because:
- There were 2 amls that had an amount_residual and needed to be reconciled (CB and D2)
- Also, there was a structural flaw in the code that did not allow for multiple lines to have a residual

After this commit, we still make 1 move to log the exchange difference,
but we make exchange difference lines for each line that need to be reconciled: CB and D2

OPW 751710
Commit in master c36f70f6726e0c7ccca1002f78e4d402e27cae3d (2017-07-20)

Closes #18347

[FIX] account: testing partial and full reconciliation
2017-08-04 09:45:31 +02:00
Nicolas Martinelli 7cd2f63705 [FIX] *: cancel settings
To reproduce:
- Go Website Admin > Configuration > Settings
- Change the Website Name
- Click on 'Cancel'

The name is saved.

When the "Cancel" button is clicked, we automatically save the record
(which is a transient model). Since the field is a related to the
company, the name is changed even if we canceled.

opw-760749
2017-08-04 08:25:33 +02:00
Martin Trigaux 54e4e3156f [FIX] point_of_sale: actually test the flow
Introduced at bb5fd86f
The test checked that the invoice amount was the same as the order amount
2017-08-03 15:57:36 +02:00
Nicolas Martinelli ecda057e11 [FIX] payment_stripe: integer currencies
Complement of commit b335ae0348

opw-760707
2017-08-03 11:05:16 +02:00
Timo Talvitie 1be57f2825 [CLA] Corporate CLA for Vizucom Oy
Done at #18591
2017-08-03 11:04:05 +02:00
Fabien Meghazi 2c0f6f39d7 [IMP] http: improve dumpstacks and remaining requests handling during tests (#18640)
This patch modifies Root#dispatch() in order to keep the httprequest url
in the current thread's attribute and use if for dumpstacks and the
phantomjs tests remaining requests handling.

Also added a counter in order to avoid looping forever when trying to join unclosed http requests
in phantomjs test suite after a phantomjs failure + added a log.warning in such a case so it's easier to troubleshoot runbot's ir.logging.
2017-08-03 10:50:18 +02:00
Lucas Perais (lpe) ef39b3d9e4 [FIX] account: bank_statement: journal accounts not required in reconciliation widget
Use case: click on "reconcile X items" on a journal which doesn't have its default credit or debit account set.
Result: Before this commit, a useless traceback popped to the user.
After this commit, move lines are searched without taking into account the journal's default accounts for debit or credit

OPW 760305

Closes #18485
2017-08-03 09:54:47 +02:00
Lucas Perais (lpe) ac3bfee8f3 [FIX] website: fix html editor view to be edited
Before this commit, the view selected to be edited by the html editor was the wrong one
This was caused by the simplification brought about by commit a2ae219d4e
which transfered from python to js the decision to make a view a header for the [customize] menu (on the website
In this case, the first view in the return list of python was the header, and the second the actual view

Now that python just sends a list of unique views without any distinction whatsoever, the right view to pick when entering the html editor is the first one, at index 0

opw 760279

Closes #18603
2017-08-03 09:36:01 +02:00
oco-odoo 7ac19968f7 [FIX] stock_account: currency comparison on invoices (#18655)
In anglosaxon accounting's stock valuation, the case where invoice and company currencies are different was not managed properly, because of a syntactic error in the condition checking this case.

(this has already been merged on saas-14, but the PR should have initially been made for 10.0 ... my mistake ! See https://github.com/odoo/odoo/pull/17259 )
2017-08-03 09:34:42 +02:00
Lucas Perais (lpe) 8749410b10 [FIX] website: correctly renders iframe for videos
Before this commit, the iframe tags were sanitized as the should, but never spawn back from JS.
Now, the iframe is actually created

opw 750830

Closes #18643
2017-08-03 09:29:14 +02:00
Goffin Simon 89360f9d9b [FIX] product: Two product.price.history created for one variant
When a unique variant was created from a product template with function create_variant_ids,
two product price history were created:

-One was created from function create on product.product
-The other one was created from function _set_standard_price on
product.template

The first product.price.history created in this situation was all the time
set to 0 and it lead to some problems in the report inventory date.
This first product.price.history doesn't have to be created.

opw:747857
2017-08-02 16:42:26 +02:00
Benjamin Willig f32b8acb2c [FIX] account: performance on manual reconciliation
Avoid reconciled move lines selection during manual reconciliation

Closes #18435
opw-756956
2017-08-02 15:51:47 +02:00
Nicolas Martinelli ce8c3af3a9 [FIX] base: default company on rate
- Activate multi-company
- Company B is parent of Company A
- Admin is in Company A
- Demo is in Company B
- Create a rate with Demo

The rate is recorded on Company A, not Company B as expected.

This is because we call: `self.env.user._get_company()` which would be
equivalent to `self.env.user.env.user.company_id`. Since the user is
browsed as `sudo`, it returns the company of the Admin.

opw-753139
2017-08-02 14:04:35 +02:00
Nicolas Martinelli b335ae0348 [FIX] payment_stripe: integer currencies
The currencies with zero decimal should not be multiplied by 100. See
https://stripe.com/docs/currencies#zero-decimal

opw-760707
2017-08-02 11:02:36 +02:00
Goffin Simon d28e410d36 [FIX] hr_expense: adding new line on an approved expense report
When an expense report is confirmed, it's not possible to add a new
line.

opw:755969
2017-08-02 10:11:39 +02:00
Christophe Simonis d0ece6cd89 [MERGE] forward port branch 10.0 up to afd4b68acc 2017-08-01 23:06:43 +02:00
Christophe Simonis afd4b68acc [FIX] website_crm_partner_assign: mock geolocalisation during tests 2017-08-01 22:39:29 +02:00
Christophe Simonis d1cf4f9672 [MERGE] forward port branch saas-11 up to ed36929265 2017-08-01 22:39:16 +02:00
Christophe Simonis ed36929265 [FIX] core: avoid tests to contact gravatar server 2017-08-01 22:03:39 +02:00
Nicolas Martinelli 4f5b0463ae [FIX] mrp: cost report
The unit price on the cost report should not be rounded using the
product UoM.

opw-760299
2017-08-01 18:18:51 +02:00
Christophe Simonis af9868bc28 [MERGE] forward port branch 10.0 up to e6ad245634 2017-08-01 17:22:43 +02:00