[MERGE][CLN] delivery: xml files cleanup

closes odoo/odoo#115811

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Odoo's Mergebot
2023-03-20 15:31:47 +01:00
committed by GitHub
15 changed files with 395 additions and 370 deletions
+12 -6
View File
@@ -13,14 +13,20 @@ The system is able to add and compute the shipping line.
""",
'depends': ['sale'],
'data': [
'security/ir.model.access.csv',
'security/delivery_carrier_security.xml',
'views/delivery_view.xml',
'views/partner_view.xml',
'data/delivery_data.xml',
'views/res_config_settings_views.xml',
'wizard/choose_delivery_carrier_views.xml',
'security/ir.model.access.csv',
'security/ir_rules.xml',
'report/ir_actions_report_templates.xml',
'views/delivery_carrier_views.xml',
'views/delivery_price_rule_views.xml',
'views/delivery_zip_prefix_views.xml',
'views/res_partner_views.xml',
'views/sale_order_views.xml',
'wizard/res_config_settings_views.xml',
'wizard/choose_delivery_carrier_views.xml',
],
'demo': ['data/delivery_demo.xml'],
'installable': True,
+24 -24
View File
@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="product_category_deliveries" model="product.category">
<field name="parent_id" ref="product.product_category_all"/>
<field name="name">Deliveries</field>
</record>
<record id="product_product_delivery" model="product.product">
<field name="name">Standard delivery</field>
<field name="default_code">Delivery_007</field>
<field name="type">service</field>
<field name="categ_id" ref="delivery.product_category_deliveries"/>
<field name="sale_ok" eval="False"/>
<field name="purchase_ok" eval="False"/>
<field name="list_price">0.0</field>
<field name="invoice_policy">order</field>
</record>
<record id="free_delivery_carrier" model="delivery.carrier">
<field name="name">Standard delivery</field>
<field name="fixed_price">0.0</field>
<field name="sequence">1</field>
<field name="delivery_type">fixed</field>
<field name="product_id" ref="delivery.product_product_delivery"/>
</record>
</data>
<odoo noupdate="1">
<record id="product_category_deliveries" model="product.category">
<field name="parent_id" ref="product.product_category_all"/>
<field name="name">Deliveries</field>
</record>
<record id="product_product_delivery" model="product.product">
<field name="name">Standard delivery</field>
<field name="default_code">Delivery_007</field>
<field name="type">service</field>
<field name="categ_id" ref="delivery.product_category_deliveries"/>
<field name="sale_ok" eval="False"/>
<field name="purchase_ok" eval="False"/>
<field name="list_price">0.0</field>
<field name="invoice_policy">order</field>
</record>
<record id="free_delivery_carrier" model="delivery.carrier">
<field name="name">Standard delivery</field>
<field name="fixed_price">0.0</field>
<field name="sequence">1</field>
<field name="delivery_type">fixed</field>
<field name="product_id" ref="delivery.product_product_delivery"/>
</record>
</odoo>
+2 -3
View File
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<odoo noupdate="1">
<!-- Carrier -->
@@ -71,5 +70,5 @@
<field name="fields_id" search="[('model','=','res.partner'),('name','=','property_delivery_carrier_id')]"/>
<field name="value" eval="'delivery.carrier,'+str(ref('delivery_local_delivery'))"/>
</record>
</data>
</odoo>
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="delivery_report_saleorder_document" inherit_id="sale.report_saleorder_document">
<xpath expr="//p[@name='order_note']" position="before">
<p t-if="doc.carrier_id.carrier_description" id="carrier_description">
<strong>Shipping Description:</strong>
<span t-out="doc.carrier_id.carrier_description"/>
<template id="delivery_report_saleorder_document" inherit_id="sale.report_saleorder_document">
<p name="order_note" position="before">
<p t-if="doc.carrier_id.carrier_description" id="carrier_description">
<strong>Shipping Description:</strong>
<span t-out="doc.carrier_id.carrier_description"/>
</p>
</p>
</xpath>
</template>
</template>
</odoo>
@@ -1,10 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo noupdate="1">
<record model="ir.rule" id="delivery_carrier_comp_rule">
<field name="name">Delivery Carrier multi-company</field>
<field name="model_id" ref="model_delivery_carrier"/>
<field name="domain_force"> ['|', ('company_id', 'in', company_ids), ('company_id', '=', False)]</field>
</record>
</odoo>
+10
View File
@@ -0,0 +1,10 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo noupdate="1">
<record model="ir.rule" id="delivery_carrier_comp_rule">
<field name="name">Delivery Carrier multi-company</field>
<field name="model_id" ref="model_delivery_carrier"/>
<field name="domain_force">['|', ('company_id', 'in', company_ids), ('company_id', '=', False)]</field>
</record>
</odoo>
@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_delivery_carrier_tree" model="ir.ui.view">
<field name="name">delivery.carrier.tree</field>
<field name="model">delivery.carrier</field>
<field name="arch" type="xml">
<tree string="Carrier">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="delivery_type"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="country_ids" widget="many2many_tags" optional="hide"/>
</tree>
</field>
</record>
<record id="view_delivery_carrier_search" model="ir.ui.view">
<field name="name">delivery.carrier.search</field>
<field name="model">delivery.carrier</field>
<field name="arch" type="xml">
<search string="Delivery Carrier">
<field name="name" string="Carrier" />
<field name="delivery_type"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<group expand="1" string="Group By">
<filter string="Provider" name="provider" context="{'group_by':'delivery_type', 'residual_visible':True}"/>
</group>
</search>
</field>
</record>
<record id="view_delivery_carrier_form" model="ir.ui.view">
<field name="name">delivery.carrier.form</field>
<field name="model">delivery.carrier</field>
<field name="arch" type="xml">
<form string="Carrier">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="toggle_prod_environment"
attrs="{'invisible': ['|', '|', ('prod_environment', '=', False), ('delivery_type', '=', 'fixed'), ('delivery_type', '=', 'base_on_rule')]}"
class="oe_stat_button"
type="object" icon="fa-play">
<div class="o_stat_info o_field_widget">
<span class="text-success">Production</span>
<span class="o_stat_text">Environment</span>
</div>
</button>
<!-- transfer referenced here due to view inheritance issue in current master (post-saas-16) -->
<button name="toggle_prod_environment"
attrs="{'invisible': ['|', '|', ('prod_environment', '=', True), ('delivery_type', '=', 'fixed'), ('delivery_type', '=', 'base_on_rule')]}"
class="oe_stat_button"
type="object" icon="fa-stop">
<div class="o_stat_info o_field_widget">
<span class="o_warning_text">Test</span>
<span class="o_stat_text">Environment</span>
</div>
</button>
<button name="toggle_debug"
attrs="{'invisible': ['|', '|', ('delivery_type', '=', 'fixed'), ('delivery_type', '=', 'base_on_rule'), ('debug_logging', '=', True)]}"
class="oe_stat_button"
type="object" icon="fa-code">
<div class="o_stat_info o_field_widget">
<span class="text-danger">No debug</span>
</div>
</button>
<button name="toggle_debug"
attrs="{'invisible': ['|', '|', ('delivery_type', '=', 'fixed'), ('delivery_type', '=', 'base_on_rule'), ('debug_logging', '=', False)]}"
class="oe_stat_button"
type="object" icon="fa-code">
<div class="o_stat_info o_field_widget">
<span class="text-success">Debug requests</span>
</div>
</button>
</div>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div class="oe_title" name="title">
<label for="name" string="Shipping Method"/>
<h1>
<field name="name" placeholder="e.g. UPS Express"/>
</h1>
</div>
<group>
<group name="provider_details">
<field name="active" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="prod_environment" invisible="1"/>
<field name="debug_logging" invisible="1"/>
<label for="delivery_type"/>
<div>
<field name="delivery_type" />
<button string="Install more Providers" name="install_more_provider" type="object" class="oe_link oe_edit_only"/>
</div>
<field name="integration_level" widget="radio" attrs="{'invisible': ['|', ('delivery_type', '=', 'fixed'), ('delivery_type', '=', 'base_on_rule')]}"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group name="delivery_details">
<field name="currency_id" invisible="1"/>
<field name="fixed_price"
widget="monetary"
class="oe_inline"
attrs="{'invisible': [('delivery_type', '!=', 'fixed')]}"/>
<field name="margin"
string="Margin on Rate"
widget="percentage"
class="oe_inline"
attrs="{'invisible': [('delivery_type', '=', 'fixed')]}"/>
<field name="fixed_margin"
string="Additional margin"
widget="monetary"
attrs="{'invisible': [('delivery_type', '=', 'fixed')]}"/>
<label for="free_over" attrs="{'invisible': [('delivery_type', '=', 'base_on_rule')]}"/>
<div name="free_over_amount" attrs="{'invisible': [('delivery_type', '=', 'base_on_rule')]}">
<field name="free_over"/>
<field name="amount"
widget="monetary"
class="oe_inline"
attrs="{'required': [('free_over', '!=', False)], 'invisible': [('free_over', '=', False)]}"/>
</div>
<field name="product_id" context="{'default_detailed_type': 'service', 'default_sale_ok': False, 'default_purchase_ok': False, 'default_invoice_policy': 'order'}" />
<field name="invoice_policy" widget="radio" attrs="{'invisible': ['|', ('delivery_type', 'in', ('fixed', 'base_on_rule')), ('integration_level', '=', 'rate')]}"/>
<field name="supports_shipping_insurance" invisible="1"/>
<label for="shipping_insurance" String="Shipping Insurance" attrs="{'invisible': [('supports_shipping_insurance', '=', False)]}"/>
<div attrs="{'invisible': [('supports_shipping_insurance', '=', False)]}">
<field name="shipping_insurance" class="oe_inline"/>%
</div>
</group>
</group>
<notebook>
<page name="pricing" string="Pricing" attrs="{'invisible': [('delivery_type', '!=', 'base_on_rule')]}">
<group name="general">
<field name="price_rule_ids" nolabel="1" colspan="2"/>
</group>
</page>
<page string="Destination Availability" name="destination">
<group col="1">
<p>
Filling this form allows you to filter delivery carriers according to the delivery address of your customer.
</p>
<group name="country_details" class="oe_inline">
<field name="country_ids"
widget="many2many_tags"
options="{'no_open': True, 'no_create': True}"/>
<field name="state_ids"
widget="many2many_tags"
domain="[('country_id', 'in', country_ids)]"
attrs="{'readonly': [('country_ids', '=', [])]}"
force_save="1"
options="{'no_create': True}"/>
<field name="zip_prefix_ids"
widget="many2many_tags"
attrs="{'readonly': [('country_ids', '=', [])]}"
force_save="1"
options="{'no_create_edit': True}"/>
</group>
<p class="fst-italic" attrs="{'invisible': [('country_ids', '!=', [])]}">
Please select a country before choosing a state or a zip prefix.
</p>
</group>
</page>
<page string="Description" name="description">
<field name="carrier_description" placeholder="Shipping method details to be included at bottom sales orders and their confirmation emails. E.g. Instructions for customers to follow."/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="action_delivery_carrier_form" model="ir.actions.act_window">
<field name="name">Shipping Methods</field>
<field name="res_model">delivery.carrier</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_group_by_provider': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Define a new delivery method
</p><p>
Each carrier (e.g. UPS) can have several delivery methods (e.g.
UPS Express, UPS Standard) with a set of pricing rules attached
to each method.
</p><p>
These methods allow to automatically compute the delivery price
according to your settings; on the sales order (based on the
quotation) or the invoice (based on the delivery orders).
</p>
</field>
</record>
<menuitem id="sale_menu_action_delivery_carrier_form"
action="action_delivery_carrier_form"
parent="sale.menu_sales_config"
sequence="4"/>
</odoo>
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_delivery_price_rule_form" model="ir.ui.view">
<field name="name">delivery.price.rule.form</field>
<field name="model">delivery.price.rule</field>
<field name="arch" type="xml">
<form string="Price Rules">
<group>
<field name="name" invisible="1"/>
</group>
<group>
<label for="variable" string="Condition"/>
<div class="o_row">
<field name="variable"/>
<field name="operator"/>
<field name="max_value"/>
</div>
<field name="currency_id" invisible="1"/>
<label for="list_base_price" string="Delivery Cost"/>
<div>
<field name="list_base_price" widget="monetary" class="oe_inline"/>
+
<field name="list_price" widget="monetary" class="oe_inline"/>
*
<field name="variable_factor" class="oe_inline"/>
</div>
</group>
</form>
</field>
</record>
<record id="view_delivery_price_rule_tree" model="ir.ui.view">
<field name="name">delivery.price.rule.tree</field>
<field name="model">delivery.price.rule</field>
<field name="arch" type="xml">
<tree string="Price Rules">
<field name="sequence" widget="handle" />
<field name="name"/>
</tree>
</field>
</record>
</odoo>
-300
View File
@@ -1,300 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Delivery Carriers -->
<record id="view_delivery_carrier_tree" model="ir.ui.view">
<field name="name">delivery.carrier.tree</field>
<field name="model">delivery.carrier</field>
<field name="arch" type="xml">
<tree string="Carrier">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="delivery_type"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="country_ids" widget="many2many_tags" optional="hide"/>
</tree>
</field>
</record>
<record id="view_delivery_carrier_search" model="ir.ui.view">
<field name="name">delivery.carrier.search</field>
<field name="model">delivery.carrier</field>
<field name="arch" type="xml">
<search string="Delivery Carrier">
<field name="name" string="Carrier" />
<field name="delivery_type"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<group expand="1" string="Group By">
<filter string="Provider" name="provider" context="{'group_by':'delivery_type', 'residual_visible':True}"/>
</group>
</search>
</field>
</record>
<record id="view_delivery_carrier_form" model="ir.ui.view">
<field name="name">delivery.carrier.form</field>
<field name="model">delivery.carrier</field>
<field name="arch" type="xml">
<form string="Carrier">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="toggle_prod_environment"
attrs="{'invisible': ['|', '|', ('prod_environment', '=', False), ('delivery_type', '=', 'fixed'), ('delivery_type', '=', 'base_on_rule')]}"
class="oe_stat_button"
type="object" icon="fa-play">
<div class="o_stat_info o_field_widget">
<span class="text-success">Production</span>
<span class="o_stat_text">Environment</span>
</div>
</button>
<!-- transfer referenced here due to view inheritance issue in current master (post-saas-16) -->
<button name="toggle_prod_environment"
attrs="{'invisible': ['|', '|', ('prod_environment', '=', True), ('delivery_type', '=', 'fixed'), ('delivery_type', '=', 'base_on_rule')]}"
class="oe_stat_button"
type="object" icon="fa-stop">
<div class="o_stat_info o_field_widget">
<span class="o_warning_text">Test</span>
<span class="o_stat_text">Environment</span>
</div>
</button>
<button name="toggle_debug"
attrs="{'invisible': ['|', '|', ('delivery_type', '=', 'fixed'), ('delivery_type', '=', 'base_on_rule'), ('debug_logging', '=', True)]}"
class="oe_stat_button"
type="object" icon="fa-code">
<div class="o_stat_info o_field_widget">
<span class="text-danger">No debug</span>
</div>
</button>
<button name="toggle_debug"
attrs="{'invisible': ['|', '|', ('delivery_type', '=', 'fixed'), ('delivery_type', '=', 'base_on_rule'), ('debug_logging', '=', False)]}"
class="oe_stat_button"
type="object" icon="fa-code">
<div class="o_stat_info o_field_widget">
<span class="text-success">Debug requests</span>
</div>
</button>
</div>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div class="oe_title" name="title">
<label for="name" string="Shipping Method"/>
<h1>
<field name="name" placeholder="e.g. UPS Express"/>
</h1>
</div>
<group>
<group name="provider_details">
<field name="active" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="prod_environment" invisible="1"/>
<field name="debug_logging" invisible="1"/>
<label for="delivery_type"/>
<div>
<field name="delivery_type" />
<button string="Install more Providers" name="install_more_provider" type="object" class="oe_link oe_edit_only"/>
</div>
<field name="integration_level" widget="radio" attrs="{'invisible': ['|', ('delivery_type', '=', 'fixed'), ('delivery_type', '=', 'base_on_rule')]}"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group name="delivery_details">
<field name="currency_id" invisible="1"/>
<field name="fixed_price"
widget="monetary"
class="oe_inline"
attrs="{'invisible': [('delivery_type', '!=', 'fixed')]}"/>
<field name="margin"
string="Margin on Rate"
widget="percentage"
class="oe_inline"
attrs="{'invisible': [('delivery_type', '=', 'fixed')]}"/>
<field name="fixed_margin"
string="Additional margin"
widget="monetary"
attrs="{'invisible': [('delivery_type', '=', 'fixed')]}"/>
<label for="free_over" attrs="{'invisible': [('delivery_type', '=', 'base_on_rule')]}"/>
<div name="free_over_amount" attrs="{'invisible': [('delivery_type', '=', 'base_on_rule')]}">
<field name="free_over"/>
<field name="amount"
widget="monetary"
class="oe_inline"
attrs="{'required': [('free_over', '!=', False)], 'invisible': [('free_over', '=', False)]}"/>
</div>
<field name="product_id" context="{'default_detailed_type': 'service', 'default_sale_ok': False, 'default_purchase_ok': False, 'default_invoice_policy': 'order'}" />
<field name="invoice_policy" widget="radio" attrs="{'invisible': ['|', ('delivery_type', 'in', ('fixed', 'base_on_rule')), ('integration_level', '=', 'rate')]}"/>
<field name="supports_shipping_insurance" invisible="1"/>
<label for="shipping_insurance" String="Shipping Insurance" attrs="{'invisible': [('supports_shipping_insurance', '=', False)]}"/>
<div attrs="{'invisible': [('supports_shipping_insurance', '=', False)]}">
<field name="shipping_insurance" class="oe_inline"/>%
</div>
</group>
</group>
<notebook>
<page name="pricing" string="Pricing" attrs="{'invisible': [('delivery_type', '!=', 'base_on_rule')]}">
<group name="general">
<field name="price_rule_ids" nolabel="1" colspan="2"/>
</group>
</page>
<page string="Destination Availability" name="destination">
<group col="1">
<p>
Filling this form allows you to filter delivery carriers according to the delivery address of your customer.
</p>
<group name="country_details" class="oe_inline">
<field name="country_ids"
widget="many2many_tags"
options="{'no_open': True, 'no_create': True}"/>
<field name="state_ids"
widget="many2many_tags"
domain="[('country_id', 'in', country_ids)]"
attrs="{'readonly': [('country_ids', '=', [])]}"
force_save="1"
options="{'no_create': True}"/>
<field name="zip_prefix_ids"
widget="many2many_tags"
attrs="{'readonly': [('country_ids', '=', [])]}"
force_save="1"
options="{'no_create_edit': True}"/>
</group>
<p class="fst-italic" attrs="{'invisible': [('country_ids', '!=', [])]}">
Please select a country before choosing a state or a zip prefix.
</p>
</group>
</page>
<page string="Description" name="description">
<field name="carrier_description" placeholder="Shipping method details to be included at bottom sales orders and their confirmation emails. E.g. Instructions for customers to follow."/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="action_delivery_carrier_form" model="ir.actions.act_window">
<field name="name">Shipping Methods</field>
<field name="res_model">delivery.carrier</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_group_by_provider': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Define a new delivery method
</p><p>
Each carrier (e.g. UPS) can have several delivery methods (e.g.
UPS Express, UPS Standard) with a set of pricing rules attached
to each method.
</p><p>
These methods allow to automatically compute the delivery price
according to your settings; on the sales order (based on the
quotation) or the invoice (based on the delivery orders).
</p>
</field>
</record>
<record id="action_delivery_zip_prefix_list" model="ir.actions.act_window">
<field name="name">Zip Prefix</field>
<field name="res_model">delivery.zip.prefix</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Manage delivery zip prefixes
</p><p>
Delivery zip prefixes are assigned to delivery carriers to restrict
which zips it is available to.
</p>
</field>
</record>
<menuitem action="action_delivery_carrier_form" id="sale_menu_action_delivery_carrier_form" parent="sale.menu_sales_config" sequence="4"/>
<record id="view_delivery_price_rule_form" model="ir.ui.view">
<field name="name">delivery.price.rule.form</field>
<field name="model">delivery.price.rule</field>
<field name="arch" type="xml">
<form string="Price Rules">
<group>
<field name="name" invisible="1"/>
</group>
<group>
<label for="variable" string="Condition"/>
<div class="o_row">
<field name="variable"/>
<field name="operator"/>
<field name="max_value"/>
</div>
<field name="currency_id" invisible="1"/>
<label for="list_base_price" string="Delivery Cost"/>
<div>
<field name="list_base_price" widget="monetary" class="oe_inline"/>
+
<field name="list_price" widget="monetary" class="oe_inline"/>
*
<field name="variable_factor" class="oe_inline"/>
</div>
</group>
</form>
</field>
</record>
<record id="view_delivery_price_rule_tree" model="ir.ui.view">
<field name="name">delivery.price.rule.tree</field>
<field name="model">delivery.price.rule</field>
<field name="arch" type="xml">
<tree string="Price Rules">
<field name="sequence" widget="handle" />
<field name="name"/>
</tree>
</field>
</record>
<record id="view_order_form_with_carrier" model="ir.ui.view">
<field name="name">delivery.sale.order.form.view.with_carrier</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='partner_id']" position='after'>
<field name="delivery_set" invisible="1"/>
<field name="is_all_service" invisible="1"/>
<field name="recompute_delivery_price" invisible="1"/>
</xpath>
<xpath expr="//group[@name='note_group']" position="before">
<div class="oe_right">
<button
string="Add shipping"
name="action_open_delivery_wizard"
type="object"
attrs="{'invisible': ['|', '|',('is_all_service', '=', True), ('order_line', '=', []), ('delivery_set', '=', True)]}"
/>
<button
string="Update shipping cost"
name="action_open_delivery_wizard"
context="{'carrier_recompute':True}"
type="object"
class="text-warning btn-secondary"
attrs="{'invisible': ['|', '|',('is_all_service', '=', True), ('recompute_delivery_price', '=', False), ('delivery_set', '=', False)]}"
/>
<button
string="Update shipping cost"
name="action_open_delivery_wizard"
context="{'carrier_recompute':True}"
type="object"
attrs="{'invisible': ['|', '|',('is_all_service', '=', True), ('recompute_delivery_price', '=', True), ('delivery_set', '=', False)]}"
/>
</div>
</xpath>
<xpath expr="//field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
<field name="recompute_delivery_price" invisible="1"/>
<field name="is_delivery" invisible="1"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='price_unit']" position="before">
<field name="recompute_delivery_price" invisible="1"/>
<field name="is_delivery" invisible="1"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree" position="attributes">
<attribute name="decoration-warning">recompute_delivery_price and is_delivery</attribute>
</xpath>
<label for="commitment_date" position="before">
<field name="shipping_weight" readonly="True"/>
</label>
</data>
</field>
</record>
</odoo>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="action_delivery_zip_prefix_list" model="ir.actions.act_window">
<field name="name">Zip Prefix</field>
<field name="res_model">delivery.zip.prefix</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Manage delivery zip prefixes
</p><p>
Delivery zip prefixes are assigned to delivery carriers to restrict
which zips it is available to.
</p>
</field>
</record>
</odoo>
-15
View File
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_property_form" model="ir.ui.view">
<field name="name">res.partner.carrier.property.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<group name="sale" position="inside">
<field name="property_delivery_carrier_id"/>
</group>
</field>
</record>
</odoo>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_property_form" model="ir.ui.view">
<field name="name">res.partner.carrier.property.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<group name="sale" position="inside">
<field name="property_delivery_carrier_id"/>
</group>
</field>
</record>
</odoo>
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_order_form_with_carrier" model="ir.ui.view">
<field name="name">delivery.sale.order.form.view.with_carrier</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<field name="partner_id" position='after'>
<field name="delivery_set" invisible="1"/>
<field name="is_all_service" invisible="1"/>
<field name="recompute_delivery_price" invisible="1"/>
</field>
<group name="note_group" position="before">
<div class="oe_right">
<button
string="Add shipping"
name="action_open_delivery_wizard"
type="object"
attrs="{'invisible': ['|', '|',('is_all_service', '=', True), ('order_line', '=', []), ('delivery_set', '=', True)]}"
/>
<button
string="Update shipping cost"
name="action_open_delivery_wizard"
context="{'carrier_recompute':True}"
type="object"
class="text-warning btn-secondary"
attrs="{'invisible': ['|', '|',('is_all_service', '=', True), ('recompute_delivery_price', '=', False), ('delivery_set', '=', False)]}"
/>
<button
string="Update shipping cost"
name="action_open_delivery_wizard"
context="{'carrier_recompute':True}"
type="object"
attrs="{'invisible': ['|', '|',('is_all_service', '=', True), ('recompute_delivery_price', '=', True), ('delivery_set', '=', False)]}"
/>
</div>
</group>
<xpath expr="//field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
<field name="recompute_delivery_price" invisible="1"/>
<field name="is_delivery" invisible="1"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='price_unit']" position="before">
<field name="recompute_delivery_price" invisible="1"/>
<field name="is_delivery" invisible="1"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree" position="attributes">
<attribute name="decoration-warning">recompute_delivery_price and is_delivery</attribute>
</xpath>
<label for="commitment_date" position="before">
<field name="shipping_weight" readonly="True"/>
</label>
</field>
</record>
</odoo>
@@ -47,8 +47,8 @@ class ChooseDeliveryCarrier(models.TransientModel):
vals = self._get_shipment_rate()
if vals.get('error_message'):
warning = {
'title': '%s Error' % self.carrier_id.name,
'message': vals.get('error_message'),
'title': _("%(carrier)s Error", carrier=self.carrier_id.name),
'message': vals['error_message'],
'type': 'notification',
}
return {'warning': warning}
@@ -6,13 +6,17 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="sale.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//setting[@id='delivery']" position="inside">
<setting id="delivery" position="inside">
<div class="content-group">
<div class="mt8" attrs="{'invisible': [('module_delivery','=',False)]}">
<button name="%(delivery.action_delivery_carrier_form)d" icon="fa-arrow-right" type="action" string="Shipping Methods" class="btn-link"/>
<button name="%(delivery.action_delivery_carrier_form)d"
type="action"
class="btn-link"
icon="fa-arrow-right"
string="Shipping Methods"/>
</div>
</div>
</xpath>
</setting>
</field>
</record>