Friday, September 27, 2024
14 changes · 17.0
Resolved issues and error corrections
This update aligns the Swedish tax reporting module's tests with recent changes made in the main Odoo community version. The tests have been updated to ensure they continue to work correctly with the latest tax report functionality, maintaining compatibility between the enterprise and community versions.
Original PR description
Community PR: odoo/odoo#181747 Forward-Port-Of: odoo/enterprise#70844
This fix resolves two critical issues with Mexican electronic invoicing (CFDI) when processing payments for public recipients. Previously, the payment policy was incorrectly set to immediate payment regardless of actual payment terms, and payments could not be signed when using the generic tax ID. These issues are now corrected, allowing businesses to properly process and sign payments for public customer invoices.
Original PR description
**Steps to reproduce:** - Install l10n_mx_edi - Switch to a Mexican company (e.g. ESCUELA KEMPER URGATE) - Create an invoice: * Customer: [a Mexican customer] (e.g. INMOBILIARIA CVA) * CFDI to public: [Checked] * Invoice Date: [Today] * Payment terms: [the following month] (e.g. 30 Days) - Confirm the invoice - Register a payment **Issues:** 1) "Payment Policy" is PUE no matter what the dates are because "CFDI to public" has been checked. 2) It is not possible to sign the payment when the generic rfc (i.e. XAXX010101000) is used. opw-4145716 opw-4127870
This fix allows tasks to be automatically created when adding non-recurring service products to subscription upsells. Previously, task creation was blocked for all upsell products due to pricing proration limitations. Since non-recurring products are not prorated, they can now safely create tasks without technical issues.
Original PR description
Steps to reproduce: - Download 'Project' and 'Subscription' - Create a product with: -- Product type: 'Service' -- Create on order: 'Task' -- Project: Pick any -- Recurring checkbox must not be…
Steps to reproduce: - Download 'Project' and 'Subscription' - Create a product with: -- Product type: 'Service' -- Create on order: 'Task' -- Project: Pick any -- Recurring checkbox must not be ticked - Subscription > New > Add any recurring product > Confirm - Create invoice > Confirm invoice > Back to subscription - Upsell > Add your task creation product > Confirm - The project is linked but no task is created The ability to create tasks from upsell orders was disabled in cbbc70f73e6fe9e29e27dea4415e20a262bbdf82. According to the commit message, this was done because upsell orders prorate the price of subscriptions accoding to the time until next invoice relative to the subscription's recurrence (i.e. if the upsell is created halfway through the recurrence it is discounted by 50% etc...). Since we do not have a way to prorate tasks it is marked as a technical limitation. This however does not need to extend to non-recurring products on subscription sale orders as they are not prorated. opw-4114049
This fix addresses two issues with appraisal feedback deadlines. First, employees can now no longer submit feedback after the deadline has passed. Second, managers can continue to view submitted feedback even after the deadline has expired. These changes ensure that feedback deadlines are properly enforced while still allowing managers to access and review the feedback they've received.
Original PR description
Issue 1: ======== To reproduce: ------------- - on an appraisal request -> ask for feedback -> set a deadline - the employee can answer after the deadline Problem: -------- the method…
Issue 1: ======== To reproduce: ------------- - on an appraisal request -> ask for feedback -> set a deadline - the employee can answer after the deadline Problem: -------- the method `_check_validity` was overriden in `hr_appraisal_survey` module to do different checks than the original method in `survey` module in case of `validity_code = answer_wrong_user`, but this override bypasses the other checks in the original method like the deadline check. Solution: --------- call the original method `_check_validity` in the override, to make sure all the checks are done, then if the original method returns `validity_code = answer_wrong_user` we can do our specific checks. Issue 2: ======== To reproduce: ------------- - on an appraisal request -> ask for feedback -> set a deadline - manager can't see the answers after the deadline Problem: -------- - to display answer in appraisal module we rely on the url of the survey that contains the tokens for suervey/answer - the deadline handling is done in the survey module where the url is dead after the deadline which is not suitable for the appraisal module Solution: --------- - override the method `_get_access_data` and bypass the deadline check in case of appraisal feedback for manager. opw-4128638
Fixed an issue where the expiration date field was incorrectly disabled when receiving lot-tracked products in the barcode app. The date picker now works properly when either "Use Existing" or "Create New" options are enabled for lot/serial number configuration, allowing warehouse staff to accurately record product expiration dates during inventory receipts.
Original PR description
The problem was that the date picker was disabled when we have Use Existing ones only enabled, but it should be enabled when "Use Existing ones" is checked or "Create New" in the config of "Lots/Serial Numbers". Steps to reproduce: - add a product tracked by lots and have also enabled expiration dates - inventory Receipts configuration - in general, check both options "Use Existing ones" and "Create New" under "Lots/Serial Numbers" - now if you receive product in barcode app, you will see expiration date of the lots disbaled opw-4086325 Forward-Port-Of: odoo/enterprise#68008
This update fixes problems that occur when helpdesk tickets are merged together. Previously, merging tickets would create duplicate SLA policy entries and lose follower information. The fix ensures that duplicate SLA policies are removed, followers are properly preserved, and only the most urgent deadline is kept for each policy type when tickets are combined.
Original PR description
Steps to reproduce: - Helpdesk > Configuration > SLA policies - Create one if necessary or use existing - Helpdesk > Tickets > Create - Configure it so that it corresponds to SLA requirements -…
Steps to reproduce: - Helpdesk > Configuration > SLA policies - Create one if necessary or use existing - Helpdesk > Tickets > Create - Configure it so that it corresponds to SLA requirements - Duplicate the ticket and merge them both (data_merge module required) Currently helpdesk ticket uses the default merge fuction, which simply concatenates the values of merged records. This causes a few strange things to happen: 1. sla_ids which registers SLA policy types, has duplicate entries. This recordset should remain a set. 2. Followers of the merged tickets are sometimes not added to the resulting record. The default merge simply swaps the resource id with no regard for a possible duplication of unique key (res_model, res_id, partner_id), which causes the transaction to fail on repeat followers. This is a common problem with every record inheriting mail.thread which does not define its own merge function as well. 3. Keeping every SLA status record is redundant, merging tickets makes it impossbile to keep track of which task each deadline was originally related to anyway. Hence why we only keep those with the shortest deadline for each type. Priority is not a concern here since SLA policies are recomputed according to a ticket's priority rating, so we cannot have 2 SLAs with the same policy and different priorities. opw-4037262
This fix prevents an application error that occurred when users tried to send WhatsApp messages after deleting a contact. The system was attempting to access information about a contact that no longer existed, causing the messaging feature to crash. With this fix, the WhatsApp messaging feature now handles deleted contacts gracefully without interrupting the user experience.
Original PR description
Steps to reproduce the error: - Install "contacts" and "whatsapp" module - Configure WhatsApp Business Account and create a whatsapp template - Go to Contacts > Create a new contact > add mobile…
Steps to reproduce the error:
- Install "contacts" and "whatsapp" module
- Configure WhatsApp Business Account and create a whatsapp template
- Go to Contacts > Create a new contact > add mobile number >
click on whatsapp button > select template > send message
- reply to message from mobile number
- Delete contact
- Go to Discuss > open channel of contact > send message
Traceback:
```
IndexError: tuple index out of range
File "odoo/http.py", line 2256, in __call__
response = request._serve_db()
File "odoo/http.py", line 1832, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1852, 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 1830, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1837, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2062, 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 742, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "home/odoo/src/enterprise/saas-17.2/whatsapp/controller/main.py", line 41, in webhookpost
request.env['whatsapp.message']._process_statuses(value)
File "home/odoo/src/enterprise/saas-17.2/whatsapp/models/whatsapp_message.py", line 413, in _process_statuses
whatsapp_message_id._update_message_fetched_seen()
File "home/odoo/src/enterprise/saas-17.2/whatsapp/models/whatsapp_message.py", line 426, in _update_message_fetched_seen
channel_member = channel.channel_member_ids.filtered(lambda cm: cm.partner_id == channel.whatsapp_partner_id)[0]
File "odoo/models.py", line 6580, in __getitem__
return self.browse((self._ids[key],))
```
https://github.com/odoo/enterprise/blob/a134bea9c6fa1a0806c5501046e358c82d7a3fe5/whatsapp/models/whatsapp_message.py#L428
Here, when user deletes the contact, channel.whatsapp_partner_id will be False,
and channel_member will become an empty tuple,
So when it tries to access the index of an empty tuple,
It will lead to the above traceback.
sentry-5314291061This fix resolves an issue where Kenyan companies using subcontracting workflows encountered validation errors when processing purchase orders. The system was incorrectly preventing negative stock quantities in subcontracting locations, which are internal locations without warehouses and should allow negative quantities. The fix ensures that stock validation only applies to locations with actual warehouses, allowing subcontracting operations to complete successfully.
Original PR description
Steps to reproduce the bug: - Log in as a Kenyan company - Create a storable product “P1” with the following Bill of Materials (BoM): - Type: Subcontracting - Subcontractor: Azure Interior -…
Steps to reproduce the bug:
- Log in as a Kenyan company
- Create a storable product “P1” with the following Bill of Materials (BoM):
- Type: Subcontracting
- Subcontractor: Azure Interior
- Component:
- C1: - Routes: “Resupply Subcontractor on Order”
- Create a purchase order for one unit of “P1”
- Confirm the PO
- Create a second PO for one unit of “C1” and receive it
- Confirm the resupply picking of C1
- Confirm the receipt of P1
**Problem:**
A validation error is triggered: “You cannot end up with a negative stock quantity.”
We added a constraint to prevent negative stock quantities in internal locations for a company in Kenya. However, the location linked to subcontracting is internal but has no warehouse, so we don’t care if its quantity is negative, and it should be ignored. This could also happen with other internal locations that don’t have a warehouse.
Additionally, when reporting stock quantities, we only consider
quantities in locations that have a warehouse:
https://github.com/odoo/enterprise/blob/9dea0f2696084235ee1192b0a14adfa43eb732ef/l10n_ke_edi_oscu_stock/models/product.py#L47
opw-4184857A technical issue was causing the tax closing entries report to crash with an error. The problem occurred when the system tried to access company information while processing multiple companies' data. This fix ensures the report generates successfully without interruption, improving the reliability of tax reporting functionality.
Original PR description
The `RuntimeError: dictionary changed size during iteration` occurred in the `_generate_tax_closing_entries` method when iterating over the `closing_moves_by_company` dictionary. This happened because accessing a key in a `defaultdict` that doesn't exist automatically creates that key with a default value. Specifically, the line: ```py if from_post and move == closing_moves_by_company[self.env.company]: ``` triggered the insertion of a new key when `self.env.company` was not already present, leading to the runtime error. This commit changes the access method to use `.get()` instead of directly accessing the key allowing, safe retrieval of the value without modifying the dictionary. opw-4089738
This fix resolves an issue where customers paying for subscription invoices through a website portal would encounter errors when multiple companies are configured. The problem occurred because the system was trying to access company information that the customer didn't have permission to view. The fix ensures the correct company context is set before processing invoice payments, allowing customers to successfully complete their subscription payments.
Original PR description
To reproduce the bug: 1. Install the subscription feature on your website. 2. Create a second company and link it to the website. 3. Create a recurring product with the service type. 4. In the…
To reproduce the bug: 1. Install the subscription feature on your website. 2. Create a second company and link it to the website. 3. Create a recurring product with the service type. 4. In the subscription app, create a quotation with the specified product. 5. Preview the invoice for the quotation. 6. Copy the link for the portal invoice and open it in an incognito window. 7. Pay the invoice. You will encounter a TraceBack error depending on the modules installed. This is due to the `company_id` being set to an empty record as a result of how it is computed here: https://github.com/odoo/odoo/blob/17.0/addons/account/models/account_move.py#L696-L698 In our case, `move.journal_id.company_id` (the invoice company) exists, so `self.env.company` (the website company) gets ignored. However, since the public user of the website doesn't have access to the invoice company, the `company_id` is set to an empty record after checking the access rights with `._accessible_branches()[:1]`. opw-3999546
This fix resolves an issue where timesheet overtime warnings and formatting would randomly change appearance due to floating-point rounding errors in calculations. The system now uses a small tolerance level when comparing time values instead of exact matches, ensuring consistent and reliable display of timesheet status regardless of working schedule configurations.
Original PR description
Steps to reproduce: - Employees > Configuration > Working schedules - Set your working schedule to have non round numbers (Not mandatory but makes the issue much easier to reproduce) - Timesheets > Edit to have the required hour total - Sometimes rounding errors will cause the formatting to change (Overtime of +0:00, display in red...) This issue is not deterministic but we currently use exact comparisons between floats to determine the formatting so it could happen anytime. The error margin was chosen to be much lower than what a difference of 1min could cause (Since the rounding errors are in the vicinity of 1e-16). opw-4123649
This fix resolves an access issue where assigned users couldn't view tasks in projects with restricted visibility settings. The problem occurred because the system was incorrectly blocking access to task information for users who were assigned to the task but not project followers. The fix ensures assigned users can properly access their assigned tasks regardless of project visibility restrictions.
Original PR description
Steps to reproduce: - Project > New > Create Project - Project > ':' menu > Settings > Settings tab - Set 'Visibility' to 'Invited Internal Users' - Create a task and assign it to Marc Demo - General…
Steps to reproduce: - Project > New > Create Project - Project > ':' menu > Settings > Settings tab - Set 'Visibility' to 'Invited Internal Users' - Create a task and assign it to Marc Demo - General Settings > Users & Companies > Users - Edit Marc Demo to have 'User' access rights in 'Project' - As Marc Demo: Project > Tasks > My Tasks > Click your task Access is denied because Marc is not a follower of the project, and therefore cannot read the task's 'is_fsm' field (which is computed from the project). Due to the specifications of the visibility mode, the task should however be accessible to him. A fix was previously made for a similar issue in Field Service 5fc4f7d15e56d2b4335aa70e896fdfbd901d6076, where we changed the _search_is_fsm function to sudo the project for the same reason as here (accessing project_id.is_fsm) so this should not raise any additional security concerns. In that same fix we switched from a related field to a compute, compute_sudo was however defaulting to False since is_fsm is not stored, hence the access error. opw-4176243
This update fixes three important issues with Uruguay's electronic invoice system (l10n_uy_edi). Users can now correct invoices that fail validation by resetting them to draft without encountering document number errors. The send and print feature now works correctly by running after invoices are posted rather than before. Additionally, the account setup instructions have been simplified and updated.
Original PR description
**[FIX] l10n_uy_edi: Do not check latam document number** When an invoice sent to DGI returns errors (e.g., wrong partner or other data issues), users can reset it to draft and make corrections. However, changing the partner triggers a validation error because the invoice lacks a valid latam document number (only provided by DGI after processing). To avoid this, resetting the invoice to draft clears the invoice name, allowing users to fix any errors without triggering the validation. **[FIX] l10n_uy_edi: Create Uruware account help** Improved the helper to remove "admin email" (since it no longer applies) and updated translations accordingly. **[FIX] l10n_uy_edi: Send and Print after Post** Fixed an issue where the send and print wizard was triggered before the invoice was posted, causing errors. The wizard now only runs after the invoice has been successfully posted.
This fix corrects an issue where Amazon orders containing multiple items were incorrectly creating a separate shipping line for each item. Now, shipping is properly consolidated into a single line per order, ensuring accurate order records and preventing billing confusion.
Original PR description
If an Amazon order has more than one item it was creating for each item an own shipping line. Info: @wt-io-it