The aim of this commit is to simplify and standardize the settings archs.
To do this, a small DSL exclusively for the settings was created. This
new DSL introduces 3 tags: `app`, `block` and `setting`.
The `app` tag is used to declare the application on the settings view.
It creates an entry with its logo on the sidebar of the view. It also
acts as delimiter when searching.
```xml
<app string="CRM" name="crm">
...
</app>
```
- `string` : The "display" name of the application.
- `name` : The technical name of the application (the name of the module).
- `logo` *optional* : The relative path to the logo. If not set, the
logo is created using the `name` parameter :
`/{name}/static/description/icon.png`.
The `block` tag is used to declare a group of settings. This group can
have a title and a description/help.
```xml
<block title="Title of group Bar">
...
</block>
```
- `title` *optional* : The title of the block of settings (the old h2),
you can perform research on its text.
- `help` *optional* : The description/help of the block of settings
(the old h3), you can perform research on its text.
The `setting` tag is used to declare the setting itself. The first field
in the setting is used as the main field (optional). This field is
placed on the left panel (if it's a boolean field) or on the top of the
right panel (otherwise). The field is also used to create the setting
label if a `string` is not defined. The `setting` tag can also contain
more elements (e.g. html), all of these elements are rendered in the
right panel.
```xml
<setting string="this is bar">
<field name="bar"/>
...More elements
</setting>
```
- `type` *optional* : By default, a setting is visually separated on two
panels (left and right), and is used to edit a given field. By
defining `type='header'`, a special kind of setting is rendered
instead. This setting is used to modify the scope of the other
settings. For example, on the website application, this setting
is used to indicate to which website the other settings apply.
The header setting is visually represented as a yellow banner on
the top of the screen.
- `string` *optional* : The text used as label of the setting. If it's
not defined, the first field is used as label.
- `title` *optional* : The text used as tooltip.
- `help` *optional* : The help/description of the setting. This text is
displayed just below the setting label (with classname
`text-muted`).
- `company_dependent` *optional* : If this attribute is set to "1" an
icon is displayed next to the setting label to explicit that
this setting is company-specific.
- `documentation` *optional* : If this attribute is set, an icon is
added next to the setting label, this icon is a link to the
documentation. Note that you can use relative or absolute path.
The relative path is relative to
`https://www.odoo.com/documentation/server_version`, so it's not
necessary to hard-code the server version on the arch anymore.
closes odoo/odoo#106425
Task-id: 3081367
Related: odoo/enterprise#34337
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: "Michael Mattiello (mcm)" <mcm@odoo.com>
83 lines
6.1 KiB
XML
83 lines
6.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<record id="res_config_settings_view_form_purchase" model="ir.ui.view">
|
|
<field name="name">res.config.settings.view.form.inherit.purchase</field>
|
|
<field name="model">res.config.settings</field>
|
|
<field name="priority" eval="25"/>
|
|
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//form" position="inside">
|
|
<app data-string="Purchase" string="Purchase" name="purchase" groups="purchase.group_purchase_manager">
|
|
<field name="po_double_validation" invisible="1"/>
|
|
<field name="company_currency_id" invisible="1"/>
|
|
<field name="po_lock" invisible="1"/>
|
|
<block title="Orders" name="purchase_setting_container">
|
|
<setting id="po_order_approval" company_dependent="1" help="Request managers to approve orders above a minimum amount">
|
|
<field name="po_order_approval"/>
|
|
<div class="content-group" attrs="{'invisible': [('po_order_approval', '=', False)]}">
|
|
<div class="row mt16">
|
|
<label for="po_double_validation_amount" class="col-lg-4 o_light_label"/>
|
|
<field name="po_double_validation_amount"/>
|
|
</div>
|
|
</div>
|
|
</setting>
|
|
<setting id="automatic_lock_confirmed_orders" help="Automatically lock confirmed orders to prevent editing">
|
|
<field name="lock_confirmed_po"/>
|
|
</setting>
|
|
<setting id="get_order_warnings" string="Warnings" help="Get warnings in orders for products or vendors">
|
|
<field name="group_warning_purchase"/>
|
|
</setting>
|
|
<setting id="manage_purchase_agreements" title="Calls for tenders are when you want to generate requests for quotations with several vendors for a given set of products to compare offers." documentation="/applications/inventory_and_mrp/purchase/manage_deals/agreements.html" help="Manage your purchase agreements (call for tenders, blanket orders)">
|
|
<field name="module_purchase_requisition"/>
|
|
<div class="content-group" attrs="{'invisible': [('module_purchase_requisition', '=', False)]}">
|
|
<div id="use_purchase_requisition"/>
|
|
</div>
|
|
</setting>
|
|
<setting id="auto_receipt_reminder" help="Automatically remind the receipt date to your vendors">
|
|
<field name="group_send_reminder"/>
|
|
</setting>
|
|
</block>
|
|
<block title="Invoicing" name="invoicing_settings_container">
|
|
<setting id="quantities_billed_vendor" title="This default value is applied to any new product created. This can be changed in the product detail form." documentation="/applications/inventory_and_mrp/purchase/manage_deals/control_bills.html" help="Quantities billed by vendors">
|
|
<field name="default_purchase_method" class="o_light_label" widget="radio"/>
|
|
</setting>
|
|
<setting id="three_way_matching" title="If enabled, activates 3-way matching on vendor bills : the items must be received in order to pay the invoice." documentation="/applications/inventory_and_mrp/purchase/manage_deals/control_bills.html" help="Make sure you only pay bills for which you received the goods you ordered">
|
|
<field name="module_account_3way_match" string="3-way matching" widget="upgrade_boolean"/>
|
|
</setting>
|
|
</block>
|
|
<block title="Products" name="matrix_setting_container">
|
|
<setting id="variant_options" help="Purchase variants of a product using attributes (size, color, etc.)" documentation="/applications/sales/sales/products_prices/products/variants.html">
|
|
<field name="group_product_variant"/>
|
|
<div class="content-group" attrs="{'invisible': [('group_product_variant','=',False)]}">
|
|
<div class="mt8">
|
|
<button name="%(product.attribute_action)d" icon="fa-arrow-right" type="action" string="Attributes" class="btn-link"/>
|
|
</div>
|
|
</div>
|
|
</setting>
|
|
<setting id="product_matrix" title="If installed, the product variants will be added to purchase orders through a grid entry." string="Variant Grid Entry" help="Add several variants to the purchase order from a grid">
|
|
<field name="module_purchase_product_matrix"/>
|
|
</setting>
|
|
<setting id="stock_packaging_purchase" help="Purchase products by multiple of unit # per package" title="Ability to select a package type in purchase orders and to force a quantity that is a multiple of the number of units per package.">
|
|
<field name="group_stock_packaging"/>
|
|
</setting>
|
|
</block>
|
|
</app>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_purchase_configuration" model="ir.actions.act_window">
|
|
<field name="name">Settings</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">res.config.settings</field>
|
|
<field name="view_mode">form</field>
|
|
<field name="target">inline</field>
|
|
<field name="context">{'module' : 'purchase', 'bin_size': False}</field>
|
|
</record>
|
|
|
|
<menuitem id="menu_purchase_general_settings" name="Settings" parent="menu_purchase_config"
|
|
sequence="0" action="action_purchase_configuration" groups="base.group_system"/>
|
|
|
|
</odoo>
|