Wednesday, February 12, 2025
2 changes · saas-18.1
Resolved issues and error corrections
Installing the Expenses app no longer fails if the default Expense product category was previously deleted in Invoicing. This helps users complete setup smoothly instead of encountering a blocking error.
Original PR description
Currently a Traceback appears when the user delete the `Expense` category in `Invoicing`. **Error:** ``` ValueError: External ID not found in the system: product.product_category_expenses ParseError…
Currently a Traceback appears when the user delete the `Expense` category in `Invoicing`.
**Error:**
```
ValueError: External ID not found in the system: product.product_category_expenses
ParseError
while parsing /home/odoo/src/odoo/saas-18.1/addons/hr_expense/data/hr_expense_data.xml:5, somewhere inside <record id="expense_product_meal" model="product.product">
<field name="name">Meals</field>
<field name="description">Restaurants, business lunches, etc.</field>
<field name="standard_price">0.0</field>
<field name="type">service</field>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="default_code">FOOD</field>
<field name="can_be_expensed" eval="True"/>
<field name="sale_ok" eval="False"/>
<field name="purchase_ok" eval="False"/>
<field name="categ_id" ref="product.product_category_expenses"/>
<field name="image_1920" type="base64" file="hr_expense/static/img/food.svg"/>
</record>
```
### Steps to reproduce above error :-
- Install `Invoicing` application (without demo data).
- Invoicing > Configuration > Categories > Delete `Expense`
- Install `Expenses` application
The error occurs because the user deleted the category, then installed `Expenses` module, which reference the missing product category.
This commit resolves the error by providing a False value for the field if the product category is missing.
sentry-6235143606Payroll batch generation no longer fails if the “Out of Contract” work entry type was deleted. This helps payroll teams continue creating payslips instead of being blocked by a configuration-related error.
Original PR description
Currently, an exception is generated when the system tries to find the 'Out of Contract' work_entry_type after it has been deleted. Steps to Reproduce: 1 - Install hr_payroll module 2 - Navigate to Payroll -> Configuration -> Work Entry Types 3 - delete the 'Out of contract' work entry type 4 - Navigate to Payroll -> Payslips -> Batches 5 - tries to create and generate payslips 6 - an error occurs Error: ```ValueError External ID not found in the system: hr_payroll.hr_work_entry_type_out_of_contract ``` This issue[1] occurs because when the system tries to reference the missing 'Out of Contract' work entry type it results in a ValueError due to a missing required record. [1] - https://github.com/odoo/enterprise/blob/60246c6482a7bf016ea1cbb5c31a693928466e94/hr_payroll/models/hr_payslip.py#L689 This fix resolves the issue by providing a False value when the 'Out of Contract' Work Entry Type is missing. sentry-6277939517