<?xml version="1.0"?>
<terp>
<data>

	<record model="ir.ui.view" id="view_company_from_invoice">
		<field name="name">res.company.form</field>
		<field name="model">res.company</field>
		<field name="inherit_id" ref="base.view_company_form"/>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<field name="rml_footer2" position="after">
				<field name="currency_id" />
			</field>
		</field>
	</record>
	
	
	#---------------------------------------------------------
	# Invoices
	#---------------------------------------------------------
	<record model="ir.ui.view" id="view_invoice_line_tree">
		<field name="name">account.invoice.line.tree</field>
		<field name="model">account.invoice.line</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="Invoice Line">
				<field name="name"/>
				<field name="account_id"/>
				<field name="quantity"/>
				<field name="uos_id"/>
				<field name="price_unit"/>
				<field name="discount"/>
				<field name="price_subtotal"/>
			</tree>
		</field>
	</record>
	<record model="ir.ui.view" id="view_invoice_line_form">
		<field name="name">account.invoice.line.form</field>
		<field name="model">account.invoice.line</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Invoice Line">
				<notebook>
					<page string="Line">
						<field name="name" select="1"/>
						<field name="account_id" on_change="onchange_account_id(parent.partner_id,account_id)" />
						<field name="product_id" select="1" on_change="product_id_change(product_id, uos_id, quantity, name)"/>
						<field name="uos_id"/>
						<field name="quantity" select="1"/>
						<field name="price_unit" select="1"/>
						<field name="discount"/>
						<newline/>
						<field name="price_subtotal"/>
						<field name="invoice_line_tax_id" colspan="3"/> 
					</page>
					<page string="Other">
						<field name="note" colspan="4"/>
					</page>
				</notebook>
			</form>
		</field>
	</record>
	<record model="ir.ui.view" id="view_invoice_tax_tree">
		<field name="name">account.invoice.tax.tree</field>
		<field name="model">account.invoice.tax</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="Manual Invoice Taxes">
				<field name="sequence"/>
				<field name="manual"/>
				<field name="name"/>
				<field name="account_id"/>
				<field name="base"/>
				<field name="amount"/>
			</tree>
		</field>
	</record>
	<record model="ir.ui.view" id="view_invoice_tax_form">
		<field name="name">account.invoice.tax.form</field>
		<field name="model">account.invoice.tax</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Manual Invoice Taxes">
				<field name="name" select="1"/>
				<field name="sequence"/>
				<field name="account_id" select="1"/>
				<field name="manual" select="1"/>
				<field name="amount" select="1"/>
				<field name="base"/>
				<separator string="Tax codes" colspan="4"/>
				<field name="base_code_id"/>
				<field name="base_amount"/>
				<field name="tax_code_id"/>
				<field name="tax_amount"/>
			</form>
		</field>
	</record>

	<record model="ir.ui.view" id="invoice_tree">
		<field name="name">account.invoice.tree</field>
		<field name="model">account.invoice</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="Invoice" colors="grey:state=='draft'">
				<field name="name"/>
				<field name="type"/>
				<field name="number"/>
				<field name="date_invoice"/>
				<field name="partner_id"/>
				<field name="amount_untaxed"/>
				<field name="amount_total"/>
				<field name="currency_id"/>
				<field name="state"/>
			</tree>
		</field>
	</record>

	<record model="ir.ui.view" id="invoice_form">
		<field name="name">account.invoice.form1</field>
		<field name="model">account.invoice</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Invoice">
			<notebook>
				<page string="Invoice">
					<field name="name" select="1"/>
					<field name="currency_id" on_change="onchange_currency_id(currency_id)" select="1"/>
					<newline/>
					<field name="type" select="1"/>
					<field name="number" select="1"/>
					<newline/>

					<field name="partner_id" on_change="onchange_partner_id(type,partner_id)" select="1"/>
					<field name="address_invoice_id" domain="[('partner_id','=',partner_id)]"/>

					<field name="account_id"/>
					<field name="project_id"/>

					<field name="payment_term"/>
					<field name="date_due"/>

					<field name="journal_id" select="1"/>

					<field name="invoice_line" nolabel="1" widget="one2many_list" colspan="4"/>
					<group colspan="4" col="7">
						<field name="amount_untaxed"/>
						<field name="amount_tax"/>
						<field name="amount_total"/>
						<button name="button_compute" string="Compute" states="draft" type="object"/>
					</group>

					<group col="6" colspan="4">
						<field name="state" readonly="1" select="1"/>
						<button name="invoice_proforma" states="draft" string="Create PRO-FORMA"/>
						<button name="invoice_open" states="draft,proforma" string="Create Invoice"/>
						<button name="invoice_cancel" states="draft,proforma,sale,open" string="Cancel Invoice"/>
						<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
					</group>
				</page>
				<page string="Tax Lines">
					<field name="tax_line" nolabel="1" widget="one2many_list" colspan="4"/>
				</page>
				<page string="Other Information">
					<field name="reference" select="1"/>
					<field name="origin"/>
					<field name="address_contact_id" domain="[('partner_id','=',partner_id)]" colspan="3"/>
					<field name="partner_ref"/>
					<field name="partner_contact"/>
					<field name="move_id"/>
					<field name="date_invoice" select="1"/>
					<field name="period_id"/><label string="(keep empty to use the current period)" align="0.0" colspan="2"/>
					<newline/>
					<field name="comment" colspan="3"/>
				</page>
			</notebook>
			</form>
		</field>
	</record>

	<record model="ir.actions.act_window" id="action_invoice_form">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_id" ref="invoice_form"/>
	</record>
	<menuitem name="Financial Management/Invoices" id="menu_action_invoice_form" action="action_invoice_form" sequence="6"/>

	<record model="ir.actions.act_window" id="action_invoice_tree1">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('type','=','out_invoice')]</field>
		<field name="context">{'type':'out_invoice'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Customers Invoices" id="menu_action_invoice_tree1" action="action_invoice_tree1"/>
	
	<record model="ir.actions.act_window" id="action_invoice_tree2">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('type','=','in_invoice')]</field>
		<field name="context">{'type':'in_invoice'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Suppliers Invoices" id="menu_action_invoice_tree2" action="action_invoice_tree2"/>

	<record model="ir.actions.act_window" id="action_invoice_tree3">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('type','=','out_refund')]</field>
		<field name="context">{'type':'out_refund'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Customers Refund" id="menu_action_invoice_tree3" action="action_invoice_tree3"/>

	<record model="ir.actions.act_window" id="action_invoice_tree4">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('type','=','in_refund')]</field>
		<field name="context">{'type':'in_refund'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Suppliers Refund" id="menu_action_invoice_tree4" action="action_invoice_tree4"/>

	<record model="ir.actions.act_window" id="action_invoice_tree5">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('state','=','draft'),('type','=','out_invoice')]</field>
		<field name="context">{'type':'out_invoice'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Customers Invoices/Draft Invoices" action="action_invoice_tree5" id="menu_invoice_draft"/>

	<record model="ir.actions.act_window" id="action_invoice_tree6">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('state','=','proforma'),('type','=','out_invoice')]</field>
		<field name="context">{'type':'out_invoice'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Customers Invoices/PRO-FORMA" id="menu_action_invoice_tree6" action="action_invoice_tree6"/>

	<record model="ir.actions.act_window" id="action_invoice_tree7">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('state','=','open'),('type','=','out_invoice')]</field>
		<field name="context">{'type':'out_invoice'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Customers Invoices/Opened Invoices" id="menu_action_invoice_tree7" action="action_invoice_tree7"/>

	<record model="ir.actions.act_window" id="action_invoice_tree8">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('state','=','draft'),('type','=','in_invoice')]</field>
		<field name="context">{'type':'in_invoice'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Suppliers Invoices/Draft" id="menu_action_invoice_tree8" action="action_invoice_tree8"/>

	<record model="ir.actions.act_window" id="action_invoice_tree9">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('state','=','open'),('type','=','in_invoice')]</field>
		<field name="context">{'type':'in_invoice'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Suppliers Invoices/Opened" id="menu_action_invoice_tree9" action="action_invoice_tree9"/>

	<record model="ir.actions.act_window" id="action_invoice_tree10">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('state','=','draft'),('type','=','out_refund')]</field>
		<field name="context">{'type':'out_refund'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Customers Refund/Draft" id="menu_action_invoice_tree10" action="action_invoice_tree10"/>
	
	<record model="ir.actions.act_window" id="action_invoice_tree11">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('state','=','open'),('type','=','out_refund')]</field>
		<field name="context">{'type':'out_refund'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Customers Refund/Opened" id="menu_action_invoice_tree11" action="action_invoice_tree11"/>

	<record model="ir.actions.act_window" id="action_invoice_tree12">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('state','=','draft'),('type','=','in_refund')]</field>
		<field name="context">{'type':'in_refund'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Suppliers Refund/Draft" id="menu_action_invoice_tree12" action="action_invoice_tree12"/>
	
	<record model="ir.actions.act_window" id="action_invoice_tree13">
		<field name="name">account.invoice</field>
		<field name="res_model">account.invoice</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('state','=','open'),('type','=','in_refund')]</field>
		<field name="context">{'type':'in_refund'}</field>
	</record>
	<menuitem name="Financial Management/Invoices/Suppliers Refund/Opened" id="menu_action_invoice_tree13" action="action_invoice_tree13"/>

</data>
</terp>
