Monday, August 26, 2024
34 changes · saas-17.4
Resolved issues and error corrections
This fixes an internal quality check that was silently failing when reviewing translated text patterns in code. The change helps developers catch translation-related mistakes reliably before they reach customers, reducing the chance of inconsistent or hard-to-maintain language handling.
Original PR description
2e130cf97532cbf773820b74997f31fd7862b67c broke the gettext-variable lint check. The `value` attribute exists only on `astroid.Const` nodes. If a variable is passed to gettext (which is what this check is supposed to detect), the node is an instance of `astroid.Name`. Trying to read the value attribute on an instance of `astroid.Name` caused the check to silently crash. This commit fixes the problem by ensuring that the node is an instance of `astroid.Const` before attempting to read the value attribute. It also adds a bunch of tests to make sure this kind of bug doesn't go undetected in the future. Task-4132201
The translation option is now shown correctly when users focus or hover over HTML fields. This makes it easier to translate rich text content directly in forms, improving usability for multilingual workflows.
Original PR description
The focus/hover does not work the same way for html fields (filiation is different) So, the icon is always hidden currently. Let's add specific logic for these html fields --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update fixes a usability issue in the Appraisals settings screen. It helps HR teams configure appraisal options more smoothly and reduces confusion during setup.
Original PR description
task-4063399
This update fixes how VoIP call data is updated so calls remain consistent after changes in the underlying system. It also makes related automated tests run much faster, helping future VoIP fixes and updates be validated more efficiently.
Original PR description
The voip model was overriding `static insert` method as if this works on a single record. For some time, this method works on multiple records, and its implementation detail has changed so assuming it does `get() ?? new()` is no longer guaranteed. The intent of override was to enrich data after them being assigned. This has been converted to an override of `update()`, which guarantees it being called whenever fields are updated on record, without making too much assumption in implementation details of records. This commit also speeds up tests of VOIP, which were awaiting input that contains a value. This is not observed by mutation observer, so these tests took 3 seconds to execute. This PR puts the value in `data-value`, so that this is a mutation that can be observed by contains, thus reducting time of such test to mere dozens of ms. community: https://github.com/odoo/odoo/pull/177212
Marketing campaign activity cards now only open the activity when users click the activity title, preventing accidental openings from clicks elsewhere on the card. The add child activity button also keeps the expected cursor behavior, making the campaign setup screen feel more predictable.
Original PR description
Purpose ======= Fix the "open record" action for the activities kanban in the marketing campaign form. The record can be opened when clicking anywhere on the kanban article, it should only be opened…
Purpose ======= Fix the "open record" action for the activities kanban in the marketing campaign form. The record can be opened when clicking anywhere on the kanban article, it should only be opened when clicking on the title of the acitvity. Specification ============= Following this commit https://github.com/odoo/odoo/commit/d52fc5ae69a9ca55df22f416a26c1ea5f5484ac9 the kanban arch parser has been updated changing the condition to open the record from this 'this.allowGlobalClick' to this 'this.props.archInfo.canOpenRecords'. It was previously only opening the record when the user clicked on the element with the 'oe_kanban_action' class (i.e. the activity title) but is now opening the record no matter where the click is on the kanban article. Fixing the issue by adding the new 'can_open' attribute on the kanban and setting it to false bringing back the old behavior. Also adding the 'user-select-none' class on the 'Add child activity' button so that the cursor isn't changed to the selector one when hovering the text. Task-4089001
This fix prevents purchase order budget calculations from failing when they reference analytic account records that no longer exist. It improves reliability by checking that related records are still available before using them during recalculation.
Original PR description
Browse mehtod of orm only returns a recordset for the ids provided but it never checks if those ids exist, which with recompute of analytic_json field can lead to this error: 'odoo.exceptions.MissingError: Record does not exist or has been deleted.'
Miscellaneous changes
Problem: The tax group name is not translated to Arabic. Purpose: Display the Arabic translation of the tax group name as well to stay consistent with the report. Steps to Reproduce: 1. Install l10n_sa 2. Switch to SA company 3. Add Arabic as a language 4. Add an Arabic translation for a tax group name 5. Change a contact's language to Arabic 6. Create an invoice with the Arabic contact and a tax from the same tax group 7. Preview or Print and observe that the tax group name is n
Original PR description
Problem: The tax group name is not translated to Arabic. Purpose: Display the Arabic translation of the tax group name as well to stay consistent with the report. Steps to Reproduce: 1. Install l10n_sa 2. Switch to SA company 3. Add Arabic as a language 4. Add an Arabic translation for a tax group name 5. Change a contact's language to Arabic 6. Create an invoice with the Arabic contact and a tax from the same tax group 7. Preview or Print and observe that the tax group name is not translated to Arabic opw-4094196 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#177307
## Before this PR: Sometimes Delivered SMS Text Messages are not counted as Sent SMS, thus causes confusion among users. ## Technical: Sometimes we got 'Delivered' Status first instead of getting 'Sent' Status from 3rd party providers (IAP). Because of this 'sent_datetime' is not Set and return False. Sent SMS in tooltip as well in other views(i.e., traces list) are counted if Sent On(sent_datetime) has a value. ## After this PR: 'sent_datetime' will be set if SMS status i
Original PR description
## Before this PR: Sometimes Delivered SMS Text Messages are not counted as Sent SMS, thus causes confusion among users. ## Technical: Sometimes we got 'Delivered' Status first instead of getting 'Sent' Status from 3rd party providers (IAP). Because of this 'sent_datetime' is not Set and return False. Sent SMS in tooltip as well in other views(i.e., traces list) are counted if Sent On(sent_datetime) has a value. ## After this PR: 'sent_datetime' will be set if SMS status is not in '**Outgoing**', '**Processing**', '**Exception**' , '**Canceled**', thus counted as Sent SMS. This will also solve any potential future issue if we can't get any delivery status from 3rd party providers for some reasons (i.e., Delivered) but we can get click/open,... status directly from recipient. https://github.com/odoo/odoo/assets/157007055/a28f6c3c-883d-4f09-a591-25dfe35e029d Task-3972519 Forward-Port-Of: odoo/odoo#177647 Forward-Port-Of: odoo/odoo#169186
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#177854
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#177854
Issue ----- Changing the color of the product's ribbon to a custome one in eCommerce has no effect outside of the editor (after clicking "Save", the background color of the ribbon returns to the default one). Change ----- Since the bg-primary class is now set on the ribbon HTML at creation. https://github.com/odoo/odoo/blob/56fd8440707a0f3f2ba298f8bf016577ca08796b/addons/website_sale/static/src/js/website_sale.editor.js#L180 Remove the bg-primary class from the ribbon. opw-4069818
Original PR description
Issue ----- Changing the color of the product's ribbon to a custome one in eCommerce has no effect outside of the editor (after clicking "Save", the background color of the ribbon returns to the default one). Change ----- Since the bg-primary class is now set on the ribbon HTML at creation. https://github.com/odoo/odoo/blob/56fd8440707a0f3f2ba298f8bf016577ca08796b/addons/website_sale/static/src/js/website_sale.editor.js#L180 Remove the bg-primary class from the ribbon. opw-4069818 Forward-Port-Of: odoo/odoo#175687
Before this commit, when using a product in a kit with a smaller unit of measure than the base product UoM, and the conversion resulted in a zero quantity, an unclear error message was displayed upon closing the PoS session: "Quantity or Reserved Quantity should be set." This error message lacked sufficient information, making it difficult to diagnose the issue, especially with multiple orders. This commit enhances the error message to clearly indicate the cause of the problem, providing spec
Original PR description
Before this commit, when using a product in a kit with a smaller unit of measure than the base product UoM, and the conversion resulted in a zero quantity, an unclear error message was displayed upon…
Before this commit, when using a product in a kit with a smaller unit of measure than the base product UoM, and the conversion resulted in a zero quantity, an unclear error message was displayed upon closing the PoS session: "Quantity or Reserved Quantity should be set." This error message lacked sufficient information, making it difficult to diagnose the issue, especially with multiple orders. This commit enhances the error message to clearly indicate the cause of the problem, providing specific details about the UoM conversion that resulted in a zero quantity. To reproduce the issue: 1. Create a product with a base UoM in kilograms (kg). 2. Include this product in a kit with a UoM of grams (g). 3. Set the rounding precision for both UoMs to 0.01. 4. Sell one kit through the PoS. The error would occur due to the quantity conversion from grams to kilograms resulting in zero, given the rounding precision settings. opw-4084783 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#175007
To reproduce the issue: - In the project app, click on a project to enter the Kanban view - Refresh the page The "+ stage" button to add a stage to a project disappears upon page refresh. This is caused by a context check that functions correctly during the normal flow. However, when directly accessing the link or refreshing the page, the `active_model` context is lost. Since the action `act_project_project_2_project_task_all` always filter project on active_id, we can add as a default
Original PR description
To reproduce the issue: - In the project app, click on a project to enter the Kanban view - Refresh the page The "+ stage" button to add a stage to a project disappears upon page refresh. This is caused by a context check that functions correctly during the normal flow. However, when directly accessing the link or refreshing the page, the `active_model` context is lost. Since the action `act_project_project_2_project_task_all` always filter project on active_id, we can add as a default context ´'active_model': 'project.project'´ opw-4075290 Forward-Port-Of: odoo/odoo#176577
Currently, a traceback occurs when the user `posts journal entries` with `multiple expenses` in which one of the expense doesn't have a `date`. To reproduce this issue: 1) Install `Expense` 2) Create an expense report(expense sheet) with multiple expense lines 3) Remove one of the expense's date 4) Click Submit to Manager> Approve> Post Journal Entries Error: ``` TypeError: '>' not supported between instances of 'datetime.date' and 'bool' File "odoo/http.py", line 2248, in __
Original PR description
Currently, a traceback occurs when the user `posts journal entries` with `multiple expenses` in which one of the expense doesn't have a `date`. To reproduce this issue: 1) Install `Expense` 2) Create…
Currently, a traceback occurs when the user `posts journal entries` with `multiple expenses`
in which one of the expense doesn't have a `date`.
To reproduce this issue:
1) Install `Expense`
2) Create an expense report(expense sheet) with multiple expense lines
3) Remove one of the expense's date
4) Click Submit to Manager> Approve> Post Journal Entries
Error:
```
TypeError: '>' not supported between instances of 'datetime.date' and 'bool'
File "odoo/http.py", line 2248, in __call__
response = request._serve_db()
File "odoo/http.py", line 1823, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1843, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1821, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1828, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2053, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 220, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 756, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 42, in call_button
action = self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 34, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 458, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "home/odoo/src/enterprise/saas-17.2/hr_expense_extract/models/hr_expense.py", line 199, in action_sheet_move_create
return super().action_sheet_move_create()
File "addons/hr_expense/models/hr_expense_sheet.py", line 558, in action_sheet_move_create
self._do_create_moves()
File "addons/sale_expense/models/hr_expense_sheet.py", line 119, in _do_create_moves
return super()._do_create_moves()
File "addons/hr_expense/models/hr_expense_sheet.py", line 700, in _do_create_moves
moves = self.env['account.move'].create([sheet._prepare_bills_vals() for sheet in own_account_sheets])
File "addons/hr_expense/models/hr_expense_sheet.py", line 700, in <listcomp>
moves = self.env['account.move'].create([sheet._prepare_bills_vals() for sheet in own_account_sheets])
File "addons/hr_expense/models/hr_expense_sheet.py", line 728, in _prepare_bills_vals
**self._prepare_move_vals(),
File "addons/hr_expense/models/hr_expense_sheet.py", line 749, in _prepare_move_vals
'date': self.accounting_date or max(self.expense_line_ids.mapped('date')) or fields.Date.context_today(self),
```
When the user clicks on the `Post Journal Entries` Button, it tries to create an expense report in which `_prepare_move_vals` method triggers.
In this method, the `max` function is used to get the date from `expense_line_ids`.
If any one of the expense lines doesn't have a date(date is not required) it leads to a traceback.
https://github.com/odoo/odoo/blob/607e454f65c2c60c4ee5169bc53706f24a8bc625/addons/hr_expense/models/hr_expense_sheet.py#L725-L732
After applying this commit, it will resolve this issue by filtering records with date and then the max function is used to get the maximum date.
sentry-5616738740
Forward-Port-Of: odoo/odoo#173613* PROPBLEM: The error is raised when user has access to Project Update, but not to Journal Item. * SOLUTION: Add `sudo` when searching `account.move.line` in the method `_get_already_included_profitability_invoice_line_ids`. Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#177150
Original PR description
* PROPBLEM: The error is raised when user has access to Project Update, but not to Journal Item. * SOLUTION: Add `sudo` when searching `account.move.line` in the method `_get_already_included_profitability_invoice_line_ids`. Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#177150
This commit fixes an issue regarding global discount lines on invoices that should be represented as allowance charge elements on the UBL file sent to ZATCA. In V17 the structure of the dictionary passed to the XML template in charge of rendering AllowanceCharge changed and expects the value of the tax_scheme_id to be passed inside a dict called tax_scheme_vals, which was not the case previously. Description of the issue/feature this PR addresses: When trying to submit an invoice containing
Original PR description
This commit fixes an issue regarding global discount lines on invoices that should be represented as allowance charge elements on the UBL file sent to ZATCA. In V17 the structure of the dictionary…
This commit fixes an issue regarding global discount lines on invoices that should be represented as allowance charge elements on the UBL file sent to ZATCA. In V17 the structure of the dictionary passed to the XML template in charge of rendering AllowanceCharge changed and expects the value of the tax_scheme_id to be passed inside a dict called tax_scheme_vals, which was not the case previously. Description of the issue/feature this PR addresses: When trying to submit an invoice containing global discounts to ZATCA, the server throws an error since it expects a Tax Scheme ID on the Allowance Charge element linked to the global discount. This only happens on V17 as the structure of the data passed to the AllowanceCharge XML template changed Current behavior before PR: ZATCA servers return an error when submitting invoices containing a global discount line Desired behavior after PR is merged: ZATCA servers correctly process invoices containing global discount lines --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#177326
**Version:** 16, 17, master **Description of the issue/feature this PR addresses:** Argentinean localization: if a customer invoice with partner with "IVA Responsable Inscripto" AFIP Responsibility is confirmed, then reset to draft and changed the partner to one with "Responsable Monotributo" AFIP Responsibility, then "Document Type" field is changed and this is not the desired behavior because that field is readonly when the invoice was posted. Compute method should not overried the docum
Original PR description
**Version:** 16, 17, master **Description of the issue/feature this PR addresses:** Argentinean localization: if a customer invoice with partner with "IVA Responsable Inscripto" AFIP Responsibility…
**Version:** 16, 17, master **Description of the issue/feature this PR addresses:** Argentinean localization: if a customer invoice with partner with "IVA Responsable Inscripto" AFIP Responsibility is confirmed, then reset to draft and changed the partner to one with "Responsable Monotributo" AFIP Responsibility, then "Document Type" field is changed and this is not the desired behavior because that field is readonly when the invoice was posted. Compute method should not overried the document type if the invoice was posted before. If it does then an incosistency will occurr because the name, document type and sequence will not match. A new sequence non-real will be used. Also the user it is not aware is happening because the field is readonly. **But when a vendor bill with partner with "IVA Responsable Inscripto" AFIP Responsibility is confirmed then is needed to change "Document Type" field if that vendor bill is reset to draft and changed the partner to one with "Responsable Monotributo" AFIP Responsibility.** --> we introduced this bug on this pr [https://github.com/odoo/odoo/pull/172003](https://github.com/odoo/odoo/pull/172003) **Video showing how to replicate the bug:** https://drive.google.com/file/d/1endivnZ3EEBVn4kzt0hIkR-a5tecYUR7/view **Steps to reproduce:** 1. Log in with admin on runbot odoo enterprise 16 instance and install l10n_ar_edi (Argentinean Electronic Invoicing) module. 2. Take position on company "Responsable Inscripto". 3. Go to "Accounting / Vendor / Bills" and create a new vendor bill with vendor "ADHOC SA" (this partner has "IVA Responsable Inscripto" AFIP Responsibility), with a journal "Vendor Bills", add an invoice line and confirm it. 4. Reset to draft the vendor bill mentioned in step 3 (now journal and document type are readonly fields), change customer to "Gritti Agrimensura" (this partner has "Responsable Monotributo" AFIP Responsibility) and save. Check that the document type has not changed from "(1) FACTURAS A" to "(11) FACTURAS C" and this is not the desired behavior because is a readonly field now because the invoice was posted before. **Current behavior before PR:** When a vendor bill with partner with "IVA Responsable Inscripto" AFIP Responsibility is confirmed then "Document Type" field does not changes if that vendor bill is reset to draft and changed the partner to one with "Responsable Monotributo" AFIP Responsibility. **Desired behavior after PR is merged:** When a vendor bill with partner with "IVA Responsable Inscripto" AFIP Responsibility is confirmed then "Document Type" field does changes if that vendor bill is reset to draft and changed the partner to one with "Responsable Monotributo" AFIP Responsibility. Ticket Adhoc side: 77058 Task latam: 1242 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#175855
Example of steps: - install `inventory` - Open a transfer/receipts - add a product - validate it - click on return - there is a modal with the product - double click quickly on remove button - click return - traceback ``` psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type integer: "virtual_12" LINE 1: ...ETE FROM "stock_return_picking_line" WHERE id IN ('virtual_1...
Original PR description
Example of steps: - install `inventory` - Open a transfer/receipts - add a product - validate it - click on return - there is a modal with the product - double click quickly on remove button - click…
Example of steps:
- install `inventory`
- Open a transfer/receipts
- add a product
- validate it
- click on return
- there is a modal with the product
- double click quickly on remove button
- click return
- traceback
```
psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type integer: "virtual_12"
LINE 1: ...ETE FROM "stock_return_picking_line" WHERE id IN ('virtual_1...
^
```
When this modal is opened, a `one2many` is built with “virtual” records,
which are the products selected in the transfer.
These records are virtual because we don't know which ones the customer
will keep - we'll only know for sure when he clicks on “Return”.
So, when this o2m is loaded, the setup of the Record class populates it.
A first call to the `_applyCommands` function is made with a command to
create a record (product) (command 0/CREATE).
Once the o2m has been loaded, the customer (who quickly clicks to remove
several products) ends up at some point double-clicking on the remove
button of the same product will trigger two consecutive calls to `_applyCommands`.
The first call (which is the correct call)
will have the command: `[2, “virtual_12”]` which is a `DELETE`.
But as we've already asked to create the same “virtual_12” record,
we are here:
https://github.com/odoo/odoo/blob/7caddbb653aa8235725b48ff9f28d6119fdc3567/addons/web/static/src/model/relational_model/static_list.js#L580-L585
Here, given that we have a delete `virtual_12` command and that just before
the setup we asked to create `virtual_12`, this condition will just remove
the command that creates `virtual_12` to simplify the operation without
creating a `DELETE` command.
So instead of creating it and then deleting it, we just don't create it.
The problem arises with the second click, which triggers exactly the same
call to `_applyCommands`, asking to delete `virtual_12`.
As this time we don't have any more “record creation” pending, we'll
enter here
https://github.com/odoo/odoo/blob/7caddbb653aa8235725b48ff9f28d6119fdc3567/addons/web/static/src/model/relational_model/static_list.js#L583-L585
The second click will ask you to delete a record that never existed in
the `web_save`... so that's what the python server don't like!
To correct the problem, I apply a variable to the button in the dom,
which I set to true when the first click occurs, and which I check on
the second click to ignore it.
opw-[4043992](https://www.odoo.com/web#id=4043992&view_type=form&model=project.task)
Forward-Port-Of: odoo/odoo#173481# Description With the upgrade to Chart.js version 4.3, the configuration for setting legend label colors has changed. The `fontColor` key is now deprecated, and the `color` key must be used instead. This update was previously overlooked in the Odoo chart plugin. This commit resolves the issue by updating the Odoo chart plugin to correctly use the color key for setting legend label colors. Task: [4111089](https://www.odoo.com/odoo/project/2328/tasks/4111089) --- I confirm I ha
Original PR description
# Description With the upgrade to Chart.js version 4.3, the configuration for setting legend label colors has changed. The `fontColor` key is now deprecated, and the `color` key must be used instead. This update was previously overlooked in the Odoo chart plugin. This commit resolves the issue by updating the Odoo chart plugin to correctly use the color key for setting legend label colors. Task: [4111089](https://www.odoo.com/odoo/project/2328/tasks/4111089) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#177420
FixImp, I often add such url assertions with bugfixes, I wanna use this new function with them Testing that we are correctly redirected to a specific URL is something recurrent in both the http framework and website. There are various competiting ways to achieve this. In this work we propose a single go-to function that (1) takes care of sanitizing both URLs to deal with missing scheme/host and (2) ouput a nice assertion message when the urls are different. It uses urllib3 because it pa
Original PR description
FixImp, I often add such url assertions with bugfixes, I wanna use this new function with them Testing that we are correctly redirected to a specific URL is something recurrent in both the http framework and website. There are various competiting ways to achieve this. In this work we propose a single go-to function that (1) takes care of sanitizing both URLs to deal with missing scheme/host and (2) ouput a nice assertion message when the urls are different. It uses urllib3 because it parses "example.com" as `netloc="example.com"` instead of urllib that parses it as `path="example.com"`. Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#177005 Forward-Port-Of: odoo/odoo#176763
Fixes 2 bugs (2nd noticed while investigating the 1st bug): 1. When selecting `create_backorder="always"` for a manufacturing operation type, the auto-printing didn't work for the MOs after they were marked as done. Steps to reproduce: - create a new lot tracked product - set the manufacture operation type `create_backorder="always"` - set the operation type > Hardware > Print When Done > Lot/SN Labels to true - create a MO for the lot tracked product with a product_qty > 1 - set a `l
Original PR description
Fixes 2 bugs (2nd noticed while investigating the 1st bug): 1. When selecting `create_backorder="always"` for a manufacturing operation type, the auto-printing didn't work for the MOs after they were…
Fixes 2 bugs (2nd noticed while investigating the 1st bug): 1. When selecting `create_backorder="always"` for a manufacturing operation type, the auto-printing didn't work for the MOs after they were marked as done. Steps to reproduce: - create a new lot tracked product - set the manufacture operation type `create_backorder="always"` - set the operation type > Hardware > Print When Done > Lot/SN Labels to true - create a MO for the lot tracked product with a product_qty > 1 - set a `lot_producing_id` and mark `qty_producing=1` - click "Produce" button Expected result: MO is backordered + the lot label is auto-printed (i.e. generated and downloaded as a pdf if no iot printer is set up) Actual result: MO is backordered and has a status=Done, but nothing is printed + the values that should be written within `button_mark_done` are not written (i.e. `priority` is not set to 0 and `date_finished` is not set to now()) Issue was due to use of the backorder wizard without passing the MOs that are always backordered as `mrp_production_ids`, this resulted in the MOs being backordered due to the context logic within the backorder wizard, but not applying the rest of the logic within `button_mark_done` that is applied to the `self` records (i.e. the MOs being backordered) 2. If more than 2 manufacturing operation types were set, then depending on the combination of `create_backorder` values, the backordering mechanism might not work. E.g. if `always` + `ask`, the `always` backordering logic would return and ended the logic before the `ask` or `never` MOs backordering logic was ever reached. Steps to reproduce: - set up 2 manufacture operation types, one with `always` and one with `ask`/`never` - set up 2 MOs with product_qty > 1 using the 2 different operation types - mark `qty_producing=1` for each MO and then select both MOs in the list view + action > "Mark as Done" Expected result: the `always` MO is backordered automatically and the `ask` MO has the backorder wizard pop up for it Actual result: the `always` MO is backordered automatically and the `ask` MO does nothing (it is not even set to done) opw-3987144 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#174632
This PR is created in order to sing the odoo CLA and contribute to Odoo. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#176903
Original PR description
This PR is created in order to sing the odoo CLA and contribute to Odoo. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#176903
Currently, the `_run_action_object_create` method (used in particular to propose record creation using a `name` field in automations) assumes that all models have a `name` field, which is not true. In fact, before this commit, we used ```py res = {'name': self.value} res = self.env[self.crud_model_id.model].create(res) ``` This will cause a traceback in models without a `name` field. This commit uses `name_create` directly, which is what it's for. opw-4100885 Forward-Port-Of: od
Original PR description
Currently, the `_run_action_object_create` method (used in particular to propose record creation using a `name` field in automations) assumes that all models have a `name` field, which is not true.
In fact, before this commit, we used
```py
res = {'name': self.value}
res = self.env[self.crud_model_id.model].create(res)
```
This will cause a traceback in models without a `name` field.
This commit uses `name_create` directly, which is what it's for.
opw-4100885
Forward-Port-Of: odoo/odoo#1776021) Start creating a tax 2) Set the 'Tax Computation' to 'Group of taxes' 3) In 'Definition' tab, select 'Add a line', choose to create a new tax 4) Jumpt to 2 Issue: Nested group of taxes are not allowed When adding the child tax users cannot choose group of taxes, but we can't block creation of just a specific type of taxes so we need to check the type afterward opw-4060955 Forward-Port-Of: odoo/odoo#176540 Forward-Port-Of: odoo/odoo#173889
Original PR description
1) Start creating a tax 2) Set the 'Tax Computation' to 'Group of taxes' 3) In 'Definition' tab, select 'Add a line', choose to create a new tax 4) Jumpt to 2 Issue: Nested group of taxes are not allowed When adding the child tax users cannot choose group of taxes, but we can't block creation of just a specific type of taxes so we need to check the type afterward opw-4060955 Forward-Port-Of: odoo/odoo#176540 Forward-Port-Of: odoo/odoo#173889
### Steps to reproduce: - Create and validate a delivery order for some product - Click on the "Detailed Operations" button on top of the picking form #### > You are able to create new move lines on your picking even thought it is done and locked. ### Cause of the issue: The `create` attribute of the view determines if the record can or can not be created. However, it is currently not set in the context of the view called by the `action_detailed_operations`. ### Note: This `a
Original PR description
### Steps to reproduce: - Create and validate a delivery order for some product - Click on the "Detailed Operations" button on top of the picking form #### > You are able to create new move lines on your picking even thought it is done and locked. ### Cause of the issue: The `create` attribute of the view determines if the record can or can not be created. However, it is currently not set in the context of the view called by the `action_detailed_operations`. ### Note: This `action_detailed_operations` did not exist in 16.0. opw-4103700 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#176709
The constraint here fails because when uploading the certificate, password and key through the settings, the values are written one by one on the company, which made it fail in case the password is written first (the constraint would test the password on empty values and throw an error). The groups right is not useful anymore as the flow uses sudo to modify it outside of the settings. Forward-Port-Of: odoo/enterprise#68826 Forward-Port-Of: odoo/enterprise#67874
Original PR description
The constraint here fails because when uploading the certificate, password and key through the settings, the values are written one by one on the company, which made it fail in case the password is written first (the constraint would test the password on empty values and throw an error). The groups right is not useful anymore as the flow uses sudo to modify it outside of the settings. Forward-Port-Of: odoo/enterprise#68826 Forward-Port-Of: odoo/enterprise#67874
### Steps to Reproduce: - Create a field service task > switch the worksheet template to false > add products and timesheets > sign report > error because there is no worksheet template set. ### After this PR: - Allow signing the report when there is no worksheet template, it will be possible to sign and send the report as long as there is content to populate the report with ( products and timesheets). task-3974170 Forward-Port-Of: odoo/enterprise#68787 Forward-Port-Of: odoo/enterprise#
Original PR description
### Steps to Reproduce: - Create a field service task > switch the worksheet template to false > add products and timesheets > sign report > error because there is no worksheet template set. ### After this PR: - Allow signing the report when there is no worksheet template, it will be possible to sign and send the report as long as there is content to populate the report with ( products and timesheets). task-3974170 Forward-Port-Of: odoo/enterprise#68787 Forward-Port-Of: odoo/enterprise#65367
The tour `test_sections_tour` fails undeterministically. It fails after opening the the variant, then opening another section of it. The issue is that we try to open the second section just before the preloading of this section happens. The opening of it enters `loadReportOptions`, has no loadingCallNumber as it is the first opening. We then stop at the call to `get_options`. Then, the preloading can happen (which is why it's undeterministic). We enter the `if` in `preLoadClosedSection
Original PR description
The tour `test_sections_tour` fails undeterministically. It fails after opening the the variant, then opening another section of it. The issue is that we try to open the second section just before the preloading of this section happens. The opening of it enters `loadReportOptions`, has no loadingCallNumber as it is the first opening. We then stop at the call to `get_options`. Then, the preloading can happen (which is why it's undeterministic). We enter the `if` in `preLoadClosedSections`, as the options are not yet of the second section. We then increment loadingCallNumber, which means it's not in sync with the call that was made to the python. If the options call comes back now, we don't remake a call with the new loadingCallNumber. runbot-75429 runbot-74795 Forward-Port-Of: odoo/enterprise#68539
Forward-Port-Of: odoo/enterprise#68704
Original PR description
Forward-Port-Of: odoo/enterprise#68704
Some improvements in EDI to support factoring operations. The tag "plazo" and "unidadTiempo" are mandatory in order to a company can be a factor . (Sell off all of its outstanding invoices at one time, rather than having to wait on collecting payments from customers) - Rename tag "RespuestaAutorizacion" to "autorizacion" - Add tag "plazo" and "unidadTiempo" in Sales Invoices and Debit Note (not only for Purchase liquidation) - Modify unit tests Forward-Port-Of: odoo/enterprise#67572
Original PR description
Some improvements in EDI to support factoring operations. The tag "plazo" and "unidadTiempo" are mandatory in order to a company can be a factor . (Sell off all of its outstanding invoices at one time, rather than having to wait on collecting payments from customers) - Rename tag "RespuestaAutorizacion" to "autorizacion" - Add tag "plazo" and "unidadTiempo" in Sales Invoices and Debit Note (not only for Purchase liquidation) - Modify unit tests Forward-Port-Of: odoo/enterprise#67572
Accessing a linked repair record through Helpdesk can lead to a blocking bug where the user is unable to generate a quote through the repair record. ### Description of the issue : 1) When generating a `repair.order` record through a Helpdesk ticket or accessing an existing linked repair order through the smart button, the context key for `default_team_id` will be inherited. In this case referencing the id of the current `helpdesk.team` record. 2) When trying to generate a quote through
Original PR description
Accessing a linked repair record through Helpdesk can lead to a blocking bug where the user is unable to generate a quote through the repair record. ### Description of the issue : 1) When generating…
Accessing a linked repair record through Helpdesk can lead to a blocking bug where the user is unable to generate a quote through the repair record. ### Description of the issue : 1) When generating a `repair.order` record through a Helpdesk ticket or accessing an existing linked repair order through the smart button, the context key for `default_team_id` will be inherited. In this case referencing the id of the current `helpdesk.team` record. 2) When trying to generate a quote through the repair order, an edge case can happen where a ValidationError is triggered at sale order creation. ``` The operation cannot be completed: another model requires the record being deleted. If possible, archive it instead. Model: Sales Order (sale.order) Constraint: sale_order_team_id_fkey ``` This is due to the fact that the `sales.order` also uses a `default_team_id` context key to designate the default sales team. If by happen stance, the referenced `id` values does not match an existing `crm.team` record, you will hit the above foreign key constraint blocking the user from generating the quote. ### Proposed fix : Functionally it makes no sense to pass the `default_team_id` context value from helpdesk to sales order, as both implicitly reference different models and functional entities. Since the `_prepare_repairs_default_value` was already introduced in https://github.com/odoo/enterprise/commit/edd88ebdcc60b7c4d261bfb8755e910356684a3f to handle the context value preparation when using the repair smart button, the simplest solution is to set the `default_team_id` context key to `False`, thus not passing it later on to the sales order (i.e. the quote will not have a default sales team, but the user can still manually define one) ### How to reproduce: 1) Set up a DB with sales, helpdesk and repairs installed 2) If using demo data, just create a handful of new helpdesk teams (`helpdesk.team`). The important part is that you have at least one record with an id that will not be present in the `crm.team` table 3) For the helpdesk team matching the above criteria, activate the Repairs option (`use_product_repairs`) in the team configuration 4) Create a helpdesk ticket for that helpdesk team, create a repair order using the action button, then try using the Create Quotation action button (`action_create_sale_order`) → Validation Error is triggered OPW-4123410 Forward-Port-Of: odoo/enterprise#68822
In 8f74d9d the french translation for the accounting financial reports where forgotten. This add the missing translated terms opw-4124296 Forward-Port-Of: odoo/enterprise#68781
Original PR description
In 8f74d9d the french translation for the accounting financial reports where forgotten. This add the missing translated terms opw-4124296 Forward-Port-Of: odoo/enterprise#68781
When the user was connecting an IoT to the database there was no notification or any information to tell him that he succeded / failed / had to wait to see it in the "connected" list. We now display those notifications. Task: 4104811 Forward-Port-Of: odoo/enterprise#68394
Original PR description
When the user was connecting an IoT to the database there was no notification or any information to tell him that he succeded / failed / had to wait to see it in the "connected" list. We now display those notifications. Task: 4104811 Forward-Port-Of: odoo/enterprise#68394
This commit removes the 2 updates on data record created in product_barcodelokup module as they were introduced in stable version. Meaning having `product_barcodelokup` installed then fetch commit 50a4b00a7dde then installing `website_sale` will try to update records that doesn't exist yet. Sentry 5731062091 Forward-Port-Of: odoo/enterprise#68757
Original PR description
This commit removes the 2 updates on data record created in product_barcodelokup module as they were introduced in stable version. Meaning having `product_barcodelokup` installed then fetch commit 50a4b00a7dde then installing `website_sale` will try to update records that doesn't exist yet. Sentry 5731062091 Forward-Port-Of: odoo/enterprise#68757
### Steps to reproduce: - Create a fiscal position that converts 19% tax-inclusive into 19% tax-exclusive. - Create a product with 19% tax inclusive. - Create a contact and assign the above fiscal position. - Navigate to a field service project and add an employee with a tax-included rate in the employee mapping. - Create a new field service task for the customer with the assigned fiscal position and add one hour for the employee in the mapping. - Add the product with 19% tax included to
Original PR description
### Steps to reproduce: - Create a fiscal position that converts 19% tax-inclusive into 19% tax-exclusive. - Create a product with 19% tax inclusive. - Create a contact and assign the above fiscal…
### Steps to reproduce: - Create a fiscal position that converts 19% tax-inclusive into 19% tax-exclusive. - Create a product with 19% tax inclusive. - Create a contact and assign the above fiscal position. - Navigate to a field service project and add an employee with a tax-included rate in the employee mapping. - Create a new field service task for the customer with the assigned fiscal position and add one hour for the employee in the mapping. - Add the product with 19% tax included to the task. - Mark the task as done. #### Current Behavior: - The product unit price is calculated excluding tax. - The service unit price remains calculated as tax-included. #### Expected Behavior: Both product and service unit prices should be calculated consistently as tax-excluded when the tax is set to 19% exclusive. ### Cause of the issue: When creating a new sale order line if the unit price is not specified "product_id_change" is called which set the correct unit price after applying the fpos by calling `_update_taxes` on the line: https://github.com/odoo/odoo/blob/a09e0c651ea54faa3b41e6012b6d62f143519f07/addons/sale/models/sale_order_line.py#L617-L628 But in our case we are setting the `unit_price` to the employee rate here: https://github.com/odoo/enterprise/blob/e23e01337faeec652d400618cf14aaf3d6d47ef2/industry_fsm_sale/models/project_task.py#L408-L412 and the taxes are not taken into account. ### Fix: The unit price of the employee rate should be updated to reflect the changed taxes from fpos. However, since `_update_taxes` relies on the unit price of the product rather than on the one given to the line: https://github.com/odoo/odoo/blob/a09e0c651ea54faa3b41e6012b6d62f143519f07/addons/sale/models/sale_order_line.py#L685 we can not call the `_update_taxes` directly to update the sol. opw-3853196 Co-authored-by: waha <waha@odoo.com> Forward-Port-Of: odoo/enterprise#67730