Commit Graph
126256 Commits
Author SHA1 Message Date
Christophe Simonis d29e8cf423 [MERGE] forward port branch 12.0 up to 7e4b0350c3 2019-04-04 19:01:12 +02:00
Xavier Morel 7e4b0350c3 [FIX] core: handle multi level o2m in SSF
Technically it does 3 different things:

* switch from 1 level of o2m to 2 levels of o2m when recursing
* handles `parent.<xxx>` readonly modifiers on o2m subfields
* handles `id` readonly modifiers on o2m subfields (already worked in the
  normal case but not for o2m records from default_get)

The last two especially are temporary quickfixes, that will need proper fixes.

closes odoo/odoo#32428

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-04 14:20:51 +00:00
Nicolas Lempereur 95c9227cb3 [FIX] payment_authorize: >1m partner ok transaction
When creating a customer profile in Authorize.Net we specify a field
merchantCustomerId that is composed of:

  ODOO-{partner-id}-{8-random-characters}

But the limit of this field is of 20 characters:

https://developer.authorize.net/api/reference/index.html#payment-transactions

So if we have 1 million partner, we may have eg. a partner 1000005 that
would result in an ID `ODOO-1000005-af123c5b` that is too long and
results in an error.

With this changeset, the generated ID is truncated to 20 characters so
this should theorically be alright for up to 9.99*10^15 partners (the
postgres limit for an integer is 2.15*10^9 so this should be safe
enough).

opw-1962422
closes #32423

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-04 12:46:00 +00:00
Christophe Simonis dea85bcb1c [FIX] stock_account: adapt new test to new version
Oversight of previous forward-port.
2019-04-04 14:27:59 +02:00
Christophe Simonis ab0babf3e9 [FIX] purchase_stock: move code at the right place
Oversight of previous forward-port.
2019-04-04 13:43:20 +02:00
qsm-odoo 60592561d7 [FIX] web_editor: support youtube-nocookie.com
closes odoo/odoo#32332

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-04-04 09:21:09 +00:00
Christophe Simonis d32420397d [MERGE] forward port branch 12.0 up to 251021796c 2019-04-04 11:20:03 +02:00
Julien Castiaux fde76dd9b8 [FIX] board: action domain
The board created out of a tree view wasn't taking the default domain of
the view.

opw-1958349

closes odoo/odoo#32240

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-04 08:29:08 +00:00
Priyanka Kakadiya 2a7a6c096e [FIX] purchase: do not set currency_id to false
- currently, cuurency_id has default value as currency of user's company id. but, when there is no partner set then 'onchange_partner_id' will trigger and set currency_id to false.
- so, set user's currency_id instead of false if no partner set.

Related to Issue: 1948645

closes odoo/odoo#32415

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-04 10:30:55 +00:00
Robot Odoo 251021796c [FIX] base, base_address_extended: optimisation of partners import
If bulk-importing clients with a parent_id set, there's a ton of extra /
post-processing work which is not batched and "de-optimises" the
batching added to import.

High-level comparison of performing a "Test Import" on a synthetic test
file of 10000 partners (all with a parent_id set to a pre-existing
record) went from ~30mn to ~8mn on my machine.

Fixes #31549

closes odoo/odoo#31876

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-04-04 09:28:12 +02:00
Goffin Simon 94d15e037c [FIX] account_set: Wrong recomputation of the depreciation lines
When a asset is confirmed, it's not allowed to link it to an invoice.
Side effect, it recomputed the depreciation lines of the confirmed asset.

opw:1961468

closes odoo/odoo#32388

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-04 07:02:53 +00:00
Christophe Simonis 27ea18a21b [FIX] website_sale: correctly convert currency
Oversight of previous forward-port.
2019-04-03 20:27:50 +02:00
Christophe Simonis f36175dd8f [MERGE] forward port branch saas-11.3 up to b3d4c2d178 2019-04-03 18:46:36 +02:00
Lucas Perais (lpe) bf0bb534bf [FIX] base: Arabic generic World locale is ar_001
Before this commit, the "unitag" notation "xx_AA" was used for arabic generic locale
Since it is not an official Unicode CLDR notation, some other modules
may, and did crash (babel)

