Commit Graph
127612 Commits
Author SHA1 Message Date
William Henrotin 108ee65af2 [IMP] mrp: block creating lot from workorder/produce wizard
When registering lot or serial number for a component in a workorder,
the manufacturer can create it on on the fly. We would like to give this
ability a restriction depending on the picking type.
This commit blocks the creating by default but leave the possibility to
tick a new checkbox on the manufacturing picking type to allow the
creation of lot and serial number for components inside the production process.

Task : 1891864
2019-04-04 11:12:29 +00:00
Thanh Dodeur f2d0995362 [FIX] mail: fixes document viewer's url preview
This commit fixes the document viewer: the document viewer
was altering the `type` key of attachment objects, this issue was causing
matching errors in some cases.

With this commit, the document viewer widget uses its own key `attachment.fileType`
to store the information that used to override `attachment.type`

closes odoo/odoo#32414

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-04-04 10:35:54 +00:00
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
Gert Pellin 6188a61de3 [FIX] hw_scale: Adam scale wait time
When opening the weight screen in PoS it can take up to 10 seconds
until the weighting starts. This can be resolved by using a
Threading.Event instead to reset the 10 second sleep time.

Using exit_flag.wait(timeout=DELAY) will be more responsive, because
you'll break out of the while loop instantly when exit_flag is set. With
time.sleep(timeout=DELAY), even after the event is set, you're going to wait around in
the time.sleep call until you've slept for DELAY seconds.

closes odoo/odoo#32389

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-04-04 08:58:41 +00:00
Moens Alexandre 40a650a089 [FIX]mail: detach non existing element
This commit fixes a js crash that occured when the user was trying to
edit a new record while the chatter was not completely loaded
(this.field.thread.$el was not in the dom yet)

Behavior before this fix:
Traceback js & impossible to edit the form afterward.

Behavior after this fix:
no traceback, still possible to edit the form normally.
The thread will display on next chatter re-render. Could be forced by
triggering an onchange.

opw-1986061

closes odoo/odoo#33381

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-05-22 06:47:37 +00:00
Romain Derie 90dec44a28 [FIX] website: restore the add of website_id on user at signup
Since b5a12b4aac the website_id was not set anymore.

Indeed, before this commit website_id was the field from the inherits, thus
when writing on website_id from res.user, we would write on the partner field.

But with b5a12b4aac the website_id was explicitely overrided on res.users as a
related to res.partner (its inherits) with readonly=True.

Thus, writting website_id on res.users was not working anymore.

closes odoo/odoo#33521

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-21 10:01:58 +00:00
Xavier Morel 7b00776c6c [FIX] doc: error & potential warnings
* properly handle 3-args version of odoo.define(): just ignore the
second argument, pretty much the only use-case is dynamic
dependencies (otherwise it should be using static require() calls)
so there's little the extractor can do
* fix an issue with sys.path ordering meaning sphinx would pick up an
odoo installed into the current virtualenv (editable or not) over
the local copy it's part of

closes odoo/odoo#33538

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-05-21 14:19:13 +00:00
Toufik Ben Jaa 72592750a7 [FIX] payment: do not shadow error traceback
- When validating payments on the payment process polling page
errors can occurs and the tracebacks aren't logged which doesn't help
when trying to understand the issues.

With this commit we display the traceback instead of shadowing them.

closes odoo/odoo#33537

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-21 14:16:25 +00:00
jev-odoo 6d88041260 [FIX]doc_howtos_backend: typo in classname
closes odoo/odoo#33518

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-05-21 09:46:59 +00:00
Sébastien Theys 51ef8514ea [FIX] product,sale,website_sale: compute combination possible in rpc
This has several advantages:
- make the code easier to maintain by having the logic only on the python model
- prevent price flickering when changing from/to an impossible combination
- fix the UI for the issue mentioned in the previous commit/the opw
- make the code much faster when using many combinations, by not requiring to
browse and to return every existing and every archived variants

