From fb3f7aa747d4d196abd3963ef1cbdfae910551a5 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Tue, 10 Jan 2012 13:35:59 +0100 Subject: [PATCH 001/591] [IMP] delivery: move picking's net weight to extended view bzr revid: ls@numerigraphe.fr-20120110123559-1llywc42k606hryj --- addons/delivery/delivery_view.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index c46253777d2..47ed9d6d274 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -194,7 +194,7 @@ - + - + - + @@ -245,7 +245,7 @@ - + @@ -258,7 +258,7 @@ - + @@ -271,7 +271,7 @@ - + From 32781b0268a8b3583869cd14809e466568ee2a7f Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Mon, 16 Jan 2012 11:34:06 +0100 Subject: [PATCH 002/591] [FIX] typo in XML file bzr revid: ls@numerigraphe.fr-20120116103406-gwx3w8zlnrnvlyyr --- addons/delivery/delivery_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 47ed9d6d274..6c9e8c85cdb 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -194,7 +194,7 @@ - @@ -207,7 +207,7 @@ - From 438cde1f2f9b6204a0cb71338eacc7dfa1fab4e9 Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Wed, 8 Feb 2012 11:37:15 +0100 Subject: [PATCH 003/591] [FIX] l10n_ch bvr report to follow last patches of report_webkit addons bzr revid: nicolas.bessi@camptocamp.com-20120208103715-gk6upkf3b47av9h1 --- addons/l10n_ch/report/report_webkit_html.py | 154 +++++++------------- 1 file changed, 51 insertions(+), 103 deletions(-) diff --git a/addons/l10n_ch/report/report_webkit_html.py b/addons/l10n_ch/report/report_webkit_html.py index e6f7239c4e4..72158361da7 100644 --- a/addons/l10n_ch/report/report_webkit_html.py +++ b/addons/l10n_ch/report/report_webkit_html.py @@ -20,22 +20,31 @@ ############################################################################## import time -from report import report_sxw -from report_webkit import webkit_report -from report_webkit import report_helper -from osv import osv -from tools import mod10r import sys import os import re + +from mako.template import Template +from mako.lookup import TemplateLookup +from mako import exceptions + + +from report import report_sxw +from report_webkit import webkit_report +from report_webkit import report_helper + +from osv import osv +from osv.osv import except_osv + +from tools import mod10r +from tools.translate import _ +from tools.config import config + import wizard import addons import pooler -from tools.config import config -from mako.template import Template -from mako import exceptions -from tools.translate import _ -from osv.osv import except_osv + + class l10n_ch_report_webkit_html(report_sxw.rml_parse): @@ -143,53 +152,26 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse): 'digits!\nPlease check your company ' 'information for the invoice:\n%s') %(invoice_name))) return '' + +def mako_template(text): + """Build a Mako template. + + This template uses UTF-8 encoding + """ + tmp_lookup = TemplateLookup() #we need it in order to allow inclusion and inheritance + return Template(text, input_encoding='utf-8', output_encoding='utf-8', lookup=tmp_lookup) class BVRWebKitParser(webkit_report.WebKitParser): - def setLang(self, lang): - if not lang: - lang = 'en_US' - self.localcontext['lang'] = lang - - def formatLang(self, value, digits=None, date=False, date_time=False, grouping=True, monetary=False): - """format using the know cursor, language from localcontext""" - if digits is None: - digits = self.parser_instance.get_digits(value) - if isinstance(value, (str, unicode)) and not value: - return '' - pool_lang = self.pool.get('res.lang') - lang = self.localcontext['lang'] - - lang_ids = pool_lang.search(self.parser_instance.cr, self.parser_instance.uid, [('code','=',lang)])[0] - lang_obj = pool_lang.browse(self.parser_instance.cr, self.parser_instance.uid, lang_ids) - - if date or date_time: - if not str(value): - return '' - - date_format = lang_obj.date_format - parse_format = '%Y-%m-%d' - if date_time: - value=value.split('.')[0] - date_format = date_format + " " + lang_obj.time_format - parse_format = '%Y-%m-%d %H:%M:%S' - if not isinstance(value, time.struct_time): - return time.strftime(date_format, time.strptime(value, parse_format)) - - else: - date = datetime(*value.timetuple()[:6]) - return date.strftime(date_format) - - return lang_obj.format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary) - def create_single_pdf(self, cursor, uid, ids, data, report_xml, context=None): """generate the PDF""" - self.parser_instance = self.parser( - cursor, + context = context or {} + if report_xml.report_type != 'webkit': + return super(WebKitParser,self).create_single_pdf(cursor, uid, ids, data, report_xml, context=context) + self.parser_instance = self.parser(cursor, uid, self.name2, - context=context - ) + context=context) self.pool = pooler.get_pool(cursor.dbname) objs = self.getObjects(cursor, uid, ids, context) self.parser_instance.set_context(objs, data, ids, report_xml.report_type) @@ -201,7 +183,7 @@ class BVRWebKitParser(webkit_report.WebKitParser): if not template and report_xml.report_webkit_data : template = report_xml.report_webkit_data if not template : - raise except_osv(_('Webkit Report template not found !'), _('')) + raise except_osv(_('Error'),_('Webkit Report template not found !')) header = report_xml.webkit_header.html footer = report_xml.webkit_header.footer_html if not header and report_xml.header: @@ -210,43 +192,19 @@ class BVRWebKitParser(webkit_report.WebKitParser): _('Please set a header in company settings') ) if not report_xml.header : - #I know it could be cleaner ... - header = u""" - - - - - - - -""" - self.parser_instance.localcontext.update({'setLang':self.setLang}) - self.parser_instance.localcontext.update({'formatLang':self.formatLang}) + header = '' + default_head = addons.get_module_resource('report_webkit', 'default_header.html') + with open(default_head,'r') as f: + header = f.read() css = report_xml.webkit_header.css if not css : css = '' user = self.pool.get('res.users').browse(cursor, uid, uid) company = user.company_id - parse_template = template - #default_filters=['unicode', 'entity'] can be used to set global filter - body_mako_tpl = Template(parse_template ,input_encoding='utf-8', output_encoding='utf-8') + body_mako_tpl = mako_template(template) #BVR specific bvr_path = addons.get_module_resource(os.path.join('l10n_ch','report','bvr.mako')) - body_bvr_tpl = Template(file(bvr_path).read(), input_encoding='utf-8', output_encoding='utf-8') - + body_bvr_tpl = mako_template(file(bvr_path).read()) helper = report_helper.WebKitHelper(cursor, uid, report_xml.id, context) ##BVR Specific htmls = [] @@ -254,58 +212,48 @@ class BVRWebKitParser(webkit_report.WebKitParser): self.parser_instance.localcontext['objects'] = [obj] if not company.bvr_only: try: - html = body_mako_tpl.render( - helper=helper, + html = body_mako_tpl.render(helper=helper, css=css, _=self.translate_call, - **self.parser_instance.localcontext - ) + **self.parser_instance.localcontext) except Exception, e: raise Exception(exceptions.text_error_template().render()) htmls.append(html) if not company.invoice_only: try: - bvr = body_bvr_tpl.render( - helper=helper, - css=css, - _=self.translate_call, - **self.parser_instance.localcontext - ) + bvr = body_bvr_tpl.render(helper=helper, + css=css, + _=self.translate_call, + **self.parser_instance.localcontext) except Exception, e: raise Exception(exceptions.text_error_template().render()) htmls.append(bvr) head_mako_tpl = Template(header, input_encoding='utf-8', output_encoding='utf-8') try: - head = head_mako_tpl.render( - helper=helper, + head = head_mako_tpl.render(helper=helper, css=css, _debug=False, _=self.translate_call, - **self.parser_instance.localcontext - ) + **self.parser_instance.localcontext) except Exception, e: raise Exception(exceptions.text_error_template().render()) foot = False if footer and company.invoice_only : foot_mako_tpl = Template(footer, input_encoding='utf-8', output_encoding='utf-8') try: - foot = foot_mako_tpl.render( - helper=helper, + foot = foot_mako_tpl.render(helper=helper, css=css, _=self.translate_call, - **self.parser_instance.localcontext - ) + **self.parser_instance.localcontext) except Exception, e: raise Exception(exceptions.text_error_template().render()) if report_xml.webkit_debug : try: - deb = head_mako_tpl.render( - helper=helper, + deb = head_mako_tpl.render(helper=helper, css=css, _debug=html, _=self.translate_call, - **self.parser_instance.localcontext - ) + **self.parser_instance.localcontext) except Exception, e: raise Exception(exceptions.text_error_template().render()) return (deb, 'html') From 02b41a75ceb5df2ca4227de5839ebd46da0e5462 Mon Sep 17 00:00:00 2001 From: Yury Tello Date: Sun, 19 Feb 2012 14:10:02 -0500 Subject: [PATCH 004/591] [ADD] l10n_cl bzr revid: ytello@cubicerp.com-20120219191002-6yid2f812r4ypg05 --- addons/l10n_cl/__init__.py | 32 ++++ addons/l10n_cl/__openerp__.py | 51 ++++++ addons/l10n_cl/account_tax.xml | 34 ++++ addons/l10n_cl/account_tax_code.xml | 94 ++++++++++ addons/l10n_cl/i18n/es.po | 72 ++++++++ addons/l10n_cl/i18n/es_CL.po | 53 ++++++ addons/l10n_cl/i18n/l10n_cl.pot | 35 ++++ addons/l10n_cl/l10n_cl_chart.xml | 256 ++++++++++++++++++++++++++++ addons/l10n_cl/l10n_cl_wizard.xml | 15 ++ 9 files changed, 642 insertions(+) create mode 100644 addons/l10n_cl/__init__.py create mode 100644 addons/l10n_cl/__openerp__.py create mode 100644 addons/l10n_cl/account_tax.xml create mode 100644 addons/l10n_cl/account_tax_code.xml create mode 100644 addons/l10n_cl/i18n/es.po create mode 100644 addons/l10n_cl/i18n/es_CL.po create mode 100644 addons/l10n_cl/i18n/l10n_cl.pot create mode 100644 addons/l10n_cl/l10n_cl_chart.xml create mode 100644 addons/l10n_cl/l10n_cl_wizard.xml diff --git a/addons/l10n_cl/__init__.py b/addons/l10n_cl/__init__.py new file mode 100644 index 00000000000..92da5dbf966 --- /dev/null +++ b/addons/l10n_cl/__init__.py @@ -0,0 +1,32 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_cl/__openerp__.py b/addons/l10n_cl/__openerp__.py new file mode 100644 index 00000000000..249bdb3ae48 --- /dev/null +++ b/addons/l10n_cl/__openerp__.py @@ -0,0 +1,51 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2011 Cubic ERP - Teradata SAC (). +# +# 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 . +# +############################################################################## +{ + "name": "Argentina Localization Chart Account", + "version": "1.0", + "description": """ +Chilean accounting chart and tax localization. + +Plan contable chileno e impuestos de acuerdo a disposiciones vigentes + + """, + "author": "Cubic ERP", + "website": "http://cubicERP.com", + "category": "Localization/Account Charts", + "depends": [ + "account_chart", + ], + "data":[ + "account_tax_code.xml", + "l10n_cl_chart.xml", + "account_tax.xml", + "l10n_cl_wizard.xml", + ], + "demo_xml": [ + ], + "update_xml": [ + ], + "active": False, + "installable": True, + "certificate" : "", + 'images': ['images/config_chart_l10n_cl.jpeg','images/l10n_cl_chart.jpeg'], +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_cl/account_tax.xml b/addons/l10n_cl/account_tax.xml new file mode 100644 index 00000000000..1db0d2637f4 --- /dev/null +++ b/addons/l10n_cl/account_tax.xml @@ -0,0 +1,34 @@ + + + + + + + IVA 19% Venta + 0.190000 + percent + sale + + + + + + + + + + + IVA 19% Compra + 0.190000 + percent + purchase + + + + + + + + + + diff --git a/addons/l10n_cl/account_tax_code.xml b/addons/l10n_cl/account_tax_code.xml new file mode 100644 index 00000000000..95c91b60d78 --- /dev/null +++ b/addons/l10n_cl/account_tax_code.xml @@ -0,0 +1,94 @@ + + + + + + Chile Impuestos + + + Base Imponible + + + + Base Imponible - Ventas + + + + Ventas Gravadas con IVA + + + + Ventas NO Gravadas (Exoneradas) + + + + Ventas Gravadas Fuera de Ámbito + + + + Base Imponible - Compras + + + + Compras Gravadas con IVA + + + + Compras NO Gravadas (Exoneradas) + + + + Compras Gravadas Fuera de Ámbito + + + + + Impuesto General a las Ventas (IVA) Total a Pagar + + + + Impuesto Pagado + + + + Impuesto Pagado IVA + + -1 + + + Impuesto Pagado de Exonerados al IVA + + -1 + + + Impuesto Pagado Fuera de Ámbito + + -1 + + + Impuesto Cobrado + + + + Impuesto Cobrado IVA + + + + Impuesto Cobrado de Exonerados al IVA + + + + Impuesto Cobrado Fuera de Ámbito + + + + + Impuestos Directos a Pagar + + + + Impuesto a la Renta Primera Categoría a Pagar + + + + diff --git a/addons/l10n_cl/i18n/es.po b/addons/l10n_cl/i18n/es.po new file mode 100644 index 00000000000..f8b17197008 --- /dev/null +++ b/addons/l10n_cl/i18n/es.po @@ -0,0 +1,72 @@ +# Spanish translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-01-11 11:15+0000\n" +"PO-Revision-Date: 2011-01-10 13:46+0000\n" +"Last-Translator: Yury Tello \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-01-15 05:56+0000\n" +"X-Generator: Launchpad (build 12177)\n" + +#. module: l10n_cl +#: model:ir.module.module,description:l10n_cl.module_meta_information +msgid "" +"\n" +" Chilean Accounting : chart of Account\n" +" " +msgstr "" +"\n" +" Contabilidad Peruana : Plan de cuentas\n" +" " + +#. module: l10n_cl +#: model:ir.module.module,shortdesc:l10n_cl.module_meta_information +msgid "Chilean Chart of Account" +msgstr "Plan de cuentas de Chile" + +#. module: l10n_cl +#: model:ir.actions.todo,note:l10n_cl.config_call_account_template_in_minimal +msgid "" +"Generate Chart of Accounts from a Chart Template. You will be asked to pass " +"the name of the company, the chart template to follow, the no. of digits to " +"generate the code for your accounts and Bank account, currency to create " +"Journals. Thus,the pure copy of chart Template is generated.\n" +"\tThis is the same wizard that runs from Financial " +"Management/Configuration/Financial Accounting/Financial Accounts/Generate " +"Chart of Accounts from a Chart Template." +msgstr "" +"Generar el plan contable a partir de una plantilla de plan contable. Se le " +"pedirá el nombre de la compañia, la plantilla de plan contable a utilizar, " +"el número de dígitos para generar el código de las cuentas y de la cuenta " +"bancaria, la moneda para crear los diarios. Así pues, se genere una copia " +"exacta de la plantilla de plan contable.\n" +"\tEste es el mismo asistente que se ejecuta desde Contabilidad y finanzas / " +"Configuración / Contabilidad financiera / Cuentas financieras / Generar el " +"plan contable a partir de una plantilla de plan contable." + +#~ msgid "Liability" +#~ msgstr "Pasivo" + +#~ msgid "Asset" +#~ msgstr "Activo" + +#~ msgid "Closed" +#~ msgstr "Cerrado" + +#~ msgid "Income" +#~ msgstr "Ingreso" + +#~ msgid "Expense" +#~ msgstr "Gasto" + +#~ msgid "View" +#~ msgstr "Vista" diff --git a/addons/l10n_cl/i18n/es_CL.po b/addons/l10n_cl/i18n/es_CL.po new file mode 100644 index 00000000000..cd0a9f9c43e --- /dev/null +++ b/addons/l10n_cl/i18n/es_CL.po @@ -0,0 +1,53 @@ +# Spanish (Paraguay) translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-01-11 11:15+0000\n" +"PO-Revision-Date: 2011-03-21 16:23+0000\n" +"Last-Translator: FULL NAME \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-03-22 04:36+0000\n" +"X-Generator: Launchpad (build 12559)\n" + +#. module: l10n_cl +#: model:ir.module.module,description:l10n_cl.module_meta_information +msgid "" +"\n" +" Chilean Accounting : chart of Account\n" +" " +msgstr "" +"\n" +" Contabilidad Chile : Plan de cuentas\n" +" " + +#. module: l10n_cl +#: model:ir.module.module,shortdesc:l10n_cl.module_meta_information +msgid "Chilean Chart of Account" +msgstr "Plan de cuentas de la Chile" + +#. module: l10n_cl +#: model:ir.actions.todo,note:l10n_cl.config_call_account_template_in_minimal +msgid "" +"Generate Chart of Accounts from a Chart Template. You will be asked to pass " +"the name of the company, the chart template to follow, the no. of digits to " +"generate the code for your accounts and Bank account, currency to create " +"Journals. Thus,the pure copy of chart Template is generated.\n" +"\tThis is the same wizard that runs from Financial " +"Management/Configuration/Financial Accounting/Financial Accounts/Generate " +"Chart of Accounts from a Chart Template." +msgstr "" +"Generar el plan contable a partir de una plantilla de plan contable. Se le " +"pedirá el nombre de la compañía, la plantilla de plan contable a utilizar, " +"el número de dígitos para generar el código de las cuentas y de la cuenta " +"bancaria, la moneda para crear los diarios. Así pues, se genere una copia " +"exacta de la plantilla de plan contable.\n" +"\tEste es el mismo asistente que se ejecuta desde Contabilidad y finanzas / " +"Configuración / Contabilidad financiera / Cuentas financieras / Generar el " +"plan contable a partir de una plantilla de plan contable." diff --git a/addons/l10n_cl/i18n/l10n_cl.pot b/addons/l10n_cl/i18n/l10n_cl.pot new file mode 100644 index 00000000000..9b3704b75e1 --- /dev/null +++ b/addons/l10n_cl/i18n/l10n_cl.pot @@ -0,0 +1,35 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * l10n_cl +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.1.0-rc1\n" +"Report-Msgid-Bugs-To: soporte@cubicerp.com\n" +"POT-Creation-Date: 2011-01-11 11:15:31+0000\n" +"PO-Revision-Date: 2011-01-11 11:15:31+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_cl +#: model:ir.module.module,description:l10n_cl.module_meta_information +msgid "\n" +" Chilean Accounting : chart of Account\n" +" " +msgstr "" + +#. module: l10n_cl +#: model:ir.module.module,shortdesc:l10n_cl.module_meta_information +msgid "Chilean Chart of Account" +msgstr "" + +#. module: l10n_cl +#: model:ir.actions.todo,note:l10n_cl.config_call_account_template_in_minimal +msgid "Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated.\n" +" This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template." +msgstr "" + diff --git a/addons/l10n_cl/l10n_cl_chart.xml b/addons/l10n_cl/l10n_cl_chart.xml new file mode 100644 index 00000000000..5b146eb067d --- /dev/null +++ b/addons/l10n_cl/l10n_cl_chart.xml @@ -0,0 +1,256 @@ + + + + + + + noneviewVistanone + + balanceBG_ACC_10Efectivo y Equivalentes al Efectivoasset + detailBG_ACC_20Otros Activos Financieros Corrientesasset + unreconciledBG_ACC_30Deudores Comercialesasset + unreconciledBG_ACC_50Otras Cuentas por Cobrarasset + balanceBG_ACC_60Inventariosasset + + detailBG_ACN_10Derechos por Cobrar No Corrienteasset + detailBG_ACN_40Otros Activos No Financierosasset + balanceBG_ACN_50Propiedades, Planta y Equipoasset + + unreconciledBG_PAC_10Otros Pasivos Financierosliability + unreconciledBG_PAC_20Cuentas por Pagar Comercialesliability + unreconciledBG_PAC_35Otras Cuentas por Pagarliability + unreconciledBG_PAC_40Otras Provisiones Corrientesliability + unreconciledBG_PAC_45Pasivos por Impuestos Corrientesliability + + unreconciledBG_PAN_10Otros Pasivos Financieros No Corrientesliability + unreconciledBG_PAN_20Otros Cuentas por Pagar No Corrientesliability + unreconciledBG_PAN_40Otras Provisiones No Corrientesliability + + balanceBG_PTN_10Patrimonio Netoliability + + noneEGP_FU_010Ingresos por Actividades Ordinariasincome + noneEGP_FU_030Costo de Ventasexpense + noneEGP_FU_040Gastos de Administraciónexpense + noneEGP_FU_050Costos por Distribuciónexpense + unreconciledEGP_FU_060Ingresos Financierosincome + noneEGP_FU_070Costos Financierosexpense + noneEGP_FU_080Otros Ingresosincome + noneEGP_FU_090Otros Gastosexpense + noneEGP_FU_120Gasto Impuesto a las Rentaexpense + noneEGP_FU_160Ganancia (Pérdida)income + + noneEGP_NA_010Compras de Activo Fijonone + + noneORDCuentas de Ordennone + + noneNCLASIFICADOCuentas No Clasificadasnone + + + + + Argentina + pcge + + view + + + inventario del Balance General + .1.BG + + + view + + + ACTIVOS1view + Activo Circulante11view + Activo Circulante - Caja111view + Activo Circulante - Caja / efectivo CLP111.001liquidity + Activo Circulante - Moneda Extranjera112view + Activo Circulante - Caja / efectivo USD112.001liquidity + Activo Circulante - Fondos fijos113view + Activo Circulante - Fondos fijos / caja chica 01 CLP113.001liquidity + Activo Circulante - Bancos114view + Activo Circulante.../ BCO. CTA CTE CLP114.001liquidity + Activo Circulante - Valores a Depositar 115other + Activo Circulante - Recaudaciones a Depositar 116other + Documentos por Cobrar12view + Documentos por Cobrar / Deudores por Ventas121receivable1 + Documentos por Cobrar / Deudores Morosos122receivable1 + Documentos por Cobrar / Deudores en Gestión Judicial123receivable + Documentos por Cobrar / Deudores Varios124receivable + Documentos por Cobrar / (-) Previsión para Incobrables125receivable1 + Cuentas por Cobrar13view + Cuentas por Cobrar / Préstamos otorgados131receivable + Cuentas por Cobrar / Anticipos a Proveedores132receivable + Cuentas por Cobrar / Anticipo de Impuestos133receivable + Cuentas por Cobrar / Anticipo al Personal134receivable + Cuentas por Cobrar / Alquileres Pagados por Adelantado135receivable + Cuentas por Cobrar / Intereses Pagados por Adelantado136receivable + Cuentas por Cobrar / Accionistas137receivable + Cuentas por Cobrar / (-) Previsión para Descuentos138receivable + Cuentas por Cobrar / (-) Intereses (+) a Devengar139receivable + Inversiones Financieras14view + Inversiones / Acciones Transitorias141other + Inversiones / Acciones Permanentes142other + Inversiones / Títulos Públicos143other + Inversiones / (-) Previsión para Devalorización de Acciones144other + Existencias15view + Existencias - Mercaderías151view + Existencias - Mercaderías / Categoria de productos 01151.01other + Existencias - Mercaderías en Tránsito152other + Materias primas153other + Productos en Curso de Elaboración154other + Productos Elaborados155other + Materiales Varios 156other + (-) Previsión para Desvalorización de Existencias157other + Activo Fijo16view + Activo Fijo / Inmuebles161other + Activo Fijo / Maquinaria162other + Activo Fijo / Equipos163other + Activo Fijo / Material Rodante Motorizado164other + Activo Fijo / (-) Depreciación Acumulada165other + Activo Intangible17view + Activo Intangible / Derecho de Llaves171other + Activo Intangible / Concesiones y Franquicias172other + Activo Intangible / Marcas y Patentes de Invención173other + Activo Intangible / (-) Amortización Acumulada174other + PASIVOS2view + Cuentas por Pagar21view + Cuentas por Pagar / Proveedores211payable1 + Cuentas por Pagar / Anticipos de Clientes212payable1 + Cuentas por Pagar / (-) Intereses a Devengar por Compras al Crédito213payable1 + Pasivo Circulante22view + Pasivo Circulante / Adelantos en Cuenta Corriente221payable + Pasivo Circulante / Prestamos222payable + Pasivo Circulante / Obligaciones a Pagar223payable + Pasivo Circulante / Intereses a Pagar224payable + Pasivo Circulante / Debentures Emitidos225payable + Impuestos por Pagar23view + Impuestos por Pagar / IVA a Pagar231other + Impuestos por Pagar / Impuesto a la Renta a Pagar232other + Remuneraciones por Pagar24view + Remuneraciones por Pagar / Sueldos a Pagar241payable + Remuneraciones por Pagar / Cargas Sociales a Pagar242payable + Remuneraciones por Pagar / Provisión para Sueldo Anual Complementario243payable + Remuneraciones por Pagar / Retenciones a Depositar244payable + Otras Cuentas por Pagar25view + Otras Cuentas por Pagar / Acreedores Varios251payable + Otras Cuentas por Pagar / Dividendos a Pagar252payable + Otras Cuentas por Pagar / Cobros por Adelantado253payable + Otras Cuentas por Pagar / Honorarios Directores y Síndicos a Pagar254payable + Provisiones26view + Provisiones / Previsión Indemnización por Despidos261payable + Provisiones / Previsión para juicios Pendientes262payable + Provisiones / Previsión para Garantías por Service263payable + PATRIMONIO3view + Capital31view + Capital / Capital Propio311other + Capital / Acciones en Circulación312other + Capital / Dividendos a Distribuir en Acciones313other + Capital / (-) Descuento de Emisión de Acciones314other + Aportes No Capitalizados32view + Aportes No Capitalizados / Primas de Emsión321other + Aportes No Capitalizados / Aportes Irrevocables Futura Suscripción de Acciones322other + Ajustes al Patrimonio33view + Ajustes al Patrimonio / Revaluo Técnico de Activo Fijo331other + Futuras Eventualidades34view + Reserva Legal341other + Reserva Estatutaria342other + Reserva Facultativa343other + Reserva para Renovación de Activo Fijo344other + Resultados No Asignados35view + Resultados Acumulados351other + Resultados Acumulados del Ejercicio Anterior352other + Utilidades y Pérdidas del Ejercicio353other + Resultado del Ejercicio354other + + + Cuentas de Resultado + .2.GP + + + view + + + RESULTADO GANANCIA4view + Ingresos de Explotación41view + Ventas411view + Ventas - Categoria de productos 01411.01other + Intereses gananados, obtenidos, percibidos412other + Alquileres gananados, obtenidos, percibidos413other + Comisiones gananados, obtenidos, percibidos414other + Descuentos gananados, obtenidos, percibidos415other + Interese sobre Inversiones416other + Honorarios gananados, obtenidos, percibidos417other + Ganancia Venta de Acciones418other + Ingresos Fuera de Explotación42view + Recupero de Rezagos421other + Recupero de Deudores Incobrables422other + Ganancia Venta de Activo Fijo423other + Donaciones obtenidas, ganandas, percibidas424other + Ganancia Venta Inversiones Permanentes425other + RESULTADO PÉRDIDA5view + Egresos de Explotación51view + Costo de Mercaderías Vendidas511view + Costo de Mercaderías Vendidas - Categoria de productos 01511.01other + Gastos en Depreciación de Activo Fijo512other + Gastos en Amortización513other + Gastos en Sueldos y Jornales514other + Gastos en Cargas Sociales515other + Gastos en Impuestos516other + Gastos Bancarios517other + Gastos en Servicios Públicos518other + Gastos de Publicidad y Propaganda519other + Egresos Fuera de Explotación52view + Gastos en Siniestros521other + Donaciones Cedidas, Otorgadas522other + Pérdida Venta Activo Fijo523other + + + Cuentas de Movimiento + .3.CC + + + view + + + Compras61view + Compras - Categoria de productos 0161.01other + Costos de Producción62other + Gastos de Administración63other + Gastos de Comercialización64other + + + Cuentas de Orden + .4.CO + + + view + + + CUENTAS DE ORDEN DEUDORAS71view + Mercaderias Recibidas en Consignación711other + Depósito de Valores Recibos en Garantía712other + Garantias Otorgadas713other + Documentos Descontados714other + Documentos Endosados715other + CUENTAS DE ORDEN ACREEDORAS72view + Comitente por Mercaderias Recibidas en Consignación721other + Acreedor por Garantías Otorgadas722other + Acreedor por Documentos Descontados723other + + + Chile - Plan de Cuentas + + + + + + + + + + + + + diff --git a/addons/l10n_cl/l10n_cl_wizard.xml b/addons/l10n_cl/l10n_cl_wizard.xml new file mode 100644 index 00000000000..191230c5010 --- /dev/null +++ b/addons/l10n_cl/l10n_cl_wizard.xml @@ -0,0 +1,15 @@ + + + + + + Generate Chart of Accounts from a Chart Template + Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated. + This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template. + + + automatic + + + + From 4c54457489044ad7c7e4f8c54241e32dba6d4a10 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Mon, 20 Feb 2012 15:00:37 +0530 Subject: [PATCH 005/591] [FIX]purchase: added domain of supplier in the partner_id field lp bug: https://launchpad.net/bugs/936385 fixed bzr revid: mma@tinyerp.com-20120220093037-uh5ubja5jtnqy8om --- addons/purchase/purchase_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 1c936055aff..e358bfc2ced 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -172,7 +172,7 @@ - + From 44fec74adfbf53e4e9a02461b45b8e1b0525441d Mon Sep 17 00:00:00 2001 From: Yury Tello Date: Tue, 21 Feb 2012 15:53:28 -0500 Subject: [PATCH 006/591] [MOD] Ajust title bzr revid: ytello@cubicerp.com-20120221205328-s5y8iz1hjnlkj4hp --- addons/l10n_cl/__openerp__.py | 2 +- addons/l10n_cl/l10n_cl_chart.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_cl/__openerp__.py b/addons/l10n_cl/__openerp__.py index 249bdb3ae48..8c1e1e45b50 100644 --- a/addons/l10n_cl/__openerp__.py +++ b/addons/l10n_cl/__openerp__.py @@ -19,7 +19,7 @@ # ############################################################################## { - "name": "Argentina Localization Chart Account", + "name": "Chile Localization Chart Account", "version": "1.0", "description": """ Chilean accounting chart and tax localization. diff --git a/addons/l10n_cl/l10n_cl_chart.xml b/addons/l10n_cl/l10n_cl_chart.xml index 5b146eb067d..8bc4272c2eb 100644 --- a/addons/l10n_cl/l10n_cl_chart.xml +++ b/addons/l10n_cl/l10n_cl_chart.xml @@ -48,7 +48,7 @@ - Argentina + Chile pcge view From 1bf3b3b515737f6fd929250cf7f7c0d1e03a1ddf Mon Sep 17 00:00:00 2001 From: Date: Thu, 1 Mar 2012 13:21:24 +0100 Subject: [PATCH 007/591] [FIX] use a local variable row instead of res bzr revid: guewen.baconnier@camptocamp.com-20120301122124-0izdqntr76ruqtde --- addons/account/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index c1a30967aea..49ecf61ee51 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -315,8 +315,8 @@ class account_account(osv.osv): self.logger.notifyChannel('addons.'+self._name, netsvc.LOG_DEBUG, 'Status: %s'%cr.statusmessage) - for res in cr.dictfetchall(): - accounts[res['id']] = res + for row in cr.dictfetchall(): + accounts[row['id']] = row # consolidate accounts with direct children children_and_consolidated.reverse() From 79aa02650c22d951e7245cbf7a9c77574deeb895 Mon Sep 17 00:00:00 2001 From: "Amit (OpenERP)" Date: Sat, 28 Apr 2012 18:21:25 +0530 Subject: [PATCH 008/591] [FIX] product : Set the missing dependecy of mail module to product module lp bug: https://launchpad.net/bugs/990474 fixed bzr revid: amp@tinyerp.com-20120428125125-1unkvn70pz1wys6i --- addons/product/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/__openerp__.py b/addons/product/__openerp__.py index 9b4d2cadee1..918545aa783 100644 --- a/addons/product/__openerp__.py +++ b/addons/product/__openerp__.py @@ -25,7 +25,7 @@ "version" : "1.1", "author" : "OpenERP SA", 'category': 'Sales Management', - "depends" : ["base", "process", "decimal_precision"], + "depends" : ["base", "process", "decimal_precision", "mail"], "init_xml" : [], "demo_xml" : ["product_demo.xml"], "description": """ From 119cb3e9b51226951e42fce05297c3fbb06c521a Mon Sep 17 00:00:00 2001 From: "Ravish Murari (OpenERP)" Date: Mon, 30 Apr 2012 14:50:06 +0530 Subject: [PATCH 009/591] [FIX]change in category of account_anglo_saxon--fixes=lp:985823 bzr revid: rmu@tinyerp.com-20120430092006-nejh5d8mt5eiyhn1 --- addons/account_anglo_saxon/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_anglo_saxon/__openerp__.py b/addons/account_anglo_saxon/__openerp__.py index 2c10fcc7a19..34fdba75567 100644 --- a/addons/account_anglo_saxon/__openerp__.py +++ b/addons/account_anglo_saxon/__openerp__.py @@ -36,7 +36,7 @@ when the invoice is created to transfer this amount to the debtor or creditor ac Secondly, price differences between actual purchase price and fixed product standard price are booked on a separate account""", "images": ["images/account_anglo_saxon.jpeg"], "depends": ["product", "purchase"], - "category": "Hidden/Dependency", + "category": "Accounting & Finance", "init_xml": [], "demo_xml": [], "update_xml": ["product_view.xml",], From 8a377a190d30176b04eeaaae5d275cb197a17626 Mon Sep 17 00:00:00 2001 From: paulius <> Date: Tue, 1 May 2012 11:44:12 +0530 Subject: [PATCH 010/591] [FIX] improve rounding at invoice subtotal field--fixes=lp:977300 bzr revid: rmu@tinyerp.com-20120501061412-on9rz3lkbm7oqad3 --- addons/account/account.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 75bfc891980..63f0e0ec1a7 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -29,6 +29,7 @@ import pooler from osv import fields, osv import decimal_precision as dp from tools.translate import _ +from tools import float_round def check_cycle(self, cr, uid, ids, context=None): """ climbs the ``self._table.parent_id`` chains for 100 levels or @@ -2069,7 +2070,7 @@ class account_tax(osv.osv): } """ precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account') - totalin = totalex = round(price_unit * quantity, precision) + totalin = totalex = float_round(price_unit * quantity, precision) tin = [] tex = [] for tax in taxes: From cef801058f56c81b68c25d443524105faa69c25b Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Mon, 14 May 2012 14:59:12 +0530 Subject: [PATCH 011/591] [IMP] l10n_in: improve code for the Indian chart of account add new file installer.py, installer_view.xml, l10n_in_partnership_private_chart.xml, l10n_in/l10n_in_public_firm_chart.xmlxml bzr revid: jap@tinyerp.com-20120514092912-lwbg1r8jy904o7u2 --- addons/l10n_in/__init__.py | 1 + addons/l10n_in/__openerp__.py | 7 +- addons/l10n_in/installer.py | 71 +++ addons/l10n_in/installer_view.xml | 16 + .../l10n_in_partnership_private_chart.xml | 413 +++++++++++++ addons/l10n_in/l10n_in_public_firm_chart.xml | 543 ++++++++++++++++++ 6 files changed, 1050 insertions(+), 1 deletion(-) create mode 100644 addons/l10n_in/installer.py create mode 100644 addons/l10n_in/installer_view.xml create mode 100644 addons/l10n_in/l10n_in_partnership_private_chart.xml create mode 100644 addons/l10n_in/l10n_in_public_firm_chart.xml diff --git a/addons/l10n_in/__init__.py b/addons/l10n_in/__init__.py index 19de03b504c..f97bda7fb89 100644 --- a/addons/l10n_in/__init__.py +++ b/addons/l10n_in/__init__.py @@ -27,5 +27,6 @@ # ############################################################################## +import installer # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/__openerp__.py b/addons/l10n_in/__openerp__.py index c13139f6736..9be4d35705e 100644 --- a/addons/l10n_in/__openerp__.py +++ b/addons/l10n_in/__openerp__.py @@ -36,8 +36,13 @@ Indian accounting chart and localization. ], "demo_xml": [], "update_xml": [ - "l10n_in_chart.xml", +# "l10n_in_chart.xml", + "l10n_in_partnership_private_chart.xml", + "installer_view.xml", + "l10n_in_public_firm_chart.xml", "l10n_in_wizard.xml", + + ], "auto_install": False, "installable": True, diff --git a/addons/l10n_in/installer.py b/addons/l10n_in/installer.py new file mode 100644 index 00000000000..e4242ad5e91 --- /dev/null +++ b/addons/l10n_in/installer.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 . +# +############################################################################## + +from osv import fields, osv +import netsvc +import tools +from os.path import join as opj + +class l10n_installer(osv.osv_memory): + _inherit = 'account.installer' + _columns = { + 'company_type':fields.selection([('partnership_private_company', 'Partnership/Private Firm'), + ('public_company', 'Public Company')], 'Company Type'), + } + + _defaults = { + 'company_type': 'public_company', + } + + def execute_simple(self, cr, uid, ids, context=None): + if context is None: + context = {} + fy_obj = self.pool.get('account.fiscalyear') + for res in self.read(cr, uid, ids, context=context): + if res['charts'] =='l10n_in' and res['company_type']=='public_company': + fp = tools.file_open(opj('l10n_in', 'l10n_in_public_firm_chart.xml')) + tools.convert_xml_import(cr, 'l10n_in', fp, {}, 'init', True, None) + fp.close() + if res['charts'] =='l10n_in' and res['company_type']=='partnership_private_company': + fp = tools.file_open(opj('l10n_in', 'l10n_in_partnership_private_chart.xml')) + tools.convert_xml_import(cr, 'l10n_in', fp, {}, 'init', True, None) + fp.close() + if 'date_start' in res and 'date_stop' in res: + f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_id'][0])], context=context) + if not f_ids: + name = code = res['date_start'][:4] + if int(name) != int(res['date_stop'][:4]): + name = res['date_start'][:4] +'-'+ res['date_stop'][:4] + code = res['date_start'][2:4] +'-'+ res['date_stop'][2:4] + vals = { + 'name': name, + 'code': code, + 'date_start': res['date_start'], + 'date_stop': res['date_stop'], + 'company_id': res['company_id'][0] + } + fiscal_id = fy_obj.create(cr, uid, vals, context=context) + if res['period'] == 'month': + fy_obj.create_period(cr, uid, [fiscal_id]) + elif res['period'] == '3months': + fy_obj.create_period3(cr, uid, [fiscal_id]) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/installer_view.xml b/addons/l10n_in/installer_view.xml new file mode 100644 index 00000000000..cfac5ed8513 --- /dev/null +++ b/addons/l10n_in/installer_view.xml @@ -0,0 +1,16 @@ + + + + account.installer.form + account.installer + form + + + + + + + + + + diff --git a/addons/l10n_in/l10n_in_partnership_private_chart.xml b/addons/l10n_in/l10n_in_partnership_private_chart.xml new file mode 100644 index 00000000000..ca009cf0c6e --- /dev/null +++ b/addons/l10n_in/l10n_in_partnership_private_chart.xml @@ -0,0 +1,413 @@ + + + + + + + + Indian Chart of Account Partnership/Private firm + 0 + view + + + + + + + Balance Sheet + 1 + view + + + + + + + + + Assets + 10 + view + + + + + + + Cash + 101 + liquidity + + + + Checking account balance (as shown in company records), currency, coins, checks received from customers but not yet deposited. + + + + Accounts Receivable + 120 + receivable + + + + + + + Merchandise Inventory + 140 + other + + + + + + + Supplies + 150 + other + + + + + + + Prepaid Insurance + 160 + other + + + + + + + Land + 170 + other + + + + + + + Accumulated Depreciation - Buildings + 178 + other + + + + + + + Equipment + 180 + other + + + + + + + Accumulated Depreciation - Equipment + 188 + other + + + + + + + + + Liabilities + 20 + view + + + + + + + Notes Payable + 210 + other + + + + + + + Accounts Payable + 215 + payable + + + + + + + Wages Payable + 220 + other + + + + + + + Interest Payable + 230 + other + + + + + + + Unearned Revenues + 240 + other + + + + + + + Mortgage Loan Payable + 250 + other + + + + + + + + + Owner's Equity Accounts + 29 + view + + + + + + + Mary Smith, Capital + 290 + other + + + + + + + Mary Smith, Drawing + 295 + other + + + + + + + + + Profit And Loss Account + 3 + view + + + + + + + + + Income + 30 + view + + + + + + + + + + Operating Revenue Accounts + 31 + view + + + + + + + Service Revenues + 310 + other + + + + + + + + Non-Operating Revenue and Gains + 80 + view + + + + + + + Interest Revenues + 810 + other + + + + + + + Gain on Sale of Assets + 910 + other + + + + + + + + + Expense + 50 + view + + + + + + + Operating Expense Accounts + 51 + view + + + + + + + Salaries Expense + 500 + other + + + + + + + Wages Expense + 510 + other + + + + + + + Supplies Expense + 540 + other + + + + + + + Rent Expense + 560 + other + + + + + + + Utilities Expense + 570 + other + + + + + + + Telephone Expense + 576 + other + + + + + + + Advertising Expense + 610 + other + + + + + + + + Depreciation Expense + 750 + other + + + + + + + + + Non-Operating Expenses and Losses + 90 + view + + + + + + + Loss on Sale of Assets + 960 + other + + + + + + + + + Indian Chart of Account Partnership/Private firm + + + + + + + + + + + + + + diff --git a/addons/l10n_in/l10n_in_public_firm_chart.xml b/addons/l10n_in/l10n_in_public_firm_chart.xml new file mode 100644 index 00000000000..2bd8a67f346 --- /dev/null +++ b/addons/l10n_in/l10n_in_public_firm_chart.xml @@ -0,0 +1,543 @@ + + + + + + + + + Indian Chart of Account Public firm + 0 + view + + + + + + + Balance Sheet + 1 + view + + + + + + + + Assets + 10 + view + + + + + + + Current Assets + 10000 + view + + + + + + + Cash - Regular Checking + 10100 + liquidity + + + + + + + Cash - Payroll Checking + 10200 + liquidity + + + + + + + Petty Cash Fund + 10600 + liquidity + + + + + + + Accounts Receivable + 12100 + receivable + + + + + + + Allowance for Doubtful Accounts + 12500 + other + + + + + + + Inventory + 13100 + other + + + + + + + Supplies + 14100 + other + + + + + + + Prepaid Insurance + 15300 + other + + + + + + + + + Liabilities + 20 + view + + + + + + + Current Liabilities + 20000 + view + + + + + + + Notes Payable - Credit Line #1 + 20100 + other + + + + + + + Notes Payable - Credit Line #2 + 20200 + other + + + + + + + Accounts Payable + 21000 + payable + + + + + + + Wages Payable + 22100 + other + + + + + + + Interest Payable + 23100 + other + + + + + + + Unearned Revenues + 24500 + other + + + + + + + + Long-term Liabilities + 25000 + view + + + + + + + Mortgage Loan Payable + 25100 + other + + + + + + + Bonds Payable + 25600 + other + + + + + + + Discount on Bonds Payable + 25650 + other + + + + + + + Stockholders' Equity + 27000 + view + + + + + + + Common Stock, No Par + 27100 + other + + + + + + + Retained Earnings + 27500 + other + + + + + + + Treasury Stock + 29500 + other + + + + + + + + + + + Profit And Loss Account + 3 + view + + + + + + + + + Income + 30 + view + + + + + + + + + Operating Revenues + 30000 + view + + + + + + + Sales - Division #1, Product Line 010 + 31010 + other + + + + + + + Sales - Division #1, Product Line 022 + 31022 + other + + + + + + + Sales - Division #2, Product Line 015 + 32015 + other + + + + + + + Sales - Division #3, Product Line 110 + 33110 + other + + + + + + + + Non-Operating Revenue and Gains + 90000 + view + + + + + + + Gain on Sale of Assets + 91800 + other + + + + + + + + + Expense + 40 + view + + + + + + + + + + Cost of Goods Sold + 40000 + view + + + + + + + + COGS - Division #1, Product Line 010 + 41010 + other + + + + + + + COGS - Division #1, Product Line 022 + 41022 + other + + + + + + + COGS - Division #2, Product Line 015 + 42015 + other + + + + + + + COGS - Division #3, Product Line 110 + 43110 + other + + + + + + + + + Marketing Expenses + 50000 + view + + + + + + + Marketing Dept. Salaries + 50100 + other + + + + + + + Marketing Dept. Payroll Taxes + 50150 + other + + + + + + + Marketing Dept. Supplies + 50200 + other + + + + + + + Marketing Dept. Telephone + 50600 + other + + + + + + + + + Payroll Dept. Expenses + 59000 + view + + + + + + + Payroll Dept. Salaries + 59100 + other + + + + + + + Payroll Dept. Payroll Taxes + 59150 + other + + + + + + + Payroll Dept. Supplies + 59200 + other + + + + + + + Payroll Dept. Telephone + 59600 + other + + + + + + + + + Non-Operating Expenses and Losses + 96000 + view + + + + + + + Loss on Sale of Assets + 96100 + other + + + + + + + + + India - Chart of Accounts Public firm + + + + + + + + + + + + From 9ce89b8af3ca6d479e74f8fb909f62b2b718389f Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Tue, 15 May 2012 10:26:41 +0530 Subject: [PATCH 012/591] [IMP] l10n_in: improve code and add new file account_tax_code_template.xml,account_wizard.py, account_wizard_view.xml bzr revid: jap@tinyerp.com-20120515045641-f509ihbt1gwnwpfx --- addons/l10n_in/__init__.py | 1 + addons/l10n_in/__openerp__.py | 6 ++- addons/l10n_in/account_tax.xml | 24 +++++----- addons/l10n_in/account_tax_code_template.xml | 36 +++++++++++++++ addons/l10n_in/account_wizard.py | 35 ++++++++++++++ addons/l10n_in/account_wizard_view.xml | 21 +++++++++ .../l10n_in_partnership_private_chart.xml | 46 +++++++++++++++++-- addons/l10n_in/l10n_in_public_firm_chart.xml | 5 +- 8 files changed, 155 insertions(+), 19 deletions(-) create mode 100644 addons/l10n_in/account_tax_code_template.xml create mode 100644 addons/l10n_in/account_wizard.py create mode 100644 addons/l10n_in/account_wizard_view.xml diff --git a/addons/l10n_in/__init__.py b/addons/l10n_in/__init__.py index f97bda7fb89..9eb002375e0 100644 --- a/addons/l10n_in/__init__.py +++ b/addons/l10n_in/__init__.py @@ -28,5 +28,6 @@ ############################################################################## import installer +import account_wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/__openerp__.py b/addons/l10n_in/__openerp__.py index 9be4d35705e..a0b8f990531 100644 --- a/addons/l10n_in/__openerp__.py +++ b/addons/l10n_in/__openerp__.py @@ -39,10 +39,12 @@ Indian accounting chart and localization. # "l10n_in_chart.xml", "l10n_in_partnership_private_chart.xml", "installer_view.xml", + "account_tax_code_template.xml", +# "account_tax_code.xml", "l10n_in_public_firm_chart.xml", + "account_tax.xml", "l10n_in_wizard.xml", - - + "account_wizard_view.xml", ], "auto_install": False, "installable": True, diff --git a/addons/l10n_in/account_tax.xml b/addons/l10n_in/account_tax.xml index 80f1233f498..f4a62e4435e 100644 --- a/addons/l10n_in/account_tax.xml +++ b/addons/l10n_in/account_tax.xml @@ -3,17 +3,19 @@ - - PPn (10%)(10.0%) - 0.100000 + + Sale Central + + 0.12 percent - - - - - - - - + + + + + + + + + diff --git a/addons/l10n_in/account_tax_code_template.xml b/addons/l10n_in/account_tax_code_template.xml new file mode 100644 index 00000000000..466d3f147b4 --- /dev/null +++ b/addons/l10n_in/account_tax_code_template.xml @@ -0,0 +1,36 @@ + + + + + + + Tax balance to pay + + + + Tax Due (Tax to pay) + + + + + Tax payable + + + + + Tax bases + + + + Base of taxed sales + + + + + + Base of taxed purchases + + + + + diff --git a/addons/l10n_in/account_wizard.py b/addons/l10n_in/account_wizard.py new file mode 100644 index 00000000000..eb6f0dd1491 --- /dev/null +++ b/addons/l10n_in/account_wizard.py @@ -0,0 +1,35 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Author: Nicolas Bessi. Copyright Camptocamp SA +# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA +# +# 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 tools +from osv import osv +from osv import fields, osv + +class account_wizard(osv.osv_memory): + _inherit ='wizard.multi.charts.accounts' + _columns = { + 'sales_tax_central': fields.boolean('Sales tax central'), + 'vat_resellers': fields.boolean('VAT resellers'), + 'service_tax': fields.boolean('Service tax'), + 'excise_duty': fields.boolean('Excise duty'), + } + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/account_wizard_view.xml b/addons/l10n_in/account_wizard_view.xml new file mode 100644 index 00000000000..7af266c7a81 --- /dev/null +++ b/addons/l10n_in/account_wizard_view.xml @@ -0,0 +1,21 @@ + + + + + + Generate Chart of Accounts from a Chart Template + wizard.multi.charts.accounts + form + + + + + + + + + + + + + diff --git a/addons/l10n_in/l10n_in_partnership_private_chart.xml b/addons/l10n_in/l10n_in_partnership_private_chart.xml index ca009cf0c6e..63853401468 100644 --- a/addons/l10n_in/l10n_in_partnership_private_chart.xml +++ b/addons/l10n_in/l10n_in_partnership_private_chart.xml @@ -5,7 +5,7 @@ - Indian Chart of Account Partnership/Private firm + Partnership/Private Firm Chart of Account 0 view @@ -40,7 +40,7 @@ - Checking account balance (as shown in company records), currency, coins, checks received from customers but not yet deposited. + Checking account balance (as shown in company records), currency, coins, checks received from customers but not yet deposited. @@ -50,6 +50,7 @@ + Amounts owed to the company for services performed or products sold but not yet paid for. @@ -59,6 +60,7 @@ + Cost of merchandise purchased but has not yet been sold. @@ -68,6 +70,7 @@ + Cost of supplies that have not yet been used. Supplies that have been used are recorded in Supplies Expense. @@ -77,6 +80,7 @@ + Cost of insurance that is paid in advance and includes a future accounting period. @@ -86,7 +90,18 @@ - + Cost to acquire and prepare land for use by the company. + + + + Buildings + 175 + other + + + + Cost to purchase or construct buildings for use by the company. + Accumulated Depreciation - Buildings @@ -95,6 +110,7 @@ + Amount of the buildings' cost that has been allocated to Depreciation Expense since the time the building was acquired. @@ -104,6 +120,7 @@ + Cost to acquire and prepare equipment for use by the company. @@ -113,6 +130,7 @@ + Amount of equipment's cost that has been allocated to Depreciation Expense since the time the equipment was acquired. @@ -133,6 +151,7 @@ + The amount of principal due on a formal written promise to pay. Loans from banks are included in this account. @@ -142,6 +161,7 @@ + Amount owed to suppliers who provided goods and services to the company but did not require immediate payment in cash. @@ -151,6 +171,7 @@ + Amount owed to employees for hours worked but not yet paid. @@ -160,6 +181,7 @@ + Amount owed for interest on Notes Payable up until the date of the balance sheet. This is computed by multiplying the amount of the note times the effective interest rate times the time period. @@ -169,6 +191,7 @@ + Amounts received in advance of delivering goods or providing services. When the goods are delivered or services are provided, this liability amount decreases. @@ -178,6 +201,7 @@ + A formal loan that involves a lien on real estate until the loan is repaid. @@ -198,6 +222,7 @@ + Amount the owner invested in the company (through cash or other assets) plus earnings of the company not withdrawn by the owner. @@ -207,6 +232,7 @@ + Amount that the owner of the sole proprietorship has withdrawn for personal use during the current accounting year. At the end of the year, the amount in this account will be transferred into Mary Smith, Capital (account 290). @@ -250,6 +276,7 @@ + Amounts earned from providing services to clients, either for cash or on credit. When a service is provided on credit, both this account and Accounts Receivable will increase. When a service is provided for immediate cash, both this account and Cash will increase. @@ -269,6 +296,7 @@ + Interest and dividends earned on bank accounts, investments or notes receivable. This account is increased when the interest is earned and either Cash or Interest Receivable is also increased. @@ -278,6 +306,7 @@ + Occurs when the company sells one of its assets (other than inventory) for more than the asset's book value. @@ -307,6 +336,7 @@ + Expenses incurred for the work performed by salaried employees during the accounting period. These employees normally receive a fixed amount on a weekly, monthly, or annual basis. @@ -316,6 +346,7 @@ + Expenses incurred for the work performed by non-salaried employees during the accounting period. These employees receive an hourly rate of pay. @@ -325,6 +356,7 @@ + Cost of supplies used up during the accounting period. @@ -334,6 +366,7 @@ + Cost of occupying rented facilities during the accounting period. @@ -343,6 +376,7 @@ + Costs for electricity, heat, water, and sewer that were used during the accounting period. @@ -352,6 +386,7 @@ + Cost of telephone used during the current accounting period. @@ -361,6 +396,7 @@ + Costs incurred by the company during the accounting period for ads, promotions, and other selling and expenses (other than salaries). @@ -371,6 +407,7 @@ + Cost of long-term assets allocated to expense during the current accounting period. @@ -391,12 +428,13 @@ + Occurs when the company sells one of its assets (other than inventory) for less than the asset's book value. - Indian Chart of Account Partnership/Private firm + Partnership/Private Firm Chart of Account diff --git a/addons/l10n_in/l10n_in_public_firm_chart.xml b/addons/l10n_in/l10n_in_public_firm_chart.xml index 2bd8a67f346..297e2947352 100644 --- a/addons/l10n_in/l10n_in_public_firm_chart.xml +++ b/addons/l10n_in/l10n_in_public_firm_chart.xml @@ -6,7 +6,7 @@ - Indian Chart of Account Public firm + Public Firm Chart of Account 0 view @@ -528,8 +528,9 @@ - India - Chart of Accounts Public firm + Public Firm Chart of Account + From 9e4dadab42723953b82638f0b748f0af50345695 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Wed, 16 May 2012 11:55:29 +0530 Subject: [PATCH 013/591] [IMP] l10n_in: improve code bzr revid: jap@tinyerp.com-20120516062529-o1lip88uk38bmy33 --- addons/l10n_in/__init__.py | 2 +- addons/l10n_in/__openerp__.py | 7 ++---- ...izard.py => account_multi_chart_wizard.py} | 20 +++++++++++++---- ...ml => account_multi_chart_wizard_view.xml} | 4 ++-- addons/l10n_in/account_tax_code_template.xml | 22 ++++++++++++------- addons/l10n_in/installer.py | 12 +++++----- .../l10n_in_partnership_private_chart.xml | 2 +- addons/l10n_in/l10n_in_public_firm_chart.xml | 8 +++---- 8 files changed, 46 insertions(+), 31 deletions(-) rename addons/l10n_in/{account_wizard.py => account_multi_chart_wizard.py} (58%) rename addons/l10n_in/{account_wizard_view.xml => account_multi_chart_wizard_view.xml} (87%) diff --git a/addons/l10n_in/__init__.py b/addons/l10n_in/__init__.py index 9eb002375e0..db0c795ae73 100644 --- a/addons/l10n_in/__init__.py +++ b/addons/l10n_in/__init__.py @@ -28,6 +28,6 @@ ############################################################################## import installer -import account_wizard +import account_multi_chart_wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/__openerp__.py b/addons/l10n_in/__openerp__.py index a0b8f990531..ba901562a0b 100644 --- a/addons/l10n_in/__openerp__.py +++ b/addons/l10n_in/__openerp__.py @@ -36,15 +36,12 @@ Indian accounting chart and localization. ], "demo_xml": [], "update_xml": [ -# "l10n_in_chart.xml", "l10n_in_partnership_private_chart.xml", - "installer_view.xml", "account_tax_code_template.xml", -# "account_tax_code.xml", "l10n_in_public_firm_chart.xml", - "account_tax.xml", "l10n_in_wizard.xml", - "account_wizard_view.xml", + "installer_view.xml", + "account_multi_chart_wizard_view.xml", ], "auto_install": False, "installable": True, diff --git a/addons/l10n_in/account_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py similarity index 58% rename from addons/l10n_in/account_wizard.py rename to addons/l10n_in/account_multi_chart_wizard.py index eb6f0dd1491..ea7974dd430 100644 --- a/addons/l10n_in/account_wizard.py +++ b/addons/l10n_in/account_multi_chart_wizard.py @@ -19,17 +19,29 @@ # ############################################################################## import tools -from osv import osv from osv import fields, osv +from os.path import join as opj -class account_wizard(osv.osv_memory): +class account_multi_charts_wizard(osv.osv_memory): _inherit ='wizard.multi.charts.accounts' _columns = { - 'sales_tax_central': fields.boolean('Sales tax central'), - 'vat_resellers': fields.boolean('VAT resellers'), + 'sales_tax': fields.boolean('Sales tax central'), + 'vat': fields.boolean('VAT resellers'), 'service_tax': fields.boolean('Service tax'), 'excise_duty': fields.boolean('Excise duty'), } + def execute(self, cr, uid, ids, context=None): + super(account_multi_charts_wizard, self).execute(cr, uid, ids, context) + obj_multi = self.browse(cr, uid, ids[0]) + if obj_multi.chart_template_id.name == 'Public Firm Chart of Account': + path = tools.file_open(opj('l10n_in', 'account_sale_tax.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + elif obj_multi.chart_template_id.name == 'Partnership/Private Firm Chart of Account': + path = tools.file_open(opj('l10n_in', 'account_vat.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/account_wizard_view.xml b/addons/l10n_in/account_multi_chart_wizard_view.xml similarity index 87% rename from addons/l10n_in/account_wizard_view.xml rename to addons/l10n_in/account_multi_chart_wizard_view.xml index 7af266c7a81..449b3af70b9 100644 --- a/addons/l10n_in/account_wizard_view.xml +++ b/addons/l10n_in/account_multi_chart_wizard_view.xml @@ -10,9 +10,9 @@ - - + + diff --git a/addons/l10n_in/account_tax_code_template.xml b/addons/l10n_in/account_tax_code_template.xml index 466d3f147b4..55dbf427e86 100644 --- a/addons/l10n_in/account_tax_code_template.xml +++ b/addons/l10n_in/account_tax_code_template.xml @@ -3,8 +3,13 @@ + + Tax + + - Tax balance to pay + Tax Balance to Pay + @@ -13,23 +18,24 @@ - Tax payable + Tax Payable - Tax bases + Tax Bases + + - Base of taxed sales - + Base of Taxed Sales + - - Base of taxed purchases - + Base of Taxed Purchases + diff --git a/addons/l10n_in/installer.py b/addons/l10n_in/installer.py index e4242ad5e91..1b57127d35c 100644 --- a/addons/l10n_in/installer.py +++ b/addons/l10n_in/installer.py @@ -41,13 +41,13 @@ class l10n_installer(osv.osv_memory): fy_obj = self.pool.get('account.fiscalyear') for res in self.read(cr, uid, ids, context=context): if res['charts'] =='l10n_in' and res['company_type']=='public_company': - fp = tools.file_open(opj('l10n_in', 'l10n_in_public_firm_chart.xml')) - tools.convert_xml_import(cr, 'l10n_in', fp, {}, 'init', True, None) - fp.close() + path = tools.file_open(opj('l10n_in', 'l10n_in_public_firm_chart.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() if res['charts'] =='l10n_in' and res['company_type']=='partnership_private_company': - fp = tools.file_open(opj('l10n_in', 'l10n_in_partnership_private_chart.xml')) - tools.convert_xml_import(cr, 'l10n_in', fp, {}, 'init', True, None) - fp.close() + path = tools.file_open(opj('l10n_in', 'l10n_in_partnership_private_chart.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() if 'date_start' in res and 'date_stop' in res: f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_id'][0])], context=context) if not f_ids: diff --git a/addons/l10n_in/l10n_in_partnership_private_chart.xml b/addons/l10n_in/l10n_in_partnership_private_chart.xml index 63853401468..f59aaeb407b 100644 --- a/addons/l10n_in/l10n_in_partnership_private_chart.xml +++ b/addons/l10n_in/l10n_in_partnership_private_chart.xml @@ -436,7 +436,7 @@ Partnership/Private Firm Chart of Account - + diff --git a/addons/l10n_in/l10n_in_public_firm_chart.xml b/addons/l10n_in/l10n_in_public_firm_chart.xml index 297e2947352..bcc9a3918a4 100644 --- a/addons/l10n_in/l10n_in_public_firm_chart.xml +++ b/addons/l10n_in/l10n_in_public_firm_chart.xml @@ -296,7 +296,7 @@ - + Sales - Division #1, Product Line 010 31010 other @@ -524,18 +524,18 @@ - + Public Firm Chart of Account - + - + From 15938009e3d5b8bbaf61bc4f24b99806f8b67006 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Thu, 17 May 2012 12:40:59 +0530 Subject: [PATCH 014/591] [IMP] l10n_in: improve code and add new xml file for different taxes bzr revid: jap@tinyerp.com-20120517071059-0s96fem90ke2i5sw --- addons/l10n_in/__openerp__.py | 4 +- addons/l10n_in/account_multi_chart_wizard.py | 49 ++++++++++++++----- addons/l10n_in/account_tax.xml | 17 +++---- addons/l10n_in/account_tax_code_template.xml | 26 +++++----- .../l10n_in_partnership_private_chart.xml | 2 +- addons/l10n_in/l10n_in_public_firm_chart.xml | 2 +- addons/l10n_in/tax/private_exice_duty.xml | 47 ++++++++++++++++++ addons/l10n_in/tax/private_service.xml | 46 +++++++++++++++++ addons/l10n_in/tax/private_vat.xml | 27 ++++++++++ addons/l10n_in/tax/privete_sale_tax.xml | 27 ++++++++++ .../l10n_in/tax/public_firm_excise_duty.xml | 48 ++++++++++++++++++ addons/l10n_in/tax/public_firm_sales_tax.xml | 23 +++++++++ addons/l10n_in/tax/public_firm_service.xml | 49 +++++++++++++++++++ addons/l10n_in/tax/public_firm_vat.xml | 28 +++++++++++ 14 files changed, 357 insertions(+), 38 deletions(-) create mode 100644 addons/l10n_in/tax/private_exice_duty.xml create mode 100644 addons/l10n_in/tax/private_service.xml create mode 100644 addons/l10n_in/tax/private_vat.xml create mode 100644 addons/l10n_in/tax/privete_sale_tax.xml create mode 100644 addons/l10n_in/tax/public_firm_excise_duty.xml create mode 100644 addons/l10n_in/tax/public_firm_sales_tax.xml create mode 100644 addons/l10n_in/tax/public_firm_service.xml create mode 100644 addons/l10n_in/tax/public_firm_vat.xml diff --git a/addons/l10n_in/__openerp__.py b/addons/l10n_in/__openerp__.py index ba901562a0b..cbacb5e5ac3 100644 --- a/addons/l10n_in/__openerp__.py +++ b/addons/l10n_in/__openerp__.py @@ -36,12 +36,10 @@ Indian accounting chart and localization. ], "demo_xml": [], "update_xml": [ - "l10n_in_partnership_private_chart.xml", "account_tax_code_template.xml", - "l10n_in_public_firm_chart.xml", + "account_multi_chart_wizard_view.xml", "l10n_in_wizard.xml", "installer_view.xml", - "account_multi_chart_wizard_view.xml", ], "auto_install": False, "installable": True, diff --git a/addons/l10n_in/account_multi_chart_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py index ea7974dd430..c19997e3f98 100644 --- a/addons/l10n_in/account_multi_chart_wizard.py +++ b/addons/l10n_in/account_multi_chart_wizard.py @@ -21,6 +21,7 @@ import tools from osv import fields, osv from os.path import join as opj +from lxml import etree class account_multi_charts_wizard(osv.osv_memory): _inherit ='wizard.multi.charts.accounts' @@ -32,16 +33,42 @@ class account_multi_charts_wizard(osv.osv_memory): } def execute(self, cr, uid, ids, context=None): - super(account_multi_charts_wizard, self).execute(cr, uid, ids, context) obj_multi = self.browse(cr, uid, ids[0]) - if obj_multi.chart_template_id.name == 'Public Firm Chart of Account': - path = tools.file_open(opj('l10n_in', 'account_sale_tax.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - elif obj_multi.chart_template_id.name == 'Partnership/Private Firm Chart of Account': - path = tools.file_open(opj('l10n_in', 'account_vat.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - - + acc_template_id= self.pool.get('account.chart.template').search(cr, uid, [('name','=',obj_multi.chart_template_id.name)], context=context) + for chart_name in self.pool.get('account.chart.template').browse(cr, uid, acc_template_id,context=context): + if obj_multi.chart_template_id.name == chart_name.name: + if obj_multi.sales_tax == True: + path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_sales_tax.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.vat == True: + path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_vat.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.service_tax == True: + path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_service.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.excise_duty == True: + path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_excise_duty.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + elif obj_multi.chart_template_id.name == chart_name.name: + if obj_multi.sales_tax == True: + path = tools.file_open(opj('l10n_in', 'tax', 'privete_sale_tax.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.vat == True: + path = tools.file_open(opj('l10n_in', 'tax', 'private_vat.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.service_tax == True: + path = tools.file_open(opj('l10n_in', 'tax', 'private_service.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.excise_duty == True: + path = tools.file_open(opj('l10n_in', 'tax', 'private_exice_duty.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + return super(account_multi_charts_wizard, self).execute(cr, uid, ids, context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/account_tax.xml b/addons/l10n_in/account_tax.xml index 5077ec64e6e..90e6264398f 100644 --- a/addons/l10n_in/account_tax.xml +++ b/addons/l10n_in/account_tax.xml @@ -4,16 +4,15 @@ - Sale Central - - 0.12 + PPn (10%)(10.0%) + 0.100000 percent - - - - - - + + + + + + diff --git a/addons/l10n_in/account_tax_code_template.xml b/addons/l10n_in/account_tax_code_template.xml index 55dbf427e86..0677ab6dfa6 100644 --- a/addons/l10n_in/account_tax_code_template.xml +++ b/addons/l10n_in/account_tax_code_template.xml @@ -3,39 +3,39 @@ - + Tax - + Tax Balance to Pay - + - + Tax Due (Tax to pay) - + - + Tax Payable - + - + Tax Bases - + - + Base of Taxed Sales - + - + Base of Taxed Purchases - + diff --git a/addons/l10n_in/l10n_in_partnership_private_chart.xml b/addons/l10n_in/l10n_in_partnership_private_chart.xml index f59aaeb407b..2bda406dbee 100644 --- a/addons/l10n_in/l10n_in_partnership_private_chart.xml +++ b/addons/l10n_in/l10n_in_partnership_private_chart.xml @@ -436,7 +436,7 @@ Partnership/Private Firm Chart of Account - + diff --git a/addons/l10n_in/l10n_in_public_firm_chart.xml b/addons/l10n_in/l10n_in_public_firm_chart.xml index bcc9a3918a4..92cad026926 100644 --- a/addons/l10n_in/l10n_in_public_firm_chart.xml +++ b/addons/l10n_in/l10n_in_public_firm_chart.xml @@ -530,7 +530,7 @@ Public Firm Chart of Account - + diff --git a/addons/l10n_in/tax/private_exice_duty.xml b/addons/l10n_in/tax/private_exice_duty.xml new file mode 100644 index 00000000000..5e8f531c0e1 --- /dev/null +++ b/addons/l10n_in/tax/private_exice_duty.xml @@ -0,0 +1,47 @@ + + + + + + + 10 + Exice Duty(10.30%) + Exice Duty + + 0.10 + percent + sale + + 1 + + 1 + + 1 + + 1 + + + + + + Excise duty(10%)(%2) + Excise duty (%2) + 0.02 + percent + sale + + + + + + Excise duty(10%)(%1) + Excise duty (%1) + 0.01 + percent + sale + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/tax/private_service.xml b/addons/l10n_in/tax/private_service.xml new file mode 100644 index 00000000000..49d5bc3542e --- /dev/null +++ b/addons/l10n_in/tax/private_service.xml @@ -0,0 +1,46 @@ + + + + + + + Service(12%) + Service + + 0.12 + percent + sale + + 1 + + 1 + + 1 + + 1 + + + + + + Service(12%)(%2) + Service (%2) + 0.02 + percent + sale + + + + + + Service(12%)(%1) + Service (%1) + 0.01 + percent + sale + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/tax/private_vat.xml b/addons/l10n_in/tax/private_vat.xml new file mode 100644 index 00000000000..860a499ccde --- /dev/null +++ b/addons/l10n_in/tax/private_vat.xml @@ -0,0 +1,27 @@ + + + + + + + 10 + VAT(12%) + VAT resellers + + 0.15 + percent + sale + + 1 + + 1 + + 1 + + 1 + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/tax/privete_sale_tax.xml b/addons/l10n_in/tax/privete_sale_tax.xml new file mode 100644 index 00000000000..6421180506d --- /dev/null +++ b/addons/l10n_in/tax/privete_sale_tax.xml @@ -0,0 +1,27 @@ + + + + + + + 10 + Sale Central (12%) + Sale Central + + 0.12 + percent + sale + + 1 + + 1 + + 1 + + 1 + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/tax/public_firm_excise_duty.xml b/addons/l10n_in/tax/public_firm_excise_duty.xml new file mode 100644 index 00000000000..6c5185ed560 --- /dev/null +++ b/addons/l10n_in/tax/public_firm_excise_duty.xml @@ -0,0 +1,48 @@ + + + + + + + Excise duty(10%) + Excise duty + + + + 0.10 + percent + sale + + 1 + + 1 + + 1 + + 1 + + + + + + Excise duty(10%)(%2) + Excise duty (%2) + 0.02 + percent + sale + + + + + + Excise duty(10%)(%1) + Excise duty (%1) + 0.01 + percent + sale + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/tax/public_firm_sales_tax.xml b/addons/l10n_in/tax/public_firm_sales_tax.xml new file mode 100644 index 00000000000..05fbd4db5b9 --- /dev/null +++ b/addons/l10n_in/tax/public_firm_sales_tax.xml @@ -0,0 +1,23 @@ + + + + + + + Sale Central (12%) + Sale Central + + + + 0.12 + percent + sale + + + + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/tax/public_firm_service.xml b/addons/l10n_in/tax/public_firm_service.xml new file mode 100644 index 00000000000..58c85cb3f74 --- /dev/null +++ b/addons/l10n_in/tax/public_firm_service.xml @@ -0,0 +1,49 @@ + + + + + + + Service(12%) + Service + + + + 0.12 + percent + sale + + 1 + + 1 + + 1 + + 1 + + + + + + Service(12%)(%2) + Service (%2) + 0.02 + percent + sale + + + + + + Service(12%)(%1) + Service (%1) + 0.01 + percent + sale + + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/tax/public_firm_vat.xml b/addons/l10n_in/tax/public_firm_vat.xml new file mode 100644 index 00000000000..02fe9cf56f4 --- /dev/null +++ b/addons/l10n_in/tax/public_firm_vat.xml @@ -0,0 +1,28 @@ + + + + + + + VAT(12%) + VAT + + + + 0.15 + percent + sale + + 1 + + 1 + + 1 + + 1 + + + + + + \ No newline at end of file From 9ee1727eb7c65267726a82337be81cc10b73d0a9 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Fri, 18 May 2012 10:29:17 +0530 Subject: [PATCH 015/591] [IMP] l10n_in: improve code for tax account bzr revid: jap@tinyerp.com-20120518045917-rv2mgpo2tlel5fm2 --- addons/l10n_in/account_multi_chart_wizard.py | 79 +++++++++---------- addons/l10n_in/tax/private_exice_duty.xml | 28 ++++++- addons/l10n_in/tax/private_service.xml | 21 ++++- addons/l10n_in/tax/private_vat.xml | 20 +++++ addons/l10n_in/tax/privete_sale_tax.xml | 20 +++++ .../l10n_in/tax/public_firm_excise_duty.xml | 22 +++++- addons/l10n_in/tax/public_firm_sales_tax.xml | 22 +++++- addons/l10n_in/tax/public_firm_service.xml | 22 +++++- addons/l10n_in/tax/public_firm_vat.xml | 22 +++++- 9 files changed, 203 insertions(+), 53 deletions(-) diff --git a/addons/l10n_in/account_multi_chart_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py index c19997e3f98..ae2b48055d2 100644 --- a/addons/l10n_in/account_multi_chart_wizard.py +++ b/addons/l10n_in/account_multi_chart_wizard.py @@ -26,49 +26,48 @@ from lxml import etree class account_multi_charts_wizard(osv.osv_memory): _inherit ='wizard.multi.charts.accounts' _columns = { - 'sales_tax': fields.boolean('Sales tax central'), - 'vat': fields.boolean('VAT resellers'), - 'service_tax': fields.boolean('Service tax'), - 'excise_duty': fields.boolean('Excise duty'), + 'sales_tax': fields.boolean('Sales tax central', help='If this field is true it allows you use Sales Tax'), + 'vat': fields.boolean('VAT resellers',help='If this field is true it allows you use VAT'), + 'service_tax': fields.boolean('Service tax', help='If this field is true it allows you use Service tax'), + 'excise_duty': fields.boolean('Excise duty', help='If this field is true it allows you use Excise duty'), } def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) - acc_template_id= self.pool.get('account.chart.template').search(cr, uid, [('name','=',obj_multi.chart_template_id.name)], context=context) - for chart_name in self.pool.get('account.chart.template').browse(cr, uid, acc_template_id,context=context): - if obj_multi.chart_template_id.name == chart_name.name: - if obj_multi.sales_tax == True: - path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_sales_tax.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if obj_multi.vat == True: - path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_vat.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if obj_multi.service_tax == True: - path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_service.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if obj_multi.excise_duty == True: - path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_excise_duty.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - elif obj_multi.chart_template_id.name == chart_name.name: - if obj_multi.sales_tax == True: - path = tools.file_open(opj('l10n_in', 'tax', 'privete_sale_tax.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if obj_multi.vat == True: - path = tools.file_open(opj('l10n_in', 'tax', 'private_vat.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if obj_multi.service_tax == True: - path = tools.file_open(opj('l10n_in', 'tax', 'private_service.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if obj_multi.excise_duty == True: - path = tools.file_open(opj('l10n_in', 'tax', 'private_exice_duty.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() + if obj_multi.chart_template_id.name == 'Public Firm Chart of Account': + if obj_multi.sales_tax == True: + path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_sales_tax.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.vat == True: + path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_vat.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.service_tax == True: + path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_service.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.excise_duty == True: + path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_excise_duty.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + elif obj_multi.chart_template_id.name == 'Partnership/Private Firm Chart of Account': + if obj_multi.sales_tax == True: + path = tools.file_open(opj('l10n_in', 'tax', 'privete_sale_tax.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.vat == True: + path = tools.file_open(opj('l10n_in', 'tax', 'private_vat.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.service_tax == True: + path = tools.file_open(opj('l10n_in', 'tax', 'private_service.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() + if obj_multi.excise_duty == True: + path = tools.file_open(opj('l10n_in', 'tax', 'private_exice_duty.xml')) + tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) + path.close() return super(account_multi_charts_wizard, self).execute(cr, uid, ids, context) + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/tax/private_exice_duty.xml b/addons/l10n_in/tax/private_exice_duty.xml index 5e8f531c0e1..8ea3a972fdf 100644 --- a/addons/l10n_in/tax/private_exice_duty.xml +++ b/addons/l10n_in/tax/private_exice_duty.xml @@ -3,14 +3,34 @@ - + + Exice Duty Receivable + 128 + receivable + + + + + + + Exice Duty Payable + 219 + payable + + + + + + 10 Exice Duty(10.30%) Exice Duty 0.10 percent - sale + all + + 1 @@ -29,7 +49,7 @@ 0.02 percent sale - + @@ -39,7 +59,7 @@ 0.01 percent sale - + diff --git a/addons/l10n_in/tax/private_service.xml b/addons/l10n_in/tax/private_service.xml index 49d5bc3542e..0bb8352096d 100644 --- a/addons/l10n_in/tax/private_service.xml +++ b/addons/l10n_in/tax/private_service.xml @@ -3,13 +3,32 @@ + + Service Tax Receivable + 126 + receivable + + + + + + + Service Tax Payable + 218 + payable + + + + + Service(12%) Service 0.12 percent - sale + + 1 diff --git a/addons/l10n_in/tax/private_vat.xml b/addons/l10n_in/tax/private_vat.xml index 860a499ccde..559115ccc78 100644 --- a/addons/l10n_in/tax/private_vat.xml +++ b/addons/l10n_in/tax/private_vat.xml @@ -3,6 +3,24 @@ + + VAT Receivable + 124 + receivable + + + + + + + VAT Payable + 217 + payable + + + + + 10 VAT(12%) @@ -11,6 +29,8 @@ 0.15 percent sale + + 1 diff --git a/addons/l10n_in/tax/privete_sale_tax.xml b/addons/l10n_in/tax/privete_sale_tax.xml index 6421180506d..2565f2a9e83 100644 --- a/addons/l10n_in/tax/privete_sale_tax.xml +++ b/addons/l10n_in/tax/privete_sale_tax.xml @@ -3,6 +3,24 @@ + + Sales Tax Receivable + 122 + receivable + + + + + + + Sales Tax Payable + 216 + payable + + + + + 10 Sale Central (12%) @@ -11,6 +29,8 @@ 0.12 percent sale + + 1 diff --git a/addons/l10n_in/tax/public_firm_excise_duty.xml b/addons/l10n_in/tax/public_firm_excise_duty.xml index 6c5185ed560..7a78037bcaa 100644 --- a/addons/l10n_in/tax/public_firm_excise_duty.xml +++ b/addons/l10n_in/tax/public_firm_excise_duty.xml @@ -3,11 +3,29 @@ + + Exice Duty Receivable + 158000 + receivable + + + + + + + Exice Duty Payable + 24900 + payable + + + + + Excise duty(10%) Excise duty - - + + 0.10 percent diff --git a/addons/l10n_in/tax/public_firm_sales_tax.xml b/addons/l10n_in/tax/public_firm_sales_tax.xml index 05fbd4db5b9..f0240de33fe 100644 --- a/addons/l10n_in/tax/public_firm_sales_tax.xml +++ b/addons/l10n_in/tax/public_firm_sales_tax.xml @@ -3,11 +3,29 @@ + + Sales Tax Receivable + 154000 + receivable + + + + + + + Sales Tax Payable + 24600 + payable + + + + + Sale Central (12%) Sale Central - - + + 0.12 percent diff --git a/addons/l10n_in/tax/public_firm_service.xml b/addons/l10n_in/tax/public_firm_service.xml index 58c85cb3f74..f4ef12defa2 100644 --- a/addons/l10n_in/tax/public_firm_service.xml +++ b/addons/l10n_in/tax/public_firm_service.xml @@ -3,11 +3,29 @@ + + Service Tax Receivable + 156000 + receivable + + + + + + + Service Tax Payable + 24700 + payable + + + + + Service(12%) Service - - + + 0.12 percent diff --git a/addons/l10n_in/tax/public_firm_vat.xml b/addons/l10n_in/tax/public_firm_vat.xml index 02fe9cf56f4..29fd2f3f9ca 100644 --- a/addons/l10n_in/tax/public_firm_vat.xml +++ b/addons/l10n_in/tax/public_firm_vat.xml @@ -3,11 +3,29 @@ + + VAT Receivable + 157000 + receivable + + + + + + + VAT Payable + 24800 + payable + + + + + VAT(12%) VAT - - + + 0.15 percent From 87f1f877c341752f11196157ebef30f5225d370b Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Fri, 18 May 2012 17:24:21 +0530 Subject: [PATCH 016/591] [IMP] l10n_in: improve code in xml bzr revid: jap@tinyerp.com-20120518115421-z8uejo5jfbtjc03g --- .../l10n_in_partnership_private_chart.xml | 4 +- addons/l10n_in/tax/private_exice_duty.xml | 2 +- addons/l10n_in/tax/private_service.xml | 5 +- addons/l10n_in/tax/private_vat.xml | 70 +++++++++++++++++-- addons/l10n_in/tax/privete_sale_tax.xml | 22 +++++- addons/l10n_in/tax/public_firm_sales_tax.xml | 18 ++++- addons/l10n_in/tax/public_firm_service.xml | 6 +- addons/l10n_in/tax/public_firm_vat.xml | 70 +++++++++++++++++-- 8 files changed, 179 insertions(+), 18 deletions(-) diff --git a/addons/l10n_in/l10n_in_partnership_private_chart.xml b/addons/l10n_in/l10n_in_partnership_private_chart.xml index 2bda406dbee..06d046d320c 100644 --- a/addons/l10n_in/l10n_in_partnership_private_chart.xml +++ b/addons/l10n_in/l10n_in_partnership_private_chart.xml @@ -215,7 +215,7 @@ - + diff --git a/addons/l10n_in/tax/private_exice_duty.xml b/addons/l10n_in/tax/private_exice_duty.xml index 8ea3a972fdf..0127d2bd444 100644 --- a/addons/l10n_in/tax/private_exice_duty.xml +++ b/addons/l10n_in/tax/private_exice_duty.xml @@ -28,7 +28,7 @@ 0.10 percent - all + sale diff --git a/addons/l10n_in/tax/private_service.xml b/addons/l10n_in/tax/private_service.xml index 0bb8352096d..ff049c31f21 100644 --- a/addons/l10n_in/tax/private_service.xml +++ b/addons/l10n_in/tax/private_service.xml @@ -22,6 +22,7 @@ + all Service(12%) Service @@ -46,7 +47,7 @@ Service (%2) 0.02 percent - sale + all @@ -56,7 +57,7 @@ Service (%1) 0.01 percent - sale + all diff --git a/addons/l10n_in/tax/private_vat.xml b/addons/l10n_in/tax/private_vat.xml index 559115ccc78..c91a9fe657a 100644 --- a/addons/l10n_in/tax/private_vat.xml +++ b/addons/l10n_in/tax/private_vat.xml @@ -22,13 +22,12 @@ - 10 - VAT(12%) + VAT(%4) VAT resellers - 0.15 + 0.04 percent - sale + all @@ -43,5 +42,68 @@ + + VAT(4%)(%1) + VAT (%1) + 0.01 + percent + all + + + + + + VAT(12.5%) + VAT (12.5%) + + 0.125 + percent + all + + + + 1 + + 1 + + 1 + + 1 + + + + + + VAT(12.5%)(%2.5) + VAT (%2.5) + 0.025 + percent + sale + + + + + + VAT(8%) + VAT (8%) + + 0.8 + percent + all + + + + 1 + + 1 + + 1 + + 1 + + + + + \ No newline at end of file diff --git a/addons/l10n_in/tax/privete_sale_tax.xml b/addons/l10n_in/tax/privete_sale_tax.xml index 2565f2a9e83..424126aec29 100644 --- a/addons/l10n_in/tax/privete_sale_tax.xml +++ b/addons/l10n_in/tax/privete_sale_tax.xml @@ -21,8 +21,28 @@ + + Sale Central (15%) + Sale Central + + 0.15 + percent + sale + + + + 1 + + 1 + + 1 + + 1 + + + + - 10 Sale Central (12%) Sale Central diff --git a/addons/l10n_in/tax/public_firm_sales_tax.xml b/addons/l10n_in/tax/public_firm_sales_tax.xml index f0240de33fe..fbc92ca9049 100644 --- a/addons/l10n_in/tax/public_firm_sales_tax.xml +++ b/addons/l10n_in/tax/public_firm_sales_tax.xml @@ -22,6 +22,22 @@ + Sale Central (15%) + Sale Central + + + + 0.15 + percent + sale + + + + + + + + Sale Central (12%) Sale Central @@ -35,7 +51,7 @@ - + \ No newline at end of file diff --git a/addons/l10n_in/tax/public_firm_service.xml b/addons/l10n_in/tax/public_firm_service.xml index f4ef12defa2..d78000ca5d5 100644 --- a/addons/l10n_in/tax/public_firm_service.xml +++ b/addons/l10n_in/tax/public_firm_service.xml @@ -29,7 +29,7 @@ 0.12 percent - sale + all 1 @@ -47,7 +47,7 @@ Service (%2) 0.02 percent - sale + all @@ -57,7 +57,7 @@ Service (%1) 0.01 percent - sale + all diff --git a/addons/l10n_in/tax/public_firm_vat.xml b/addons/l10n_in/tax/public_firm_vat.xml index 29fd2f3f9ca..53d3f1efc5a 100644 --- a/addons/l10n_in/tax/public_firm_vat.xml +++ b/addons/l10n_in/tax/public_firm_vat.xml @@ -22,14 +22,45 @@ - VAT(12%) - VAT + VAT(%4) + VAT(%4) - 0.15 + 0.04 percent - sale + all + + 1 + + 1 + + 1 + + 1 + + + + + + VAT(4%)(%1) + VAT (%1) + 0.01 + percent + all + + + + + + VAT(12.5%) + VAT (12.5%) + + + + 0.125 + percent + all 1 @@ -41,6 +72,37 @@ + + + VAT(12.5%)(%2.5) + VAT(12.5%)(%2.5) + 0.025 + percent + all + + + + + + VAT(8%) + VAT(8%) + + + + 0.08 + percent + all + + 1 + + 1 + + 1 + + 1 + + + \ No newline at end of file From b4676557b420d113490d704741e6550ea5ace2f0 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Mon, 21 May 2012 15:41:04 +0530 Subject: [PATCH 017/591] [IMP] l10n_in: improve code for different tax name bzr revid: jap@tinyerp.com-20120521101104-vdbovr1c37f1fye1 --- addons/l10n_in/account_multi_chart_wizard.py | 2 ++ .../l10n_in_partnership_private_chart.xml | 3 +-- addons/l10n_in/l10n_in_public_firm_chart.xml | 1 - addons/l10n_in/tax/private_exice_duty.xml | 16 +++++++------ addons/l10n_in/tax/private_service.xml | 10 ++++---- addons/l10n_in/tax/private_vat.xml | 23 ++++++++++--------- addons/l10n_in/tax/privete_sale_tax.xml | 14 +++++------ .../l10n_in/tax/public_firm_excise_duty.xml | 10 ++++---- addons/l10n_in/tax/public_firm_sales_tax.xml | 10 ++++---- addons/l10n_in/tax/public_firm_service.xml | 6 ++--- addons/l10n_in/tax/public_firm_vat.xml | 22 +++++++++--------- 11 files changed, 60 insertions(+), 57 deletions(-) diff --git a/addons/l10n_in/account_multi_chart_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py index ae2b48055d2..f530cd44b62 100644 --- a/addons/l10n_in/account_multi_chart_wizard.py +++ b/addons/l10n_in/account_multi_chart_wizard.py @@ -69,5 +69,7 @@ class account_multi_charts_wizard(osv.osv_memory): tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() return super(account_multi_charts_wizard, self).execute(cr, uid, ids, context) + +account_multi_charts_wizard() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/l10n_in_partnership_private_chart.xml b/addons/l10n_in/l10n_in_partnership_private_chart.xml index 06d046d320c..d77ed6424fd 100644 --- a/addons/l10n_in/l10n_in_partnership_private_chart.xml +++ b/addons/l10n_in/l10n_in_partnership_private_chart.xml @@ -442,8 +442,7 @@ - - + diff --git a/addons/l10n_in/l10n_in_public_firm_chart.xml b/addons/l10n_in/l10n_in_public_firm_chart.xml index 92cad026926..f3a9c4d7c6e 100644 --- a/addons/l10n_in/l10n_in_public_firm_chart.xml +++ b/addons/l10n_in/l10n_in_public_firm_chart.xml @@ -537,7 +537,6 @@ - diff --git a/addons/l10n_in/tax/private_exice_duty.xml b/addons/l10n_in/tax/private_exice_duty.xml index 0127d2bd444..825bb4afab0 100644 --- a/addons/l10n_in/tax/private_exice_duty.xml +++ b/addons/l10n_in/tax/private_exice_duty.xml @@ -22,10 +22,10 @@ - 10 - Exice Duty(10.30%) + Exice Duty - 10.30% + 10 Exice Duty - + 0.10 percent sale @@ -44,8 +44,9 @@ - Excise duty(10%)(%2) - Excise duty (%2) + 11 + Excise duty -10% -%2 + Excise duty - 2% 0.02 percent sale @@ -54,8 +55,9 @@ - Excise duty(10%)(%1) - Excise duty (%1) + 11 + Excise duty - 10% - %1 + Excise duty - 1% 0.01 percent sale diff --git a/addons/l10n_in/tax/private_service.xml b/addons/l10n_in/tax/private_service.xml index ff049c31f21..f5566a5dce1 100644 --- a/addons/l10n_in/tax/private_service.xml +++ b/addons/l10n_in/tax/private_service.xml @@ -23,7 +23,7 @@ all - Service(12%) + Service - 12% Service 0.12 @@ -43,8 +43,8 @@ - Service(12%)(%2) - Service (%2) + Service - 12% - %2 + Service - 2% 0.02 percent all @@ -53,8 +53,8 @@ - Service(12%)(%1) - Service (%1) + Service - 12% - 1% + Service - 1% 0.01 percent all diff --git a/addons/l10n_in/tax/private_vat.xml b/addons/l10n_in/tax/private_vat.xml index c91a9fe657a..a025e72310c 100644 --- a/addons/l10n_in/tax/private_vat.xml +++ b/addons/l10n_in/tax/private_vat.xml @@ -22,9 +22,10 @@ - VAT(%4) + 30 + VAT - 4% VAT resellers - + 0.04 percent all @@ -43,8 +44,8 @@ - VAT(4%)(%1) - VAT (%1) + VAT - 4% - %1 + VAT - %1 0.01 percent all @@ -53,9 +54,9 @@ - VAT(12.5%) - VAT (12.5%) - + VAT - 12.5% + VAT - 12.5% + 0.125 percent all @@ -74,7 +75,7 @@ - VAT(12.5%)(%2.5) + VAT - 12.5%- %2.5 VAT (%2.5) 0.025 percent @@ -84,8 +85,8 @@ - VAT(8%) - VAT (8%) + VAT - 8% + VAT - 8% 0.8 percent @@ -100,7 +101,7 @@ 1 1 - + diff --git a/addons/l10n_in/tax/privete_sale_tax.xml b/addons/l10n_in/tax/privete_sale_tax.xml index 424126aec29..5d741879798 100644 --- a/addons/l10n_in/tax/privete_sale_tax.xml +++ b/addons/l10n_in/tax/privete_sale_tax.xml @@ -20,10 +20,10 @@ - + - Sale Central (15%) - Sale Central + Sale Tax - 15% + Sale Tax - 15% 0.15 percent @@ -38,13 +38,13 @@ 1 1 - + - Sale Central (12%) - Sale Central + Sale Tax -12% + Sale Tax - 12% 0.12 percent @@ -59,7 +59,7 @@ 1 1 - + diff --git a/addons/l10n_in/tax/public_firm_excise_duty.xml b/addons/l10n_in/tax/public_firm_excise_duty.xml index 7a78037bcaa..e8f010da3ac 100644 --- a/addons/l10n_in/tax/public_firm_excise_duty.xml +++ b/addons/l10n_in/tax/public_firm_excise_duty.xml @@ -22,7 +22,7 @@ - Excise duty(10%) + Excise duty - 10% Excise duty @@ -43,8 +43,8 @@ - Excise duty(10%)(%2) - Excise duty (%2) + Excise duty - 10% - 2% + Excise duty - %2 0.02 percent sale @@ -53,8 +53,8 @@ - Excise duty(10%)(%1) - Excise duty (%1) + Excise duty - 10% - 1% + Excise duty - 1% 0.01 percent sale diff --git a/addons/l10n_in/tax/public_firm_sales_tax.xml b/addons/l10n_in/tax/public_firm_sales_tax.xml index fbc92ca9049..3d805a4a049 100644 --- a/addons/l10n_in/tax/public_firm_sales_tax.xml +++ b/addons/l10n_in/tax/public_firm_sales_tax.xml @@ -22,8 +22,8 @@ - Sale Central (15%) - Sale Central + Sale Tax - 15% + Sale Tax - 15% @@ -38,8 +38,8 @@ - Sale Central (12%) - Sale Central + Sale Tax - 12% + Sale Tax - 12% @@ -51,7 +51,7 @@ - + \ No newline at end of file diff --git a/addons/l10n_in/tax/public_firm_service.xml b/addons/l10n_in/tax/public_firm_service.xml index d78000ca5d5..dcfc7cd343e 100644 --- a/addons/l10n_in/tax/public_firm_service.xml +++ b/addons/l10n_in/tax/public_firm_service.xml @@ -22,7 +22,7 @@ - Service(12%) + Service - 12% Service @@ -43,7 +43,7 @@ - Service(12%)(%2) + Service - 12% - 2% Service (%2) 0.02 percent @@ -53,7 +53,7 @@ - Service(12%)(%1) + Service - 12% - 1% Service (%1) 0.01 percent diff --git a/addons/l10n_in/tax/public_firm_vat.xml b/addons/l10n_in/tax/public_firm_vat.xml index 53d3f1efc5a..3fb5eea8dcc 100644 --- a/addons/l10n_in/tax/public_firm_vat.xml +++ b/addons/l10n_in/tax/public_firm_vat.xml @@ -22,11 +22,11 @@ - VAT(%4) - VAT(%4) + VAT - 4% + VAT - 4% - + 0.04 percent all @@ -43,8 +43,8 @@ - VAT(4%)(%1) - VAT (%1) + VAT - 4% -1% + VAT - 1% 0.01 percent all @@ -53,8 +53,8 @@ - VAT(12.5%) - VAT (12.5%) + VAT - 12.5% + VAT - 12.5% @@ -74,8 +74,8 @@ - VAT(12.5%)(%2.5) - VAT(12.5%)(%2.5) + VAT - 12.5% - %2.5 + VAT - 12.5% - %2.5 0.025 percent all @@ -84,8 +84,8 @@ - VAT(8%) - VAT(8%) + VAT - 8% + VAT - 8% From 2808efa6fd74890e15f1bdbafb1443b3be871d8c Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Tue, 22 May 2012 18:51:19 +0530 Subject: [PATCH 018/591] [IMP] l10n_in: improve code in account_multi_chart_wizard_view.py add new onchange method bzr revid: jap@tinyerp.com-20120522132119-0mwnk1ue8r2ct7q0 --- addons/l10n_in/account_multi_chart_wizard.py | 24 ++++++++++++++++--- .../account_multi_chart_wizard_view.xml | 9 +++---- addons/l10n_in/tax/public_firm_sales_tax.xml | 2 +- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/addons/l10n_in/account_multi_chart_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py index f530cd44b62..784a7b748ca 100644 --- a/addons/l10n_in/account_multi_chart_wizard.py +++ b/addons/l10n_in/account_multi_chart_wizard.py @@ -30,19 +30,37 @@ class account_multi_charts_wizard(osv.osv_memory): 'vat': fields.boolean('VAT resellers',help='If this field is true it allows you use VAT'), 'service_tax': fields.boolean('Service tax', help='If this field is true it allows you use Service tax'), 'excise_duty': fields.boolean('Excise duty', help='If this field is true it allows you use Excise duty'), + 'is_indian_chart': fields.boolean('Flag') } + def onchange_chart_template_id(self, cr, uid, ids, chart_template_id=False, context=None): + res = super(account_multi_charts_wizard, self).onchange_chart_template_id(cr, uid, ids, chart_template_id, context) + tax_templ_obj = self.pool.get('account.tax.template') + res['value'] = {'complete_tax_set': False, 'sale_tax': False, 'purchase_tax': False} + data = self.pool.get('account.chart.template').browse(cr, uid, chart_template_id, context=context) + if data.name in ('Public Firm Chart of Account','Partnership/Private Firm Chart of Account'): + res.update({'value': {'is_indian_chart': True}}) + else: + res.update({'value': {'is_indian_chart': False}}) + if data.complete_tax_set: + sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" + , "=", chart_template_id), ('type_tax_use', 'in', ('sale','all'))], order="sequence, id desc") + purchase_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" + , "=", chart_template_id), ('type_tax_use', 'in', ('purchase','all'))], order="sequence, id desc") + res['value'].update({'sale_tax': sale_tax_ids and sale_tax_ids[0] or False, 'purchase_tax': purchase_tax_ids and purchase_tax_ids[0] or False}) + return res + def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) if obj_multi.chart_template_id.name == 'Public Firm Chart of Account': if obj_multi.sales_tax == True: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_sales_tax.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() + path.close() if obj_multi.vat == True: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_vat.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() + path.close() if obj_multi.service_tax == True: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_service.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) @@ -67,7 +85,7 @@ class account_multi_charts_wizard(osv.osv_memory): if obj_multi.excise_duty == True: path = tools.file_open(opj('l10n_in', 'tax', 'private_exice_duty.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() + path.close() return super(account_multi_charts_wizard, self).execute(cr, uid, ids, context) account_multi_charts_wizard() diff --git a/addons/l10n_in/account_multi_chart_wizard_view.xml b/addons/l10n_in/account_multi_chart_wizard_view.xml index 449b3af70b9..63ef1ccc94c 100644 --- a/addons/l10n_in/account_multi_chart_wizard_view.xml +++ b/addons/l10n_in/account_multi_chart_wizard_view.xml @@ -10,10 +10,11 @@ - - - - + + + + + diff --git a/addons/l10n_in/tax/public_firm_sales_tax.xml b/addons/l10n_in/tax/public_firm_sales_tax.xml index 3d805a4a049..d88c1370368 100644 --- a/addons/l10n_in/tax/public_firm_sales_tax.xml +++ b/addons/l10n_in/tax/public_firm_sales_tax.xml @@ -20,7 +20,7 @@ - + Sale Tax - 15% Sale Tax - 15% From 2ae3cb623e2a5d9c061f3ee2397f1d68eb1db442 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Wed, 23 May 2012 17:34:55 +0530 Subject: [PATCH 019/591] [IMP] l10n_in: Remove the receivable accounts from tax, change template name, add new account product sale and improve code bzr revid: jap@tinyerp.com-20120523120455-197vc5xqni5atdcp --- addons/l10n_in/account_multi_chart_wizard.py | 51 +++++++++---------- .../account_multi_chart_wizard_view.xml | 2 +- addons/l10n_in/installer.py | 5 +- .../l10n_in_partnership_private_chart.xml | 17 +++++-- addons/l10n_in/l10n_in_public_firm_chart.xml | 4 +- addons/l10n_in/tax/private_exice_duty.xml | 11 +--- addons/l10n_in/tax/private_service.xml | 11 +--- addons/l10n_in/tax/private_vat.xml | 17 ++----- addons/l10n_in/tax/privete_sale_tax.xml | 13 +---- .../l10n_in/tax/public_firm_excise_duty.xml | 11 +--- addons/l10n_in/tax/public_firm_sales_tax.xml | 13 +---- addons/l10n_in/tax/public_firm_service.xml | 11 +--- addons/l10n_in/tax/public_firm_vat.xml | 15 ++---- 13 files changed, 58 insertions(+), 123 deletions(-) diff --git a/addons/l10n_in/account_multi_chart_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py index 784a7b748ca..4fbe1fa2cc5 100644 --- a/addons/l10n_in/account_multi_chart_wizard.py +++ b/addons/l10n_in/account_multi_chart_wizard.py @@ -18,18 +18,19 @@ # along with this program. If not, see . # ############################################################################## -import tools +from lxml import etree from osv import fields, osv from os.path import join as opj -from lxml import etree +import tools + class account_multi_charts_wizard(osv.osv_memory): _inherit ='wizard.multi.charts.accounts' _columns = { - 'sales_tax': fields.boolean('Sales tax central', help='If this field is true it allows you use Sales Tax'), - 'vat': fields.boolean('VAT resellers',help='If this field is true it allows you use VAT'), - 'service_tax': fields.boolean('Service tax', help='If this field is true it allows you use Service tax'), - 'excise_duty': fields.boolean('Excise duty', help='If this field is true it allows you use Excise duty'), + 'sales_tax': fields.boolean('Sales Tax', help='If this field is true it allows you use Sales Tax'), + 'vat': fields.boolean('VAT',help='If this field is true it allows you use VAT'), + 'service_tax': fields.boolean('Service Tax', help='If this field is true it allows you use Service tax'), + 'excise_duty': fields.boolean('Excise Duty', help='If this field is true it allows you use Excise duty'), 'is_indian_chart': fields.boolean('Flag') } @@ -38,51 +39,49 @@ class account_multi_charts_wizard(osv.osv_memory): tax_templ_obj = self.pool.get('account.tax.template') res['value'] = {'complete_tax_set': False, 'sale_tax': False, 'purchase_tax': False} data = self.pool.get('account.chart.template').browse(cr, uid, chart_template_id, context=context) - if data.name in ('Public Firm Chart of Account','Partnership/Private Firm Chart of Account'): - res.update({'value': {'is_indian_chart': True}}) - else: - res.update({'value': {'is_indian_chart': False}}) - if data.complete_tax_set: - sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" - , "=", chart_template_id), ('type_tax_use', 'in', ('sale','all'))], order="sequence, id desc") - purchase_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" - , "=", chart_template_id), ('type_tax_use', 'in', ('purchase','all'))], order="sequence, id desc") - res['value'].update({'sale_tax': sale_tax_ids and sale_tax_ids[0] or False, 'purchase_tax': purchase_tax_ids and purchase_tax_ids[0] or False}) + if data.name in ('India - Chart of Accounts for Public Firm','India - Chart of Accounts for Partnership/Private Firm'): + res['value'].update({'is_indian_chart': True}) + else: + res['value'].update({'is_indian_chart': False}) + if data.name == 'India - Chart of Accounts for Public Firm': + res['value'].update({'sales_tax': True,'vat':True, 'service_tax':True, 'excise_duty': True}) + elif data.name == 'India - Chart of Accounts for Partnership/Private Firm': + res['value'].update({'sales_tax': True,'vat':True}) return res def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) - if obj_multi.chart_template_id.name == 'Public Firm Chart of Account': - if obj_multi.sales_tax == True: + if obj_multi.chart_template_id.name == 'India - Chart of Accounts for Public Firm': + if obj_multi.sales_tax: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_sales_tax.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.vat == True: + if obj_multi.vat: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_vat.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.service_tax == True: + if obj_multi.service_tax: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_service.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.excise_duty == True: + if obj_multi.excise_duty: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_excise_duty.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - elif obj_multi.chart_template_id.name == 'Partnership/Private Firm Chart of Account': - if obj_multi.sales_tax == True: + elif obj_multi.chart_template_id.name == 'India - Chart of Accounts for Partnership/Private Firm': + if obj_multi.sales_tax: path = tools.file_open(opj('l10n_in', 'tax', 'privete_sale_tax.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.vat == True: + if obj_multi.vat: path = tools.file_open(opj('l10n_in', 'tax', 'private_vat.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.service_tax == True: + if obj_multi.service_tax: path = tools.file_open(opj('l10n_in', 'tax', 'private_service.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.excise_duty == True: + if obj_multi.excise_duty: path = tools.file_open(opj('l10n_in', 'tax', 'private_exice_duty.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() diff --git a/addons/l10n_in/account_multi_chart_wizard_view.xml b/addons/l10n_in/account_multi_chart_wizard_view.xml index 63ef1ccc94c..4851392748f 100644 --- a/addons/l10n_in/account_multi_chart_wizard_view.xml +++ b/addons/l10n_in/account_multi_chart_wizard_view.xml @@ -8,7 +8,7 @@ form - + diff --git a/addons/l10n_in/installer.py b/addons/l10n_in/installer.py index 1b57127d35c..b189a061da4 100644 --- a/addons/l10n_in/installer.py +++ b/addons/l10n_in/installer.py @@ -18,17 +18,16 @@ # along with this program. If not, see . # ############################################################################## - from osv import fields, osv +from os.path import join as opj import netsvc import tools -from os.path import join as opj class l10n_installer(osv.osv_memory): _inherit = 'account.installer' _columns = { 'company_type':fields.selection([('partnership_private_company', 'Partnership/Private Firm'), - ('public_company', 'Public Company')], 'Company Type'), + ('public_company', 'Public Firm')], 'Company Type', required=True), } _defaults = { diff --git a/addons/l10n_in/l10n_in_partnership_private_chart.xml b/addons/l10n_in/l10n_in_partnership_private_chart.xml index d77ed6424fd..f5185d85426 100644 --- a/addons/l10n_in/l10n_in_partnership_private_chart.xml +++ b/addons/l10n_in/l10n_in_partnership_private_chart.xml @@ -238,7 +238,7 @@ - Profit And Loss Account + Profit And Loss 3 view @@ -277,8 +277,17 @@ Amounts earned from providing services to clients, either for cash or on credit. When a service is provided on credit, both this account and Accounts Receivable will increase. When a service is provided for immediate cash, both this account and Cash will increase. - + + + Product Sales + 311 + other + + + + Sales of product account + Non-Operating Revenue and Gains @@ -301,7 +310,7 @@ Gain on Sale of Assets - 910 + 811 other @@ -434,7 +443,7 @@ - Partnership/Private Firm Chart of Account + India - Chart of Accounts for Partnership/Private Firm diff --git a/addons/l10n_in/l10n_in_public_firm_chart.xml b/addons/l10n_in/l10n_in_public_firm_chart.xml index f3a9c4d7c6e..8e84d9b8d79 100644 --- a/addons/l10n_in/l10n_in_public_firm_chart.xml +++ b/addons/l10n_in/l10n_in_public_firm_chart.xml @@ -266,7 +266,7 @@ - Profit And Loss Account + Profit And Loss 3 view @@ -528,7 +528,7 @@ - Public Firm Chart of Account + India - Chart of Accounts for Public Firm diff --git a/addons/l10n_in/tax/private_exice_duty.xml b/addons/l10n_in/tax/private_exice_duty.xml index 825bb4afab0..568d480eb86 100644 --- a/addons/l10n_in/tax/private_exice_duty.xml +++ b/addons/l10n_in/tax/private_exice_duty.xml @@ -3,15 +3,6 @@ - - Exice Duty Receivable - 128 - receivable - - - - - Exice Duty Payable 219 @@ -29,7 +20,7 @@ 0.10 percent sale - + 1 diff --git a/addons/l10n_in/tax/private_service.xml b/addons/l10n_in/tax/private_service.xml index f5566a5dce1..1ce8cbfe74c 100644 --- a/addons/l10n_in/tax/private_service.xml +++ b/addons/l10n_in/tax/private_service.xml @@ -3,15 +3,6 @@ - - Service Tax Receivable - 126 - receivable - - - - - Service Tax Payable 218 @@ -28,7 +19,7 @@ 0.12 percent - + 1 diff --git a/addons/l10n_in/tax/private_vat.xml b/addons/l10n_in/tax/private_vat.xml index a025e72310c..d717201b577 100644 --- a/addons/l10n_in/tax/private_vat.xml +++ b/addons/l10n_in/tax/private_vat.xml @@ -3,15 +3,6 @@ - - VAT Receivable - 124 - receivable - - - - - VAT Payable 217 @@ -24,12 +15,12 @@ 30 VAT - 4% - VAT resellers + VAT 0.04 percent all - + 1 @@ -60,7 +51,7 @@ 0.125 percent all - + 1 @@ -91,7 +82,7 @@ 0.8 percent all - + 1 diff --git a/addons/l10n_in/tax/privete_sale_tax.xml b/addons/l10n_in/tax/privete_sale_tax.xml index 5d741879798..dc89d3d3fee 100644 --- a/addons/l10n_in/tax/privete_sale_tax.xml +++ b/addons/l10n_in/tax/privete_sale_tax.xml @@ -3,15 +3,6 @@ - - Sales Tax Receivable - 122 - receivable - - - - - Sales Tax Payable 216 @@ -28,7 +19,7 @@ 0.15 percent sale - + 1 @@ -49,7 +40,7 @@ 0.12 percent sale - + 1 diff --git a/addons/l10n_in/tax/public_firm_excise_duty.xml b/addons/l10n_in/tax/public_firm_excise_duty.xml index e8f010da3ac..031c92307fd 100644 --- a/addons/l10n_in/tax/public_firm_excise_duty.xml +++ b/addons/l10n_in/tax/public_firm_excise_duty.xml @@ -3,15 +3,6 @@ - - Exice Duty Receivable - 158000 - receivable - - - - - Exice Duty Payable 24900 @@ -24,7 +15,7 @@ Excise duty - 10% Excise duty - + 0.10 diff --git a/addons/l10n_in/tax/public_firm_sales_tax.xml b/addons/l10n_in/tax/public_firm_sales_tax.xml index d88c1370368..27d768aba7a 100644 --- a/addons/l10n_in/tax/public_firm_sales_tax.xml +++ b/addons/l10n_in/tax/public_firm_sales_tax.xml @@ -3,15 +3,6 @@ - - Sales Tax Receivable - 154000 - receivable - - - - - Sales Tax Payable 24600 @@ -24,7 +15,7 @@ Sale Tax - 15% Sale Tax - 15% - + 0.15 @@ -40,7 +31,7 @@ Sale Tax - 12% Sale Tax - 12% - + 0.12 diff --git a/addons/l10n_in/tax/public_firm_service.xml b/addons/l10n_in/tax/public_firm_service.xml index dcfc7cd343e..f57eee6796b 100644 --- a/addons/l10n_in/tax/public_firm_service.xml +++ b/addons/l10n_in/tax/public_firm_service.xml @@ -3,15 +3,6 @@ - - Service Tax Receivable - 156000 - receivable - - - - - Service Tax Payable 24700 @@ -24,7 +15,7 @@ Service - 12% Service - + 0.12 diff --git a/addons/l10n_in/tax/public_firm_vat.xml b/addons/l10n_in/tax/public_firm_vat.xml index 3fb5eea8dcc..9ffe2b9d9ca 100644 --- a/addons/l10n_in/tax/public_firm_vat.xml +++ b/addons/l10n_in/tax/public_firm_vat.xml @@ -3,15 +3,6 @@ - - VAT Receivable - 157000 - receivable - - - - - VAT Payable 24800 @@ -24,7 +15,7 @@ VAT - 4% VAT - 4% - + 0.04 @@ -55,7 +46,7 @@ VAT - 12.5% VAT - 12.5% - + 0.125 @@ -86,7 +77,7 @@ VAT - 8% VAT - 8% - + 0.08 From f86c011e90cb81208d6f4739134ce7e3e37c45be Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Mon, 28 May 2012 17:31:17 +0530 Subject: [PATCH 020/591] [IMP] l10n_in: Improve code and use proper id name in l10n_in_partnership_private_chart.xml bzr revid: jap@tinyerp.com-20120528120117-iinpi1vuh2v71dvt --- addons/l10n_in/account_multi_chart_wizard.py | 46 +- .../account_multi_chart_wizard_view.xml | 14 +- addons/l10n_in/account_tax_code_template.xml | 2 +- addons/l10n_in/installer.py | 26 +- addons/l10n_in/installer_view.xml | 1 + addons/l10n_in/l10n_in_chart.xml | 447 ------------------ .../l10n_in_partnership_private_chart.xml | 166 +++---- addons/l10n_in/l10n_in_public_firm_chart.xml | 2 +- addons/l10n_in/l10n_in_wizard.xml | 1 + addons/l10n_in/tax/private_exice_duty.xml | 2 +- addons/l10n_in/tax/private_service.xml | 2 +- addons/l10n_in/tax/private_vat.xml | 2 +- addons/l10n_in/tax/privete_sale_tax.xml | 2 +- 13 files changed, 124 insertions(+), 589 deletions(-) delete mode 100644 addons/l10n_in/l10n_in_chart.xml diff --git a/addons/l10n_in/account_multi_chart_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py index 4fbe1fa2cc5..058c2a41617 100644 --- a/addons/l10n_in/account_multi_chart_wizard.py +++ b/addons/l10n_in/account_multi_chart_wizard.py @@ -18,28 +18,25 @@ # along with this program. If not, see . # ############################################################################## -from lxml import etree + from osv import fields, osv from os.path import join as opj import tools - class account_multi_charts_wizard(osv.osv_memory): _inherit ='wizard.multi.charts.accounts' _columns = { - 'sales_tax': fields.boolean('Sales Tax', help='If this field is true it allows you use Sales Tax'), - 'vat': fields.boolean('VAT',help='If this field is true it allows you use VAT'), - 'service_tax': fields.boolean('Service Tax', help='If this field is true it allows you use Service tax'), - 'excise_duty': fields.boolean('Excise Duty', help='If this field is true it allows you use Excise duty'), - 'is_indian_chart': fields.boolean('Flag') + 'sales_tax': fields.boolean('Sales Tax', help='If this field is true it allows you install Sales Tax'), + 'vat': fields.boolean('VAT', help='If this field is true it allows install use VAT'), + 'service_tax': fields.boolean('Service Tax', help='If this field is true it allows you install Service tax'), + 'excise_duty': fields.boolean('Excise Duty', help='If this field is true it allows you install Excise duty'), + 'is_indian_chart': fields.boolean('Indian Chart?') } def onchange_chart_template_id(self, cr, uid, ids, chart_template_id=False, context=None): - res = super(account_multi_charts_wizard, self).onchange_chart_template_id(cr, uid, ids, chart_template_id, context) - tax_templ_obj = self.pool.get('account.tax.template') - res['value'] = {'complete_tax_set': False, 'sale_tax': False, 'purchase_tax': False} + res = super(account_multi_charts_wizard, self).onchange_chart_template_id(cr, uid, ids, chart_template_id, context=context) data = self.pool.get('account.chart.template').browse(cr, uid, chart_template_id, context=context) - if data.name in ('India - Chart of Accounts for Public Firm','India - Chart of Accounts for Partnership/Private Firm'): + if data.name in ('India - Chart of Accounts for Public Firm', 'India - Chart of Accounts for Partnership/Private Firm'): res['value'].update({'is_indian_chart': True}) else: res['value'].update({'is_indian_chart': False}) @@ -50,42 +47,43 @@ class account_multi_charts_wizard(osv.osv_memory): return res def execute(self, cr, uid, ids, context=None): - obj_multi = self.browse(cr, uid, ids[0]) - if obj_multi.chart_template_id.name == 'India - Chart of Accounts for Public Firm': - if obj_multi.sales_tax: + multichart_data = self.browse(cr, uid, ids[0], context=context) + if multichart_data.chart_template_id.name == 'India - Chart of Accounts for Public Firm': + if multichart_data.sales_tax: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_sales_tax.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.vat: + if multichart_data.vat: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_vat.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.service_tax: + if multichart_data.service_tax: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_service.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.excise_duty: + if multichart_data.excise_duty: path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_excise_duty.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - elif obj_multi.chart_template_id.name == 'India - Chart of Accounts for Partnership/Private Firm': - if obj_multi.sales_tax: + elif multichart_data.chart_template_id.name == 'India - Chart of Accounts for Partnership/Private Firm': + if multichart_data.sales_tax: path = tools.file_open(opj('l10n_in', 'tax', 'privete_sale_tax.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.vat: + if multichart_data.vat: path = tools.file_open(opj('l10n_in', 'tax', 'private_vat.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.service_tax: + if multichart_data.service_tax: path = tools.file_open(opj('l10n_in', 'tax', 'private_service.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) path.close() - if obj_multi.excise_duty: + if multichart_data.excise_duty: path = tools.file_open(opj('l10n_in', 'tax', 'private_exice_duty.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - return super(account_multi_charts_wizard, self).execute(cr, uid, ids, context) + path.close() + res = super(account_multi_charts_wizard, self).execute(cr, uid, ids, context=context) + return res account_multi_charts_wizard() diff --git a/addons/l10n_in/account_multi_chart_wizard_view.xml b/addons/l10n_in/account_multi_chart_wizard_view.xml index 4851392748f..899d81fc65b 100644 --- a/addons/l10n_in/account_multi_chart_wizard_view.xml +++ b/addons/l10n_in/account_multi_chart_wizard_view.xml @@ -1,7 +1,6 @@ + - - Generate Chart of Accounts from a Chart Template wizard.multi.charts.accounts @@ -9,12 +8,13 @@ - - - - - + + + + + + diff --git a/addons/l10n_in/account_tax_code_template.xml b/addons/l10n_in/account_tax_code_template.xml index 0677ab6dfa6..1d8e5ed3b70 100644 --- a/addons/l10n_in/account_tax_code_template.xml +++ b/addons/l10n_in/account_tax_code_template.xml @@ -1,4 +1,4 @@ - + diff --git a/addons/l10n_in/installer.py b/addons/l10n_in/installer.py index b189a061da4..e9e4157a23f 100644 --- a/addons/l10n_in/installer.py +++ b/addons/l10n_in/installer.py @@ -18,9 +18,9 @@ # along with this program. If not, see . # ############################################################################## + from osv import fields, osv from os.path import join as opj -import netsvc import tools class l10n_installer(osv.osv_memory): @@ -35,9 +35,9 @@ class l10n_installer(osv.osv_memory): } def execute_simple(self, cr, uid, ids, context=None): + res = super(l10n_installer, self).execute_simple(cr, uid, ids, context=context) if context is None: context = {} - fy_obj = self.pool.get('account.fiscalyear') for res in self.read(cr, uid, ids, context=context): if res['charts'] =='l10n_in' and res['company_type']=='public_company': path = tools.file_open(opj('l10n_in', 'l10n_in_public_firm_chart.xml')) @@ -46,25 +46,7 @@ class l10n_installer(osv.osv_memory): if res['charts'] =='l10n_in' and res['company_type']=='partnership_private_company': path = tools.file_open(opj('l10n_in', 'l10n_in_partnership_private_chart.xml')) tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if 'date_start' in res and 'date_stop' in res: - f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_id'][0])], context=context) - if not f_ids: - name = code = res['date_start'][:4] - if int(name) != int(res['date_stop'][:4]): - name = res['date_start'][:4] +'-'+ res['date_stop'][:4] - code = res['date_start'][2:4] +'-'+ res['date_stop'][2:4] - vals = { - 'name': name, - 'code': code, - 'date_start': res['date_start'], - 'date_stop': res['date_stop'], - 'company_id': res['company_id'][0] - } - fiscal_id = fy_obj.create(cr, uid, vals, context=context) - if res['period'] == 'month': - fy_obj.create_period(cr, uid, [fiscal_id]) - elif res['period'] == '3months': - fy_obj.create_period3(cr, uid, [fiscal_id]) + path.close() + return res # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/installer_view.xml b/addons/l10n_in/installer_view.xml index cfac5ed8513..63dbe44eabd 100644 --- a/addons/l10n_in/installer_view.xml +++ b/addons/l10n_in/installer_view.xml @@ -1,3 +1,4 @@ + diff --git a/addons/l10n_in/l10n_in_chart.xml b/addons/l10n_in/l10n_in_chart.xml deleted file mode 100644 index d18d2b801e0..00000000000 --- a/addons/l10n_in/l10n_in_chart.xml +++ /dev/null @@ -1,447 +0,0 @@ - - - - - - - - Indian Chart of Account - 0 - view - - - - - - Balance Sheet - IA_AC0 - view - - - - - - - Assets - IA_AC01 - view - - - - - - - Current Assets - IA_AC011 - view - - - - - - - Bank Account - IA_AC0111 - liquidity - - - - - - - Cash In Hand Account - IA_AC0112 - view - - - - - - - Cash Account - IA_AC01121 - view - - - - - - - Deposit Account - IA_AC0113 - other - - - - - - - Loan & Advance(Assets) Account - IA_AC0114 - other - - - - - - - Total Sundry Debtors Account - IA_AC0116 - view - - - - - - - Sundry Debtors Account - IA_AC01161 - receivable - - - - - - - Fixed Assets - IA_AC012 - other - - - - - - - Investment - IA_AC013 - other - - - - - - - Misc. Expenses(Asset) - IA_AC014 - other - - - - - - - Liabilities - IA_AC02 - view - - - - - - - Current Liabilities - IA_AC021 - view - - - - - - - Duties & Taxes - IA_AC0211 - other - - - - - - - Provision - IA_AC0212 - other - - - - - - - Total Sundry Creditors - IA_AC0213 - view - - - - - - - Sundry Creditors Account - IA_AC02131 - payable - - - - - - - Branch/Division - IA_AC022 - other - - - - - - - Share Holder/Owner Fund - IA_AC023 - view - - - - - - - Capital Account - IA_AC0231 - other - - - - - - - Reserve and Profit/Loss Account - IA_AC0232 - other - - - - - - - Loan(Liability) Account - IA_AC024 - view - - - - - - - Bank OD Account - IA_AC0241 - other - - - - - - - Secured Loan Account - IA_AC0242 - other - - - - - - - Unsecured Loan Account - IA_AC0243 - other - - - - - - - Suspense Account - IA_AC025 - other - - - - - - - - Profit And Loss Account - IA_AC1 - view - - - - - - - Expense - IA_AC11 - view - - - - - - - Direct Expenses - IA_AC111 - other - - - - - - - Indirect Expenses - IA_AC112 - other - - - - - - - Purchase - IA_AC113 - other - - - - - - - Opening Stock - IA_AC114 - other - - - - - - Salary Expenses - IA_AC115 - other - - - - - - - - Income - IA_AC12 - view - - - - - - - Direct Incomes - IA_AC121 - other - - - - - - - Indirect Incomes - IA_AC122 - other - - - - - - - Sales Account - IA_AC123 - other - - - - - - Goods Given Account - IA_AC124 - other - - - - - - - - - Tax - - - - Tax Balance to Pay - - - - - Tax Due (Tax to pay) - - - - - Tax Payable - - - - - Tax Bases - - - - - - Base of Taxed Sales - - - - - - Base of Taxed Purchases - - - - - OPJ - Opening Journal - situation - - - - - India - Chart of Accounts - - - - - - - - - - - - - diff --git a/addons/l10n_in/l10n_in_partnership_private_chart.xml b/addons/l10n_in/l10n_in_partnership_private_chart.xml index f5185d85426..6e2a764d64f 100644 --- a/addons/l10n_in/l10n_in_partnership_private_chart.xml +++ b/addons/l10n_in/l10n_in_partnership_private_chart.xml @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - + Balance Sheet 1 view @@ -24,183 +24,183 @@ - + Assets 10 view - + - + Cash 101 liquidity - + Checking account balance (as shown in company records), currency, coins, checks received from customers but not yet deposited. - + Accounts Receivable 120 receivable - + Amounts owed to the company for services performed or products sold but not yet paid for. - + Merchandise Inventory 140 other - + Cost of merchandise purchased but has not yet been sold. - + Supplies 150 other - + Cost of supplies that have not yet been used. Supplies that have been used are recorded in Supplies Expense. - + Prepaid Insurance 160 other - + Cost of insurance that is paid in advance and includes a future accounting period. - + Land 170 other - + Cost to acquire and prepare land for use by the company. - + Buildings 175 other - + Cost to purchase or construct buildings for use by the company. - + Accumulated Depreciation - Buildings 178 other - + Amount of the buildings' cost that has been allocated to Depreciation Expense since the time the building was acquired. - + Equipment 180 other - + Cost to acquire and prepare equipment for use by the company. - + Accumulated Depreciation - Equipment 188 other - + Amount of equipment's cost that has been allocated to Depreciation Expense since the time the equipment was acquired. - + Liabilities 20 view - + - + Notes Payable 210 other - + The amount of principal due on a formal written promise to pay. Loans from banks are included in this account. - + Accounts Payable 215 payable - + Amount owed to suppliers who provided goods and services to the company but did not require immediate payment in cash. - + Wages Payable 220 other - + Amount owed to employees for hours worked but not yet paid. - + Interest Payable 230 other - + Amount owed for interest on Notes Payable up until the date of the balance sheet. This is computed by multiplying the amount of the note times the effective interest rate times the time period. - + Unearned Revenues 240 other - + Amounts received in advance of delivering goods or providing services. When the goods are delivered or services are provided, this liability amount decreases. - + Mortgage Loan Payable 250 other - + A formal loan that involves a lien on real estate until the loan is repaid. @@ -212,7 +212,7 @@ view - + - + Profit And Loss 3 view @@ -248,186 +248,186 @@ - + Income 30 view - + - + Operating Revenue Accounts 31 view - + - + Service Revenues 310 other - + Amounts earned from providing services to clients, either for cash or on credit. When a service is provided on credit, both this account and Accounts Receivable will increase. When a service is provided for immediate cash, both this account and Cash will increase. - + Product Sales 311 other - + Sales of product account - + Non-Operating Revenue and Gains 80 view - + - + Interest Revenues 810 other - + Interest and dividends earned on bank accounts, investments or notes receivable. This account is increased when the interest is earned and either Cash or Interest Receivable is also increased. - + Gain on Sale of Assets 811 other - + Occurs when the company sells one of its assets (other than inventory) for more than the asset's book value. - + Expense 50 view - + - + Operating Expense Accounts 51 view - + - + Salaries Expense 500 other - + Expenses incurred for the work performed by salaried employees during the accounting period. These employees normally receive a fixed amount on a weekly, monthly, or annual basis. - + Wages Expense 510 other - + Expenses incurred for the work performed by non-salaried employees during the accounting period. These employees receive an hourly rate of pay. - + Supplies Expense 540 other - + Cost of supplies used up during the accounting period. - + Rent Expense 560 other - + Cost of occupying rented facilities during the accounting period. - + Utilities Expense 570 other - + Costs for electricity, heat, water, and sewer that were used during the accounting period. - + Telephone Expense 576 other - + Cost of telephone used during the current accounting period. - + Advertising Expense 610 other - + Costs incurred by the company during the accounting period for ads, promotions, and other selling and expenses (other than salaries). - + Depreciation Expense 750 other - + Cost of long-term assets allocated to expense during the current accounting period. - + Non-Operating Expenses and Losses 90 view - + @@ -436,7 +436,7 @@ other - + Occurs when the company sells one of its assets (other than inventory) for less than the asset's book value. @@ -446,12 +446,12 @@ India - Chart of Accounts for Partnership/Private Firm - - - - - - + + + + + + diff --git a/addons/l10n_in/l10n_in_public_firm_chart.xml b/addons/l10n_in/l10n_in_public_firm_chart.xml index 8e84d9b8d79..9e72ec9569c 100644 --- a/addons/l10n_in/l10n_in_public_firm_chart.xml +++ b/addons/l10n_in/l10n_in_public_firm_chart.xml @@ -1,4 +1,4 @@ - + diff --git a/addons/l10n_in/l10n_in_wizard.xml b/addons/l10n_in/l10n_in_wizard.xml index 17bd975d140..19d7df181f7 100644 --- a/addons/l10n_in/l10n_in_wizard.xml +++ b/addons/l10n_in/l10n_in_wizard.xml @@ -1,3 +1,4 @@ + diff --git a/addons/l10n_in/tax/private_exice_duty.xml b/addons/l10n_in/tax/private_exice_duty.xml index 568d480eb86..14f4636cf32 100644 --- a/addons/l10n_in/tax/private_exice_duty.xml +++ b/addons/l10n_in/tax/private_exice_duty.xml @@ -9,7 +9,7 @@ payable - + diff --git a/addons/l10n_in/tax/private_service.xml b/addons/l10n_in/tax/private_service.xml index 1ce8cbfe74c..1a36cf4cc0f 100644 --- a/addons/l10n_in/tax/private_service.xml +++ b/addons/l10n_in/tax/private_service.xml @@ -9,7 +9,7 @@ payable - + diff --git a/addons/l10n_in/tax/private_vat.xml b/addons/l10n_in/tax/private_vat.xml index d717201b577..9f917a329f0 100644 --- a/addons/l10n_in/tax/private_vat.xml +++ b/addons/l10n_in/tax/private_vat.xml @@ -9,7 +9,7 @@ payable - + diff --git a/addons/l10n_in/tax/privete_sale_tax.xml b/addons/l10n_in/tax/privete_sale_tax.xml index dc89d3d3fee..a221ff1317b 100644 --- a/addons/l10n_in/tax/privete_sale_tax.xml +++ b/addons/l10n_in/tax/privete_sale_tax.xml @@ -9,7 +9,7 @@ payable - + From 29b1abbe04b5e98d891d08a76c093dd6778fc871 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Sat, 2 Jun 2012 17:36:56 +0530 Subject: [PATCH 021/591] [IMP] l10n_in: Improve code for Create template tax from Install chart of account wizard added new tax template xml file bzr revid: jap@tinyerp.com-20120602120656-4a2itir1joo10x3d --- addons/l10n_in/account_multi_chart_wizard.py | 91 ++++--- addons/l10n_in/installer.py | 25 +- .../l10n_in_private_firm_tax_template.xml | 224 +++++++++++++++++ .../l10n_in_public_firm_tax_template.xml | 231 ++++++++++++++++++ addons/l10n_in/tax/private_exice_duty.xml | 60 ----- addons/l10n_in/tax/private_service.xml | 57 ----- addons/l10n_in/tax/private_vat.xml | 101 -------- addons/l10n_in/tax/privete_sale_tax.xml | 58 ----- .../l10n_in/tax/public_firm_excise_duty.xml | 57 ----- addons/l10n_in/tax/public_firm_sales_tax.xml | 48 ---- addons/l10n_in/tax/public_firm_service.xml | 58 ----- addons/l10n_in/tax/public_firm_vat.xml | 99 -------- 12 files changed, 523 insertions(+), 586 deletions(-) create mode 100644 addons/l10n_in/l10n_in_private_firm_tax_template.xml create mode 100644 addons/l10n_in/l10n_in_public_firm_tax_template.xml delete mode 100644 addons/l10n_in/tax/private_exice_duty.xml delete mode 100644 addons/l10n_in/tax/private_service.xml delete mode 100644 addons/l10n_in/tax/private_vat.xml delete mode 100644 addons/l10n_in/tax/privete_sale_tax.xml delete mode 100644 addons/l10n_in/tax/public_firm_excise_duty.xml delete mode 100644 addons/l10n_in/tax/public_firm_sales_tax.xml delete mode 100644 addons/l10n_in/tax/public_firm_service.xml delete mode 100644 addons/l10n_in/tax/public_firm_vat.xml diff --git a/addons/l10n_in/account_multi_chart_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py index 058c2a41617..b9c242312a6 100644 --- a/addons/l10n_in/account_multi_chart_wizard.py +++ b/addons/l10n_in/account_multi_chart_wizard.py @@ -18,7 +18,7 @@ # along with this program. If not, see . # ############################################################################## - +from tools.translate import _ from osv import fields, osv from os.path import join as opj import tools @@ -45,45 +45,56 @@ class account_multi_charts_wizard(osv.osv_memory): elif data.name == 'India - Chart of Accounts for Partnership/Private Firm': res['value'].update({'sales_tax': True,'vat':True}) return res - - def execute(self, cr, uid, ids, context=None): - multichart_data = self.browse(cr, uid, ids[0], context=context) - if multichart_data.chart_template_id.name == 'India - Chart of Accounts for Public Firm': - if multichart_data.sales_tax: - path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_sales_tax.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if multichart_data.vat: - path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_vat.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if multichart_data.service_tax: - path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_service.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if multichart_data.excise_duty: - path = tools.file_open(opj('l10n_in', 'tax', 'public_firm_excise_duty.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - elif multichart_data.chart_template_id.name == 'India - Chart of Accounts for Partnership/Private Firm': - if multichart_data.sales_tax: - path = tools.file_open(opj('l10n_in', 'tax', 'privete_sale_tax.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if multichart_data.vat: - path = tools.file_open(opj('l10n_in', 'tax', 'private_vat.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if multichart_data.service_tax: - path = tools.file_open(opj('l10n_in', 'tax', 'private_service.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - if multichart_data.excise_duty: - path = tools.file_open(opj('l10n_in', 'tax', 'private_exice_duty.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() - res = super(account_multi_charts_wizard, self).execute(cr, uid, ids, context=context) - return res + + def _load_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, account_ref={}, taxes_ref={}, tax_code_ref={}, context=None): + res = super(account_multi_charts_wizard, self)._load_template(cr, uid, template_id, company_id, code_digits, obj_wizard, account_ref, taxes_ref, tax_code_ref, context=context) + template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context) + obj_tax_code_template = self.pool.get('account.tax.code.template') + obj_tax_temp = self.pool.get('account.tax.template') + obj_tax = self.pool.get('account.tax') + tax_code_ref.update(obj_tax_code_template.generate_tax_code(cr, uid, template.tax_code_root_id.id, company_id, context=context)) + if obj_wizard.sales_tax == False and obj_wizard.excise_duty == False and obj_wizard.vat == False and obj_wizard.service_tax == False: + raise osv.except_osv(_('Error !'), _('Select Tax to Install')) + # Unlink the Tax for current company + tax_ids = obj_tax.search(cr, uid, [('company_id','=',company_id)], context=context) + obj_tax.unlink(cr, uid, tax_ids, context=context) + #Create new Tax as per selected from wizard + if obj_wizard.chart_template_id.name == 'India - Chart of Accounts for Public Firm': + if obj_wizard.sales_tax: + tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Sale Tax - 15%','Sale Tax - 12%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) + tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + if obj_wizard.vat: + tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['VAT - 5%','VAT - 15%','VAT - 8%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) + tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + if obj_wizard.service_tax: + tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Service Tax','Service Tax - %2','Service Tax - %1']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) + tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + if obj_wizard.excise_duty: + tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Excise Duty','Excise Duty - %2','Excise Duty - 1%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) + tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + + elif obj_wizard.chart_template_id.name == 'India - Chart of Accounts for Partnership/Private Firm': + if obj_wizard.sales_tax: + tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Sale Tax - 15%','Sale Tax - 12%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) + tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + if obj_wizard.vat: + tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['VAT - 5%','VAT - 15%','VAT - 8%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) + tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + if obj_wizard.service_tax: + tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Service Tax', 'Service Tax - %2', 'Service Tax - %1']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) + tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + if obj_wizard.excise_duty: + tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Excise Duty', 'Excise Duty - %2', 'Excise Duty - 1%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) + tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + return account_ref, taxes_ref, tax_code_ref account_multi_charts_wizard() diff --git a/addons/l10n_in/installer.py b/addons/l10n_in/installer.py index e9e4157a23f..2d9a2a3d39b 100644 --- a/addons/l10n_in/installer.py +++ b/addons/l10n_in/installer.py @@ -27,9 +27,9 @@ class l10n_installer(osv.osv_memory): _inherit = 'account.installer' _columns = { 'company_type':fields.selection([('partnership_private_company', 'Partnership/Private Firm'), - ('public_company', 'Public Firm')], 'Company Type', required=True), + ('public_company', 'Public Firm')], 'Company Type', required=True, + help='Select your company Type according to your need to install account chart'), } - _defaults = { 'company_type': 'public_company', } @@ -40,13 +40,22 @@ class l10n_installer(osv.osv_memory): context = {} for res in self.read(cr, uid, ids, context=context): if res['charts'] =='l10n_in' and res['company_type']=='public_company': - path = tools.file_open(opj('l10n_in', 'l10n_in_public_firm_chart.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() + acc_file_path = tools.file_open(opj('l10n_in', 'l10n_in_public_firm_chart.xml')) + tools.convert_xml_import(cr, 'l10n_in', acc_file_path, {}, 'init', True, None) + acc_file_path.close() + + tax_file_path = tools.file_open(opj('l10n_in', 'l10n_in_public_firm_tax_template.xml')) + tools.convert_xml_import(cr, 'l10n_in', tax_file_path, {}, 'init', True, None) + tax_file_path.close() + if res['charts'] =='l10n_in' and res['company_type']=='partnership_private_company': - path = tools.file_open(opj('l10n_in', 'l10n_in_partnership_private_chart.xml')) - tools.convert_xml_import(cr, 'l10n_in', path, {}, 'init', True, None) - path.close() + acc_file_path = tools.file_open(opj('l10n_in', 'l10n_in_partnership_private_chart.xml')) + tools.convert_xml_import(cr, 'l10n_in', acc_file_path, {}, 'init', True, None) + acc_file_path.close() + + tax_file_path = tools.file_open(opj('l10n_in', 'l10n_in_private_firm_tax_template.xml')) + tools.convert_xml_import(cr, 'l10n_in', tax_file_path, {}, 'init', True, None) + tax_file_path.close() return res # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/l10n_in_private_firm_tax_template.xml b/addons/l10n_in/l10n_in_private_firm_tax_template.xml new file mode 100644 index 00000000000..564eb41fdfd --- /dev/null +++ b/addons/l10n_in/l10n_in_private_firm_tax_template.xml @@ -0,0 +1,224 @@ + + + + + + + + Sales Tax Payable + 216 + payable + + + + + + + VAT Payable + 217 + payable + + + + + + + Service Tax Payable + 218 + payable + + + + + + + Exice Duty Payable + 219 + payable + + + + + + + + + Sale Tax - 15% + Sale Tax - 15% + + 0.15 + percent + sale + + + + + + + + + + + + Sale Tax -12% + Sale Tax - 12% + + 0.12 + percent + sale + + + + + + + + + + + + + + VAT - 5% + VAT - 5% + + 0.05 + percent + all + + + + 1 + + 1 + + 1 + + 1 + + + + + + VAT - 15% + VAT - 15% + + 0.15 + percent + all + + + + 1 + + 1 + + 1 + + 1 + + + + + + VAT - 8% + VAT - 8% + + 0.8 + percent + all + + + + + + + + + + + + + + Exice Duty - 10.30% + Excise Duty + + 0.10 + percent + sale + + + + 1 + + 1 + + 1 + + 1 + + + + + + Excise duty -10% -%2 + Excise Duty - %2 + 0.02 + percent + sale + + + + + + Excise duty - 10% - %1 + Excise Duty - 1% + 0.01 + percent + sale + + + + + + + + all + Service - 12% + Service Tax + + 0.12 + percent + + + + + + + + + + + + Service - 12% - %2 + Service Tax - %2 + 0.02 + percent + all + + + + + + Service - 12% - 1% + Service Tax - %1 + 0.01 + percent + all + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/l10n_in_public_firm_tax_template.xml b/addons/l10n_in/l10n_in_public_firm_tax_template.xml new file mode 100644 index 00000000000..6dd08be944b --- /dev/null +++ b/addons/l10n_in/l10n_in_public_firm_tax_template.xml @@ -0,0 +1,231 @@ + + + + + + + + + Sales Tax Payable + 24600 + payable + + + + + + + VAT Payable + 24800 + payable + + + + + + + Exice Duty Payable + 24900 + payable + + + + + + + Service Tax Payable + 24700 + payable + + + + + + + + + + Sale Tax - 15% + Sale Tax - 15% + + + + 0.15 + percent + sale + + + + + + + + + Sale Tax - 12% + Sale Tax - 12% + + + + 0.12 + percent + sale + + + + + + + + + + + VAT - 5% + VAT - 5% + + + + 0.05 + percent + all + + 1 + + 1 + + 1 + + 1 + + + + + + VAT - 15% + VAT - 15% + + + + 0.15 + percent + all + + 1 + + 1 + + 1 + + 1 + + + + + + VAT - 8% + VAT - 8% + + + + 0.08 + percent + all + + 1 + + 1 + + 1 + + 1 + + + + + + + + Service - 12% + Service Tax + + + + 0.12 + percent + all + + 1 + + 1 + + 1 + + 1 + + + + + + Service - 12% - 2% + Service Tax - %2 + 0.02 + percent + all + + + + + + Service - 12% - 1% + Service Tax - %1 + 0.01 + percent + all + + + + + + + + Excise duty - 10% + Excise Duty + + + + 0.10 + percent + sale + + 1 + + 1 + + 1 + + 1 + + + + + + Excise duty - 10% - 2% + Excise Duty - %2 + 0.02 + percent + sale + + + + + + Excise duty - 10% - 1% + Excise Duty - 1% + 0.01 + percent + sale + + + + + + \ No newline at end of file diff --git a/addons/l10n_in/tax/private_exice_duty.xml b/addons/l10n_in/tax/private_exice_duty.xml deleted file mode 100644 index 14f4636cf32..00000000000 --- a/addons/l10n_in/tax/private_exice_duty.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - Exice Duty Payable - 219 - payable - - - - - - - Exice Duty - 10.30% - 10 - Exice Duty - - 0.10 - percent - sale - - - - 1 - - 1 - - 1 - - 1 - - - - - - 11 - Excise duty -10% -%2 - Excise duty - 2% - 0.02 - percent - sale - - - - - - 11 - Excise duty - 10% - %1 - Excise duty - 1% - 0.01 - percent - sale - - - - - - \ No newline at end of file diff --git a/addons/l10n_in/tax/private_service.xml b/addons/l10n_in/tax/private_service.xml deleted file mode 100644 index 1a36cf4cc0f..00000000000 --- a/addons/l10n_in/tax/private_service.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - Service Tax Payable - 218 - payable - - - - - - - all - Service - 12% - Service - - 0.12 - percent - - - - 1 - - 1 - - 1 - - 1 - - - - - - Service - 12% - %2 - Service - 2% - 0.02 - percent - all - - - - - - Service - 12% - 1% - Service - 1% - 0.01 - percent - all - - - - - - \ No newline at end of file diff --git a/addons/l10n_in/tax/private_vat.xml b/addons/l10n_in/tax/private_vat.xml deleted file mode 100644 index 9f917a329f0..00000000000 --- a/addons/l10n_in/tax/private_vat.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - VAT Payable - 217 - payable - - - - - - - 30 - VAT - 4% - VAT - - 0.04 - percent - all - - - - 1 - - 1 - - 1 - - 1 - - - - - - VAT - 4% - %1 - VAT - %1 - 0.01 - percent - all - - - - - - VAT - 12.5% - VAT - 12.5% - - 0.125 - percent - all - - - - 1 - - 1 - - 1 - - 1 - - - - - - VAT - 12.5%- %2.5 - VAT (%2.5) - 0.025 - percent - sale - - - - - - VAT - 8% - VAT - 8% - - 0.8 - percent - all - - - - 1 - - 1 - - 1 - - 1 - - - - - - - \ No newline at end of file diff --git a/addons/l10n_in/tax/privete_sale_tax.xml b/addons/l10n_in/tax/privete_sale_tax.xml deleted file mode 100644 index a221ff1317b..00000000000 --- a/addons/l10n_in/tax/privete_sale_tax.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - Sales Tax Payable - 216 - payable - - - - - - - Sale Tax - 15% - Sale Tax - 15% - - 0.15 - percent - sale - - - - 1 - - 1 - - 1 - - 1 - - - - - - Sale Tax -12% - Sale Tax - 12% - - 0.12 - percent - sale - - - - 1 - - 1 - - 1 - - 1 - - - - - - \ No newline at end of file diff --git a/addons/l10n_in/tax/public_firm_excise_duty.xml b/addons/l10n_in/tax/public_firm_excise_duty.xml deleted file mode 100644 index 031c92307fd..00000000000 --- a/addons/l10n_in/tax/public_firm_excise_duty.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - Exice Duty Payable - 24900 - payable - - - - - - - Excise duty - 10% - Excise duty - - - - 0.10 - percent - sale - - 1 - - 1 - - 1 - - 1 - - - - - - Excise duty - 10% - 2% - Excise duty - %2 - 0.02 - percent - sale - - - - - - Excise duty - 10% - 1% - Excise duty - 1% - 0.01 - percent - sale - - - - - - \ No newline at end of file diff --git a/addons/l10n_in/tax/public_firm_sales_tax.xml b/addons/l10n_in/tax/public_firm_sales_tax.xml deleted file mode 100644 index 27d768aba7a..00000000000 --- a/addons/l10n_in/tax/public_firm_sales_tax.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - Sales Tax Payable - 24600 - payable - - - - - - - Sale Tax - 15% - Sale Tax - 15% - - - - 0.15 - percent - sale - - - - - - - - - Sale Tax - 12% - Sale Tax - 12% - - - - 0.12 - percent - sale - - - - - - - - - \ No newline at end of file diff --git a/addons/l10n_in/tax/public_firm_service.xml b/addons/l10n_in/tax/public_firm_service.xml deleted file mode 100644 index f57eee6796b..00000000000 --- a/addons/l10n_in/tax/public_firm_service.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - Service Tax Payable - 24700 - payable - - - - - - - Service - 12% - Service - - - - 0.12 - percent - all - - 1 - - 1 - - 1 - - 1 - - - - - - Service - 12% - 2% - Service (%2) - 0.02 - percent - all - - - - - - Service - 12% - 1% - Service (%1) - 0.01 - percent - all - - - - - - - \ No newline at end of file diff --git a/addons/l10n_in/tax/public_firm_vat.xml b/addons/l10n_in/tax/public_firm_vat.xml deleted file mode 100644 index 9ffe2b9d9ca..00000000000 --- a/addons/l10n_in/tax/public_firm_vat.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - VAT Payable - 24800 - payable - - - - - - - VAT - 4% - VAT - 4% - - - - 0.04 - percent - all - - 1 - - 1 - - 1 - - 1 - - - - - - VAT - 4% -1% - VAT - 1% - 0.01 - percent - all - - - - - - VAT - 12.5% - VAT - 12.5% - - - - 0.125 - percent - all - - 1 - - 1 - - 1 - - 1 - - - - - - VAT - 12.5% - %2.5 - VAT - 12.5% - %2.5 - 0.025 - percent - all - - - - - - VAT - 8% - VAT - 8% - - - - 0.08 - percent - all - - 1 - - 1 - - 1 - - 1 - - - - - - \ No newline at end of file From a7bfa42417a3047600b8357e53c4f8fdc1e0b92e Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Mon, 4 Jun 2012 10:34:39 +0530 Subject: [PATCH 022/591] [IMP] l10n_in: Improve code in installer.py bzr revid: jap@tinyerp.com-20120604050439-sja8sl3j92co825d --- addons/l10n_in/installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_in/installer.py b/addons/l10n_in/installer.py index 2d9a2a3d39b..23d03bfc87d 100644 --- a/addons/l10n_in/installer.py +++ b/addons/l10n_in/installer.py @@ -28,7 +28,7 @@ class l10n_installer(osv.osv_memory): _columns = { 'company_type':fields.selection([('partnership_private_company', 'Partnership/Private Firm'), ('public_company', 'Public Firm')], 'Company Type', required=True, - help='Select your company Type according to your need to install account chart'), + help='Select your company Type according to your need to install Chart Of Account'), } _defaults = { 'company_type': 'public_company', @@ -48,7 +48,7 @@ class l10n_installer(osv.osv_memory): tools.convert_xml_import(cr, 'l10n_in', tax_file_path, {}, 'init', True, None) tax_file_path.close() - if res['charts'] =='l10n_in' and res['company_type']=='partnership_private_company': + elif res['charts'] =='l10n_in' and res['company_type']=='partnership_private_company': acc_file_path = tools.file_open(opj('l10n_in', 'l10n_in_partnership_private_chart.xml')) tools.convert_xml_import(cr, 'l10n_in', acc_file_path, {}, 'init', True, None) acc_file_path.close() From 088e65bd0b044dc9fb148e8e80927f56d938dd84 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Tue, 5 Jun 2012 11:34:41 +0530 Subject: [PATCH 023/591] [IMP] l10n_in: Improve Usability and link account with tax bzr revid: jap@tinyerp.com-20120605060441-52p0hoksc2hr3ey6 --- addons/l10n_in/account_multi_chart_wizard.py | 46 +++++++++++++------ .../account_multi_chart_wizard_view.xml | 11 ++--- addons/l10n_in/installer.py | 2 +- .../l10n_in_private_firm_tax_template.xml | 36 +++++++-------- 4 files changed, 55 insertions(+), 40 deletions(-) diff --git a/addons/l10n_in/account_multi_chart_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py index b9c242312a6..a7e018b2cdb 100644 --- a/addons/l10n_in/account_multi_chart_wizard.py +++ b/addons/l10n_in/account_multi_chart_wizard.py @@ -1,8 +1,8 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # -# Author: Nicolas Bessi. Copyright Camptocamp SA -# Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA +# OpenERP, Open Source Business Applications +# Copyright (C) 2004-2012 OpenERP S.A. (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -24,7 +24,8 @@ from os.path import join as opj import tools class account_multi_charts_wizard(osv.osv_memory): - _inherit ='wizard.multi.charts.accounts' + _name = 'wizard.multi.charts.accounts' + _inherit = 'wizard.multi.charts.accounts' _columns = { 'sales_tax': fields.boolean('Sales Tax', help='If this field is true it allows you install Sales Tax'), 'vat': fields.boolean('VAT', help='If this field is true it allows install use VAT'), @@ -45,57 +46,72 @@ class account_multi_charts_wizard(osv.osv_memory): elif data.name == 'India - Chart of Accounts for Partnership/Private Firm': res['value'].update({'sales_tax': True,'vat':True}) return res - + def _load_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, account_ref={}, taxes_ref={}, tax_code_ref={}, context=None): res = super(account_multi_charts_wizard, self)._load_template(cr, uid, template_id, company_id, code_digits, obj_wizard, account_ref, taxes_ref, tax_code_ref, context=context) template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context) - obj_tax_code_template = self.pool.get('account.tax.code.template') obj_tax_temp = self.pool.get('account.tax.template') obj_tax = self.pool.get('account.tax') - tax_code_ref.update(obj_tax_code_template.generate_tax_code(cr, uid, template.tax_code_root_id.id, company_id, context=context)) if obj_wizard.sales_tax == False and obj_wizard.excise_duty == False and obj_wizard.vat == False and obj_wizard.service_tax == False: raise osv.except_osv(_('Error !'), _('Select Tax to Install')) - # Unlink the Tax for current company - tax_ids = obj_tax.search(cr, uid, [('company_id','=',company_id)], context=context) - obj_tax.unlink(cr, uid, tax_ids, context=context) - #Create new Tax as per selected from wizard if obj_wizard.chart_template_id.name == 'India - Chart of Accounts for Public Firm': + # Unlink the Tax for current company + tax_ids = obj_tax.search(cr, uid, [('company_id','=',company_id)], context=context) + obj_tax.unlink(cr, uid, tax_ids, context=context) + #Create new Tax as per selected from wizard if obj_wizard.sales_tax: tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Sale Tax - 15%','Sale Tax - 12%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + self._tax_account(cr, uid, account_ref, taxes_ref, context=context) if obj_wizard.vat: tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['VAT - 5%','VAT - 15%','VAT - 8%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + self._tax_account(cr, uid, account_ref, taxes_ref, context=context) if obj_wizard.service_tax: tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Service Tax','Service Tax - %2','Service Tax - %1']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + self._tax_account(cr, uid, account_ref, taxes_ref, context=context) if obj_wizard.excise_duty: tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Excise Duty','Excise Duty - %2','Excise Duty - 1%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) - + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + self._tax_account(cr, uid, account_ref, taxes_ref, context=context) elif obj_wizard.chart_template_id.name == 'India - Chart of Accounts for Partnership/Private Firm': + # Unlink the Tax for current company + tax_ids = obj_tax.search(cr, uid, [('company_id','=',company_id)], context=context) + obj_tax.unlink(cr, uid, tax_ids, context=context) + #Create new Tax as per selected from wizard if obj_wizard.sales_tax: tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Sale Tax - 15%','Sale Tax - 12%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + self._tax_account(cr, uid, account_ref, taxes_ref, context=context) if obj_wizard.vat: tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['VAT - 5%','VAT - 15%','VAT - 8%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + self._tax_account(cr, uid, account_ref, taxes_ref, context=context) if obj_wizard.service_tax: tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Service Tax', 'Service Tax - %2', 'Service Tax - %1']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + self._tax_account(cr, uid, account_ref, taxes_ref, context=context) if obj_wizard.excise_duty: tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Excise Duty', 'Excise Duty - %2', 'Excise Duty - 1%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + self._tax_account(cr, uid, account_ref, taxes_ref, context=context) return account_ref, taxes_ref, tax_code_ref - + + def _tax_account(self, cr, uid, account_ref, taxes_ref, context=None): + obj_tax = self.pool.get('account.tax') + for key,value in taxes_ref['account_dict'].items(): + obj_tax.write(cr, uid, [key], { 'account_collected_id': account_ref.get(value['account_collected_id'], False), 'account_paid_id': account_ref.get(value['account_paid_id'], False),}) + return True + account_multi_charts_wizard() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/account_multi_chart_wizard_view.xml b/addons/l10n_in/account_multi_chart_wizard_view.xml index 899d81fc65b..dde9e5981ca 100644 --- a/addons/l10n_in/account_multi_chart_wizard_view.xml +++ b/addons/l10n_in/account_multi_chart_wizard_view.xml @@ -9,12 +9,11 @@ - - - - - - + + + + + diff --git a/addons/l10n_in/installer.py b/addons/l10n_in/installer.py index 23d03bfc87d..7d4cb04b803 100644 --- a/addons/l10n_in/installer.py +++ b/addons/l10n_in/installer.py @@ -28,7 +28,7 @@ class l10n_installer(osv.osv_memory): _columns = { 'company_type':fields.selection([('partnership_private_company', 'Partnership/Private Firm'), ('public_company', 'Public Firm')], 'Company Type', required=True, - help='Select your company Type according to your need to install Chart Of Account'), + help='Company Type is used to install Indian chart of accounts as per your type of business.'), } _defaults = { 'company_type': 'public_company', diff --git a/addons/l10n_in/l10n_in_private_firm_tax_template.xml b/addons/l10n_in/l10n_in_private_firm_tax_template.xml index 564eb41fdfd..d3d627b54da 100644 --- a/addons/l10n_in/l10n_in_private_firm_tax_template.xml +++ b/addons/l10n_in/l10n_in_private_firm_tax_template.xml @@ -4,7 +4,7 @@ - + Sales Tax Payable 216 payable @@ -13,7 +13,7 @@ - + VAT Payable 217 payable @@ -22,7 +22,7 @@ - + Service Tax Payable 218 payable @@ -31,7 +31,7 @@ - + Exice Duty Payable 219 payable @@ -50,8 +50,8 @@ 0.15 percent sale - - + + @@ -67,8 +67,8 @@ 0.12 percent sale - - + + @@ -86,8 +86,8 @@ 0.05 percent all - - + + 1 @@ -107,8 +107,8 @@ 0.15 percent all - - + + 1 @@ -128,8 +128,8 @@ 0.8 percent all - - + + @@ -147,8 +147,8 @@ 0.10 percent sale - - + + 1 @@ -190,8 +190,8 @@ 0.12 percent - - + + From a5db806929c6265eb891b6017746ae04bcedb194 Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Fri, 8 Jun 2012 18:36:38 +0530 Subject: [PATCH 024/591] [IMP] l10n_in: Improve code bzr revid: jap@tinyerp.com-20120608130638-0zii119hfa340wgv --- addons/l10n_in/account_multi_chart_wizard.py | 49 ++++++------------- .../account_multi_chart_wizard_view.xml | 11 +++-- 2 files changed, 20 insertions(+), 40 deletions(-) diff --git a/addons/l10n_in/account_multi_chart_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py index a7e018b2cdb..78fa5fe23da 100644 --- a/addons/l10n_in/account_multi_chart_wizard.py +++ b/addons/l10n_in/account_multi_chart_wizard.py @@ -44,7 +44,7 @@ class account_multi_charts_wizard(osv.osv_memory): if data.name == 'India - Chart of Accounts for Public Firm': res['value'].update({'sales_tax': True,'vat':True, 'service_tax':True, 'excise_duty': True}) elif data.name == 'India - Chart of Accounts for Partnership/Private Firm': - res['value'].update({'sales_tax': True,'vat':True}) + res['value'].update({'sales_tax': True,'vat':True, 'service_tax':False, 'excise_duty': False}) return res def _load_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, account_ref={}, taxes_ref={}, tax_code_ref={}, context=None): @@ -52,58 +52,37 @@ class account_multi_charts_wizard(osv.osv_memory): template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context) obj_tax_temp = self.pool.get('account.tax.template') obj_tax = self.pool.get('account.tax') - if obj_wizard.sales_tax == False and obj_wizard.excise_duty == False and obj_wizard.vat == False and obj_wizard.service_tax == False: - raise osv.except_osv(_('Error !'), _('Select Tax to Install')) + tax_temp_ids = [] if obj_wizard.chart_template_id.name == 'India - Chart of Accounts for Public Firm': # Unlink the Tax for current company tax_ids = obj_tax.search(cr, uid, [('company_id','=',company_id)], context=context) obj_tax.unlink(cr, uid, tax_ids, context=context) #Create new Tax as per selected from wizard if obj_wizard.sales_tax: - tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Sale Tax - 15%','Sale Tax - 12%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) - tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) - self._tax_account(cr, uid, account_ref, taxes_ref, context=context) + tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Sale Tax - 15%','Sale Tax - 12%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) if obj_wizard.vat: - tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['VAT - 5%','VAT - 15%','VAT - 8%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) - tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) - self._tax_account(cr, uid, account_ref, taxes_ref, context=context) + tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['VAT - 5%','VAT - 15%','VAT - 8%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) if obj_wizard.service_tax: - tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Service Tax','Service Tax - %2','Service Tax - %1']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) - tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) - self._tax_account(cr, uid, account_ref, taxes_ref, context=context) + tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Service Tax', 'Service Tax - %2', 'Service Tax - %1']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) if obj_wizard.excise_duty: - tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Excise Duty','Excise Duty - %2','Excise Duty - 1%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) - tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) - self._tax_account(cr, uid, account_ref, taxes_ref, context=context) + tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Excise Duty', 'Excise Duty - %2', 'Excise Duty - 1%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) elif obj_wizard.chart_template_id.name == 'India - Chart of Accounts for Partnership/Private Firm': # Unlink the Tax for current company tax_ids = obj_tax.search(cr, uid, [('company_id','=',company_id)], context=context) obj_tax.unlink(cr, uid, tax_ids, context=context) #Create new Tax as per selected from wizard if obj_wizard.sales_tax: - tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Sale Tax - 15%','Sale Tax - 12%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) - tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) - self._tax_account(cr, uid, account_ref, taxes_ref, context=context) + tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Sale Tax - 15%','Sale Tax - 12%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) if obj_wizard.vat: - tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['VAT - 5%','VAT - 15%','VAT - 8%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) - tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) - self._tax_account(cr, uid, account_ref, taxes_ref, context=context) + tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['VAT - 5%','VAT - 15%','VAT - 8%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) if obj_wizard.service_tax: - tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Service Tax', 'Service Tax - %2', 'Service Tax - %1']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) - tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) - self._tax_account(cr, uid, account_ref, taxes_ref, context=context) + tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Service Tax', 'Service Tax - %2', 'Service Tax - %1']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) if obj_wizard.excise_duty: - tax_temp_ids = obj_tax_temp.search(cr, uid, [('name','in',['Excise Duty', 'Excise Duty - %2', 'Excise Duty - 1%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context) - tax_temp_data = obj_tax_temp.browse(cr, uid, tax_temp_ids, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) - self._tax_account(cr, uid, account_ref, taxes_ref, context=context) + tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Excise Duty', 'Excise Duty - %2', 'Excise Duty - 1%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) + for temp in tax_temp_ids: + tax_temp_data = obj_tax_temp.browse(cr, uid, temp, context=context) + taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) + self._tax_account(cr, uid, account_ref, taxes_ref, context=context) return account_ref, taxes_ref, tax_code_ref def _tax_account(self, cr, uid, account_ref, taxes_ref, context=None): diff --git a/addons/l10n_in/account_multi_chart_wizard_view.xml b/addons/l10n_in/account_multi_chart_wizard_view.xml index dde9e5981ca..d864a01a3a8 100644 --- a/addons/l10n_in/account_multi_chart_wizard_view.xml +++ b/addons/l10n_in/account_multi_chart_wizard_view.xml @@ -9,11 +9,12 @@ - - - - - + + + + + + From 156da2b3503a4449106fa78a2883431e1f6663aa Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Sat, 9 Jun 2012 11:45:22 -0400 Subject: [PATCH 025/591] [IMP] Use account.data_account_type. Remove notax. Improve chart of taxes. bzr revid: maxime.chambreuil@savoirfairelinux.com-20120609154522-htduc8596i18pj93 --- addons/l10n_ca/__openerp__.py | 2 - addons/l10n_ca/account_chart_en.xml | 166 +++--- addons/l10n_ca/account_chart_fr.xml | 174 +++--- addons/l10n_ca/account_tax_code_en.xml | 18 +- addons/l10n_ca/account_tax_code_fr.xml | 16 +- addons/l10n_ca/account_tax_en.xml | 481 +++++++++++++---- addons/l10n_ca/account_tax_fr.xml | 477 +++++++++++++---- addons/l10n_ca/account_types_en.xml | 64 --- addons/l10n_ca/account_types_fr.xml | 79 --- addons/l10n_ca/fiscal_templates_en.xml | 712 +++++++++++++++++-------- addons/l10n_ca/fiscal_templates_fr.xml | 522 +++++++++++++----- 11 files changed, 1828 insertions(+), 883 deletions(-) delete mode 100644 addons/l10n_ca/account_types_en.xml delete mode 100644 addons/l10n_ca/account_types_fr.xml diff --git a/addons/l10n_ca/__openerp__.py b/addons/l10n_ca/__openerp__.py index 800ca7937eb..bd5fe4e6ea0 100644 --- a/addons/l10n_ca/__openerp__.py +++ b/addons/l10n_ca/__openerp__.py @@ -33,13 +33,11 @@ Canadian accounting charts and localizations. "depends" : ['base', 'account', 'base_iban', 'base_vat', 'account_chart'], "init_xml" : [], "update_xml" : [ - 'account_types_en.xml', 'account_chart_en.xml', 'account_tax_code_en.xml', 'account_chart_template_en.xml', 'account_tax_en.xml', 'fiscal_templates_en.xml', - 'account_types_fr.xml', 'account_chart_fr.xml', 'account_tax_code_fr.xml', 'account_chart_template_fr.xml', diff --git a/addons/l10n_ca/account_chart_en.xml b/addons/l10n_ca/account_chart_en.xml index 26db0bcef95..14cbc993b2b 100644 --- a/addons/l10n_ca/account_chart_en.xml +++ b/addons/l10n_ca/account_chart_en.xml @@ -8,7 +8,7 @@ Account Chart CA EN view - + @@ -17,7 +17,7 @@ 1 view - + ASSETS @@ -25,7 +25,7 @@ 11 view - + CURRENT ASSETS @@ -33,7 +33,7 @@ 111 view - + CASH @@ -41,7 +41,7 @@ 1111 liquidity - + Checking Account @@ -49,7 +49,7 @@ 112 view - + TREASURY OR TREASURY EQUIVALENTS @@ -57,7 +57,7 @@ 113 view - + CERTIFICATES OF DEPOSITS @@ -65,7 +65,7 @@ 114 view - + STOCKS @@ -73,7 +73,7 @@ 115 view - + ACCOUNTS RECEIVABLES @@ -81,7 +81,7 @@ 1151 receivable - + Customers Account @@ -90,7 +90,7 @@ 1152 view - + ALLOWANCE FOR DOUBTFUL ACCOUNTS @@ -98,7 +98,7 @@ 116 view - + PREPAID EXPENSES @@ -106,7 +106,7 @@ 117 view - + INVESTMENTS HELD FOR TRADING @@ -114,15 +114,15 @@ 118 view - + TAXES RECEIVABLES 1181 - receivable - + other + GST receivable @@ -130,8 +130,8 @@ 1182 - receivable - + other + PST/QST receivable @@ -139,8 +139,8 @@ 1183 - receivable - + other + HST receivable @@ -149,7 +149,7 @@ 15 view - + NON-CURRENT ASSETS @@ -157,7 +157,7 @@ 151 view - + INVESTMENTS AVAILABLE FOR SALE @@ -165,7 +165,7 @@ 152 view - + TANGIBLE ASSETS @@ -173,7 +173,7 @@ 1527 view - + ACCUMULATED DEPRECIATIONS @@ -181,7 +181,7 @@ 153 view - + INTANGIBLE ASSETS @@ -189,7 +189,7 @@ 1531 view - + PATENTS, TRADEMARKS AND COPYRIGHTS @@ -199,7 +199,7 @@ 2 view - + LIABILITIES @@ -207,7 +207,7 @@ 21 view - + CURRENT LIABILITIES @@ -215,7 +215,7 @@ 211 view - + ACCOUNTS PAYABLES @@ -223,7 +223,7 @@ 2111 payable - + Suppliers Account @@ -232,15 +232,15 @@ 212 view - + TAXES PAYABLES 2121 - payable - + other + GST to pay @@ -248,8 +248,8 @@ 2122 - payable - + other + PST/QST to pay @@ -257,8 +257,8 @@ 2123 - payable - + other + HST to pay @@ -267,7 +267,7 @@ 213 view - + CURRENT FINANCIAL DEBTS @@ -275,7 +275,7 @@ 25 view - + NON-CURRENT LIABILITIES @@ -283,7 +283,7 @@ 251 view - + NON-CURRENT FINANCIAL DEBTS @@ -291,7 +291,7 @@ 252 view - + PROVISIONS FOR PENSIONS AND OTHER POST-EMPLOYMENT ADVANTAGES @@ -299,7 +299,7 @@ 253 view - + DEFERRED TAXES @@ -307,7 +307,7 @@ 259 view - + OTHER NON-CURRENT LIABILITIES @@ -317,7 +317,7 @@ 3 view - + EQUITY @@ -325,7 +325,7 @@ 31 view - + SHARE CAPITAL @@ -333,7 +333,7 @@ 32 view - + PREMIUMS @@ -341,7 +341,7 @@ 33 view - + RETAINED EARNINGS @@ -349,7 +349,7 @@ 34 view - + DIVIDENDS @@ -357,7 +357,7 @@ 35 view - + TRANSLATION ADJUSTMENTS @@ -365,7 +365,7 @@ 36 view - + CONTRIBUTED SURPLUS @@ -375,7 +375,7 @@ 4 view - + INCOMES @@ -383,7 +383,7 @@ 41 view - + OPERATING INCOMES @@ -391,7 +391,7 @@ 411 other - + Inside Sales @@ -399,7 +399,7 @@ 412 other - + Harmonized Provinces Sales @@ -407,7 +407,7 @@ 413 other - + Non-Harmonized Provinces Sales @@ -415,7 +415,7 @@ 414 other - + International Sales @@ -423,7 +423,7 @@ 419 view - + OTHER OPERATING INCOMES @@ -431,7 +431,7 @@ 42 view - + NON-OPERATING INCOMES @@ -439,7 +439,7 @@ 421 view - + INTERESTS @@ -447,7 +447,7 @@ 429 view - + OTHER NON-OPERATING INCOMES @@ -457,7 +457,7 @@ 5 view - + EXPENSES @@ -465,7 +465,7 @@ 51 view - + OPERATING EXPENSES @@ -473,7 +473,7 @@ 511 view - + COST OF GOODS SOLD @@ -481,7 +481,7 @@ 5111 other - + Inside Purchases @@ -489,7 +489,7 @@ 5112 other - + Purchases in harmonized provinces @@ -497,7 +497,7 @@ 5113 other - + Purchases in non-harmonized provinces @@ -505,7 +505,7 @@ 5114 other - + International Purchases @@ -513,7 +513,7 @@ 512 view - + LABOUR EXPENSES @@ -521,7 +521,7 @@ 5121 other - + Salaries, wages and commissions @@ -529,7 +529,7 @@ 5122 other - + Holidays @@ -537,7 +537,7 @@ 5123 other - + Employment Insurance @@ -545,7 +545,7 @@ 5124 other - + Health Services Fund @@ -553,7 +553,7 @@ 5125 other - + Annuities @@ -561,7 +561,7 @@ 5126 other - + Parental Insurance @@ -569,7 +569,7 @@ 5127 other - + Labour Health and Safety @@ -577,7 +577,7 @@ 5128 other - + Labour Standards @@ -585,7 +585,7 @@ 513 view - + SALES EXPENSES @@ -593,7 +593,7 @@ 514 view - + GENERAL EXPENSES @@ -601,7 +601,7 @@ 515 view - + RESEARCH AND DEVELOPMENT EXPENSES @@ -609,7 +609,7 @@ 519 view - + OTHER OPERATING EXPENSES @@ -617,7 +617,7 @@ 55 view - + NON-OPERATING EXPENSES @@ -625,7 +625,7 @@ 551 view - + INTEREST EXPENSES @@ -633,7 +633,7 @@ 559 view - + OTHER NON-OPERATING EXPENSES diff --git a/addons/l10n_ca/account_chart_fr.xml b/addons/l10n_ca/account_chart_fr.xml index b66dd5f02ba..e50ac7ff4dc 100644 --- a/addons/l10n_ca/account_chart_fr.xml +++ b/addons/l10n_ca/account_chart_fr.xml @@ -6,7 +6,7 @@ 0 view - + Account Chart CA FR @@ -16,7 +16,7 @@ 1 view - + ACTIF @@ -24,7 +24,7 @@ 11 view - + ACTIFS COURANTS @@ -32,7 +32,7 @@ 111 view - + ENCAISSE @@ -40,7 +40,7 @@ 1111 liquidity - + Compte chèque @@ -48,7 +48,7 @@ 1112 liquidity - + Petite caisse @@ -56,7 +56,7 @@ 112 view - + TRÉSORERIE OU ÉQUIVALENTS DE TRÉSORERIE @@ -64,7 +64,7 @@ 113 view - + CERTIFICATS DE DÉPÔTS @@ -72,7 +72,7 @@ 114 view - + STOCKS @@ -80,7 +80,7 @@ 115 view - + COMPTES CLIENTS @@ -88,7 +88,7 @@ 1151 receivable - + Comptes clients @@ -97,7 +97,7 @@ 1152 view - + PROVISION POUR CRÉANCES DOUTEUSES @@ -105,7 +105,7 @@ 116 view - + FRAIS PAYÉS D'AVANCE @@ -113,7 +113,7 @@ 117 view - + PLACEMENTS DÉTENUS À DES FINS DE TRANSACTION @@ -121,15 +121,15 @@ 118 view - + IMPÔTS À RECEVOIR 1181 - receivable - + other + TPS à recevoir @@ -137,8 +137,8 @@ 1182 - receivable - + other + TVP/TVQ à recevoir @@ -146,8 +146,8 @@ 1183 - receivable - + other + TVH à recevoir @@ -156,7 +156,7 @@ 15 view - + ACTIFS NON-COURANTS @@ -164,7 +164,7 @@ 151 view - + PLACEMENTS DISPONIBLES À LA VENTE @@ -172,7 +172,7 @@ 152 view - + IMMOBILISATIONS CORPORELLES @@ -180,7 +180,7 @@ 1527 view - + AMORTISSEMENTS CUMULÉS @@ -188,7 +188,7 @@ 153 view - + IMMOBILISATIONS INCORPORELLES @@ -196,7 +196,7 @@ 1531 view - + BREVETS, MARQUES DE COMMERCE ET DROITS D'AUTEURS @@ -206,7 +206,7 @@ 2 view - + PASSIF @@ -214,7 +214,7 @@ 21 view - + PASSIFS COURANTS @@ -222,7 +222,7 @@ 211 view - + FOURNISSEURS ET COMPTES RATTACHÉS @@ -230,7 +230,7 @@ 2111 payable - + Comptes fournisseurs @@ -239,7 +239,7 @@ 212 view - + AUTRES COMPTES CRÉDITEURS @@ -247,15 +247,15 @@ 213 view - + IMPÔTS À PAYER 2131 - payable - + other + TPS à payer @@ -263,8 +263,8 @@ 2132 - payable - + other + TVP/TVQ à payer @@ -272,8 +272,8 @@ 2133 - payable - + other + TVH à payer @@ -282,7 +282,7 @@ 214 view - + DETTES FINANCIÈRES COURANTES @@ -290,7 +290,7 @@ 215 view - + PASSIFS LIÉS AUX ACTIFS DÉTENUS EN VUE DE LEUR CESSION @@ -298,7 +298,7 @@ 25 view - + PASSIFS NON-COURANTS @@ -306,7 +306,7 @@ 251 view - + DETTES FINANCIÈRES NON-COURANTES @@ -314,7 +314,7 @@ 252 view - + PROVISIONS POUR RETRAITES ET AUTRES AVANTAGES POSTÉRIEURS À L'EMPLOI @@ -322,7 +322,7 @@ 253 view - + IMPÔTS DIFFÉRÉS @@ -330,7 +330,7 @@ 254 view - + AUTRES PASSIFS NON-COURANTS @@ -340,7 +340,7 @@ 3 view - + CAPITAUX PROPRES @@ -348,7 +348,7 @@ 31 view - + CAPITAL-ACTIONS @@ -356,7 +356,7 @@ 32 view - + PRIMES @@ -364,7 +364,7 @@ 33 view - + BÉNÉFICES NON RÉPARTIS @@ -372,7 +372,7 @@ 34 view - + DIVIDENDES @@ -380,7 +380,7 @@ 35 view - + ÉCARTS DE CONVERSION @@ -388,7 +388,7 @@ 36 view - + SURPLUS D'APPORT @@ -396,7 +396,7 @@ 39 view - + AUTRES ÉLÉMENTS DU RÉSULTAT GLOBAL @@ -406,7 +406,7 @@ 4 view - + PRODUITS @@ -414,7 +414,7 @@ 41 view - + PRODUITS D'EXPLOITATION @@ -422,7 +422,7 @@ 411 other - + Ventes @@ -430,7 +430,7 @@ 412 other - + Ventes avec des provinces harmonisées @@ -438,7 +438,7 @@ 413 other - + Ventes avec des provinces non-harmonisées @@ -446,7 +446,7 @@ 414 other - + Ventes à l'étranger @@ -454,7 +454,7 @@ 419 view - + AUTRES PRODUITS D'EXPLOITATION @@ -462,7 +462,7 @@ 42 view - + PRODUITS NON LIÉS À L'EXPLOITATION @@ -470,7 +470,7 @@ 425 view - + INTÉRÊTS @@ -478,7 +478,7 @@ 429 view - + AUTRES PRODUITS NON LIÉS À L'EXPLOITATION @@ -488,7 +488,7 @@ 5 view - + CHARGES @@ -496,7 +496,7 @@ 51 view - + CHARGES D'EXPLOITATION @@ -504,7 +504,7 @@ 511 view - + COÛT DES PRODUITS VENDUS @@ -512,7 +512,7 @@ 5111 other - + Achats @@ -520,7 +520,7 @@ 5112 other - + Achats dans des provinces harmonisées @@ -528,7 +528,7 @@ 5113 other - + Achats dans des provinces non-harmonisées @@ -536,7 +536,7 @@ 5114 other - + Achats à l'étranger @@ -544,7 +544,7 @@ 512 view - + SALAIRES ET CHARGES SOCIALES @@ -552,7 +552,7 @@ 51201 other - + Salaires @@ -560,7 +560,7 @@ 51202 other - + Vacances @@ -568,7 +568,7 @@ 51203 other - + Assurance Emploi @@ -576,7 +576,7 @@ 51204 other - + Fonds des services de santé @@ -584,7 +584,7 @@ 51205 other - + Rentes @@ -592,7 +592,7 @@ 51206 other - + Assurance parental @@ -600,7 +600,7 @@ 51207 other - + Santé et sécurité au travail @@ -608,7 +608,7 @@ 51208 other - + Normes du travail @@ -616,7 +616,7 @@ 513 view - + FRAIS SUR VENTE @@ -624,7 +624,7 @@ 514 view - + FRAIS GÉNÉRAUX @@ -632,7 +632,7 @@ 515 view - + FRAIS DE RECHERCHE ET DÉVELOPPEMENT @@ -640,7 +640,7 @@ 519 view - + AUTRES FRAIS D'EXPLOITATION @@ -648,7 +648,7 @@ 52 view - + FRAIS NON LIÉS À L'EXPLOITATION @@ -656,7 +656,7 @@ 521 view - + INTÉRÊTS DÉBITEURS @@ -664,7 +664,7 @@ 529 view - + AUTRES FRAIS NON LIÉS À L'EXPLOITATION diff --git a/addons/l10n_ca/account_tax_code_en.xml b/addons/l10n_ca/account_tax_code_en.xml index 2fe144d6086..bb628a39f15 100644 --- a/addons/l10n_ca/account_tax_code_en.xml +++ b/addons/l10n_ca/account_tax_code_en.xml @@ -7,47 +7,47 @@ - Tax Balance to Pay + Tax Balance - Receivable Taxes + Taxes paid - GST to Receive + GST paid - PST to Receive + PST paid - HST to Receive + HST paid - Payable Taxes + Taxes received - GST to Pay + GST received - PST to Pay + PST received - HST to Pay + HST received diff --git a/addons/l10n_ca/account_tax_code_fr.xml b/addons/l10n_ca/account_tax_code_fr.xml index 849842b2453..d8abf73dd93 100644 --- a/addons/l10n_ca/account_tax_code_fr.xml +++ b/addons/l10n_ca/account_tax_code_fr.xml @@ -12,42 +12,42 @@ - Taxes à recevoir + Taxes payées - TPS à recevoir + TPS payée - TVP/TVQ à recevoir + TVP/TVQ payée - TVH à recevoir + TVH payée - Taxes à payer + Taxes reçues - TPS à payer + TPS reçue - TVP/TVQ à payer + TVP/TVQ reçue - TVH à payer + TVH reçue diff --git a/addons/l10n_ca/account_tax_en.xml b/addons/l10n_ca/account_tax_en.xml index 662ac4b52fc..f185f7f9198 100644 --- a/addons/l10n_ca/account_tax_en.xml +++ b/addons/l10n_ca/account_tax_en.xml @@ -2,263 +2,544 @@ + + - + - GST + PST (MB) - GSTPST_MB + GST + PST for sales (MB) + GSTPST_MB_SALE + sale 1 1 percent - + - GST - 5% (MB) + GST for sales - 5% (MB) GST + sale 0.050000 percent 1 - + - - + + - + - + - PST - 7% + PST for sales - 7% PST - 0.070000 + sale + 0.700000 percent - 1 - + 2 + - - + + - + - + - GST + PST (PE) - GSTPST_PE + GST + PST for sales (PE) + GSTPST_PE_SALE + sale 1 1 percent - + - GST - 5% (PE) + GST for sales - 5% (PE) GST + sale 0.050000 percent 1 - + - - + + - + - + - PST - 10% + PST for sale - 10% PST + sale 0.100000 percent - 1 - + 2 + - - + + - + - + - GST + PST (QC) - GSTPST_QC + GST + TVQ for sales + GSTTVQ_SALE + sale 1 1 percent - + - GST - 5% (QC) + GST for sales - 5% (QC) GST + sale 0.050000 percent 1 - + - - + + - + - + - PST - 9.5% - PST + TVQ for sales - 9.5% + TVQ + sale 0.095000 percent - 1 - + 2 + - - + + - + - + - GST + PST (SK) - GSTPST_SK + GST + PST for sales (SK) + GSTPST_SK_SALE + sale 1 1 percent - + - GST - 5% (SK) + GST for sales - 5% (SK) GST + sale 0.050000 percent 1 - + - - + + - + - + - PST - 5% + PST for sales - 5% (SK) PST + sale 0.050000 percent - 1 - + 2 + - - + + - + - + - HST - 12% - HST12 + TVH for sales - 12% + TVH12_SALE + sale 0.120000 percent - + - - + + - + - HST - 13% - HST13 + TVH for sales - 13% + TVH13_SALE + sale 0.130000 percent - + - - + + - + - HST - 13.5% - HST135 + TVH for sales - 13.5% + TVH135_SALE + sale 0.135000 percent - + - - + + - + - HST - 15% - HST15 + TVH for sales - 15% + TVH15_SALE + sale 0.150000 percent - + - - + + - + - GST - 5% - GST + GST for sales - 5% + GST_SALE + sale 0.050000 percent - + - - + + - + + + + + + - No tax - No tax - 0.00 + GST + PST for purchases (MB) + GSTPST_MB_PURC + purchase + 1 + 1 percent + + + GST for purchases - 5% (MB) + GST + purchase + 0.050000 + percent + 1 + + + + + + + + + + + + + PST for purchases - 7% + PST + purchase + 0.700000 + percent + 2 + + + + + + + + + + + + + + GST + PST for purchases (PE) + GSTPST_PE_PURC + purchase + 1 + 1 + percent + + + + + GST for purchases - 5% (PE) + GST + purchase + 0.050000 + percent + 1 + + + + + + + + + + + + + PST for purchases - 10% + PST + purchase + 0.100000 + percent + 2 + + + + + + + + + + + + + + GST + TVQ for purchases + GSTTVQ_PURC + purchase + 1 + 1 + percent + + + + + GST for purchases - 5% (QC) + GST + purchase + 0.050000 + percent + 1 + + + + + + + + + + + + + TVQ for purchases - 9.5% + TVQ + purchase + 0.095000 + percent + 2 + + + + + + + + + + + + + + GST + PST for purchases (SK) + GSTPST_SK_PURC + purchase + 1 + 1 + percent + + + + + GST for purchases - 5% (SK) + GST + purchase + 0.050000 + percent + 1 + + + + + + + + + + + + + PST for purchases - 5% (SK) + PST + purchase + 0.050000 + percent + 2 + + + + + + + + + + + + + + TVH for purchases - 12% + TVH12_PURC + purchase + 0.120000 + percent + + + + + + + + + + + TVH for purchases - 13% + TVH13_PURC + purchase + 0.130000 + percent + + + + + + + + + + + TVH for purchases - 13.5% + TVH135_PURC + purchase + 0.135000 + percent + + + + + + + + + + + TVH for purchases - 15% + TVH15_PURC + purchase + 0.150000 + percent + + + + + + + + + + + + + GST for purchases - 5% + GST_PURC + purchase + 0.050000 + percent + + + + + + + + diff --git a/addons/l10n_ca/account_tax_fr.xml b/addons/l10n_ca/account_tax_fr.xml index 5df4446c611..169bfe4f20b 100644 --- a/addons/l10n_ca/account_tax_fr.xml +++ b/addons/l10n_ca/account_tax_fr.xml @@ -2,263 +2,544 @@ + + - + - TPS + TVP (MB) - TPSTVP_MB + TPS + TVP sur les ventes (MB) + TPSTVP_MB_SALE + sale 1 1 percent - + - TPS - 5% (MB) + TPS sur les ventes - 5% (MB) TPS + sale 0.050000 percent 1 - + - - + + - + - + - TVP - 7% + TVP sur les ventes - 7% TVP + sale 0.700000 percent - 1 - + 2 + - - + + - + - + - TPS + TVP (PE) - TPSTVP_PE + TPS + TVP sur les ventes (PE) + TPSTVP_PE_SALE + sale 1 1 percent - + - TPS - 5% (PE) + TPS sur les ventes - 5% (PE) TPS + sale 0.050000 percent 1 - + - - + + - + - + - TVP - 10% + TVP for sale - 10% TVP + sale 0.100000 percent - 1 - + 2 + - - + + - + - + - TPS + TVQ - TPSTVQ + TPS + TVQ sur les ventes + TPSTVQ_SALE + sale 1 1 percent - + - TPS - 5% (QC) + TPS sur les ventes - 5% (QC) TPS + sale 0.050000 percent 1 - + - - + + - + - + - TVQ - 9.5% + TVQ sur les ventes - 9.5% TVQ + sale 0.095000 percent - 1 - + 2 + - - + + - + - + - TPS + TVP (SK) - TPSTVP_SK + TPS + TVP sur les ventes (SK) + TPSTVP_SK_SALE + sale 1 1 percent - + - TPS - 5% (SK) + TPS sur les ventes - 5% (SK) TPS + sale 0.050000 percent 1 - + - - + + - + - + - TVP - 5% (SK) + TVP sur les ventes - 5% (SK) TVP + sale 0.050000 percent - 1 - + 2 + - - + + - + - + - TVH - 12% - TVH12 + TVH sur les ventes - 12% + TVH12_SALE + sale 0.120000 percent - + - - + + - + - TVH - 13% - TVH13 + TVH sur les ventes - 13% + TVH13_SALE + sale 0.130000 percent - + - - + + - + - TVH - 13.5% - TVH135 + TVH sur les ventes - 13.5% + TVH135_SALE + sale 0.135000 percent - + - - + + - + - TVH - 15% - TVH15 + TVH sur les ventes - 15% + TVH15_SALE + sale 0.150000 percent - + - - + + - + - TPS - 5% - TPS + TPS sur les ventes - 5% + TPS_SALE + sale 0.050000 percent - + - - + + - + + + + + + - Pas de taxes - Pas de taxes - 0.00 + TPS + TVP sur les achats (MB) + TPSTVP_MB_PURC + purchase + 1 + 1 percent + + + TPS sur les achats - 5% (MB) + TPS + purchase + 0.050000 + percent + 1 + + + + + + + + + + + + + TVP sur les achats - 7% + TVP + purchase + 0.700000 + percent + 2 + + + + + + + + + + + + + + TPS + TVP sur les achats (PE) + TPSTVP_PE_PURC + purchase + 1 + 1 + percent + + + + + TPS sur les achats - 5% (PE) + TPS + purchase + 0.050000 + percent + 1 + + + + + + + + + + + + + TVP sur les achats - 10% + TVP + purchase + 0.100000 + percent + 2 + + + + + + + + + + + + + + TPS + TVQ sur les achats + TPSTVQ_PURC + purchase + 1 + 1 + percent + + + + + TPS sur les achats - 5% (QC) + TPS + purchase + 0.050000 + percent + 1 + + + + + + + + + + + + + TVQ sur les achats - 9.5% + TVQ + purchase + 0.095000 + percent + 2 + + + + + + + + + + + + + + TPS + TVP sur les achats (SK) + TPSTVP_SK_PURC + purchase + 1 + 1 + percent + + + + + TPS sur les achats - 5% (SK) + TPS + purchase + 0.050000 + percent + 1 + + + + + + + + + + + + + TVP sur les achats - 5% (SK) + TVP + purchase + 0.050000 + percent + 2 + + + + + + + + + + + + + + TVH sur les achats - 12% + TVH12_PURC + purchase + 0.120000 + percent + + + + + + + + + + + TVH sur les achats - 13% + TVH13_PURC + purchase + 0.130000 + percent + + + + + + + + + + + TVH sur les achats - 13.5% + TVH135_PURC + purchase + 0.135000 + percent + + + + + + + + + + + TVH sur les achats - 15% + TVH15_PURC + purchase + 0.150000 + percent + + + + + + + + + + + + + TPS sur les achats - 5% + TPS_PURC + purchase + 0.050000 + percent + + + + + + + + diff --git a/addons/l10n_ca/account_types_en.xml b/addons/l10n_ca/account_types_en.xml deleted file mode 100644 index 1af3fd92205..00000000000 --- a/addons/l10n_ca/account_types_en.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - Receivable - receivable - unreconciled - - - - Payable - payable - unreconciled - - - - View - view - none - - - - Income - income - none - income - - - - Expense - expense - none - expense - - - - Tax - tax - unreconciled - - - - Cash - cash - balance - - - - Asset - asset - balance - asset - - - - Equity - equity - liability - balance - - - - diff --git a/addons/l10n_ca/account_types_fr.xml b/addons/l10n_ca/account_types_fr.xml deleted file mode 100644 index cff6c01e6f2..00000000000 --- a/addons/l10n_ca/account_types_fr.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - Vue - view - none - - - - Capital - capital - asset - balance - - - - Immobilisation - immo - asset - balance - - - - Stock et Encours - stock - asset - balance - - - - Tiers - tiers - balance - - - - Tiers - Recevable - tiers -rec - asset - unreconciled - - - - Tiers - Payable - tiers - pay - liability - unreconciled - - - - Tax - tax - unreconciled - - - - Financier - financier - balance - - - - Charge - charge - expense - none - - - - Produit - produit - income - none - - - - diff --git a/addons/l10n_ca/fiscal_templates_en.xml b/addons/l10n_ca/fiscal_templates_en.xml index d7b6a3ee7da..54f9c21b5e1 100644 --- a/addons/l10n_ca/fiscal_templates_en.xml +++ b/addons/l10n_ca/fiscal_templates_en.xml @@ -39,354 +39,618 @@ + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + - + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + - - - - - + + + + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + - - - - + + + + + + - - - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + - - - - + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/l10n_ca/fiscal_templates_fr.xml b/addons/l10n_ca/fiscal_templates_fr.xml index 2ce50e5d6e1..0acd7388a52 100644 --- a/addons/l10n_ca/fiscal_templates_fr.xml +++ b/addons/l10n_ca/fiscal_templates_fr.xml @@ -39,278 +39,542 @@ + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 0fee0cea0079a57d362a5752cf3499a28c58bc43 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 08:45:23 +0200 Subject: [PATCH 026/591] [ADD] backbone-ification of Widgets API bzr revid: xmo@openerp.com-20120611064523-gczdqmfes5f1g9kj --- addons/web/static/src/js/corelib.js | 177 ++++++++++++++++++++++------ 1 file changed, 143 insertions(+), 34 deletions(-) diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 94c748f839c..8455a183f87 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -238,6 +238,20 @@ instance.web.ParentedMixin = { } }; +/** + * Utility function for APIs which can take either a value or a function which + * returns a value + * + * @param {Object} object + * @param {String} property + * @returns {Object} + */ +var getValue = function (object, property) { + if (object == null) { return null; } + var value = object[property]; + return _.isFunction(value) ? value.call(object) : value; +}; + /** * Backbone's events. Do not ever use it directly, use EventDispatcherMixin instead. * @@ -490,23 +504,19 @@ instance.web.CallbackEnabledMixin = _.extend({}, instance.web.PropertiesMixin, { * * The semantics of this precisely replace closing over the method call. * - * @param {String} method_name name of the method to invoke + * @param {String|Function} method function or name of the method to invoke * @returns {Function} proxied method */ - proxy: function (method_name) { + proxy: function (method) { var self = this; return function () { - return self[method_name].apply(self, arguments); + var fn = (method instanceof String) ? self[method] : method; + return fn.apply(self, arguments); } } }); instance.web.WidgetMixin = _.extend({},instance.web.CallbackEnabledMixin, { - /** - * Tag name when creating a default $element. - * @type string - */ - tagName: 'div', /** * Constructs the widget and sets its parent if a parent is given. * @@ -516,14 +526,9 @@ instance.web.WidgetMixin = _.extend({},instance.web.CallbackEnabledMixin, { * @param {instance.web.Widget} parent Binds the current instance to the given Widget instance. * When that widget is destroyed by calling destroy(), the current instance will be * destroyed too. Can be null. - * @param {String} element_id Deprecated. Sets the element_id. Only useful when you want - * to bind the current Widget to an already existing part of the DOM, which is not compatible - * with the DOM insertion methods provided by the current implementation of Widget. So - * for new components this argument should not be provided any more. */ init: function(parent) { instance.web.CallbackEnabledMixin.init.call(this); - this.$element = $(document.createElement(this.tagName)); this.setParent(parent); }, /** @@ -533,8 +538,8 @@ instance.web.WidgetMixin = _.extend({},instance.web.CallbackEnabledMixin, { _.each(this.getChildren(), function(el) { el.destroy(); }); - if(this.$element != null) { - this.$element.remove(); + if(this.$el) { + this.$el.remove(); } instance.web.PropertiesMixin.destroy.call(this); }, @@ -546,7 +551,7 @@ instance.web.WidgetMixin = _.extend({},instance.web.CallbackEnabledMixin, { appendTo: function(target) { var self = this; return this.__widgetRenderAndInsert(function(t) { - self.$element.appendTo(t); + self.$el.appendTo(t); }, target); }, /** @@ -557,7 +562,7 @@ instance.web.WidgetMixin = _.extend({},instance.web.CallbackEnabledMixin, { prependTo: function(target) { var self = this; return this.__widgetRenderAndInsert(function(t) { - self.$element.prependTo(t); + self.$el.prependTo(t); }, target); }, /** @@ -568,7 +573,7 @@ instance.web.WidgetMixin = _.extend({},instance.web.CallbackEnabledMixin, { insertAfter: function(target) { var self = this; return this.__widgetRenderAndInsert(function(t) { - self.$element.insertAfter(t); + self.$el.insertAfter(t); }, target); }, /** @@ -579,7 +584,7 @@ instance.web.WidgetMixin = _.extend({},instance.web.CallbackEnabledMixin, { insertBefore: function(target) { var self = this; return this.__widgetRenderAndInsert(function(t) { - self.$element.insertBefore(t); + self.$el.insertBefore(t); }, target); }, /** @@ -589,7 +594,7 @@ instance.web.WidgetMixin = _.extend({},instance.web.CallbackEnabledMixin, { */ replace: function(target) { return this.__widgetRenderAndInsert(_.bind(function(t) { - this.$element.replaceAll(t); + this.$el.replaceAll(t); }, this), target); }, __widgetRenderAndInsert: function(insertion, target) { @@ -612,6 +617,7 @@ instance.web.WidgetMixin = _.extend({},instance.web.CallbackEnabledMixin, { * @returns {jQuery.Deferred} */ start: function() { + return $.when(); } }); @@ -688,12 +694,9 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, { * @param {instance.web.Widget} parent Binds the current instance to the given Widget instance. * When that widget is destroyed by calling destroy(), the current instance will be * destroyed too. Can be null. - * @param {String} element_id Deprecated. Sets the element_id. Only useful when you want - * to bind the current Widget to an already existing part of the DOM, which is not compatible - * with the DOM insertion methods provided by the current implementation of Widget. So - * for new components this argument should not be provided any more. */ init: function(parent) { + this._uid = _.uniqueId('-widget-'); instance.web.WidgetMixin.init.call(this,parent); this.session = instance.connection; }, @@ -703,20 +706,126 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, { * key that references `this`. */ renderElement: function() { - var rendered = null; - if (this.template) - rendered = instance.web.qweb.render(this.template, {widget: this}); - if (_.str.trim(rendered)) { - var elem = $(rendered); - this.$element.replaceWith(elem); - this.$element = elem; + var $el; + if (this.template) { + $el = $(_.str.trim(instance.web.qweb.render( + this.template, {widget: this}))); + } else { + var attrs = _.extend({}, getValue(this, 'attributes') || {}); + if (this.id) { attrs.id = this.id; } + if (this.className) { attrs['class'] = this.className; } + $el = $(this.make(this.tagName, attrs)) + } + this.setElement($el); + }, + + /** + * Re-sets the widget's root element (el/$el/$element). + * + * Includes: + * * re-delegating events + * * re-binding sub-elements + * * if the widget already had a root element, replacing the pre-existing + * element in the DOM + * + * @param {HTMLElement | jQuery} element new root element for the widget + * @return {*} + */ + setElement: function (element) { + if (this.$el) { + this.undelegateEvents(); + this.unbindElements(); + this.$el.replaceWith(element); + } + + this.$element = this.$el = (element instanceof $) ? element : $(element); + this.el = this.$el[0]; + + this.bindElements(); + this.delegateEvents(); + + return this; + }, + + // Backbone-ish API + tagName: 'div', + id: null, + className: null, + attributes: {}, + /** + * Utility function to build small DOM elements. + * + * @param {String} tagName name of the DOM element to create + * @param {Object} [attributes] map of DOM attributes to set on the element + * @param {String} [content] HTML content to set on the element + * @return {Element} + */ + make: function (tagName, attributes, content) { + var el = document.createElement(tagName); + if (attributes) { + $(el).attrs(attributes); + } + if (content) { + $(el).html(content); + } + return el; + }, + events: {}, + delegateEvents: function () { + var events = getValue(this, 'events'); + if (_.isEmpty(events)) { return; } + + for(var key in events) { + if (!events.hasOwnProperty(key)) { continue; } + + var method = this.proxy(events[key]); + + var match = /^(\S+)(\s+(.*))?$/.exec(key); + var event = match[1]; + var selector = match[3]; + + // add namespace for easy un-delegation + event += '.delegated-events' + this._uid; + if (!selector) { + this.$el.on(event, method); + } else { + this.$el.on(event, selector, method); + } + } + }, + undelegateEvents: function () { + this.$el.off('.delegated-events' + this._uid); + }, + elements: {}, + bindElements: function () { + var elements = getValue(this, 'elements'); + if (_.isEmpty(elements)) { return; } + + for (var selector in elements) { + if (!elements.hasOwnProperty(selector)) { continue; } + + // TODO: ensure at least one element matched? + this[elements[selector]] = this.$(selector); + } + }, + unbindElements: function () { + var elements = getValue(this, 'elements'); + if (_.isEmpty(elements)) { return; } + + for (var selector in elements) { + if (!elements.hasOwnProperty(selector)) { continue; } + + delete this[elements[selector]]; } }, /** - * Shortcut for $element.find() like backbone + * Shortcut for ``this.$el.find(selector)`` + * + * @param {String} selector CSS selector, rooted in $el + * @returns {jQuery} selector match */ - "$": function() { - return this.$element.find.apply(this.$element,arguments); + $: function(selector) { + return this.$el.find(selector); }, /** * Informs the action manager to do an action. This supposes that From 459eb54d77f8fce5cce460d56c74121fe8125275 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 10:50:19 +0200 Subject: [PATCH 027/591] [FIX] broken unit tests bzr revid: xmo@openerp.com-20120611085019-z16aggfnuovgh1p4 --- addons/web/static/src/xml/base.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 3764395dc13..7bbc1884beb 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1409,10 +1409,10 @@ -
+
-
+

