~sergio-incaser/banking-addons/banking-addons

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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2013 Akretion (http://www.akretion.com)
  @author: Alexis de Lattre <alexis.delattre@akretion.com>
  The licence is in the file __openerp__.py
-->
<openerp>
<data>

<record id="sdd_mandate_form" model="ir.ui.view">
    <field name="name">sdd.mandate.form</field>
    <field name="model">sdd.mandate</field>
    <field name="arch" type="xml">
        <form string="SEPA Direct Debit Mandate" version="7.0">
            <header>
                <button name="validate" type="object" string="Validate" states="draft"/>
                <button name="cancel" type="object" string="Cancel" states="draft,valid"/>
                <field name="state" widget="statusbar"/>
            </header>
            <sheet>
                <div class="oe_title">
                    <h1>
                        <field name="unique_mandate_reference" class="oe_inline"/>
                    </h1>
                </div>
                <group name="main">
                    <field name="company_id" groups="base.group_multi_company"/>
                    <field name="partner_bank_id"
                        on_change="mandate_partner_bank_change(partner_bank_id, type, recurrent_sequence_type, last_debit_date, state)"
                        invisible="context.get('sdd_mandate_bank_partner_view')"
                        />
                    <field name="partner_id" invisible="context.get('sdd_mandate_bank_partner_view')"/>
                    <field name="type" on_change="mandate_type_change(type)"/>
                    <field name="recurrent_sequence_type" attrs="{'invisible': [('type', '=', 'oneoff')], 'required': [('type', '=', 'recurrent')]}"/>
                    <field name="signature_date"/>
                    <field name="scan"/>
                    <field name="last_debit_date"/>
                    <field name="sepa_migrated" groups="account_banking_sepa_direct_debit.group_original_mandate_required"/>
                    <field name="original_mandate_identification" attrs="{'invisible': [('sepa_migrated', '=', True)], 'required': [('sepa_migrated', '=', False)]}" groups="account_banking_sepa_direct_debit.group_original_mandate_required"/>
                </group>
                <group name="payment_lines" string="Related Payment Lines">
                    <field name="payment_line_ids" nolabel="1"/>
                </group>
            </sheet>
            <div class="oe_chatter">
                <field name="message_follower_ids" widget="mail_followers"/>
                <field name="message_ids" widget="mail_thread"/>
            </div>
        </form>
    </field>
</record>

<record id="sdd_mandate_tree" model="ir.ui.view">
    <field name="name">sdd.mandate.tree</field>
    <field name="model">sdd.mandate</field>
    <field name="arch" type="xml">
        <tree string="SEPA Direct Debit Mandate" colors="blue:state=='draft';black:state in ('expired', 'cancel')">
            <field name="company_id" groups="base.group_multi_company"/>
            <field name="partner_id" invisible="context.get('sdd_mandate_bank_partner_view')"/>
            <field name="unique_mandate_reference" string="Reference"/>
            <field name="type" string="Type"/>
            <field name="signature_date" string="Signature Date"/>
            <field name="last_debit_date"/>
            <field name="state"/>
        </tree>
    </field>
</record>

<record id="sdd_mandate_search" model="ir.ui.view">
    <field name="name">sdd.mandate.search</field>
    <field name="model">sdd.mandate</field>
    <field name="arch" type="xml">
        <search string="Search SEPA Direct Debit Mandates">
            <field name="partner_id"/>
            <filter name="draft" string="Draft" domain="[('state', '=', 'draft')]" />
            <filter name="valid" string="Valid" domain="[('state', '=', 'valid')]" />
            <filter name="cancel" string="Cancelled" domain="[('state', '=', 'cancel')]" />
            <filter name="expired" string="Expired" domain="[('state', '=', 'expired')]" />
            <filter name="oneoff" string="One-Off" domain="[('type', '=', 'oneoff')]" />
            <filter name="recurrent" string="Recurrent" domain="[('type', '=', 'recurrent')]" />
        </search>
    </field>
</record>

<record id="sdd_mandate_action" model="ir.actions.act_window">
    <field name="name">SEPA Direct Debit Mandates</field>
    <field name="res_model">sdd.mandate</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form</field>
    <field name="help" type="html">
        <p class="oe_view_nocontent_create">
        Click to create a new SEPA Direct Debit Mandate.
        </p><p>
        A SEPA Direct Debit Mandate is a document signed by your customer that gives you the autorization to do one or several direct debits on his bank account.
        </p>
    </field>
</record>

<menuitem id="sdd_mandate_menu"
          parent="account_payment.menu_main_payment"
          action="sdd_mandate_action"
          sequence="20"
          />

<!-- notifications in the chatter -->
<record id="mandate_valid" model="mail.message.subtype">
    <field name="name">Mandate Validated</field>
    <field name="res_model">sdd.mandate</field>
    <field name="default" eval="False"/>
    <field name="description">SEPA Direct Debit Mandate Validated</field>
</record>

<record id="mandate_expired" model="mail.message.subtype">
    <field name="name">Mandate Expired</field>
    <field name="res_model">sdd.mandate</field>
    <field name="default" eval="False"/>
    <field name="description">SEPA Direct Debit Mandate has Expired</field>
</record>

<record id="mandate_cancel" model="mail.message.subtype">
    <field name="name">Mandate Cancelled</field>
    <field name="res_model">sdd.mandate</field>
    <field name="default" eval="False"/>
    <field name="description">SEPA Direct Debit Mandate Cancelled</field>
</record>

<record id="recurrent_sequence_type_first" model="mail.message.subtype">
    <field name="name">Sequence Type set to First</field>
    <field name="res_model">sdd.mandate</field>
    <field name="default" eval="False"/>
    <field name="description">Sequence Type set to First</field>
</record>

<record id="recurrent_sequence_type_recurring" model="mail.message.subtype">
    <field name="name">Sequence Type set to Recurring</field>
    <field name="res_model">sdd.mandate</field>
    <field name="default" eval="False"/>
    <field name="description">Sequence Type set to Recurring</field>
</record>

<record id="recurrent_sequence_type_final" model="mail.message.subtype">
    <field name="name">Sequence Type set to Final</field>
    <field name="res_model">sdd.mandate</field>
    <field name="default" eval="False"/>
    <field name="description">Sequence Type set to Final</field>
</record>

</data>
</openerp>