summaryrefslogtreecommitdiff
path: root/addons/sale/views/res_partner_views.xml
blob: cbfa2b17a0421dcd4f83cdbc0c5c1e6f3ea93b89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0"?>
<odoo>
        <record id="act_res_partner_2_sale_order" model="ir.actions.act_window">
            <field name="name">Quotations and Sales</field>
            <field name="res_model">sale.order</field>
            <field name="view_mode">tree,form,graph</field>
            <field name="context">{'search_default_partner_id': active_id, 'default_partner_id': active_id}</field>
            <field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
            <field name="help" type="html">
              <p class="o_view_nocontent_smiling_face">
                Create a new quotation, the first step of a new sale!
              </p><p>
                Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
              </p>
            </field>
        </record>

        <!-- Partner kanban view inherte -->
        <record model="ir.ui.view" id="crm_lead_partner_kanban_view">
            <field name="name">res.partner.kanban.saleorder.inherit</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.res_partner_kanban_view"/>
            <field name="priority" eval="20"/>
            <field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
            <field name="arch" type="xml">
                <field name="mobile" position="after">
                    <field name="sale_order_count"/>
                </field>
                <xpath expr="//span[hasclass('oe_kanban_partner_links')]" position="inside">
                    <span t-if="record.sale_order_count.value>0" class="badge badge-pill"><i class="fa fa-fw fa-usd" role="img" aria-label="Sale orders" title="Sales orders"/><t t-esc="record.sale_order_count.value"/></span>
                </xpath>
            </field>
        </record>

        <record id="res_partner_view_buttons" model="ir.ui.view">
            <field name="name">res.partner.view.buttons</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_partner_form" />
            <field name="priority" eval="3"/>
            <field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
            <field name="arch" type="xml">
                <div name="button_box" position="inside">
                    <button class="oe_stat_button" type="action" name="%(sale.act_res_partner_2_sale_order)d" 
                        groups="sales_team.group_sale_salesman"
                        icon="fa-usd">
                        <field string="Sales" name="sale_order_count" widget="statinfo"/>
                    </button>
                </div>
                <page name="internal_notes" position="inside">
                    <group colspan="2" col="2" groups="sale.group_warning_sale">
                        <separator string="Warning on the Sales Order" colspan="4" />
                            <field name="sale_warn" nolabel="1" />
                            <field name="sale_warn_msg" colspan="3" nolabel="1"
                                    attrs="{'required':[('sale_warn', '!=', False), ('sale_warn','!=','no-message')],'readonly':[('sale_warn','=','no-message')]}"/>
                    </group>
                </page>
            </field>
        </record>

        <record id="res_partner_view_form_payment_defaultcreditcard" model="ir.ui.view">
            <field name="name">res.partner.view.form.payment.defaultcreditcard</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="payment.view_partners_form_payment_defaultcreditcard"/>
            <field name="arch" type="xml">
                <button name="%(payment.payment_token_action)d" position="attributes">
                    <attribute name="groups">sales_team.group_sale_salesman</attribute>
                </button>
            </field>
        </record>

        <record id="res_partner_view_form_property_inherit" model="ir.ui.view">
            <field name="name">res.partner.view.form.property.inherit</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="account.view_partner_property_form"/>
            <field name="arch" type="xml">
                <group name="fiscal_information" position="attributes">
                    <attribute name="groups">account.group_account_invoice, sales_team.group_sale_salesman</attribute>
                </group>
                <field name="property_payment_term_id" position="attributes">
                    <attribute name="groups">account.group_account_invoice, sales_team.group_sale_salesman</attribute>
                </field>
                <field name="property_supplier_payment_term_id" position="attributes">
                    <attribute name="groups">account.group_account_invoice, sales_team.group_sale_salesman</attribute>
                </field>
            </field>
        </record>
</odoo>