diff --git a/exportsage50/__init__.py b/exportsage50/__init__.py index bd1e5e5..468cd70 100755 --- a/exportsage50/__init__.py +++ b/exportsage50/__init__.py @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -############################################################################## +############################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Gestion-Ressources (). @@ -11,13 +11,12 @@ # # 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 +# 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 wizard -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +from . import wizard diff --git a/exportsage50/__openerp__.py b/exportsage50/__openerp__.py index a69a95e..faeecd5 100755 --- a/exportsage50/__openerp__.py +++ b/exportsage50/__openerp__.py @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -############################################################################## +############################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Gestion-Ressources (). @@ -11,7 +11,7 @@ # # 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 +# 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 @@ -23,56 +23,60 @@ 'name': 'Export to Sage50', 'version': '1.0', "category": 'Accounting & Finance', - 'complexity': "easy", 'description': """ -French version below -Export accounting data from OpenErp to Sage50. -==================================== - Export accounting data from OpenErp to Sage50. The exportation generates the imp file to import in Sage50. +Export accounting data from OpenERP to Sage50 +============================================= + +Export accounting data from OpenERP to Sage50. The export generates the imp file to import in Sage50. Documentation : layout of the import file (.IMP) -==================================== +------------------------------------------------ + A PDF document (in the /doc repository) gives more details about the .IMP file layout that can be imported -into Sage 50.This document is part of the Sage 50 SDK (Software Development Kit) available for download at +into Sage 50. This document is part of the Sage 50 SDK (Software Development Kit) available for download at the following address : http://na.sage.com/sage-simply-accounting/lp/partners/sdk/?isnow=ssa. - - Sage 50: After creating .IMP file -==================================== +--------------------------------- + Solution: -Importing purchase invoices, purchase quotes, sales invoices and sales orders into Sage 50 +* Importing purchase invoices, purchase quotes, sales invoices and sales orders into Sage 50 + How to import purchase invoices, purchase quotes, sales invoices and sales orders? + You can import purchase invoices, purchase quotes, sales invoices and sales orders into Sage 50. The transaction(s) details should be in a text file with extension .IMP. - After you have created the .IMP file, you can import the transaction(s) into Sage 50 by following these steps: (Account information is not included in the .IMP format because when importing the file, you will receive a pop-up screen to ask you "Select an Account to match".) -From the Home Window, go to File, Import/Export -Click on Import Transactions (the Import Transactions Wizard appears) -Select on 'Import purchase invoices, purchase quotes, sales invoices, sales orders or time slips' and click Next -You can now create a backup of your file -Click Next -Click on Browse and select the .IMP file previously created -If the customer (or vendor) in the transaction(s) you are trying to import does not exist in the Sage 50 company, +* From the Home Window, go to File, Import/Export +* Click on Import Transactions (the Import Transactions Wizard appears) +* Select on 'Import purchase invoices, purchase quotes, sales invoices, sales orders or time slips' and click Next +* You can now create a backup of your file +* Click Next +* Click on Browse and select the .IMP file previously created +* If the customer (or vendor) in the transaction(s) you are trying to import does not exist in the Sage 50 company, you will get a new window asking you if you want to add this customer (or vendor), or if you want to select another customer (or vendor) from the existing ones -You will also get a similar window if the import file uses an inventory item which does not exist in Sage 50. -You will see a summary of the imported transactions, click OK and then Finish. -If you got any errors importing the data, open the .IMP file in Notepad and use the attached .PDF document +* You will also get a similar window if the import file uses an inventory item which does not exist in Sage 50. +* You will see a summary of the imported transactions, click OK and then Finish. +* If you got any errors importing the data, open the .IMP file in Notepad and use the attached .PDF document to verify the file format. Once the errors have been corrected, you can try the import again. + Note: View KB25664 for information about some possible errors when importing .IMP file. + Sage Business Care plan does NOT include support for SDK. Please, contact one of our partners website for further assistance. Possible errors when importing purchase invoices, purchase quotes, sales invoices and/or sales orders -==================================== +===================================================================================================== + Questions and Answers + Import started... Errors occurred while importing. Line x does not contain compatible tax information. Invalid date. The date must be between and . @@ -81,48 +85,35 @@ A: These are the possible reasons for getting any of these error messages when importing transactions into Simply Accounting: -- The import file (extension .IMP) you are using does not have the proper format. +* The import file (extension .IMP) you are using does not have the proper format. Refer to the KB article 25659 for more information about the format of the import file. -- The transaction type is not enabled in the Simply Accounting company. To enable the feature, from the Home Window +* The transaction type is not enabled in the Simply Accounting company. To enable the feature, from the Home Window in Simply Accounting, go to Setup, Settings, Company, Features, make sure the type of transaction you want to import is checked -- The dates in the import file do not match the fiscal year dates in Simply Accounting. +* The dates in the import file do not match the fiscal year dates in Simply Accounting. Open the import file in Notepad and make the necessary changes +Contributors +------------ -Exportation des données comptables de OpenERP vers Sage50. -============================================== -Ce module exporte des données comptables de OpenERP vers Sage50. Le module génére un fichier imp file qui peut -être importé dans Sage50. - -Documentation : Format du fichier à importer (.IMP) -==================================== -Un document .PDF (dans le répertoire /doc) donne plus de détails sur le format du fichier .IMP qui peut être -importé dans Sage 50. Ce document fait parti du Kit de développement - SDK de Sage 50 qui peut-être téléchargé -à l'adresse suivante : http://na.sage.com/sage-simply-accounting/lp/partners/sdk/?isnow=ssa. - -Guide d'utilisation export Sage 50 -======================================== -Comment exporter les données comptables à partir d'OpenERP? -Un manuel d'utilisation est disponible dans le répertoire /doc du module. +* El Hadji Dem +* Maxime Chambreuil """, - "author": "Gestion-Ressources", - "website": "http://www.gestion-ressources.com", + 'author': 'Savoir-faire Linux', + 'maintainer': 'Savoir-faire Linux', + 'website': 'http://www.savoirfairelinux.com', "license": "AGPL-3", 'images': [], 'depends': ['account'], - 'update_xml': [ - 'wizard/exportsage50.xml', + 'data': [ 'security/ir.model.access.csv', + 'wizard/exportsage50_view.xml' ], - 'demo_xml': [], - 'test':[], + 'demo': [], + 'test': [], 'installable': True, 'auto_install': False, - 'certificate': '', - 'application': True, } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/exportsage50/i18n/exportsage50.pot b/exportsage50/i18n/exportsage50.pot index 1be3d65..00aa6b4 100644 --- a/exportsage50/i18n/exportsage50.pot +++ b/exportsage50/i18n/exportsage50.pot @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 6.1\n" +"Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-11-15 15:35+0000\n" -"PO-Revision-Date: 2013-11-15 15:35+0000\n" +"POT-Creation-Date: 2013-11-15 16:22+0000\n" +"PO-Revision-Date: 2013-11-15 16:22+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,102 +15,126 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: exportsage50 +#: field:exportsage,name:0 +msgid "Filename" +msgstr "" + #. module: exportsage50 #: field:exportsage,format:0 msgid "File Format" msgstr "" #. module: exportsage50 -#: help:exportsage,invoice_ids:0 -msgid "This is the list of invoices that have been generated for this sales order. The same sales order may have been invoiced in several times (by line for example)." +#: field:exportsage,state:0 +msgid "unknown" msgstr "" #. module: exportsage50 #: view:exportsage:0 -msgid "Export done" +msgid "Here is the exported file:" +msgstr "" + +#. module: exportsage50 +#: model:ir.model,name:exportsage50.model_exportsage +msgid "Create imp file to export in sage50" msgstr "" #. module: exportsage50 #: selection:exportsage,state:0 -msgid "get" +msgid "choose" msgstr "" #. module: exportsage50 #: view:exportsage:0 -#: field:exportsage,invoice_ids:0 -msgid "Invoices" +msgid "Unicode/UTF-8" msgstr "" #. module: exportsage50 -#: field:exportsage,state:0 -msgid "unknown" +#: view:exportsage:0 +msgid "file encoding, please be sure to view and edit using the same encoding." +msgstr "" + +#. module: exportsage50 +#: selection:exportsage,state:0 +msgid "get" msgstr "" #. module: exportsage50 #: view:exportsage:0 -msgid "Create" +msgid "This file was generated using the universal" msgstr "" #. module: exportsage50 -#: code:addons/exportsage50/wizard/exportsage50.py:71 -#, python-format -msgid "You have to select at least 1 Invoice. And try again" +#: view:exportsage:0 +msgid "Cancel" msgstr "" #. module: exportsage50 -#: field:exportsage,name:0 -msgid "Filename" +#: code:addons/exportsage50/wizard/exportsage50.py:68 +#, python-format +msgid "Error" msgstr "" #. module: exportsage50 #: view:exportsage:0 -#: model:ir.ui.menu,name:exportsage50.menu_report -msgid "Export to Sage50" +msgid "Export Complete" msgstr "" #. module: exportsage50 #: view:exportsage:0 -msgid "This action allows you to export accounting data from OpenErp to Simply account.You should have the same configuration about the tax information" +msgid "Export Settings" msgstr "" #. module: exportsage50 -#: model:ir.model,name:exportsage50.model_exportsage -msgid "Create imp file to export in sage50" +#: help:exportsage,invoice_ids:0 +msgid "This is the list of invoices that have been generated for this sales order. The same sales order may have been invoiced in several times (by line for example)." msgstr "" #. module: exportsage50 -#: selection:exportsage,state:0 -msgid "choose" +#: model:ir.actions.act_window,name:exportsage50.action_account_invoice_generate_export_view +#: model:ir.ui.menu,name:exportsage50.menu_account_invoice_generate_export_view +msgid "Export accounting data to Sage50" msgstr "" #. module: exportsage50 -#: field:exportsage,data:0 -msgid "File" +#: field:exportsage,invoice_ids:0 +msgid "Invoices" msgstr "" #. module: exportsage50 -#: code:addons/exportsage50/wizard/exportsage50.py:71 +#: view:exportsage:0 +msgid "or" +msgstr "" + +#. module: exportsage50 +#: code:addons/exportsage50/wizard/exportsage50.py:68 #, python-format -msgid "Error" +msgid "You have to select at least 1 Invoice. And try again" msgstr "" #. module: exportsage50 #: view:exportsage:0 -msgid "Cancel" +msgid "This action allows you to export accounting data from OpenErp to Simply account.You should have the same configuration about the tax information" +msgstr "" + +#. module: exportsage50 +#: field:exportsage,data:0 +msgid "File" msgstr "" #. module: exportsage50 #: view:exportsage:0 -msgid "_Close" +msgid "Export to Sage50" msgstr "" #. module: exportsage50 -#: field:exportsage,config_logo:0 -msgid "Image" +#: view:exportsage:0 +msgid "Close" msgstr "" #. module: exportsage50 -#: model:ir.actions.act_window,name:exportsage50.action_account_invoice_generate_export -msgid "Export accounting data to Sage50" +#: view:exportsage:0 +msgid "Export" msgstr "" diff --git a/exportsage50/wizard/__init__.py b/exportsage50/wizard/__init__.py index 06cba1c..283d719 100755 --- a/exportsage50/wizard/__init__.py +++ b/exportsage50/wizard/__init__.py @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -############################################################################## +############################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Gestion-Ressources (). @@ -11,13 +11,12 @@ # # 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 +# 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 exportsage50 -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +from . import exportsage50 diff --git a/exportsage50/wizard/exportsage50.py b/exportsage50/wizard/exportsage50.py index 4c2bb30..d6c3799 100644 --- a/exportsage50/wizard/exportsage50.py +++ b/exportsage50/wizard/exportsage50.py @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -############################################################################## +############################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Gestion-Ressources (). @@ -11,117 +11,108 @@ # # 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 +# 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 . # -############################################################################## +############################################################################### -from osv import osv, fields -import web +from openerp.osv import fields, orm import base64 -import tools -from tools.translate import _ -from tools.misc import get_iso_codes +from openerp.tools.translate import _ import pooler from datetime import datetime -import decimal_precision as dp +import unicodedata -class exportsage(osv.osv): - - """ - Wizard - """ +class exportsage(orm.Model): _name = "exportsage" _description = "Create imp file to export in sage50" - _inherit = "ir.wizard.screen" _columns = { 'data': fields.binary('File', readonly=True), 'name': fields.char('Filename', 20, readonly=True), 'format': fields.char('File Format', 10), - 'state': fields.selection([('choose', 'choose'), # choose date + 'state': fields.selection([('choose', 'choose'), ('get', 'get')]), 'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_export_rel', 'order_id', 'invoice_id', 'Invoices', required=True, - help="This is the list of invoices that have been generated for this sales order. The same sales order may have been invoiced in several times (by line for example)."), + help="This is the list of invoices that have been generated " + "for this sales order. The same sales order may have been invoiced " + "in several times (by line for example)."), } _defaults = { 'state': lambda *a: 'choose', } - def act_cancel(self, cr, uid, ids, context=None): - #self.unlink(cr, uid, ids, context) - return {'type':'ir.actions.act_window_close' } + def act_cancel(self, cr, uid, ids, context=None): + return {'type': 'ir.actions.act_window_close'} def act_destroy(self, *args): - return {'type':'ir.actions.act_window_close' } + return {'type': 'ir.actions.act_window_close'} - def create_report(self, cr, uid, ids, context=None): - if context == None: + if context is None: context = {} - this = self.browse(cr, uid, ids)[0] + this = self.browse(cr, uid, ids, context=context)[0] data = self.read(cr, uid, ids, [], context=context)[0] if not data['invoice_ids']: - raise osv.except_osv(_('Error'), _('You have to select at least 1 Invoice. And try again')) + raise orm.except_orm(_('Error'), _('You have to select at least 1 Invoice. And try again')) output = '''\n' + '"12001"' + ',' + '"1"''\n' + '\n\n' - #Faire le traitement des autres lignes dans les lignes de factures + # Do the treatment of other lines in the invoice lines pool = pooler.get_pool(cr.dbname) line_obj = pool.get('account.invoice') + account_move_line_obj = self.pool.get('account.move.line') + account_invoice_line_obj = self.pool.get('account.invoice.line') + decimal_precision_obj = self.pool.get('decimal.precision') - for line in line_obj.browse(cr, uid, data['invoice_ids'], context): - # tag de debut pour les lignes de factures + for line in line_obj.browse(cr, uid, data['invoice_ids'], context=context): + # start tag for invoice lines output += '''\n' - #informations sur le client + # informations sur le client costumer_name = line.partner_id.name - oneTimefield = "" - contact_name = line.partner_id.address[0].name or "" - street1 = line.partner_id.address[0].street or "" - street2 = line.partner_id.address[0].street2 or "" - city = line.partner_id.address[0].city or "" - province_state = line.partner_id.address[0].state_id.name or "" - zip_code = line.partner_id.address[0].zip or "" - country = line.partner_id.address[0].country_id.name or "" - phone1 = line.partner_id.address[0].phone or "" - mobile = line.partner_id.address[0].mobile or "" - fax = line.partner_id.address[0].fax or "" - email = line.partner_id.address[0].email or "" - # ligne de client - fields = [costumer_name, oneTimefield, contact_name, street1, street2, + onetimefield = "" + contact_name = line.partner_id.name or "" + street1 = line.partner_id.street or "" + street2 = line.partner_id.street2 or "" + city = line.partner_id.city or "" + province_state = line.partner_id.state_id.name or "" + zip_code = line.partner_id.zip or "" + country = line.partner_id.country_id.name or "" + phone1 = line.partner_id.phone or "" + mobile = line.partner_id.mobile or "" + fax = line.partner_id.fax or "" + email = line.partner_id.email or "" + # Customer line + fields = [costumer_name, onetimefield, contact_name, street1, street2, city, province_state, zip_code, country, phone1, mobile, fax, email ] costumer = ','.join(['"%s"' % field for field in fields]) - #print costumer - #exit(0) output += costumer.encode('UTF-8') + '\n' - #informations sur la facture + # Invoice informations no_of_details = str(len(line.invoice_line)) order_no = "" # Invoice number (Max 20 chars) invoice_no = str(line.number) - # date de la facture - if line.date_invoice: - entry_date = datetime.strptime(line.date_invoice, "%Y-%m-%d").strftime('%m-%d-%Y') # date format : mm-dd-yyyy - else: - entry_date = "" - # Informations sur le type de paiement (between 0 and 3) + # Get invoice date + entry_date = datetime.strptime(line.date_invoice, "%Y-%m-%d").strftime('%m-%d-%Y')\ + if line.date_invoice else "" + # Type of payment (between 0 and 3) # 0 = pay later , 1 = cash , 2 = cheque , 3 = credit card - # Selectionner le dernier paiement + # Select last payment list_id = [] # Paid by source (20 Chars) : Blank- pay later and cash Cheque number or credit card paid_by_source = "" if line.payment_ids: + lastId = max(line.payment_ids).id for oneId in line.payment_ids: list_id.append(oneId.id) lastId = max(list_id) - # acceder à partir du dernier paiement à l'objet account_move_line - account_move_line_obj = self.pool.get('account.move.line') + # access from the last payment account_move_line object account_move_line = account_move_line_obj.browse(cr, uid, lastId, context=context) paiement_type = account_move_line.journal_id.type if paiement_type == 'cash': @@ -130,67 +121,69 @@ def create_report(self, cr, uid, ids, context=None): elif paiement_type == 'bank': paid_by_type = str(2) else: - paid_by_type = str(0) # default value 0 = pay later - + paid_by_type = str(0) # default value 0 = pay later else: - paid_by_type = str(0) # default value 0 = pay later + paid_by_type = str(0) # default value 0 = pay later total_amount = str(line.amount_total) or "" freight_amount = "0.0" fields_sale_invoice = [no_of_details, order_no, invoice_no, entry_date, paid_by_type, - paid_by_source, total_amount, freight_amount, - ] - sale_invoice = ','.join(['"%s"' % field_sale_invoice for field_sale_invoice in fields_sale_invoice]) - #sale_invoice = '"' + no_of_details + '"' + ',"' + order_no + '"' + ',"' + invoice_no + '"' + ',"' + entry_date + '"' + ',"' + paid_by_type + '"' + ',"' + paid_by_source + '"' + ',"' + total_amount + '"' + ',"' + freight_amount + '"' + paid_by_source, total_amount, freight_amount] + sale_invoice = ','.join(['"%s"' % one_field for one_field in fields_sale_invoice]) output += sale_invoice.encode('UTF-8') + '\n' - product_line_invoice_with_taxe = "" - #Sale invoice detail lines - account_invoice_line_obj =self.pool.get('account.invoice.line') - product_ids = account_invoice_line_obj.search(cr, uid, [('invoice_id','=',line.id)]) + product_line_invoice_with_tax = "" + # Sale invoice detail lines + product_ids = account_invoice_line_obj.search(cr, + uid, + [('invoice_id', '=', line.id)], + context=context) if product_ids: - for product in account_invoice_line_obj.browse(cr, uid, product_ids): - item_number = str(product.name) + for product in account_invoice_line_obj.browse(cr, + uid, + product_ids, + context=context): + item_number = unicode(product.name, "utf8", "replace") \ + if isinstance(product.name, str) else unicodedata.normalize('NFD', product.name) quantity = str(product.quantity) price = str(product.price_unit) amount = product.quantity * product.price_unit - amount = str(round(amount, self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))) + amount = str(round(amount, decimal_precision_obj.precision_get(cr, uid, 'Account'))) fields_one_product_invoice = [item_number, quantity, price, amount] - one_product_invoice = ','.join(['"%s"' % field_one_product_invoice for field_one_product_invoice in fields_one_product_invoice]) - #one_product_invoice = '"' + item_number + '"' + ',"' + quantity + '"' + ',"' + price + '"' + ',"' + amount + '"' + one_product_invoice = ','.join(['"%s"' % field_one_product_invoice + for field_one_product_invoice in fields_one_product_invoice]) one_product_invoice = one_product_invoice.encode('UTF-8') tax_product_line = "" - # tax information pour chaque produit + # Tax information for each product if product.invoice_line_tax_id: - for one_taxe in product.invoice_line_tax_id: - tax_name = one_taxe.description # or one_taxe.description or one_taxe.name - if one_taxe.price_include: - tax_included = str(1) # 1=yes,0=No - else: - tax_included = str(0) # 1=yes,0=No - tax_refundable = str(1) # 1=yes,0=No - tax_rate = str(one_taxe.amount) - tax_amount = str(one_taxe.amount) - fields_tax_product_line = [tax_name, tax_included, tax_refundable, tax_rate, tax_amount, - ] - tax_product_line = ',' + ','.join(['"%s"' % field_tax_product_line for field_tax_product_line in fields_tax_product_line]) - #tax_product_line += ',"' + tax_name + '"' + ',"' + tax_included + '"' + ',"' + tax_refundable + '"' + ',"' + tax_rate + '"' + ',"' + tax_amount + '"' - - #tax_product_line = tax_product_line[:-1] + for one_tax in product.invoice_line_tax_id: + tax_name = one_tax.description # or one_tax.description or one_tax.name + # 1=yes, 0=No + tax_included = str(1) if one_tax.price_include else str(0) + tax_refundable = str(1) # 1=yes, 0=No + tax_rate = str(one_tax.amount) + tax_amount = str(one_tax.amount) + fields_tax_product_line = [tax_name, tax_included, tax_refundable, tax_rate, tax_amount, ] + tax_product_line = ',' + ','.join(['"%s"' % one_tax_field + for one_tax_field in fields_tax_product_line]) tax_product_line = tax_product_line.encode('UTF-8') - product_line_invoice_with_taxe += one_product_invoice + tax_product_line + '\n' - #print product_line_invoice_with_taxe , exit(0) - - output += product_line_invoice_with_taxe - # tag de fin pour les lignes de factures - #output += '\n' + product_line_invoice_with_tax += one_product_invoice + tax_product_line + '\n' + output += product_line_invoice_with_tax + # End of invoice lines output += '\n\n\n' - #output += '\n' + this.start_date + ',' + this.end_date this.format = 'imp' filename = 'export_to_sage50' this.name = "%s.%s" % (filename, this.format) out = base64.encodestring(output) - self.write(cr, uid, ids, {'state':'get', 'data':out, 'name':this.name, 'format' : this.format}, context=context) - -exportsage() - + self.write(cr, uid, ids, {'state': 'get', 'data': out, 'name': this.name, + 'format': this.format}, context=context) + + return { + 'type': 'ir.actions.act_window', + 'res_model': 'exportsage', + 'view_mode': 'form', + 'view_type': 'form', + 'res_id': this.id, + 'views': [(False, 'form')], + 'target': 'new', + } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/exportsage50/wizard/exportsage50.xml b/exportsage50/wizard/exportsage50.xml deleted file mode 100644 index b1cf130..0000000 --- a/exportsage50/wizard/exportsage50.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - Export to Sage50 - exportsage - form - -
- -