The opportunity is also taken to properly throttle the rpc and to use
"DropMisordered" on its result:
- fix all the other remaining flickering when changing quantity or combination
- fix the server being spammed of rpc when using the configurator modal, but
also in a lot of other cases such as incrementing the quantity, ...
- fix UI consistency by ensuring the result of the last rpc is always the one
displayed, obsolete rpc returns are ignored

By computing the possibility of the combination asynchronously, the two
drawbacks are:
- the UI is a bit less reactive than in the previously the best case scenario,
but this almost completely mitigated by debouncing with a leading call
- it is possible for a quick user to click on "add to cart" on an impossible
combination before the return of the rpc, but this is not really an issue
because when the product will be added to cart there will a check and the
closest possible combination will be selected automatically instead

Finally the event of the configurator mixin and the widgets using it have been
cleaned to avoid the duplication of the rpc in the first place.

opw-1959317
PR: #32691

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-21 10:11:38 +00:00
Sébastien Theys 42cc64b5ce [FIX] product: fix possible combination with variant active + archive
Before this commit, if multiple variants exist for the same combination it would
consider the combination impossible if any of the variants was archived.

After this commit, it will consider the combination impossible only if all the
corresponding variants are archived.

opw-1959317
PR: #32691
2019-05-21 08:44:55 +00:00
Sébastien Theys e015ee5df3 [FIX] website_sale: fix infinite recursion from product configurator
When the configurator modal is shown on the shop page (when the add to cart
button customize show is enabled), changing the quantity would trigger an
infinite recursion before this commit, because the selector was not finding the
input on the page (because it is not there), but it was not restrictive enough
so it matched the input on the modal itself.

PR: #32691
2019-05-21 08:44:46 +00:00
Julien CastiauxandRaphël Collet be5f07c612 [FIX] calendar: Cannot create 'free' event with reminder
Install CRM (we need the "Hide Private Message" record rule defined by
that module), create a meeting as of today, set a reminder of one day,
invite another user (Demo) as attendee, save. Edit, go to the options,
change the "Show time as" to "free", save => access error due to the
said record rule.

The reminder is handled by the `get_next_potential_limit_alarm` method
of the `calendar.alarm_manager` model. It uses a raw SQL query to
perform its search. It returns a dictionary of the different events with
data attached. Due to the "Hide Private Message" record rule, some
records are not accessible.

Original (reverted) 9c4b52000 fix was replacing the `browse` by a `search`
in order to filter out non-accessible records. That fix was later fine
tuned by (not-merged) 7dd93809c to exclude calendar's virtual ids. The
real fix is to filter out records in the original result dict.

opw-1974599

closes odoo/odoo#33209

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


Co-authored-by: Raphël Collet <rco@odoo.com>
2019-05-15 11:41:21 +00:00
Priyanka Kakadiya 8ffedf4545 [FIX] sale: fix search issue in settings
Before this rev., we searched for 'label' tagname into the DOM, but
the fields labels are not always inside <label> (sometimes <span>).

However, they always have className 'o_form_label', so we use this
instead.

task 1961427

closes odoo/odoo#33487

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-21 07:34:26 +00:00
Nicolas Martinelli 92393a6b8e [FIX] purchase_stock: discount on invoice
- Create a product P
Costing Method: FIFO
Inventory Valuation: Perpetual (automated)
Price Difference Account set
- Create a PO with P, set a price of 100 (no tax).
- Receive the product

2 journal items are generated:

|                 Account |   Debit|  Credit|
|-------------------------|--------|--------|
| Stock Valuation         |   100.0|     0.0|
| Stock Interim (Received)|     0.0|   100.0|

- Create the corresponding invoice
- Change the:
Discount: 10
- Validate the invoice (for a total of 90.0)

2 journal items are generated:

|                 Account |   Debit|  Credit|
|-------------------------|--------|--------|
| Account Payable         |     0.0|    90.0|
| Stock Interim (Received)|    90.0|     0.0|

