due to the absence of IR model data entries for certain
account taxes, but with identical tax names, tax types,
and scopes, attempts to create standard taxes with the
same names alongside IR model data result in a constraint
violation, specifically, "tax name must be unique." To address
this constraint, we append "old" to the tax name for existing
taxes lacking IR model data entries.
see:
https://github.com/odoo/odoo/blob/740fb9ac8c8e121820feeac0e1f25a304e47da9d/addons/account/models/account_tax.py#L202
```
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 4864, in _create
records._validate_fields(name for data in data_list for name in data['stored'])
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 1456, in _validate_fields
check(self)
File "/home/odoo/src/odoo/17.0/addons/account/models/account_tax.py", line 201, in _constrains_name
raise ValidationError(
odoo.exceptions.ValidationError: Tax names must be unique!
```
closesodoo/odoo#161146
X-original-commit: 87e13a0f29ace57f1fd591d7180a64bb085a3bca
Signed-off-by: William André (wan) <wan@odoo.com>
Steps to reproduce:
- Add the same tag to 13 different blog posts.
- On the "Blog" page, click on this tag to filter the blogs.
-> Problem: the result displays "12 Articles" but they are actually 13.
In this case, the result displays "12 Articles" as they are 12 articles
on the current page. When going on the second page of the results,
"1 Article" is displayed. This problem is solved by displaying the total
number of articles found after the filtering operation rather than the
number of articles on the page.
opw-3802729
closesodoo/odoo#161137
X-original-commit: 4e90dc9096cbcf9f2fe7f251b247c8d62bc0bc5d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
Before this commit, when the user created a new quotation from
Contact->Opportunity-> ("New Quotation" or "Quotations/orders widget
button", archived records could be added to the quotation
(e.g. ,product, taxes...) because the context was set to
active_test = false. After this commit, the context is configured back
to active_test = true when creating a quotation from opportunity.
opw-3802796
closesodoo/odoo#161087
X-original-commit: 3085c3b24bef719c3cf63ec9d3b5a7d7b2a34037
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When user tries to empty start date or end date in website using editor,
a traceback will appear.
Steps to reproduce the error:
- Install "website_event"
- Go to Website > Events > Open any Event > Register > Edit
- Now try to empty start date or end date > Save
Error: A traceback appears:
"TypeError:'<' not supported between instances of 'bool' and
'datetime.datetime'"
https://github.com/odoo/odoo/blob/4759c6d1ee09c32381dc56c59c95949fd0e2807c/addons/event/models/event_event.py#L507
Here, When user tries to empty start date or end date,
start date or end date will become "False",
So it will lead to the above traceback.
solution:
A try-catch is used to catch typeerror at write of qweb fields.
sentry-5038057541
closesodoo/odoo#161083
X-original-commit: c893ff16e277b46796a943c5532e01e8edf8958f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Renilkumar Kajavadra (reka) <reka@odoo.com>
Currently, there is an access right problem concerning timesheet. The
module mrp gives write access to portal user on analytic line, but it is not
something we want for the project app.
step to reproduce:
- install hr_timesheet on a saas-16.3 db
- go to project app, open office design
- select any task, and add a subtask to it
- go the the view form of the subtask
- create a new timesheet for this subtask
- go back to the view form of the parent task
a button 'subtask timesheet' is now visible
- share the project in edit mode with a portal user
- connect with that portal user
- open the office design project
- go to the view form of the parent task and click on the button
- the user is redirected to a view tree with the timesheet of the
subtask
this view tree is editable
Source of the problem:
in the mrp module, the access rights of the analytic line is overwritten
to give write access to it to portal user.
Soluce:
We have to make the view in readonly mode for timesheet when the
connected user is a portal one. Unfortunately, it is not 100% possible
because setting the field to readonly still gives the user the
opportunity to click on those fields (which triggers access errors). So
we have to create new views and specifically open those views when the
user is a portal one.
affected version: saas-16.3 - master
task - 3751315
closesodoo/odoo#160959
X-original-commit: 7b733f118f60ff98d9f82c69453187d70e6bece0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
The sale_stock module patches the ProductCatalogKanbanRecord updateQuantity method
to prevent the quantity to go under the delivered quantity of the product
The issue is that we are also using the ProductCatalogKanbanRecord in the industry_fsm_stock module
in which the services product added to the sale order are considered by default but we would like to be
able to dimish their quantity in the catalog (in case of a missclick for exemple)
Since the service product can't be considered delivered in sale modules, the condition in updateQuantity
shouldn't change anything
Task-3689939
closesodoo/odoo#155157
Related: odoo/enterprise#55455
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Steps:
Install web_studio
Change language to French
Open any form view and enable Studio
Add a datetime field and click on it
In french we have the following message:
"Première date acceptée": Date formatée ISO ou "aujourd'hui" He says that we can use the string "aujourd'hui"
when we only expect "today" in English.
This commit changes the help text to display "today" in every language
opw-3829954
closes odoo/odoo#160904
Forward-port-of: #160144
Forward-port-of: #159654
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Steps:
- Install sales app.
- Go to settings of sales.
- See header field there is no download button.
Issue:
- Binary field should have download button and
user should be able to download file with out
issue.
Cause:
- Since Settings is abstact model so it does not
contains id field in it and download button visibility
depends on id field.
Fix:
- Extend binary field for setting view to get proper
file from related field where actual file is stored.
task-3620555
closesodoo/odoo#160070
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This module was introduced in saas-16.4. In that version the sale
order report and portal template displayed both price_subtotal and
price_total for each sale order
line. 655d375af8 removed price_total.
Because this module removes price_subtotal we end up with no line
total at all on the default Brazilian quotation PDF and portal
view (just 3 columns: description, quantity and unit price).
Loosely inspired by l10n_cl [1], this commit changes our approach to
turn the two places where we use price_subtotal into price_total. The
aforementioned commit also changed the heading of this column from
"Subtotal" to a more generic "Amount", so there's no inconsistency
there. Although this is a bit of a mess, I can't think of a better
solution.
[1] https://github.com/odoo/odoo/blob/655d375af83dd49bbbd5f5818e319c3b0e9778c1/addons/l10n_cl/views/report_invoice.xml#L173-L175closesodoo/odoo#159794
Related: odoo/enterprise#59703
Signed-off-by: Josse Colpaert <jco@odoo.com>
Fix various "Using variable xxx before assignment". It was not detected
by pylint <= 2.5.0 which was the version enforced on runbot.
closesodoo/odoo#160886closesodoo/odoo#161166
X-original-commit: 328a0ce2fa619376672c591d8b4f8892aaa2da1a
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
This commit fixes the 'og:site_name' metadata, which previously
defaulted to the company name (see [1]), causing issues for multi-site
setups. Now, the metadata actually uses the site name.
Steps to reproduce:
- Navigate to any page
- Right-click and select "View Page Source"
- In the <head> section, observe the meta property "og:site_name" set to
"MyCompany".
[1]: https://github.com/odoo/odoo/commit/156955de6b4e6288ac606d29b843081842154eff
opw-3791082
closesodoo/odoo#161123
X-original-commit: 24ea3ca4b12f8dd4103a650436a144e776b81d83
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
To reproduce the issue:
-Drag and drop the rating snippet.
-Change the score from options.
-Notice that spaces between icons disappear.
In the release notes[1] of jQuery 3.5.0, it's stated that security
fixes related to the HTML parser were implemented. Consequently,
self-closing e.g. `<i/>` tags inside function arguments were replaced
with e.g. `<i></i>`. As a result, trailing spaces lost significance,
causing icons to stick together.
Before the commit:
Prior to Odoo 16.2, jQuery 3.3.1 was utilized, which allowed the use
of self-closing tags in the append function. This behavior was as
expected.However, starting from Odoo 16.2, jQuery version 3.6.3 was
adopted.
After the commit:
Instead of using self-closing `<i/>` tags, `<i></i> ` with a trailing
space was used. This trailing space gained significance due to the
prefilter no longer ignoring it. Consequently, icons no longer stick
together after changing the score.
task-3576760
[1] https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/closesodoo/odoo#161076
X-original-commit: b897e836697a288bbd58a8efc340d9f7b2e76e30
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This ensures that the user will not click on the confirm button before the record is saved which will prevent unnecessary UserError if the Timeof type requires no validation
closesodoo/odoo#160839
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
When writing in a discuss channel, the updated value sent to the client
should be read from the database, not directly from the values passed to
the write method.
Partially backport of https://github.com/odoo/odoo/pull/139563closesodoo/odoo#158860
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
When the user adds a valid Mauritius phone number, it is not correctly parsed by
the phonenumbers library, resulting in a user error while sending a WhatsApp
message to that number.
Steps to produce:
- Create a new contact with the Mauritius country selected.
- Add a phone number (e.g., '+23057654321').
- Try to send WhatsApp messages using this phone number.
- This will throw an Invalid number error.
Problem:
`phonenumbers==8.12.1` python library is used in odoo for parsing phone numbers.
The `8.12.1` version is too old and cannot parse Mauritius phone numbers
correctly.
Solution:
The `8.12.13` version accurately parses Mauritius phone numbers. Currently, The
latest version of the phonenumbers library is `8.13.31`. Hence, the latest code
from the latest version of the phonenumbers library is monkey-patched into the
system.
Task - 3799632
closesodoo/odoo#161039
X-original-commit: c3743b5fcfb5d67c442e5eee9f084b684e4baac3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before when we create an expense report paid by company with multiple expenses of different dates then we posted the expense report. The journal entries had all the same date.
Now journal entries will match the date of the expense when it is an expense paid by company.
closesodoo/odoo#160990
X-original-commit: 77d53dd3d62016f97c19645b42c772204babdd45
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Logan Staelens (lost) <lost@odoo.com>
When creating a product document, it was still possible to save
something that wasn't a pdf. The check only happened when modifying it.
opw-3802795
closesodoo/odoo#160879
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
Steps to reproduce:
-------------------
- create a time off accrual plan with:
- cap accrued time equals to `True`
- maximum leave equals to `0 days`
- create an allocation with this accrual plan
- run the scheduled action "Accrual Time Off: Updates the number of time off"
(make sure you have the right "lastcall" and "nextcall")
Issue:
------
The number of days of the allocation is set to zero.
This scenario makes no sense from a business point of view.
In effect, we are blocking the accumulation of allocations at zero.
The result is that there will never be any days allocated to these allocations.
Solution:
---------
Add a constraint to force a maximum leave number
when cap accrued time is set.
opw-3847408
closesodoo/odoo#160626
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
When a register payment is made with a writeoff in foreign currency
and when the user set manually an exchange difference account,
don't create a write-off. Instead, 2 cases to consider:
- When the payment is expressed in a foreign currency different than
the invoice's one, play with the rate between amount_currency and
balance and let odoo making an exchange difference accordingly.
That way, the payment has no write-off and the invoice is fully paid.
- When the payment is expressed in company currency but the invoice
has a foreign currency, force the exchange difference to use a rate
that will fully paid the invoice without creating any write-off line
on the payment.
task_id: 3717436
closesodoo/odoo#157398
Related: odoo/enterprise#58511
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
* Current Status
- when remove attachment or message, The system will perform deletion on
the interface before performing deletion in the DB. However, in some
situations, exceptions will occur during the deletion process. So it
will happen that the attachment or message has been deleted on the
interface but still exists under the database. From a function that
helps optimize user experience, it will cause a worse situation with
user experience
* Solution
- Make rpc calls before deleting messages or attachments on the
interface
closesodoo/odoo#161023
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this PR, the error displayed in the public page was quite
cryptic. It was hard for the user to understand that error and even
harder to report it if needed. This PR makes the error more user
friendly.
task-3850559
closesodoo/odoo#160947
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Steps to reproduce:
- Install Accounting, l10n_it_edi and Contacts
- Switch to an Italian company (e.g. IT Company)
- Go to Contacts and create a contact from San Marino:
* Name: SM customer
* Country: San Marino
* Street, City, ZIP: [any]
* Destination Code: [any]
- Create an invoice:
* Customer: [the created contact from San Marino]
* Product: [any]
- Confirm the invoice
- Generate E-invoice XML via "Send & Print" button
Issue:
In the XML, the destination code (i.e. CodiceDestinatario) is the
default one for non-Italian customer (i.e. XXXXXXX).
Also, the VAT number (i.e. IdFiscaleIVA) is the default value for
countries that are not in the European Union (i.e. OO99999999999).
However, since October 2021, San Marino should be handled differently
for Italian electronic invoices.
A specific destination code (i.e. 2R4GTO8) should be used for all
customers from San Marino.
Source: https://www.credemtel.it/fattura-elettronica/fattura-elettronica-san-marino/
Solution:
For customers from San Marino:
- Keep VAT number
- Set "2R4GTO8" as destination code
opw-3819054
closesodoo/odoo#160494
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
In Spain, "Cooperativas" have their own variant of the Spanish chart of
accounts. In order to support these businesses, we add two extra CoA
templates: Cooperatives - SMEs and Cooperatives - Complete.
task-3803050
closesodoo/odoo#159357
Signed-off-by: Josse Colpaert <jco@odoo.com>
Steps to reproduce:
- Install mrp and purchase
- Go to "Inventory / Configuration / Settings"
- Activate "Storage Locations"
- Go to "Inventory / Configuration / Warehouse Management / Operations Types"
- Edit "Receipts" type by activating "Show Detailed Operations"
- Go to "Manufactoring / Configuration / Settings"
- Activate "Subcontracting"
- Create product: (e.g. Product XYZ)
* Product Type: Storable Product
- Create a BoM for Product XYZ:
* BoM Type: Subcontracting
* Subcontractors: [any] (e.g. Azure Interior)
- Create a PO:
* Vendor: Azure Interior
* Products: 2 x Product XYZ
- Confirm the PO
- Open the picking from PO via the Receipt smart button
- In "Operations" tab, set done to 1
- On the picking form, change the destination location (e.g. WH/Stock/Shelf1)
- Save
- In "Detailed Operations" tab, a line should have appeared
- Select the same destination location on that line (i.e. WH/Stock/Shelf1)
- Validate the picking and create a backorder for the remaining quantity to produce
- Go to "Inventory / Reporting / Locations"
- Check the locations of Product XYZ (Search Product: XYZ - Group by: Location)
=> The "On Hand Quantity" for Product XYZ is as followed:
* Virtual Locations/Production: -1.00 (correct)
* WH/Stock/Shelf1: 1.00 (correct)
- Open the backorder picking from PO via the Receipt smart button
- Record the production of the remaining unit
- Validate the picking
- Go to "Inventory / Reporting / Locations"
- Check the locations of Product XYZ
Issue:
The "On Hand Quantity" for Product XYZ is as followed:
* Partners/Vendors: -1.00 (incorrect, it should be empty)
* Physical Locations/Subcontracting Location: 1.00 (incorrect, it should be 0.00)
* Virtual Locations/Production: -2.00 (correct)
* WH/Stock/Shelf1: 2.00 (correct)
Cause:
When the PO is confirmed, the stock picking and the stock move are created, they both
have the same source and destination locations.
However, in an overridden method from "mrp_subcontracting" module, a check is performed
on the move to determine if it is a subcontract.
If it is the case, its source location is set to the subcontractor location and so, the
source location of the picking and the move is not the same anymore.
When the destination location is changed on the picking, an onchange is triggering an
update of the destination location AND the source location of the move to the values
coming from the picking, erasing the subcontractor location set on the move.
The issue only happens for the backorder, because the source location update is not
propagated to the stock move lines.
In the case of the original picking, the move lines were already created with the
subcontractor location as source location.
But when the backorder is created, the move lines are created with the values coming
from a move without the subcontractor location.
Solution:
Do not propagate "location_id" from the picking to the subcontracting moves.
opw-3777379
closesodoo/odoo#161011
X-original-commit: e0f7577da1a42512d2fdc5ee316f27a1ce040522
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
-Same behaviour as [1] we should use slug(job) instead of job.id
1: a2c6ddf8158bf40f13b5c5a8b89deb3d2ae8af6b
closesodoo/odoo#160972
X-original-commit: 721a8bd4b06668dac9fad0ba08a95b7943331918
Signed-off-by: Jérémy Kersten <jke@odoo.com>
Issue:
When we have open tickets from anyone with
the email domain @proton.me, they are linked
together even though this domain is generic,
not a private one.
same issue with @cegetel.net and @dbmail.com
Steps To Reproduce:
- Create three tickets with "@proton.me"
domain but different addresses.
- See that in the smart button, the tickets
are linked to each other even though the
customers are different.
Solution:
- in `_compute_partner_ticket_count` we check
if the email domain of the partner is in
`iap_tools._MAIL_DOMAIN_BLACKLIST `, if not,
we consider the email to be a company email
which tickets can be grouped by.
- the _MAIL_DOMAIN_BLACKLIST is a list of generic
email providers on which IAP services should not run.
Retrieving company information from them makes no sense.
- To fix this issue I added `proton.me`,
`cegetel.net` and `dbmail.com`
to _MAIL_DOMAIN_BLACKLIST
opw-3786308
closesodoo/odoo#160804
X-original-commit: 0258fccc217142e66873c1dbb99efbfdd70a3887
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
Signed-off-by: Kawtar Drissi El Bouzaidi (kdeb) <kdeb@odoo.com>
Issue:
=====
double scrollbar appears in notes.
Steps to reproduce the issue:
=============================
- Go to notes
- Insert a table
- Add some columns and try to stretch the last one to the right until it
goes outside the width of the editable.
- Click on the last cell to the right in the table and scroll left
- Another scrollbar will appear.
Origin of the issue:
====================
The part of the table that is invisible in the editor is considered as
overflow for the `html_field` so it will show a scrollbar which is not
needed since we already have a scrollbar in the edtibale.
Solution:
=========
We mark hide the overflow in `html_field` and let the editable takes
care of the overflow.
task-3721794
closesodoo/odoo#160953
X-original-commit: c98c58301da82ad896e296b9bbbdf6bbb0bc2a8e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
Small improvements on the download logs button in the Iot App:
- Log file contains the IoT name and date of generation
- Internal server error araise if the logfile config is missing
- Internal server error aised if the log file is missin
Was meant to be part of:
https://github.com/odoo/odoo/pull/159186
opw-3827121
closesodoo/odoo#160755
X-original-commit: a6bcfce6714c4a804fe84d81d8b9ee29c1440046
Signed-off-by: Loan Sens (lse) <lse@odoo.com>
Steps to reproduce issue:
1. Select a boxed layout document
2. Create an invoice and add lines until the pdf version is on two pages
3. Print the pdf
4. On every page except the first one, the body of the document is cropped by the header
Explanation:
The PDF consists of three parts: the header, the footer and the body, and they are added separately. The body is delimited by the paper format and margins. Those do not depend on the size of the header and the footer.
In the boxed layout, the height of the header is bigger than the default size of the top margin of the body. Because of that, it covers a part of the body.
Suggested fix:
By removing some whitespace, the header size has been reduced to a size smaller than the default margins of the document while keeping every information readable.
opw-3768511
closesodoo/odoo#160925
X-original-commit: 08ec6a850b1959f71833d1ea7b39f50ab7ff4ed8
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
Signed-off-by: Stroobant Paul (stpa) <stpa@odoo.com>
Steps to reproduce:
- Create a storable kit product
- Update on hand quantity:
only the components are displayed(correct behavior)
- In Inventory tab open Inventory Adjustement
- Possible to edit kit quantity
Bug:
In the product tab when trying to update qty the kit product is
replaced with its components instead but it is still Possible to
edit kit quantity directly in the inventory app
Fix:
introduced python constraint to prevent user from directly editing
the kit product qty in master
in standard just display a warning
opw-3681703
closesodoo/odoo#160978
X-original-commit: ba81d4ef64933dc025c7a473456c5c056ed69aac
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
Create a SO with the following lines:
1. Price Unit 10000, tax 20%
2. Price Unit 10000, tax 20%
3. Price Unit 10000, tax 20%
4. Price Unit 50, tax 20%
Confirm, Create a downpayment of 840.0
Check the downpayment
Issue: Amount will be 840.01
This occurs because we compute the downpayment values aggregating
so line amounts line by line, each time multiplying for the downpayment
percentage and rounding the result.
Over multiple lines this mechanism may accumulate a rounding error.
opw-3812925
closesodoo/odoo#160781
X-original-commit: 1a21f40274d7d7c3c5029c3bb83214618cc2384f
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
Before this commit, we didn't correctly detect when to prefix the
value of an url field for the href of its link.
closesodoo/odoo#160916
X-original-commit: 27458e3bdb545f550e60f1bd39addf188151c38b
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Current behavior:
Cannot send SMS to a partner that has
a mobile phone number from Panama.
Steps to reproduce:
parsed = phonenumbers.parse('6198 5462', region='PA')
is_valid = phonenumbers.is_valid_number(parsed)
is_valid == False
Cause of the issue:
Old versions of phonenumbers (external library) are not
updated to Panamas mobile phone numbers system change.
Fix:
Monkey patched the library
Similar as: https://github.com/odoo/odoo/commit/b21df8797141dac9f2cf0315658a08a238849f5b
opw-3682631
closesodoo/odoo#160885
X-original-commit: 1b6611f5d2d381ec53de8fce103759d6a5717d79
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
- Confirm an SO with a storable product
- in barcode app open the created picking
- Scan a different product confirm the picking and create a backorder
Bug:
the new product is not added to the SO and the original picking isn't
linked the SO anymore
Root cause:
when new moves are created in the inventory app default_picking_id
is set in the context and is used in _default_group_id to set the group
Fix:
explicitly set the group_id when creating the move instead of relying
on the defaults from the context when possible
test: https://github.com/odoo/enterprise/pull/57408
opw-3644773
closesodoo/odoo#160812
X-original-commit: adb072ce198454801d306df90f30a14a79e3dd3d
Related: odoo/enterprise#60200
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
Currently, when creating a purchase order, if the product has multiple vendor lines (with the vendor selected on the PO), the product description uses information from all the vendor lines; instead of using information from the vendor line that is used for the price.
Steps to reproduce:
-------------------
* Go to the **Purchase** App
* Go to **Products**
* Select any product
* Select the **Purchase** tab
* Add `Vendor Product Name` and `Vendor Product Code` in additional line fields
* Add two vendor lines
* Line 1:
`Vendor`: Vendor1
`Vendor Product Name`: P1
`Vendor Product Code`: A
`Price`: 1
* Line 2: <br>
`Vendor`: Vendor 1
`Vendor Product Name`: P1 bis
`Vendor Product Code`: B
`Price`: 5
* Select **Orders** > **Request for quotation**
* Create a new quotation
* Select Vendor 1, add the product for which we just added the two vendor lines
> **Observation**: The description of the product shows information from both vendor lines added.
Why the fix:
------------
This behavior was introduced when `name_get` was removed to use `dispay_name` instead.
* https://github.com/odoo/odoo/pull/122085/commits/a8b15c7ab5e2d850d0551a6eb4213bb20a30b210
When adding a product to the purchase order, the onchange on `product_id` is called. The onchange calls the function `_product_id_change`, which itself calls `_get_product_purchase_description`.
https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/purchase/models/purchase.py#L1224https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/purchase/models/purchase.py#L1401-L1407
The line `name = product_lang.display_name` calls the function `_compute_display_name`.
* We do have a parnter_id in the context as we have selected a vendor on the purchase order.
https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/product/models/product_product.py#L434
* We don't have a supplierinfo in the context yet but we have multiple supplierinfo with the same partner_id.
https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/product/models/product_product.py#L466-L467
Here we thus have 2 sellers.
* Ultimately, the display name joins the different display names computer for each seller.
https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/product/models/product_product.py#L473-L483
Coming back to the line `self.name = self._get_product_purchase_description(product_lang)`, we now have the name of the purchase order line set as the concatenation of display names from the supplierinfo, i.e `'[A] P1, [B] P1 bis'`.
Once the onchange is called, the function `_compute_price_unit_and_date_planned_and_name` is being called.
https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/purchase/models/purchase.py#L1295
In the current state, we do not meet the if condition. Indeed, the line has a name (`'[A] P1, [B] P1 bis'`) but it isn't in the default_names (`['[A] P1', '[B] P1 bis']`). It somehow corresponds to a setting where the name of the purchase order line was setup by the user.
With this current fix, the call to `_product_id_change` will set the name of the line with the product information from the company; and not the partner. We also need to add this name to the `default_names` in `_compute_price_unit_and_date_planned_and_name` so that the description get recomputed with regards to the seller, if any.
opw-3802182
closesodoo/odoo#160778
X-original-commit: 6974f5303badbc5f5db104270f9492c12a52f220
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Sarah Bellefroid (sbel) <sbel@odoo.com>
It should not be common, but through custo or in debug mode, one can
create a menu without an URL since it's not required on the model.
Through regular flows, it won't be possible since our UI won't let you
go through when creating a menu if you don't set a URL.
Followup of https://github.com/odoo/odoo/commit/948235079f002794f9837d3cf91e2d20e3254e20
X-original-commit: f2ac2ab72a190375c8116a11109191c0b7b970dc
Part-of: odoo/odoo#160588
Don't show HSN value for sale.order not linked to this localization.
Before this commit, if you have multi company with multi localization,
you see this field whatever the current localization.
It uses the same condition than other report: purchase/invoice/...
closesodoo/odoo#160833
X-original-commit: e2a684018d7f92994aa5d30ded8f64703254f0fb
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
Without sudo, an user in a company can change the type even if somes not done stock.move.line exists.
closesodoo/odoo#160856
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
The conditionnal `isinstance(exc, NotFound)` is shadowed by the
conditionnal `isinstance(exc, HTTPException)` two lines above. Nobody
ever complained that the warning for NotFound error was gone. Since
werkzeug 1.0.0, the status code in the response log is colored, 404 is
colored yellow which should catch the eye. The explicit warning line
isn't really necessary.
closesodoo/odoo#159895
X-original-commit: 851b91f19b87446662421cb8d801a9472725bc72
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Before this commit:
The cursor kept on flickering when attempting to enter a space at the end
of label text field of a link resulting in not being able to add space at all.
After this commit:
Now, it's possible to add spaces at the end of a link label.
task-3820250
closesodoo/odoo#160780
X-original-commit: 1af59ba5054dae5272506aead8b2c8dd0e5616fb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
How to reproduce:
- Install website_slides with demo data
- Log in from localhost
- Log in from dev.localhost
- Switch to localhost
- (The system property web.base.url is http://dev.localhost:8069 but we are
on localhost)
- Go to a course in the back end and click on “Go to website” button
You are redirected to the frontend website home page instead of the course
home page.
This fix solves the problem.
Afer correcting this error for the courses (slide.channel), we have found the
same problem for:
- event.sponsor
- event.meeting.room
- slide.slide
So we apply the same correction for them.
Technical note: the button "Go to website" uses the open_website_url method of
WebsitePublishedMultiMixin that relies on website_url. That method expects a
relative URL in the computed field website_url and not an absolute one
(actually, the method already handle adding the website domain, so it expect
the relative part). The problem is that the compute method for the field
website_url of channel compute an absolute URL. The consequence is that the
user is redirected to the home page instead of the course page (by
WebsitePreview, see get path method). In stable, we cannot change easily
website_url to make it relative as it is used in other of places (ex.: if we
make it relative the share link in the sidebar on the frontend is relative
which is not correct and in mail template, the URL might not be correct as the
mail system append the default domain for relative URLs). So instead, we
override open_website_url to use a relative URL when the website is not
defined. If the website is defined on the course, we call the super
implementation because a domain change might be required. Note that by doing
that, we duplicate the code of _compute_website_url in open_website_url but
making the URL relative instead of absolute. So we should clean that in master.
Task-3635856
closesodoo/odoo#160763
X-original-commit: 1f798428fc0f403755512a45f67b5f70aae0c808
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Pierre-Yves Dufays (pydu) <pydu@odoo.com>
In mobile, having a somewhat 'large price' (like a few thousands
currency units) can cause the bottom of the card to overflow (esp.
if buttons like 'add to card' or 'add to wishlist' are present).
This commit modifies the card template so that content is normally
spaced and can wrap to a new line if need be.
opw-3706637
closesodoo/odoo#160628
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
Resolves an issue with Afterpay via Stripe not receiving correct
shipping address details, causing transaction failures. Now,
ensures shipping address from the order or invoice is accurately
sent to Stripe if we have it.
opw-3419984
closesodoo/odoo#160300
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>