Thursday, March 6, 2025
7 changes · saas-17.4
Miscellaneous changes
…g payment term Steps to reproduce: - create an invoice - define the "30 days payment term" - save the invoice - define a discount for the 30 days payment term - confirm the invoice - Preview the invoice Issue: - Stack Trace Cause: There is no discount_date added when modifying the payment term (makes sense, we will not modify every line linked to move having that payment term) Solution: ugly fallback but but since the field is not required and no recomputation is done and
Original PR description
…g payment term Steps to reproduce: - create an invoice - define the "30 days payment term" - save the invoice - define a discount for the 30 days payment term - confirm the invoice - Preview the invoice Issue: - Stack Trace Cause: There is no discount_date added when modifying the payment term (makes sense, we will not modify every line linked to move having that payment term) Solution: ugly fallback but but since the field is not required and no recomputation is done and the ps tech needs this for one of their module and the flow is easily reproducible we have enough reasons to apply it opw-4619835 Forward-Port-Of: odoo/odoo#200017
Steps: - Create and confirm an invoice with 3 lines for the same product P: 1 - 10 quantity, 10$ 2 - 5 quantity, 5$ 3 - 20 quantity, 2$ - Go to invoice analysis, pivot view - Filter to see only product P - Measure Untaxed Amount, Product Quantity and Average Price -> The average price is 5.67 instead of 4.71 This is because the SQL query calculates the average of each line before calculating the average of the 3 lines instead of calculating the global average. With this commit,
Original PR description
Steps:
- Create and confirm an invoice with 3 lines for the same product P:
1 - 10 quantity, 10$
2 - 5 quantity, 5$
3 - 20 quantity, 2$
- Go to invoice analysis, pivot view
- Filter to see only product P
- Measure Untaxed Amount, Product Quantity and Average Price
-> The average price is 5.67 instead of 4.71
This is because the SQL query calculates the average of each line before
calculating the average of the 3 lines instead of calculating the global
average.
With this commit, we override the `read_group` method to make the
correct calcultaion of the average price.
opw-4503562
Forward-Port-Of: odoo/odoo#196975Steps to reproduce: - create a new quotation - select a customer with another langage than the current user - add a product - add a discount using the discount button (select "global amount" or "fixed amount") Problem: Inside "order lines" from the quotation, the "description" column in the line created for the discount product is not translated. https://github.com/odoo/odoo/blob/c62e8d90db481fb7ba28e888431b6a7dc5ed03cd/addons/sale/wizard/sale_order_discount.py#L126 opw-4534846 Fo
Original PR description
Steps to reproduce: - create a new quotation - select a customer with another langage than the current user - add a product - add a discount using the discount button (select "global amount" or "fixed amount") Problem: Inside "order lines" from the quotation, the "description" column in the line created for the discount product is not translated. https://github.com/odoo/odoo/blob/c62e8d90db481fb7ba28e888431b6a7dc5ed03cd/addons/sale/wizard/sale_order_discount.py#L126 opw-4534846 Forward-Port-Of: odoo/odoo#197892
### Steps to reproduce: - In Sale create an empty sale order and confirm - In Expense > Configuration > Expense Categories > Mileage set the price per km to be 1 and "Re-Invoice Expenses" to "Sales price" - Create a new expense - Change the category to "Mileage" - Set a quantity >1 - In "Customer to Reinvoice" select the one from the quotation - Click "Create Report" > "Submit to Manager" > "Validate" > "Post Journal Entries" - Return to the sale order - The number under "Delivered" is
Original PR description
### Steps to reproduce: - In Sale create an empty sale order and confirm - In Expense > Configuration > Expense Categories > Mileage set the price per km to be 1 and "Re-Invoice Expenses" to "Sales price" - Create a new expense - Change the category to "Mileage" - Set a quantity >1 - In "Customer to Reinvoice" select the one from the quotation - Click "Create Report" > "Submit to Manager" > "Validate" > "Post Journal Entries" - Return to the sale order - The number under "Delivered" is 1, it should be the same as the quantity ### Cause: When creating the move from the expense, the quantity is not given and defaults to 1. ### Solution: Add the quantity to the `payments_vals`. opw-4389303 Forward-Port-Of: odoo/odoo#192524
When handling errors on runbot, it can be difficult to know where a message comes from. It can be problematic to identify automatically the source of an error. This branch give the possibility to add metadata to log_db. The current only metadata is the canonical tag. Some other information, like the stack, or the subtest could be added in the future. This is not the case for now to make the review easier. ```patch def get_log_metadata(self): + stack = traceback.format_
Original PR description
When handling errors on runbot, it can be difficult to know where a message comes from. It can be problematic to identify automatically the source of an error.
This branch give the possibility to add metadata to log_db.
The current only metadata is the canonical tag.
Some other information, like the stack, or the subtest could be added in the future. This is not the case for now to make the review easier.
```patch
def get_log_metadata(self):
+ stack = traceback.format_stack()
+ start = next((index for index, frame in enumerate(stack) if self._testMethodName in frame), 0)
metadata = {
'canonical_tag': self.canonical_tag,
+ 'stack': '\n'.join(traceback.format_stack()[start:-7]),
+ 'subtest': str(self._subtest),
}
return metadata
```
Forward-Port-Of: odoo/odoo#199964This commit adds a check to prevent deprecating an account that is used in tax distribution lines. It serves as an indirect fix to avoid future issues in other contexts. For example, in the Italian EDI flow, if an XML bill includes a tax with a distribution line linked to a deprecated account, an error will be raised by the following code: https://github.com/odoo/odoo/blob/cc3a060e67a2f1015ea02b589dcf6a7e7eff1e90/addons/account/models/account_move_line.py#L1478 This commit aims to minimize s
Original PR description
This commit adds a check to prevent deprecating an account that is used in tax distribution lines. It serves as an indirect fix to avoid future issues in other contexts. For example, in the Italian EDI flow, if an XML bill includes a tax with a distribution line linked to a deprecated account, an error will be raised by the following code: https://github.com/odoo/odoo/blob/cc3a060e67a2f1015ea02b589dcf6a7e7eff1e90/addons/account/models/account_move_line.py#L1478 This commit aims to minimize such issues by preventing them as early as possible. Steps to reproduce: - Try to deprecate an account that is used in tax distribution lines. Forward-Port-Of: odoo/odoo#197521
Before Commit: --------------- - Shipping rates were retrieved based on the total shipping weight calculated from product. - Manually adjusted weights were not considered in the rate retrieval, causing inconsistencies. After Commit: ------------- - The weight computation for the packages was updated to take into consideration the manually modified order weight. - If an adjusted weight is provided, it will be used for rate calculations; otherwise, the calculated weight will be used. - T
Original PR description
Before Commit: --------------- - Shipping rates were retrieved based on the total shipping weight calculated from product. - Manually adjusted weights were not considered in the rate retrieval, causing inconsistencies. After Commit: ------------- - The weight computation for the packages was updated to take into consideration the manually modified order weight. - If an adjusted weight is provided, it will be used for rate calculations; otherwise, the calculated weight will be used. - This fix prevents confusion and ensures that the shipping rate reflects the actual weight of the order as adjusted by the user. task-4203065 Forward-Port-Of: odoo/odoo#189392