Daily updates from Odoo
Navigate
Branch
Tuesday, April 9, 2019
14 changes
New functionality added to Odoo
This adds a way to run certain actions only after a business transaction has been fully saved, reducing the risk of emails or invoice-signing calls being sent too early. It is especially useful for processes that contact external systems, such as country-specific electronic invoicing services.
Original PR description
Run only if the system is absolutely sure that the method didn't
trigger any blocking point.
Useful for invoice sign fashion, send emails or other processes
connecting to external systems
@rco-odoo this PR will be useful for all countries where an invoice signed is required.
Example for l10n_mx_edi
```python
@api.run_after_commit
def call_external_service(self):
...
```
Similar to `send_email`
```python
@api.run_after_commit
def send(self):
...
class Partner(...):
...
emails.with_context(run_after_commit=send_after_commit).send()
```
What do you think?Enhancements to existing features
The website shop now avoids unnecessary cart and pricing checks when visitors browse without an active cart. This reduces database work on every page load, making pages load faster for public visitors.
Original PR description
website_sale adds a call to `sale_get_order` to website.layout, and thus every page on the website (to display the shopping cart state). Before this, that results in a call to `get_pricelist_available` on every page load, even for a public user with no cart (/SO). This, in turn, triggers 2 different computations of property_product_pricelist with an overhead of ~20 queries, for 20ms (total) / 10ms (sql). Instead, if the user doesn't have a cart and we're not in a case of needing to create one, just early return without messing about with pricelists. Loading "/" with just website_sale installed on a new DB, - before: 53 queries, 31ms ±5 (sql), 75ms ±5 (all) - after: 32 queries, 21ms ±1 (sql), 53ms ±3 (all)
Wire transfer payment references are now simplified to reduce confusion for customers. This helps customers enter the correct reference when paying, lowering the chance of payment matching or encoding errors.
Original PR description
Task id: 1946656 Pad link : https://pad.odoo.com/p/r.bd5dea5d7936420481a575c627ddf8f8
Pricelist forms now allow users to directly edit multiple prices for products, making price management faster and more convenient. These changes are also reflected on product records, helping keep pricing information consistent across the system.
Original PR description
Task:https://www.odoo.com/web#id=1904777&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720 Pad:https://pad.odoo.com/p/r.7c36cb00cfa2f925896a6f9131e5880e -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Manufacturing orders now give teams better control over lot and serial number creation during production, helping prevent unauthorized or accidental entries. The update also supports splitting finished production across multiple lots and brings byproduct handling more directly into the manufacturing workflow.
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
Customers are now informed directly on the payment form when a selected payment provider adds extra fees. This improves price transparency before checkout or invoice payment, reducing surprises and support issues.
Original PR description
Description of the issue/feature this PR addresses: - Task - https://www.odoo.com/web#id=1845815&action=327&model=project.task&view_type=form&menu_id=4720 - Pad - https://pad.odoo.com/p/r.46398252f0f3bd6166bd7d5b30c0b183 Current behavior before PR: - Customer was not getting any warning regarding the extra fees taken by the payment acquirer. Desired behavior after PR is merged: - Customer will be notified on the **payment form** regarding extra fees taken by the payment acquirer. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Studio no longer offers grid views for creation or editing because they require specific business logic to work properly. When users open Studio from an existing grid view, they are redirected to the Views menu instead, preventing unsupported read-only configurations.
Original PR description
Task link : https://www.odoo.com/web?debug#id=1895408&action=327&model=project.task&view_type=form&menu_id=4720 Pad link : https://pad.odoo.com/p/r.03fb1819654d6a0dc1959cc569f6a672 User should not be allow to activate studio on Gridview. This commit is related to task ID 1895408
Manufacturing work orders now suggest reserved lot or serial numbers for components, reducing manual entry during production. The update also lets manufacturers split finished goods across multiple lots while adding controls to prevent unauthorized creation of new lots or serial numbers during work orders.
Customers will now see a notice on the payment form when a payment provider may charge extra fees. This improves transparency before payment confirmation and helps reduce surprises or complaints related to subscription payments.
Original PR description
Description of the issue/feature this PR addresses: - Task - https://www.odoo.com/web#id=1845815&action=327&model=project.task&view_type=form&menu_id=4720 - Pad - https://pad.odoo.com/p/r.46398252f0f3bd6166bd7d5b30c0b183 Current behavior before PR: - Customer was not getting any warning regarding the extra fees taken by the payment acquirer. Desired behavior after PR is merged: - Customer will be notified on the **payment form** regarding extra fees taken by the payment acquirer. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Odoo Studio now makes selection field values easier to enter and manage by showing them as an editable list with a clear option. When users confirm the dialog, the last entered value is saved automatically, reducing confusion and missed entries.
Original PR description
**Improvement in studio selection field values:** Editable list in place of inpute zone in selection field Confirm button will add last record Clear field is added on pressing cross icon Task link : https://www.odoo.com/web#id=1931579&action=327&model=project.task&view_type=form&menu_id=4720 Pad link: https://pad.odoo.com/p/r.0e536f77bfa238db08ed39af3ae54c6d
Resolved issues and error corrections
This fix ensures that actions scheduled during a failed database savepoint are properly cleared when the savepoint is rolled back. This helps prevent unintended follow-up actions, such as email-related events, from being carried out after an error.
Original PR description
Description of the issue/feature this PR addresses:
Consider a corner case
```python
env = self.env
mail = env['mail.mail'].search(limit=1).copy()
with env.cr.savepoint():
mail.send()
raise Exception("Error!")
print(env.cr._event_handlers) # <-Notice that is not reseted
```
Current behavior before PR:
`env.cr._event_handlers` is not reset before of call `savepoint` if there is a exception during savepoint running.
Desired behavior after PR is merged:
Consider reset `env.cr._event_handlers` to original state before to call `savepoint`
cc @rco-odoo
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThe home menu icon now appears correctly after refreshing a page. This prevents users from losing quick access to the main app menu during normal navigation.
Original PR description
- reference commit: https://github.com/odoo/enterprise/commit/2324786e19cb5f6e2dd5cff2afc95a5a3a05bf41 - because of this commit 'home_menu_displayed' set to false at the time of initialization. also 'on_hashchange' pass false to 'toggle_home_menu' method. so, in 'toggle_home_menu' it returns without doing anything and it does not show home menu icon. - so, set 'home_menu_displayed' to true before 'toggle_home_menu' call. Issue: https://www.odoo.com/web#id=1963354&action=327&model=project.task&view_type=form&menu_id=4720 Pad: https://pad.odoo.com/p/r.6ad6b3da67001645e1cd54f9101d2570
Code cleanup and technical improvements
The website form editing functionality has been consolidated into the main website form module. This simplifies the app structure and should make maintenance and future improvements easier without changing the core business workflow.
The website form editor pieces have been merged into the main website form functionality to simplify maintenance and module dependencies. This should not noticeably change day-to-day use, but it helps keep related website form features managed in one place.