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.
closesodoo/odoo#32428
Signed-off-by: Christophe Simonis <chs@odoo.com>
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>
The board created out of a tree view wasn't taking the default domain of
the view.
opw-1958349
closesodoo/odoo#32240
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
- 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
closesodoo/odoo#32415
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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#31549closesodoo/odoo#31876
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
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
closesodoo/odoo#32388
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
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.
closesodoo/odoo#32368
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#31655
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
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
closesodoo/odoo#32391
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
product_location was confusing, not correctly working and is now
replaced by a new feature to manage subcontracting correctly.
TaskID: 1915022
closesodoo/odoo#32390
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
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
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
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
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
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
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
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
closesodoo/odoo#32365
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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
closesodoo/odoo#32384
Signed-off-by: Christophe Matthieu <Gorash@users.noreply.github.com>
- when no workcenter or no production order, it should not provide option to create work order.
Related to Issue: 1957994
closesodoo/odoo#32411
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
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>
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>
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.
closesodoo/odoo#32363
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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.
closesodoo/odoo#32381
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
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.
closesodoo/odoo#32313
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
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 : 1938107closesodoo/odoo#31138
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
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).
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
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.
- 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
closesodoo/odoo#32328
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- 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
closesodoo/odoo#31965
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- 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
closesodoo/odoo#32239
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>