Merge lp:~camptocamp/account-invoicing/7.0-port-invoice_validation_wkfl into lp:~account-core-editors/account-invoicing/7.0
- 7.0-port-invoice_validation_wkfl
- Merge into 7.0
Proposed by
Yannick Vaucher @ Camptocamp
Status: | Merged |
---|---|
Merged at revision: | 18 |
Proposed branch: | lp:~camptocamp/account-invoicing/7.0-port-invoice_validation_wkfl |
Merge into: | lp:~account-core-editors/account-invoicing/7.0 |
Diff against target: |
486 lines (+174/-199) 5 files modified
invoice_validation_wkfl/__init__.py (+18/-24) invoice_validation_wkfl/__openerp__.py (+38/-50) invoice_validation_wkfl/invoice.py (+35/-42) invoice_validation_wkfl/invoice_view.xml (+49/-51) invoice_validation_wkfl/invoice_wkf.xml (+34/-32) |
To merge this branch: | bzr merge lp:~camptocamp/account-invoicing/7.0-port-invoice_validation_wkfl |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Maxime Chambreuil (http://www.savoirfairelinux.com) | Approve | ||
Guewen Baconnier @ Camptocamp | code review, no test | Approve | |
Alexandre Fayolle - camptocamp | code review, no test | Needs Fixing | |
Review via email: mp+162128@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : | # |
review:
Needs Fixing
(code review, no test)
- 22. By Yannick Vaucher @ Camptocamp
-
[IMP] invoice_
validation_ wkfl - __openerp__ spelling and formating - 23. By Yannick Vaucher @ Camptocamp
-
[IMP] invoice_
validation_ wkfl - remove space before ':'
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
correction made
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : | # |
Small typo fix : l.137 typo : s/incoices/invoices ( + no space before : )
Apart that LGTM
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : | # |
Fixed the typo.
LGTM
review:
Approve
(code review, no test)
- 24. By Guewen Baconnier @ Camptocamp
-
[FIX] typo, no space before colon
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'invoice_validation_wkfl/__init__.py' | |||
2 | --- invoice_validation_wkfl/__init__.py 2011-08-12 12:35:23 +0000 | |||
3 | +++ invoice_validation_wkfl/__init__.py 2013-06-17 09:44:27 +0000 | |||
4 | @@ -1,29 +1,23 @@ | |||
5 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
6 | 2 | ############################################################################## | 2 | ############################################################################## |
7 | 3 | # | 3 | # |
31 | 4 | # Copyright (c) 2010 Camtocamp SA | 4 | # Author: Joël Grand-Guillaume |
32 | 5 | # @author Joël Grand-Guillaume | 5 | # Copyright 2010 Camptocamp SA |
33 | 6 | # | 6 | # |
34 | 7 | # WARNING: This program as such is intended to be used by professional | 7 | # This program is free software: you can redistribute it and/or modify |
35 | 8 | # programmers who take the whole responsability of assessing all potential | 8 | # it under the terms of the GNU Affero General Public License as |
36 | 9 | # consequences resulting from its eventual inadequacies and bugs | 9 | # published by the Free Software Foundation, either version 3 of the |
37 | 10 | # End users who are looking for a ready-to-use solution with commercial | 10 | # License, or (at your option) any later version. |
38 | 11 | # garantees and support are strongly adviced to contract a Free Software | 11 | # |
39 | 12 | # Service Company | 12 | # This program is distributed in the hope that it will be useful, |
40 | 13 | # | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
41 | 14 | # This program is Free Software; you can redistribute it and/or | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
42 | 15 | # modify it under the terms of the GNU General Public License | 15 | # GNU Affero General Public License for more details. |
43 | 16 | # as published by the Free Software Foundation; either version 2 | 16 | # |
44 | 17 | # of the License, or (at your option) any later version. | 17 | # You should have received a copy of the GNU Affero General Public License |
45 | 18 | # | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | 19 | # This program is distributed in the hope that it will be useful, | ||
24 | 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
25 | 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
26 | 22 | # GNU General Public License for more details. | ||
27 | 23 | # | ||
28 | 24 | # You should have received a copy of the GNU General Public License | ||
29 | 25 | # along with this program; if not, write to the Free Software | ||
30 | 26 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
46 | 27 | # | 19 | # |
47 | 28 | ############################################################################## | 20 | ############################################################################## |
48 | 29 | import invoice | ||
49 | 30 | \ No newline at end of file | 21 | \ No newline at end of file |
50 | 22 | import invoice | ||
51 | 23 | |||
52 | 24 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
53 | 31 | 25 | ||
54 | === modified file 'invoice_validation_wkfl/__openerp__.py' | |||
55 | --- invoice_validation_wkfl/__openerp__.py 2013-04-03 14:37:57 +0000 | |||
56 | +++ invoice_validation_wkfl/__openerp__.py 2013-06-17 09:44:27 +0000 | |||
57 | @@ -1,57 +1,45 @@ | |||
58 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
59 | 2 | ############################################################################## | 2 | ############################################################################## |
60 | 3 | # | 3 | # |
86 | 4 | # Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) | 4 | # Author: Joël Grand-Guillaume (Camptocamp) |
87 | 5 | # All Right Reserved | 5 | # Copyright 2010 Camptocamp SA |
88 | 6 | # | 6 | # |
89 | 7 | # Author : Joël Grand-Guillaume (Camptocamp) | 7 | # This program is free software: you can redistribute it and/or modify |
90 | 8 | # | 8 | # it under the terms of the GNU Affero General Public License as |
91 | 9 | # WARNING: This program as such is intended to be used by professional | 9 | # published by the Free Software Foundation, either version 3 of the |
92 | 10 | # programmers who take the whole responsability of assessing all potential | 10 | # License, or (at your option) any later version. |
93 | 11 | # consequences resulting from its eventual inadequacies and bugs | 11 | # |
94 | 12 | # End users who are looking for a ready-to-use solution with commercial | 12 | # This program is distributed in the hope that it will be useful, |
95 | 13 | # garantees and support are strongly adviced to contract a Free Software | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
96 | 14 | # Service Company | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
97 | 15 | # | 15 | # GNU Affero General Public License for more details. |
98 | 16 | # This program is Free Software; you can redistribute it and/or | 16 | # |
99 | 17 | # modify it under the terms of the GNU General Public License | 17 | # You should have received a copy of the GNU Affero General Public License |
100 | 18 | # as published by the Free Software Foundation; either version 2 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
76 | 19 | # of the License, or (at your option) any later version. | ||
77 | 20 | # | ||
78 | 21 | # This program is distributed in the hope that it will be useful, | ||
79 | 22 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
80 | 23 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
81 | 24 | # GNU General Public License for more details. | ||
82 | 25 | # | ||
83 | 26 | # You should have received a copy of the GNU General Public License | ||
84 | 27 | # along with this program; if not, write to the Free Software | ||
85 | 28 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
101 | 29 | # | 19 | # |
102 | 30 | ############################################################################## | 20 | ############################################################################## |
103 | 31 | |||
104 | 32 | { | 21 | { |
129 | 33 | "name" : "Add 'To Send' and 'To Validate' states in Invoices", | 22 | 'name': 'Add "To Send" and "To Validate" states in Invoices', |
130 | 34 | "version" : "1.0", | 23 | 'version': '1.0', |
131 | 35 | "author" : "Camptocamp", | 24 | 'category': 'Generic Modules/Invoicing', |
132 | 36 | "category" : "Generic Modules/Invoicing", | 25 | 'description': |
133 | 37 | "description": | 26 | ''' |
134 | 38 | """ | 27 | This module adds 2 states between draft and open state in invoices: |
135 | 39 | This module adds 2 states between Draft and Open states in Invoices: | 28 | |
136 | 40 | 29 | - To Validate: For invoices which need a validation | |
137 | 41 | - To Validate: for invoices which need a validation | 30 | - To Send: For all invoices that need to be sent |
138 | 42 | - To Send: for invoices that need to be sent | 31 | |
139 | 43 | 32 | ''', | |
140 | 44 | """, | 33 | 'author': 'Camptocamp', |
141 | 45 | "website": "http://camptocamp.com", | 34 | 'website': 'http://camptocamp.com', |
142 | 46 | "depends" : [ | 35 | 'depends': ['account'], |
143 | 47 | "account", | 36 | 'data': [ |
144 | 48 | ], | 37 | 'invoice_wkf.xml', |
145 | 49 | "init_xml" : [], | 38 | 'invoice_view.xml', |
146 | 50 | "demo_xml" : [], | 39 | ], |
147 | 51 | "update_xml" : [ | 40 | 'demo': [], |
148 | 52 | "invoice_wkf.xml", | 41 | 'test': [], |
149 | 53 | "invoice_view.xml", | 42 | 'installable': True, |
150 | 54 | ], | 43 | 'auto_install': False, |
151 | 55 | "active": False, | 44 | 'application': False |
128 | 56 | "installable": False | ||
152 | 57 | } | 45 | } |
153 | 58 | 46 | ||
154 | === modified file 'invoice_validation_wkfl/invoice.py' | |||
155 | --- invoice_validation_wkfl/invoice.py 2012-02-23 09:24:17 +0000 | |||
156 | +++ invoice_validation_wkfl/invoice.py 2013-06-17 09:44:27 +0000 | |||
157 | @@ -1,41 +1,30 @@ | |||
158 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
159 | 2 | ############################################################################## | 2 | ############################################################################## |
160 | 3 | # | 3 | # |
185 | 4 | # Copyright (c) 2010 Camtocamp SA | 4 | # Author: Joël Grand-Guillaume |
186 | 5 | # @author Joël Grand-Guillaume | 5 | # Copyright 2010 Camptocamp SA |
187 | 6 | # $Id: $ | 6 | # |
188 | 7 | # | 7 | # This program is free software: you can redistribute it and/or modify |
189 | 8 | # WARNING: This program as such is intended to be used by professional | 8 | # it under the terms of the GNU Affero General Public License as |
190 | 9 | # programmers who take the whole responsability of assessing all potential | 9 | # published by the Free Software Foundation, either version 3 of the |
191 | 10 | # consequences resulting from its eventual inadequacies and bugs | 10 | # License, or (at your option) any later version. |
192 | 11 | # End users who are looking for a ready-to-use solution with commercial | 11 | # |
193 | 12 | # garantees and support are strongly adviced to contract a Free Software | 12 | # This program is distributed in the hope that it will be useful, |
194 | 13 | # Service Company | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
195 | 14 | # | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
196 | 15 | # This program is Free Software; you can redistribute it and/or | 15 | # GNU Affero General Public License for more details. |
197 | 16 | # modify it under the terms of the GNU General Public License | 16 | # |
198 | 17 | # as published by the Free Software Foundation; either version 2 | 17 | # You should have received a copy of the GNU Affero General Public License |
199 | 18 | # of the License, or (at your option) any later version. | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
176 | 19 | # | ||
177 | 20 | # This program is distributed in the hope that it will be useful, | ||
178 | 21 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
179 | 22 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
180 | 23 | # GNU General Public License for more details. | ||
181 | 24 | # | ||
182 | 25 | # You should have received a copy of the GNU General Public License | ||
183 | 26 | # along with this program; if not, write to the Free Software | ||
184 | 27 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
200 | 28 | # | 19 | # |
201 | 29 | ############################################################################## | 20 | ############################################################################## |
205 | 30 | 21 | from openerp.osv import orm, fields, osv | |
203 | 31 | from osv import fields | ||
204 | 32 | from osv import osv | ||
206 | 33 | from tools.translate import _ | 22 | from tools.translate import _ |
207 | 34 | import netsvc | 23 | import netsvc |
208 | 35 | 24 | ||
210 | 36 | class account_invoice(osv.osv): | 25 | class AccountInvoice(orm.Model): |
211 | 37 | _inherit = "account.invoice" | 26 | _inherit = "account.invoice" |
213 | 38 | 27 | ||
214 | 39 | def action_to_valid(self, cr, uid, ids): | 28 | def action_to_valid(self, cr, uid, ids): |
215 | 40 | """Check if analytic account of each lines is not closed""" | 29 | """Check if analytic account of each lines is not closed""" |
216 | 41 | inv_ids = isinstance(ids, list) and ids[:] or [ids] | 30 | inv_ids = isinstance(ids, list) and ids[:] or [ids] |
217 | @@ -45,16 +34,16 @@ | |||
218 | 45 | for line in inv.invoice_line: | 34 | for line in inv.invoice_line: |
219 | 46 | if line.account_analytic_id and line.account_analytic_id.state in ['close', 'cancelled']: | 35 | if line.account_analytic_id and line.account_analytic_id.state in ['close', 'cancelled']: |
220 | 47 | str_error_lines += "\n- %s" %(line.name) | 36 | str_error_lines += "\n- %s" %(line.name) |
223 | 48 | errors = True | 37 | errors = True |
224 | 49 | if errors: | 38 | if errors: |
225 | 50 | raise osv.except_osv(_('UserError'), | 39 | raise osv.except_osv(_('UserError'), |
226 | 51 | _("You are trying to validate invoice lines linked to a closed or cancelled Analytic Account." | 40 | _("You are trying to validate invoice lines linked to a closed or cancelled Analytic Account." |
228 | 52 | "\n\nCheck the following lines :") | 41 | "\n\nCheck the following lines:") |
229 | 53 | + str_error_lines) | 42 | + str_error_lines) |
231 | 54 | 43 | ||
232 | 55 | self.write(cr, uid, inv_ids, {'state': 'to_valid'}) | 44 | self.write(cr, uid, inv_ids, {'state': 'to_valid'}) |
233 | 56 | return True | 45 | return True |
235 | 57 | 46 | ||
236 | 58 | _columns = { | 47 | _columns = { |
237 | 59 | 'state': fields.selection([ | 48 | 'state': fields.selection([ |
238 | 60 | ('draft','Draft'), | 49 | ('draft','Draft'), |
239 | @@ -64,13 +53,12 @@ | |||
240 | 64 | ('open','Open'), | 53 | ('open','Open'), |
241 | 65 | ('paid','Paid'), | 54 | ('paid','Paid'), |
242 | 66 | ('cancel','Canceled')],'State', select=True, readonly=True), | 55 | ('cancel','Canceled')],'State', select=True, readonly=True), |
248 | 67 | } | 56 | } |
249 | 68 | 57 | ||
250 | 69 | account_invoice() | 58 | |
251 | 70 | 59 | class AccountInvoiceRefund(orm.TransientModel): | |
247 | 71 | class account_invoice_refund(osv.osv_memory): | ||
252 | 72 | _inherit = "account.invoice.refund" | 60 | _inherit = "account.invoice.refund" |
254 | 73 | 61 | ||
255 | 74 | def compute_refund(self, cr, uid, ids, mode='refund', context=None): | 62 | def compute_refund(self, cr, uid, ids, mode='refund', context=None): |
256 | 75 | """ | 63 | """ |
257 | 76 | @param cr: the current row, from the database cursor, | 64 | @param cr: the current row, from the database cursor, |
258 | @@ -95,8 +83,11 @@ | |||
259 | 95 | date = False | 83 | date = False |
260 | 96 | period = False | 84 | period = False |
261 | 97 | description = False | 85 | description = False |
262 | 86 | journal_id = False | ||
263 | 98 | company = res_users_obj.browse(cr, uid, uid, context=context).company_id | 87 | company = res_users_obj.browse(cr, uid, uid, context=context).company_id |
265 | 99 | journal_id = form.get('journal_id', False) | 88 | if form.get('journal_id', False): |
266 | 89 | journal_id = form['journal_id'][0] | ||
267 | 90 | |||
268 | 100 | for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context): | 91 | for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context): |
269 | 101 | if inv.state in ['draft', 'proforma2', 'cancel']: | 92 | if inv.state in ['draft', 'proforma2', 'cancel']: |
270 | 102 | raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode)) | 93 | raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode)) |
271 | @@ -217,4 +208,6 @@ | |||
272 | 217 | invoice_domain.append(('id', 'in', created_inv)) | 208 | invoice_domain.append(('id', 'in', created_inv)) |
273 | 218 | result['domain'] = invoice_domain | 209 | result['domain'] = invoice_domain |
274 | 219 | return result | 210 | return result |
276 | 220 | account_invoice_refund() | 211 | |
277 | 212 | |||
278 | 213 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
279 | 221 | 214 | ||
280 | === modified file 'invoice_validation_wkfl/invoice_view.xml' | |||
281 | --- invoice_validation_wkfl/invoice_view.xml 2011-08-29 11:34:30 +0000 | |||
282 | +++ invoice_validation_wkfl/invoice_view.xml 2013-06-17 09:44:27 +0000 | |||
283 | @@ -1,62 +1,60 @@ | |||
284 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
285 | 1 | <openerp> | 2 | <openerp> |
288 | 2 | <data> | 3 | <data> |
289 | 3 | 4 | ||
290 | 4 | <record model="ir.ui.view" id="invoice_supplier_formc2c"> | 5 | <record model="ir.ui.view" id="invoice_supplier_formc2c"> |
308 | 5 | <field name="name">account.invoice.supplier.formc2c</field> | 6 | <field name="name">account.invoice.supplier.formc2c</field> |
309 | 6 | <field name="model">account.invoice</field> | 7 | <field name="model">account.invoice</field> |
310 | 7 | <field name="inherit_id" ref="account.invoice_supplier_form"/> | 8 | <field name="inherit_id" ref="account.invoice_supplier_form"/> |
311 | 8 | <field name="type">form</field> | 9 | <field name="arch" type="xml"> |
312 | 9 | <field name="arch" type="xml"> | 10 | <xpath expr="/form/header" position="replace"> |
313 | 10 | <xpath expr="/form/notebook/page/group/group[1]" position="replace"> | 11 | <header> |
314 | 11 | <group col="12" colspan="4"> | 12 | <button name="invoice_cancel" states="draft,to_valid,to_send,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/> |
315 | 12 | <button name="invoice_cancel" states="draft,to_valid,to_send,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/> | 13 | <button name="action_cancel_draft" states="cancel" string="Set to Drafttttt" type="object" icon="terp-stock_effects-object-colorize"/> |
316 | 13 | <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/> | 14 | <button name="%(account.action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/> |
317 | 14 | <button name="%(account.action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/> | 15 | <button name="%(account.action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="account.group_account_user"/> |
318 | 15 | <button name="%(account.action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="account.group_account_user"/> | 16 | <button name="invoice_open" states="to_send,proforma2" string="Approve" icon="terp-camera_test"/> |
319 | 16 | <button name="invoice_open" states="to_send,proforma2" string="Approve" icon="terp-camera_test"/> | 17 | <button name="invoice_to_valid" states="draft" string="To Validation" icon="terp-camera_test"/> |
320 | 17 | <button name="invoice_to_valid" states="draft" string="To Validation" icon="terp-camera_test"/> | 18 | <button name="invoice_to_send" states="to_valid" string="Invoice to send" icon="terp-camera_test"/> |
321 | 18 | <button name="invoice_to_send" states="to_valid" string="Invoice to send" icon="terp-camera_test"/> | 19 | <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/> |
322 | 19 | </group> | 20 | </header> |
323 | 20 | </xpath> | 21 | </xpath> |
324 | 21 | </field> | 22 | </field> |
325 | 22 | </record> | 23 | </record> |
326 | 23 | 24 | ||
327 | 24 | <record model="ir.ui.view" id="invoice_formc2c"> | 25 | <record model="ir.ui.view" id="invoice_formc2c"> |
347 | 25 | <field name="name">account.invoice.formc2c</field> | 26 | <field name="name">account.invoice.formc2c</field> |
348 | 26 | <field name="model">account.invoice</field> | 27 | <field name="model">account.invoice</field> |
349 | 27 | <field name="inherit_id" ref="account.invoice_form"/> | 28 | <field name="inherit_id" ref="account.invoice_form"/> |
350 | 28 | <field name="type">form</field> | 29 | <field name="arch" type="xml"> |
351 | 29 | <field name="arch" type="xml"> | 30 | <xpath expr="/form/header" position="replace"> |
352 | 30 | <xpath expr="/form/notebook/page/group/group[@groups='base.group_user']" position="replace"> | 31 | <header> |
353 | 31 | <group col="12" colspan="4" groups="base.group_user"> | 32 | <button name="invoice_cancel" states="to_send,to_valid,draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/> |
354 | 32 | <button name="invoice_cancel" states="to_send,to_valid,draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/> | 33 | <button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" icon="terp-stock_effects-object-colorize"/> |
355 | 33 | <button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" icon="terp-stock_effects-object-colorize"/> | 34 | <button name="invoice_to_send" states="to_valid" string="Invoice To Send" icon="gtk-go-forward"/> |
356 | 34 | <button name="invoice_to_send" states="to_valid" string="Invoice To Send" icon="gtk-go-forward"/> | 35 | <button name="invoice_to_valid" states="draft" string="To Validation" icon="terp-gtk-media-pause"/> |
357 | 35 | <button name="invoice_to_valid" states="draft" string="To Validation" icon="terp-gtk-media-pause"/> | 36 | <button name="%(account.action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/> |
358 | 36 | <button name="%(account.action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/> | 37 | <button name='%(account.action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="account.group_account_user"/> |
359 | 37 | <button name='%(account.action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="account.group_account_user"/> | 38 | <button name="invoice_proforma2" states="to_send" string="PRO-FORMA" icon="terp-gtk-media-pause" /> |
360 | 38 | <button name="invoice_proforma2" states="to_send" string="PRO-FORMA" icon="terp-gtk-media-pause" /> | 39 | <button name="invoice_open" states="to_send,proforma2" string="Validate" icon="gtk-go-forward"/> |
361 | 39 | <button name="invoice_open" states="to_send,proforma2" string="Validate" icon="gtk-go-forward"/> | 40 | <button name="%(account.account_invoices)d" string="Print Invoice" type="action" icon="gtk-print" states="open,paid,proforma,sale,proforma2"/> |
362 | 40 | <button name="%(account.account_invoices)d" string="Print Invoice" type="action" icon="gtk-print" states="open,paid,proforma,sale,proforma2"/> | 41 | <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/> |
363 | 41 | </group> | 42 | </header> |
364 | 42 | </xpath> | 43 | </xpath> |
365 | 43 | </field> | 44 | </field> |
366 | 44 | </record> | 45 | </record> |
367 | 45 | 46 | ||
368 | 46 | |||
369 | 47 | <record id="view_account_invoice_filter" model="ir.ui.view"> | 47 | <record id="view_account_invoice_filter" model="ir.ui.view"> |
380 | 48 | <field name="name">account.invoice.valid_wkf.select</field> | 48 | <field name="name">account.invoice.valid_wkf.select</field> |
381 | 49 | <field name="model">account.invoice</field> | 49 | <field name="model">account.invoice</field> |
382 | 50 | <field name="type">search</field> | 50 | <field name="inherit_id" ref="account.view_account_invoice_filter" /> |
383 | 51 | <field name="inherit_id" ref="account.view_account_invoice_filter" /> | 51 | <field name="arch" type="xml"> |
384 | 52 | <field name="arch" type="xml"> | 52 | <xpath expr="/search/filter[@name='proforma']" position="after"> |
385 | 53 | <xpath expr="/search/group/filter[@name='proforma']" position="after"> | 53 | <filter name="to_valid" icon="terp-camera_test" string="To Validate" domain="[('state','=','to_valid')]" help="To Validate Invoices"/> |
386 | 54 | <filter name="to_valid" icon="terp-camera_test" string="To Validate" domain="[('state','=','to_valid')]" help="To Validate Invoices"/> | 54 | <filter name="to_send" icon="terp-check" string="To Send" domain="[('state','=','to_send')]" help="To Send Invoices"/> |
387 | 55 | <filter name="to_send" icon="terp-check" string="To Send" domain="[('state','=','to_send')]" help="To Send Invoices"/> | 55 | </xpath> |
388 | 56 | </xpath> | 56 | </field> |
379 | 57 | </field> | ||
389 | 58 | </record> | 57 | </record> |
390 | 59 | 58 | ||
393 | 60 | 59 | </data> | |
392 | 61 | </data> | ||
394 | 62 | </openerp> | 60 | </openerp> |
395 | 63 | 61 | ||
396 | === modified file 'invoice_validation_wkfl/invoice_wkf.xml' | |||
397 | --- invoice_validation_wkfl/invoice_wkf.xml 2012-02-23 09:24:17 +0000 | |||
398 | +++ invoice_validation_wkfl/invoice_wkf.xml 2013-06-17 09:44:27 +0000 | |||
399 | @@ -1,53 +1,55 @@ | |||
400 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
401 | 1 | <openerp> | 2 | <openerp> |
404 | 2 | <data> | 3 | <data> |
405 | 3 | 4 | ||
406 | 4 | <record model="workflow.activity" id="act_to_send"> | 5 | <record model="workflow.activity" id="act_to_send"> |
411 | 5 | <field name="wkf_id" ref="account.wkf"/> | 6 | <field name="wkf_id" ref="account.wkf"/> |
412 | 6 | <field name="name">to_send</field> | 7 | <field name="name">to_send</field> |
413 | 7 | <field name="action">write({'state':'to_send'})</field> | 8 | <field name="action">write({'state':'to_send'})</field> |
414 | 8 | <field name="kind">function</field> | 9 | <field name="kind">function</field> |
415 | 9 | </record> | 10 | </record> |
417 | 10 | 11 | ||
418 | 11 | <record model="workflow.activity" id="act_to_valid"> | 12 | <record model="workflow.activity" id="act_to_valid"> |
423 | 12 | <field name="wkf_id" ref="account.wkf"/> | 13 | <field name="wkf_id" ref="account.wkf"/> |
424 | 13 | <field name="name">to_valid</field> | 14 | <field name="name">to_valid</field> |
425 | 14 | <field name="action">action_to_valid()</field> | 15 | <field name="action">action_to_valid()</field> |
426 | 15 | <field name="kind">function</field> | 16 | <field name="kind">function</field> |
427 | 16 | </record> | 17 | </record> |
429 | 17 | 18 | ||
430 | 18 | <record model="workflow.transition" id="t_draft_to_valid"> | 19 | <record model="workflow.transition" id="t_draft_to_valid"> |
434 | 19 | <field name="act_from" ref="account.act_draft"/> | 20 | <field name="act_from" ref="account.act_draft"/> |
435 | 20 | <field name="act_to" ref="act_to_valid"/> | 21 | <field name="act_to" ref="act_to_valid"/> |
436 | 21 | <field name="signal">invoice_to_valid</field> | 22 | <field name="signal">invoice_to_valid</field> |
437 | 22 | </record> | 23 | </record> |
438 | 23 | 24 | ||
439 | 24 | <record model="workflow.transition" id="t_valid_to_send"> | 25 | <record model="workflow.transition" id="t_valid_to_send"> |
443 | 25 | <field name="act_from" ref="act_to_valid"/> | 26 | <field name="act_from" ref="act_to_valid"/> |
444 | 26 | <field name="act_to" ref="act_to_send"/> | 27 | <field name="act_to" ref="act_to_send"/> |
445 | 27 | <field name="signal">invoice_to_send</field> | 28 | <field name="signal">invoice_to_send</field> |
446 | 28 | </record> | 29 | </record> |
447 | 29 | 30 | ||
448 | 30 | <record model="workflow.transition" id="t_send_to_pro2"> | 31 | <record model="workflow.transition" id="t_send_to_pro2"> |
452 | 31 | <field name="act_from" ref="act_to_send"/> | 32 | <field name="act_from" ref="act_to_send"/> |
453 | 32 | <field name="act_to" ref="account.act_proforma2"/> | 33 | <field name="act_to" ref="account.act_proforma2"/> |
454 | 33 | <field name="signal">invoice_proforma2</field> | 34 | <field name="signal">invoice_proforma2</field> |
455 | 34 | </record> | 35 | </record> |
456 | 35 | <record model="workflow.transition" id="account.t4"> | 36 | <record model="workflow.transition" id="account.t4"> |
460 | 36 | <field name="act_from" ref="act_to_send"/> | 37 | <field name="act_from" ref="act_to_send"/> |
461 | 37 | <field name="act_to" ref="account.act_open"/> | 38 | <field name="act_to" ref="account.act_open"/> |
462 | 38 | <field name="signal">invoice_open</field> | 39 | <field name="signal">invoice_open</field> |
463 | 39 | </record> | 40 | </record> |
465 | 40 | 41 | ||
466 | 41 | <record model="workflow.transition" id="account.t9"> | 42 | <record model="workflow.transition" id="account.t9"> |
470 | 42 | <field name="act_from" ref="act_to_send"/> | 43 | <field name="act_from" ref="act_to_send"/> |
471 | 43 | <field name="act_to" ref="account.act_cancel"/> | 44 | <field name="act_to" ref="account.act_cancel"/> |
472 | 44 | <field name="signal">invoice_cancel</field> | 45 | <field name="signal">invoice_cancel</field> |
473 | 45 | </record> | 46 | </record> |
474 | 47 | |||
475 | 46 | <record model="workflow.transition" id="t_valid_to_cancel"> | 48 | <record model="workflow.transition" id="t_valid_to_cancel"> |
479 | 47 | <field name="act_from" ref="act_to_valid"/> | 49 | <field name="act_from" ref="act_to_valid"/> |
480 | 48 | <field name="act_to" ref="account.act_cancel"/> | 50 | <field name="act_to" ref="account.act_cancel"/> |
481 | 49 | <field name="signal">invoice_cancel</field> | 51 | <field name="signal">invoice_cancel</field> |
482 | 50 | </record> | 52 | </record> |
483 | 51 | 53 | ||
485 | 52 | </data> | 54 | </data> |
486 | 53 | </openerp> | 55 | </openerp> |
line 134: s/add/adds/
line 229: remove space before ':'