[IMP]account_voucher :set a accountant group on some field
[odoo/odoo.git] / addons / account_voucher / voucher_sales_purchase_view.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <openerp>
3     <data>
4         <record id="view_voucher_filter_vendor" model="ir.ui.view">
5             <field name="name">account.voucher.purchase.select</field>
6             <field name="model">account.voucher</field>
7             <field name="type">search</field>
8             <field name="arch" type="xml">
9                 <search string="Search Vouchers">
10                     <group>
11                         <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
12                         <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
13                         <separator orientation="vertical"/>
14                         <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted')]" help="To Review"/>
15                         <separator orientation="vertical"/>
16                         <field name="date"/>
17                         <field name="number"/>
18                         <field name="partner_id" string="Supplier"/>
19                     </group>
20                     <newline/>
21                     <group>
22                         <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('purchase','purchase_refund'))]"/>
23                         <field name="period_id"/>
24                     </group>
25                    <newline/>
26                     <group expand="0" string="Group By...">
27                         <filter string="Supplier" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
28                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
29                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
30                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
31                     </group>
32                 </search>
33             </field>
34         </record>
35
36         <record id="view_voucher_filter_sale" model="ir.ui.view">
37             <field name="name">account.voucher.sale.select</field>
38             <field name="model">account.voucher</field>
39             <field name="type">search</field>
40             <field name="arch" type="xml">
41                 <search string="Search Vouchers">
42                     <group>
43                         <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
44                         <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
45                         <separator orientation="vertical"/>
46                         <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted')]" help="To Review"/>
47                         <separator orientation="vertical"/>
48                         <field name="date"/>
49                         <field name="number"/>
50                         <field name="partner_id" string="Customer"/>
51                     </group>
52                     <newline/>
53                     <group>
54                         <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('sale','sale_refund'))]"/>
55                         <field name="period_id"/>
56                     </group>
57                    <newline/>
58                     <group expand="0" string="Group By...">
59                         <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
60                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
61                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
62                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
63                     </group>
64                 </search>
65             </field>
66         </record>
67
68         <record id="act_pay_voucher" model="ir.actions.act_window">
69             <field name="name">Customer Payment</field>
70             <field name="res_model">account.voucher</field>
71             <field name="view_type">form</field>
72             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>
73             <field name="context">{'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
74             <field name="view_id" ref="view_vendor_receipt_form"/>
75             <field name="target">current</field>
76         </record>
77
78         <record model="ir.ui.view" id="view_sale_receipt_form">
79             <field name="name">account.voucher.sale.form</field>
80             <field name="model">account.voucher</field>
81             <field name="type">form</field>
82             <field name="arch" type="xml">
83                 <form layout="manual">
84                 <div class="oe_form_topbar">
85                     <button name="proforma_voucher" string="Validate" states="draft"/>
86                     <button name="%(act_pay_voucher)d" context="{'narration':narration, 'title':'Customer Payment', 'type':'receipt', 'partner_id':partner_id, 'reference':reference, 'amount':amount}" type="action" string="Pay" attrs="{'invisible':['|',('pay_now','=','pay_now'),'|',('state','=','draft'), ('paid','=',True)]}"/>
87                     <button name="cancel_voucher" string="Cancel" states="draft,proforma" />
88                     <button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to confirm this record ?"/>
89                     <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
90                     <div class="oe_right">
91                         <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
92                     </div>
93                     <div class="oe_clear"/>
94                 </div>
95                 <sheet string="Sales Receipt" layout="auto">
96                     <group col="6" colspan="4" class="oe_form_header">
97                         <field name="partner_id" domain="[('customer','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
98                         <field name="date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
99                         <field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id, date, amount, type, company_id, context)"/>
100                         <field name="number"/>
101                         <field name="name" colspan="2"/>
102                         <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
103                         <field name="type" invisible="True"/>
104                         <field name="currency_id"/>
105                     </group>
106                     <notebook colspan="4">
107                         <page string="Sales Information">
108                             <field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
109                                 <tree string="Sales Lines" editable="bottom">
110                                     <field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection"/>
111                                     <field name="name"/>
112                                     <field name="amount" sum="Total"/>
113                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
114                                 </tree>
115                             </field>
116                             <group col="2" colspan="3">
117                                 <separator string="Internal Notes" colspan="2"/>
118                                 <field name="narration" colspan="2" nolabel="1"/>
119                             </group>
120                             <group col="2" colspan="1">
121                                 <group col="2" colspan="1">
122                                     <separator string="Payment Options" colspan="2"/>
123                                     <field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
124                                     <field name="account_id"
125                                          attrs="{'invisible':[('pay_now','!=','pay_now')]}"
126                                           domain="[('type','=','liquidity')]"/>
127                                          <!-- should select income accounts only. Or use the journal for this ? -->
128                                     <field name="reference"
129                                          attrs="{'invisible':[('pay_now','!=','pay_now')]}"
130                                     />
131                                     <field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
132                                     <field name="paid" invisible="1"/>
133                                 </group>
134                                 <group col="4" colspan="1">
135                                     <separator string="Total" colspan="4"/>
136                                     <field name="tax_id" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" widget="selection" domain="[('type_tax_use','in',('sale','all')), ('parent_id', '=', False)]"/><field name="tax_amount" nolabel="1"/><button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
137                                     <label string="" colspan="1"/><field name="amount" string="Total"/>
138                                 </group>
139                             </group>
140                         </page>
141                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
142                             <group col="6" colspan="4">
143                                 <field name="period_id"/>
144                                 <field name="audit"/>
145                             </group>
146                             <field name="move_ids" colspan="4" nolabel="1" readonly="1">
147                                <tree string="Journal Items">
148                                    <field name="move_id"/>
149                                    <field name="ref"/>
150                                    <field name="date"/>
151                                    <field name="statement_id"/>
152                                    <field name="partner_id"/>
153                                    <field name="account_id"/>
154                                    <field name="name"/>
155                                    <field name="debit"/>
156                                    <field name="credit"/>
157                                    <field name="state"/>
158                                    <field name="reconcile_id"/>
159                                </tree>
160                             </field>
161                         </page>
162                     </notebook>
163                     </sheet>
164                 </form>
165             </field>
166         </record>
167
168         <!-- Sales Voucher -->
169         <record id="action_sale_receipt" model="ir.actions.act_window">
170             <field name="name">Sales Receipt</field>
171             <field name="res_model">account.voucher</field>
172             <field name="view_type">form</field>
173             <field name="domain">[('journal_id.type','in',['sale','sale_refund']), ('type','=','sale')]</field>
174             <field name="context">{'default_type': 'sale', 'type': 'sale'}</field>
175             <field name="view_id" eval="False"/>
176             <field name="search_view_id" ref="view_voucher_filter_sale"/>
177             <field name="target">current</field>
178             <field name="help">When you sell products to a customer, you can give him a sales receipt or an invoice. When the sales receipt is confirmed, it creates journal items automatically and you can record the customer payment related to this sales receipt.</field>
179         </record>
180         <record id="action_sale_receipt_tree" model="ir.actions.act_window.view">
181             <field eval="1" name="sequence"/>
182             <field name="view_mode">tree</field>
183             <field name="act_window_id" ref="action_sale_receipt"/>
184         </record>
185         <record id="action_sale_receipt_form" model="ir.actions.act_window.view">
186             <field eval="2" name="sequence"/>
187             <field name="view_mode">form</field>
188             <field name="view_id" ref="view_sale_receipt_form"/>
189             <field name="act_window_id" ref="action_sale_receipt"/>
190         </record>
191
192         <menuitem id="menu_action_sale_receipt" icon="STOCK_JUSTIFY_FILL"
193             action="action_sale_receipt"
194             parent="account.menu_finance_receivables"
195             sequence="10"/>
196
197         <!--  Purchase Vouchers -->
198         <record id="act_pay_bills" model="ir.actions.act_window">
199             <field name="name">Bill Payment</field>
200             <field name="res_model">account.voucher</field>
201             <field name="view_type">form</field>
202             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment'), ('partner_id','=',partner_id)]</field>
203             <field name="context">{'default_type':'payment', 'type':'payment', 'default_partner_id': partner_id, 'partner_id': partner_id, 'default_reference':reference}</field>
204             <field name="view_id" ref="view_vendor_payment_form"/>
205             <field name="target">current</field>
206         </record>
207         <record model="ir.ui.view" id="view_purchase_receipt_form">
208             <field name="name">account.voucher.purchase.form</field>
209             <field name="model">account.voucher</field>
210             <field name="type">form</field>
211             <field name="arch" type="xml">
212                 <form layout="manual">
213                 <div class="oe_form_topbar">
214                     <button name="proforma_voucher" string="Validate" states="draft" class="oe_form_button_hi"/>
215                     <button name="%(act_pay_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay Bill" attrs="{'invisible':['|',('pay_now','=','pay_now'),'|',('state','=','draft'), ('paid','=',True)]}" class="oe_form_button_hi"/>
216                     <button name="cancel_voucher" string="Cancel" states="draft,proforma" />
217                     <button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to confirm this record ?"/>
218                     <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
219                     <div class="oe_right">
220                         <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
221                     </div>
222                     <div class="oe_clear"/>
223                 </div>
224                 <sheet string="Supplier Voucher" layout="auto">
225                     <field name="pay_now" invisible="1"/>
226                     <group col="6" colspan="4" class="oe_form_header">
227                         <field name="partner_id" domain="[('supplier','=',True)]" required="1" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" />
228                         <field name="date" string="Bill Date" select="1" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
229                         <field name="journal_id" domain="[('type','in',['purchase','purchase_refund'])]" widget="selection" select="1" on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id, date, amount, type, company_id, context)"/>
230                         <field name="number"/>
231                         <field name="name" colspan="2"/>
232                         <field name="reference" select="1"/>
233                         <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
234                         <field name="account_id" domain="[('type','=','other')]"  invisible="True"/>
235                         <field name="type" invisible="True"/>
236                         <field name="currency_id"/>
237                     </group>
238                     <notebook colspan="4">
239                         <page string="Bill Information">
240                             <field name="line_dr_ids" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" context="{'journal_id':journal_id,'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
241                                 <tree string="Expense Lines" editable="bottom">
242                                     <field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"  groups="account.group_account_user"/>
243                                     <field name="name"/>
244                                     <field name="amount"/>
245                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
246                                 </tree>
247                             </field>
248                             <group col="2" colspan="3">
249                                 <separator string="Internal Notes" colspan="2"/>
250                                 <field name="narration" colspan="2" nolabel="1"/>
251                             </group>
252                             <group col="2" colspan="1">
253                                 <group col="2" colspan="1">
254                                     <separator string="Payment Terms" colspan="2"/>
255                                     <field name="date_due"/>
256                                     <field name="paid" invisible="1"/>
257                                 </group>
258                                 <group col="4" colspan="1">
259                                     <separator string="Total" colspan="4"/>
260                                     <field name="tax_id" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" widget="selection" domain="[('type_tax_use','in',('purchase','all')), ('parent_id', '=', False)]"/><field name="tax_amount" nolabel="1"/><button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
261                                     <label string="" colspan="1"/><field name="amount" string="Total"/>
262                                 </group>
263                             </group>
264                         </page>
265                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
266                             <group col="6" colspan="4">
267                                 <field name="period_id"/>
268                                 <field name="audit"/>
269                             </group>
270                             <field name="move_ids" colspan="4" nolabel="1" readonly="1">
271                                <tree string="Journal Items">
272                                    <field name="move_id"/>
273                                    <field name="ref"/>
274                                    <field name="date"/>
275                                    <field name="statement_id"/>
276                                    <field name="partner_id"/>
277                                    <field name="account_id"/>
278                                    <field name="name"/>
279                                    <field name="debit"/>
280                                    <field name="credit"/>
281                                    <field name="state"/>
282                                    <field name="reconcile_id"/>
283                                </tree>
284                             </field>
285                         </page>
286                     </notebook>
287                     </sheet>
288                     <div class="oe_form_sheet_width">
289                         <field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
290                     </div>
291                 </form>
292             </field>
293         </record>
294         <record id="action_purchase_receipt" model="ir.actions.act_window">
295             <field name="name">Purchase Receipt</field>
296             <field name="res_model">account.voucher</field>
297             <field name="view_type">form</field>
298             <field name="domain">[('journal_id.type','in',['purchase','purchase_refund']), ('type','=','purchase')]</field>
299             <field name="context">{'default_type': 'purchase', 'type': 'purchase'}</field>
300             <field name="view_id" eval="False"/>
301             <field name="search_view_id" eval="view_voucher_filter_vendor"/>
302             <field name="target">current</field>
303             <field name="help"> Click here to create a Purchase Receipt.When the purchase receipt is confirmed, you can record the supplier payment related to this Purchase receipt.</field>
304         </record>
305         <record id="action_purchase_receipt_tree" model="ir.actions.act_window.view">
306             <field eval="1" name="sequence"/>
307             <field name="view_mode">tree</field>
308             <field name="act_window_id" ref="action_purchase_receipt"/>
309         </record>
310         <record id="action_purchase_receipt_form" model="ir.actions.act_window.view">
311             <field eval="2" name="sequence"/>
312             <field name="view_mode">form</field>
313             <field name="view_id" ref="view_purchase_receipt_form"/>
314             <field name="act_window_id" ref="action_purchase_receipt"/>
315         </record>
316
317         <menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
318             action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"/>
319
320     </data>
321 </openerp>