flectra/addons/website_sale/views/sale_order_views.xml

191 lines
9.9 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
2018-01-16 11:34:37 +01:00
<flectra>
<record id="view_sales_order_filter_ecommerce" model="ir.ui.view">
<field name="name">sale.order.ecommerce.search.view</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<search>
<filter string="Confirmed Orders" name="order_confirmed" domain="[('state', 'in', ('sale', 'done'))]"/>
<separator/>
<filter string="From Website" name="from_website" domain="[('team_id.team_type', '=', 'website')]"/>
<separator/>
<filter string="Recovery Email to Send" name="recovery_email" domain="[('cart_recovery_email_sent', '=', False)]" />
<separator/>
<filter name="website_id" string="Website" context="{'group_by':'website_id'}"/>
</search>
</field>
</record>
<record id="sale_order_view_form_cart_recovery" model="ir.ui.view">
<field name="name">sale.order.form.abandoned.cart</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='team_id']" position="after">
<field name="is_abandoned_cart" invisible="1"/>
<field name="cart_recovery_email_sent" invisible="1"/>
</xpath>
<xpath expr="//button[@name='action_quotation_send' and @states='draft']" position="attributes">
<!-- The '| and the '&amp' opertors are necessary because draft state of the parent concatenate the domain -->
<attribute name="attrs">{'invisible': ['|','&amp;',('is_abandoned_cart', '=', True), ('cart_recovery_email_sent', '=', False)]}</attribute>
</xpath>
<xpath expr="//button[@name='action_quotation_send']" position="after">
<button name="action_recovery_email_send"
string="Send a Recovery Email"
type="object"
class="btn-primary"
attrs="{'invisible': ['|', ('is_abandoned_cart', '=', False), ('cart_recovery_email_sent', '=', True)]}"/>
</xpath>
<xpath expr="//group[@name='sales_person']" position="inside">
<field name="website_id"/>
</xpath>
</field>
</record>
<record id="action_orders_ecommerce" model="ir.actions.act_window">
<field name="name">Orders</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('team_id.team_type', '=', 'website')]</field>
<field name="context">{'show_sale': True, 'search_default_order_confirmed': 1}</field>
<field name="search_view_id" ref="view_sales_order_filter_ecommerce"/>
<field name="help">You don't have any confirmed order from the website.</field>
</record>
<record id="action_unpaid_orders_ecommerce" model="ir.actions.act_window">
<field name="name">Unpaid Orders</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state', '=', 'sent'), ('team_id.team_type', '=', 'website')]</field>
<field name="context">{'show_sale': True, 'create': False}</field>
<field name="search_view_id" ref="view_sales_order_filter_ecommerce"/>
<field name="help">You don't have any unpaid order from the website.</field>
</record>
<record id="action_abandoned_orders_ecommerce" model="ir.actions.act_window">
<field name="name">Abandoned Carts</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('is_abandoned_cart', '=', True)]</field>
<field name="context" eval="{'show_sale': True, 'create': False, 'search_default_recovery_email' : 1}"/>
<field name="search_view_id" ref="view_sales_order_filter_ecommerce"/>
<field name="help" type="xml">
<p>Find here all the abandoned carts, i.e. the carts generated by your website's visitors more than one hour ago and not confirmed.</p>
<p>You should send an email to revive them!</p></field>
</record>
<record id="sale_order_action_to_invoice" model="ir.actions.act_window">
<field name="name">Orders To Invoice</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state', 'in', ('sale', 'done')), ('invoice_status', '=', 'to invoice'), ('team_id.team_type', '=', 'website')]</field>
<field name="context">{'show_sale': True, 'search_default_order_confirmed': 1, 'create': False}</field>
<field name="search_view_id" ref="view_sales_order_filter_ecommerce"/>
<field name="help">You don't have any order from the website.</field>
</record>
<!-- Server action to send multiple recovery email-->
<record id="ir_actions_server_sale_cart_recovery_email" model="ir.actions.server">
<field name="name">Send a Cart Recovery Email</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="model_sale_order"/>
<field name="state">code</field>
<field name="code">
if records:
action = records.action_recovery_email_send()
</field>
<field name="binding_model_id" ref="sale.model_sale_order"/>
</record>
<!-- Main website sale menu items -->
<menuitem id="menu_orders" name="Orders"
parent="website.menu_website_configuration" sequence="2"
groups="sales_team.group_sale_salesman"/>
<menuitem id="menu_catalog" name="Catalog"
parent="website.menu_website_configuration" sequence="3"
groups="sales_team.group_sale_salesman"/>
<menuitem id="menu_reporting" name="Reporting"
parent="website.menu_website_configuration" sequence="99"
groups="sales_team.group_sale_manager"/>
<menuitem id="website.menu_website_global_configuration" name="Configuration"
parent="website.menu_website_configuration" sequence="100"
groups="base.group_system,sales_team.group_sale_manager"/>
<menuitem id="menu_ecommerce_settings" name="eCommerce"
parent="website.menu_website_global_configuration"/>
<menuitem id="menu_product_settings" name="Products"
parent="website.menu_website_global_configuration"/>
<!-- Orders sub-menus -->
<menuitem id="menu_orders_orders" name="Orders"
action="action_orders_ecommerce"
parent="menu_orders" sequence="1"/>
<menuitem id="menu_orders_unpaid_orders" name="Unpaid Orders"
action="action_unpaid_orders_ecommerce"
parent="menu_orders" sequence="2"/>
<menuitem id="menu_orders_abandoned_orders" name="Abandoned Carts"
action="action_abandoned_orders_ecommerce"
parent="menu_orders" sequence="3"/>
<menuitem id="menu_orders_customers" name="Customers"
action="base.action_partner_customer_form"
parent="menu_orders" sequence="4"/>
<!-- Product Limit Menu -->
<menuitem action="website_product_limit_action" id="menu_view_limit"
name="Website Product View Limit" parent="website_sale.menu_ecommerce_settings"/>
<!-- <menuitem id="menu_orders_invoices" name="Invoices" parent="menu_orders" action="action_invoices_ecommerce" sequence="4"/> -->
<!-- Catalog sub-menus -->
<menuitem id="menu_catalog_products" name="Products"
action="product_template_action_website"
parent="menu_catalog" sequence="1"/>
<menuitem id="product_catalog_variants" name="Product Variants"
action="product.product_normal_action"
parent="menu_catalog" groups="product.group_product_variant" sequence="2"/>
<menuitem id="menu_catalog_pricelists" name="Pricelists"
action="product.product_pricelist_action2"
parent="menu_catalog" groups="product.group_sale_pricelist" sequence="4"/>
<!-- Reporting sub-menus -->
<menuitem id="menu_report_sales" name="Sales"
action="sale_report_action_dashboard"
parent="menu_reporting" sequence="1"/>
<!-- Configuration sub-menus -->
<menuitem id="menu_ecommerce_payment_acquirers"
action="payment.action_payment_acquirer"
parent="menu_ecommerce_settings" name="Payment Acquirers" />
<menuitem id="menu_catalog_categories"
action="product_public_category_action"
parent="menu_product_settings" sequence="1"/>
<menuitem id="menu_product_attribute_action"
action="product.attribute_action"
parent="menu_product_settings" groups="product.group_product_variant" sequence="2"/>
<menuitem id="menu_catalog_variants_action"
action="product.variants_action"
parent="menu_product_settings" groups="product.group_product_variant" sequence="3"/>
<record id="sale_order_view_form" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_quotation_send']" position="after">
<button name="action_mark_as_paid" type="object"
string="Mark as Paid" class="btn-primary"
attrs="{'invisible': ['|', ('can_directly_mark_as_paid', '=', False), ('state', 'not in', ['sent', 'sale'])]}"/>
</xpath>
<field name="partner_id" position="after">
<field name="can_directly_mark_as_paid" invisible="1"/>
</field>
<xpath expr="//button[@id='action_confirm']" position="attributes">
<attribute name="attrs">{'invisible': ['|',('can_directly_mark_as_paid', '=', True), ('state', 'not in', ['sent'])]}</attribute>
</xpath>
</field>
</record>
2018-01-16 11:34:37 +01:00
</flectra>