summaryrefslogtreecommitdiff
path: root/addons/sale_quotation_builder/views
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/sale_quotation_builder/views
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/sale_quotation_builder/views')
-rw-r--r--addons/sale_quotation_builder/views/res_config_settings_views.xml11
-rw-r--r--addons/sale_quotation_builder/views/sale_order_template_views.xml33
-rw-r--r--addons/sale_quotation_builder/views/sale_order_views.xml38
-rw-r--r--addons/sale_quotation_builder/views/sale_portal_templates.xml96
4 files changed, 178 insertions, 0 deletions
diff --git a/addons/sale_quotation_builder/views/res_config_settings_views.xml b/addons/sale_quotation_builder/views/res_config_settings_views.xml
new file mode 100644
index 00000000..0894b145
--- /dev/null
+++ b/addons/sale_quotation_builder/views/res_config_settings_views.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="sale_quotation_builder.res_config_settings_view_form_inherit" model="ir.ui.view">
+ <field name="name">res.config.settings.view.form.inherit.sale.management.inherit.sale.quotation.builder</field>
+ <field name="model">res.config.settings</field>
+ <field name="inherit_id" ref="sale_management.res_config_settings_view_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//label[@for='module_sale_quotation_builder']/following::div/em" position="replace"/>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/sale_quotation_builder/views/sale_order_template_views.xml b/addons/sale_quotation_builder/views/sale_order_template_views.xml
new file mode 100644
index 00000000..339f5d6a
--- /dev/null
+++ b/addons/sale_quotation_builder/views/sale_order_template_views.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <record id="sale_order_template_view_form_inherit_sale_quotation_builder" model="ir.ui.view">
+ <field name="name">sale.order.template.form.inherit.sale_quotation_builder</field>
+ <field name="inherit_id" ref="sale_management.sale_order_template_view_form"/>
+ <field name="model">sale.order.template</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <xpath expr="//sheet" position='before'>
+ <header>
+ <button name="open_template" class="oe_highlight" string="Design Template" type="object"/>
+ </header>
+ </xpath>
+
+ <xpath expr="//notebook[@name='description']" position="inside">
+ <page string="Website Description" name="website_description">
+ <field name="website_description" />
+ </page>
+ </xpath>
+
+ <xpath expr="//tree/field[@name='product_uom_id']" position="after">
+ <field name="website_description" invisible="1"/>
+ </xpath>
+
+ <xpath expr="//notebook[@name='main_book']" position="inside">
+ <field name="website_description" invisible="1"/>
+ </xpath>
+
+ </field>
+ </record>
+
+</odoo>
diff --git a/addons/sale_quotation_builder/views/sale_order_views.xml b/addons/sale_quotation_builder/views/sale_order_views.xml
new file mode 100644
index 00000000..dda07a85
--- /dev/null
+++ b/addons/sale_quotation_builder/views/sale_order_views.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <record id="sale_order_form_quote_design" model="ir.ui.view">
+ <field name="name">sale.order.form.sale_quotation_builder</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale_management.sale_order_form_quote"/>
+ <field name="arch" type="xml">
+
+ <xpath expr="//page/field[@name='order_line']/tree/field[@name='name']" position="after">
+ <field name="website_description" invisible="1"/>
+ </xpath>
+ <xpath expr="//page/field[@name='order_line']/form/field[@name='name']" position="after">
+ <field name="website_description" invisible="1"/>
+ </xpath>
+
+ <xpath expr="//page/field[@name='sale_order_option_ids']/kanban/field[@name='product_id']" position="after">
+ <field name="website_description" invisible="1" readonly="1" force_save="1"/>
+ </xpath>
+ <xpath expr="//page/field[@name='sale_order_option_ids']/form//field[@name='name']" position="after">
+ <field name="website_description" invisible="1" readonly="1" force_save="1"/>
+ </xpath>
+ <xpath expr="//page/field[@name='sale_order_option_ids']/tree/field[@name='name']" position="after">
+ <field name="website_description" invisible="1" readonly="1" force_save="1"/>
+ </xpath>
+
+ <xpath expr="//button[@name='button_add_to_order']" position="after">
+ <field name="website_description" invisible="1"/>
+ </xpath>
+
+ <xpath expr="//field[@name='require_payment']" position="after">
+ <field name="website_description" invisible="1"/>
+ </xpath>
+
+ </field>
+ </record>
+
+</odoo>
diff --git a/addons/sale_quotation_builder/views/sale_portal_templates.xml b/addons/sale_quotation_builder/views/sale_portal_templates.xml
new file mode 100644
index 00000000..7b4d9c36
--- /dev/null
+++ b/addons/sale_quotation_builder/views/sale_portal_templates.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <template id="sale_order_portal_content_inherit_sale_quotation_builder" name="Order Design" inherit_id="sale.sale_order_portal_content">
+ <xpath expr="//div[@id='informations']" position="after">
+ <div t-field="sale_order.website_description" class="oe_no_empty"/>
+ <t t-set="product_tmpl_ids" t-value="[]"/>
+ <t t-foreach="sale_order.order_line" t-as="line">
+ <t t-if="line.product_id.product_tmpl_id.id not in product_tmpl_ids">
+ <t t-set="product_tmpl_ids" t-value="product_tmpl_ids + [line.product_id.product_tmpl_id.id]"/>
+ <a t-att-id="line.id"/>
+ <div class="alert alert-info alert-dismissable mt16 css_non_editable_mode_hidden o_not_editable" t-ignore="True" role="status">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
+ Product: <strong t-esc="line.product_id.name"/>:
+ this content will appear on the quotation only if this
+ product is not removed.
+ </div>
+ <div t-att-class="'oe_no_empty' if line.website_description else 'oe_no_empty d-print-none'" t-field="line.website_description"/>
+ </t>
+ </t>
+ </xpath>
+ </template>
+
+ <!-- Template to edit the quotation template with the website editor -->
+ <template id="so_template" name="SO Template">
+ <t t-call="website.layout">
+ <body>
+ <t t-set="o_portal_fullwidth_alert">
+ <t t-call="portal.portal_back_in_edit_mode">
+ <t t-set="backend_url" t-value="'/web#model=%s&amp;id=%s&amp;action=%s&amp;view_type=form' % (template._name, template.id, request.env.ref('sale_management.sale_order_template_action').id)"/>
+ <t t-set="custom_html">This is a preview of the sale order template.</t>
+ </t>
+ </t>
+ <div class="container o_sale_order">
+ <div class="row mt16">
+ <div class="col-lg-9 ml-auto">
+ <div class="alert alert-info" t-ignore="True" role="status">
+ <p>
+ <strong>Template Header:</strong> this content
+ will appear on all quotations using this
+ template.
+ </p>
+ <p class="text-muted">
+ Titles with style <i>Heading 1</i> and
+ <i>Heading 2</i> will be used to generate the
+ table of content automatically.
+ </p>
+ </div>
+ <div id="template_introduction" t-field="template.website_description" class="oe_no_empty"/>
+ <t t-set="product_tmpl_ids" t-value="[]"/>
+ <t t-foreach="template.sale_order_template_line_ids" t-as="line">
+ <t t-if="line.product_id.product_tmpl_id.id not in product_tmpl_ids">
+ <t t-set="product_tmpl_ids" t-value="product_tmpl_ids + [line.product_id.product_tmpl_id.id]"/>
+ <div class="alert alert-info mt16" t-ignore="True" role="status">
+ Product: <strong t-esc="line.product_id.name"/>:
+ this content will appear on the quotation only if this
+ product is put on the quote.
+ </div>
+ <div t-field="line.website_description" class="oe_no_empty"/>
+ </t>
+ </t>
+ <t t-set="product_tmpl_ids" t-value="[]"/>
+ <t t-foreach="template.sale_order_template_option_ids" t-as="option_line">
+ <t t-if="option_line.product_id.product_tmpl_id.id not in product_tmpl_ids">
+ <t t-set="product_tmpl_ids" t-value="product_tmpl_ids + [option_line.product_id.product_tmpl_id.id]"/>
+ <div class="alert alert-info mt16" t-ignore="True" role="status">
+ Optional Product: <strong t-esc="option_line.product_id.name"/>:
+ this content will appear on the quotation only if this
+ product is used in the quote.
+ </div>
+ <div t-field="option_line.website_description" class="oe_no_empty"/>
+ </t>
+ </t>
+ <section id="terms" class="container" t-if="template.note">
+ <h1 t-ignore="True">Terms &amp; Conditions</h1>
+ <p t-field="template.note"/>
+ </section>
+ </div>
+ </div>
+ </div>
+ </body>
+ </t>
+ </template>
+
+ <template id="brand_promotion" inherit_id="website.brand_promotion">
+ <xpath expr="//t[@t-call='web.brand_promotion_message']" position="replace">
+ <t t-call="web.brand_promotion_message">
+ <t t-set="_message">
+ An awesome <a target="_blank" href="https://www.odoo.com/page/crm?utm_source=db&amp;utm_medium=portal">Open Source CRM</a>
+ </t>
+ <t t-set="_utm_medium" t-valuef="portal"/>
+ </t>
+ </xpath>
+ </template>
+
+</odoo>