Before this commit, 'last_session' inaccurately returned the newest
session, which was incorrect as the first session technically has no
preceding session. This update ensures that `last_session` does not
return any session when it is the first instance.
opw-3302489
closesodoo/odoo#128516
X-original-commit: d676f60af8f2ef45ed26e80f34bd4244f6f8157f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
A recent discovery has led us to understand that actual HTTP requests to external services are performed even during non-external tests (even during at-install tests in fact).
This PR puts a stop to that, by installing a requests mock which results in a ConnectionError for any request to an other host than localhost / 127.0.0.1. May add richer routing support in the future, but currently the easiest way to handle is to override `_request_handler` and return custom responses as needed when matching expected endpoints.
Issues found so far:
- `/link_tracker:TestMailRenderMixin` performs requests to all sorts of domains real and fake during testing, originally fixed in #128249 but re-fixed more generically here (the link tracker handles connection failure gracefully).
- `partner_autocomplete` tests cause a request to clearbit to resolve the logo of the mock partner, failure is handled silently so nothing more is needed, this probably occurs in a few more locations (I didn't check every single log).
- `/mass_mailing:TestMailingControllers.test_tracking_short_code` creates shortlinks to example.com, then opens the shortlink. While the shortlink is local, it redirects to an external site and the test is not happy when that fails. Intercept requests to that endpoint and returns successes.
- `/website_sale:TestProductPictureController.test_resequence_images` touches the video_url of a product, which causes a call to `get_video_thumbnail`, which did handle (ignore) non-200 responses but not complete request failure. Add support for that (ignore `RequestException`).
closesodoo/odoo#128497
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Error responses are already ignored, but connection errors would blow
up the entire thing, which breaks `test_resequence_images` (and
possibly others).
Part-of: odoo/odoo#128497
Non-external tests should not be performing requests to external
websites or services.
Add a mock to handle such requests:
- if the test is not tagged external
- and the request is not to localhost
- and the request is not to `file:` (it's possible to install a
FileAdapter in a session to resolve file URLs)
- raise a connection error (and log, both with some details of the
blocked request for debugging)
The mock is layered on the lowest possible level (`Session.send`), so
tests can either:
- reconfigure the mock to handle cases differently (the mock is
re-created on every test)
- layer their own mock at a higher level of the library
Eventually we might also built-in a routing / dispatch mechanism so
it's easier to declare external services you want to mock, somewhat
similar to what's available client-side.
Whitelist `file:` because e.g. zeep performs `file:` request, using a
bespoke adapter installed in its session.
Part-of: odoo/odoo#128497
Steps to reproduce the bug:
- Create a storable product “P1” with BoM:
- Component: "C1", cost: $100
- Create a Manufacturing Order to produce 1 unit of "P1":
- Set any analytic account
- Confirm and validate the MO
- An analytic account line is created for $100 of C1.
- Change the quantity of the component to 0.
- Try to save
Problem:
A traceback is triggered, because the `amount` and `unit_amount`
variables are used without assignment.
Solution:
Assign “0” value to both variable in the beginning of the function,
therefore the analytic account line will be deleted.
opw-3257240
closesodoo/odoo#128495
X-original-commit: 513e3dea2c838bb6f805c567069ea39406c6634e
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Steps to reproduce
==================
- Create and confirm MO with BOM1
- Consume the theoretical qty of your MO
- Update the BOM1
- Click on the `Produce All` button
- You will receive a message that the consumed quantity does not match the quantity
of the BOM1 anymore
- When clicking on the set quantities and validate button, the consume
quantities are not the ones that are previewed in the flexible consumption message,
but the initial MO quantities.
So in this commit, we updated the `To Consume` quantities as per the flexible
consumption wizard.
task - 3323154
closesodoo/odoo#128488
X-original-commit: fe95a33770c8b701b007310e2b9b5f7b0596f5a9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Steps to reproduce the bug:
- Connect with a company using USD currency.
- Create a storable product "P1":
- Cost: $100
- Create a Purchase order:
- Add 1 unit of "P1"
- Currency: USD
- Create another Purchase order:
- Add 1 unit of "P1"
- Currency: EUR
- Go to the purchase analysis and select the list view.
Problem:
The purchase order in EUR is converted into the current company
currency, but the Euro currency symbol is used instead of the dollar
symbol
opw-3354221
opw-3348265
closesodoo/odoo#128479
X-original-commit: ad05cea889cb632946abceeb5c0db36b73a18afc
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Current behaviour:
When searching in `All Tasks` for tasks whos user is archived, no
results are returned.
Expected behaviour:
You should be able to see tasks of users that are possibly archived.
Steps to reproduce:
- Install Project
- Archive the user and contact Marc Demo
- Go to Project > All tasks
- Search for assignees "demo".
- No results
Reason for the problem:
The `user_ids` definition in the task is:
```xml
<field name="user_ids"
filter_domain="[('user_ids', 'ilike', self), ('user_ids.active', 'in', [True, False])]"/>
```
But there is no context of the `active_test=False` on the view. So
the ORM for the `filter_domain` generates a query which contains 2
relevant `EXISTS` clauses, and for the leaf `('user_ids', 'ilike',
self)`, the generated `WHERE` clause is
```sql
("res_users"."active" = TRUE) AND ("res_users__partner_id"."name"::TEXT ILIKE '%demo%'))
```
where we can see the presence of the `active_test`, because we don't
disable it in the *view*.
Fix:
Change the domain on the user to check on the field `name`, with this
domain, the ORM will not add an active test on this part. This
essentially does the same as 7a366abb40
but there was a regression in b77f60b155.
Affected versions:
- saas-16.1
- saas-16.2
- saas-16.3
- master
opw-3383564
closesodoo/odoo#128471
X-original-commit: aa6aa636de0f9f0a43bb1f603ecebbcd26b94bbd
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
In the new version of the iot we import a new "crypt" library which is not available for windows
Addition of the class in the input of the password
closesodoo/odoo#128467
X-original-commit: f84bbfac2de786bf73e1fbe6d3b77452e17ac4bb
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
In a sale order, an error is raised when selecting a product
(`product.template`) that has an archived variant (`product.product`)
which uses an attribute (`product.attribute`) still used in other
variants
Steps to reproduce:
1. Install Sales and Stock
2. Create a new product 'TEST'
3. Add the attribute 'Legs' with values 'Steel' and 'Aluminium"
4. Create a new sale order for any customer with product 'TEST' and
variant 'Steel' and confirm it
5. Open the form of product 'TEST' and add the attribute 'Color' with
values 'White' and 'Black'
6. Create a new sale order and try to add the product 'TEST', an error
is raised
Solution:
Make sure there is a product attribute value to disable before excluding
one in the ptavList
Problem:
A `product.product` of a `product.template` can be archived if it has
been used in past orders and a new `product.attribute` has been added to
the `product.template`. Thus, the old product attribute value will
appear in archivedCombinations but there is nothing to disable because
the `product.attribute` is still used.
opw-3413721
closesodoo/odoo#128465
X-original-commit: 8240a34a7f5b082aca4b495447abf87481a04913
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
Steps to reproduce the bug:
- enable “package” option in inventory settings
- Create a package
- save and click on “Package Transfers”
- Create a new transfer
Problem:
No operation type is displayed. Because we do a `name_search` with
the following domain: `[["code","=",none]]`
opw-3394868
closesodoo/odoo#128463
X-original-commit: 149af0ebf22b4575c89d6f4f875f988dc6064c07
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
On smaller screens, `.o_status_bar_buttons` are displayed in a dropdown.
This commits reset the styles of these buttons when they are displayed
in the dropdown, so they look like regular dropdown items
task-3414462
part of task-3326263
closesodoo/odoo#128462
X-original-commit: 071d92b3926f6a062ca3b0b0c9c70d8567bb6899
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
This commit removes the displayName variable of the calendar controller
since it wasn't used anymore and the extension of the displayName is now
updated in the ProjectCalendarController instead. This fixes an issue in
project where the extension of the displayName in the project calendar
controller ( - Tasks by Deadline) would not be shown in the view.
opw-3410987
closesodoo/odoo#128461
X-original-commit: 120ab2513b487d0c117e5c67ed76e6d154d0243f
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
While creating a Manufacturing Orders, when user give date format as '%d/%m/%Y'
and when it tries to match the date format with '%m/%d/%Y' in
'_add_transit_line' method, the error will be generated.
Steps to Produce:-
1. Install 'mrp' and 'purchase' module
2. Change the format of date in 'Languages' as '%d/%m/%Y'
3. Activate 'Multi-Step Routes' in inventory configuration
4. Go to 'Warehouse' and select 3 steps route in 'Incoming Shipments' and
'Manufacture' and save
5. Go to 'mrp' and create a new BOM
6. Go to 'purchase' and create a PO with the same product in BOM and confirm it
7. Click on smart button 'Receipt' -> 'set quantities' -> 'validate'
8. Go to 'mrp' and create a MO with same BOM change the 'Scheduled Date' and
confirm it
9. Click on smart button 'Overview'
Trace-back will be generated.
Applying these changes will resolve this issue.
sentry-4088257491
closesodoo/odoo#128453
X-original-commit: d1d7141fd52bd7167910074adcde2cd95e8b9440
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
QR code extraction fails in some cases when we try to get the Base64 content
from the Saudi EDI attachment when the datas is too voluminous. To avoid this, we pass
bin_size=False in the context to always get the attachment datas correctly.
closesodoo/odoo#128429
X-original-commit: c0369d9f5bda428e7501a7ab1e11134af8c7888d
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Mehdi Bendali Hacine (mebe) <mebe@odoo.com>
Sometimes, when the base64 data used to render the QR code is too long,
some of the special characters included might be wrongly encoded in the
url passed to the /report/barcode route. To avoid this, we format the QR
code string through the quote_plus method to make sure it's always
properly encoded
X-original-commit: 4b5b0caa75302c945d9f762526f1939783ef3250
Part-of: odoo/odoo#128429
With the new website header templates, a search bar will be available
in the header. To avoid two search bars in the page add an option to
remove the search bar in the /shop page.
task-3302735
closesodoo/odoo#121391
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Before this commit `.webp` images could not be used in odoo.
After this commit `.webp` images can be uploaded to odoo.
- can be used in image field
- can be used in HTML field image
- can be used in mails and website
- can be transformed (shape mask, filter effect, crop, rotate, resize, quality)
- can be included in PDF reports
Because the Pillow plugin for `webp` relies on the `libwebp` native library, it cannot be used.
Because of this, the server-size resize (for Image fields) and conversion to `jpeg` (for `wkhtmltopdf`) are done beforehand by precomputing them when a webp is uploaded.
After this PR, the general flow when uploading an image is:
1. On upload in `website`: suggest conversion to `webp`
2. On `webp` upload:
2-A. upload converted `jpeg`
2-B. upload resized `webp` (and therefore `jpeg` of each resize because of (2-A))
There is currently no "fallback to original" in (2-A).
task-2774352
closesodoo/odoo#85494
Related: odoo/enterprise#24998
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit introduces the computation of the image size from a webp
binary source without relying on PIL.
This is needed by eCommerce to determine which image to fetch when using
the zoom functionality on the product page.
task-2774352
Part-of: odoo/odoo#85494
Since [1] dropped images are saved as attachments.
When such an image is a WEBP, its pre-computed resizes and conversions
to jpeg are not generated.
This commit adds the behavior of saving an `o_modified_image_to_save`
when a `o_b64_image_to_save` is a WEBP.
[1]: https://github.com/odoo/odoo/commit/3bbce756c69a206d07abd31059f0392c26b36096
task-2774352
Part-of: odoo/odoo#85494
`libwebp` cannot be used to perform resize operations on webp images on
the server.
This commit uploads all resizes of webp images whenever a webp image is
uploaded:
- resized to any smaller size in 1024, 512, 256 & 128,
- each size converted to jpg as well to be usable in `wkhtmltopdf`.
When an Image field requires `_imageProcessing` to resize a webp image,
it retrieves the pre-resized image instead of running through the
Pillow toolbox.
Pre-converted images are stored as `ir.attachment`s with:
- `res_model` = ir.attachment
- `res_id` = id of transformed attachment
i.e. id of original size webp for resized images
id of webp for jpeg-converted images
- `description` = "format: image/jpeg" for jpeg conversions,
"resize: [size]" for resized images.
task-2774352
Part-of: odoo/odoo#85494
Wkhtmltopdf is unable to render WebP images.
This commit intercepts the requests for the image data during PDF
reports rendering to replace them by the converted image that was
uploaded with it.
task-2774352
Part-of: odoo/odoo#85494
The library used to generate PDFs does not support the WEBP image
format. For those images to be included in reports, they need to be
converted. For security reasons, this conversion cannot be done on the
server, therefore it was decided to keep an already converted copy of
such images.
This commit converts uploaded WEBP images to JPEG and uploads them both
so that the report generation can use the JPEG instead.
This commit also pre-generates the resized version of images - and JPEG
versions of each of them.
task-2774352
Part-of: odoo/odoo#85494
The library used to generate PDFs does not support the WEBP image
format. For those images to be included in reports, they need to be
converted. For security reasons, this conversion cannot be done on the
server, therefore it was decided to keep an already converted copy of
such images.
This commit converts uploaded WEBP images to JPEG and uploads them both
so that the report generation can use the JPEG instead.
task-2774352
Part-of: odoo/odoo#85494
Before this commit two options of images are named "Width":
- the one that adjusts the image resolution
- the one that changes the `width` CSS property
This commit makes the following changes:
- the option about the image resolution is renamed to "Format"
- the "Format" option combines the image resolution and the file format
- an option item gives access to the initially uploaded file format and
resolution
- for all sizes the image format is set to `image/webp`
- for the uploaded size, an `image/webp` version of it is available too
- upon upload, the default selection is an `image/webp` version of the
image
task-2774352
Part-of: odoo/odoo#85494
*: mail, mrp, test_website, web, web_editor
Before this commit '.webp' images could not be used in odoo.
After this commit '.webp' images can be uploaded to odoo.
- can be used in image field
- can be used in HTML field image
- can be used in mails and website
- can be transformed (shape mask, filter effect, crop, rotate, resize,
adjust quality)
task-2774352
Part-of: odoo/odoo#85494
Before this commit, inviting a channel member to a livechat channel
would change its name. This is not what we want as the thread name
should always be the one of the visitor (e.g. "Visitor 20", task-3332872).
Steps to reproduce:
- Open two tabs, one with admin log, one on the support page
- Click on the livechat button and send a message from the support page
- Invite a member with the admin tab
- The name of the thread changed.
closesodoo/odoo#128238
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Currently, When a user tries to set up a stripe account but his country is not
supported by stripe then he receives a error message at backend side and a
ValidationError ("Stripe Proxy: An error occurred when communicating with
the proxy.") on frontend side.
After applying this commit the error message will be updated to a warning level
which will reduce the noise in sentry. I have also added a condition in
'action_stripe_connect_account' method to check whether the country is
supported by stripe or not and if it is not supported the user will be
redirected to other payment providers page.
sentry-3935758343
closesodoo/odoo#128140
X-original-commit: c7b0d8eebe686d9c38f9f5c71577c80718ffb791
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Steps to Produce:-
- Install `Advanced Events`
- Go to ` website` then `Configuration`
- Open `setting`
- Then change favicon and Select svg type file and click on save
- Traceback is here
Cause :-
- The traceback occurs when an SVG image is passed to the ImageProcess method.
In this scenario, the method sets the image as false, and then attempts to
access its size, resulting in the traceback
Fix :-
- The issue has been resolved by implementing a condition check for the image
before accessing its properties. This ensures that the image is valid before
trying to retrieve its size, preventing the traceback from occurring.
sentry-4199175498
closesodoo/odoo#127958
X-original-commit: ebb1e89b367dced4a2157751de12a53bf41ae400
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Syntax Error generates when the user gives invalid python code in 'account_tax'
module and uses that tax while creating invoice.
Steps to produce:
* Install 'account_tax_python' module
* Go to configuration/taxes and create a new tax.
* Select Tax Computation as 'python code' and give some special characters to
python code field and save it.
* Now create an invoice, add a product and add the above created tax in taxes.
* At this moment traceback raises.
By applying these changes will resolve this issue.
closesodoo/odoo#127919
Sentry: 4060222060
X-original-commit: f42bd9c9fbd9a5e4c3eb127453a38d0c21a9d4fb
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Before this commit:
When user try to create link with / it is not recognized as a link.
After this commit:
Now when user try to create link with / it is recognized as a link.
Task-3347775
closesodoo/odoo#127842
X-original-commit: e99ccfa1ed7aa338f99c4142d109b2860cc9be4a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This allows the user to set the total_amount_company
Currently, when an employee set the amount
in a foreign currency, Odoo doesn't let the employee
register how much they have been charged after
conversion in their own currency
(assuming that it's the company one)
After this if the user changes the total_amount_company,
the new rate is computed and used
Task-3255758
closesodoo/odoo#127246
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
The "add-user" thread action is not necessarily present in the view,
therefore the action should not necessarily be programmatically
called.
This commit fixes the issue by letting discuss app programmatically
call the invitation button precisely in the next rendering when
it was requested from click on "start a meeting".
Fixes runbot-23240
closesodoo/odoo#128510
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Previously, customers were not allowed to sign a draft quotation.
We consider that if the customer has access to the quote, he should be able to sign/pay it (instead of getting some strange feedback that the order is not in a state requiring signature/payment)
task-3340541
closesodoo/odoo#124486
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Before this commit, when an invoice is reversed we used to put the message
"this entry has been duplicated from XXXX" but the message that we log in the
chatter was not very clear and also to have the info on the invoice that it has
been reversed you add to go on the credit note itself.
Now when an entry is reversed, the link to the credit note is put in the chatter
of the invoice and the message on the credit note has been changed.
closesodoo/odoo#124060
Task-id: 3326780
Signed-off-by: William André (wan) <wan@odoo.com>
before this commit, currently the field karma_profile_min
field in website model is not added in any views and
the default value set for the field is 150, as it is
not added in any views, the end users have no option to
change the value of this field.
this field value is used in _check_user_profile_access
function and thus the non logged in users or logged in
users with karma less than 150(default value) is not
able to open any public profiles.
after this commit, end users is not able to change
the default value set for the field and also default
value is changed to 0.
closesodoo/odoo#123411
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Be consistent with the terminology used in all views,
'None' doesn't add value and makes the private task stage user-friendly.
Add filter "Private Tasks" to search private tasks easily.
task-3300649
Part-of: odoo/odoo#120668
A serialization error can happen when chatting with another
user from the company. To reproduce:
- Log into Odoo as User A
- Open another Odoo tab in the same window as User A
- In private mode log into Odoo as User B
- Send a message via chat from User B to User A.
A concurrent update happens in channel_fetched method when writing
on mail_channel_partner.fetched_message_id.
To fix that, update the field
through raw SQL using FOR NO KEY UPDATE SKIP LOCKED in select subquery.
This skips the row should it be already locked, which is fine
as we only need to first transaction in the queue to complete.
opw-3164584
closesodoo/odoo#128464
X-original-commit: 5e95bfc2a9e68ea7643ea436968dcad19fdeeff9
Signed-off-by: Aurélien van Delft (avd) <avd@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Trying to access quotations using an older version of a browser, that
doesn't support `structuredClone` like i.e Safari <15.3 will throw a
traceback that will block the regular usage of the app.
We can use an older alternative to handle the deep cloning, with this
approach tho, we will lose the support of Dates, RegExps, Maps, Sets,
Blobs, FileLists, ImageDatas, sparse Arrays, Typed Arrays.
opw-3386434
closesodoo/odoo#128472
X-original-commit: 5b4526b5dab519178a7c694de0625629e8686396
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Before this commit, opening full composer from chatter were always
copying the selected suggested recipients, regardless of the mode
of the composer.
Suggested recipients only makes sense in "Send message" mode,
therefore it should not copy them in "Log note" mode, which this
commit fixes.
Also fix a bug where copying of suggested recipients in full composer
was taking all suggested recipients into account, regardless of
checkbox state. This commit fixes issue by copying only checked
suggested recipients
closesodoo/odoo#128466
X-original-commit: 89afc58a69a53824a9100ceaf4f3574bb82dfc1d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
When user adds rule in the 'Default GS1 Nomenclature' that contains
'Unit product' in Type and 'Date' in GS1 Content Type.
Steps to reproduce the issue:
- Go to Inventory > Configuration > Settings > Barcode
> Select 'Default GS1 Nomenclature' in Barcode Nomenclature
- Go to Inventory > Configuration > Barcode Nomenclatures
> Open Default GS1 Nomenclature > Add a line > Select 'Unit Product' in Type
> Select 'Date' in GS1 Content Type > Add Barcode Pattern for Date
(ex. '(20)(\d{6})' )
- Go to Barcode > Inventory Adjustment > Click on Add Product
> In product, add value for that Barcode Pattern (ex. 20230614)
Error: A traceback appears: 'TypeError: expected string or bytes-like object'
When user add barcode of date for product
https://github.com/odoo/odoo/blob/ae94f14a844352f66490ec326fe2d1a716023891/addons/barcodes_gs1_nomenclature/models/barcode_nomenclature.py#LL156C25-L156C63
Here we will receive datetime.date datatype for value.
Now when it tries to match re with datetime.date, it will lead to the
above traceback.
sentry-4236166678
closesodoo/odoo#128424
X-original-commit: fbec8cd5cc3e75f2079928537a31d59a0b4ce03d
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
before this commit, if user imports a non valid file,
in the import translation wizard, the users is notified
about the invalid file format by a user error and in
this message .pot is shown as a valid format.
but the only valid format's are csv and po files.
after this commit, the .pot from the user error is removed.
closesodoo/odoo#128422
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Receiving a kit's component will fail in AVCO + multi-uom
To reproduce:
1. Create a product category PC
- Costing Method: AVCO
2. Create two products P_compo, P_kit
- P_kit:
- In Units
- P_compo:
- In L
- Storable
- Category PC
3. Create a BoM
- Product: P_kit
- Type: Kit
- Components: 1 x P_compo
4. Create and confirm a PO with 1 x P_kit
5. Process the receipt
Error: When validating the receipt, a user error is displayed: "The
unit of measure L defined on the order line doesn't belong to the
same category [...]"
When processing the SM, we create the in-SVL. To do so, at some
point, we need the unit price of the SM, and here is where the error
comes from:
https://github.com/odoo/odoo/blob/708c3d063482e365e49a04f633c83e90e6fa4356/addons/purchase_stock/models/stock_move.py#L39
`self.product_id` is P_component, but `line.product_id` is P_kit,
hence the error with the UoM1
And there will be some similar errors with the `if` block, L40 (we
compare some SM quantities and some POL quantities: we are mixing
components and kit)
For now, in case of a kit, we will always use the `else` block (i.e.,
the unit price of the POL). This will be improved in master
OPW-3357685
closesodoo/odoo#128386
X-original-commit: 3a81eb79cad7f25843315e39da421efa2c34aaf1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>