Instead, we prefer to use Unicode CLDR compliance
i.e. World regions should be "_001"

http://www.unicode.org/reports/tr35/#unicode_region_subtag
http://www.unicode.org/reports/tr35/#unicode_region_subtag_validity
BCP47: https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry

This commit should invalidate the commit made by #32344
which was a hack for stable versions

It should also be taken into account in migration scripts

closes odoo/odoo#32393

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-04-03 14:24:34 +00:00
Aurélien Warnon eec46c4774 [FIX] (website)_sale: fix p. configurator related tours
Task#1963335

Now that the product configurator has its own module, the tour
"tour_shop_custom_attribute_value" needs to be split in two parts
to handle the optional products.

The "sale_tour" also needed to be adapted to handle the fact that
the product input can also be a product_template input.

The "shop_buy_product" had its 'add_to_cart' step changed to handle
possible optional products window.

closes odoo/odoo#32368

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-04 08:47:37 +00:00
wan 01d0523fd7 [IMP] account, account_facturex: import customer invoices in XML
Task 1942983

Accounting firms need to upload PDF of customer invoices and refunds (not only vendor bills). For that, we now allow to
* define a mail alias on sale journals
* upload customer invoices from list view
* check for `facture X` XML attachments in PDF of customer invoices

closes odoo/odoo#31655

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-04 07:30:43 +00:00
Lucas Perais (lpe) 0e85b5b132 [FIX] odoo: patch babel for "World" language territory
Following c844d66091
where generic Arabic (World) is coded ar_AA
but babel doesn't support this

Instead, babel understands xx_001 for World generic languages

http://www.unicode.org/reports/tr35/#unicode_region_subtag
http://www.unicode.org/reports/tr35/#unicode_region_subtag_validity
BCP47: https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry

OPW 1961396

closes odoo/odoo#32344

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-04-03 14:03:00 +00:00
jem-odoo e24a16858d [FIX] sale_timesheet: include correct empty lines in overview
When confirming a second SO, with its project set as the project of a previous SO (so they
can share the same project, and all their task created end up in the same project), we want
to see the sales line without timesheet on the table of the project overview.
Before this commit, it only takes the empty lines of the origin sales order, not the ones from
the second. This commit fixes that by including 2nd SO's service lines in the empty lines to
display.

Task-1915660

closes odoo/odoo#32391

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-04-03 13:55:39 +00:00
Antoine Prieels b28d14bf08 [REM] mrp: product location on routing
product_location was confusing, not correctly working and is now
replaced by a new feature to manage subcontracting correctly.

TaskID: 1915022

closes odoo/odoo#32390

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-03 13:53:52 +00:00
Arnaud Baes dc7c4ef52a [FIX] stock: move_ids_without_package locations
Since the package level task, most time it is not move_lines which is
displayed in the form view but move_ids_without_package. We apply the
weird write override to this field too, and we'll apply the comment in
the code (change this override by a proper onchange) someday in the
future.

Task 1831382
2019-04-03 13:53:52 +00:00
Arnaud Baes 46f2628ee3 [FIX] mrp: hide order when its picking type is archived
We may want do disable a picking type. In this case, we don't want the
linked manufacturing orders to appear on the main view of the
manufacturing orders (not through the inventory dashboards but through
the "manufacturing orders" menu item).

Task 1831382
2019-04-03 13:53:52 +00:00
Simon Lejeune e1a29b83be [ADD] purchase_mrp_subcontracting
With this module we can now add the price of the subcontracting on the
subcontracted move by using the `extra_cost` field on the MO and the
unit price of the PO.

We also enhance the view of the supplier info to display a checkbox if
the linked partner is a subcontractr, for clarity sake.

Joint work with: Arnaud Baes <arb@odoo.com>