This is not correct, it should be:

|                 Account |   Debit|  Credit|
|-------------------------|--------|--------|
| Account Payable         |     0.0|    90.0|
| Difference Account      |     0.0|    10.0|
| Stock Interim (Received)|   100.0|     0.0|

This comes from the fact that the valuation price is compared to the
price unit without the discount.

opw-1974002

closes odoo/odoo#33296

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-14 08:19:20 +00:00
Nicolas Martinelli 4927d4c5ac [FIX] purchase_stock: change PU with discount on invoice
- Create a product P
  Costing Method: FIFO
  Inventory Valuation: Perpetual (automated)
  Price Difference Account set
- Create a PO with P, set a price of 110 (no tax).
- Receive the product

2 journal items are generated:

|                 Account |   Debit|  Credit|
|-------------------------|--------|--------|
| Stock Valuation         |   110.0|     0.0|
| Stock Interim (Received)|     0.0|   110.0|

- Create the corresponding invoice
- Change the:
  Unit Price: 100
  Discount: 10
- Validate the invoice (for a total of 90.0)

3 journal items are generated:

|                 Account |   Debit|  Credit|
|-------------------------|--------|--------|
| Account Payable         |     0.0|   100.0|
| Difference Account      |     0.0|    20.0|
| Stock Interim (Received)|   120.0|     0.0|

This is not correct: the Stock Interim (Received) should have a debit of
110.0, and the Account Payable credit should be 90.0.

This comes from the fact that the difference is subtracted from
`line['price_unit']`, which doesn't contain the discount.

We can use `price_val_dif` to update the price. Moreover, the
`price_unit` seems ultimately useless, since it is not used in:

https://github.com/odoo/odoo/blob/e11bacfe512a3170f44d6d43646af914a9cf3b73/addons/account/models/product.py#L63

We still update it for consistency.

Fixes #32911
Fixes #33201
opw-1974002
2019-05-14 08:19:20 +00:00
Nicolas Martinelli e526b6bba4 [FIX] purchase_stock: incorrect indentation
Incorrect indentation following forward-port.
2019-05-14 08:19:19 +00:00
Jigar Vaghela 3d755262e5 [ADD] l10n_mn: Add Mongolia Accounting
Basic Chart of Accounts and taxes for the Mongolian
accounting.  Tags for a lot of reports in Enterprise.

A lot of different taxes are created to be able
to represent them in the vat report. Mongolians
are used to taxes included even for B2B.

Some fiscal positions are added e.g. to automatically
apply 0% for export.

We got a lot of input from our Mongolian partner
Baskhuu Lodoikhuu and colleagues from BumanIT LLC

opw-1946238
Separate pr for 12.3
Closes #32830

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-05-14 08:07:03 +00:00
Jeremy Kersten 659ff0da13 [FIX] base: ignore context key in compute_display_name for res_partner
If you create a partner with a e.g. the key show_vat, it will be stored on
the partner while we would like to have this information only in the name_get.

After this commit, we will stop to save partner in our production database
with the vat number stored in the name because we create the partner (with vat)
from the invoice, where partner_id have a context with show_vat.

closes odoo/odoo#33492

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-20 13:52:20 +00:00
Adrian Torres 09af3fac39 [FIX] base: generate field translations based on index key
The ir_translation table has an index on the (name, lang, type and value)
key, however this index was not being used when generating field
translations because the column `type` was missing!

With this commit, we fully utilize the index when generating field
translations.

With the eCommerce with categories and 4k+ products, the time to charge
products per category would be around 4-5s; With this patch it is
reduced to 1-2s.

opw-1961665

closes odoo/odoo#33504

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-20 13:42:17 +00:00
Toufik Ben Jaa 3c305daded [FIX] payment: do not display postgres operational errors
- When processing payments on the payments processing page,
`psycopg2.OperationalError` can be raised.
We do not want those exceptions to be displayed to the customers,
instead we want the polling page to try to process the payments again.

