Daily updates from Odoo
Monday, April 1, 2019
11 changes · master
Enhancements to existing features
Website administrators can now recover broken or customized website views more safely, either by reverting to the previous version or restoring from the original file when available. The update also improves the error page and makes it easier to identify and repair template issues, reducing downtime and support effort.
Original PR description
- Store previous arch to be able to reset it (soft reset) - Add the possibility to reset from file if possible (hard reset) - Adapt frontend reset page to these new fields - `arch_fs` hack to check…
- Store previous arch to be able to reset it (soft reset) - Add the possibility to reset from file if possible (hard reset) - Adapt frontend reset page to these new fields - `arch_fs` hack to check if view was modified got moved to new field `arch_updated` as we now need to keep track of the `arch_fs` to reset a broken view. Closes #32009 (task-1943001) This commit also: - adds the possibility to reset a view arch in its form view, including a diff viewer (github like). - adds string helper on those arch fields, as they are not documented, it is not always obvious to get the purpose of each fields. - adapts the font-size and headings to fit Odoo style on the error 500 page. The error page does not use Odoo's assets, just bootstrap.css (the cursor might be broken on the error 500 page so we can't use Odoo assets). - raise the caller on unexisting t-call during QWeb rendering. - adapts reset view code to single view as the code still had remains of its initial release (Odoo 9.0). Handling multiple views has no sense anymore.
Product variant image fallback logic has been moved out of a shared image component and kept where it is actually used. This reduces unnecessary complexity and improves test coverage by checking image content, not just image size.
Original PR description
part of task-1949729
New live chat conversations are now routed to the available operator with the fewest active chats, helping distribute workload more evenly. Returning visitors are also more likely to reconnect with the same operator from their last visit when that operator is available, improving continuity and customer experience.
Original PR description
Purpose The assignation method should always give the new conversation to the operator who has the less active conversation. If two operators have the same amount of active conversation, it should…
Purpose The assignation method should always give the new conversation to the operator who has the less active conversation. If two operators have the same amount of active conversation, it should chose one of them randomly. We also want the visitor to get the same operator (if available) from its last visit. Specifications The method 'get_mail_channel' on the 'im_livechat.channel' model used a simple random.choice in the available users to select the operator. It was improved to select the operator that has the lowest number of open livechat sessions. If multiple operators share the same number (lowest) of open livechat sessions, it selects randomly between those. For the visitor to get the same operator as during its last visit, we save that information in a cookie (1 week lifetime), and give this optional parameter to the server when asking for the livechat session. To make the code clearer, some methods were reorganize and convert from `api.model` to `api.multi` (ensure_one) to be more API-compliant. Task-1919871
This change moves key business logic from screen-only change handlers into stored computed fields, so the same defaults and updates apply whether records are created by users, automation, imports, or other modules. It should reduce duplicate integration work and make processes like invoice creation more consistent and easier to maintain.
Original PR description
Rationale: Most onchange includes business logic (ex: changing a partner on an invoice sets the fiscal position, and the payment terms). But the business logic should not be exclusive to the user…
Rationale:
Most onchange includes business logic (ex: changing a partner on an
invoice sets the fiscal position, and the payment terms). But the
business logic should not be exclusive to the user interface. Thus,
most of these onchanges should actually be compute with store=True
and readonly=False.
Compute fields are usually orthogonal between each others, thus simpler
to implement and inherits. Example: on an invoice, it's easy to
implement _compute_fiscal_position (it's a related
partner_id.fiscal_position_id), but very complex to implement
_onchange_partner_id (it has impact on lots of different concepts
depending on installed modules: fiscal positions, payment terms,
address, ...). By splitting this big onchange into smaller compute,
it should simplify the code and inheritability.
USE CASE 1:
If onchanges are replaced by compute fields, the code to create an
invoice is simplified as you can let the business logic do its job:
self.env['account.invoice'].create({
'partner_id': 1
'line_ids': [(0,0,{
'product_id': 1
})
)}
-> the compute fields will compute the right fiscal position, taxes,
customer address, etc. It's not the role of the sale order to implement
this logic anymore.
This should simplify tests too as you cover more business logic code
with less data to provide.
USE CASE 2:
Let's say the module l10n_mx want to add a TAXCODE field on an invoice,
there is two way to do it:
@api.onchange['partner_id')
def _change_partner_id(self):
super()
self.taxcode = self.partner_id.taxcode
or, the new approach:
@api.depends('partner_id')
def _compute_taxcode(self):
self.taxcode = self.partner_id.taxcode
The onchange approach creates a big issue: you will have to create modules
like l10n_mx_sale and l10n_mx_subsription. Because, when these modules create
an invoice, they will have to call the code to set the taxcode.
With the new approach, there is nothing to do. Every module who create
an invoice will have the new business logic applied automatically: no
need to create glue modules.
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prUsers can now start a direct signing process from a document workflow action, making document approvals and signatures faster. The option is limited to one document at a time so the workflow matches how direct signing works.
Original PR description
This commit adds the option to use the direct sign feature from the document's workflow actions. Since this feature is only available for one record at a time, this commit also makes it possible to define is a rule is limited for a single record with the `on_single_record` computed field. Task: #1929589
Invoice scanning now supports richer OCR results, including invoice lines, taxes, and stronger total validation. It also sends more context to improve recognition accuracy and shows clearer error messages when processing fails.
Original PR description
Invoice lines and taxes support This commit make the module compatible with the new version (120) of the OCR server This imply new functionnalities: - Detection of invoice lines - Detection of invoice line taxes, global taxes on invoice - Validation of the invoice total with subtotal, taxes, invoice lines, etc... - Send user email, language and company VAT to server to help OCR to take right decision - Improve error message management. The server was always 'An error occured', now the module can display a custom message - Parsing of the new format of the JSON sent by the server And some fixs: - Trigger onchange when setting vendor with the VAT (avoid 'Commercial partner and partner account holder must be identical' error) - Avoid suppression of boxes on the invoices when the pdf is rerendered - Make features button always visible in edit mode
Accounting journals can now be linked to specific document workspaces and tags from the settings. This helps businesses automatically organize accounting documents in the right folders, while refreshed setting labels make the configuration easier to understand.
Original PR description
This commit adds the option to match account journals to folder and tags through the settings. Adds a new model: `documents.account.folder.setting` to configure the relation between workspaces (`documents.folder`) and journals (`account.journal`). Additionally, changes some of the labeling of document's settings. Task: #1948365
Customers can now see delivery carrier prices appear shortly after the checkout page loads, without manually selecting each option. This makes it easier to compare shipping choices and pick the best option while keeping the checkout page fast to open.
Original PR description
Before this commit: User landing on checkout payment step had to select a carrier. These carriers only showed 'Select to compute price'. This was done to prevent the page to take seconds to load, since it would compute all the carrier price by querying these carrier API then display the page. The users would still click on every carrier anyway to check all the prices and select the cheapest one. Now: Once the page is loaded, we will asynchronously retrieve every carrier prices. That way, the page rendering page will not be affected and the user will be able to see the price of every carrier after a few seconds without having to do anything. task-1867265
EasyPost shipping now supports generating return labels directly in Odoo. This helps businesses simplify returns handling and provide customers with a smoother post-delivery experience.
New document requests now automatically email the assigned owner with a share link when someone else creates the request. This helps request owners act faster and includes small interface refinements to make document request pages clearer.
Original PR description
After this commit, an email containing a share link is automatically sent to the owner (`res.users`) of a newly created document request if this user is not the user that creates the request. In addition, this commit adds several UI tweaks for document requests. Task: #1903845
The DHL delivery integration now builds and checks shipment requests using DHL's official definitions, reducing the risk of rejected or malformed requests. It also adds support for DHL return labels, helping businesses handle returns more smoothly.