[IMP] sale order line invisible type
[odoo/odoo.git] / addons / account / edi / invoice_action_data.xml
1 <?xml version="1.0" ?>
2 <openerp>
3     <data>
4         <!-- EDI Export + Send email Action  -->
5         <record id="ir_actions_server_edi_invoice" model="ir.actions.server">
6             <field name="code">if (object.type in ('out_invoice', 'out_refund')) and not object.partner_id.opt_out: object.edi_export_and_email(template_ext_id='account.email_template_edi_invoice', context=context)</field>
7             <field eval="6" name="sequence"/>
8             <field name="state">code</field>
9             <field name="type">ir.actions.server</field>
10             <field name="model_id" ref="account.model_account_invoice"/>
11             <field name="condition">True</field>
12             <field name="name">Auto-email confirmed invoices</field>
13         </record>
14
15         <!-- EDI related Email Templates menu -->
16         <record model="ir.actions.act_window" id="action_email_templates">
17             <field name="name">Email Templates</field>
18             <field name="res_model">email.template</field>
19             <field name="view_type">form</field>
20             <field name="view_mode">form,tree</field>
21             <field name="view_id" ref="email_template.email_template_tree" />
22             <field name="search_view_id" ref="email_template.view_email_template_search"/>
23             <field name="context">{'search_default_model_id':'account.invoice'}</field>
24             <field name="context" eval="{'search_default_model_id': ref('account.model_account_invoice')}"/>
25         </record>
26         <menuitem id="menu_email_templates" parent="menu_configuration_misc" action="action_email_templates" sequence="30" groups="base.group_no_one"/>
27
28     </data>
29
30     <!-- Mail template and workflow bindings are done in a NOUPDATE block
31          so users can freely customize/delete them -->
32     <data noupdate="1">
33         <!-- bind the mailing server action to invoice open activity -->
34         <record id="account.act_open" model="workflow.activity">
35             <field name="action_id" ref="ir_actions_server_edi_invoice"/>
36         </record>
37
38         <!--Email template -->
39         <record id="email_template_edi_invoice" model="email.template">
40             <field name="name">Automated Invoice Notification Mail</field>
41             <field name="email_from">${object.user_id.email or object.company_id.email or 'noreply@localhost'}</field>
42             <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })</field>
43             <field name="email_to">${object.partner_id.email or ''}</field>
44             <field name="model_id" ref="account.model_account_invoice"/>
45             <field name="auto_delete" eval="True"/>
46             <field name="body_html"><![CDATA[
47 <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); ">
48
49     <p>Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
50
51     <p>A new invoice is available for ${object.partner_id.name}: </p>
52     
53     <p style="border-left: 1px solid #8e0000; margin-left: 30px;">
54        &nbsp;&nbsp;<strong>REFERENCES</strong><br />
55        &nbsp;&nbsp;Invoice number: <strong>${object.number}</strong><br />
56        &nbsp;&nbsp;Invoice total: <strong>${object.amount_total} ${object.currency_id.name}</strong><br />
57        &nbsp;&nbsp;Invoice date: ${object.date_invoice}<br />
58        % if object.origin:
59        &nbsp;&nbsp;Order reference: ${object.origin}<br />
60        % endif
61        &nbsp;&nbsp;Your contact: <a href="mailto:${object.user_id.email or ''}?subject=Invoice%20${object.number}">${object.user_id.name}</a>
62     </p>  
63     
64     <p>
65     You can view the invoice document, download it and pay online using the following link:
66     </p>
67             <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;" 
68                href="${ctx.get('edi_web_url_view') or ''}">View Invoice</a>
69     
70     % if object.company_id.paypal_account and object.type in ('out_invoice', 'in_refund'):
71     <% 
72     comp_name = quote(object.company_id.name)
73     inv_number = quote(object.number)
74     paypal_account = quote(object.company_id.paypal_account)
75     inv_amount = quote(str(object.amount_total))
76     cur_name = quote(object.currency_id.name)
77     paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=%s&amp;item_name=%s%%20Invoice%%20%s&amp;" \
78                  "invoice=%s&amp;amount=%s&amp;currency_code=%s&amp;button_subtype=services&amp;no_note=1&amp;bn=OpenERP_Invoice_PayNow_%s" % \
79                  (paypal_account,comp_name,inv_number,inv_number,inv_amount,cur_name,cur_name)
80     %>
81     <br/>
82     <p>It is also possible to directly pay with Paypal:</p>
83         <a style="margin-left: 120px;" href="${paypal_url}">
84             <img class="oe_edi_paypal_button" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif"/>
85         </a>
86     % endif
87     
88     <br/>
89     <p>If you have any question, do not hesitate to contact us.</p>
90     <p>Thank you for choosing ${object.company_id.name or 'us'}!</p>
91     <br/>
92     <br/>
93     <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;">
94         <h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;">
95             <strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
96     </div>
97     <div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
98         <span style="color: #222; margin-bottom: 5px; display: block; ">
99         % if object.company_id.street:
100             ${object.company_id.street}<br/>
101         % endif
102         % if object.company_id.street2:
103             ${object.company_id.street2}<br/>
104         % endif
105         % if object.company_id.city or object.company_id.zip:
106             ${object.company_id.zip} ${object.company_id.city}<br/>
107         % endif
108         % if object.company_id.country_id:
109             ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>
110         % endif
111         </span>
112         % if object.company_id.phone:
113             <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; ">
114                 Phone:&nbsp; ${object.company_id.phone}
115             </div>
116         % endif
117         % if object.company_id.website:
118             <div>
119                 Web :&nbsp;<a href="${object.company_id.website}">${object.company_id.website}</a>
120             </div>
121         %endif
122         <p></p>
123     </div>
124 </div>
125             ]]></field>
126             <field name="body_text"><![CDATA[
127 Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},
128
129 A new invoice is available for ${object.partner_id.name}:
130        | Invoice number: *${object.number}*
131        | Invoice total: *${object.amount_total} ${object.currency_id.name}*
132        | Invoice date: ${object.date_invoice}
133        % if object.origin:
134        | Order reference: ${object.origin}
135        % endif
136        | Your contact: ${object.user_id.name} ${object.user_id.email and '<%s>'%(object.user_id.email) or ''}
137
138 You can view the invoice document, download it and pay online using the following link:
139     ${ctx.get('edi_web_url_view') or 'n/a'}
140
141 % if object.company_id.paypal_account and object.type in ('out_invoice', 'in_refund'):
142 <% 
143 comp_name = quote(object.company_id.name)
144 inv_number = quote(object.number)
145 paypal_account = quote(object.company_id.paypal_account)
146 inv_amount = quote(str(object.amount_total))
147 cur_name = quote(object.currency_id.name)
148 paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=%s&item_name=%s%%20Invoice%%20%s"\
149              "&invoice=%s&amount=%s&currency_code=%s&button_subtype=services&no_note=1&bn=OpenERP_Invoice_PayNow_%s" % \
150              (paypal_account,comp_name,inv_number,inv_number,inv_amount,cur_name,cur_name)
151 %>
152 It is also possible to directly pay with Paypal:
153     ${paypal_url}
154 % endif
155
156 If you have any question, do not hesitate to contact us.
157
158
159 Thank you for choosing ${object.company_id.name}!
160
161
162 --
163 ${object.user_id.name} ${object.user_id.email and '<%s>'%(object.user_id.email) or ''}
164 ${object.company_id.name}
165 % if object.company_id.street:
166 ${object.company_id.street or ''}
167 % endif
168 % if object.company_id.street2:
169 ${object.company_id.street2}
170 % endif
171 % if object.company_id.city or object.company_id.zip:
172 ${object.company_id.zip or ''} ${object.company_id.city or ''}
173 % endif
174 % if object.company_id.country_id:
175 ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}
176 % endif
177 % if object.company_id.phone:
178 Phone: ${object.company_id.phone}
179 % endif
180 % if object.company_id.website:
181 ${object.company_id.website or ''}
182 % endif
183             ]]></field>
184         </record>
185     </data>
186 </openerp>