This commit hides the display of psycopg2 operational errors.

- This commit also fixes the "processing your payments" message being
hidden after the first polling, no matter if the processing has succeeded or not.

closes odoo/odoo#33462

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-17 13:17:01 +00:00
Romain Derie c209c250d7 [FIX] website: prevent new website homepage to be '/-1'
Before this commit, the URL of the bootstraped homepage for a new website
could be '/-1' instead of '/'.

Indeed, creating a new website ends up calling `page.copy` which try to get an
unique URL for the website (to avoid duplicated URL after copy). Typically, the
copied page will have a suffix (-X).

But `get_unique_path` in charge of doing that is based on `get_current_website`
method which will/could return a wrong website (not the one we created).
For instance the one forced in session after using the website switcher or
creating a website or installing a theme.

As those website already have (most likely) a homepage '/', get_unique_path
will create the bootstraped homepage with '/-1' as URL.

Step to reproduce (among others):
- Create a new website in backend through res.settings screen
- Create another new website, it's homepage will be '/-1'.
- Repeat indefinitely, every two website created, the bug will appear.
(One out of two, the bug won't appear since it will try to get an unique URL
on the previously created website which only has '/-1' so '/' is assumed
unique)

closes odoo/odoo#33372

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-14 15:12:50 +00:00
Jorge Pinna Puissant 418babf7af [FIX] account: Invoice Analysis product quantity
To calculate the product quantity and the average price, two UOM are
used: The UOM of the product, and the UOM of the invoice line.

The UOM of the product it's mandatory in the product, but the product
itself it's not mandatory in the invoice. The UOM of the invoice line
it's not mandatory.

When either of the UOM is not filled, it gives as value NULL, and gives
'empty' as result of the calculation.

Now, we use the psql function COALESCE to return '1' when one of the UOM
is not filled.

closes odoo/odoo#33465

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-17 13:31:44 +00:00
Jorge Pinna Puissant d48da27e64 [FIX] account: Invoice Analysis total without sign
- Go to Accounting > Reports > Invoices
- Go to the pivot view
- Enable 'Total' and 'Untaxed Total' in the measures

The Total is wrong.

The sign of the total must be positive for the customer invoices and the
vendors refunds; and negative for the credit notes and the vendors bills.

Before this commit, the total of the credit notes and the vendors bills
weren't negative.

This occurs because the sign of the result of amount_total * invoice_type.sign
is different of the sign of amount_total_signed. Indeed amount_total is
the total amount without sign, and invoice_type.sign is used to change
the sign only for the vendors bills and the vendors refunds
(see https://github.com/odoo/odoo/blob/3cf9cfc985950c30c6b76480f77f5ffe53650b24/addons/account/report/account_invoice_report.py#L144).
Contrariwise amount_total_signed is the total amount signed : negative
for the credit notes and the vendors refunds.

Later on the calculation, the total amount is multiplied to
invoice_type.sign, to have the signs as expected
(see https://github.com/odoo/odoo/blob/3cf9cfc985950c30c6b76480f77f5ffe53650b24/addons/account/report/account_invoice_report.py#L118)

Fine tuning of this commit: 4218f3b

opw-1999175
2019-05-17 13:31:44 +00:00
Odoo Translation Bot b25fdb25b5 [I18N] Update translation terms from Transifex 2019-05-19 01:16:49 +02:00
Nans Lefebvre cf84108de8 [FIX] product: test image variants behaviour
Add some tests to ensure that basic image variant updates are correctly done.

opw 1974727

closes odoo/odoo#33249

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-17 12:41:04 +00:00
snd f4748c28f7 [FIX] product: correct bug where variants can't change image
When you import a variant or when you archive variants to only leave
one tied to the template, the image of the variant can't be changed.

If the variant has a picture and you archive all the other variants,
when you change the image on the variant, it's the template
image which is modified.

opw 1974727
2019-05-13 12:32:41 +00: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