From 7bf78a7097f724258060badf28a97311f4cc19b2 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 27 Mar 2013 14:36:45 +0100 Subject: [PATCH] [FIX] Clean up: wipe of timeinvoicecreateviewfinal wizard bzr revid: jco@openerp.com-20130327133645-ax49xrxvt5svh4b1 --- addons/hr_timesheet_invoice/__openerp__.py | 1 - .../test/test_hr_timesheet_invoice.yml | 17 +---- .../test_hr_timesheet_invoice_no_prod_tax.yml | 17 +---- .../hr_timesheet_final_invoice_create.py | 63 ------------------- ...hr_timesheet_invoice_create_final_view.xml | 52 --------------- 5 files changed, 2 insertions(+), 148 deletions(-) delete mode 100644 addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py delete mode 100644 addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py index d15dd3b0e3b..888902e1484 100644 --- a/addons/hr_timesheet_invoice/__openerp__.py +++ b/addons/hr_timesheet_invoice/__openerp__.py @@ -46,7 +46,6 @@ reports.""", 'report/hr_timesheet_invoice_report_view.xml', 'wizard/hr_timesheet_analytic_profit_view.xml', 'wizard/hr_timesheet_invoice_create_view.xml', - 'wizard/hr_timesheet_invoice_create_final_view.xml', ], 'demo': ['hr_timesheet_invoice_demo.xml'], 'test': ['test/test_hr_timesheet_invoice.yml', diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml index de19ea8fb3a..05326bb19c1 100644 --- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml +++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml @@ -102,19 +102,4 @@ assert aline.invoice_id, "Invoice created, but analytic line wasn't updated." assert aline.invoice_id == invoice_id, "Invoice doesn't match the one at analytic line" assert invoice_id.amount_untaxed == 187.5, "Invoice amount mismatch: %s" % invoice_id.amount_untaxed - assert invoice_id.amount_tax == 50, "Invoice tax mismatch: %s" % invoice_id.amount_tax -- - I create final invoice for this analytic account. -- - !record {model: hr.timesheet.invoice.create.final, id: hr_timesheet_invoice_create_final_0}: - date: 1 - name: 1 - price: 1 - time: 1 -- - I click on "Create Invoice" button to create Invoice and validate the invoice. -- - !python {model: hr.timesheet.invoice.create.final}: | - import netsvc - wkf_service = netsvc.LocalService("workflow") - res = self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_final_0")], {"active_ids": [ref("account.analytic_agrolait")]}) + assert invoice_id.amount_tax == 50, "Invoice tax mismatch: %s" % invoice_id.amount_tax \ No newline at end of file diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml index 68e827e79f1..88675f3042f 100644 --- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml +++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml @@ -101,19 +101,4 @@ assert aline.invoice_id, "Invoice created, but analytic line wasn't updated." assert aline.invoice_id == invoice_id, "Invoice doesn't match the one at analytic line" assert invoice_id.amount_untaxed == 187.5, "Invoice amount mismatch: %s" % invoice_id.amount_untaxed - assert invoice_id.amount_tax == 40, "Invoice tax mismatch: %s" % invoice_id.amount_tax -- - I create final invoice for this analytic account. -- - !record {model: hr.timesheet.invoice.create.final, id: hr_timesheet_invoice_create_final_0}: - date: 1 - name: 1 - price: 1 - time: 1 -- - I click on "Create Invoice" button to create Invoice and validate the invoice. -- - !python {model: hr.timesheet.invoice.create.final}: | - import netsvc - wkf_service = netsvc.LocalService("workflow") - res = self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_final_0")], {"active_ids": [ref("account.analytic_agrolait")]}) + assert invoice_id.amount_tax == 40, "Invoice tax mismatch: %s" % invoice_id.amount_tax \ No newline at end of file diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py deleted file mode 100644 index 1977d6cccc5..00000000000 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import time - -from openerp.osv import fields, osv -from openerp.tools.translate import _ - -# -# Create an final invoice based on selected timesheet lines -# - -# -# TODO: check unit of measure !!! -# -class final_invoice_create(osv.osv_memory): - _name = 'hr.timesheet.invoice.create.final' - _description = 'Create invoice from timesheet final' - _columns = { - 'date': fields.boolean('Date', help='Display date in the history of works'), - 'time': fields.boolean('Time Spent', help='Display time in the history of works'), - 'name': fields.boolean('Log of Activity', help='Display detail of work in the invoice line.'), - 'price': fields.boolean('Cost', help='Display cost of the item you reinvoice'), - 'product': fields.many2one('product.product', 'Product', help='The product that will be used to invoice the remaining amount'), - } - - def do_create(self, cr, uid, ids, context=None): - data = self.read(cr, uid, ids, [], context=context)[0] - # hack for fixing small issue (context should not propagate implicitly between actions) - if 'default_type' in context: - del context['default_type'] - ids = self.pool.get('account.analytic.line').search(cr, uid, [('invoice_id','=',False),('to_invoice','<>', False), ('account_id', 'in', context['active_ids'])], context=context) - invs = self.pool.get('account.analytic.line').invoice_cost_create(cr, uid, ids, data, context=context) - mod_obj = self.pool.get('ir.model.data') - act_obj = self.pool.get('ir.actions.act_window') - mod_ids = mod_obj.search(cr, uid, [('name', '=', 'action_invoice_tree1')], context=context)[0] - res_id = mod_obj.read(cr, uid, mod_ids, ['res_id'], context=context)['res_id'] - act_win = act_obj.read(cr, uid, res_id, [], context=context) - act_win['domain'] = [('id','in',invs),('type','=','out_invoice')] - act_win['name'] = _('Invoices') - return act_win - -final_invoice_create() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml deleted file mode 100644 index d1c95212139..00000000000 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Create Invoice - ir.actions.act_window - hr.timesheet.invoice.create.final - form - form - new - - - - - - Invoice - client_action_multi - - action - account.analytic.account - - - - - hr.timesheet.invoice.create.final.form - hr.timesheet.invoice.create.final - -
-

Do you want to show details of each activity to your customer?

- - - - - - - - - - - - - -
-
-
- -
-