From fb3f7aa747d4d196abd3963ef1cbdfae910551a5 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Tue, 10 Jan 2012 13:35:59 +0100 Subject: [PATCH 0001/1775] [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 0002/1775] [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 0003/1775] [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 0004/1775] [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 0005/1775] [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 0006/1775] [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 c9f3b0f46a833adb32e11ccdddd03c2fc9afcbfc Mon Sep 17 00:00:00 2001 From: florian da Costa Date: Mon, 27 Feb 2012 16:06:20 -0300 Subject: [PATCH 0007/1775] [FIX] fixed sale order line properties not copied in procurement bug lp bug: https://launchpad.net/bugs/926107 fixed bzr revid: florian.dacosta@akretion.com.br-20120227190620-ltdpop07hggjc9lb --- addons/sale/sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 82bfda7b580..5dca3d432f0 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -720,7 +720,8 @@ class sale_order(osv.osv): 'procure_method': line.type, 'move_id': move_id, 'company_id': order.company_id.id, - 'note': line.notes + 'note': line.notes, + 'property_ids': [(6, 0, [x.id for x in line.property_ids])] } def _prepare_order_line_move(self, cr, uid, order, line, picking_id, date_planned, context=None): From 1bf3b3b515737f6fd929250cf7f7c0d1e03a1ddf Mon Sep 17 00:00:00 2001 From: Date: Thu, 1 Mar 2012 13:21:24 +0100 Subject: [PATCH 0008/1775] [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 befafc71d54b9a2ac0226f97520da5b918b4e465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Mon, 19 Mar 2012 12:20:15 +0100 Subject: [PATCH 0009/1775] [imp] add required jquery plugin bzr revid: rlo@openerp.com-20120319112015-788gds4aioshyvco --- .../src/js/jquery.barcodelistener-1.1-min.js | 1 + .../src/js/jquery.barcodelistener-1.1.js | 79 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js create mode 100644 addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1.js diff --git a/addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js b/addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js new file mode 100644 index 00000000000..f3b7c205dbf --- /dev/null +++ b/addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js @@ -0,0 +1 @@ +(function(a){jQuery.fn.BarcodeListener=function(b,c){char0=new Array("","32");char1=new Array("~","732");settings=new Array(char0,char1);if(b){jQuery.extend(settings,b)}a("body").append('
');a(document).keypress(function(d){if(d.which==settings[0][1]){if(settings.length-1>0){wlBUJTIw=1;xaWi4Y4y=true;while((wlBUJTIw"); + + // intercetta barcode reader con sequenza di caratteri ~ + $(document).keypress(function(e) { + if (e.which == settings[0][1]) { + if(settings.length-1>0) { + wlBUJTIw = 1; + xaWi4Y4y = true; + while ((wlBUJTIw < settings.length) && (xaWi4Y4y == true)) { + $(document).keypress(function(e) { + if (e.which == settings[wlBUJTIw][1]) { + xaWi4Y4y = true; + } else { + xaWi4Y4y = false; + } + }); + wlBUJTIw++; + } + if (xaWi4Y4y == true) { + $("#L3ZitQdL").val("").focus(); + } + } else { + $("#L3ZitQdL").val("").focus(); + } + + // event propagation + e.cancelBubble = true; + e.returnValue = false; + + if (e.stopPropagation) { + e.stopPropagation(); + e.preventDefault(); + } + + } + }); + + // intercetta invio del form + $("#29LLRUZk").submit(function() { + code = $("#L3ZitQdL").val(); + for (i=0; i Date: Tue, 20 Mar 2012 09:47:05 +0100 Subject: [PATCH 0010/1775] [fix] move jquery.barcodelistener bzr revid: rlo@openerp.com-20120320084705-2s7lewxb8x2hkg0z --- addons/point_of_sale/__openerp__.py | 2 +- .../src/js/jquery.barcodelistener-1.1-min.js | 1 - .../src/js/jquery.barcodelistener-1.1.js | 79 ------------------- addons/point_of_sale/static/src/js/pos.js | 9 +++ 4 files changed, 10 insertions(+), 81 deletions(-) delete mode 100644 addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js delete mode 100644 addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1.js diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index 911ccf24bb5..43376663170 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -82,7 +82,7 @@ Main features : 'application': True, 'certificate' : '001156338024966477869', # Web client - 'js': ['static/lib/backbone/backbone-0.5.3.js', 'static/src/js/pos.js'], + 'js': ['static/lib/backbone/backbone-0.5.3.js', 'static/src/js/pos.js', 'static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1-min.js'], 'css': ['static/src/css/pos.css'], 'qweb': ['static/src/xml/pos.xml'], } diff --git a/addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js b/addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js deleted file mode 100644 index f3b7c205dbf..00000000000 --- a/addons/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){jQuery.fn.BarcodeListener=function(b,c){char0=new Array("","32");char1=new Array("~","732");settings=new Array(char0,char1);if(b){jQuery.extend(settings,b)}a("body").append('
');a(document).keypress(function(d){if(d.which==settings[0][1]){if(settings.length-1>0){wlBUJTIw=1;xaWi4Y4y=true;while((wlBUJTIw"); - - // intercetta barcode reader con sequenza di caratteri ~ - $(document).keypress(function(e) { - if (e.which == settings[0][1]) { - if(settings.length-1>0) { - wlBUJTIw = 1; - xaWi4Y4y = true; - while ((wlBUJTIw < settings.length) && (xaWi4Y4y == true)) { - $(document).keypress(function(e) { - if (e.which == settings[wlBUJTIw][1]) { - xaWi4Y4y = true; - } else { - xaWi4Y4y = false; - } - }); - wlBUJTIw++; - } - if (xaWi4Y4y == true) { - $("#L3ZitQdL").val("").focus(); - } - } else { - $("#L3ZitQdL").val("").focus(); - } - - // event propagation - e.cancelBubble = true; - e.returnValue = false; - - if (e.stopPropagation) { - e.stopPropagation(); - e.preventDefault(); - } - - } - }); - - // intercetta invio del form - $("#29LLRUZk").submit(function() { - code = $("#L3ZitQdL").val(); - for (i=0; i Date: Tue, 20 Mar 2012 09:47:29 +0100 Subject: [PATCH 0011/1775] [fix] move jquery.barcodelistener bzr revid: rlo@openerp.com-20120320084729-x2zo7n01jamsfkt5 --- .../jquery.barcodelistener-1.1-min.js | 1 + .../jquery.barcodelistener-1.1.js | 79 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 addons/point_of_sale/static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1-min.js create mode 100644 addons/point_of_sale/static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1.js diff --git a/addons/point_of_sale/static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1-min.js b/addons/point_of_sale/static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1-min.js new file mode 100644 index 00000000000..f3b7c205dbf --- /dev/null +++ b/addons/point_of_sale/static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1-min.js @@ -0,0 +1 @@ +(function(a){jQuery.fn.BarcodeListener=function(b,c){char0=new Array("","32");char1=new Array("~","732");settings=new Array(char0,char1);if(b){jQuery.extend(settings,b)}a("body").append('
');a(document).keypress(function(d){if(d.which==settings[0][1]){if(settings.length-1>0){wlBUJTIw=1;xaWi4Y4y=true;while((wlBUJTIw"); + + // intercetta barcode reader con sequenza di caratteri ~ + $(document).keypress(function(e) { + if (e.which == settings[0][1]) { + if(settings.length-1>0) { + wlBUJTIw = 1; + xaWi4Y4y = true; + while ((wlBUJTIw < settings.length) && (xaWi4Y4y == true)) { + $(document).keypress(function(e) { + if (e.which == settings[wlBUJTIw][1]) { + xaWi4Y4y = true; + } else { + xaWi4Y4y = false; + } + }); + wlBUJTIw++; + } + if (xaWi4Y4y == true) { + $("#L3ZitQdL").val("").focus(); + } + } else { + $("#L3ZitQdL").val("").focus(); + } + + // event propagation + e.cancelBubble = true; + e.returnValue = false; + + if (e.stopPropagation) { + e.stopPropagation(); + e.preventDefault(); + } + + } + }); + + // intercetta invio del form + $("#29LLRUZk").submit(function() { + code = $("#L3ZitQdL").val(); + for (i=0; i Date: Tue, 20 Mar 2012 09:51:11 +0100 Subject: [PATCH 0012/1775] [fix] move jquery.barcodelistener bzr revid: rlo@openerp.com-20120320085111-s9i0l92u9vkushrh --- addons/point_of_sale/static/src/js/pos.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index e64f0232d62..e90b524960f 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1328,11 +1328,10 @@ openerp.point_of_sale = function(db) { pos.app = new App(self.$element); - $.getScript('/point_of_sale/static/src/js/jquery.barcodelistener-1.1-min.js'); char0 = new Array("§", "32"); char1 = new Array("˜", "732"); characters = new Array(char0, char1); - new jQuery.fn.BarcodeListener(characters, function(code) {console.log('<<<<<<<<<<<<<<<');}); + db.webclient.BarcodeListener(characters, function(code) {console.log('<<<<<<<<<<<<<<<');}); db.webclient.set_content_full_screen(true); From 0f0ecfd90f341deb47b1f06d21821089db5b76e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Tue, 20 Mar 2012 16:46:20 +0100 Subject: [PATCH 0013/1775] [imp] bzr revid: rlo@openerp.com-20120320154620-c5f5o2og5dmai7je --- .../jquery.barcodelistener-1.1-min.js | 1 - .../jquery.barcodelistener-1.1.js | 79 ------------------- addons/point_of_sale/static/src/js/pos.js | 34 ++++++-- 3 files changed, 28 insertions(+), 86 deletions(-) delete mode 100644 addons/point_of_sale/static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1-min.js delete mode 100644 addons/point_of_sale/static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1.js diff --git a/addons/point_of_sale/static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1-min.js b/addons/point_of_sale/static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1-min.js deleted file mode 100644 index f3b7c205dbf..00000000000 --- a/addons/point_of_sale/static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1-min.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){jQuery.fn.BarcodeListener=function(b,c){char0=new Array("","32");char1=new Array("~","732");settings=new Array(char0,char1);if(b){jQuery.extend(settings,b)}a("body").append('
');a(document).keypress(function(d){if(d.which==settings[0][1]){if(settings.length-1>0){wlBUJTIw=1;xaWi4Y4y=true;while((wlBUJTIw"); - - // intercetta barcode reader con sequenza di caratteri ~ - $(document).keypress(function(e) { - if (e.which == settings[0][1]) { - if(settings.length-1>0) { - wlBUJTIw = 1; - xaWi4Y4y = true; - while ((wlBUJTIw < settings.length) && (xaWi4Y4y == true)) { - $(document).keypress(function(e) { - if (e.which == settings[wlBUJTIw][1]) { - xaWi4Y4y = true; - } else { - xaWi4Y4y = false; - } - }); - wlBUJTIw++; - } - if (xaWi4Y4y == true) { - $("#L3ZitQdL").val("").focus(); - } - } else { - $("#L3ZitQdL").val("").focus(); - } - - // event propagation - e.cancelBubble = true; - e.returnValue = false; - - if (e.stopPropagation) { - e.stopPropagation(); - e.preventDefault(); - } - - } - }); - - // intercetta invio del form - $("#29LLRUZk").submit(function() { - code = $("#L3ZitQdL").val(); - for (i=0; i= 48 && e.keyCode <= 57) { + // a number + if (codeNumbers.length==0) { + codeNumbers.timeStamp = new Date().getTime() + } else { + if (codeNumbers.lastTimeStamp + 30 < new Date().getTime()) { + // not a barcode reader + console.log(e) + codeNumbers = [] + codeNumbers.timeStamp = new Date().getTime() + } + } + codeNumbers.push(e.keyCode - 48) + codeNumbers.lastTimeStamp = new Date().getTime() + if (codeNumbers.length == 13) { + // a barcode reader + console.log('barcode: ' + codeNumbers.join()) + codeNumbers = [] + } + } else { + // NaN + codeNumbers = [] + } + }) $('.searchbox input').keyup(function() { var m, s; s = $(this).val().toLowerCase(); @@ -1323,15 +1351,9 @@ openerp.point_of_sale = function(db) { this.$element.find("#loggedas button").click(function() { self.try_close(); }); - // TODO bind barcode reader event - console.log('--------------------'); pos.app = new App(self.$element); - char0 = new Array("§", "32"); - char1 = new Array("˜", "732"); - characters = new Array(char0, char1); - db.webclient.BarcodeListener(characters, function(code) {console.log('<<<<<<<<<<<<<<<');}); db.webclient.set_content_full_screen(true); From 2f0d87381b85b2fe3f21c68450a8375c7507be60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Wed, 21 Mar 2012 10:43:11 +0100 Subject: [PATCH 0014/1775] [imp] barcode reader events are successfully delegated bzr revid: rlo@openerp.com-20120321094311-bb12qnp46ch29pt1 --- addons/point_of_sale/static/src/js/pos.js | 50 +++++++++++------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 83fb7b31930..0ee945a2130 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1259,34 +1259,34 @@ openerp.point_of_sale = function(db) { }); (this.shop.get('products')).reset(products); var self = this; - // bind barcode reader event - codeNumbers = [] - $('.openerp').keypress(function (e){ - console.log('keyup!!!') - if (e.keyCode >= 48 && e.keyCode <= 57) { - // a number - if (codeNumbers.length==0) { - codeNumbers.timeStamp = new Date().getTime() - } else { - if (codeNumbers.lastTimeStamp + 30 < new Date().getTime()) { - // not a barcode reader - console.log(e) - codeNumbers = [] - codeNumbers.timeStamp = new Date().getTime() - } - } - codeNumbers.push(e.keyCode - 48) - codeNumbers.lastTimeStamp = new Date().getTime() - if (codeNumbers.length == 13) { - // a barcode reader - console.log('barcode: ' + codeNumbers.join()) - codeNumbers = [] - } + // bind barcode reader event + codeNumbers = [] + $('body').delegate('','keyup', function (e){ + console.log('keyup!!!') + if (e.keyCode >= 48 && e.keyCode <= 57) { + // a number + if (codeNumbers.length==0) { + codeNumbers.timeStamp = new Date().getTime() } else { - // NaN + if (codeNumbers.lastTimeStamp + 30 < new Date().getTime()) { + // not a barcode reader + console.log(e) + codeNumbers = [] + codeNumbers.timeStamp = new Date().getTime() + } + } + codeNumbers.push(e.keyCode - 48) + codeNumbers.lastTimeStamp = new Date().getTime() + if (codeNumbers.length == 13) { + // a barcode reader + console.log('barcode: ' + codeNumbers.join()) codeNumbers = [] } - }) + } else { + // NaN + codeNumbers = [] + } + }) $('.searchbox input').keyup(function() { var m, s; s = $(this).val().toLowerCase(); From 1677026b0bd5b605db675b06adebe7f37f5fb758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Wed, 21 Mar 2012 11:04:14 +0100 Subject: [PATCH 0015/1775] [imp] unbind barcode reader events when closing point of sale bzr revid: rlo@openerp.com-20120321100414-h5qsu1qumbil8uks --- addons/point_of_sale/static/src/js/pos.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 0ee945a2130..90aa47f4be6 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1403,6 +1403,9 @@ openerp.point_of_sale = function(db) { }, this)); }, close: function() { + // remove barcode reader event listener + $('body').undelegate('', 'keyup') + return new db.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_pos_close_statement']], ['res_id']).pipe( _.bind(function(res) { return this.rpc('/web/action/load', {'action_id': res[0]['res_id']}).pipe(_.bind(function(result) { From 8cab1f54c21cb808a7c6afb0d4f1c63ce2c35fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Wed, 21 Mar 2012 14:33:29 +0100 Subject: [PATCH 0016/1775] [imp] barcode tooltip bzr revid: rlo@openerp.com-20120321133329-h447mmid36nekbak --- addons/product/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index 0d5fa31ac11..8408909b57e 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -517,7 +517,7 @@ class product_product(osv.osv): 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the product without removing it."), 'variants': fields.char('Variants', size=64), 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade"), - 'ean13': fields.char('EAN13', size=13), + 'ean13': fields.char('EAN13', size=13, help='Barcode'), 'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."), 'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Sale Price')), 'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Sale Price')), From 3b81d145b4256dca9fe5b793d7431112cf857b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Thu, 22 Mar 2012 10:25:58 +0100 Subject: [PATCH 0017/1775] [imp] get the barcode of each product during the init method of the point of sale. Thus, the product can be detected using its barcode. Insertion into the current order still pending bzr revid: rlo@openerp.com-20120322092558-sw7pll78qim6v51q --- addons/point_of_sale/static/src/js/pos.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 90aa47f4be6..4a5a3952603 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -85,7 +85,7 @@ openerp.point_of_sale = function(db) { }, this)); }, this)); $.when(this.fetch('pos.category', ['name', 'parent_id', 'child_id']), - this.fetch('product.product', ['name', 'list_price', 'pos_categ_id', 'taxes_id', 'product_image_small'], [['pos_categ_id', '!=', 'false']]), + this.fetch('product.product', ['name', 'list_price', 'pos_categ_id', 'taxes_id', 'product_image_small', 'ean13'], [['pos_categ_id', '!=', 'false']]), this.fetch('account.bank.statement', ['account_id', 'currency', 'journal_id', 'state', 'name'], [['state', '=', 'open'], ['user_id', '=', this.session.uid]]), this.fetch('account.journal', ['auto_cash', 'check_dtls', 'currency', 'name', 'type']), @@ -1280,6 +1280,11 @@ openerp.point_of_sale = function(db) { if (codeNumbers.length == 13) { // a barcode reader console.log('barcode: ' + codeNumbers.join()) + selectedOrder = self.shop.get('selectedOrder') + products = pos.store.get('product.product') + scannedProduct = _.detect(products, function(el){return el.ean13 === codeNumbers.join('')}) + //TODO INSERT THE scannedProduct into the selectedOrder + codeNumbers = [] } } else { From 315a75679b534a1ed579cc54707c9ed484b5f5b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Thu, 22 Mar 2012 11:27:24 +0100 Subject: [PATCH 0018/1775] [imp] working integration barcode reader - point of sale order bzr revid: rlo@openerp.com-20120322102724-nfakdy4ug5pnm6he --- addons/point_of_sale/static/src/js/pos.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 4a5a3952603..6549a4f6678 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1262,7 +1262,6 @@ openerp.point_of_sale = function(db) { // bind barcode reader event codeNumbers = [] $('body').delegate('','keyup', function (e){ - console.log('keyup!!!') if (e.keyCode >= 48 && e.keyCode <= 57) { // a number if (codeNumbers.length==0) { @@ -1281,9 +1280,9 @@ openerp.point_of_sale = function(db) { // a barcode reader console.log('barcode: ' + codeNumbers.join()) selectedOrder = self.shop.get('selectedOrder') - products = pos.store.get('product.product') - scannedProduct = _.detect(products, function(el){return el.ean13 === codeNumbers.join('')}) - //TODO INSERT THE scannedProduct into the selectedOrder + productsCollection = self.shop.get('products') + scannedProductModel = _.detect(productsCollection.models, function(pc) { return pc.attributes.ean13 === codeNumbers.join('')}) + selectedOrder.addProduct(scannedProductModel) codeNumbers = [] } From 9e5f88c24351bd275b45e7b48fa1ef9c5551a76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Thu, 22 Mar 2012 11:57:20 +0100 Subject: [PATCH 0019/1775] [imp] add demo data bzr revid: rlo@openerp.com-20120322105720-o9ygtir59x3lokv7 --- addons/point_of_sale/point_of_sale_demo.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/point_of_sale/point_of_sale_demo.xml b/addons/point_of_sale/point_of_sale_demo.xml index 1e4b2ec7c35..3638b0faa72 100644 --- a/addons/point_of_sale/point_of_sale_demo.xml +++ b/addons/point_of_sale/point_of_sale_demo.xml @@ -672,6 +672,7 @@ 0.83 Belle-Vue Kriek 25cl + 5410228193449 /9j/4AAQSkZJRgABAAEBLAEsAAD/2wCEAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9PjsBCwoKDg0OHBYWHCgoKCgoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O//AABEIAGQAYAMBEQACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFh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GQt5qenTRxrNAYschoWJzjt82fzzx71m6UlsyudFa81a3k08CGyhVjwrEFmH5nH6U1S7thzj0iOgapLp1/bB5I1VhvyGG5Q3BBHr3zTdO+wlIWfUdMe681lmjZOPKWTIfPocfL78HNT7KQ+ZFq1gj8Ra/bada2ihpw2SGZm4UnvwOnpVRp2tqKUtCrpWowRW7rPaIXHDFSUY/wBP0odJ9GHOiS1v9MjmLoJpN/OwybdnsTj5v04x+E+zkx8yO7+GdnZ6zqsjm2CR2JWZdhPMmfl3E59zxjpWkYWerIlLQ9crQzIL2yttRs5bO7iWWCZdro3cUmrgcJd/BvQ5mb7NeXdujfwZVwPpkZo1Hcfp/wAHfD1o2bme6uxkEozBFP1wM/rRqFzpNd8IaRr+jw6XcwmKG3x5BhO0xYGOPw7UNAmcRdfBC2mI8rXHRR2a2DH89wpajujR0X4P6Ppt3Dc3l3NfNAwZUKhELA5yRkk/nRYLm14n8AaN4puUvLkSw3aLtE0R6gdAQeDTsJM5N/gbaPOZBrkqj0+zj+e6lZjujqvC3w+0jwrcNd27S3F2ylfOlI+UdwAOn607CbKms/CzQdUupbuAy2U0xLP5eChPc7T0/AigLmJD8EbKOXc2tTMvoIAD+eaNR3O38OeF9N8L2bW2no+ZCDJJI2WcjpmhITdzYpiAAP/Z From cc3e6d9b172564ecf3fa8eeb7c1c5a202c7dcd3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Thu, 22 Mar 2012 13:20:29 +0100 Subject: [PATCH 0020/1775] [fix] remove unused js import bzr revid: rlo@openerp.com-20120322122029-5sy4luezyaf8c57m --- addons/point_of_sale/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index 43376663170..911ccf24bb5 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -82,7 +82,7 @@ Main features : 'application': True, 'certificate' : '001156338024966477869', # Web client - 'js': ['static/lib/backbone/backbone-0.5.3.js', 'static/src/js/pos.js', 'static/lib/jquery-barcodelistener/jquery.barcodelistener-1.1-min.js'], + 'js': ['static/lib/backbone/backbone-0.5.3.js', 'static/src/js/pos.js'], 'css': ['static/src/css/pos.css'], 'qweb': ['static/src/xml/pos.xml'], } From 36e5619bf3e63cface457ecd265464fe8ffcbf5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Thu, 22 Mar 2012 14:05:19 +0100 Subject: [PATCH 0021/1775] [fix] clean debug output and improve digits detection bzr revid: rlo@openerp.com-20120322130519-0zxr8wif2sl3nr47 --- addons/point_of_sale/static/src/js/pos.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 6549a4f6678..b3d737dfb87 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1262,14 +1262,13 @@ openerp.point_of_sale = function(db) { // bind barcode reader event codeNumbers = [] $('body').delegate('','keyup', function (e){ - if (e.keyCode >= 48 && e.keyCode <= 57) { + if (!isNaN(Number(String.fromCharCode(e.keyCode)))) { // a number if (codeNumbers.length==0) { codeNumbers.timeStamp = new Date().getTime() } else { if (codeNumbers.lastTimeStamp + 30 < new Date().getTime()) { // not a barcode reader - console.log(e) codeNumbers = [] codeNumbers.timeStamp = new Date().getTime() } From 337fe0c8eef34ac72ee6a90b71f1e934807662e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Thu, 22 Mar 2012 15:08:14 +0100 Subject: [PATCH 0022/1775] [fix] bzr revid: rlo@openerp.com-20120322140814-mvo7e1qh4svom3tw --- addons/point_of_sale/static/src/js/pos.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index b3d737dfb87..9c92e5233d0 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1356,8 +1356,6 @@ openerp.point_of_sale = function(db) { }); pos.app = new App(self.$element); - - db.webclient.set_content_full_screen(true); if (pos.store.get('account.bank.statement').length === 0) From 7fc89ff1d8b30117284cfb0d829b39a02df06d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Fri, 23 Mar 2012 15:31:36 +0100 Subject: [PATCH 0023/1775] =?UTF-8?q?[imp]=20modified=20code=20after=20St?= =?UTF-8?q?=C3=A9phane=20instructions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bzr revid: rlo@openerp.com-20120323143136-0qhzjnttnxei7xpi --- addons/point_of_sale/static/src/js/pos.js | 33 +++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 9c92e5233d0..53b7b01037e 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1260,7 +1260,7 @@ openerp.point_of_sale = function(db) { (this.shop.get('products')).reset(products); var self = this; // bind barcode reader event - codeNumbers = [] + var codeNumbers = [] $('body').delegate('','keyup', function (e){ if (!isNaN(Number(String.fromCharCode(e.keyCode)))) { // a number @@ -1277,10 +1277,33 @@ openerp.point_of_sale = function(db) { codeNumbers.lastTimeStamp = new Date().getTime() if (codeNumbers.length == 13) { // a barcode reader - console.log('barcode: ' + codeNumbers.join()) - selectedOrder = self.shop.get('selectedOrder') - productsCollection = self.shop.get('products') - scannedProductModel = _.detect(productsCollection.models, function(pc) { return pc.attributes.ean13 === codeNumbers.join('')}) + var barcode = codeNumbers.join('') + console.log('barcode: ' + barcode) + var selectedOrder = self.shop.get('selectedOrder') + var productsCollection = self.shop.get('products') + if (barcode.substring(0,2) in ['02', '22', '24', '26', '28']) { + // product with a specific price - specified into the barcode + barcode = barcode.substring(2,5) + // TODO conversion euro - old local currencies + price = Number(barcode.substring(7,5))/100 + weight = '' + } else if (barcode.substring(0,2) in ['21','23','27','29','25']) { + // product sold by weight + barcode = barcode.substring(2,5) + weight = Number(barcode.substring(7,5))/1000 + price = '' + } else { + // product unit + weight = '' + price = '' + } + var scannedProductModel = _.detect(productsCollection.models, function(pc) { return pc.attributes.ean13 === barcode}) + if (weight === '' and price !== '') { + scannedProductModel.price = price + } else if (weight !== '' and price === '') { + // TODO sell by weight: how to calculate the price? + scannedProductModel.price *= weight + } selectedOrder.addProduct(scannedProductModel) codeNumbers = [] From e398d3aa1207cb58f6d4ecede27747cfe62ba1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Mon, 26 Mar 2012 11:36:05 +0200 Subject: [PATCH 0024/1775] [fix] correct js syntax bzr revid: rlo@openerp.com-20120326093605-72k4ewcnw4xzmnid --- addons/point_of_sale/static/src/js/pos.js | 52 +++++++++++------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 53b7b01037e..84c4d695829 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1260,57 +1260,57 @@ openerp.point_of_sale = function(db) { (this.shop.get('products')).reset(products); var self = this; // bind barcode reader event - var codeNumbers = [] + var codeNumbers = []; $('body').delegate('','keyup', function (e){ if (!isNaN(Number(String.fromCharCode(e.keyCode)))) { // a number if (codeNumbers.length==0) { - codeNumbers.timeStamp = new Date().getTime() + codeNumbers.timeStamp = new Date().getTime(); } else { if (codeNumbers.lastTimeStamp + 30 < new Date().getTime()) { // not a barcode reader - codeNumbers = [] - codeNumbers.timeStamp = new Date().getTime() + codeNumbers = []; + codeNumbers.timeStamp = new Date().getTime(); } } - codeNumbers.push(e.keyCode - 48) - codeNumbers.lastTimeStamp = new Date().getTime() + codeNumbers.push(e.keyCode - 48); + codeNumbers.lastTimeStamp = new Date().getTime(); if (codeNumbers.length == 13) { // a barcode reader - var barcode = codeNumbers.join('') - console.log('barcode: ' + barcode) - var selectedOrder = self.shop.get('selectedOrder') - var productsCollection = self.shop.get('products') + var barcode = codeNumbers.join(''); + console.log('barcode: ' + barcode); + var selectedOrder = self.shop.get('selectedOrder'); + var productsCollection = self.shop.get('products'); if (barcode.substring(0,2) in ['02', '22', '24', '26', '28']) { // product with a specific price - specified into the barcode - barcode = barcode.substring(2,5) + barcode = barcode.substring(2,5); // TODO conversion euro - old local currencies - price = Number(barcode.substring(7,5))/100 - weight = '' + price = Number(barcode.substring(7,5))/100; + weight = ''; } else if (barcode.substring(0,2) in ['21','23','27','29','25']) { // product sold by weight - barcode = barcode.substring(2,5) - weight = Number(barcode.substring(7,5))/1000 - price = '' + barcode = barcode.substring(2,5); + weight = Number(barcode.substring(7,5))/1000; + price = ''; } else { // product unit - weight = '' - price = '' + weight = ''; + price = ''; } - var scannedProductModel = _.detect(productsCollection.models, function(pc) { return pc.attributes.ean13 === barcode}) - if (weight === '' and price !== '') { - scannedProductModel.price = price - } else if (weight !== '' and price === '') { + var scannedProductModel = _.detect(productsCollection.models, function(pc) { return pc.attributes.ean13 === barcode;}); + if (weight === '' && price !== '') { + scannedProductModel.price = price; + } else if (weight !== '' && price === '') { // TODO sell by weight: how to calculate the price? - scannedProductModel.price *= weight + scannedProductModel.price *= weight; } - selectedOrder.addProduct(scannedProductModel) + selectedOrder.addProduct(scannedProductModel); - codeNumbers = [] + codeNumbers = []; } } else { // NaN - codeNumbers = [] + codeNumbers = []; } }) $('.searchbox input').keyup(function() { From 08e30b83bf5759d7c75848ab8585e22f78f6fdf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Mon, 26 Mar 2012 14:27:43 +0200 Subject: [PATCH 0025/1775] [imp] warning product not recognized bzr revid: rlo@openerp.com-20120326122743-3m6c24j0dnb9c1yq --- addons/point_of_sale/static/src/js/pos.js | 18 +++++++++++++++++- addons/point_of_sale/static/src/xml/pos.xml | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 84c4d695829..70de88dd93e 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1298,10 +1298,26 @@ openerp.point_of_sale = function(db) { price = ''; } var scannedProductModel = _.detect(productsCollection.models, function(pc) { return pc.attributes.ean13 === barcode;}); + if (scannedProductModel == undefined) { + // product not recognized, raise warning + $(QWeb.render('pos-scan-warning')).dialog({ + resizable: false, + height:160, + modal: true, + title: "Warning", + buttons: { + "OK": function() { + $( this ).dialog( "close" ); + }, + } + }); + } if (weight === '' && price !== '') { + // product sold by price scannedProductModel.price = price; } else if (weight !== '' && price === '') { - // TODO sell by weight: how to calculate the price? + // product sold by weight + // TODO check how to calculate the price scannedProductModel.price *= weight; } selectedOrder.addProduct(scannedProductModel); diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index d24d16713d8..16192f208c8 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -141,6 +141,9 @@ + +
The product could not be recognized. Please contact an employee.
+
There are pending operations that could not be saved into the database, are you sure you want to exit?
From d849defd2a2cb0aa2827970e88e413fedc98ed01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Mon, 26 Mar 2012 16:39:00 +0200 Subject: [PATCH 0026/1775] [imp] dialog height bzr revid: rlo@openerp.com-20120326143900-qb6g01z9wsdzuyac --- addons/point_of_sale/static/src/js/pos.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 70de88dd93e..18c6511629f 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1302,7 +1302,7 @@ openerp.point_of_sale = function(db) { // product not recognized, raise warning $(QWeb.render('pos-scan-warning')).dialog({ resizable: false, - height:160, + height:220, modal: true, title: "Warning", buttons: { From e70087c87451593d897d2aa3cf98a65ce538c596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Tue, 27 Mar 2012 08:53:22 +0200 Subject: [PATCH 0027/1775] [imp] add control digit bzr revid: rlo@openerp.com-20120327065322-a7gegbmtrtjexn41 --- addons/point_of_sale/static/src/js/pos.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 18c6511629f..369c7fbc032 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1281,6 +1281,7 @@ openerp.point_of_sale = function(db) { console.log('barcode: ' + barcode); var selectedOrder = self.shop.get('selectedOrder'); var productsCollection = self.shop.get('products'); + var controlDigit = Number(barcode.charAt(12)); if (barcode.substring(0,2) in ['02', '22', '24', '26', '28']) { // product with a specific price - specified into the barcode barcode = barcode.substring(2,5); From b6fa154cbc153aef1db14cc44c5ecc15443a7b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Tue, 27 Mar 2012 10:25:45 +0200 Subject: [PATCH 0028/1775] [imp] add control digit bzr revid: rlo@openerp.com-20120327082545-y3fzc2rysefx0k2q --- addons/point_of_sale/static/src/js/pos.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 369c7fbc032..ecaecdf91d5 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1281,7 +1281,28 @@ openerp.point_of_sale = function(db) { console.log('barcode: ' + barcode); var selectedOrder = self.shop.get('selectedOrder'); var productsCollection = self.shop.get('products'); - var controlDigit = Number(barcode.charAt(12)); + // EAN digit control calculation, based on http://es.wikipedia.org/wiki/EAN#Javascript , licensed under Creative Commons Attribution-Share-Alike License 3.0 + var checksum = 0; + ean13Reversed = codeNumbers.reverse(); + for (var pos in ean13Reversed) { + checksum += ean13Reversed[pos] * (3 - 2 * (pos % 2)); + } + checksum = (10 - (checksum % 10)) % 10; + // End of EAN digit control calculation + if (Number(barcode.charAt(12)) !== checksum) { + // barcode read error, raise warning + $(QWeb.render('pos-scan-warning')).dialog({ + resizable: false, + height:220, + modal: true, + title: "Warning", + buttons: { + "OK": function() { + $( this ).dialog( "close" ); + }, + } + }); + } if (barcode.substring(0,2) in ['02', '22', '24', '26', '28']) { // product with a specific price - specified into the barcode barcode = barcode.substring(2,5); From e5150890236f42e48e4055dcba8aef39e093c8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Tue, 27 Mar 2012 16:14:22 +0200 Subject: [PATCH 0029/1775] [imp] currency conversion - yet incomplete bzr revid: rlo@openerp.com-20120327141422-9grv8dw70q89ayx5 --- addons/point_of_sale/__openerp__.py | 2 +- addons/point_of_sale/static/src/js/pos.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index 911ccf24bb5..f39c05c5e7d 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -40,7 +40,7 @@ Main features : """, 'author': 'OpenERP SA', 'images': ['images/cash_registers.jpeg', 'images/pos_analysis.jpeg','images/register_analysis.jpeg','images/sale_order_pos.jpeg','images/product_pos.jpeg'], - 'depends': ['sale'], + 'depends': ['sale','account'], 'init_xml': [], 'update_xml': [ diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index ecaecdf91d5..77b38d9b872 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1249,6 +1249,7 @@ openerp.point_of_sale = function(db) { id = 0; } c = pos.categories[id]; + currency = pos.get('currency'); this.categoryView.ancestors = c.ancestors; this.categoryView.children = c.children; this.categoryView.renderElement(); @@ -1307,6 +1308,7 @@ openerp.point_of_sale = function(db) { // product with a specific price - specified into the barcode barcode = barcode.substring(2,5); // TODO conversion euro - old local currencies + new db.web.Model('res.currency').get_func('_get_conversion_rate')(['FRF', 'EUR']).pipe(function(result){}); price = Number(barcode.substring(7,5))/100; weight = ''; } else if (barcode.substring(0,2) in ['21','23','27','29','25']) { From ce55e113ed3b01506664b9b59b0d9c9999a24ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Wed, 28 Mar 2012 12:03:37 +0200 Subject: [PATCH 0030/1775] [imp] control digit check + more demo data bzr revid: rlo@openerp.com-20120328100337-aypdlk8o9revqpm6 --- addons/point_of_sale/point_of_sale_demo.xml | 1 + addons/point_of_sale/static/src/js/pos.js | 40 ++++++++++++++------- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/addons/point_of_sale/point_of_sale_demo.xml b/addons/point_of_sale/point_of_sale_demo.xml index 3638b0faa72..95c0192f6c7 100644 --- a/addons/point_of_sale/point_of_sale_demo.xml +++ b/addons/point_of_sale/point_of_sale_demo.xml @@ -687,6 +687,7 @@ 1.00 Leffe Blonde 33cl + 5410228142218 /9j/4AAQSkZJRgAB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NAkUYQKiBd+Px/eMPxrWeIIUDnvEOoNL4vQuwRjAFAHUfN/+uuZQcoX/vGvNZ/IZb316NS2JqDom77u4j+laWtHQi9x/jTUkh0sr5iy3LuGEeckAEH8qKFF1JoHLlRzR8VLLZwxy2pJXOeQR+tdEcFy7Mh1bmraeLpbiKHT9P07dcTERoc9zx0Ao+pa3bD2pd1D4P8Ai2wuJW06eK8STndFN5THnPIYgfqa7OVW2MuYjs/hn4+mAgmja3jJ5Mt6pUfgrH+VL2cOyDmfc9j8JeHl8L+HrfTBL5zplpJAMBmPX8O34VaE2XdT0fTtZg8jUrKG6jHIEqA7T7HqPwoYjhfGXg3SvDnhy61bQNOENzEVMv7x2DR55GCTjsfwrOpTU42ZcJWZ5uvi2E27LPaPyOgwwz+OK5Xg2nozT2oWHi+2sy7xWLFj2JAGf1xQ8HJ9Q9qjbX4da7400q28SwXUEU8+dltKGTagJAIbnOevOOtdNOkqcbIzlK7KQ+EnjQ3HMUYUnljdLj+eauy7CuehfD/4byeF57i+1O4huLmeLyvKjG5FUnJySOScDt+dMRuXXw/8J3khkl0K2DE5Plgxj8lIFOwXL2leF9D0R/M03S7e3kxjzFXL4/3jzRYLmrQIKACgANADXRZEZHUMrDDKRkEelAHK3/wx8JahKZG0zyGbr9nkZB/3yDgfgKVh3DTvhj4R02USppazuDkfaHaQf98k4/SnYLnVKqooVVCqowABgAUCHUAFABQAUAFABQAUAAD/2Q== diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 77b38d9b872..238366163d9 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1266,31 +1266,46 @@ openerp.point_of_sale = function(db) { if (!isNaN(Number(String.fromCharCode(e.keyCode)))) { // a number if (codeNumbers.length==0) { - codeNumbers.timeStamp = new Date().getTime(); + timeStamp = new Date().getTime(); } else { - if (codeNumbers.lastTimeStamp + 30 < new Date().getTime()) { + if (lastTimeStamp + 30 < new Date().getTime()) { // not a barcode reader codeNumbers = []; - codeNumbers.timeStamp = new Date().getTime(); + timeStamp = new Date().getTime(); } } codeNumbers.push(e.keyCode - 48); - codeNumbers.lastTimeStamp = new Date().getTime(); + lastTimeStamp = new Date().getTime(); if (codeNumbers.length == 13) { // a barcode reader var barcode = codeNumbers.join(''); console.log('barcode: ' + barcode); var selectedOrder = self.shop.get('selectedOrder'); var productsCollection = self.shop.get('products'); - // EAN digit control calculation, based on http://es.wikipedia.org/wiki/EAN#Javascript , licensed under Creative Commons Attribution-Share-Alike License 3.0 - var checksum = 0; - ean13Reversed = codeNumbers.reverse(); - for (var pos in ean13Reversed) { - checksum += ean13Reversed[pos] * (3 - 2 * (pos % 2)); - } - checksum = (10 - (checksum % 10)) % 10; + // EAN digit control calculation + var st1 = codeNumbers; + var st2 = st1.slice(0,12).reverse(); + var countSt3 = 1; + var st3 = 0; + $.each(st2, function() { + if (countSt3%2 === 1) { + st3 += this; + } + countSt3 ++; + }); + st3 *= 3; + var st4 = 0; + var countSt4 = 1; + $.each(st2, function() { + if (countSt4%2 === 0) { + st4 += this; + } + countSt4 ++; + }); + var st5 = st3 + st4; + var dc = (10 - (st5%10)) % 10; // End of EAN digit control calculation - if (Number(barcode.charAt(12)) !== checksum) { + if (Number(barcode.charAt(12)) !== dc) { // barcode read error, raise warning $(QWeb.render('pos-scan-warning')).dialog({ resizable: false, @@ -1332,6 +1347,7 @@ openerp.point_of_sale = function(db) { buttons: { "OK": function() { $( this ).dialog( "close" ); + return; }, } }); From 6178afe4be0a386022e02d22ee099517f3b88f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Wed, 28 Mar 2012 15:46:56 +0200 Subject: [PATCH 0031/1775] [imp] unit barcode bzr revid: rlo@openerp.com-20120328134656-zxxdpa861q2qk3r5 --- addons/point_of_sale/static/src/js/pos.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 238366163d9..ec6726a42ef 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1254,6 +1254,7 @@ openerp.point_of_sale = function(db) { this.categoryView.children = c.children; this.categoryView.renderElement(); this.categoryView.start(); + allProducts = pos.store.get('product.product'); products = pos.store.get('product.product').filter( function(p) { var _ref; return _ref = p.pos_categ_id[0], _.indexOf(c.subtree, _ref) >= 0; @@ -1279,9 +1280,7 @@ openerp.point_of_sale = function(db) { if (codeNumbers.length == 13) { // a barcode reader var barcode = codeNumbers.join(''); - console.log('barcode: ' + barcode); var selectedOrder = self.shop.get('selectedOrder'); - var productsCollection = self.shop.get('products'); // EAN digit control calculation var st1 = codeNumbers; var st2 = st1.slice(0,12).reverse(); @@ -1315,6 +1314,7 @@ openerp.point_of_sale = function(db) { buttons: { "OK": function() { $( this ).dialog( "close" ); + return; }, } }); @@ -1336,7 +1336,7 @@ openerp.point_of_sale = function(db) { weight = ''; price = ''; } - var scannedProductModel = _.detect(productsCollection.models, function(pc) { return pc.attributes.ean13 === barcode;}); + var scannedProductModel = _.detect(allProducts, function(pc) { return pc.ean13 === barcode;}); if (scannedProductModel == undefined) { // product not recognized, raise warning $(QWeb.render('pos-scan-warning')).dialog({ @@ -1360,7 +1360,7 @@ openerp.point_of_sale = function(db) { // TODO check how to calculate the price scannedProductModel.price *= weight; } - selectedOrder.addProduct(scannedProductModel); + selectedOrder.addProduct(new Product(scannedProductModel)); codeNumbers = []; } @@ -1368,7 +1368,7 @@ openerp.point_of_sale = function(db) { // NaN codeNumbers = []; } - }) + }); $('.searchbox input').keyup(function() { var m, s; s = $(this).val().toLowerCase(); From c67aea4ed7e61eed9fd02835cf0ade4d883e1f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Thu, 29 Mar 2012 12:04:27 +0200 Subject: [PATCH 0032/1775] [imp] improved dc check bzr revid: rlo@openerp.com-20120329100427-r5pk59e5dnne99ou --- addons/point_of_sale/static/src/js/pos.js | 57 +++++++++++++---------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index ec6726a42ef..81ac6cff516 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1260,6 +1260,38 @@ openerp.point_of_sale = function(db) { return _ref = p.pos_categ_id[0], _.indexOf(c.subtree, _ref) >= 0; }); (this.shop.get('products')).reset(products); + var checkEan = function(code) { + // EAN control digit calculation + var st1 = code.slice(); + var st2 = st1.slice(0,st1.length-1).reverse(); + // some EAN13 barcodes have a length of 12, as they start by 0 + while (st2.length < 12) { + st2.push(0); + } + console.log('code: '+code.join(',')); + console.log('st1: '+st1.join(',')); + console.log('st2: '+st2.join(',')); + var countSt3 = 1; + var st3 = 0; + $.each(st2, function() { + if (countSt3%2 === 1) { + st3 += this; + } + countSt3 ++; + }); + st3 *= 3; + var st4 = 0; + var countSt4 = 1; + $.each(st2, function() { + if (countSt4%2 === 0) { + st4 += this; + } + countSt4 ++; + }); + var st5 = st3 + st4; + var cd = (10 - (st5%10)) % 10; + return code[code.length-1] === cd; + } var self = this; // bind barcode reader event var codeNumbers = []; @@ -1281,30 +1313,7 @@ openerp.point_of_sale = function(db) { // a barcode reader var barcode = codeNumbers.join(''); var selectedOrder = self.shop.get('selectedOrder'); - // EAN digit control calculation - var st1 = codeNumbers; - var st2 = st1.slice(0,12).reverse(); - var countSt3 = 1; - var st3 = 0; - $.each(st2, function() { - if (countSt3%2 === 1) { - st3 += this; - } - countSt3 ++; - }); - st3 *= 3; - var st4 = 0; - var countSt4 = 1; - $.each(st2, function() { - if (countSt4%2 === 0) { - st4 += this; - } - countSt4 ++; - }); - var st5 = st3 + st4; - var dc = (10 - (st5%10)) % 10; - // End of EAN digit control calculation - if (Number(barcode.charAt(12)) !== dc) { + if (!checkEan(codeNumbers)) { // barcode read error, raise warning $(QWeb.render('pos-scan-warning')).dialog({ resizable: false, From d9c673d586e58ee56bc29f2d6df8e4101383ba9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Thu, 29 Mar 2012 12:24:46 +0200 Subject: [PATCH 0033/1775] [imp] add method to get exchange rates from the client bzr revid: rlo@openerp.com-20120329102446-wzg853rgzd11f4yg --- addons/account/res_currency.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/account/res_currency.py b/addons/account/res_currency.py index 8c9c6a8b103..6381ca258de 100644 --- a/addons/account/res_currency.py +++ b/addons/account/res_currency.py @@ -25,6 +25,11 @@ from osv import osv class res_currency_account(osv.osv): _inherit = "res.currency" + def get_conversion_rate(self, cr, uid, from_currency, to_currency, context=None): + if context is None: + context = {} + return self._get_conversion_rate(cr, uid, from_currency, to_currency, context=context) + def _get_conversion_rate(self, cr, uid, from_currency, to_currency, context=None): if context is None: context = {} @@ -44,4 +49,4 @@ class res_currency_account(osv.osv): res_currency_account() -# 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 646e0334c83bd636868ea7d772352ee546859a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Thu, 29 Mar 2012 12:25:48 +0200 Subject: [PATCH 0034/1775] [fix] fix 'in' expression when reading a price or weight barcode bzr revid: rlo@openerp.com-20120329102548-gnffz8am3m755agq --- addons/point_of_sale/static/src/js/pos.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 81ac6cff516..17c9da5e92c 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1328,14 +1328,14 @@ openerp.point_of_sale = function(db) { } }); } - if (barcode.substring(0,2) in ['02', '22', '24', '26', '28']) { + if (barcode.substring(0,2) in {'02':'', '22':'', '24':'', '26':'', '28':''}) { // product with a specific price - specified into the barcode barcode = barcode.substring(2,5); // TODO conversion euro - old local currencies new db.web.Model('res.currency').get_func('_get_conversion_rate')(['FRF', 'EUR']).pipe(function(result){}); price = Number(barcode.substring(7,5))/100; weight = ''; - } else if (barcode.substring(0,2) in ['21','23','27','29','25']) { + } else if (barcode.substring(0,2) in {'21':'','23':'','27':'','29':'','25':''}) { // product sold by weight barcode = barcode.substring(2,5); weight = Number(barcode.substring(7,5))/1000; From 0a77d53dea33d0b66d631d21e62a095bc0e22d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Thu, 29 Mar 2012 14:12:23 +0200 Subject: [PATCH 0035/1775] [imp] currency conversion (partial) bzr revid: rlo@openerp.com-20120329121223-gb0d9sbpdjijaf0t --- addons/point_of_sale/static/src/js/pos.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 17c9da5e92c..95c8bfa1d32 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1268,9 +1268,6 @@ openerp.point_of_sale = function(db) { while (st2.length < 12) { st2.push(0); } - console.log('code: '+code.join(',')); - console.log('st1: '+st1.join(',')); - console.log('st2: '+st2.join(',')); var countSt3 = 1; var st3 = 0; $.each(st2, function() { @@ -1330,15 +1327,15 @@ openerp.point_of_sale = function(db) { } if (barcode.substring(0,2) in {'02':'', '22':'', '24':'', '26':'', '28':''}) { // product with a specific price - specified into the barcode - barcode = barcode.substring(2,5); + price = Number(barcode.substring(7,12))/100; + barcode = barcode.substring(2,7); // TODO conversion euro - old local currencies - new db.web.Model('res.currency').get_func('_get_conversion_rate')(['FRF', 'EUR']).pipe(function(result){}); - price = Number(barcode.substring(7,5))/100; + new db.web.Model('res.currency').get_func('get_conversion_rate')([pos.session.uid,'FRF', pos.get('currency'), {}]).pipe(function(result){}); weight = ''; } else if (barcode.substring(0,2) in {'21':'','23':'','27':'','29':'','25':''}) { // product sold by weight - barcode = barcode.substring(2,5); - weight = Number(barcode.substring(7,5))/1000; + weight = Number(barcode.substring(7,12))/1000; + barcode = barcode.substring(2,7); price = ''; } else { // product unit From 09506d254af19e1a626413d0eab3f4a043cc0d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Fri, 30 Mar 2012 12:02:21 +0200 Subject: [PATCH 0036/1775] [imp] partially working price/weight barcodes bzr revid: rlo@openerp.com-20120330100221-tjzbpqfp1wzv9n6w --- addons/point_of_sale/static/src/js/pos.js | 54 ++++++++++++----------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 95c8bfa1d32..6c86194201c 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -85,7 +85,8 @@ openerp.point_of_sale = function(db) { }, this)); }, this)); $.when(this.fetch('pos.category', ['name', 'parent_id', 'child_id']), - this.fetch('product.product', ['name', 'list_price', 'pos_categ_id', 'taxes_id', 'product_image_small', 'ean13'], [['pos_categ_id', '!=', 'false']]), + this.fetch('product.product', ['name', 'list_price', 'pos_categ_id', 'taxes_id', 'product_image_small', 'ean13', 'id'], [['pos_categ_id', '!=', 'false']]), + this.fetch('product.packaging', ['product_id', 'ean']), this.fetch('account.bank.statement', ['account_id', 'currency', 'journal_id', 'state', 'name'], [['state', '=', 'open'], ['user_id', '=', this.session.uid]]), this.fetch('account.journal', ['auto_cash', 'check_dtls', 'currency', 'name', 'type']), @@ -1255,6 +1256,7 @@ openerp.point_of_sale = function(db) { this.categoryView.renderElement(); this.categoryView.start(); allProducts = pos.store.get('product.product'); + allPackages = pos.store.get('product.packaging'); products = pos.store.get('product.product').filter( function(p) { var _ref; return _ref = p.pos_categ_id[0], _.indexOf(c.subtree, _ref) >= 0; @@ -1308,8 +1310,6 @@ openerp.point_of_sale = function(db) { lastTimeStamp = new Date().getTime(); if (codeNumbers.length == 13) { // a barcode reader - var barcode = codeNumbers.join(''); - var selectedOrder = self.shop.get('selectedOrder'); if (!checkEan(codeNumbers)) { // barcode read error, raise warning $(QWeb.render('pos-scan-warning')).dialog({ @@ -1325,25 +1325,36 @@ openerp.point_of_sale = function(db) { } }); } + var barcode = codeNumbers.join(''); + var selectedOrder = self.shop.get('selectedOrder'); if (barcode.substring(0,2) in {'02':'', '22':'', '24':'', '26':'', '28':''}) { - // product with a specific price - specified into the barcode + // PRICE barcode price = Number(barcode.substring(7,12))/100; - barcode = barcode.substring(2,7); - // TODO conversion euro - old local currencies - new db.web.Model('res.currency').get_func('get_conversion_rate')([pos.session.uid,'FRF', pos.get('currency'), {}]).pipe(function(result){}); - weight = ''; + barcode = barcode.substring(0,7); + var scannedPackaging = _.detect(allPackages, function(pack) { return pack.ean !== undefined && pack.ean.substring(0,7) === barcode;}); + if (scannedPackaging !== undefined) { + var scannedProductModel = _.detect(allProducts, function(pc) { return pc.id === scannedPackaging.product_id[0];}); + console.log(scannedProductModel.price); + scannedProductModel.price = price; + console.log('price: '+price); + } } else if (barcode.substring(0,2) in {'21':'','23':'','27':'','29':'','25':''}) { - // product sold by weight + // WEIGHT barcode weight = Number(barcode.substring(7,12))/1000; - barcode = barcode.substring(2,7); - price = ''; + console.log(weight); + barcode = barcode.substring(0,7); + var scannedPackaging = _.detect(allPackages, function(pack) { return pack.ean !== undefined && pack.ean.substring(0,7) === barcode;}); + if (scannedPackaging !== undefined) { + var scannedProductModel = _.detect(allProducts, function(pc) { return pc.ean13 === scannedPackaging.product_id[0];}); + console.log(scannedProductModel.price); + scannedProductModel.price *= weight; + console.log(weight); + } } else { - // product unit - weight = ''; - price = ''; + // UNIT barcode + var scannedProductModel = _.detect(allProducts, function(pc) { return pc.ean13 === barcode;}); } - var scannedProductModel = _.detect(allProducts, function(pc) { return pc.ean13 === barcode;}); - if (scannedProductModel == undefined) { + if (scannedProductModel === undefined) { // product not recognized, raise warning $(QWeb.render('pos-scan-warning')).dialog({ resizable: false, @@ -1357,16 +1368,9 @@ openerp.point_of_sale = function(db) { }, } }); + } else { + selectedOrder.addProduct(new Product(scannedProductModel)); } - if (weight === '' && price !== '') { - // product sold by price - scannedProductModel.price = price; - } else if (weight !== '' && price === '') { - // product sold by weight - // TODO check how to calculate the price - scannedProductModel.price *= weight; - } - selectedOrder.addProduct(new Product(scannedProductModel)); codeNumbers = []; } From de6a9009725afe731ce682b5b65a6a62215d3578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Fri, 30 Mar 2012 13:16:17 +0200 Subject: [PATCH 0037/1775] [imp] working price barcodes bzr revid: rlo@openerp.com-20120330111617-fnc85bpk26eevicc --- addons/point_of_sale/static/src/js/pos.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 6c86194201c..98930e284cd 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1334,9 +1334,7 @@ openerp.point_of_sale = function(db) { var scannedPackaging = _.detect(allPackages, function(pack) { return pack.ean !== undefined && pack.ean.substring(0,7) === barcode;}); if (scannedPackaging !== undefined) { var scannedProductModel = _.detect(allProducts, function(pc) { return pc.id === scannedPackaging.product_id[0];}); - console.log(scannedProductModel.price); - scannedProductModel.price = price; - console.log('price: '+price); + scannedProductModel.list_price = price; } } else if (barcode.substring(0,2) in {'21':'','23':'','27':'','29':'','25':''}) { // WEIGHT barcode From caba6de06e850006689ea4d318807057e97bae85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Fri, 30 Mar 2012 13:42:25 +0200 Subject: [PATCH 0038/1775] [imp] working weight barcodes bzr revid: rlo@openerp.com-20120330114225-iouhxmyv3hb3xbcd --- addons/point_of_sale/static/src/js/pos.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 98930e284cd..4b63740c9f9 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1339,14 +1339,12 @@ openerp.point_of_sale = function(db) { } else if (barcode.substring(0,2) in {'21':'','23':'','27':'','29':'','25':''}) { // WEIGHT barcode weight = Number(barcode.substring(7,12))/1000; - console.log(weight); barcode = barcode.substring(0,7); var scannedPackaging = _.detect(allPackages, function(pack) { return pack.ean !== undefined && pack.ean.substring(0,7) === barcode;}); if (scannedPackaging !== undefined) { - var scannedProductModel = _.detect(allProducts, function(pc) { return pc.ean13 === scannedPackaging.product_id[0];}); - console.log(scannedProductModel.price); - scannedProductModel.price *= weight; - console.log(weight); + var scannedProductModel = _.detect(allProducts, function(pc) { return pc.id === scannedPackaging.product_id[0];}); + scannedProductModel.list_price *= weight; + scannedProductModel.name += ' - ' + weight + ' Kg.' } } else { // UNIT barcode From e3a06211124d62b1b0f8e5b62a767960c0cd0737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Fri, 30 Mar 2012 14:42:07 +0200 Subject: [PATCH 0039/1775] [fix] fix search field 'clear' button bzr revid: rlo@openerp.com-20120330124207-5c4lb61al2c1q8s2 --- addons/point_of_sale/static/src/js/pos.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 4b63740c9f9..d845fe06679 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1390,7 +1390,7 @@ openerp.point_of_sale = function(db) { return (self.shop.get('products')).reset(m); }); return $('.search-clear').click( function() { - (this.shop.get('products')).reset(products); + (self.shop.get('products')).reset(products); $('.searchbox input').val('').focus(); return $('.search-clear').fadeOut(); }); From 2d672a4089587934baf092b9b367d46df0dfc6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Fri, 30 Mar 2012 15:23:04 +0200 Subject: [PATCH 0040/1775] [fix] remove some useless changes after review bzr revid: rlo@openerp.com-20120330132304-6kyfsir5efcp9kig --- addons/account/res_currency.py | 5 ----- addons/point_of_sale/__openerp__.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/addons/account/res_currency.py b/addons/account/res_currency.py index 6381ca258de..ce781a1e11a 100644 --- a/addons/account/res_currency.py +++ b/addons/account/res_currency.py @@ -25,11 +25,6 @@ from osv import osv class res_currency_account(osv.osv): _inherit = "res.currency" - def get_conversion_rate(self, cr, uid, from_currency, to_currency, context=None): - if context is None: - context = {} - return self._get_conversion_rate(cr, uid, from_currency, to_currency, context=context) - def _get_conversion_rate(self, cr, uid, from_currency, to_currency, context=None): if context is None: context = {} diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index f39c05c5e7d..911ccf24bb5 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -40,7 +40,7 @@ Main features : """, 'author': 'OpenERP SA', 'images': ['images/cash_registers.jpeg', 'images/pos_analysis.jpeg','images/register_analysis.jpeg','images/sale_order_pos.jpeg','images/product_pos.jpeg'], - 'depends': ['sale','account'], + 'depends': ['sale'], 'init_xml': [], 'update_xml': [ From c82330ccb63d598792b17415308316659d3df079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Fri, 30 Mar 2012 15:30:01 +0200 Subject: [PATCH 0041/1775] [fix] remove some useless changes after review bzr revid: rlo@openerp.com-20120330133001-8l5w5d7nsy2vpyh9 --- addons/account/res_currency.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/res_currency.py b/addons/account/res_currency.py index ce781a1e11a..8e02836274a 100644 --- a/addons/account/res_currency.py +++ b/addons/account/res_currency.py @@ -45,3 +45,4 @@ class res_currency_account(osv.osv): res_currency_account() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + From c053aab30edb3bff9e741653352165bc730bfa4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Mon, 2 Apr 2012 11:13:43 +0200 Subject: [PATCH 0042/1775] [fix] remove unused code bzr revid: rlo@openerp.com-20120402091343-8dltnmyld7yk2yo2 --- addons/point_of_sale/static/src/js/pos.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index d845fe06679..3253fe85bd9 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1250,7 +1250,6 @@ openerp.point_of_sale = function(db) { id = 0; } c = pos.categories[id]; - currency = pos.get('currency'); this.categoryView.ancestors = c.ancestors; this.categoryView.children = c.children; this.categoryView.renderElement(); From c407affde98d46158e8f8a85745e25863ed8749f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Mon, 2 Apr 2012 16:25:13 +0200 Subject: [PATCH 0043/1775] [IMP]Cleaned syntax of the Backbone models bzr revid: fva@openerp.com-20120402142513-funzsxkit810c3q2 --- addons/point_of_sale/static/src/js/pos.js | 232 ++++++++-------------- 1 file changed, 88 insertions(+), 144 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 3253fe85bd9..85aaacc8621 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -224,57 +224,29 @@ openerp.point_of_sale = function(db) { Models --- */ - var CashRegister = (function() { - __extends(CashRegister, Backbone.Model); - function CashRegister() { - CashRegister.__super__.constructor.apply(this, arguments); - } + console.log("Fva Tools Reloaded"); - return CashRegister; - })(); - var CashRegisterCollection = (function() { - __extends(CashRegisterCollection, Backbone.Collection); - function CashRegisterCollection() { - CashRegisterCollection.__super__.constructor.apply(this, arguments); - } + var CashRegister = Backbone.Model.extend({ + }); - CashRegisterCollection.prototype.model = CashRegister; - return CashRegisterCollection; - })(); - var Product = (function() { - __extends(Product, Backbone.Model); - function Product() { - Product.__super__.constructor.apply(this, arguments); - } + var CashRegisterCollection = Backbone.Collection.extend({ + model: CashRegister, + }); - return Product; - })(); - var ProductCollection = (function() { - __extends(ProductCollection, Backbone.Collection); - function ProductCollection() { - ProductCollection.__super__.constructor.apply(this, arguments); - } + var Product = Backbone.Model.extend({ + }); - ProductCollection.prototype.model = Product; - return ProductCollection; - })(); - var Category = (function() { - __extends(Category, Backbone.Model); - function Category() { - Category.__super__.constructor.apply(this, arguments); - } + var ProductCollection = Backbone.Collection.extend({ + model: Product, + }); - return Category; - })(); - var CategoryCollection = (function() { - __extends(CategoryCollection, Backbone.Collection); - function CategoryCollection() { - CategoryCollection.__super__.constructor.apply(this, arguments); - } + var Category = Backbone.Model.extend({ + }); + + var CategoryCollection = Backbone.Collection.extend({ + model: Category, + }); - CategoryCollection.prototype.model = Category; - return CategoryCollection; - })(); /* Each Order contains zero or more Orderlines (i.e. the content of the "shopping cart".) There should only ever be one Orderline per distinct product in an Order. @@ -352,91 +324,73 @@ openerp.point_of_sale = function(db) { }; }, exportAsJSON: function() { - var result; - result = { + return { qty: this.get('quantity'), price_unit: this.get('list_price'), discount: this.get('discount'), product_id: this.get('id') }; - return result; }, }); + var OrderlineCollection = Backbone.Collection.extend({ model: Orderline, }); - /* - Every PaymentLine has all the attributes of the corresponding CashRegister. - */ - var Paymentline = (function() { - __extends(Paymentline, Backbone.Model); - function Paymentline() { - Paymentline.__super__.constructor.apply(this, arguments); - } - Paymentline.prototype.defaults = { - amount: 0 - }; - Paymentline.prototype.getAmount = function() { + // Every PaymentLine has all the attributes of the corresponding CashRegister. + var Paymentline = Backbone.Model.extend({ + defaults: { + amount: 0, + }, + initialize: function(attributes) { + Backbone.Model.prototype.initialize.apply(this, arguments); + }, + getAmount: function(){ return this.get('amount'); - }; - Paymentline.prototype.exportAsJSON = function() { - var result; - result = { + }, + exportAsJSON: function(){ + return { name: db.web.datetime_to_str(new Date()), statement_id: this.get('id'), account_id: (this.get('account_id'))[0], journal_id: (this.get('journal_id'))[0], amount: this.getAmount() }; - return result; - }; - return Paymentline; - })(); - var PaymentlineCollection = (function() { - __extends(PaymentlineCollection, Backbone.Collection); - function PaymentlineCollection() { - PaymentlineCollection.__super__.constructor.apply(this, arguments); - } + }, + }); - PaymentlineCollection.prototype.model = Paymentline; - return PaymentlineCollection; - })(); - var Order = (function() { - __extends(Order, Backbone.Model); - function Order() { - Order.__super__.constructor.apply(this, arguments); - } - - Order.prototype.defaults = { + var PaymentlineCollection = Backbone.Collection.extend({ + model: Paymentline, + }); + + var Order = Backbone.Model.extend({ + defaults:{ validated: false, step: 'products', - }; - Order.prototype.initialize = function() { - this.set({creationDate: new Date}); + }, + initialize: function(attributes){ + Backbone.Model.prototype.initialize.apply(this, arguments); this.set({ - orderLines: new OrderlineCollection - }); - this.set({ - paymentLines: new PaymentlineCollection + creationDate: new Date, + orderLines: new OrderlineCollection, + paymentLines: new PaymentlineCollection, + name: "Order " + this.generateUniqueId(), }); this.bind('change:validated', this.validatedChanged); - return this.set({ - name: "Order " + this.generateUniqueId() - }); - }; - Order.prototype.events = { + return this; + }, + events: { 'change:validated': 'validatedChanged' - }; - Order.prototype.validatedChanged = function() { + }, + validatedChanged: function() { if (this.get("validated") && !this.previous("validated")) { this.set({'step': 'receipt'}); } - } - Order.prototype.generateUniqueId = function() { + }, + generateUniqueId: function() { return new Date().getTime(); - }; - Order.prototype.addProduct = function(product) { + }, + addProduct: function(product) { var existing; existing = (this.get('orderLines')).get(product.id); if (existing != null) { @@ -448,8 +402,8 @@ openerp.point_of_sale = function(db) { this.get('orderLines').remove(line); }, this); } - }; - Order.prototype.addPaymentLine = function(cashRegister) { + }, + addPaymentLine: function(cashRegister) { var newPaymentline; newPaymentline = new Paymentline(cashRegister); /* TODO: Should be 0 for cash-like accounts */ @@ -457,38 +411,38 @@ openerp.point_of_sale = function(db) { amount: this.getDueLeft() }); return (this.get('paymentLines')).add(newPaymentline); - }; - Order.prototype.getName = function() { + }, + getName: function() { return this.get('name'); - }; - Order.prototype.getTotal = function() { + }, + getTotal: function() { return (this.get('orderLines')).reduce((function(sum, orderLine) { return sum + orderLine.getPriceWithTax(); }), 0); - }; - Order.prototype.getTotalTaxExcluded = function() { + }, + getTotalTaxExcluded: function() { return (this.get('orderLines')).reduce((function(sum, orderLine) { return sum + orderLine.getPriceWithoutTax(); }), 0); - }; - Order.prototype.getTax = function() { + }, + getTax: function() { return (this.get('orderLines')).reduce((function(sum, orderLine) { return sum + orderLine.getTax(); }), 0); - }; - Order.prototype.getPaidTotal = function() { + }, + getPaidTotal: function() { return (this.get('paymentLines')).reduce((function(sum, paymentLine) { return sum + paymentLine.getAmount(); }), 0); - }; - Order.prototype.getChange = function() { + }, + getChange: function() { return this.getPaidTotal() - this.getTotal(); - }; - Order.prototype.getDueLeft = function() { + }, + getDueLeft: function() { return this.getTotal() - this.getPaidTotal(); - }; - Order.prototype.exportAsJSON = function() { - var orderLines, paymentLines, result; + }, + exportAsJSON: function() { + var orderLines, paymentLines; orderLines = []; (this.get('orderLines')).each(_.bind( function(item) { return orderLines.push([0, 0, item.exportAsJSON()]); @@ -497,7 +451,7 @@ openerp.point_of_sale = function(db) { (this.get('paymentLines')).each(_.bind( function(item) { return paymentLines.push([0, 0, item.exportAsJSON()]); }, this)); - result = { + return { name: this.getName(), amount_paid: this.getPaidTotal(), amount_total: this.getTotal(), @@ -506,26 +460,15 @@ openerp.point_of_sale = function(db) { lines: orderLines, statement_ids: paymentLines }; - return result; - }; - return Order; - })(); - var OrderCollection = (function() { - __extends(OrderCollection, Backbone.Collection); - function OrderCollection() { - OrderCollection.__super__.constructor.apply(this, arguments); - } + }, + }); - OrderCollection.prototype.model = Order; - return OrderCollection; - })(); - var Shop = (function() { - __extends(Shop, Backbone.Model); - function Shop() { - Shop.__super__.constructor.apply(this, arguments); - } + var OrderCollection = Backbone.Collection.extend({ + model: Order, + }); - Shop.prototype.initialize = function() { + var Shop = Backbone.Model.extend({ + initialize: function() { this.set({ orders: new OrderCollection(), products: new ProductCollection() @@ -543,15 +486,15 @@ openerp.point_of_sale = function(db) { }); } }, this)); - }; - Shop.prototype.addAndSelectOrder = function(newOrder) { + }, + addAndSelectOrder: function(newOrder) { (this.get('orders')).add(newOrder); return this.set({ selectedOrder: newOrder }); - }; - return Shop; - })(); + }, + }); + /* The numpad handles both the choice of the property currently being modified (quantity, price or discount) and the edition of the corresponding numeric value. @@ -618,6 +561,7 @@ openerp.point_of_sale = function(db) { } }, }); + /* --- Views From d7d7500588993348edf3c97b70f2aae7236e32fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Mon, 2 Apr 2012 17:50:05 +0200 Subject: [PATCH 0044/1775] [IMP]Cleaned more syntax, added comments, removed __extends() bzr revid: fva@openerp.com-20120402155005-6rpin43aho26h1yz --- addons/point_of_sale/static/src/js/pos.js | 53 ++++++++++++----------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 85aaacc8621..e6868519c55 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -2,22 +2,6 @@ openerp.point_of_sale = function(db) { db.point_of_sale = {}; - var __extends = function(child, parent) { - var __hasProp = Object.prototype.hasOwnProperty; - for (var key in parent) { - if (__hasProp.call(parent, key)) - child[key] = parent[key]; - } - function ctor() { - this.constructor = child; - } - - ctor.prototype = parent.prototype; - child.prototype = new ctor; - child.__super__ = parent.prototype; - return child; - }; - var QWeb = db.web.qweb; var qweb_template = function(template) { return function(ctx) { @@ -719,6 +703,7 @@ openerp.point_of_sale = function(db) { }, on_selected: function() {}, }); + var OrderWidget = db.web.OldWidget.extend({ init: function(parent, options) { this._super(parent); @@ -800,6 +785,7 @@ openerp.point_of_sale = function(db) { $('#total').html(total.toFixed(2)).hide().fadeIn(); }, }); + /* "Products" step. */ @@ -838,6 +824,7 @@ openerp.point_of_sale = function(db) { }, on_change_category: function(id) {}, }); + var ProductWidget = db.web.OldWidget.extend({ tagName:'li', template_fct: qweb_template('pos-product-template'), @@ -860,6 +847,7 @@ openerp.point_of_sale = function(db) { return this; }, }); + var ProductListWidget = db.web.OldWidget.extend({ init: function(parent, options) { this._super(parent); @@ -1011,6 +999,7 @@ openerp.point_of_sale = function(db) { this.currentPaymentLines.last().set({amount: val}); }, }); + var ReceiptWidget = db.web.OldWidget.extend({ init: function(parent, options) { this._super(parent); @@ -1053,6 +1042,7 @@ openerp.point_of_sale = function(db) { $('.pos-receipt-container', this.$element).html(qweb_template('pos-ticket')({widget:this})); }, }); + var OrderButtonWidget = db.web.OldWidget.extend({ tagName: 'li', template_fct: qweb_template('pos-order-selector-button-template'), @@ -1092,6 +1082,7 @@ openerp.point_of_sale = function(db) { this.$element.addClass('order-selector-button'); } }); + var ShopWidget = db.web.OldWidget.extend({ init: function(parent, options) { this._super(parent); @@ -1172,7 +1163,9 @@ openerp.point_of_sale = function(db) { } }, }); + var App = (function() { + function App($element) { this.initialize($element); } @@ -1188,16 +1181,18 @@ openerp.point_of_sale = function(db) { this.categoryView.on_change_category.add_last(_.bind(this.category, this)); this.category(); }; + App.prototype.category = function(id) { - var c, products; - if (id == null) { - id = 0; - } + var c, products, self = this; + + id = !id ? 0 : id; + c = pos.categories[id]; this.categoryView.ancestors = c.ancestors; this.categoryView.children = c.children; this.categoryView.renderElement(); this.categoryView.start(); + allProducts = pos.store.get('product.product'); allPackages = pos.store.get('product.packaging'); products = pos.store.get('product.product').filter( function(p) { @@ -1205,8 +1200,9 @@ openerp.point_of_sale = function(db) { return _ref = p.pos_categ_id[0], _.indexOf(c.subtree, _ref) >= 0; }); (this.shop.get('products')).reset(products); + + //returns true if the code is a valid EAN codebar number by checking the control digit. var checkEan = function(code) { - // EAN control digit calculation var st1 = code.slice(); var st2 = st1.slice(0,st1.length-1).reverse(); // some EAN13 barcodes have a length of 12, as they start by 0 @@ -1234,12 +1230,18 @@ openerp.point_of_sale = function(db) { var cd = (10 - (st5%10)) % 10; return code[code.length-1] === cd; } - var self = this; - // bind barcode reader event + + // The barcode readers acts as a keyboard, we catch all keyup events and try to find a + // barcode sequence in the typed keys, then act accordingly. + var codeNumbers = []; $('body').delegate('','keyup', function (e){ + + //We only care about numbers if (!isNaN(Number(String.fromCharCode(e.keyCode)))) { - // a number + + // The barcode reader sends keystrokes with a specific interval. + // We look if the typed keys fit in the interval. if (codeNumbers.length==0) { timeStamp = new Date().getTime(); } else { @@ -1291,7 +1293,7 @@ openerp.point_of_sale = function(db) { } } else { // UNIT barcode - var scannedProductModel = _.detect(allProducts, function(pc) { return pc.ean13 === barcode;}); + var scannedProductModel = _.detect(allProducts, function(pc) { return pc.ean13 === barcode;}); //TODO DOES NOT SCALE } if (scannedProductModel === undefined) { // product not recognized, raise warning @@ -1318,6 +1320,7 @@ openerp.point_of_sale = function(db) { codeNumbers = []; } }); + $('.searchbox input').keyup(function() { var m, s; s = $(this).val().toLowerCase(); From a7bdd4e172657f2b5962e13c3eadafa759c12d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Mon, 2 Apr 2012 18:17:54 +0200 Subject: [PATCH 0045/1775] [FIX] Remove debug console.log bzr revid: fva@openerp.com-20120402161754-dmhty19ag58aow2q --- addons/point_of_sale/static/src/js/pos.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index e6868519c55..cf8c066c249 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -208,7 +208,6 @@ openerp.point_of_sale = function(db) { Models --- */ - console.log("Fva Tools Reloaded"); var CashRegister = Backbone.Model.extend({ }); From 34610c1e61c5de6759b82e51fcafcb8f26e88697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Tue, 3 Apr 2012 10:28:03 +0200 Subject: [PATCH 0046/1775] [fix] modify according to review: split functionalities into different functions bzr revid: rlo@openerp.com-20120403082803-hvvd65cl64qmzvms --- addons/point_of_sale/static/src/js/pos.js | 54 +++++++++++++---------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index cf8c066c249..2ec692618f0 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1234,6 +1234,35 @@ openerp.point_of_sale = function(db) { // barcode sequence in the typed keys, then act accordingly. var codeNumbers = []; + + var getProductByEAN = function(ean) { + var prefix = ean.substring(0,2); + var scannedProductModel = undefined; + if (prefix in {'02':'', '22':'', '24':'', '26':'', '28':''}) { + // PRICE barcode + var itemCode = ean.substring(0,7); + var scannedPackaging = _.detect(allPackages, function(pack) { return pack.ean !== undefined && pack.ean.substring(0,7) === itemCode;}); + if (scannedPackaging !== undefined) { + scannedProductModel = _.detect(allProducts, function(pc) { return pc.id === scannedPackaging.product_id[0];}); + scannedProductModel.list_price = Number(ean.substring(7,12))/100; + } + } else if (prefix in {'21':'','23':'','27':'','29':'','25':''}) { + // WEIGHT barcode + var weight = Number(barcode.substring(7,12))/1000; + var itemCode = ean.substring(0,7); + var scannedPackaging = _.detect(allPackages, function(pack) { return pack.ean !== undefined && pack.ean.substring(0,7) === itemCode;}); + if (scannedPackaging !== undefined) { + scannedProductModel = _.detect(allProducts, function(pc) { return pc.id === scannedPackaging.product_id[0];}); + scannedProductModel.list_price *= weight; + scannedProductModel.name += ' - ' + weight + ' Kg.'; + } + } else { + // UNIT barcode + scannedProductModel = _.detect(allProducts, function(pc) { return pc.ean13 === ean;}); //TODO DOES NOT SCALE + } + return scannedProductModel; + } + $('body').delegate('','keyup', function (e){ //We only care about numbers @@ -1269,31 +1298,8 @@ openerp.point_of_sale = function(db) { } }); } - var barcode = codeNumbers.join(''); var selectedOrder = self.shop.get('selectedOrder'); - if (barcode.substring(0,2) in {'02':'', '22':'', '24':'', '26':'', '28':''}) { - // PRICE barcode - price = Number(barcode.substring(7,12))/100; - barcode = barcode.substring(0,7); - var scannedPackaging = _.detect(allPackages, function(pack) { return pack.ean !== undefined && pack.ean.substring(0,7) === barcode;}); - if (scannedPackaging !== undefined) { - var scannedProductModel = _.detect(allProducts, function(pc) { return pc.id === scannedPackaging.product_id[0];}); - scannedProductModel.list_price = price; - } - } else if (barcode.substring(0,2) in {'21':'','23':'','27':'','29':'','25':''}) { - // WEIGHT barcode - weight = Number(barcode.substring(7,12))/1000; - barcode = barcode.substring(0,7); - var scannedPackaging = _.detect(allPackages, function(pack) { return pack.ean !== undefined && pack.ean.substring(0,7) === barcode;}); - if (scannedPackaging !== undefined) { - var scannedProductModel = _.detect(allProducts, function(pc) { return pc.id === scannedPackaging.product_id[0];}); - scannedProductModel.list_price *= weight; - scannedProductModel.name += ' - ' + weight + ' Kg.' - } - } else { - // UNIT barcode - var scannedProductModel = _.detect(allProducts, function(pc) { return pc.ean13 === barcode;}); //TODO DOES NOT SCALE - } + var scannedProductModel = getProductByEAN(codeNumbers.join('')); if (scannedProductModel === undefined) { // product not recognized, raise warning $(QWeb.render('pos-scan-warning')).dialog({ From ef10d28de963cabf8eb5e636b6b726159f4bbf11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Tue, 3 Apr 2012 10:46:58 +0200 Subject: [PATCH 0047/1775] [FIX] Comment in the wrong place bzr revid: fva@openerp.com-20120403084658-j19s285vjd307ag7 --- addons/point_of_sale/static/src/js/pos.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 2ec692618f0..a03e34a3e53 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1230,11 +1230,10 @@ openerp.point_of_sale = function(db) { return code[code.length-1] === cd; } - // The barcode readers acts as a keyboard, we catch all keyup events and try to find a - // barcode sequence in the typed keys, then act accordingly. - var codeNumbers = []; + // returns a product that has a packaging with an EAN matching to provided ean string. + // returns undefined if no such product is found. var getProductByEAN = function(ean) { var prefix = ean.substring(0,2); var scannedProductModel = undefined; @@ -1263,6 +1262,8 @@ openerp.point_of_sale = function(db) { return scannedProductModel; } + // The barcode readers acts as a keyboard, we catch all keyup events and try to find a + // barcode sequence in the typed keys, then act accordingly. $('body').delegate('','keyup', function (e){ //We only care about numbers From bc05498416ae2fce7625d7f5d842ed0c38fb60a9 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Wed, 4 Apr 2012 14:31:14 +0200 Subject: [PATCH 0048/1775] [IMP] point_of_sale: Add the POS Config object bzr revid: stw@openerp.com-20120404123114-e557auyszvy4uy3a --- addons/point_of_sale/point_of_sale.py | 57 ++++++++++++++++ addons/point_of_sale/point_of_sale_view.xml | 76 +++++++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 5af78b131b2..012de387776 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -33,6 +33,63 @@ import decimal_precision as dp _logger = logging.getLogger(__name__) +class pos_config(osv.osv): + _name = 'pos.config' + + POS_CONFIG_STATE = [('draft', 'Draft'),('active', 'Active'),('inactive', 'Inactive'),('deprecated', 'Deprecated')] + + _columns = { + 'name' : fields.char('Name', size=32, select=1, required=True), + 'journal_ids' : fields.many2many('account.journal', 'pos_config_journal_rel', 'pos_config_id', 'journal_id', 'Payment Methods'), + 'shop_id' : fields.many2one('sale.shop', 'Shop', required=True, select=1), + 'journal_id' : fields.many2one('account.journal', 'Journal', required=True, select=1), + 'profit_account_id' : fields.many2one('account.account', 'Profit Account', required=True, select=1), + 'loss_account_id' : fields.many2one('account.account', 'Loss Account', required=True, select=1), + + 'authorized_cashbox_diff' : fields.integer('Authorized Cashbox Difference (%)'), + 'authorized_cashbox_diff_fixed' : fields.integer('Authorized Cashbox Difference (Fixed Amount)'), + + + 'iface_self_checkout' : fields.boolean('Self Checkout Mode'), + 'iface_websql' : fields.boolean('WebSQL (to store data)'), + 'iface_led' : fields.boolean('LED Interface'), + 'iface_cashdrawer' : fields.boolean('Cashdrawer Interface'), + 'iface_payment_terminal' : fields.boolean('Payment Terminal Interface'), + 'iface_electronic_scale' : fields.boolean('Electronic Scale Interface'), + 'iface_barscan' : fields.boolean('BarScan Interface'), + 'iface_vkeyboard' : fields.boolean('Virtual KeyBoard Interface'), + + 'state' : fields.selection(POS_CONFIG_STATE, 'State', required=True, readonly=True), + + } + + _defaults = { + 'state' : 'draft', + } + + def set_draft(self, cr, uid, ids, context=None): + return self.write(cr, uid, ids, {'state' : 'draft'}, context=context) + + def set_active(self, cr, uid, ids, context=None): + return self.write(cr, uid, ids, {'state' : 'active'}, context=context) + + def set_inactive(self, cr, uid, ids, context=None): + return self.write(cr, uid, ids, {'state' : 'inactive'}, context=context) + + def set_deprecate(self, cr, uid, ids, context=None): + return self.write(cr, uid, ids, {'state' : 'deprecated'}, context=context) + +pos_config() + +class pos_session(osv.osv): + _name = 'pos.session' + + _columns = { + 'config_id' : fields.many2one('pos.config', 'Configuration', required=True, select=1), + } + +pos_session() + class pos_config_journal(osv.osv): """ Point of Sale journal configuration""" _name = 'pos.config.journal' diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index b397bd826cc..4e1fcc7c6db 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -790,5 +790,81 @@ + + pos.config.form.view + pos.config + form + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
From 803220f3b7c893824cecb09763155a99436a1524 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 18 Jul 2012 12:21:09 +0200 Subject: [PATCH 1258/1775] [IMP] account: usability, review of form views bzr revid: qdp-launchpad@openerp.com-20120718102109-prtl3sb28xehgnlh --- addons/account/account_view.xml | 7 ++++--- addons/account/wizard/account_chart_view.xml | 5 ++--- addons/account/wizard/account_report_common_view.xml | 2 +- addons/account/wizard/account_use_model_view.xml | 4 ++-- addons/account_voucher/account_voucher_view.xml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 0172fa7429a..ecdcdaf4924 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2603,20 +2603,21 @@ action = pool.get('res.config').next(cr, uid, [], context)
- Select an Accounting Setup + Chart of Accounts account.chart form tree,form @@ -41,7 +41,6 @@ diff --git a/addons/account/wizard/account_report_common_view.xml b/addons/account/wizard/account_report_common_view.xml index aa09e7fd3a8..18953270e09 100644 --- a/addons/account/wizard/account_report_common_view.xml +++ b/addons/account/wizard/account_report_common_view.xml @@ -26,7 +26,7 @@ - +
diff --git a/addons/account/wizard/account_use_model_view.xml b/addons/account/wizard/account_use_model_view.xml index b128292271c..6170ca4fe12 100644 --- a/addons/account/wizard/account_use_model_view.xml +++ b/addons/account/wizard/account_use_model_view.xml @@ -8,8 +8,8 @@ form
- - + +
+ +
- Compabitiliby configuration wizard - ir.actions.configuration.wizard - form - -
-
-
- - - -
-
+ Compabitiliby configuration wizard + ir.actions.configuration.wizard + form + +
+ + + +
+
+
+
- Inheritable view for installer objects - res.config.installer - form - -
-
-
- - -
+ Inheritable view for installer objects + res.config.installer + form + +
+ +
+
+ +
- + From 8c403c671c20a0b45adb367b5510f8a6f91ad8a2 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 18 Jul 2012 15:08:22 +0200 Subject: [PATCH 1277/1775] [FIX] in all wizards, move buttons to footer bzr revid: rco@openerp.com-20120718130822-wn71hhjukhqblijc --- addons/plugin_outlook/plugin_outlook.xml | 2 +- addons/plugin_thunderbird/plugin_thunderbird.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/plugin_outlook/plugin_outlook.xml b/addons/plugin_outlook/plugin_outlook.xml index 0340a7c502f..811661bf127 100644 --- a/addons/plugin_outlook/plugin_outlook.xml +++ b/addons/plugin_outlook/plugin_outlook.xml @@ -14,7 +14,7 @@ - + diff --git a/addons/plugin_thunderbird/plugin_thunderbird.xml b/addons/plugin_thunderbird/plugin_thunderbird.xml index fef7772dfdf..69e83bf6df2 100644 --- a/addons/plugin_thunderbird/plugin_thunderbird.xml +++ b/addons/plugin_thunderbird/plugin_thunderbird.xml @@ -14,7 +14,7 @@ - + From 5a918cf01de012e45ac580b3fb55d010001129b7 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 18 Jul 2012 15:10:04 +0200 Subject: [PATCH 1278/1775] [IMP] session_bind is done by openerp.init(). As result, Clients can have template like any other widget as qweb template are loaded. This make the code cleaner as show_common() does not return a deferred anymore. bzr revid: chs@openerp.com-20120718131004-gvn63r3ihzxyzvy3 --- addons/web/static/src/js/boot.js | 7 ++- addons/web/static/src/js/chrome.js | 69 ++++++++++-------------------- addons/web/static/src/xml/base.xml | 6 ++- 3 files changed, 33 insertions(+), 49 deletions(-) diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js index 86f8077b151..9f426ee787c 100644 --- a/addons/web/static/src/js/boot.js +++ b/addons/web/static/src/js/boot.js @@ -21,10 +21,10 @@ * * @param {Array} modules list of modules to initialize */ - init: function(modules) { + init: function(modules, origin) { // By default only web will be loaded, the rest will be by loaded // by openerp.web.Session on the first session_authenticate - modules = modules || ["web"]; + modules = _.union(['web'], modules || []); var new_instance = { // links to the global openerp _openerp: openerp, @@ -39,6 +39,9 @@ for(var i=0; i < modules.length; i++) { openerp[modules[i]](new_instance,new_instance[modules[i]]); } + new_instance.connection.synchronized_mode(function() { + new_instance.connection.session_bind(origin); + }); return new_instance; } }; diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index b07c5d01dce..9eb8a238cec 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -857,31 +857,17 @@ instance.web.UserMenu = instance.web.Widget.extend({ }); instance.web.Client = instance.web.Widget.extend({ - name: 'Client', - init: function(parent, origin) { + init: function(parent) { if (instance.webclient) { throw new Error('Only one client per instance'); } instance.client = instance.webclient = this; this._super(parent); - this._origin = origin; }, start: function() { - var self = this; - return this.session.session_bind(this._origin).pipe(function() { - // now that we are bound, we can render the real template - var $e = undefined; - try { - $e = $(QWeb.render(self.name, {})); - } catch (e) {} - if ($e) { - self.$element.append($e); - } - - self.bind_events(); - return self.show_common(); - }); + this.bind_events(); + this.show_common(); }, bind_events: function() { @@ -928,7 +914,7 @@ instance.web.Client = instance.web.Widget.extend({ }); instance.web.WebClient = instance.web.Client.extend({ - name: 'WebClient', + template: 'WebClient', init: function(parent) { this._super(parent); this._current_state = null; @@ -947,8 +933,7 @@ instance.web.WebClient = instance.web.Client.extend({ }, start: function() { var self = this; - return this._super().pipe(function() { - self.$element.addClass("openerp openerp_webclient_container"); + return $.when(this._super()).pipe(function() { if (jQuery.param !== undefined && jQuery.deparam(jQuery.param.querystring()).kitten !== undefined) { $("body").addClass("kitten-mode-activated"); if ($.blockUI) { @@ -964,17 +949,16 @@ instance.web.WebClient = instance.web.Client.extend({ }, show_common: function() { var self = this; - return $.when(this._super()).pipe(function() { - window.onerror = function (message, file, line) { - self.crashmanager.on_traceback({ - type: _t("Client Error"), - message: message, - data: {debug: file + ':' + line} - }); - }; - self.login = new instance.web.Login(self); - self.login.on("login",self,self.show_application); - }); + this._super(); + window.onerror = function (message, file, line) { + self.crashmanager.on_traceback({ + type: _t("Client Error"), + message: message, + data: {debug: file + ':' + line} + }); + }; + self.login = new instance.web.Login(self); + self.login.on("login",self,self.show_application); }, show_login: function() { var self = this; @@ -1097,9 +1081,9 @@ instance.web.WebClient = instance.web.Client.extend({ }); instance.web.EmbeddedClient = instance.web.Client.extend({ - name: 'EmbedClient', - init: function(parent, origin, dbname, login, key, action_id, options) { - this._super(parent, origin); + template: 'EmbedClient', + init: function(parent, dbname, login, key, action_id, options) { + this._super(parent); this.dbname = dbname; this.login = login; @@ -1110,6 +1094,7 @@ instance.web.EmbeddedClient = instance.web.Client.extend({ start: function() { var self = this; return $.when(this._super()).pipe(function() { + return instance.connection.session_authenticate(self.dbname, self.login, self.key, true).pipe(function() { return self.rpc("/web/action/load", { action_id: self.action_id }, function(result) { var action = result.result; action.flags = _.extend({ @@ -1120,22 +1105,14 @@ instance.web.EmbeddedClient = instance.web.Client.extend({ //pager : false }, self.options, action.flags || {}); - self.am.do_action(action); + self.action_manager.do_action(action); + }); }); }); }, - - show_common: function() { - var self = this; - return $.when(this._super()).pipe(function() { - self.am = self.action_manager; - return instance.connection.session_authenticate(self.dbname, self.login, self.key, true); - }); - - }, }); -instance.web.embed = function (origin, dbname, login, key, action, options) { +instance.web.embed = function (dbname, login, key, action, options) { $('head').append($('', { 'rel': 'stylesheet', 'type': 'text/css', @@ -1146,7 +1123,7 @@ instance.web.embed = function (origin, dbname, login, key, action, options) { var sc = document.getElementsByTagName('script'); currentScript = sc[sc.length-1]; } - var client = new instance.web.EmbeddedClient(null, origin, dbname, login, key, action, options); + var client = new instance.web.EmbeddedClient(null, dbname, login, key, action, options); client.insertAfter(currentScript); }; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 546d1c45a35..5779a6801ee 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -371,6 +371,7 @@ +
@@ -394,10 +395,13 @@
+
-
+
+
+
From 391a35389c42b81a5306f8954cace8a235a763bd Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Wed, 18 Jul 2012 15:14:03 +0200 Subject: [PATCH 1279/1775] [IMP] remove deprecated attributes 'icon', 'web_icon' and 'web_icon_hover' from top menu items bzr revid: abo@openerp.com-20120718131403-6pzpzhhqbxhtub9b --- addons/account/account_menuitem.xml | 3 --- addons/association/profile_association.xml | 3 --- addons/base_tools/tools_view.xml | 3 --- addons/crm_claim/crm_claim_menu.xml | 3 --- addons/crm_helpdesk/crm_helpdesk_menu.xml | 3 --- addons/hr/hr_view.xml | 3 --- addons/knowledge/knowledge_view.xml | 3 --- addons/mail/mail_thread_view.xml | 2 -- addons/marketing/marketing_view.xml | 3 --- addons/mrp/mrp_view.xml | 3 --- addons/point_of_sale/point_of_sale_view.xml | 10 ++-------- addons/project/project_view.xml | 3 --- addons/purchase/purchase_view.xml | 3 --- addons/sale/sale_view.xml | 1 - addons/stock/stock_view.xml | 3 --- addons/wiki/wiki_view.xml | 1 - 16 files changed, 2 insertions(+), 48 deletions(-) diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 69c4f3a7307..9ac6f98661c 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -5,9 +5,6 @@ diff --git a/addons/association/profile_association.xml b/addons/association/profile_association.xml index 3936824972b..099a6f1ac97 100644 --- a/addons/association/profile_association.xml +++ b/addons/association/profile_association.xml @@ -5,9 +5,6 @@ diff --git a/addons/base_tools/tools_view.xml b/addons/base_tools/tools_view.xml index 3002931cf17..fbe0e16e31a 100644 --- a/addons/base_tools/tools_view.xml +++ b/addons/base_tools/tools_view.xml @@ -5,9 +5,6 @@ diff --git a/addons/crm_claim/crm_claim_menu.xml b/addons/crm_claim/crm_claim_menu.xml index bba8e6556ee..46f8760387a 100644 --- a/addons/crm_claim/crm_claim_menu.xml +++ b/addons/crm_claim/crm_claim_menu.xml @@ -5,9 +5,6 @@ diff --git a/addons/crm_helpdesk/crm_helpdesk_menu.xml b/addons/crm_helpdesk/crm_helpdesk_menu.xml index 9557d5e1d45..393428e091e 100644 --- a/addons/crm_helpdesk/crm_helpdesk_menu.xml +++ b/addons/crm_helpdesk/crm_helpdesk_menu.xml @@ -5,9 +5,6 @@ diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 521ebafdd97..0706da45c86 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -5,9 +5,6 @@ diff --git a/addons/knowledge/knowledge_view.xml b/addons/knowledge/knowledge_view.xml index 5ed5256b0e6..9acba0f4b43 100644 --- a/addons/knowledge/knowledge_view.xml +++ b/addons/knowledge/knowledge_view.xml @@ -5,9 +5,6 @@ diff --git a/addons/mail/mail_thread_view.xml b/addons/mail/mail_thread_view.xml index 06cb8189915..f07e1e467ee 100644 --- a/addons/mail/mail_thread_view.xml +++ b/addons/mail/mail_thread_view.xml @@ -5,8 +5,6 @@ diff --git a/addons/marketing/marketing_view.xml b/addons/marketing/marketing_view.xml index d478b9f6479..b4c8a295241 100644 --- a/addons/marketing/marketing_view.xml +++ b/addons/marketing/marketing_view.xml @@ -5,9 +5,6 @@ diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 72cd8b5c1ff..943fb0556ec 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -5,9 +5,6 @@ diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 27fc6bb8637..6b1b9132344 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -5,9 +5,6 @@ @@ -760,14 +757,11 @@ --> Point of Sale - 150 + + 150 - - - pos.config.form.view pos.config diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 9edd731acf2..94836221265 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -5,9 +5,6 @@ diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 45728729719..ebc7df729b5 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -5,9 +5,6 @@ diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 77f4bc33147..b2d45196703 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -5,9 +5,6 @@ diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml index 1041644f3b8..c88255a073a 100644 --- a/addons/wiki/wiki_view.xml +++ b/addons/wiki/wiki_view.xml @@ -5,7 +5,6 @@ Date: Wed, 18 Jul 2012 15:27:35 +0200 Subject: [PATCH 1280/1775] [FIX] temporarily desactivate commits 2748 & 2747 because there are problems with werkzeug versions bzr revid: nicolas.vanhoren@openerp.com-20120718132735-t2lg790pl9g4ccgj --- addons/web/common/http.py | 71 +-------------------------------------- 1 file changed, 1 insertion(+), 70 deletions(-) diff --git a/addons/web/common/http.py b/addons/web/common/http.py index cd17f5711e0..cc76a554693 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -452,7 +452,7 @@ class Root(object): static_dirs = self._load_addons(openerp_addons_namespace) if options.serve_static: - self.dispatch = SuperSharedDataMiddleware( + self.dispatch = werkzeug.wsgi.SharedDataMiddleware( self.dispatch, static_dirs, cache=False) if options.session_storage: @@ -555,75 +555,6 @@ class Root(object): return m ps, _slash, meth = ps.rpartition('/') return None - -class SuperSharedDataMiddleware(werkzeug.wsgi.SharedDataMiddleware): - """Redefine SharedDataMiddleware to better handle the cache = False directive. - Also desactivate 304 Not Modified headers only when the referer has 'debug' in its - arguments. - """ - def __call__(self, environ, start_response): - import os - import mimetypes - import werkzeug.http - import urlparse - # sanitize the path for non unix systems - cleaned_path = environ.get('PATH_INFO', '').strip('/') - for sep in os.sep, os.altsep: - if sep and sep != '/': - cleaned_path = cleaned_path.replace(sep, '/') - path = '/'.join([''] + [x for x in cleaned_path.split('/') - if x and x != '..']) - file_loader = None - for search_path, loader in self.exports.iteritems(): - if search_path == path: - real_filename, file_loader = loader(None) - if file_loader is not None: - break - if not search_path.endswith('/'): - search_path += '/' - if path.startswith(search_path): - real_filename, file_loader = loader(path[len(search_path):]) - if file_loader is not None: - break - if file_loader is None or not self.is_allowed(real_filename): - return self.app(environ, start_response) - - guessed_type = mimetypes.guess_type(real_filename) - mime_type = guessed_type[0] or self.fallback_mimetype - f, mtime, file_size = file_loader() - - etag = self.generate_etag(mtime, file_size, real_filename) - modified = werkzeug.http.is_resource_modified(environ, etag, last_modified=mtime) - - headers = [('Date', werkzeug.http.http_date())] - if self.cache: - timeout = self.cache_timeout - headers += [ - ('Etag', '"%s"' % etag), - ('Cache-Control', 'max-age=%d, public' % timeout) - ] - if modified: - headers.append(('Expires', werkzeug.http.http_date(time() + timeout))) - else: - headers.append(('Cache-Control', 'no-cache')) - - referer = environ.get('HTTP_REFERER', '') - parsed = urlparse.urlparse(referer) - debug = not urlparse.parse_qs(parsed.query).has_key('debug') - # it's important to put it at the end - if not debug and not modified: - f.close() - start_response('304 Not Modified', headers) - return [] - - headers.extend(( - ('Content-Type', mime_type), - ('Content-Length', str(file_size)), - ('Last-Modified', werkzeug.http.http_date(mtime)) - )) - start_response('200 OK', headers) - return werkzeug.wsgi.wrap_file(environ, f) - class LibException(Exception): """ Base of all client lib exceptions """ From 85a8641e2c672aa3801e49df39296335b9567368 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 18 Jul 2012 15:31:15 +0200 Subject: [PATCH 1281/1775] [FIX] cancel edition when deleting a record, so we're not left with a phantom editor for the deleted record on top of an other row bzr revid: xmo@openerp.com-20120718133115-8cn8wqf1ra8pjrnv --- addons/web/static/src/js/view_list_editable.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 58925a11ba1..052a471f0f3 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -31,6 +31,12 @@ openerp.web.list_editable = function (instance) { } }); + this.records.bind('remove', function () { + if (self.editor.is_editing()) { + self.cancel_edition(); + } + }); + this.on('edit:after', this, function () { self.$element.add(self.$buttons).addClass('oe_editing'); }); @@ -282,7 +288,12 @@ openerp.web.list_editable = function (instance) { }, function () { return this.editor.cancel().pipe(function (attrs) { if (attrs.id) { - return self.reload_record(self.records.get(attrs.id)); + var record = self.records.get(attrs.id); + if (!record) { + // Record removed by third party during edition + return + } + return self.reload_record(record); } var to_delete = self.records.find(function (r) { return !r.get('id'); From 56e6186ad91b2ef9bf6371a5877133a3b7e9a4e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 18 Jul 2012 15:32:34 +0200 Subject: [PATCH 1282/1775] [IMP] mail, email_template: chatter: added forgotton images for links/buttons, cleaned a bit the CSS for the composer. bzr revid: tde@openerp.com-20120718133234-p933jg1y8658i5ah --- .../static/src/img/email_template.png | Bin 0 -> 2898 bytes .../static/src/img/email_template_save.png | Bin 0 -> 3100 bytes .../wizard/email_compose_message_view.xml | 21 +++++------------- addons/mail/static/src/css/mail.css | 4 ++++ .../static/src/css/mail_compose_message.css | 2 +- addons/mail/static/src/img/attachment.png | Bin 0 -> 1142 bytes addons/mail/static/src/img/checklist.png | Bin 0 -> 976 bytes addons/mail/static/src/img/formatting.png | Bin 0 -> 3466 bytes .../mail/wizard/mail_compose_message_view.xml | 7 +++++- 9 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 addons/email_template/static/src/img/email_template.png create mode 100644 addons/email_template/static/src/img/email_template_save.png create mode 100644 addons/mail/static/src/img/attachment.png create mode 100644 addons/mail/static/src/img/checklist.png create mode 100644 addons/mail/static/src/img/formatting.png diff --git a/addons/email_template/static/src/img/email_template.png b/addons/email_template/static/src/img/email_template.png new file mode 100644 index 0000000000000000000000000000000000000000..d679492bc19f71ea893d6c9d3ebd48f3b5e425f4 GIT binary patch literal 2898 zcmV-Y3$65tP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyk| z4GIH_CLfak01DDcL_t(o!_AmUk7QR?$A5QtQ;ZoIIlHnZXLTF5t)_tuGN?fo>@4*s zV8MIK8fI{ZCJ-@v|&=M{lMi7N4{YoIMHQU#()9rS#*8VXt2LpUj z6vS~%r_&)#Q2!+K&^8s3?RkI;FrGYl zvN);V?-R%IE8rACDU`gp=Vis79|J+3gUMpAA`pVdd(YwFA$gwD@AtX=`W-HT6-7a> z*Q49*5=9Y3QM`IMQRnY3|8LZ&=YxAm$@z~k==aF73<-g@suou+z>G0eRYh5rOePbw z)+nVGs=cV5Qi>1)B7%rqIxmE<_#b>gX@zKe33VQSg7=O*&*#^s3ipB#m%y5)p{{G< zIHs;^LI^Jpq*5fY0nwoK0tUeQ`Op|+Fvie&k5ZOEi$^cCyNEbNAdM5Ms>T?Pr21vB zx~@4oI$|=JkR%COU(TWnWkdqg;802(rb1)5LSr=;?DkapV zUrapYL@#Qq9j6VArPUB!YhsU zfQJ%AM^E!X~kN=4m zp$!pQC-mZ&>g zuz&OwzyF7xPrq(>^(g|+n6NH$cuurvoo5yWarjRa4kiVQ&;t3 zZn&hF#$t`eO3J8bdG_TVVp2}qeGVT5e(>J!(v)YMb_}QYKW8gC@oLOEl7!2rSDOFXG7)@j?5=V=IVPDKRB%sA$ zP-IccPk#L8B)vXK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MOnVWS9Z z4gG$fGAO+FSR0)`1L8PFs|aHwQ1emp!mGi&_c-U+-rm0CfJ6l69LgAOr#-SHX6a-= zH%WQ(%{R%ij5v;&OwR}*P}enW>*#hn+#IbinHBW9ed@MBYt827CTWsDXi1DF_zLI4 zRpsJ2oKlJpKKOvs(^It8SZfgx>bk~@aBce*ab!3-Ib?HnjfanRQA)A1v%}deXLVzX z;c)ysJc2`OL1_ryp)e?=@WInoHJ*T00j2d-Qe;2m)k;he)Y9%D2r2yq-! zUR5qGjP8Xq9t;LAwFm@3P#A0GPDgoGR#p%Ko12?>?^#+}!il0ROQOh9Rn2)zK~a}2 zkyg06z$iU8z2a%=iZt$07Wvh_QbcImmMqJts_N>dik@4wx!n;$0MzqVLGT_g3hx8X zIlK=j#oWkfjfA-eM+A|8*3j)FSQY4IR~X)2uScHe^m;w|{XTVFzXW#C)A2zs6w?7v z&szlWJne(gSR)t}P)g3dx0?6Z(DMup9)jcK_>i`$aIU=sW?p;kHQs;!eGU!|7Ukia zZGwybn8@7jqXIezmwHlYf;NPpX_X*eVU@>7ShTPfoeKpCQjm?D`j`D?CAWmKf$;BA7N+_=ntk4xc~qF07*qoM6N<$f;;PNWdHyG literal 0 HcmV?d00001 diff --git a/addons/email_template/static/src/img/email_template_save.png b/addons/email_template/static/src/img/email_template_save.png new file mode 100644 index 0000000000000000000000000000000000000000..bf29f9ab4ad59ca18e67d5a841322ccf95322647 GIT binary patch literal 3100 zcmV+%4CC{OP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyk| z4G16_cMM|y01KQ+L_t(o!;P5RuO-(}#(!07^<`hrnKR?@Wnu?K*d`X2L?R#rL_qQo zAw`PB6AwXo;{V|<0A2~P1P|fG3IYNWM92!VgoB;&1>4x3bIzR0zI3lkRUUeunIU;` zOKY!I@4Z`JSJn5`S1q2dNfM5J8fU%$W;fwM!r?$Z z?8gqX3Oj)qpargg0^DJb)-BOItcvJG1BIgW~u>H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ep 17 00:00:00 2001 From: Antonin Bourguignon Date: Wed, 18 Jul 2012 15:43:09 +0200 Subject: [PATCH 1284/1775] [IMP] add a proper sequence number on the Portal's top menu item. This should work properly after the merge of trunk-imp_top_menus_sequences-abo bzr revid: abo@openerp.com-20120718134309-c7uztya4ziykt661 --- addons/portal/portal_data.xml | 7 +++++-- addons/portal/res_user_view.xml | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/portal/portal_data.xml b/addons/portal/portal_data.xml index 307844ed50a..74bf1711b7e 100644 --- a/addons/portal/portal_data.xml +++ b/addons/portal/portal_data.xml @@ -21,8 +21,11 @@ inline - - + + diff --git a/addons/portal/res_user_view.xml b/addons/portal/res_user_view.xml index 492c2ec5559..d481b865b79 100644 --- a/addons/portal/res_user_view.xml +++ b/addons/portal/res_user_view.xml @@ -1,6 +1,7 @@ + res.portal.users.form @@ -13,5 +14,6 @@
+ From 9096f2c45c3c9c12486eed2dd273aeb03441cb68 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 18 Jul 2012 15:46:07 +0200 Subject: [PATCH 1285/1775] [ADD] reimplement o2m's cancel-on-blur when no alteration has been done by the user to the row being edited (new or not) bzr revid: xmo@openerp.com-20120718134607-bukj6c5lysmqeer3 --- addons/web/static/src/js/view_form.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 948b3a73913..92faa3d7d15 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3331,13 +3331,20 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ /** * Handles blurring of the nested form (saves the currently edited row), * unless the flag to ignore the event is set to ``true`` + * + * Makes the internal form go away */ _on_form_blur: function () { if (this.__ignore_blur) { this.__ignore_blur = false; return; } - this.save_edition(); + // FIXME: why isn't there an API for this? + if (this.editor.form.$element.hasClass('oe_form_dirty')) { + this.save_edition(); + return; + } + this.cancel_edition(); }, keyup_ENTER: function () { // blurring caused by hitting the [Return] key, should skip the From 26665b774376068a93b887a2818ae98a22f23ae7 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 18 Jul 2012 15:50:10 +0200 Subject: [PATCH 1286/1775] [IMP] after a module installation, reload the client and open the menu Feeds bzr revid: rco@openerp.com-20120718135010-4933mmgw3n18epvy --- openerp/addons/base/module/module.py | 28 +++------------------------ openerp/addons/base/res/res_config.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index fde8fcf5b9a..1a0932ac7cf 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -363,8 +363,9 @@ class module(osv.osv): if config.get('type') not in ('ir.actions.reload', 'ir.actions.act_window_close'): return config - # reload the client - menu_ids = self.root_menus(cr,uid,ids,context) + # reload the client; open the first available root menu + menu_obj = self.pool.get('ir.ui.menu') + menu_ids = menu_obj.search(cr, uid, [('parent_id', '=', False)], context=context) return { 'type': 'ir.actions.client', 'tag': 'reload', @@ -649,29 +650,6 @@ class module(osv.osv): _logger.critical('module %s: invalid quality certificate: %s', mod.name, mod.certificate) raise osv.except_osv(_('Error'), _('Module %s: Invalid Quality Certificate') % (mod.name,)) - def root_menus(self, cr, uid, ids, context=None): - """ Return root menu ids the menus created by the modules whose ids are - provided. - - :param list[int] ids: modules to get menus from - """ - values = self.read(cr, uid, ids, ['name'], context=context) - module_names = [i['name'] for i in values] - - ids = self.pool.get('ir.model.data').search(cr, uid, [ ('model', '=', 'ir.ui.menu'), ('module', 'in', module_names) ], context=context) - values = self.pool.get('ir.model.data').read(cr, uid, ids, ['res_id'], context=context) - all_menu_ids = [i['res_id'] for i in values] - - root_menu_ids = [] - for menu in self.pool.get('ir.ui.menu').browse(cr, uid, all_menu_ids, context=context): - while menu.parent_id: - menu = menu.parent_id - if not menu.id in root_menu_ids: - root_menu_ids.append((menu.sequence,menu.id)) - root_menu_ids.sort() - root_menu_ids = [i[1] for i in root_menu_ids] - return root_menu_ids - class module_dependency(osv.osv): _name = "ir.module.module.dependency" _description = "Module dependency" diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index 9277184a822..3f4a052a36b 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -70,10 +70,14 @@ class res_config_configurable(osv.osv_memory): res = next.action_launch(context=context) res['nodestroy'] = False return res - #if there is no next action and if html is in the context: reload instead of closing - if context and 'html' in context: - return {'type' : 'ir.actions.reload'} - return {'type' : 'ir.actions.act_window_close'} + # reload the client; open the first available root menu + menu_obj = self.pool.get('ir.ui.menu') + menu_ids = menu_obj.search(cr, uid, [('parent_id', '=', False)], context=context) + return { + 'type': 'ir.actions.client', + 'tag': 'reload', + 'params': {'menu_id': menu_ids and menu_ids[0] or False}, + } def start(self, cr, uid, ids, context=None): return self.next(cr, uid, ids, context) From 531444a6f6b1d94e8ab4893a8f976e32e038bfff Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 18 Jul 2012 15:51:02 +0200 Subject: [PATCH 1287/1775] [IMP] account: do not open a non-existing view after setting taxes bzr revid: rco@openerp.com-20120718135102-34gvep3dbpqznozc --- addons/account/account.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index b6fd7232a25..fab9de5407c 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -3351,15 +3351,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): # Create Bank journals self._create_bank_journals_from_o2m(cr, uid, obj_wizard, company_id, acc_template_ref, context=context) - action = { - 'type': 'ir.actions.act_window', - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'board.board', - 'view_id': self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'board_account_form')[1], - 'menu_id': self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'menu_finance')[1] - } - return action + return {} def _prepare_bank_journal(self, cr, uid, line, current_num, default_account_id, company_id, context=None): ''' From bfe3afcbd8ac214487c57731c850c199f8a6a3c5 Mon Sep 17 00:00:00 2001 From: Minh Tran Date: Wed, 18 Jul 2012 15:55:03 +0200 Subject: [PATCH 1288/1775] improved project kanban vignette bzr revid: mit@openerp.com-20120718135503-gi222ulbtmhyesq8 --- addons/web_kanban/static/src/css/kanban.css | 3 +++ addons/web_kanban/static/src/css/kanban.sass | 3 +++ 2 files changed, 6 insertions(+) diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index 36dbab57559..5a7c1b84067 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -401,6 +401,9 @@ position: relative; top: 2px; } +.openerp .oe_kanban_view .oe_kanban_project_times li { + float: left; +} .openerp .oe_kanban_view .oe_kanban_status { position: relative; top: 4px; diff --git a/addons/web_kanban/static/src/css/kanban.sass b/addons/web_kanban/static/src/css/kanban.sass index f4c13cc7bd2..cea95f2ce53 100644 --- a/addons/web_kanban/static/src/css/kanban.sass +++ b/addons/web_kanban/static/src/css/kanban.sass @@ -336,6 +336,9 @@ float: right position: relative top: 2px + + .oe_kanban_project_times li + float: left .oe_kanban_status position: relative From 607c1670314a00cb3cd5b28ba495f950104d776f Mon Sep 17 00:00:00 2001 From: Minh Tran Date: Wed, 18 Jul 2012 15:55:14 +0200 Subject: [PATCH 1289/1775] improved project kanban vignette bzr revid: mit@openerp.com-20120718135514-ojyvli4qyresvsmf --- addons/project/project_view.xml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index a70bc504299..dbc4007bf8c 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -521,6 +521,15 @@
  • Edit...
  • Delete
  • +
  • + +
    @@ -531,19 +540,6 @@
    - - - - - ! -
    @@ -554,6 +550,12 @@ 7
    +
    From 585cbe8d2e8db793f02a89729cec5e1d1be39ef3 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Wed, 18 Jul 2012 15:56:51 +0200 Subject: [PATCH 1290/1775] [IMP] better formatting for project's demo data bzr revid: abo@openerp.com-20120718135651-bnqfnu4r04psdde0 --- addons/project/project_demo.xml | 115 ++++++++++++++++---------------- 1 file changed, 57 insertions(+), 58 deletions(-) diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml index 0916fc5890f..91b272d60ff 100644 --- a/addons/project/project_demo.xml +++ b/addons/project/project_demo.xml @@ -4,48 +4,48 @@ - + Nicolas - + niv niv Antony - + al al Quentin - + qdp qdp Francois - + fpi fpi Julien - + jth jth Minh - + mit mit Valérie - + vad vad @@ -84,8 +84,8 @@ - - + + 2 @@ -96,8 +96,8 @@ ref('project.project_category_02')])]"/> - - + + 2 @@ -105,8 +105,8 @@ - - + + 2 @@ -119,20 +119,20 @@ ref('project_category_04')])]"/> - - + + 2 Budget Planning Use the account_budget module - 3 + 5 - - + + 2 @@ -143,8 +143,8 @@ - - + + 2 @@ -152,8 +152,8 @@ - - + + 2 @@ -161,8 +161,8 @@ - - + + 2 @@ -173,8 +173,8 @@ ref('project.project_category_01')])]"/> - - + + 2 @@ -182,8 +182,8 @@ - - + + 2 @@ -192,8 +192,8 @@ - - + + 2 @@ -203,14 +203,14 @@ - - + + 2 Integrate Modules - 7 + 6 @@ -218,8 +218,8 @@ - - + + 2 @@ -229,8 +229,8 @@ - - + + 2 @@ -238,8 +238,8 @@ - - + + 2 @@ -248,9 +248,9 @@ 2011-02-06 - - - + + + 2 @@ -261,8 +261,8 @@ - - + + 2 @@ -272,8 +272,8 @@ - - + + 2 @@ -290,30 +290,30 @@ OpenERP Integration - + 10 Study + Prototype - - + + 20 Specific Developments - - + + 30 Install, data import, configuration - - + + @@ -356,7 +356,7 @@ 0 Customer analysis + Architecture - 3 + 7 15 @@ -366,7 +366,7 @@ Internal testing + Software Install - 4 + 8 17 @@ -403,8 +403,7 @@ + eval="[ref('project_project_21'), ref('project_project_22'), ref('project_project_23')], {'install_mode': True}"/> From ea3c3b3d9fc81bd8a98e3887bc2bfb37a6907048 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Wed, 18 Jul 2012 15:58:12 +0200 Subject: [PATCH 1291/1775] [ADD] a dependence from portal to anonymous this will be necessary to restrict the Portal's top menu item to anonymous user (among others) bzr revid: abo@openerp.com-20120718135812-v5gn6prr0j3vdqmo --- addons/portal/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal/__openerp__.py b/addons/portal/__openerp__.py index aaf94526615..72be8edb4b8 100644 --- a/addons/portal/__openerp__.py +++ b/addons/portal/__openerp__.py @@ -22,7 +22,7 @@ { 'name' : "Portal", 'version' : "1.0", - 'depends' : ["base", "share"], + 'depends' : ["base", "share", "anonymous"], 'author' : "OpenERP SA", 'category': 'Portal', 'description': """ From 03dd20254e2c62b8290f9b329bde256e92fcc3cd Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 18 Jul 2012 16:01:31 +0200 Subject: [PATCH 1292/1775] [IMP] use 'Save' as label of the button to save an editable list row bzr revid: xmo@openerp.com-20120718140131-eop88n524hwvrguw --- addons/web/static/src/xml/base.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 6d0d4a9ea7d..94b76c170ea 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -668,7 +668,7 @@ + type="button">Save discard From a824028878037b2e1bac655390ea77808feb7c11 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 18 Jul 2012 16:06:13 +0200 Subject: [PATCH 1293/1775] [IMP] initial mail message sale bzr revid: fp@tinyerp.com-20120718140613-3urmqhtng63lc23f --- addons/sale/sale_data.xml | 26 +++++++++++++++++++++++++ addons/sale/wizard/sale_make_invoice.py | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml index 4622577ac3d..b0fd5ed6d10 100644 --- a/addons/sale/sale_data.xml +++ b/addons/sale/sale_data.xml @@ -26,5 +26,31 @@ + + + Module sale installed! + comment + html + Welcome to OpenERP + Second Line + + +

    OpenERP Sale module just installed!

    +

    + You can click on the top menu Sales to manage your + customers, your quotations and sales orders. +

    +

    + If you need to manage your sales pipeline (leads, + opportunities, phonecalls), you can install the CRM module + from the Settings top menu. +

    +
    +
    + + + + + diff --git a/addons/sale/wizard/sale_make_invoice.py b/addons/sale/wizard/sale_make_invoice.py index 5265afb9bff..b4b3772a91a 100644 --- a/addons/sale/wizard/sale_make_invoice.py +++ b/addons/sale/wizard/sale_make_invoice.py @@ -68,4 +68,4 @@ class sale_make_invoice(osv.osv_memory): sale_make_invoice() -# 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 5510ee74b2f97959d129aa4e45933bd65bd42981 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 18 Jul 2012 16:11:12 +0200 Subject: [PATCH 1294/1775] [IMP] sale: in customer form, move action 'Quotations and Sales' from contextual menu to button bzr revid: rco@openerp.com-20120718141112-tdw4vb1c2am6rwl3 --- addons/sale/res_partner_view.xml | 34 +++++++++++++++++++++++++++++++- addons/sale/sale_view.xml | 8 -------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/addons/sale/res_partner_view.xml b/addons/sale/res_partner_view.xml index bb5695eac39..9c557620e75 100644 --- a/addons/sale/res_partner_view.xml +++ b/addons/sale/res_partner_view.xml @@ -1,7 +1,24 @@ - + + Quotations and Sales + sale.order + form + tree,form,graph + {'search_default_partner_id': active_id} + + + This customer has no quotation or sale order. + Click here to create a new quotation. + <p> + The "Quotation" is the first step of the Sales flow. Manage your sales from quotation to invoice. + <p> + You will be able to sell products (manage deliveries) as well as services (create projects). + + + + res.partner.kanban.saleorder.inherit res.partner @@ -18,6 +35,21 @@
    + + + res.partner.view.buttons + res.partner + form + + + +