Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
21
sale_exception/views/res_config_settings.xml
Executable file
21
sale_exception/views/res_config_settings.xml
Executable file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2025 Camptocamp SA
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="res_config_settings_view_form_sale_exception" model="ir.ui.view">
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="sale.res_config_settings_view_form" />
|
||||
<field name="arch" type="xml">
|
||||
<setting id="order_warnings" position="after">
|
||||
<setting
|
||||
id="sale_exception_show_popup"
|
||||
help="Display popup at confirm or simply rely on the red alert already visible on top of the order."
|
||||
company_dependent="1"
|
||||
invisible="not group_warning_sale"
|
||||
>
|
||||
<field name="sale_exception_show_popup" />
|
||||
</setting>
|
||||
</setting>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
115
sale_exception/views/sale_view.xml
Executable file
115
sale_exception/views/sale_view.xml
Executable file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="action_sale_test_tree" model="ir.actions.act_window">
|
||||
<field name="name">Sale Exception Rules</field>
|
||||
<field name="res_model">exception.rule</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_id" ref="base_exception.view_exception_rule_list" />
|
||||
<field
|
||||
name="domain"
|
||||
>[('model', 'in', ['sale.order', 'sale.order.line'])]</field>
|
||||
<field
|
||||
name="context"
|
||||
>{'active_test': False, 'default_model' : 'sale.order'}</field>
|
||||
</record>
|
||||
<menuitem
|
||||
action="action_sale_test_tree"
|
||||
id="menu_sale_test"
|
||||
sequence="90"
|
||||
parent="sale.menu_sales_config"
|
||||
groups="base_exception.group_exception_rule_manager"
|
||||
/>
|
||||
<record id="view_order_form" model="ir.ui.view">
|
||||
<field name="name">sale_exception.view_order_form</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form" />
|
||||
<field name="arch" type="xml">
|
||||
<sheet position="before">
|
||||
<div
|
||||
class="alert alert-danger"
|
||||
role="alert"
|
||||
style="margin-bottom:0px;"
|
||||
invisible="not exceptions_summary"
|
||||
>
|
||||
<p>
|
||||
<strong
|
||||
>There are exceptions blocking the confirmation of this Sale Order:</strong>
|
||||
</p>
|
||||
<field name="exceptions_summary" />
|
||||
<button
|
||||
name="action_ignore_exceptions"
|
||||
type="object"
|
||||
class="btn-danger"
|
||||
string="Ignore Exceptions"
|
||||
help="Click here to be able to confirm this Sale Orders regardless of the exceptions."
|
||||
groups="base_exception.group_exception_rule_manager"
|
||||
/>
|
||||
</div>
|
||||
</sheet>
|
||||
<xpath expr="//field[@name='date_order']/.." position="inside">
|
||||
<field
|
||||
name="ignore_exception"
|
||||
invisible="state != 'sale'"
|
||||
groups="base_exception.group_exception_rule_manager"
|
||||
/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/form/group[1]" position="before">
|
||||
<div
|
||||
class="alert alert-danger"
|
||||
role="alert"
|
||||
style="margin-bottom:0px;"
|
||||
invisible="not exceptions_summary"
|
||||
>
|
||||
<p>
|
||||
<strong
|
||||
>There are exceptions on this line blocking the confirmation of this quotation:</strong>
|
||||
</p>
|
||||
<field name="exceptions_summary" />
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/list" position="inside">
|
||||
<field name="is_exception_danger" column_invisible="1" />
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/list" position="attributes">
|
||||
<attribute name="decoration-danger">is_exception_danger</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_order_tree" model="ir.ui.view">
|
||||
<field name="name">sale_exception.view_order_tree</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="state" position="after">
|
||||
<field name="main_exception_id" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_quotation_tree" model="ir.ui.view">
|
||||
<field name="name">sale_exception.view_order_tree</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_quotation_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="state" position="after">
|
||||
<field name="main_exception_id" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_sales_order_filter" model="ir.ui.view">
|
||||
<field name="name">sale_exception.view_sales_order_filter</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_sales_order_filter" />
|
||||
<field name="arch" type="xml">
|
||||
<filter name="my_sale_orders_filter" position="after">
|
||||
<separator orientation="vertical" />
|
||||
<filter
|
||||
icon="terp-emblem-important"
|
||||
name="tofix"
|
||||
string="Blocked in draft"
|
||||
domain="[('main_exception_id','!=',False)]"
|
||||
/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user