M Custom Filters

    From 26ec50e0603561128a5470f871d9ea487ed95560 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 11:18:03 +0200 Subject: [PATCH 028/591] [FIX] bug in new 'proxy' implementation revealed by searchview tests bzr revid: xmo@openerp.com-20120611091803-kzo5j5t8p82gwr6i --- addons/web/static/src/js/corelib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 8455a183f87..61464a58930 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -510,7 +510,7 @@ instance.web.CallbackEnabledMixin = _.extend({}, instance.web.PropertiesMixin, { proxy: function (method) { var self = this; return function () { - var fn = (method instanceof String) ? self[method] : method; + var fn = (typeof method === 'string') ? self[method] : method; return fn.apply(self, arguments); } } From 5c701e2b1d8070e49f0dc247f1b649f19ebc7751 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 11:18:20 +0200 Subject: [PATCH 029/591] [FIX] behavior of OldWidget for new Widget implementation bzr revid: xmo@openerp.com-20120611091820-m5gm67psqeh1xxx8 --- addons/web/static/src/js/coresetup.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 4defde54a3c..d419c7ac3c1 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -19,15 +19,15 @@ instance.web.OldWidget = instance.web.Widget.extend({ this._super(parent); this.element_id = element_id; this.element_id = this.element_id || _.uniqueId('widget-'); + var tmp = document.getElementById(this.element_id); - this.$element = tmp ? $(tmp) : $(document.createElement(this.tagName)); + this.setElement(tmp || this.make(this.tagName)); }, renderElement: function() { var rendered = this.render(); if (rendered) { - var elem = $(rendered); - this.$element.replaceWith(elem); - this.$element = elem; + var $el = $(rendered); + this.setElement($el); } return this; }, From 3f1757869c51cadb87d57abbb0392c78cb888bda Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 11:18:57 +0200 Subject: [PATCH 030/591] [IMP] make searchview base widget not inherit from OldWidget anymore bzr revid: xmo@openerp.com-20120611091857-wcpc2oqywoc0gg51 --- addons/web/static/src/js/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 85521a14651..22649197317 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -886,13 +886,13 @@ instance.web.search.Invalid = instance.web.Class.extend( /** @lends instance.web ); } }); -instance.web.search.Widget = instance.web.OldWidget.extend( /** @lends instance.web.search.Widget# */{ +instance.web.search.Widget = instance.web.Widget.extend( /** @lends instance.web.search.Widget# */{ template: null, /** * Root class of all search widgets * * @constructs instance.web.search.Widget - * @extends instance.web.OldWidget + * @extends instance.web.Widget * * @param view the ancestor view of this widget */ From 772bed66f33f16886ac0211cda6bd34ba05e4e3d Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 11:48:40 +0200 Subject: [PATCH 031/591] [TEST] Widget#proxy, with both String and Function arguments bzr revid: xmo@openerp.com-20120611094840-mtilgirzwlhkl2qc --- addons/web/static/test/Widget.js | 67 ++++++++++++++++++++++++++++++++ addons/web/static/test/test.html | 1 + 2 files changed, 68 insertions(+) create mode 100644 addons/web/static/test/Widget.js diff --git a/addons/web/static/test/Widget.js b/addons/web/static/test/Widget.js new file mode 100644 index 00000000000..dc86e99b38a --- /dev/null +++ b/addons/web/static/test/Widget.js @@ -0,0 +1,67 @@ +$(document).ready(function () { + var $fix = $('#qunit-fixture'); + var mod = { + setup: function () { + instance = window.openerp.init([]); + window.openerp.web.corelib(instance); + } + }; + var instance; + + module('Widget.proxy', mod); + test('(String)', function () { + var W = instance.web.Widget.extend({ + exec: function () { + this.executed = true; + } + }); + var w = new W; + var fn = w.proxy('exec'); + fn(); + ok(w.executed, 'should execute the named method in the right context'); + }); + test('(String)(*args)', function () { + var W = instance.web.Widget.extend({ + exec: function (arg) { + this.executed = arg; + } + }); + var w = new W; + var fn = w.proxy('exec'); + fn(42); + ok(w.executed, "should execute the named method in the right context"); + equal(w.executed, 42, "should be passed the proxy's arguments"); + }); + test('(String), include', function () { + // the proxy function should handle methods being changed on the class + // and should always proxy "by name", to the most recent one + var W = instance.web.Widget.extend({ + exec: function () { + this.executed = 1; + } + }); + var w = new W; + var fn = w.proxy('exec'); + W.include({ + exec: function () { this.executed = 2; } + }); + + fn(); + equal(w.executed, 2, "should be lazily resolved"); + }); + + test('(Function)', function () { + var w = new (instance.web.Widget.extend({ })); + + var fn = w.proxy(function () { this.executed = true; }); + fn(); + ok(w.executed, "should set the function's context (like Function#bind)"); + }); + test('(Function)(*args)', function () { + var w = new (instance.web.Widget.extend({ })); + + var fn = w.proxy(function (arg) { this.executed = arg; }); + fn(42); + equal(w.executed, 42, "should be passed the proxy's arguments"); + }); +}); diff --git a/addons/web/static/test/test.html b/addons/web/static/test/test.html index e352f63c17c..dd0d08a4986 100644 --- a/addons/web/static/test/test.html +++ b/addons/web/static/test/test.html @@ -55,4 +55,5 @@ + From a0c5057dbacef8e8f1841245c58ad4f52da57ef9 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 13:32:38 +0200 Subject: [PATCH 032/591] [TEST] Widget#renderElement with no template specified, fix Widget#make's handling of attributes bzr revid: xmo@openerp.com-20120611113238-wz516g9tl0xp1igd --- addons/web/static/src/js/corelib.js | 4 +- addons/web/static/test/Widget.js | 68 +++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 61464a58930..83586ec57d4 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -762,8 +762,8 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, { */ make: function (tagName, attributes, content) { var el = document.createElement(tagName); - if (attributes) { - $(el).attrs(attributes); + if (!_.isEmpty(attributes)) { + $(el).attr(attributes); } if (content) { $(el).html(content); diff --git a/addons/web/static/test/Widget.js b/addons/web/static/test/Widget.js index dc86e99b38a..51a5182845d 100644 --- a/addons/web/static/test/Widget.js +++ b/addons/web/static/test/Widget.js @@ -64,4 +64,72 @@ $(document).ready(function () { fn(42); equal(w.executed, 42, "should be passed the proxy's arguments"); }); + + module('Widget.renderElement', mod); + test('no template, default', function () { + var w = new (instance.web.Widget.extend({ })); + + ok(!w.$el, "should not initially have a root element"); + w.renderElement(); + ok(w.$el, "should have generated a root element"); + strictEqual(w.$element, w.$el, "should provide $element alias"); + ok(w.$el.is(w.el), "should provide raw DOM alias"); + + equal(w.el.nodeName, 'DIV', "should have generated the default element"); + equal(w.el.attributes.length, 0, "should not have generated any attribute"); + ok(_.isEmpty(w.$el.html(), "should not have generated any content")); + }); + test('no template, custom tag', function () { + var w = new (instance.web.Widget.extend({ + tagName: 'ul' + })); + w.renderElement(); + + equal(w.el.nodeName, 'UL', "should have generated the custom element tag"); + }); + test('no template, @id', function () { + var w = new (instance.web.Widget.extend({ + id: 'foo' + })); + w.renderElement(); + + equal(w.el.attributes.length, 1, "should have one attribute"); + equal(w.$el.attr('id'), 'foo', "should have generated the id attribute"); + equal(w.el.id, 'foo', "should also be available via property"); + }); + test('no template, @className', function () { + var w = new (instance.web.Widget.extend({ + className: 'oe_some_class' + })); + w.renderElement(); + + equal(w.el.className, 'oe_some_class', "should have the right property"); + equal(w.$el.attr('class'), 'oe_some_class', "should have the right attribute"); + }); + test('no template, bunch of attributes', function () { + var w = new (instance.web.Widget.extend({ + attributes: { + 'id': 'some_id', + 'class': 'some_class', + 'data-foo': 'data attribute', + 'clark': 'gable', + 'spoiler': 'snape kills dumbledore' + } + })); + w.renderElement(); + + equal(w.el.attributes.length, 5, "should have all the specified attributes"); + + equal(w.el.id, 'some_id'); + equal(w.$el.attr('id'), 'some_id'); + + equal(w.el.className, 'some_class'); + equal(w.$el.attr('class'), 'some_class'); + + equal(w.$el.attr('data-foo'), 'data attribute'); + equal(w.$el.data('foo'), 'data attribute'); + + equal(w.$el.attr('clark'), 'gable'); + equal(w.$el.attr('spoiler'), 'snape kills dumbledore'); + }); }); From c531cb96ca2b0dc74ec6f9569eec8ea24c6506a1 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 13:48:49 +0200 Subject: [PATCH 033/591] [TEST] Wisget#renderElement with template bzr revid: xmo@openerp.com-20120611114849-dwk4erae5f1tyc6o --- addons/web/static/test/Widget.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/addons/web/static/test/Widget.js b/addons/web/static/test/Widget.js index 51a5182845d..3a2301e53f8 100644 --- a/addons/web/static/test/Widget.js +++ b/addons/web/static/test/Widget.js @@ -132,4 +132,24 @@ $(document).ready(function () { equal(w.$el.attr('clark'), 'gable'); equal(w.$el.attr('spoiler'), 'snape kills dumbledore'); }); + + test('template', function () { + instance.web.qweb = new QWeb2.Engine(); + instance.web.qweb.add_template('' + + '
      ' + + '
    1. ' + + '' + + '
    2. ' + + '
    ' + + '
    '); + + var w = new (instance.web.Widget.extend({ + template: 'test.widget.template' + })); + w.renderElement(); + + equal(w.el.nodeName, 'OL'); + equal(w.$el.children().length, 5); + equal(w.el.textContent, '01234'); + }); }); From 2a9bd73a83c27e3dfab7e7b6438ad9988930ae39 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 14:08:18 +0200 Subject: [PATCH 034/591] [TEST] Widget#$ shortcut bzr revid: xmo@openerp.com-20120611120818-apsawz6kypnpc5m3 --- addons/web/static/test/Widget.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/addons/web/static/test/Widget.js b/addons/web/static/test/Widget.js index 3a2301e53f8..f588d9a258c 100644 --- a/addons/web/static/test/Widget.js +++ b/addons/web/static/test/Widget.js @@ -4,6 +4,15 @@ $(document).ready(function () { setup: function () { instance = window.openerp.init([]); window.openerp.web.corelib(instance); + + instance.web.qweb = new QWeb2.Engine(); + instance.web.qweb.add_template('' + + '
      ' + + '
    1. ' + + '' + + '
    2. ' + + '
    ' + + '
    '); } }; var instance; @@ -134,15 +143,6 @@ $(document).ready(function () { }); test('template', function () { - instance.web.qweb = new QWeb2.Engine(); - instance.web.qweb.add_template('' + - '
      ' + - '
    1. ' + - '' + - '
    2. ' + - '
    ' + - '
    '); - var w = new (instance.web.Widget.extend({ template: 'test.widget.template' })); @@ -152,4 +152,15 @@ $(document).ready(function () { equal(w.$el.children().length, 5); equal(w.el.textContent, '01234'); }); + + module('Widget.$', mod); + test('basic-alias', function () { + var w = new (instance.web.Widget.extend({ + template: 'test.widget.template' + })); + w.renderElement(); + + ok(w.$('li:eq(3)').is(w.$el.find('li:eq(3)')), + "should do the same thing as calling find on the widget root"); + }); }); From c64d8859a01933a89cd5c06df4324d7e11081a4f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 14:48:24 +0200 Subject: [PATCH 035/591] [TEST] declarative events delegation bzr revid: xmo@openerp.com-20120611124824-w83h6betknrajyte --- addons/web/static/test/Widget.js | 49 +++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/addons/web/static/test/Widget.js b/addons/web/static/test/Widget.js index f588d9a258c..d797120a341 100644 --- a/addons/web/static/test/Widget.js +++ b/addons/web/static/test/Widget.js @@ -8,7 +8,9 @@ $(document).ready(function () { instance.web.qweb = new QWeb2.Engine(); instance.web.qweb.add_template('' + '
      ' + - '
    1. ' + + '
    2. ' + + '' + '' + '
    3. ' + '
    ' + @@ -163,4 +165,49 @@ $(document).ready(function () { ok(w.$('li:eq(3)').is(w.$el.find('li:eq(3)')), "should do the same thing as calling find on the widget root"); }); + + module('Widget.events', mod); + test('delegate', function () { + var a = []; + var w = new (instance.web.Widget.extend({ + template: 'test.widget.template', + events: { + 'click': function () { + a[0] = true; + strictEqual(this, w, "should trigger events in widget") + }, + 'click li.class-3': 'class3', + 'change input': function () { a[2] = true; } + }, + class3: function () { a[1] = true; } + })); + w.renderElement(); + + w.$el.click(); + w.$('li:eq(3)').click(); + w.$('input:last').val('foo').change(); + + for(var i=0; i<3; ++i) { + ok(a[i], "should pass test " + i); + } + }); + test('undelegate', function () { + var clicked = false, newclicked = false; + var w = new (instance.web.Widget.extend({ + template: 'test.widget.template', + events: { 'click li': function () { clicked = true; } } + })); + w.renderElement(); + w.$el.on('click', 'li', function () { newclicked = true }); + + w.$('li').click(); + ok(clicked, "should trigger bound events"); + ok(newclicked, "should trigger bound events"); + clicked = newclicked = false; + + w.undelegateEvents(); + w.$('li').click(); + ok(!clicked, "undelegate should unbind events delegated"); + ok(newclicked, "undelegate should only unbind events it created"); + }); }); From b19354ae2005e83980a938c8e534fe55b5d1c14e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 14:54:54 +0200 Subject: [PATCH 036/591] [TEST] getValue/events as a callable bzr revid: xmo@openerp.com-20120611125454-nli5gkds9ffksmdm --- addons/web/static/test/Widget.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/web/static/test/Widget.js b/addons/web/static/test/Widget.js index d797120a341..36d6795ff7c 100644 --- a/addons/web/static/test/Widget.js +++ b/addons/web/static/test/Widget.js @@ -191,6 +191,17 @@ $(document).ready(function () { ok(a[i], "should pass test " + i); } }); + test('delegate(Function)', function () { + var clicked = false, fn = function () { + return { 'click li': function () { clicked = true; } }; }; + var w = new (instance.web.Widget.extend({ + template: 'test.widget.template', + events: fn + })); + w.renderElement(); + w.$('li:first').click(); + ok(clicked, "should accept #events to be a function"); + }); test('undelegate', function () { var clicked = false, newclicked = false; var w = new (instance.web.Widget.extend({ From d6f376464516709c7b4ad7631ac1e49e4e39fe5e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 16:41:08 +0200 Subject: [PATCH 037/591] [REM] declarative elements binding, not sure there's much point and can add later bzr revid: xmo@openerp.com-20120611144108-pw8pz5p06prsikxe --- addons/web/static/src/js/corelib.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 83586ec57d4..e9fd4e1fedf 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -734,14 +734,12 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, { setElement: function (element) { if (this.$el) { this.undelegateEvents(); - this.unbindElements(); this.$el.replaceWith(element); } this.$element = this.$el = (element instanceof $) ? element : $(element); this.el = this.$el[0]; - this.bindElements(); this.delegateEvents(); return this; @@ -796,28 +794,6 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, { undelegateEvents: function () { this.$el.off('.delegated-events' + this._uid); }, - elements: {}, - bindElements: function () { - var elements = getValue(this, 'elements'); - if (_.isEmpty(elements)) { return; } - - for (var selector in elements) { - if (!elements.hasOwnProperty(selector)) { continue; } - - // TODO: ensure at least one element matched? - this[elements[selector]] = this.$(selector); - } - }, - unbindElements: function () { - var elements = getValue(this, 'elements'); - if (_.isEmpty(elements)) { return; } - - for (var selector in elements) { - if (!elements.hasOwnProperty(selector)) { continue; } - - delete this[elements[selector]]; - } - }, /** * Shortcut for ``this.$el.find(selector)`` * From d2f7ddb43eeb53973e7957fa9bccf3153d7f7bc5 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Jun 2012 17:07:02 +0200 Subject: [PATCH 038/591] [ADD] doc for backbone-ish APIs bzr revid: xmo@openerp.com-20120611150702-r4c9kyxmu8m7g4c0 --- doc/addons.rst | 109 -------------------- doc/index.rst | 1 + doc/widget.rst | 270 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 271 insertions(+), 109 deletions(-) create mode 100644 doc/widget.rst diff --git a/doc/addons.rst b/doc/addons.rst index da1f1f28769..35878b04430 100644 --- a/doc/addons.rst +++ b/doc/addons.rst @@ -113,103 +113,6 @@ initializing the addon. Creating new standard roles --------------------------- -Widget -++++++ - -This is the base class for all visual components. It provides a number of -services for the management of a DOM subtree: - -* Rendering with QWeb - -* Parenting-child relations - -* Life-cycle management (including facilitating children destruction when a - parent object is removed) - -* DOM insertion, via jQuery-powered insertion methods. Insertion targets can - be anything the corresponding jQuery method accepts (generally selectors, - DOM nodes and jQuery objects): - - :js:func:`~openerp.base.Widget.appendTo` - Renders the widget and inserts it as the last child of the target, uses - `.appendTo()`_ - - :js:func:`~openerp.base.Widget.prependTo` - Renders the widget and inserts it as the first child of the target, uses - `.prependTo()`_ - - :js:func:`~openerp.base.Widget.insertAfter` - Renders the widget and inserts it as the preceding sibling of the target, - uses `.insertAfter()`_ - - :js:func:`~openerp.base.Widget.insertBefore` - Renders the widget and inserts it as the following sibling of the target, - uses `.insertBefore()`_ - -:js:class:`~openerp.base.Widget` inherits from -:js:class:`~openerp.base.SessionAware`, so subclasses can easily access the -RPC layers. - -Subclassing Widget -~~~~~~~~~~~~~~~~~~ - -:js:class:`~openerp.base.Widget` is subclassed in the standard manner (via the -:js:func:`~openerp.base.Class.extend` method), and provides a number of -abstract properties and concrete methods (which you may or may not want to -override). Creating a subclass looks like this: - -.. code-block:: javascript - - var MyWidget = openerp.base.Widget.extend({ - // QWeb template to use when rendering the object - template: "MyQWebTemplate", - - init: function(parent) { - this._super(parent); - // insert code to execute before rendering, for object - // initialization - }, - start: function() { - this._super(); - // post-rendering initialization code, at this point - // ``this.$element`` has been initialized - this.$element.find(".my_button").click(/* an example of event binding * /); - - // if ``start`` is asynchronous, return a promise object so callers - // know when the object is done initializing - return this.rpc(/* … */) - } - }); - -The new class can then be used in the following manner: - -.. code-block:: javascript - - // Create the instance - var my_widget = new MyWidget(this); - // Render and insert into DOM - my_widget.appendTo(".some-div"); - -After these two lines have executed (and any promise returned by ``appendTo`` -has been resolved if needed), the widget is ready to be used. - -.. note:: the insertion methods will start the widget themselves, and will - return the result of :js:func:`~openerp.base.Widget.start()`. - - If for some reason you do not want to call these methods, you will - have to first call :js:func:`~openerp.base.Widget.render()` on the - widget, then insert it into your DOM and start it. - -If the widget is not needed anymore (because it's transient), simply terminate -it: - -.. code-block:: javascript - - my_widget.stop(); - -will unbind all DOM events, remove the widget's content from the DOM and -destroy all widget data. - Views +++++ @@ -541,18 +444,6 @@ Python .. _promise object: http://api.jquery.com/deferred.promise/ -.. _.appendTo(): - http://api.jquery.com/appendTo/ - -.. _.prependTo(): - http://api.jquery.com/prependTo/ - -.. _.insertAfter(): - http://api.jquery.com/insertAfter/ - -.. _.insertBefore(): - http://api.jquery.com/insertBefore/ - .. _Rosetta: .. _Launchpad's own translation tool: https://help.launchpad.net/Translations diff --git a/doc/index.rst b/doc/index.rst index 9f54b879acc..1f660426a88 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -16,6 +16,7 @@ Contents: async rpc + widget search-view Older stuff diff --git a/doc/widget.rst b/doc/widget.rst new file mode 100644 index 00000000000..9868e4030e0 --- /dev/null +++ b/doc/widget.rst @@ -0,0 +1,270 @@ +User Interaction: Widget +======================== + +This is the base class for all visual components. It corresponds to an MVC +view. It provides a number of services to handle a section of a page: + +* Rendering with QWeb + +* Parenting-child relations + +* Life-cycle management (including facilitating children destruction when a + parent object is removed) + +* DOM insertion, via jQuery-powered insertion methods. Insertion targets can + be anything the corresponding jQuery method accepts (generally selectors, + DOM nodes and jQuery objects): + + :js:func:`~openerp.base.Widget.appendTo` + Renders the widget and inserts it as the last child of the target, uses + `.appendTo()`_ + + :js:func:`~openerp.base.Widget.prependTo` + Renders the widget and inserts it as the first child of the target, uses + `.prependTo()`_ + + :js:func:`~openerp.base.Widget.insertAfter` + Renders the widget and inserts it as the preceding sibling of the target, + uses `.insertAfter()`_ + + :js:func:`~openerp.base.Widget.insertBefore` + Renders the widget and inserts it as the following sibling of the target, + uses `.insertBefore()`_ + +* Backbone-compatible shortcuts + +DOM Root +-------- + +A :js:class:`~openerp.web.Widget` is responsible for a section of the +page materialized by the DOM root of the widget. The DOM root is +available via the :js:attr:`~openerp.web.Widget.el` and +:js:attr:`~openerp.web.Widget.$el` attributes, which are respectively +the raw DOM Element and the jQuery wrapper around the DOM element. + +.. note:: + + both attributes are compatible with Backbone's equivalent, there + is also the :js:attr:`~openerp.web.Widget.$element` attribute + which aliases to :js:attr:`~openerp.web.Widget.$el` and remains + for backwards compatiblity reasons. + +There are two main ways to define and generate this DOM root: + +.. js:attribute:: openerp.web.Widget.template + + Should be set to the name of a QWeb template (a + :js:class:`String`). If set, the template will be rendered after + the widget has been initialized but before it has been + started. The root element generated by the template will be set as + the DOM root of the widget. + +.. js:attribute:: openerp.web.Widget.tagName + + Used if the widget has no template defined. Defaults to ``div``, + will be used as the tag name to create the DOM element to set as + the widget's DOM root. It is possible to further customize this + generated DOM root with the following attributes: + + .. js:attribute:: openerp.web.Widget.id + + Used to generate an ``id`` attribute on the generated DOM + root. + + .. js:attribute:: openerp.web.Widget.className + + Used to generate a ``class`` attribute on the generated DOM root. + + .. js:attribute:: openerp.web.Widget.attributes + + Mapping (object literal) of attribute names to attribute + values. Each of these k:v pairs will be set as a DOM attribute + on the generated DOM root. + + None of these is used in case a template is specified on the widget. + +The DOM root can also be defined programmatically by overridding + +.. js:function:: openerp.web.Widget.renderElement + + Renders the widget's DOM root and sets it. The default + implementation will render a set template or generate an element + as described above, and will call + :js:func:`~openerp.web.Widget.setElement` on the result. + + Any override to :js:func:`~openerp.web.Widget.renderElement` which + does not call its ``_super`` **must** call + :js:func:`~openerp.web.Widget.setElement` with whatever it + generated or the widget's behavior is undefined. + +Accessing DOM content +~~~~~~~~~~~~~~~~~~~~~ + +Because a widget is only responsible for the content below its DOM +root, there is a shortcut for selecting sub-sections of a widget's +DOM: + +.. js:function:: openerp.web.Widget.$(selector) + + Applies the CSS selector specified as parameter to the widget's + DOM root. + + .. code-block:: javascript + + this.$(selector); + + is functionally identical to: + + .. code-block:: javascript + + this.$element.find(selector); + + :param String selector: CSS selector + :returns: jQuery object + + .. note:: this helper method is compatible with + ``Backbone.View.$`` + +Resetting the DOM root +~~~~~~~~~~~~~~~~~~~~~~ + +.. js:function:: openerp.web.Widget.setElement(element) + + Re-sets the widget's DOM root to the provided element, also + handles re-setting the various aliases of the DOM root as well as + unsetting and re-setting delegated events. + + :param Element element: a DOM element or jQuery object to set as + the widget's DOM root + + .. note:: should be mostly compatible with `Backbone's + setElement`_ + +DOM events handling +------------------- + +A widget will generally need to respond to user action within its +section of the page. This entails binding events to DOM elements. + +To this end, :js:class:`~openerp.web.Widget` provides an shortcut: + +.. js:attribute:: openerp.web.Widget.events + + Events are a mapping of ``event selector`` (an event name and a + CSS selector separated by a space) to a callback. The callback can + be either a method name in the widget or a function. In either + case, the ``this`` will be set to the widget. + + The selector is used for jQuery's `event delegation`_, the + callback will only be triggered for descendants of the DOM root + matching the selector [0]_. If the selector is left out (only an + event name is specified), the event will be set directly on the + widget's DOM root. + +.. js:function:: openerp.web.Widget.delegateEvents + + This method is in charge of binding + :js:attr:`~openerp.web.Widget.events` to the DOM. It is + automatically called after setting the widget's DOM root. + + It can be overridden to set up more complex events than the + :js:attr:`~openerp.web.Widget.events` map allows, but the parent + should always be called (or :js:attr:`~openerp.web.Widget.events` + won't be handled correctly). + +.. js:function:: openerp.web.Widget.undelegateEvents + + This method is in charge of unbinding + :js:attr:`~openerp.web.Widget.events` from the DOM root when the + widget is destroyed or the DOM root is reset, in order to avoid + leaving "phantom" events. + + It should be overridden to un-set any event set in an override of + :js:func:`~openerp.web.Widget.delegateEvents`. + +.. note:: this behavior should be compatible with `Backbone's + delegateEvents`_, apart from not accepting any argument. + +Subclassing Widget +------------------ + +:js:class:`~openerp.base.Widget` is subclassed in the standard manner (via the +:js:func:`~openerp.base.Class.extend` method), and provides a number of +abstract properties and concrete methods (which you may or may not want to +override). Creating a subclass looks like this: + +.. code-block:: javascript + + var MyWidget = openerp.base.Widget.extend({ + // QWeb template to use when rendering the object + template: "MyQWebTemplate", + + init: function(parent) { + this._super(parent); + // insert code to execute before rendering, for object + // initialization + }, + start: function() { + this._super(); + // post-rendering initialization code, at this point + // ``this.$element`` has been initialized + this.$element.find(".my_button").click(/* an example of event binding * /); + + // if ``start`` is asynchronous, return a promise object so callers + // know when the object is done initializing + return this.rpc(/* … */) + } + }); + +The new class can then be used in the following manner: + +.. code-block:: javascript + + // Create the instance + var my_widget = new MyWidget(this); + // Render and insert into DOM + my_widget.appendTo(".some-div"); + +After these two lines have executed (and any promise returned by ``appendTo`` +has been resolved if needed), the widget is ready to be used. + +.. note:: the insertion methods will start the widget themselves, and will + return the result of :js:func:`~openerp.base.Widget.start()`. + + If for some reason you do not want to call these methods, you will + have to first call :js:func:`~openerp.base.Widget.render()` on the + widget, then insert it into your DOM and start it. + +If the widget is not needed anymore (because it's transient), simply terminate +it: + +.. code-block:: javascript + + my_widget.destroy(); + +will unbind all DOM events, remove the widget's content from the DOM and +destroy all widget data. + +.. [0] not all DOM events are compatible with events delegation + +.. _.appendTo(): + http://api.jquery.com/appendTo/ + +.. _.prependTo(): + http://api.jquery.com/prependTo/ + +.. _.insertAfter(): + http://api.jquery.com/insertAfter/ + +.. _.insertBefore(): + http://api.jquery.com/insertBefore/ + +.. _event delegation: + http://api.jquery.com/delegate/ + +.. _Backbone's setElement: + http://backbonejs.org/#View-setElement + +.. _Backbone's delegateEvents: + http://backbonejs.org/#View-delegateEvents + From 96333130201c0db03f284fe85cf29d9d6d55defb Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Tue, 12 Jun 2012 12:17:12 +0530 Subject: [PATCH 039/591] [IMP] l10n_in: Remove file l10n_in/account_multi_chart_wizard.py and l10n_in/account_multi_chart_wizard_view.xml bzr revid: jap@tinyerp.com-20120612064712-tviq139uo8yyd1zs --- addons/l10n_in/__init__.py | 1 - addons/l10n_in/__openerp__.py | 1 - addons/l10n_in/account_multi_chart_wizard.py | 96 ------------------- .../account_multi_chart_wizard_view.xml | 22 ----- 4 files changed, 120 deletions(-) delete mode 100644 addons/l10n_in/account_multi_chart_wizard.py delete mode 100644 addons/l10n_in/account_multi_chart_wizard_view.xml diff --git a/addons/l10n_in/__init__.py b/addons/l10n_in/__init__.py index db0c795ae73..f97bda7fb89 100644 --- a/addons/l10n_in/__init__.py +++ b/addons/l10n_in/__init__.py @@ -28,6 +28,5 @@ ############################################################################## import installer -import account_multi_chart_wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/__openerp__.py b/addons/l10n_in/__openerp__.py index cbacb5e5ac3..630d99ca8db 100644 --- a/addons/l10n_in/__openerp__.py +++ b/addons/l10n_in/__openerp__.py @@ -37,7 +37,6 @@ Indian accounting chart and localization. "demo_xml": [], "update_xml": [ "account_tax_code_template.xml", - "account_multi_chart_wizard_view.xml", "l10n_in_wizard.xml", "installer_view.xml", ], diff --git a/addons/l10n_in/account_multi_chart_wizard.py b/addons/l10n_in/account_multi_chart_wizard.py deleted file mode 100644 index 78fa5fe23da..00000000000 --- a/addons/l10n_in/account_multi_chart_wizard.py +++ /dev/null @@ -1,96 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Business Applications -# Copyright (C) 2004-2012 OpenERP S.A. (). -# -# 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 . -# -############################################################################## -from tools.translate import _ -from osv import fields, osv -from os.path import join as opj -import tools - -class account_multi_charts_wizard(osv.osv_memory): - _name = 'wizard.multi.charts.accounts' - _inherit = 'wizard.multi.charts.accounts' - _columns = { - 'sales_tax': fields.boolean('Sales Tax', help='If this field is true it allows you install Sales Tax'), - 'vat': fields.boolean('VAT', help='If this field is true it allows install use VAT'), - 'service_tax': fields.boolean('Service Tax', help='If this field is true it allows you install Service tax'), - 'excise_duty': fields.boolean('Excise Duty', help='If this field is true it allows you install Excise duty'), - 'is_indian_chart': fields.boolean('Indian Chart?') - } - - def onchange_chart_template_id(self, cr, uid, ids, chart_template_id=False, context=None): - res = super(account_multi_charts_wizard, self).onchange_chart_template_id(cr, uid, ids, chart_template_id, context=context) - data = self.pool.get('account.chart.template').browse(cr, uid, chart_template_id, context=context) - if data.name in ('India - Chart of Accounts for Public Firm', 'India - Chart of Accounts for Partnership/Private Firm'): - res['value'].update({'is_indian_chart': True}) - else: - res['value'].update({'is_indian_chart': False}) - if data.name == 'India - Chart of Accounts for Public Firm': - res['value'].update({'sales_tax': True,'vat':True, 'service_tax':True, 'excise_duty': True}) - elif data.name == 'India - Chart of Accounts for Partnership/Private Firm': - res['value'].update({'sales_tax': True,'vat':True, 'service_tax':False, 'excise_duty': False}) - return res - - def _load_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, account_ref={}, taxes_ref={}, tax_code_ref={}, context=None): - res = super(account_multi_charts_wizard, self)._load_template(cr, uid, template_id, company_id, code_digits, obj_wizard, account_ref, taxes_ref, tax_code_ref, context=context) - template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context) - obj_tax_temp = self.pool.get('account.tax.template') - obj_tax = self.pool.get('account.tax') - tax_temp_ids = [] - if obj_wizard.chart_template_id.name == 'India - Chart of Accounts for Public Firm': - # Unlink the Tax for current company - tax_ids = obj_tax.search(cr, uid, [('company_id','=',company_id)], context=context) - obj_tax.unlink(cr, uid, tax_ids, context=context) - #Create new Tax as per selected from wizard - if obj_wizard.sales_tax: - tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Sale Tax - 15%','Sale Tax - 12%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) - if obj_wizard.vat: - tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['VAT - 5%','VAT - 15%','VAT - 8%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) - if obj_wizard.service_tax: - tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Service Tax', 'Service Tax - %2', 'Service Tax - %1']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) - if obj_wizard.excise_duty: - tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Excise Duty', 'Excise Duty - %2', 'Excise Duty - 1%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) - elif obj_wizard.chart_template_id.name == 'India - Chart of Accounts for Partnership/Private Firm': - # Unlink the Tax for current company - tax_ids = obj_tax.search(cr, uid, [('company_id','=',company_id)], context=context) - obj_tax.unlink(cr, uid, tax_ids, context=context) - #Create new Tax as per selected from wizard - if obj_wizard.sales_tax: - tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Sale Tax - 15%','Sale Tax - 12%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) - if obj_wizard.vat: - tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['VAT - 5%','VAT - 15%','VAT - 8%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) - if obj_wizard.service_tax: - tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Service Tax', 'Service Tax - %2', 'Service Tax - %1']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) - if obj_wizard.excise_duty: - tax_temp_ids.append(obj_tax_temp.search(cr, uid, [('name','in',['Excise Duty', 'Excise Duty - %2', 'Excise Duty - 1%']),('chart_template_id','=',obj_wizard.chart_template_id.id)], context=context)) - for temp in tax_temp_ids: - tax_temp_data = obj_tax_temp.browse(cr, uid, temp, context=context) - taxes_ref = obj_tax_temp._generate_tax(cr, uid, tax_temp_data, tax_code_ref, company_id, context=context) - self._tax_account(cr, uid, account_ref, taxes_ref, context=context) - return account_ref, taxes_ref, tax_code_ref - - def _tax_account(self, cr, uid, account_ref, taxes_ref, context=None): - obj_tax = self.pool.get('account.tax') - for key,value in taxes_ref['account_dict'].items(): - obj_tax.write(cr, uid, [key], { 'account_collected_id': account_ref.get(value['account_collected_id'], False), 'account_paid_id': account_ref.get(value['account_paid_id'], False),}) - return True - -account_multi_charts_wizard() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/account_multi_chart_wizard_view.xml b/addons/l10n_in/account_multi_chart_wizard_view.xml deleted file mode 100644 index d864a01a3a8..00000000000 --- a/addons/l10n_in/account_multi_chart_wizard_view.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Generate Chart of Accounts from a Chart Template - wizard.multi.charts.accounts - form - - - - - - - - - - - - - - - From f0ad5fedacc2e994ef8ba45b05113278ac72db95 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 12 Jun 2012 15:21:20 +0200 Subject: [PATCH 040/591] [IMP] move .replaceWith() back into renderElement * Better formalizes repeated calls to renderElement * Makes setElement cleaner and less surprising to call bzr revid: xmo@openerp.com-20120612132120-egsg4kr5n2riv4zk --- addons/web/static/src/js/corelib.js | 5 +++- addons/web/static/test/Widget.js | 42 ++++++++++++++++++++++------- doc/widget.rst | 12 ++++++++- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index e9fd4e1fedf..73fa6839607 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -716,7 +716,11 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, { if (this.className) { attrs['class'] = this.className; } $el = $(this.make(this.tagName, attrs)) } + var $oldel = this.$el; this.setElement($el); + if ($oldel && !$oldel.is(this.$el)) { + $oldel.replaceWith(this.$el); + } }, /** @@ -734,7 +738,6 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, { setElement: function (element) { if (this.$el) { this.undelegateEvents(); - this.$el.replaceWith(element); } this.$element = this.$el = (element instanceof $) ? element : $(element); diff --git a/addons/web/static/test/Widget.js b/addons/web/static/test/Widget.js index 36d6795ff7c..b50dd233a13 100644 --- a/addons/web/static/test/Widget.js +++ b/addons/web/static/test/Widget.js @@ -6,15 +6,21 @@ $(document).ready(function () { window.openerp.web.corelib(instance); instance.web.qweb = new QWeb2.Engine(); - instance.web.qweb.add_template('' + - '
      ' + - '
    1. ' + - '' + - '' + - '
    2. ' + - '
    ' + - '
    '); + instance.web.qweb.add_template( + '' + + '' + + '
      ' + + '
    1. ' + + '' + + '' + + '
    2. ' + + '
    ' + + '
    ' + + '' + + '

    ' + + '
    ' + + '
    '); } }; var instance; @@ -221,4 +227,22 @@ $(document).ready(function () { ok(!clicked, "undelegate should unbind events delegated"); ok(newclicked, "undelegate should only unbind events it created"); }); + + module('Widget.renderElement', mod); + test('repeated', function () { + var w = new (instance.web.Widget.extend({ + template: 'test.widget.template-value' + })); + w.value = 42; + w.appendTo($fix) + .always(start) + .done(function () { + equal($fix.find('p').text(), '42', "DOM fixture should contain initial value"); + equal(w.$el.text(), '42', "should set initial value"); + w.value = 36; + w.renderElement(); + equal($fix.find('p').text(), '36', "DOM fixture should use new value"); + equal(w.$el.text(), '36', "should set new value"); + }); + }); }); diff --git a/doc/widget.rst b/doc/widget.rst index 9868e4030e0..b29260c5882 100644 --- a/doc/widget.rst +++ b/doc/widget.rst @@ -95,7 +95,17 @@ The DOM root can also be defined programmatically by overridding Any override to :js:func:`~openerp.web.Widget.renderElement` which does not call its ``_super`` **must** call :js:func:`~openerp.web.Widget.setElement` with whatever it - generated or the widget's behavior is undefined. + generated or the widget's behavior is undefined.r + + .. note:: + + The default :js:func:`~openerp.web.Widget.renderElement` can + be called repeatedly, it will *replace* the previous DOM root + (using ``replaceWith``). However, this requires that the + widget correctly sets and unsets its events (and children + widgets). Generally, + :js:func:`~openerp.web.Widget.renderElement` should not be + called repeatedly unless the widget advertizes this feature. Accessing DOM content ~~~~~~~~~~~~~~~~~~~~~ From 2911d6a8c5532310e07b3b593d78c43653190137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Thu, 21 Jun 2012 12:40:18 +0200 Subject: [PATCH 041/591] [IMP] Provide _prepare* hooks in bank statement object for the entries creations of account.move.line from a statement line bzr revid: joel.grandguillaume@camptocamp.com-20120621104018-ryylbaxh6696e0rc --- addons/account/account_bank_statement.py | 247 +++++++++++++++++------ 1 file changed, 184 insertions(+), 63 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 1f47a6be9bd..97d10bfc022 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -205,7 +205,182 @@ class account_bank_statement(osv.osv): def button_dummy(self, cr, uid, ids, context=None): return self.write(cr, uid, ids, {}, context=context) + def _prepare_move(self, cr, uid, st_line, st_line_number, context=None): + """Prepare the dict of values to create the move from a + statement line. This method may be overridden to implement custom + move generation (making sure to call super() to establish + a clean extension chain). + + :param browse_record st_line: account.bank.statement.line record to + create the move from. + :param char st_line_number: will be used as the name of the generated account move + :return: dict of value to create() the account.move + """ + move_vals = { + 'journal_id': st_line.statement_id.journal_id.id, + 'period_id': st_line.statement_id.period_id.id, + 'date': st_line.date, + 'name': st_line_number, + 'ref': st_line.ref, + } + return move_vals + + def _prepare_bank_move_line(self, cr, uid, st_line, move_id, amount, company_currency_id, + context=None): + """Compute the args to build the dict of values to create the bank move line from a + statement line by calling the _prepare_move_line_vals. This method may be + overridden to implement custom move generation (making sure to call super() to + establish a clean extension chain). + + :param browse_record st_line: account.bank.statement.line record to + create the move from. + :param int/long move_id: ID of the account.move to link the move line + :param float amount: amount of the move line + :param int/long company_currency_id: ID of currency of the concerned company + :return: dict of value to create() the bank account.move.line + """ + anl_id = st_line.analytic_account_id and st_line.analytic_account_id.id or False + debit = ((amount<0) and -amount) or 0.0 + credit = ((amount>0) and amount) or 0.0 + cur_id = False + amt_cur = False + if st_line.statement_id.currency.id <> company_currency_id: + amount_cur = res_currency_obj.compute(cr, uid, company_currency_id, + st.currency.id, amount, context=context) + amt_cur = -amount_cur + if st_line.account_id and st_line.account_id.currency_id and st_line.account_id.currency_id.id <> company_currency_id: + cur_id = st_line.account_id.currency_id.id + amount_cur = res_currency_obj.compute(cr, uid, company_currency_id, + st_line.account_id.currency_id.id, amount, context=context) + amt_cur = -amount_cur + + res = self._prepare_move_line_vals(cr, uid, st_line, move_id, debit, credit, + amount_currency=amt_cur, currency_id=cur_id, analytic_id = anl_id, context=context) + return res + + def _get_counter_part_account(sefl, cr, uid, st_line, context=None): + """Retrieve the account to use in the counterpart move. + This method may be overridden to implement custom move generation (making sure to + call super() to establish a clean extension chain). + + :param browse_record st_line: account.bank.statement.line record to + create the move from. + :return: int/long of the account.account to use as counterpart + """ + account_id = False + if st_line.amount >= 0: + account_id = st_line.statement_id.journal_id.default_credit_account_id.id + else: + account_id = st_line.statement_id.journal_id.default_debit_account_id.id + return account_id + + def _get_counter_part_partner(sefl, cr, uid, st_line, context=None): + """Retrieve the partner to use in the counterpart move. + This method may be overridden to implement custom move generation (making sure to + call super() to establish a clean extension chain). + + :param browse_record st_line: account.bank.statement.line record to + create the move from. + :return: int/long of the res.partner to use as counterpart + """ + import pdb;pdb.set_trace() + partner_id = ((st_line.partner_id) and st_line.partner_id.id) or False + return partner_id + + + def _prepare_counterpart_move_line(self, cr, uid, st_line, move_id, amount, company_currency_id, + context=None): + """Compute the args to build the dict of values to create the counter part move line from a + statement line by calling the _prepare_move_line_vals. This method may be + overridden to implement custom move generation (making sure to call super() to + establish a clean extension chain). + + :param browse_record st_line: account.bank.statement.line record to + create the move from. + :param int/long move_id: ID of the account.move to link the move line + :param float amount: amount of the move line + :param int/long account_id: ID of account to use as counter part + :param int/long company_currency_id: ID of currency of the concerned company + :return: dict of value to create() the bank account.move.line + """ + account_id = self._get_counter_part_account(cr, uid, st_line, context=context) + partner_id = self._get_counter_part_partner(cr, uid, st_line, context=context) + debit = ((amount > 0) and amount) or 0.0 + credit = ((amount < 0) and -amount) or 0.0 + cur_id = False + amt_cur = False + if st_line.statement_id.currency.id <> company_currency_id: + amt_cur = st_line.amount + cur_id = st_line.statement_id.currency.id + res = self._prepare_move_line_vals(cr, uid, st_line, move_id, debit, credit, + amount_currency = amt_cur, currency_id = cur_id, account_id = account_id, + partner_id = partner_id, context=context) + return res + + def _prepare_move_line_vals(self, cr, uid, st_line, move_id, debit, credit, currency_id = False, + amount_currency= False, account_id = False, analytic_id = False, + partner_id = False, context=None): + """Prepare the dict of values to create the move line from a + statement line. All non-mandatory args will replace the default computed one. + This method may be overridden to implement custom move generation (making sure to + call super() to establish a clean extension chain). + + :param browse_record st_line: account.bank.statement.line record to + create the move from. + :param int/long move_id: ID of the account.move to link the move line + :param float debit: debit amount of the move line + :param float credit: credit amount of the move line + :param int/long currency_id: ID of currency of the move line to create + :param float amount_currency: amount of the debit/credit expressed in the currency_id + :param int/long account_id: ID of the account to use in the move line if different + from the statement line account ID + :param int/long analytic_id: ID of analytic account to put on the move line + :param int/long partner_id: ID of the partner to put on the move line + :return: dict of value to create() the account.move.line + """ + acc_id = (st_line.account_id) and st_line.account_id.id + cur_id = st_line.statement_id.currency.id + par_id = ((st_line.partner_id) and st_line.partner_id.id) or False + anl_acc_id = False + am_curr = False + amount_currency = False + if account_id: + acc_id = account_id + if currency_id: + cur_id = currency_id + if amount_currency: + am_curr = amount_currency + if analytic_id: + anl_acc_id = analytic_id + if partner_id: + par_id = partner_id + ml_val = { + 'name': st_line.name, + 'date': st_line.date, + 'ref': st_line.ref, + 'move_id': move_id, + 'partner_id': partner_id, + 'account_id': acc_id, + 'credit': credit, + 'debit': debit, + 'statement_id': st_line.statement_id.id, + 'journal_id': st_line.statement_id.journal_id.id, + 'period_id': st_line.statement_id.period_id.id, + 'currency_id': cur_id, + 'amount_currency': am_curr, + 'analytic_account_id': anl_acc_id, + } + return ml_val + def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): + """Create the account move from the statement line using the _prepare_bank_move_line and + _prepare_counterpart_move_line hook methods. + :param int/long st_line: ID of the account.bank.statement.line to create the move from. + :param int/long company_currency_id: ID of the res.currency of the company + :param char st_line_number: will be used as the name of the generated account move + :return: ID of the account.move created + """ + if context is None: context = {} res_currency_obj = self.pool.get('res.currency') @@ -217,82 +392,28 @@ class account_bank_statement(osv.osv): context.update({'date': st_line.date}) - move_id = account_move_obj.create(cr, uid, { - 'journal_id': st.journal_id.id, - 'period_id': st.period_id.id, - 'date': st_line.date, - 'name': st_line_number, - 'ref': st_line.ref, - }, context=context) + move_vals = self._prepare_move(cr, uid, st_line, st_line_number, context=context) + move_id = account_move_obj.create(cr, uid, move_vals, context=context) account_bank_statement_line_obj.write(cr, uid, [st_line.id], { 'move_ids': [(4, move_id, False)] }) - torec = [] - if st_line.amount >= 0: - account_id = st.journal_id.default_credit_account_id.id - else: - account_id = st.journal_id.default_debit_account_id.id - acc_cur = ((st_line.amount<=0) and st.journal_id.default_debit_account_id) or st_line.account_id + context.update({ 'res.currency.compute.account': acc_cur, }) amount = res_currency_obj.compute(cr, uid, st.currency.id, company_currency_id, st_line.amount, context=context) - val = { - 'name': st_line.name, - 'date': st_line.date, - 'ref': st_line.ref, - 'move_id': move_id, - 'partner_id': ((st_line.partner_id) and st_line.partner_id.id) or False, - 'account_id': (st_line.account_id) and st_line.account_id.id, - 'credit': ((amount>0) and amount) or 0.0, - 'debit': ((amount<0) and -amount) or 0.0, - 'statement_id': st.id, - 'journal_id': st.journal_id.id, - 'period_id': st.period_id.id, - 'currency_id': st.currency.id, - 'analytic_account_id': st_line.analytic_account_id and st_line.analytic_account_id.id or False - } - - if st.currency.id <> company_currency_id: - amount_cur = res_currency_obj.compute(cr, uid, company_currency_id, - st.currency.id, amount, context=context) - val['amount_currency'] = -amount_cur - - if st_line.account_id and st_line.account_id.currency_id and st_line.account_id.currency_id.id <> company_currency_id: - val['currency_id'] = st_line.account_id.currency_id.id - amount_cur = res_currency_obj.compute(cr, uid, company_currency_id, - st_line.account_id.currency_id.id, amount, context=context) - val['amount_currency'] = -amount_cur - - move_line_id = account_move_line_obj.create(cr, uid, val, context=context) + bank_move_val = self._prepare_bank_move_line(cr, uid, st_line, move_id, amount, + company_currency_id, context=context) + move_line_id = account_move_line_obj.create(cr, uid, bank_move_val, context=context) torec.append(move_line_id) - # Fill the secondary amount/currency - # if currency is not the same than the company - amount_currency = False - currency_id = False - if st.currency.id <> company_currency_id: - amount_currency = st_line.amount - currency_id = st.currency.id - account_move_line_obj.create(cr, uid, { - 'name': st_line.name, - 'date': st_line.date, - 'ref': st_line.ref, - 'move_id': move_id, - 'partner_id': ((st_line.partner_id) and st_line.partner_id.id) or False, - 'account_id': account_id, - 'credit': ((amount < 0) and -amount) or 0.0, - 'debit': ((amount > 0) and amount) or 0.0, - 'statement_id': st.id, - 'journal_id': st.journal_id.id, - 'period_id': st.period_id.id, - 'amount_currency': amount_currency, - 'currency_id': currency_id, - }, context=context) + counterpart_move_val = self._prepare_counterpart_move_line(cr, uid, st_line, move_id, + amount, company_currency_id, context=context) + account_move_line_obj.create(cr, uid, counterpart_move_val, context=context) for line in account_move_line_obj.browse(cr, uid, [x.id for x in account_move_obj.browse(cr, uid, move_id, From 28908bea003e11e2df7ccedc58f9a0fbee159bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Thu, 21 Jun 2012 13:49:16 +0200 Subject: [PATCH 042/591] [FIX] Remove pdb... no comment... bzr revid: joel.grandguillaume@camptocamp.com-20120621114916-a0uy3ipru8usgzo0 --- addons/account/account_bank_statement.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 97d10bfc022..ece18a016fe 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -283,7 +283,6 @@ class account_bank_statement(osv.osv): create the move from. :return: int/long of the res.partner to use as counterpart """ - import pdb;pdb.set_trace() partner_id = ((st_line.partner_id) and st_line.partner_id.id) or False return partner_id From 2c115e6856f5c6eb7f3d730b0ccfa028b386b009 Mon Sep 17 00:00:00 2001 From: Ronald Portier Date: Fri, 22 Jun 2012 16:19:32 +0200 Subject: [PATCH 043/591] [FIX] Problem with runaway cpu and/or postgres crash on analytic account analysis. lp bug: https://launchpad.net/bugs/1015995 fixed bzr revid: ronald@therp.nl-20120622141932-f6rywvd1nawn186w --- .../account_analytic_analysis.py | 54 +++++++------------ 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 20c170cb5c0..cedcc9fa533 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -418,41 +418,25 @@ class account_analytic_account_summary_user(osv.osv): } def init(self, cr): - tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_user') - cr.execute('CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS (' \ - 'SELECT ' \ - '(u.account_id * u.max_user) + u."user" AS id, ' \ - 'u.account_id AS account_id, ' \ - 'u."user" AS "user", ' \ - 'COALESCE(SUM(l.unit_amount), 0.0) AS unit_amount ' \ - 'FROM ' \ - '(SELECT ' \ - 'a.id AS account_id, ' \ - 'u1.id AS "user", ' \ - 'MAX(u2.id) AS max_user ' \ - 'FROM ' \ - 'res_users AS u1, ' \ - 'res_users AS u2, ' \ - 'account_analytic_account AS a ' \ - 'GROUP BY u1.id, a.id ' \ - ') AS u ' \ - 'LEFT JOIN ' \ - '(SELECT ' \ - 'l.account_id AS account_id, ' \ - 'l.user_id AS "user", ' \ - 'SUM(l.unit_amount) AS unit_amount ' \ - 'FROM account_analytic_line AS l, ' \ - 'account_analytic_journal AS j ' \ - 'WHERE (j.type = \'general\') and (j.id=l.journal_id) ' \ - 'GROUP BY l.account_id, l.user_id ' \ - ') AS l ' - 'ON (' \ - 'u.account_id = l.account_id ' \ - 'AND u."user" = l."user"' \ - ') ' \ - 'GROUP BY u."user", u.account_id, u.max_user' \ - ')') - + cr.execute('''CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS ( + with mu as + (select max(id) as max_user from res_users) + , lu AS + (SELECT + l.account_id AS account_id, + coalesce(l.user_id, 0) AS user_id, + SUM(l.unit_amount) AS unit_amount + FROM account_analytic_line AS l, + account_analytic_journal AS j + WHERE (j.type = 'general' ) and (j.id=l.journal_id) + GROUP BY l.account_id, l.user_id + ) + select (lu.account_id * mu.max_user) + lu.user_id as id, + lu.account_id as account_id, + lu.user_id as "user", + unit_amount + from lu, mu)''') + account_analytic_account_summary_user() class account_analytic_account_summary_month(osv.osv): From ff4342dc4f08adf10343ae700d8c9ebf89fdd2a2 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 25 Jun 2012 14:26:30 +0200 Subject: [PATCH 044/591] [ADD] signup addon bzr revid: chs@openerp.com-20120625122630-ce6hywabt512xbh6 --- addons/anonymous/static/src/xml/anonymous.xml | 2 + addons/signup/__init__.py | 2 + addons/signup/__openerp__.py | 23 +++++++ addons/signup/res_config.py | 19 ++++++ addons/signup/res_config.xml | 16 +++++ addons/signup/signup_wizard.py | 65 +++++++++++++++++++ addons/signup/signup_wizard.xml | 41 ++++++++++++ addons/signup/static/src/js/signup.js | 21 ++++++ addons/signup/static/src/xml/signup.xml | 14 ++++ 9 files changed, 203 insertions(+) create mode 100644 addons/signup/__init__.py create mode 100644 addons/signup/__openerp__.py create mode 100644 addons/signup/res_config.py create mode 100644 addons/signup/res_config.xml create mode 100644 addons/signup/signup_wizard.py create mode 100644 addons/signup/signup_wizard.xml create mode 100644 addons/signup/static/src/js/signup.js create mode 100644 addons/signup/static/src/xml/signup.xml diff --git a/addons/anonymous/static/src/xml/anonymous.xml b/addons/anonymous/static/src/xml/anonymous.xml index 4c6d2fcbf54..7429efff458 100644 --- a/addons/anonymous/static/src/xml/anonymous.xml +++ b/addons/anonymous/static/src/xml/anonymous.xml @@ -4,10 +4,12 @@ + diff --git a/addons/signup/__init__.py b/addons/signup/__init__.py new file mode 100644 index 00000000000..f15ba34bf0a --- /dev/null +++ b/addons/signup/__init__.py @@ -0,0 +1,2 @@ +import signup_wizard +import res_config diff --git a/addons/signup/__openerp__.py b/addons/signup/__openerp__.py new file mode 100644 index 00000000000..b927b9526b7 --- /dev/null +++ b/addons/signup/__openerp__.py @@ -0,0 +1,23 @@ +{ + 'name': 'Signup', + 'description': 'Allow users to register', + 'author': 'OpenERP SA', + 'version': '1.0', + 'category': 'Tools', + 'website': 'http://www.openerp.com', + 'installable': True, + 'depends': ['anonymous', 'base_setup'], + 'data': [ + 'signup_wizard.xml', + 'res_config.xml', + ], + 'js': [ + 'static/src/js/signup.js', + ], + #'css': [ + # 'static/src/css/reset_password.css', + #], + 'qweb': [ + 'static/src/xml/signup.xml', + ], +} diff --git a/addons/signup/res_config.py b/addons/signup/res_config.py new file mode 100644 index 00000000000..0c8ab8023d8 --- /dev/null +++ b/addons/signup/res_config.py @@ -0,0 +1,19 @@ +from openerp.osv import osv, fields + +class ResConfig(osv.TransientModel): + _inherit = 'base.config.settings' + + _columns = { + 'signup_user_template_id': fields.many2one('res.users', 'Template user for account creation') + } + + def get_default_user_tpl(self, cr, uid, fields, context=None): + icp = self.pool.get('ir.config_parameter') + return { + 'signup_user_template_id': icp.get_param(cr, uid, 'signup.user_template_id', 0) or False + } + + def set_user_template(self, cr, uid, ids, context=None): + config = self.browse(cr, uid, ids[0], context=context) + icp = self.pool.get('ir.config_parameter') + icp.set_param(cr, uid, 'signup.user_template_id', config.signup_user_template_id.id) diff --git a/addons/signup/res_config.xml b/addons/signup/res_config.xml new file mode 100644 index 00000000000..d2c85a33fd5 --- /dev/null +++ b/addons/signup/res_config.xml @@ -0,0 +1,16 @@ + + + + Inherit General Settings + base.config.settings + + form + + + + + + + + + diff --git a/addons/signup/signup_wizard.py b/addons/signup/signup_wizard.py new file mode 100644 index 00000000000..939e90aa21d --- /dev/null +++ b/addons/signup/signup_wizard.py @@ -0,0 +1,65 @@ +from functools import partial +from openerp.osv import osv, fields + +class res_users(osv.Model): + _inherit = 'res.users' + + _sql_constraints = [ + ('email_uniq', 'UNIQUE (user_email)', 'You can not have two users with the same email!') + ] + + +class signup_wizard(osv.TransientModel): + _name = 'signup.wizard' + _columns = { + 'name': fields.char('Name', size=64), + 'email': fields.char('Email', size=64), + 'pw': fields.char('Password', size=64), + 'cpw': fields.char('Confirm Password', size=64), + 'state': fields.selection([(x, x) for x in 'draft done missmatch'.split()], required=True), + } + _defaults = { + 'state': 'draft', + } + + def create(self, cr, uid, values, context=None): + # NOTE here, invalid values raises exceptions to avoid storing + # sensitive data into the database (which then are available to anyone) + + name = values.get('name') + email = values.get('email') + pw = values.get('pw') + cpw = values.get('cpw') + + if pw != cpw: + raise osv.except_osv('Error', 'Passwords missmatch') + + Users = self.pool.get('res.users') + + user_template_id = self.pool.get('ir.config_parameter').get_param(cr, uid, 'signup.user_template_id', 0) + if user_template_id: + func = partial(Users.copy, cr, 1, user_template_id, context=context) + else: + func = partial(Users.create, cr, 1, context=context) + + func({ + 'name': name, + 'login': email, + 'user_email': email, + 'password': pw, + 'active': True, + }) + + values = {'state': 'done'} + return super(signup_wizard, self).create(cr, uid, values, context) + + def signup(self, cr, uid, ids, context=None): + return { + 'type': 'ir.actions.client', + 'tag': 'login', + } + + def onchange_pw(self, cr, uid, ids, pw, cpw, context=None): + if pw != cpw: + return {'value': {'state': 'missmatch'}} + return {'value': {'state': 'draft'}} diff --git a/addons/signup/signup_wizard.xml b/addons/signup/signup_wizard.xml new file mode 100644 index 00000000000..ec5095ff474 --- /dev/null +++ b/addons/signup/signup_wizard.xml @@ -0,0 +1,41 @@ + + + + + signup.wizard.form + signup.wizard + form + +
    + + + + + + + +
    Passwords missmatch
    +
    + + +
    From 13458db46f61545b63c11a60137ab2e9d8f27d9c Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Thu, 28 Jun 2012 17:18:44 +0530 Subject: [PATCH 059/591] added a bounce effect when On non editable page view, if click on the content of a field, bounce the Edit button bzr revid: pan@tinyerp.com-20120628114844-3c1rv4ckk888yhzo --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 2dc954c414d..09c8ac67dfc 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -584,7 +584,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM }, on_invalidclick: function() { this.$element.find(".oe_form_field").click(function () { - $(".oe_form_button_edit").effect("bounce", { times:3,distance:100 }, 500); + $(".oe_form_button_edit").effect("bounce", { times:3}, 500); }); }, on_button_cancel: function(event) { From 4abbbe1e6a0775f0b54aa4975c70b7940eb7d408 Mon Sep 17 00:00:00 2001 From: "Mustufa Rangwala (OpenERP)" Date: Fri, 29 Jun 2012 12:38:29 +0530 Subject: [PATCH 060/591] [IMP] Clean code bzr revid: mra@tinyerp.com-20120629070829-whk2yy9ilhojf7vf --- addons/l10n_in/installer.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/l10n_in/installer.py b/addons/l10n_in/installer.py index 83a63fba122..5342e6c50bc 100644 --- a/addons/l10n_in/installer.py +++ b/addons/l10n_in/installer.py @@ -26,10 +26,10 @@ import tools class l10n_installer(osv.osv_memory): _inherit = 'account.installer' _columns = { - 'company_type': fields.selection([('public_company', 'Public Firm'), + 'company_type': fields.selection([('public_company', 'Public Firm'), ('partnership_private_company', 'Partnership/Private Firm') - ], 'Company Type', required=True, - help='Company Type is used to install Indian chart of accounts as per need of business.'), + ], 'Company Type', required=True, + help='Company Type is used to install Indian chart of accounts as per need of business.'), } _defaults = { 'company_type': 'public_company', @@ -42,7 +42,7 @@ class l10n_installer(osv.osv_memory): res = super(l10n_installer, self).execute_simple(cr, uid, ids, context=context) for chart in self.read(cr, uid, ids, context=context): - if chart['charts'] =='l10n_in' and chart['company_type']=='public_company': + if chart['charts'] == 'l10n_in' and chart['company_type'] == 'public_company': acc_file_path = tools.file_open(opj('l10n_in', 'l10n_in_public_firm_chart.xml')) tools.convert_xml_import(cr, 'l10n_in', acc_file_path, {}, 'init', True, None) acc_file_path.close() @@ -51,7 +51,7 @@ class l10n_installer(osv.osv_memory): tools.convert_xml_import(cr, 'l10n_in', tax_file_path, {}, 'init', True, None) tax_file_path.close() - elif chart['charts'] =='l10n_in' and chart['company_type']=='partnership_private_company': + elif chart['charts'] == 'l10n_in' and chart['company_type'] == 'partnership_private_company': acc_file_path = tools.file_open(opj('l10n_in', 'l10n_in_partnership_private_chart.xml')) tools.convert_xml_import(cr, 'l10n_in', acc_file_path, {}, 'init', True, None) acc_file_path.close() @@ -62,4 +62,4 @@ class l10n_installer(osv.osv_memory): return res -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From e748c3d4cf18eb3e8defde43f46ee3eeeff0404c Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Fri, 29 Jun 2012 12:52:48 +0530 Subject: [PATCH 061/591] improoved code for [added a bounce effect when On non editable page view, if click on the content of a field, bounce the Edit button] bzr revid: pan@tinyerp.com-20120629072248-kb0vfjjo707l8vaj --- addons/web/static/src/css/base.css | 5 +---- addons/web/static/src/js/view_form.js | 7 +++++-- addons/web/static/src/xml/base.xml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 2f4111882c4..f738fe757ac 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2215,7 +2215,4 @@ } .kitten-mode-activated > * { opacity: 0.7; -} -.openerp .bounce { - float:left; -} +} \ No newline at end of file diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 09c8ac67dfc..65f825c6cf5 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -582,8 +582,11 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM self.set({mode: "view"}); }); }, - on_invalidclick: function() { - this.$element.find(".oe_form_field").click(function () { + on_invalidclick: function() { + var div = $("
    ", {id:"bounce"}); + this.$element.find(".oe_form_field").click(function () { + $(".oe_form_button_edit").wrap(div); + $("#bounce").css({"float":"left","margin-right":"4px"}); $(".oe_form_button_edit").effect("bounce", { times:3}, 500); }); }, diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 641d37a818a..02ff528b993 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -679,8 +679,8 @@
    - -
    + + From 58d7c74c1dfba66a1e56f1524d0a54bc59744b43 Mon Sep 17 00:00:00 2001 From: ggh-openerp Date: Fri, 29 Jun 2012 13:11:24 +0530 Subject: [PATCH 062/591] [IMP]If the user clicks on an empty row of a list, bounce the Create button bzr revid: ggh@tinyerp.com-20120629074124-vxh7ngcyvqvb9zok --- addons/web/static/src/js/view_list.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index b5634c3443f..848c2934b17 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -285,6 +285,8 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi this.$element.find('.oe_list_buttons').replaceWith(this.$buttons); } this.$buttons.find('.oe_list_add') + .wrap("
    ") + .css({"float":"left","margin-right":"4px"}) .click(this.proxy('do_add_record')) .prop('disabled', grouped && this.options.editable); this.$buttons.on('click', '.oe_list_button_import', function() { @@ -978,6 +980,11 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. } self.row_clicked(e); } + else{ + if (opts.options.$buttons){ + $(opts.options.$buttons.find('.oe_list_add')).effect("bounce", { times:5 }, 300); + } + } }); }, row_clicked: function (e, view) { From 64e33e43e17e79a3dfc6106927a60adf05ad8b28 Mon Sep 17 00:00:00 2001 From: "Mustufa Rangwala (OpenERP)" Date: Fri, 29 Jun 2012 14:14:29 +0530 Subject: [PATCH 063/591] [IMP] licence changed bzr revid: mra@tinyerp.com-20120629084429-0lsk4mvbdlanhvdj --- addons/l10n_in/__init__.py | 35 ++++++++++++++--------------------- addons/l10n_in/__openerp__.py | 4 ++-- addons/l10n_in/installer.py | 2 +- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/addons/l10n_in/__init__.py b/addons/l10n_in/__init__.py index f97bda7fb89..975dcf5aa59 100644 --- a/addons/l10n_in/__init__.py +++ b/addons/l10n_in/__init__.py @@ -1,32 +1,25 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # -# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved. -# Fabien Pinckaers +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). # -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company +# 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 Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# 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. # -# 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # ############################################################################## + import installer # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_in/__openerp__.py b/addons/l10n_in/__openerp__.py index 630d99ca8db..06b254605a7 100644 --- a/addons/l10n_in/__openerp__.py +++ b/addons/l10n_in/__openerp__.py @@ -1,8 +1,8 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). +# 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 diff --git a/addons/l10n_in/installer.py b/addons/l10n_in/installer.py index 5342e6c50bc..3568f04d2dd 100644 --- a/addons/l10n_in/installer.py +++ b/addons/l10n_in/installer.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). +# 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 From 1a61a20dbbc0ea716aed59b3d71374a8a2b2e4fc Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Fri, 29 Jun 2012 17:53:47 +0530 Subject: [PATCH 064/591] [IMP] stock : Destination address should be the company by default. bzr revid: mdi@tinyerp.com-20120629122347-iswqb89471fas9gg --- addons/stock/stock.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index a279b8bea6c..1407f96f05b 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1726,10 +1726,16 @@ class stock_move(osv.osv): if location_xml_id: location_model, location_id = mod_obj.get_object_reference(cr, uid, 'stock', location_xml_id) return location_id + + def _default_destination_address(self, cr, uid, context=None): + partner_obj = self.pool.get('res.partner') + partner_ids = partner_obj.search(cr, uid, [('name', '=', 'Your Company')], context=context) + return partner_ids and partner_ids[0] or False _defaults = { 'location_id': _default_location_source, 'location_dest_id': _default_location_destination, + 'partner_id': _default_destination_address, 'state': 'draft', 'priority': '1', 'product_qty': 1.0, From e0e7597aa037206d34912420cf77c3a1681ab130 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Fri, 29 Jun 2012 14:52:09 +0200 Subject: [PATCH 065/591] [IMP] start the portal's contact page new layout bzr revid: abo@openerp.com-20120629125209-03wbu806i8mi2ab7 --- addons/portal_crm/wizard/contact.py | 17 +++++++ addons/portal_crm/wizard/contact_view.xml | 56 +++++++++++++++++++---- 2 files changed, 63 insertions(+), 10 deletions(-) diff --git a/addons/portal_crm/wizard/contact.py b/addons/portal_crm/wizard/contact.py index be21decafa9..7ea4d094ac3 100644 --- a/addons/portal_crm/wizard/contact.py +++ b/addons/portal_crm/wizard/contact.py @@ -5,6 +5,23 @@ class crm_contact_us(osv.TransientModel): _name = 'portal_crm.crm_contact_us' _description = 'Contact form for the portal' _inherit = 'crm.lead' + _columns = { + 'company_ids' : fields.many2many('res.company', string='Companies', readonly=True), + 'employee_ids' : fields.many2many('hr.employee', string='Employees', readonly=True), + } + + def _get_employee(self, cr, uid, context=None): + r = self.pool.get('hr.employee').search(cr, uid, [], context=context) + return r + + def _get_companies(self, cr, uid, context=None): + r = self.pool.get('res.company').search(cr, uid, [], context=context) + return r + + _defaults = { + 'employee_ids' : _get_employee, + 'company_ids' : _get_companies + } def create(self, cr, uid, values, context=None): """ diff --git a/addons/portal_crm/wizard/contact_view.xml b/addons/portal_crm/wizard/contact_view.xml index 904326ea409..3e4afa067f6 100644 --- a/addons/portal_crm/wizard/contact_view.xml +++ b/addons/portal_crm/wizard/contact_view.xml @@ -8,16 +8,52 @@ portal_crm.crm_contact_us form - - - - - - - -