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

	<record model="ir.ui.view" id="letter_letter_type_form">
		<field name="model">letter.letter.type</field>
		<field name="name">letter.letter.type.view</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Letter Type">
				<field name="name" colspan="3" select="1"/>
				<field name="template" select="1"/>
				<field name="paragraph_ids" colspan="3"/>
			</form>
		</field>
	</record>

	<wizard string="Load Paragraphs" model="letter.letter" name="letter.paragraph.load" id="wizard_letter_paragraph_load"/>

	<record model="ir.ui.view" id="letter_letter_form">
		<field name="model">letter.letter</field>
		<field name="name">letter.letter.view</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Letter">
				<field name="name" colspan="3" select="1"/>
				<field name="partner_id" select="1"/>
				<field name="type_id" on_change="onchange_type_id(type_id)"/>
				<newline/>
				<field name="paragraph_ids" colspan="3" widget="one2many_list"/>
				<separator string="States" colspan="4"/>
				<field name="state" select="1"/>
				<group col="2" colspan="2">
					<button name="%(wizard_letter_paragraph_load)d" string="Load Paragraphs" type="action"/>
				</group>
			</form>
		</field>
	</record>
	<record model="ir.actions.act_window" id="action_letter_form">
		<field name="name">letter.letter.form</field>
		<field name="res_model">letter.letter</field>
		<field name="type">ir.actions.act_window</field>
		<field name="view_type">form</field>
		<field name="view_id" ref="letter_letter_form"/>
	</record>
	<menuitem name="Tools/Letters/Letters" id="menu_action_letter_form" action="action_letter_form"/>

	<record model="ir.actions.act_window" id="action_letter_form_draft">
		<field name="name">letter.letter.form</field>
		<field name="res_model">letter.letter</field>
		<field name="type">ir.actions.act_window</field>
		<field name="domain">[('state','=','draft')]</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
	</record>
	<menuitem name="Tools/Letters/Letters/Draft Letters" id="menu_action_letter_form_draft" action="action_letter_form_draft"/>
	<record model="ir.actions.act_window" id="action_letter_form_confirm">
		<field name="name">letter.letter.form</field>
		<field name="res_model">letter.letter</field>
		<field name="type">ir.actions.act_window</field>
		<field name="domain">[('state','=','confirmed')]</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
	</record>
	<menuitem name="Tools/Letters/Letters/Confirmed Letters" id="menu_action_letter_form_confirm" action="action_letter_form_confirm"/>

	<record model="ir.ui.view" id="view_letter_paragraph_tree">
		<field name="model">letter.letter.paragraph</field>
		<field name="name">letter.letter.paragraph.tree</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="Letter Paragraph">
				<field name="sequence"/>
				<field name="name"/>
				<field name="type_id"/>
			</tree>
		</field>
	</record>

	<record model="ir.ui.view" id="view_letter_paragraph_form">
		<field name="model">letter.letter.paragraph</field>
		<field name="name">letter.letter.paragraph.form</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Letter Paragraph">
				<field name="name" select="1" colspan="3"/>
				<field name="sequence"/>
				<field name="type_id"/>
				<field name="content" colspan="3" widget="text_tag"/>
			</form>
		</field>
	</record>

	#
	# Configuration
	#
	
	<record model="ir.ui.view" id="view_paragraph_form">
		<field name="model">letter.paragraph</field>
		<field name="name">letter.paragraph.form</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Letter Paragraph">
				<field name="name" select="1" colspan="3"/>
				<field name="type_id" select="1"/>
				<field name="sequence"/>
				<field name="content" colspan="3" widget="text_tag"/>
			</form>
		</field>
	</record>
	<record model="ir.actions.act_window" id="action_paragraph_form">
		<field name="name">letter.paragraph.form</field>
		<field name="res_model">letter.paragraph</field>
		<field name="type">ir.actions.act_window</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
	</record>
	<menuitem name="Tools/Letters/Configuration" groups="admin" sequence="1"/>
	<menuitem name="Tools/Letters/Configuration/Paragraphs" id="menu_action_paragraph_form" action="action_paragraph_form"/>


	<record model="ir.ui.view" id="view_letter_type_form">
		<field name="model">letter.letter.type</field>
		<field name="name">letter.letter.type.form</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Letter type">
				<field name="name"/>
				<field name="template" />
				<field name="paragraph_ids" colspan="3"/>
			</form>
		</field>
	</record>
	<record model="ir.actions.act_window" id="action_letter_type_form">
		<field name="name">letter.letter.type.form</field>
		<field name="res_model">letter.letter.type</field>
		<field name="type">ir.actions.act_window</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
	</record>
	<menuitem name="Tools/Letters/Configuration/Letter type" id="menu_action_letter_type_form" action="action_letter_type_form"/>


	<record model="ir.ui.view" id="view_paragraph_type_tree">
		<field name="model">letter.paragraph.type</field>
		<field name="name">letter.paragraph.type.tree</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="Paragraph Type">
				<field name="sequence"/>
				<field name="name"/>
			</tree>
		</field>
	</record>
	<record model="ir.ui.view" id="view_paragraph_type_form">
		<field name="model">letter.paragraph.type</field>
		<field name="name">letter.paragraph.type.form</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Paragraph Type">
				<field name="name" select="1"/>
				<field name="sequence"/>
			</form>
		</field>
	</record>
	<record model="ir.actions.act_window" id="action_paragraph_type_form">
		<field name="name">letter.paragraph.type.form</field>
		<field name="res_model">letter.paragraph.type</field>
		<field name="type">ir.actions.act_window</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
	</record>
	<menuitem name="Tools/Letters/Configuration/Paragraphs Type" id="menu_action_paragraph_type_form" action="action_paragraph_type_form"/>

</data>
</terp>
