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