task 1831382
2019-04-03 13:53:52 +00:00
Simon Lejeune d91db5bde6 [ADD] mrp_subcontracting
In a few words, it allows to send components to a subcontractor partner
and receive a finished product. The production is managed through classical
manufacturing orders where the raw and finished location is the
subcontracting location. When creating a receipt picking for a
subcontractor partner, the location_id of the moves will be set to the
subcontracting locations by using the property_stock_customer and
property_stock_supplier of the partner. An override of _action_confirm
will create the manufacturing order.

When a subcontracted bom contains tracking, the produce wizard is
available from the picking to record which lots were produced/consumed.

New type on the BoM: subcontract
New type on res.partner: subcontactor
New location per company (we still own the components stored at the
subcontractor so they're still valued)
New routes created to resupply the subcontracting location on order or
not (through a reordering rule).
Override of res.partner to set the property_stock_customer/supplier on
subcontactor partners.

Proper tests were added too.

Joint work with: Arnaud Baes <arb@odoo.com>

task 1831382
2019-04-03 13:52:22 +00:00
Simon Lejeune 928e3e0a0b [REF] mrp: extract _bom_find for reusability
In the subcontracting. we want an extension of the BoM lookup handling
the subcontractor_ids field we'll add. So this is a preliminary work.

task 1831382
2019-04-03 13:51:05 +00:00
Simon Lejeune 5978dcc641 [REF] stock: locations per company creations
Extract on an helper so that other modules can add a new location per
company without the creation of the default warehouse.

task 1831382
2019-04-03 13:51:05 +00:00
Simon Lejeune 028544e32e [FIX] stock: routes/rules generation
Joint work with Arnold Moyaux <arm@odoo.com>

task 1831382
2019-04-03 13:51:05 +00:00
Simon Lejeune e972d25400 [REF] mrp_account: add an extra_cost notion on the manufacturing order
This is a preliminary work to handle the price of subcontracting. We put
this field in the generic `mrp_account` module because we also want to
support adding an extra cost on a finished move without having to work
with the wokorders, on a future task.

task 1831382
2019-04-03 13:51:05 +00:00
Arnaud Baes 1019ceee6e [MOV] mrp_account
The module is moved from the enterprise repository as it
was *without* the bom cost report.

task 1831382
2019-04-03 13:51:05 +00:00
Lucas Perais (lpe) 491deeb3d4 [FIX] account, account_check_printing: print all reconciled invoice on a payment
Make some invoices
Make a payment
Reconcile it with the invoices through the reconciliation widget
Print the payment receipt and the checks

Before this commit, neither the payment receipt nor the checks contained
the invoices
This was because the prints relied on only the field invoice_ids
filled specifically when registering a payment on an invoice

After this commit, the prints mention the invoices

OPW 1947002

closes odoo/odoo#32365

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-03 13:24:59 +00:00
Martin Geubelle f391b8c5a5 [FIX] web_editor: restore ace style
The recent refactoring odoo/odoo@f296992 wrongly moved the ace editor
style from `web_editor` to `website`, even though ace is in `«eb_editor`.

The editor is also used in Studio (which does not depend on website) so
the style was missing in this case.

Task 1951290

closes odoo/odoo#32384

Signed-off-by: Christophe Matthieu <Gorash@users.noreply.github.com>
2019-04-03 12:46:57 +00:00
Priyanka Kakadiya 987bdf46fc [FIX] mrp: remove workorder creation from gantt
- when no workcenter or no production order, it should not provide option to create work order.

Related to Issue: 1957994

closes odoo/odoo#32411

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-04 09:48:02 +00:00
Nicolas Lempereur e14c386a19 [FIX] point_of_sale: allow connect proxy https error
Since 79af654fc61 if we had unexpected configuration of usage such as
being in HTTPS, having a POS hardware in HTTPS but an error is received
(eg. the device is closed) => the POS interface can't be opened being
blocked on an error:

 Https connection to IoT Box failed
 Make sure you are using IoT Box v18.10 or higher.

 Navigate to {proxy_ip} to accept the certificate of your IoT Box.

With this changeset, we have a popup that does not prevent to open the
point of sale interface (and  the red disconnected status in the top
left allow to retry connection as before) on first load.

opw-1934413
closes #32306

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-03 10:39:37 +00:00
Nicolas Lempereur 0539dde576 [FIX] point_of_sale: background layout header iframe
When a report with header is displayed in iframe with layout
"Background", part of the header maybe outside of the page.

For example on /my/invoices portal show of an invoice, the max width
report iframe can set at 210mm (+/- 793.7px normally), the header in
background layout has `min-width: 900px` so is wrongly centered and may
have content outside of shown page (eg. company tagline).

The same issue happen when using HTML rendering of the report in
backend, but depends on the viewport width.

This may be the expected configuration when printing (wkhtmltopdf should
unzoom if something was too large to fit) but not when displaying html
directly.

opw-1915807
closes #32373

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-03 10:05:53 +00:00
Aurélien Warnon b3490fba44 [FIX] product: fix product template's _name_search
Task#1963256

Some fixes for the product configurator recently introduced a bug
in the product template's _name_search method.
Commit: 99bae2cdb7

This commit correctly handles the fact that the "limit" parameter
can be None.

closes odoo/odoo#32363

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-03 08:05:28 +00:00
Christophe Simonis b3d4c2d178 [FIX] account: IndentationError
Oversight of previous forward-port.
2019-04-02 17:44:36 +02:00
wan 7146a4b23b [IMP] account,pos: better distinction between customer payments
Task 1934667

1. That's the partner type (and not the payment type) that should define if a payment is a customer or a supplier payment :
a. When the partner type on the payment is "customer", the payment should be considered as a customer payment
(and thus be visible from the menu customer payments)
b. When the partner type on the payment is "supplier", the payment should be considered as a supplier payment
(and thus be visible from the menu supplier payments)

2. The PoS should only create customer payments (you never pay suppliers through the PoS)
The payment created should be with a partner type "Customer"
But the partner field can stay empty if the customer wasn't set on the PoS Order

3. When I change the payment type while creating a payment from scratch, it shouldn't change the partner type
Example : I'm creating a payment for a reimbursement, I'll create it from the customer payments menu (as I'm paying a customer), I'll tick the payment type "Send money"
I don't expect the partner type to change to vendor.

closes odoo/odoo#32381

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-02 14:45:04 +00:00
Christophe Monniez 3f3763148a [REL] saas-12.3 2019-04-02 21:21:32 +02:00
Xavier-Do b5c2004160 [IMP] core: avoid to check access rules on empty recordset
Checking access rules only makes sence if we have some records,
_filter_access_rules will always return a subset or current
recordset, and a subset or a empty recordset is an empty recordset.

closes odoo/odoo#32313

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-02 15:39:30 +00:00
Jinal Patel edef08eeee [IMP] stock: assign someone to picking
purpose is allow to assign picking to users
- add field responsible on the picking that allows to select a user
- Now we assign responsible to several picking at once
- add default filter 'My Transfers' and 'Unassigned Transfers'

Related task : 1938107

closes odoo/odoo#31138

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-02 14:41:19 +00:00
Christophe Simonis 1122b62d00 [MERGE] forward port branch 11.0 up to 4df568549a 2019-04-02 16:35:17 +02:00
Christophe Simonis 4df568549a [MERGE] forward port branch saas-15 up to 180f105508 2019-04-02 13:58:03 +02:00
Christophe Simonis 180f105508 [MERGE] forward port branch saas-14 up to d158a8ffbf 2019-04-02 12:34:15 +02:00
Christophe Simonis d158a8ffbf [MERGE] forward port branch 10.0 up to 2d30bd9698 2019-04-02 12:28:19 +02:00
Xavier Morel 6c2b54ff9c [IMP] base_address_partner: optimise transfer betwen parent and child
Mostly a concern during bulk import of partners with parents.

First remove syncing extended fields, that seems completely
unnecessary since the street gets sync'd and will get split through the
normal process (updating the sub-fields), by also syncing the split
fields we're redundantly calling _set_steet and rewriting the address
we just sync'd.

Second if write()ing both the country and street, the override would
then go and re-write the street based on what had *just* been split
into sub-street fields, which could waste a lot of time during the
import post-process as address fields get moved back and forth between
parents and children leading to *lots* of writing both country and
address together, we're talking:

 ncalls  tottime  percall  cumtime  percall filename:lineno(function)
10002/2    0.111    0.000  344.390  172.195 res_partner.py:181(write)
[...]
      2    0.455    0.228  165.264   82.632 base_address_extended.py:41(_set_street)

My initial instinct was to just add the country_id to _set_street and
remove the write override but it would break
88ff6beb01: if the country alone is
updated on a partner, we do want to re-format the "unified" address
based on individual fields and the new country's format.

Note: it might be that the logic would be more sensible by inversing
the entire thing, such that the split fields are the proper
source (regular stored fields) and street is converted to a computed
field instead, but that'd be a larger model change. Seems like it'd
make more sense though, at least given what the modules attempts to
do (OTOH the module probably fails
https://www.mjt.me.uk/posts/falsehoods-programmers-believe-about-addresses/
in just about all the ways).
2019-04-02 09:57:49 +00:00
Xavier Morel b4ae543098 [IMP] base: batching of _compute_commercial_partner
Should correctly handle / fallback to regular code when processing
non-stored partners.

Perf difference according to cprofile on my machine:

original python:
ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1    0.134    0.134  205.380  205.380 res_partner.py:277(_compute_commercial_partner)
SQLized
     1    0.118    0.118   67.239   67.239 res_partner.py:280(_compute_commercial_partner)

most of the time leftover seems to be in modified_draft
2019-04-02 09:57:49 +00:00
Xavier Morel 1fb20fe304 [IMP] base: try to batch update of children address & commercial fields
With profiling enabled, importing 10k partners, with all of them
having the same parent (though not with all of them having the same
is_company setting) lowers sync / post-process time from ~550s to
~330s.

Put it in an override to _load_records_create so it's only active for
imports (which is the original report & test case), use a context key
to avoid going the post-processing work in create.
2019-04-02 09:57:49 +00:00
Nicolas Martinelli 9f2dd49c57 [FIX] product, purchase: seller in multi-company
- Create 2 companies A & B
- For a product P, create a supplier info for each company using the
  same partner, with a different price and delay.
- Order the supplier so that the one for A has a higher priority than
  the one for B.
- Create a reordering rule for P in company B.
- Run the scheduler as admin (e.g. thanks to the cron).

The price taken is the price for company A instead of B.

`_select_seller` is not company-aware, therefore the first matching
supplier is chosen.

opw-1959263

closes odoo/odoo#32328

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-02 08:33:15 +00:00
Jigar Vaghela 9fc21c9b61 [FIX] l10n_pl: incorrect command
The `(6,0,[*])` command is missing from `vs_kraj_7`.

closes odoo/odoo#32358

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-03 06:05:50 +00:00
Nicolas Martinelli 180866fe1e [FIX] website_sale: discount
- Go to Sales > Configuration > Settings
- Enable "Multiple Sales Prices per Product" and select option "Prices
  computed from formulas (discounts, margins, roundings)"
- Go to Sales > Catalog / Pricelists
- Select "Public Pricelist" and set "Discount Policy: Show public price
  & discount to the customer"
- Go to the eCommerce, buy "iPad Retina Display" which as a 20 %
  discount

In the corresponding SO, the discount appears to be zero, and the
discount is included in the price unit. However, adding the product
directly to the SO in the backend displays the discount as expected.

There should not be a difference in behavior between the eCommerce and
the backend.

Fixes #31337
opw-1943989

closes odoo/odoo#31965

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-02 07:43:06 +00:00
Nicolas Martinelli 1fc0b08e14 [FIX] account: partners not shared
- Activate multi-company, but do not share contact book.
- Create 2 companies A & B
- Create a partner named 'PartnerA' in company A
- Switch to company B
- Import a bank statement with partner name set as 'PartnerA' (use the
  bank statement template if necessary)
- Reconcile the entries

An `AccessError` is raised.

The partner suggestion doesn't take into account the record rules,
therefore it might happen that the user doesn't have access to it.

opw-1958711

closes odoo/odoo#32239

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-02 07:40:58 +00:00