summaryrefslogtreecommitdiff
path: root/base_accounting_kit/views/credit_limit_view.xml
blob: 17d0b34bf26563b4b0e9300502d187fce35a8191 (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
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data>
        <record id="view_customer_form" model="ir.ui.view">
            <field name="name">Credit Limit</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_partner_form"/>
            <field name="arch" type="xml">
                <xpath expr="//page[@name='accounting']" position="inside">
                    <group string="Credit Limit" attrs="{'invisible':[('enable_credit_limit','=',False)]}">
                        <group>
                            <field name="active_limit"/>
                            <field name="enable_credit_limit" invisible="1"/>
                            <field name="warning_stage" attrs="{'invisible':[('active_limit','=',False)]}"/>
                            <field name="blocking_stage" attrs="{'invisible':[('active_limit','=',False)]}"/>
                        </group>
                    </group>
                </xpath>
            </field>
        </record>

        <record id="header_view" model="ir.ui.view">
            <field name="name">Credit Limit</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='payment_term_id']" position="after">
                    <field name="has_due" invisible="1"/>
                    <field name="is_warning" invisible="1"/>
                    <field name="outstanding_amount" invisible="1"/>
                </xpath>
                <xpath expr="//header" position="after">
                    <div class="alert alert-info" role="alert" style="height: 40px; margin-bottom:0px;"
                         attrs="{'invisible':[('outstanding_amount','=',0)]}">
                        This Customer's due amount is <strong><field name="outstanding_amount"/></strong>.
                    </div>
                </xpath>
                <xpath expr="//sheet/div[@name='button_box']" position="after">
                    <div role="alert" class="alert alert-danger" style="height: 40px; width: 350px; margin-bottom:0px;"
                         attrs="{'invisible':[('is_warning','=',False)]}">
                        This customer's <strong>warning limit</strong> has been crossed.
                    </div>
                </xpath>
            </field>
        </record>

        <record id="account_move_form_inherited" model="ir.ui.view">
            <field name="name">Account Move</field>
            <field name="model">account.move</field>
            <field name="inherit_id" ref="account.view_move_form"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='ref']" position="after">
                    <field name="has_due" invisible="1"/>
                    <field name="is_warning" invisible="1"/>
                </xpath>
                <xpath expr="//header" position="after">
                    <div class="alert alert-info" role="alert" style="height: 40px; margin-bottom:0px;"
                         attrs="{'invisible':['|',('outstanding_amount','=',0),('move_type','not in',('out_invoice','out_refund','out_receipt'))]}">
                        This Customer's due amount is <strong><field name="outstanding_amount"/></strong>.
                    </div>
                </xpath>
                <xpath expr="//sheet/div[@name='button_box']" position="after">
                    <div role="alert" class="alert alert-danger" style="height: 40px; width: 350px; margin-bottom:0px;"
                         attrs="{'invisible':['|',('is_warning','=',False),('move_type','not in',('out_invoice','out_refund','out_receipt'))]}">
                        This customer's <strong>warning limit</strong> has been crossed.
                    </div>
                </xpath>
            </field>
        </record>
    </data>
</odoo>