[IMP] Dashboard: moved 'Create' button in title of action
[odoo/odoo.git] / addons / purchase / edi / purchase_order_action_data.xml
1 <?xml version="1.0" ?>
2 <openerp>
3     <data>
4         <!--Export edi document  -->
5         <record id="ir_actions_server_edi_purchase" model="ir.actions.server">
6             <field name="code">if not object.partner_id.opt_out: object.edi_export_and_email(template_ext_id='purchase.email_template_edi_purchase', context=context)</field>
7             <field name="state">code</field>
8             <field name="type">ir.actions.server</field>
9             <field name="model_id" ref="purchase.model_purchase_order"/>
10             <field name="condition">True</field>
11             <field name="name">Auto-email confirmed purchase orders</field>
12         </record>
13
14         <!-- EDI related Email Templates menu -->
15         <record model="ir.actions.act_window" id="action_email_templates">
16             <field name="name">Email Templates</field>
17             <field name="res_model">email.template</field>
18             <field name="view_type">form</field>
19             <field name="view_mode">form,tree</field>
20             <field name="view_id" ref="email_template.email_template_tree" />
21             <field name="search_view_id" ref="email_template.view_email_template_search"/>
22             <field name="context" eval="{'search_default_model_id': ref('purchase.model_purchase_order')}"/>
23         </record>
24         <menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_purchase_config_purchase" sequence="30"/>
25         <menuitem id="menu_email_templates" parent="menu_configuration_misc" action="action_email_templates" sequence="30"/>
26     </data>
27
28     <!-- Mail template and workflow bindings are done in a NOUPDATE block
29          so users can freely customize/delete them -->
30     <data noupdate="1">
31          <!-- bind the mailing server action to purchase.order confirmed activity -->
32         <record id="purchase.act_confirmed" model="workflow.activity">
33             <field name="action_id" ref="ir_actions_server_edi_purchase"/>
34         </record>
35
36         <!--Email template -->
37         <record id="email_template_edi_purchase" model="email.template">
38             <field name="name">Automated Purchase Order Notification Mail</field>
39             <field name="email_from">${object.validator.user_email or ''}</field>
40             <field name="subject">${object.company_id.name} Order (Ref ${object.name or 'n/a' })</field>
41             <field name="email_to">${object.partner_address_id.email}</field>
42             <field name="model_id" ref="purchase.model_purchase_order"/>
43             <field name="auto_delete" eval="True"/>
44             <field name="body_html"><![CDATA[
45 <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
46
47     <p>Hello${object.partner_address_id.name and ' ' or ''}${object.partner_address_id.name or ''},</p>
48     
49     <p>Here is a purchase order confirmation from ${object.company_id.name}: </p>
50     
51     <p style="border-left: 1px solid #8e0000; margin-left: 30px;">
52        &nbsp;&nbsp;<strong>REFERENCES</strong><br />
53        &nbsp;&nbsp;Order number: <strong>${object.name}</strong><br />
54        &nbsp;&nbsp;Order total: <strong>${object.amount_total} ${object.pricelist_id.currency_id.name}</strong><br />
55        &nbsp;&nbsp;Order date: ${object.date_order}<br />
56        % if object.origin:
57        &nbsp;&nbsp;Order reference: ${object.origin}<br />
58        % endif
59        % if object.partner_ref:
60        &nbsp;&nbsp;Your reference: ${object.partner_ref}<br />
61        % endif
62        &nbsp;&nbsp;Your contact: <a href="mailto:${object.validator.user_email or ''}?subject=Order%20${object.name}">${object.validator.name}</a>
63     </p>
64
65     <p>
66     You can view the order confirmation document and download it using the following link:
67     </p>
68             <a style="display:block; width: 150px; height:20px; margin-left: 120px; color: #FFF; font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 13px; font-weight: bold; text-align: center; text-decoration: none !important; line-height: 1; padding: 5px 0px 0px 0px; background-color: #8E0000; border-radius: 5px 5px; background-repeat: repeat no-repeat;" 
69                href="${ctx.get('edi_web_url_view') or ''}">View Order</a>
70
71     <br/>
72     <p>If you have any question, do not hesitate to contact us.</p>
73     <p>Thank you!</p>
74     <br/>
75     <br/>
76     <div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
77         <h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;">
78             <strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
79     </div>
80     <div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
81         <span style="color: #222; margin-bottom: 5px; display: block; ">
82         % if object.company_id.street:
83             ${object.company_id.street}<br/>
84         % endif
85         % if object.company_id.street2:
86             ${object.company_id.street2}<br/>
87         % endif
88         % if object.company_id.city or object.company_id.zip:
89             ${object.company_id.zip} ${object.company_id.city}<br/>
90         % endif
91         % if object.company_id.country_id:
92             ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>
93         % endif
94         </span>
95         % if object.company_id.phone:
96             <div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">
97                 Phone:&nbsp; ${object.company_id.phone}
98             </div>
99         % endif
100         % if object.company_id.website:
101             <div>
102                 Web :&nbsp;<a href="${object.company_id.website}">${object.company_id.website}</a>
103             </div>
104         %endif
105         <p></p>
106     </div>
107 </div>
108             ]]></field>
109             <field name="body_text"><![CDATA[
110 Hello${object.partner_address_id.name and ' ' or ''}${object.partner_address_id.name or ''},
111
112 Here is a purchase order confirmation from ${object.company_id.name}:
113        | Order number: *${object.name}*
114        | Order total: *${object.amount_total} ${object.pricelist_id.currency_id.name}*
115        | Order date: ${object.date_order}
116        % if object.origin:
117        | Order reference: ${object.origin}
118        % endif
119        % if object.partner_ref:
120        | Your reference: ${object.partner_ref}<br />
121        % endif
122        | Your contact: ${object.validator.name} ${object.validator.user_email and '<%s>'%(object.validator.user_email) or ''}
123
124 You can view the order confirmation and download it using the following link:
125     ${ctx.get('edi_web_url_view') or 'n/a'}
126
127 If you have any question, do not hesitate to contact us.
128
129 Thank you!
130
131
132 --
133 ${object.validator.name} ${object.validator.user_email and '<%s>'%(object.validator.user_email) or ''}
134 ${object.company_id.name}
135 % if object.company_id.street:
136 ${object.company_id.street or ''}
137 % endif
138 % if object.company_id.street2:
139 ${object.company_id.street2}
140 % endif
141 % if object.company_id.city or object.company_id.zip:
142 ${object.company_id.zip or ''} ${object.company_id.city or ''}
143 % endif
144 % if object.company_id.country_id:
145 ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}
146 % endif
147 % if object.company_id.phone:
148 Phone: ${object.company_id.phone}
149 % endif
150 % if object.company_id.website:
151 ${object.company_id.website or ''}
152 % endif
153             ]]></field>
154         </record>
155     </data>
156 </openerp>