When using a date field in the email templates it is important to use it with formatting function for the value to be represented in the format set in the language settings.
The function for formatting a date is format_date
and by default is using the format specified in the language settings. However, it is possible to specify a custom one (using LDML format), if needed.
An example of adding a date in an email template is shown in the example below:
In case it is needed to display datetime
or time
values the functions available for them are: format_datetime
and format_time
.
The module Partner Stock Risk extends the Account Financial Risk module functionality by adding an extra financial risk check on validation of inventory transfers with "Customer" as a destination location.
Once the module is installed, the extra check is enabled without any additional settings. In order to disable the check the module needs to be uninstalled.
The stock financial risk validation is based only on the General Limits, which means at least one General Limit financial risk needs to be enabled for the check to work.
Specific Limits are not taken into consideration for this check, which is expected, knowing that there is no specific option for Stock in the financial risk Specific Limits section.
The module is a great addition to business processes where additional financial risk validation is needed before dispatching the products. For example, if the invoice is generated after the delivery this module will help in preventing products from being shipped in the first place for customers with financial risk issues.
The module is maintained by the Odoo Community Association (OCA).
Sale Financial Risk module extends the Account Financial Risk by providing control of the customer’s credit limit in the sales order. This allows the system to include the financial risk check at the initial phase of the sales process and prevent a quote from being confirmed if the credit limit for the customer is exceeded.
Once the module is installed in the partner’s "Financial Risk" tab can be found two additional fields: “Include Sales Orders” in the General Limits and “Limit Sales Orders” in the Specific Limits.
When the “Include Sales Orders” is selected, the Sales Orders risk amount will be included in the customer’s Total Risk. The sales order risk amount is a sum of the sales orders’ total amount which is not invoiced. On quote confirmation, the system will check if the total risk exceeds the total credit limit specified for that customer. In case it is exceeded a warning message will be shown.
Additionally, it is possible to specify a specific limit for the sales orders in the field “Limit Sales Orders”. If the field is set, on quote confirmation it will be checked if the specific limit exceeds the total of the quote’s total amount and sales orders’ risk amount. If it does a warning message will be shown with info that the sales orders limit is exceeded.
Furthermore, in the Accounting / Invoicing Configuration Settings can be found the option “Include orders in done state”. This option extends the range of orders used in the financial calculations, not only to orders with the state “Sale Order” but it adds the orders with the state “Locked” as well. This option can be very useful for business cases where the "Lock Sales Order" option is used.
The warning message that is shown on quote confirmation, when any of the specified credit limits exceeds, can be overpassed by the Financial Risk Manager user. However, for other users, the confirmation will be blocked while the credit limit issue is not resolved.
Similarly to other Financial Risk limits, this module provides a convenient way of overviewing the financial data that contributes to the sales order financial risk.
By clicking on the total sale order risk amount will open the “Financial Risk Information” view where are listed all commercial partners related to the customer, that have an impact on the total risk amount, with information about their risk amounts and quantities. On click of the risk amount on any of the lines will open a list view with all sales order lines which are part of the calculation.
This module is a great addition to the Account Financial Risk module making the financial risk management for sales orders more convenient to implement by covering a wider range of business cases.
The module is maintained by the Odoo Community Association (OCA).
In the post The importance of correctly setting priority on inherited views we have already discussed the importance of the priority
field in the inherited views and why it needs to have the right value.
However, in some cases, it may be needed to update the priority of an existing view to meet certain requirements. The simplest case for that can be a request to change the primary view for a model that has multiple views from the same type.
The code sample below presents a way to modify the priority for an existing view from the codebase. In the particular example, the priority of the view_order_tree
view in the sale module is updated to value 5
.
That would mean that in the system the list view with the biggest priority for the sale.order
model will be view_quotation_tree
, which has a priority of 4
, and that one will be used always when the list view is not explicitly specified in the action.