From 50462d4296f21ba932dd5b38319a6e7182da60ce Mon Sep 17 00:00:00 2001 From: Yogesh Sakhreliya Date: Tue, 4 Jan 2011 15:30:59 +0530 Subject: [PATCH 001/306] [FIX] use ustr function instead of encoding in xsl report. lp bug: https://launchpad.net/bugs/695960 fixed bzr revid: ysa@tinyerp.com-20110104100059-55eydjnmtd22saed --- bin/report/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/report/interface.py b/bin/report/interface.py index 16dfafe0a18..3e710db9660 100644 --- a/bin/report/interface.py +++ b/bin/report/interface.py @@ -39,7 +39,7 @@ def toxml(val): if isinstance(val, str): str_utf8 = val elif isinstance(val, unicode): - str_utf8 = val.encode('utf-8') + str_utf8 = tools.ustr(val) else: str_utf8 = str(val) return str_utf8.replace('&', '&').replace('<','<').replace('>','>') From d0c25a2c23f222534f97e4451507cad2744ffe81 Mon Sep 17 00:00:00 2001 From: Yogesh Sakhreliya Date: Thu, 6 Jan 2011 16:53:17 +0530 Subject: [PATCH 002/306] [FIX] display simple error instead of traceback in sql bad query. bzr revid: ysa@tinyerp.com-20110106112317-0mj9v7n8n133af29 --- bin/sql_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/sql_db.py b/bin/sql_db.py index aed10423bb7..b9b72023980 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -133,7 +133,7 @@ class Cursor(object): raise except Exception: if log_exceptions or self.sql_log: - self.__logger.exception("bad query: %s", self._obj.query or query) + self.__logger.error("bad query: %s", self._obj.query or query) raise if self.sql_log: From fcf7c478cc18bd50530d94a56fc17d4edb0f01dd Mon Sep 17 00:00:00 2001 From: "YSA (Openerp)" Date: Thu, 20 Jan 2011 11:10:34 +0530 Subject: [PATCH 003/306] [FIX] call name_search method then pass context parameter in import_data method.. bzr revid: ysa@tinyerp.com-20110120054034-b8mdwsev5ax5c2cj --- bin/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 89b93c41923..1b6c9358e7a 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -728,7 +728,7 @@ class orm_template(object): id = ir_model_data[0]['res_id'] else: obj_model = self.pool.get(model_name) - ids = obj_model.name_search(cr, uid, id, operator='=') + ids = obj_model.name_search(cr, uid, id, operator='=', context=context) if not ids: raise ValueError('No record found for %s' % (id,)) id = ids[0][0] From bafa90b716f3d1c1382be039c317ed554912ca98 Mon Sep 17 00:00:00 2001 From: Olivier Ligot Date: Wed, 9 Feb 2011 11:08:45 +0100 Subject: [PATCH 004/306] [IMP] The command line option --i18n-overwrite can also be used when updating modules bzr revid: olivier.ligot@groupes.be-20110209100845-ldgoxolfz98k3mnu --- openerp/addons/__init__.py | 2 +- openerp/tools/config.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openerp/addons/__init__.py b/openerp/addons/__init__.py index af080724136..f91d66eb7a7 100644 --- a/openerp/addons/__init__.py +++ b/openerp/addons/__init__.py @@ -779,7 +779,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= modobj.write(cr, 1, [mid], {'state': 'installed', 'latest_version': ver}) cr.commit() # Update translations for all installed languages - modobj.update_translations(cr, 1, [mid], None) + modobj.update_translations(cr, 1, [mid], None, {'overwrite': tools.config['overwrite_existing_translations']}) cr.commit() package.state = 'installed' diff --git a/openerp/tools/config.py b/openerp/tools/config.py index 7d0b04739e4..7b0e560f4f6 100644 --- a/openerp/tools/config.py +++ b/openerp/tools/config.py @@ -217,7 +217,7 @@ class configmanager(object): group.add_option("--i18n-import", dest="translate_in", help="import a CSV or a PO file with translations and exit. The '-l' option is required.") group.add_option("--i18n-overwrite", dest="overwrite_existing_translations", action="store_true", default=False, - help="overwrites existing translation terms on importing a CSV or a PO file.") + help="overwrites existing translation terms on updating a module or importing a CSV or a PO file.") group.add_option("--modules", dest="translate_modules", help="specify modules to export. Use in combination with --i18n-export") group.add_option("--addons-path", dest="addons_path", @@ -264,8 +264,8 @@ class configmanager(object): die(opt.translate_in and (not opt.language or not opt.db_name), "the i18n-import option cannot be used without the language (-l) and the database (-d) options") - die(opt.overwrite_existing_translations and (not opt.translate_in), - "the i18n-overwrite option cannot be used without the i18n-import option") + die(opt.overwrite_existing_translations and not (opt.translate_in or opt.update), + "the i18n-overwrite option cannot be used without the i18n-import option or without the update option") die(opt.translate_out and (not opt.db_name), "the i18n-export option cannot be used without the database (-d) option") From b06fded288a7bfd4390378c394976f71a2d4880d Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 25 Feb 2011 14:56:54 +0100 Subject: [PATCH 005/306] [IMP] Allow to send an email if there is a bug in the OpenERP Server, avoid to lose the email. The email will send the full trace back with the original email and the parameters of the mailgateway [IMP] Add a new class for the configuration bzr revid: stephane@openerp.com-20110225135654-kjwzgb2ucyoy7syn --- .../openerp_mailgate/openerp_mailgate.py | 160 +++++++++++++++--- 1 file changed, 132 insertions(+), 28 deletions(-) diff --git a/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py b/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py index 204cb2d5d03..bcff408ef46 100644 --- a/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py +++ b/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py @@ -19,15 +19,71 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see # -########################################################################################### +############################################################################## +""" + openerp_mailgate.py +""" -import logging +import cgitb +import time import optparse import sys import xmlrpclib +import smtplib +from email.MIMEMultipart import MIMEMultipart +from email.MIMEBase import MIMEBase +from email.MIMEText import MIMEText +from email.Utils import COMMASPACE, formatdate +from email import Encoders -class rpc_proxy(object): - def __init__(self, uid, passwd, host='localhost', port=8069, path='object', dbname='openerp'): +class DefaultConfig(object): + """ + Default configuration + """ + OPENERP_DEFAULT_USER_ID = 1 + OPENERP_DEFAULT_PASSWORD = 'admin' + OPENERP_HOSTNAME = 'localhost' + OPENERP_PORT = 8069 + OPENERP_DEFAULT_DATABASE = 'openerp' + MAIL_ERROR = 'error@example.com' + MAIL_SERVER = 'localhost' + MAIL_ADMINS = ('admin@example.com',) + +config = DefaultConfig() + + +def send_mail(_from_, to_, subject, text, files=None, server=config.MAIL_SERVER): + assert isinstance(to_, (list, tuple)) + + if files is None: + files = [] + + msg = MIMEMultipart() + msg['From'] = _from_ + msg['To'] = COMMASPACE.join(to_) + msg['Date'] = formatdate(localtime=True) + msg['Subject'] = subject + + msg.attach( MIMEText(text) ) + + for file_name, file_content in files: + part = MIMEBase('application', "octet-stream") + part.set_payload( file_content ) + Encoders.encode_base64(part) + part.add_header('Content-Disposition', 'attachment; filename="%s"' + % file_name) + msg.attach(part) + + smtp = smtplib.SMTP(server) + smtp.sendmail(_from_, to_, msg.as_string() ) + smtp.close() + +class RPCProxy(object): + def __init__(self, uid, passwd, + host=config.OPENERP_HOSTNAME, + port=config.OPENERP_PORT, + path='object', + dbname=config.OPENERP_DEFAULT_DATABASE): self.rpc = xmlrpclib.ServerProxy('http://%s:%s/xmlrpc/%s' % (host, port, path), allow_none=True) self.user_id = uid self.passwd = passwd @@ -36,9 +92,9 @@ class rpc_proxy(object): def __call__(self, *request, **kwargs): return self.rpc.execute(self.dbname, self.user_id, self.passwd, *request, **kwargs) -class email_parser(object): +class EmailParser(object): def __init__(self, uid, password, model, email_default, dbname, host, port): - self.rpc = rpc_proxy(uid, password, host=host, port=port, dbname=dbname) + self.rpc = RPCProxy(uid, password, host=host, port=port, dbname=dbname) try: self.model_id = int(model) self.model = str(model) @@ -51,44 +107,92 @@ class email_parser(object): def parse(self, message, custom_values=None): if custom_values is None: custom_values = {} - try: - # pass message as bytes because we don't know its encoding until we parse its headers - # and hence can't convert it to utf-8 for transport - res_id = self.rpc('email.server.tools', 'process_email', self.model, xmlrpclib.Binary(message), custom_values) - except Exception: - logger = logging.getLogger('mail-gateway') - logger.warning('Failed to process incoming email. Source of the failed mail is available at debug level.', exc_info=True) - logger.debug('Source of the mail that failed to parse:', message) + # pass message as bytes because we don't know its encoding until we parse its headers + # and hence can't convert it to utf-8 for transport + self.rpc('email.server.tools', + 'process_email', + self.model, + xmlrpclib.Binary(message), + custom_values) -if __name__ == '__main__': - parser = optparse.OptionParser(usage='usage: %prog [options]', version='%prog v1.0') +def configure_parser(): + parser = optparse.OptionParser(usage='usage: %prog [options]', version='%prog v1.1') group = optparse.OptionGroup(parser, "Note", "This program parse a mail from standard input and communicate " "with the OpenERP server for case management in the CRM module.") parser.add_option_group(group) - parser.add_option("-u", "--user", dest="userid", help="ID of the user in OpenERP", default=1, type='int') - parser.add_option("-p", "--password", dest="password", help="Password of the user in OpenERP", default='admin') - parser.add_option("-o", "--model", dest="model", help="Name or ID of crm model", default="crm.lead") - parser.add_option("-m", "--default", dest="default", help="Default eMail in case of any trouble.", default=None) - parser.add_option("-d", "--dbname", dest="dbname", help="Database name (default: openerp)", default='openerp') - parser.add_option("--host", dest="host", help="Hostname of the OpenERP Server", default="localhost") - parser.add_option("--port", dest="port", help="Port of the OpenERP Server", default="8069") - parser.add_option("--custom-values", dest="custom_values", help="Add Custom Values to the object", default=None) + parser.add_option("-u", "--user", dest="userid", + help="ID of the user in OpenERP", + default=config.OPENERP_DEFAULT_USER_ID, type='int') + parser.add_option("-p", "--password", dest="password", + help="Password of the user in OpenERP", + default=config.OPENERP_DEFAULT_PASSWORD) + parser.add_option("-o", "--model", dest="model", + help="Name or ID of crm model", + default="crm.lead") + parser.add_option("-m", "--default", dest="default", + help="Default eMail in case of any trouble.", + default=None) + parser.add_option("-d", "--dbname", dest="dbname", + help="Database name (default: %default)", + default=config.OPENERP_DEFAULT_DATABASE) + parser.add_option("--host", dest="host", + help="Hostname of the OpenERP Server", + default=config.OPENERP_HOSTNAME) + parser.add_option("--port", dest="port", + help="Port of the OpenERP Server", + default=config.OPENERP_PORT) + parser.add_option("--custom-values", dest="custom_values", + help="Add Custom Values to the object", + default=None) + return parser + +def main(): + """ + Receive the email via the stdin and send it to the OpenERP Server + """ + parser = configure_parser() (options, args) = parser.parse_args() - logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s") - parser = email_parser(options.userid, options.password, options.model, options.default, dbname=options.dbname, host=options.host, port=options.port) + email_parser = EmailParser(options.userid, + options.password, + options.model, + options.default, + dbname=options.dbname, + host=options.host, + port=options.port) + msg_txt = sys.stdin.read() custom_values = {} try: - custom_values = dict(eval(options.custom_values)) + custom_values = dict(eval(options.custom_values or {} )) except: pass - parser.parse(msg_txt, custom_values) + try: + email_parser.parse(msg_txt, custom_values) + except Exception: + msg = '\n'.join([ + 'parameters', + '==========', + '%r' % (options,), + 'traceback', + '=========', + '%s' % (cgitb.text(sys.exc_info())), + ]) + + subject = '[OPENERP]:ERROR: Mailgateway - %s' % time.strftime('%Y-%m-%d %H:%M:%S') + send_mail( + config.MAIL_ERROR, + config.MAIL_ADMINS, + subject, msg, files=[('message.txt', msg_txt)] + ) + +if __name__ == '__main__': + main() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 3a30b348636be2fc67ffc72cb2e6e00513e25b4f Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Tue, 8 Mar 2011 14:09:39 +0530 Subject: [PATCH 006/306] [IMP]:Put names in act_windows because of blank names we are not able to find some act_windows bzr revid: ksa@tinyerp.co.in-20110308083939-ebfhrlt53g7ysuo5 --- addons/auction/auction_view.xml | 5 ++++- addons/auction/board_auction_view.xml | 2 ++ addons/auction/report/report_auction_view.xml | 3 +++ addons/caldav/caldav_view.xml | 1 + addons/crm/board_crm_statistical_view.xml | 3 +++ addons/crm/board_crm_view.xml | 3 +++ addons/crm/crm_meeting_menu.xml | 1 + addons/crm/crm_report_view.xml | 4 ++++ addons/document/document_view.xml | 1 + addons/document_webdav/webdav_view.xml | 2 ++ addons/event/event_view.xml | 1 + addons/membership/report/report_membership_view.xml | 1 + addons/sale_crm/board_sale_crm_view.xml | 1 + addons/share/res_users_view.xml | 2 ++ addons/stock/board_warehouse_view.xml | 2 ++ 15 files changed, 31 insertions(+), 1 deletion(-) diff --git a/addons/auction/auction_view.xml b/addons/auction/auction_view.xml index e55938d2ecd..3805dc602dc 100644 --- a/addons/auction/auction_view.xml +++ b/addons/auction/auction_view.xml @@ -39,6 +39,7 @@ + Auction Artist auction.artists form @@ -76,12 +77,13 @@ + Auction object Categories auction.lot.category form - @@ -759,6 +761,7 @@ + Bid Open auction.bid tree,form diff --git a/addons/auction/board_auction_view.xml b/addons/auction/board_auction_view.xml index 12ef99043b0..298b96199b8 100644 --- a/addons/auction/board_auction_view.xml +++ b/addons/auction/board_auction_view.xml @@ -6,12 +6,14 @@ + Report latest object tree auction.lots form tree,form + Report latest deposit tree auction.deposit form tree,form diff --git a/addons/auction/report/report_auction_view.xml b/addons/auction/report/report_auction_view.xml index b521ce38e78..67a4984fe28 100644 --- a/addons/auction/report/report_auction_view.xml +++ b/addons/auction/report/report_auction_view.xml @@ -168,12 +168,14 @@ Objects per Day + Report Auction object date tree report.auction.object.date form graph,tree [('user_id','=',uid),('month','=',time.strftime('%Y-%m-01'))] + Report Auction object date report.auction.object.date form graph,tree @@ -211,6 +213,7 @@ Auction adjudication + Report Auction Adjudication tree report.auction.adjudication form graph,tree diff --git a/addons/caldav/caldav_view.xml b/addons/caldav/caldav_view.xml index 6ddcde0bd59..50a19012992 100644 --- a/addons/caldav/caldav_view.xml +++ b/addons/caldav/caldav_view.xml @@ -48,6 +48,7 @@ + Document directory form [('calendar_collection','=',False)] diff --git a/addons/crm/board_crm_statistical_view.xml b/addons/crm/board_crm_statistical_view.xml index 333a8684764..2176af102eb 100644 --- a/addons/crm/board_crm_statistical_view.xml +++ b/addons/crm/board_crm_statistical_view.xml @@ -43,6 +43,7 @@ + Opportunities Categories Opportunities by Categories crm.lead.report form @@ -53,6 +54,7 @@ + Opportunities stage crm.lead.report form graph,tree,form @@ -62,6 +64,7 @@ + Opportunities stage user Planned revenue by user and stage crm.lead.report form diff --git a/addons/crm/board_crm_view.xml b/addons/crm/board_crm_view.xml index 41628b61f8f..0357f87494a 100644 --- a/addons/crm/board_crm_view.xml +++ b/addons/crm/board_crm_view.xml @@ -87,6 +87,7 @@ + My Meetings crm.meeting form tree,form @@ -95,6 +96,7 @@ + My opportunity stage crm.lead.report form graph,tree,form @@ -104,6 +106,7 @@ + sales pipeline crm.lead.report form graph,tree,form diff --git a/addons/crm/crm_meeting_menu.xml b/addons/crm/crm_meeting_menu.xml index 3f07b140e75..6a7bc79e5b9 100644 --- a/addons/crm/crm_meeting_menu.xml +++ b/addons/crm/crm_meeting_menu.xml @@ -13,6 +13,7 @@ /> + Create Partner for Meeting diff --git a/addons/crm/crm_report_view.xml b/addons/crm/crm_report_view.xml index ee5a6ac35f4..7d133a0532f 100644 --- a/addons/crm/crm_report_view.xml +++ b/addons/crm/crm_report_view.xml @@ -90,6 +90,7 @@ + crm case section report.crm.case.section.categ2 form graph,tree @@ -180,6 +181,7 @@ + crm case section stage report.crm.case.section.stage form graph,tree @@ -271,6 +273,7 @@ + crm case section category stage report.crm.case.section.categ.stage form tree,graph @@ -363,6 +366,7 @@ + case section category report.crm.case.section.categ.categ2 form tree,graph diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index 6f82dde0a4f..0447fae6bdd 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -51,6 +51,7 @@ + Document Storage ir.actions.act_window document.storage form diff --git a/addons/document_webdav/webdav_view.xml b/addons/document_webdav/webdav_view.xml index 4e76346469a..bfa3685783e 100644 --- a/addons/document_webdav/webdav_view.xml +++ b/addons/document_webdav/webdav_view.xml @@ -50,6 +50,7 @@ + Dir Property ir.actions.act_window document.webdav.dir.property form @@ -142,6 +143,7 @@ + webdev file property ir.actions.act_window document.webdav.file.property form diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index c91d279021b..d6babcc9750 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -34,6 +34,7 @@ + Event Type event.type form diff --git a/addons/membership/report/report_membership_view.xml b/addons/membership/report/report_membership_view.xml index b14d3dcb88c..17e04884393 100644 --- a/addons/membership/report/report_membership_view.xml +++ b/addons/membership/report/report_membership_view.xml @@ -87,6 +87,7 @@ + Report Membership report.membership form diff --git a/addons/sale_crm/board_sale_crm_view.xml b/addons/sale_crm/board_sale_crm_view.xml index 132d7c699c5..5e1d6c3774a 100644 --- a/addons/sale_crm/board_sale_crm_view.xml +++ b/addons/sale_crm/board_sale_crm_view.xml @@ -40,6 +40,7 @@ + Turnover By Month account.invoice.report form graph,tree diff --git a/addons/share/res_users_view.xml b/addons/share/res_users_view.xml index 09733e81a01..990bf29a84a 100644 --- a/addons/share/res_users_view.xml +++ b/addons/share/res_users_view.xml @@ -17,6 +17,7 @@ + Users {'search_default_no_share': 1} @@ -37,6 +38,7 @@ + Groups {'search_default_no_share': 1} diff --git a/addons/stock/board_warehouse_view.xml b/addons/stock/board_warehouse_view.xml index a4b0054a124..0de341b4c1e 100644 --- a/addons/stock/board_warehouse_view.xml +++ b/addons/stock/board_warehouse_view.xml @@ -27,6 +27,7 @@ + stock incoming product delay report.stock.move form graph,tree @@ -35,6 +36,7 @@ {'search_default_month-1':1,'search_default_in':1,'group_by':['day'], 'group_by_no_leaf':1} + stock outcoming product delay report.stock.move form graph,tree From 8084d846369fbba92a277b2a066143e32da28bb0 Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Mon, 14 Mar 2011 18:14:29 +0100 Subject: [PATCH 007/306] [FIX] report webkit UTF-8 support and error in embed_image. Thank to Florent Xicluna for the patch bzr revid: nicolas.bessi@camptocamp.com-20110314171429-tmfet9ar3oelcws7 --- addons/report_webkit/report_helper.py | 2 +- addons/report_webkit/webkit_report.py | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/addons/report_webkit/report_helper.py b/addons/report_webkit/report_helper.py index db0c1c372fc..2b9d8c93256 100644 --- a/addons/report_webkit/report_helper.py +++ b/addons/report_webkit/report_helper.py @@ -48,7 +48,7 @@ class WebKitHelper(object): else : width = ' ' if height : - height = 'width="%spx"'%(height) + height = 'height="%spx"'%(height) else : height = ' ' toreturn = ''%( diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 2944b768643..0157343074d 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -44,6 +44,16 @@ import addons from tools.translate import _ from osv.osv import except_osv + +def mako_template(text): + """Build a Mako template. + + This template uses UTF-8 encoding + """ + # default_filters=['unicode', 'h'] can be used to set global filters + return Template(text, input_encoding='utf-8', output_encoding='utf-8') + + class WebKitParser(report_sxw): """Custom class that use webkit to render HTML reports Code partially taken from report openoffice. Thanks guys :) @@ -98,7 +108,9 @@ class WebKitParser(report_sxw): else: command = ['wkhtmltopdf'] - command.append('-q') + command.append('--quiet') + # default to UTF-8 encoding. Use to override. + command.append("--encoding 'utf-8'") if header : head_file = file( os.path.join( tmp_dir, @@ -276,7 +288,7 @@ class WebKitParser(report_sxw): company= user.company_id #default_filters=['unicode', 'entity'] can be used to set global filter - body_mako_tpl = Template(template ,input_encoding='utf-8') + body_mako_tpl = mako_template(template) helper = WebKitHelper(cursor, uid, report_xml.id, context) try : html = body_mako_tpl.render( helper=helper, @@ -288,7 +300,7 @@ class WebKitParser(report_sxw): msg = exceptions.text_error_template().render() netsvc.Logger().notifyChannel('Webkit render', netsvc.LOG_ERROR, msg) raise except_osv(_('Webkit render'), msg) - head_mako_tpl = Template(header, input_encoding='utf-8') + head_mako_tpl = mako_template(header) try : head = head_mako_tpl.render( company=company, @@ -305,7 +317,7 @@ class WebKitParser(report_sxw): exceptions.text_error_template().render()) foot = False if footer : - foot_mako_tpl = Template(footer ,input_encoding='utf-8') + foot_mako_tpl = mako_template(footer) try : foot = foot_mako_tpl.render( company=company, From 71f60b3c3db166c98b8da5d6086ce82613e3e207 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Tue, 15 Mar 2011 10:17:38 +0530 Subject: [PATCH 008/306] [IMP]: Give proper action name bzr revid: ksa@tinyerp.co.in-20110315044738-lw641vlh1tq0lela --- addons/auction/auction_view.xml | 2 +- addons/auction/board_auction_view.xml | 6 +++--- addons/auction/report/report_auction_view.xml | 6 +++--- addons/crm/board_crm_statistical_view.xml | 6 ++---- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/addons/auction/auction_view.xml b/addons/auction/auction_view.xml index 3805dc602dc..82efe655c5b 100644 --- a/addons/auction/auction_view.xml +++ b/addons/auction/auction_view.xml @@ -761,7 +761,7 @@ - Bid Open + Open Bids auction.bid tree,form diff --git a/addons/auction/board_auction_view.xml b/addons/auction/board_auction_view.xml index 298b96199b8..613d058ab98 100644 --- a/addons/auction/board_auction_view.xml +++ b/addons/auction/board_auction_view.xml @@ -6,14 +6,14 @@ - Report latest object tree + Latest object Report auction.lots form tree,form - Report latest deposit tree + Latest Deposit Report auction.deposit form tree,form @@ -112,7 +112,7 @@ action="open_board_auction" sequence="1" id="menu_board_auction_open" icon="terp-graph" parent="menu_board_auction"/> - + diff --git a/addons/auction/report/report_auction_view.xml b/addons/auction/report/report_auction_view.xml index 67a4984fe28..71f069f7dd7 100644 --- a/addons/auction/report/report_auction_view.xml +++ b/addons/auction/report/report_auction_view.xml @@ -168,14 +168,14 @@ Objects per Day - Report Auction object date tree + Auction object Date Report report.auction.object.date form graph,tree [('user_id','=',uid),('month','=',time.strftime('%Y-%m-01'))] - Report Auction object date + Auction object Date Report Tree report.auction.object.date form graph,tree @@ -213,7 +213,7 @@ Auction adjudication - Report Auction Adjudication tree + Auction Adjudication Report report.auction.adjudication form graph,tree diff --git a/addons/crm/board_crm_statistical_view.xml b/addons/crm/board_crm_statistical_view.xml index 2176af102eb..cc24dfe259d 100644 --- a/addons/crm/board_crm_statistical_view.xml +++ b/addons/crm/board_crm_statistical_view.xml @@ -43,8 +43,7 @@ - Opportunities Categories - Opportunities by Categories + Opportunities by Categories crm.lead.report form graph,tree,form @@ -64,8 +63,7 @@ - Opportunities stage user - Planned revenue by user and stage + Planned revenue by user and stage crm.lead.report form graph,tree,form From 30c2f1c33023e0072c9f87c40ceec145dabd3690 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Tue, 15 Mar 2011 14:08:26 +0530 Subject: [PATCH 009/306] [IMP]: Give proper action name bzr revid: ksa@tinyerp.co.in-20110315083826-q4te23k1c7m521ov --- addons/auction/auction_view.xml | 4 ++-- addons/auction/board_auction_view.xml | 4 ++-- addons/auction/report/report_auction_view.xml | 4 ++-- addons/caldav/caldav_view.xml | 2 +- addons/crm/board_crm_statistical_view.xml | 2 +- addons/crm/board_crm_view.xml | 4 ++-- addons/crm/crm_report_view.xml | 8 ++++---- addons/document/document_view.xml | 2 +- addons/document_webdav/webdav_view.xml | 8 ++++---- addons/event/event_view.xml | 2 +- addons/membership/report/report_membership_view.xml | 2 +- addons/sale_crm/board_sale_crm_view.xml | 2 +- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/addons/auction/auction_view.xml b/addons/auction/auction_view.xml index 82efe655c5b..500e55f805b 100644 --- a/addons/auction/auction_view.xml +++ b/addons/auction/auction_view.xml @@ -1,7 +1,7 @@ - @@ -39,7 +39,7 @@ - Auction Artist + Auction Artists auction.artists form diff --git a/addons/auction/board_auction_view.xml b/addons/auction/board_auction_view.xml index 613d058ab98..ec45ab19811 100644 --- a/addons/auction/board_auction_view.xml +++ b/addons/auction/board_auction_view.xml @@ -6,14 +6,14 @@ - Latest object Report + Latest objects auction.lots form tree,form - Latest Deposit Report + Latest Deposits auction.deposit form tree,form diff --git a/addons/auction/report/report_auction_view.xml b/addons/auction/report/report_auction_view.xml index 71f069f7dd7..d8c821e041b 100644 --- a/addons/auction/report/report_auction_view.xml +++ b/addons/auction/report/report_auction_view.xml @@ -168,14 +168,14 @@ Objects per Day - Auction object Date Report + My Auction object Date Report report.auction.object.date form graph,tree [('user_id','=',uid),('month','=',time.strftime('%Y-%m-01'))] - Auction object Date Report Tree + Auction object Date Report report.auction.object.date form graph,tree diff --git a/addons/caldav/caldav_view.xml b/addons/caldav/caldav_view.xml index 50a19012992..dd0cc2151ba 100644 --- a/addons/caldav/caldav_view.xml +++ b/addons/caldav/caldav_view.xml @@ -48,7 +48,7 @@ - Document directory form + Document directory [('calendar_collection','=',False)] diff --git a/addons/crm/board_crm_statistical_view.xml b/addons/crm/board_crm_statistical_view.xml index cc24dfe259d..d2d52e2701b 100644 --- a/addons/crm/board_crm_statistical_view.xml +++ b/addons/crm/board_crm_statistical_view.xml @@ -53,7 +53,7 @@ - Opportunities stage + Opportunities by Stage crm.lead.report form graph,tree,form diff --git a/addons/crm/board_crm_view.xml b/addons/crm/board_crm_view.xml index 0357f87494a..048a20a6025 100644 --- a/addons/crm/board_crm_view.xml +++ b/addons/crm/board_crm_view.xml @@ -96,7 +96,7 @@ - My opportunity stage + My Planned Revenues by Stage crm.lead.report form graph,tree,form @@ -106,7 +106,7 @@ - sales pipeline + My Win/Lost Ratio for the Last Year crm.lead.report form graph,tree,form diff --git a/addons/crm/crm_report_view.xml b/addons/crm/crm_report_view.xml index 7d133a0532f..16015c950e0 100644 --- a/addons/crm/crm_report_view.xml +++ b/addons/crm/crm_report_view.xml @@ -90,7 +90,7 @@ - crm case section + cases by section and category report.crm.case.section.categ2 form graph,tree @@ -181,7 +181,7 @@ - crm case section stage + cases by section and stage report.crm.case.section.stage form graph,tree @@ -273,7 +273,7 @@ - crm case section category stage + cases by section ,category and stage report.crm.case.section.categ.stage form tree,graph @@ -366,7 +366,7 @@ - case section category + cases by section ,category and category2 report.crm.case.section.categ.categ2 form tree,graph diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index 0447fae6bdd..8a76b8cfabb 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -51,7 +51,7 @@ - Document Storage + Storage Media ir.actions.act_window document.storage form diff --git a/addons/document_webdav/webdav_view.xml b/addons/document_webdav/webdav_view.xml index bfa3685783e..db74cbfa264 100644 --- a/addons/document_webdav/webdav_view.xml +++ b/addons/document_webdav/webdav_view.xml @@ -50,7 +50,7 @@ - Dir Property + DAV properties for folders ir.actions.act_window document.webdav.dir.property form @@ -74,7 +74,7 @@ - + document.webdav.file.property.form @@ -143,7 +143,7 @@ - webdev file property + DAV properties for documents ir.actions.act_window document.webdav.file.property form diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index d6babcc9750..8968169cf7d 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -34,7 +34,7 @@ - Event Type + Types of Events event.type form diff --git a/addons/membership/report/report_membership_view.xml b/addons/membership/report/report_membership_view.xml index 17e04884393..9cff243e930 100644 --- a/addons/membership/report/report_membership_view.xml +++ b/addons/membership/report/report_membership_view.xml @@ -87,7 +87,7 @@ - Report Membership + Members Analysis report.membership form diff --git a/addons/sale_crm/board_sale_crm_view.xml b/addons/sale_crm/board_sale_crm_view.xml index 5e1d6c3774a..27adce0ca9d 100644 --- a/addons/sale_crm/board_sale_crm_view.xml +++ b/addons/sale_crm/board_sale_crm_view.xml @@ -40,7 +40,7 @@ - Turnover By Month + Monthly Turnover account.invoice.report form graph,tree From 972f5e2186cecf0d7894fc78a832001056695527 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Fri, 18 Mar 2011 15:18:38 +0530 Subject: [PATCH 010/306] [IMP]: Improve act window name and menu name bzr revid: ksa@tinyerp.co.in-20110318094838-k2xkyhc98zyhmeff --- addons/auction/report/report_auction_view.xml | 4 +-- addons/caldav/caldav_view.xml | 2 +- addons/crm/board_crm_statistical_view.xml | 6 ++--- addons/crm/board_crm_view.xml | 4 +-- addons/crm/crm_meeting_menu.xml | 2 +- addons/crm/crm_report_view.xml | 8 +++--- addons/document_webdav/webdav_view.xml | 25 +++++++++++-------- addons/stock/board_warehouse_view.xml | 4 +-- 8 files changed, 30 insertions(+), 25 deletions(-) diff --git a/addons/auction/report/report_auction_view.xml b/addons/auction/report/report_auction_view.xml index d8c821e041b..b021ebfb650 100644 --- a/addons/auction/report/report_auction_view.xml +++ b/addons/auction/report/report_auction_view.xml @@ -168,14 +168,14 @@ Objects per Day - My Auction object Date Report + My Auction Object Date report.auction.object.date form graph,tree [('user_id','=',uid),('month','=',time.strftime('%Y-%m-01'))] - Auction object Date Report + Auction Object Date report.auction.object.date form graph,tree diff --git a/addons/caldav/caldav_view.xml b/addons/caldav/caldav_view.xml index dd0cc2151ba..4e0c6218bf6 100644 --- a/addons/caldav/caldav_view.xml +++ b/addons/caldav/caldav_view.xml @@ -48,7 +48,7 @@ - Document directory + Document Directory [('calendar_collection','=',False)] diff --git a/addons/crm/board_crm_statistical_view.xml b/addons/crm/board_crm_statistical_view.xml index d2d52e2701b..da9c78ebf01 100644 --- a/addons/crm/board_crm_statistical_view.xml +++ b/addons/crm/board_crm_statistical_view.xml @@ -43,7 +43,7 @@ - Opportunities by Categories + Opportunities By Categories crm.lead.report form graph,tree,form @@ -53,7 +53,7 @@ - Opportunities by Stage + Opportunities By Stage crm.lead.report form graph,tree,form @@ -63,7 +63,7 @@ - Planned revenue by user and stage + Planned Revenue By User and Stage crm.lead.report form graph,tree,form diff --git a/addons/crm/board_crm_view.xml b/addons/crm/board_crm_view.xml index 048a20a6025..f10f7283586 100644 --- a/addons/crm/board_crm_view.xml +++ b/addons/crm/board_crm_view.xml @@ -96,7 +96,7 @@ - My Planned Revenues by Stage + My Planned Revenues By Stage crm.lead.report form graph,tree,form @@ -106,7 +106,7 @@ - My Win/Lost Ratio for the Last Year + My Win/Lost Ratio for The Last Year crm.lead.report form graph,tree,form diff --git a/addons/crm/crm_meeting_menu.xml b/addons/crm/crm_meeting_menu.xml index 6a7bc79e5b9..61ef9942464 100644 --- a/addons/crm/crm_meeting_menu.xml +++ b/addons/crm/crm_meeting_menu.xml @@ -13,7 +13,7 @@ /> - Create Partner for Meeting + Create Partner For Meeting diff --git a/addons/crm/crm_report_view.xml b/addons/crm/crm_report_view.xml index 16015c950e0..6a8a0438a25 100644 --- a/addons/crm/crm_report_view.xml +++ b/addons/crm/crm_report_view.xml @@ -90,7 +90,7 @@ - cases by section and category + Cases By Section and Category report.crm.case.section.categ2 form graph,tree @@ -181,7 +181,7 @@ - cases by section and stage + Cases By Section and Stage report.crm.case.section.stage form graph,tree @@ -273,7 +273,7 @@ - cases by section ,category and stage + Cases By Section ,Category and Stage report.crm.case.section.categ.stage form tree,graph @@ -366,7 +366,7 @@ - cases by section ,category and category2 + Cases By Section ,Category and Category2 report.crm.case.section.categ.categ2 form tree,graph diff --git a/addons/document_webdav/webdav_view.xml b/addons/document_webdav/webdav_view.xml index db74cbfa264..b50c989e797 100644 --- a/addons/document_webdav/webdav_view.xml +++ b/addons/document_webdav/webdav_view.xml @@ -50,7 +50,7 @@ - DAV properties for folders + Folder Properties ir.actions.act_window document.webdav.dir.property form @@ -58,12 +58,18 @@ + + document.directory.webdav.inherit @@ -143,7 +149,7 @@ - DAV properties for documents + Document Properties ir.actions.act_window document.webdav.file.property form @@ -151,11 +157,10 @@ - + id="menu_document_props" + groups="base.group_extended" + parent="menu_properties"/> diff --git a/addons/stock/board_warehouse_view.xml b/addons/stock/board_warehouse_view.xml index 0de341b4c1e..df2ea7ce438 100644 --- a/addons/stock/board_warehouse_view.xml +++ b/addons/stock/board_warehouse_view.xml @@ -27,7 +27,7 @@ - stock incoming product delay + Incoming Products Delay report.stock.move form graph,tree @@ -36,7 +36,7 @@ {'search_default_month-1':1,'search_default_in':1,'group_by':['day'], 'group_by_no_leaf':1} - stock outcoming product delay + Outgoing Products Delay report.stock.move form graph,tree From e0c2ec4559bd484508fb183d930f57dfd8bb85a9 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Fri, 18 Mar 2011 15:26:30 +0530 Subject: [PATCH 011/306] [IMP]: Improve act window name bzr revid: ksa@tinyerp.co.in-20110318095630-tv3sfn25y83a4kmw --- addons/crm/board_crm_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/board_crm_view.xml b/addons/crm/board_crm_view.xml index f10f7283586..ec3e2a9c1e5 100644 --- a/addons/crm/board_crm_view.xml +++ b/addons/crm/board_crm_view.xml @@ -96,7 +96,7 @@ - My Planned Revenues By Stage + Planned Revenue By Stage crm.lead.report form graph,tree,form From 91cd6bfda1033caae7f3ee79afd1244a4e4cc5e0 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Fri, 18 Mar 2011 15:45:01 +0530 Subject: [PATCH 012/306] [IMP]: document_webdav: Minor improvement for action name suggested by xrg bzr revid: rpa@tinyerp.com-20110318101501-h97b9u5i7kegvro6 --- addons/document_webdav/webdav_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/document_webdav/webdav_view.xml b/addons/document_webdav/webdav_view.xml index b50c989e797..c9b924ddc1a 100644 --- a/addons/document_webdav/webdav_view.xml +++ b/addons/document_webdav/webdav_view.xml @@ -50,7 +50,7 @@ - Folder Properties + DAV Properties for Folders ir.actions.act_window document.webdav.dir.property form @@ -149,7 +149,7 @@ - Document Properties + DAV Properties for Documents ir.actions.act_window document.webdav.file.property form From ab2ef137529aa24cbbc55c2949974527a81e3703 Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Fri, 18 Mar 2011 11:22:45 +0100 Subject: [PATCH 013/306] [FIX] report webkit sample UTF-8 no filter on image. Thank to Florent Xicluna for the patch bzr revid: nicolas.bessi@camptocamp.com-20110318102245-302h2lbdf5r6czr2 --- addons/report_webkit/data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/report_webkit/data.xml b/addons/report_webkit/data.xml index 508cf426860..a841631faaa 100644 --- a/addons/report_webkit/data.xml +++ b/addons/report_webkit/data.xml @@ -53,7 +53,7 @@ - + From 7be91c10088e835ecc333bcdc7973734ea0041ed Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Tue, 22 Mar 2011 14:21:52 +0530 Subject: [PATCH 014/306] [FIX]:problem with create_date in base synchro lp bug: https://launchpad.net/bugs/725073 fixed bzr revid: ksa@tinyerp.co.in-20110322085152-xmq5lgh93351l7xh --- addons/base_synchro/wizard/base_synchro.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/base_synchro/wizard/base_synchro.py b/addons/base_synchro/wizard/base_synchro.py index 0535ca8054d..1a593684b59 100644 --- a/addons/base_synchro/wizard/base_synchro.py +++ b/addons/base_synchro/wizard/base_synchro.py @@ -103,6 +103,11 @@ class base_synchro(osv.osv_memory): if object.model_id.model=='crm.case.history': fields = ['email','description','log_id'] value = pool_src.get(object.model_id.model).read(cr, uid, [id], fields)[0] + if 'create_date' in value: + del value['create_date'] + for key ,val in value.iteritems(): + if type(val)==tuple: + value.update({key:val[0]}) value = self.data_transform(cr, uid, pool_src, pool_dest, object.model_id.model, value, action, context=context) id2 = self.get_id(cr, uid, object.id, id, action, context) # From 4ed6eeeba6809207de8f63e2f4c0fe33bf7e0b9a Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Tue, 22 Mar 2011 14:40:40 +0100 Subject: [PATCH 015/306] [FIX] utf8 debug + minial bin version bzr revid: nicolas.bessi@camptocamp.com-20110322134040-co8s0zyt87t6ymwc --- addons/report_webkit/data.xml | 2 +- addons/report_webkit/webkit_report.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/report_webkit/data.xml b/addons/report_webkit/data.xml index a841631faaa..62a76697ea5 100644 --- a/addons/report_webkit/data.xml +++ b/addons/report_webkit/data.xml @@ -75,7 +75,7 @@ -
${helper.embed_logo_by_name('camptocamp_logo')}${helper.embed_logo_by_name('camptocamp_logo')|n}
Mail: ${company.partner_id.address and company.partner_id.address[0].email or ''|entity}
${_debug or ''} + ${_debug or ''|n} ]]> diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 0157343074d..268364fc399 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -77,7 +77,8 @@ class WebKitParser(report_sxw): _('Please install executable on your system'+ ' (sudo apt-get install wkhtmltopdf) or download it from here:'+ ' http://code.google.com/p/wkhtmltopdf/downloads/list and set the'+ - ' path to the executable on the Company form.') + ' path to the executable on the Company form.'+ + 'Minimal version is 0.9.9') ) if os.path.isabs(path) : if (os.path.exists(path) and os.access(path, os.X_OK)\ @@ -339,7 +340,7 @@ class WebKitParser(report_sxw): time=time, helper=helper, css=css, - _debug=html, + _debug=html.decode(), formatLang=self.formatLang, setLang=self.setLang, _=self.translate_call, From ba2b179b304737fdf98a7eae21bd66f320439c6d Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Tue, 22 Mar 2011 15:01:20 +0100 Subject: [PATCH 016/306] [ADD] report_webkit contributor bzr revid: nicolas.bessi@camptocamp.com-20110322140120-brw1vqx19zd49b48 --- addons/report_webkit/webkit_report.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 92c01a748c4..0d32b89645c 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -5,6 +5,7 @@ # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) +# Contributor(s) : Florent Xicluna (Wingo SA) # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential From 6d10583973d371fff93a10896d43af832bc9826f Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Thu, 24 Mar 2011 14:14:17 +0530 Subject: [PATCH 017/306] [FIX] Account: Account chart wizard does not check if generated account code for bank journal exsits lp bug: https://launchpad.net/bugs/684119 fixed bzr revid: ara@tinyerp.com-20110324084417-9rqbu46o4v97x2ey --- addons/account/account.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 2bdb62b44c0..8947afc8fe4 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2921,15 +2921,27 @@ class wizard_multi_charts_accounts(osv.osv_memory): ref_acc_bank = obj_multi.chart_template_id.bank_account_view_id current_num = 1 + valid = True for line in obj_multi.bank_accounts_id: #create the account_account for this bank journal tmp = line.acc_name dig = obj_multi.code_digits if ref_acc_bank.code: - try: - new_code = str(int(ref_acc_bank.code.ljust(dig,'0')) + current_num) - except: - new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)),'0')) + str(current_num) + while valid: + try: + new_code = str(int(ref_acc_bank.code.ljust(dig, '0')) + current_num) + ids = obj_acc.search(cr, uid,[('code', '=', new_code)]) + if not ids: + valid = False + else: + current_num += 1 + except: + new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)), '0')) + str(current_num) + ids = obj_acc.search(cr, uid,[('code', '=', new_code)]) + if not ids: + valid = False + else: + current_num += 1 vals = { 'name': tmp, 'currency_id': line.currency_id and line.currency_id.id or False, @@ -2962,6 +2974,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): vals_journal['default_debit_account_id'] = acc_cash_id obj_journal.create(cr, uid, vals_journal) current_num += 1 + valid = True #create the properties property_obj = self.pool.get('ir.property') From 0de7622c037ee2aa18dea205847703624761343d Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Thu, 24 Mar 2011 14:16:53 +0530 Subject: [PATCH 018/306] [FIX] Account: Account chart wizard does not check if generated account code for bank journal exsits bzr revid: ara@tinyerp.com-20110324084653-ysbw98hvxcynrgqt --- 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 8947afc8fe4..def72ec08d3 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2930,14 +2930,14 @@ class wizard_multi_charts_accounts(osv.osv_memory): while valid: try: new_code = str(int(ref_acc_bank.code.ljust(dig, '0')) + current_num) - ids = obj_acc.search(cr, uid,[('code', '=', new_code)]) + ids = obj_acc.search(cr, uid, [('code', '=', new_code)]) if not ids: valid = False else: current_num += 1 except: new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)), '0')) + str(current_num) - ids = obj_acc.search(cr, uid,[('code', '=', new_code)]) + ids = obj_acc.search(cr, uid, [('code', '=', new_code)]) if not ids: valid = False else: From 82565f571b748ac285754e1eb1a633b9bcd00c51 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Fri, 25 Mar 2011 15:19:39 +0530 Subject: [PATCH 019/306] [FIX] Account: payment term line need at least 5 to 6 digits precision lp bug: https://launchpad.net/bugs/740596 fixed bzr revid: ara@tinyerp.com-20110325094939-k30q24tu5okj7mcm --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 2bdb62b44c0..1dab0d077af 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -102,7 +102,7 @@ class account_payment_term_line(osv.osv): ('fixed', 'Fixed Amount')], 'Valuation', required=True, help="""Select here the kind of valuation related to this payment term line. Note that you should have your last line with the type 'Balance' to ensure that the whole amount will be threated."""), - 'value_amount': fields.float('Value Amount', help="For Value percent enter % ratio between 0-1."), + 'value_amount': fields.float('Value Amount', digits=(16, 6), help="For Value percent enter % ratio between 0-1."), 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \ "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."), 'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."), From 10fbcafa0366bff92d3a77f966408cb9c5e84a6a Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 30 Mar 2011 11:48:09 +0530 Subject: [PATCH 020/306] [FIX] Account:Account chart wizard does not check if generated account code for bank journal exsits bzr revid: ara@tinyerp.com-20110330061809-3b28ug6dz37tq23v --- addons/account/account.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index def72ec08d3..e25ec7fa08c 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2930,18 +2930,13 @@ class wizard_multi_charts_accounts(osv.osv_memory): while valid: try: new_code = str(int(ref_acc_bank.code.ljust(dig, '0')) + current_num) - ids = obj_acc.search(cr, uid, [('code', '=', new_code)]) - if not ids: - valid = False - else: - current_num += 1 except: new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)), '0')) + str(current_num) - ids = obj_acc.search(cr, uid, [('code', '=', new_code)]) - if not ids: - valid = False - else: - current_num += 1 + ids = obj_acc.search(cr, uid, [('code', '=', new_code)]) + if not ids: + valid = False + else: + current_num += 1 vals = { 'name': tmp, 'currency_id': line.currency_id and line.currency_id.id or False, From 53cad5a3bf55108a443d726a2637f3bc3e9823a6 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 31 Mar 2011 16:52:06 +0530 Subject: [PATCH 021/306] [FIX]sale: wrong price calculation when changing UoM and pricelist based on other pricelist lp bug: https://launchpad.net/bugs/742100 fixed bzr revid: ron@tinyerp.com-20110331112206-5ww6yrqyc3y88yzw --- addons/product/pricelist.py | 1 + addons/sale/sale.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index 2271dbc86a6..4e7caff0e96 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -234,6 +234,7 @@ class product_pricelist(osv.osv): [res['base_pricelist_id']], product_id, qty, context=context)[res['base_pricelist_id']] ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id + uom_price_already_computed = True price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False) elif res['base'] == -2: # this section could be improved by moving the queries outside the loop: diff --git a/addons/sale/sale.py b/addons/sale/sale.py index f80d610eb03..ac80f65e5d9 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1111,6 +1111,8 @@ class sale_order_line(osv.osv): result['product_uos_qty'] = qty result['th_weight'] = q * product_obj.weight # Round the quantity up + if not uom: + uom =product_obj.uom_id and product_obj.uom_id.id if not uom2: uom2 = product_obj.uom_id if (product_obj.type=='product') and (product_obj.virtual_available * uom2.factor < qty * product_obj.uom_id.factor) \ From 79ca9ad384686e9fd70ec9f97fdf356bb5f5e5b1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 1 Apr 2011 15:19:10 +0530 Subject: [PATCH 022/306] [IMP]product: wrong price calculation when changing UoM and pricelist based on other pricelist bzr revid: ron@tinyerp.com-20110401094910-stho2qg6pcgdtrve --- 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 bab6b5f5cc1..a56f13e73fa 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -593,7 +593,7 @@ class product_product(osv.osv): res[product.id] = (res[product.id] * (product.price_margin or 1.0)) + \ product.price_extra if 'uom' in context: - uom = product.uos_id or product.uom_id + uom = product.uom_id or product.uos_id res[product.id] = product_uom_obj._compute_price(cr, uid, uom.id, res[product.id], context['uom']) # Convert from price_type currency to asked one From 4bc1c69250829f82ace458aeedca7b44a15c3ff0 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 4 Apr 2011 15:31:41 +0530 Subject: [PATCH 023/306] [REF]sale:refectoring code wrong price calculation when changing UoM and pricelist based on other pricelist bzr revid: ron@tinyerp.com-20110404100141-2i3og2pxcxf3n1sg --- addons/sale/sale.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index ac80f65e5d9..919358f500a 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1111,8 +1111,6 @@ class sale_order_line(osv.osv): result['product_uos_qty'] = qty result['th_weight'] = q * product_obj.weight # Round the quantity up - if not uom: - uom =product_obj.uom_id and product_obj.uom_id.id if not uom2: uom2 = product_obj.uom_id if (product_obj.type=='product') and (product_obj.virtual_available * uom2.factor < qty * product_obj.uom_id.factor) \ @@ -1135,7 +1133,7 @@ class sale_order_line(osv.osv): else: price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product, qty or 1.0, partner_id, { - 'uom': uom, + 'uom': uom or result.get('product_uom'), 'date': date_order, })[pricelist] if price is False: From fd97f9f966d48f69dd7f2b7a216c292811f9ee76 Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Tue, 5 Apr 2011 13:22:16 +0200 Subject: [PATCH 024/306] [FIX] better menu emplacement for webkit header bzr revid: nicolas.bessi@camptocamp.com-20110405112216-0cba0ii600gqd7lq --- addons/report_webkit/header_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/report_webkit/header_view.xml b/addons/report_webkit/header_view.xml index baca42d663f..f3b17f79675 100644 --- a/addons/report_webkit/header_view.xml +++ b/addons/report_webkit/header_view.xml @@ -49,7 +49,7 @@ form tree,form
- + Header HTML @@ -57,7 +57,7 @@ form tree,form - + From fd9fcd3ac77229ccf7e0d391ada83975860a4910 Mon Sep 17 00:00:00 2001 From: skh Date: Wed, 6 Apr 2011 12:27:36 +0530 Subject: [PATCH 025/306] [FIX] [PS] List view of leaves type contains different fields as the form view lp bug: https://launchpad.net/bugs/751299 fixed bzr revid: skh@tinyerp.com-20110406065736-944f5id53aesdf8b --- addons/hr_holidays/hr_holidays_view.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 7740470ccc7..2eb58504275 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -361,6 +361,12 @@ + + + + + + From a45a076aba0842e838bb1368d1c0d930ee406f0f Mon Sep 17 00:00:00 2001 From: skh Date: Wed, 6 Apr 2011 12:55:20 +0530 Subject: [PATCH 026/306] [FIX] [PS] List view of leaves type contains different fields as the form view lp bug: https://launchpad.net/bugs/751299 fixed bzr revid: skh@tinyerp.com-20110406072520-vd8qj7iphmzkry3r --- addons/hr_holidays/hr_holidays_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 2eb58504275..3de7a254f01 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -361,7 +361,7 @@ - + From 0f3d174ff241cd624cadef577918927cb939469f Mon Sep 17 00:00:00 2001 From: skh Date: Wed, 6 Apr 2011 15:29:19 +0530 Subject: [PATCH 027/306] [FIX] [PS] List view of leaves type contains different fields as the form view lp bug: https://launchpad.net/bugs/751299 fixed bzr revid: skh@tinyerp.com-20110406095919-rsp0rzugqglp901b --- addons/hr_holidays/hr_holidays_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 3de7a254f01..3f3a79c45cd 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -361,8 +361,8 @@ - - + + From 4ee8a210dcfaf4acb1083cc31ac84be563099914 Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Thu, 7 Apr 2011 10:38:13 +0200 Subject: [PATCH 028/306] [FIX] encoding support fix for use of subprocess bzr revid: nicolas.bessi@camptocamp.com-20110407083813-m8ymnb2lka3k6qex --- addons/report_webkit/webkit_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 46f0028dfd5..f48795c34d3 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -112,7 +112,7 @@ class WebKitParser(report_sxw): command.append('--quiet') # default to UTF-8 encoding. Use to override. - command.append("--encoding 'utf-8'") + command.extend(['--encoding', 'utf-8']) if header : head_file = file( os.path.join( tmp_dir, From 0cf43b7857b45455be2076b52c99f5fa84f1a70d Mon Sep 17 00:00:00 2001 From: "Ferdinand @ Camptocamp" <> Date: Wed, 13 Apr 2011 13:02:11 +0530 Subject: [PATCH 029/306] [FIX] account: Improved invoice analysis report for calculation of total without tax lp bug: https://launchpad.net/bugs/748178 fixed bzr revid: pso@tinyerp.com-20110413073211-nktkleb1izezr7o0 --- .../account/report/account_invoice_report.py | 59 +++++++++++-------- .../report/account_invoice_report_view.xml | 4 +- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 9c7cf014e4d..4815b00ba25 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -69,6 +69,7 @@ class account_invoice_report(osv.osv): 'address_contact_id': fields.many2one('res.partner.address', 'Contact Address Name', readonly=True), 'address_invoice_id': fields.many2one('res.partner.address', 'Invoice Address Name', readonly=True), 'account_id': fields.many2one('account.account', 'Account',readonly=True), + 'account_line_id': fields.many2one('account.account', 'Account Line',readonly=True), 'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',readonly=True), 'residual': fields.float('Total Residual', readonly=True), 'delay_to_pay': fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"), @@ -106,44 +107,48 @@ class account_invoice_report(osv.osv): ai.address_contact_id as address_contact_id, ai.address_invoice_id as address_invoice_id, ai.account_id as account_id, + ail.account_id as account_line_id, ai.partner_bank_id as partner_bank_id, sum(case when ai.type in ('out_refund','in_invoice') then - ail.quantity / u.factor * -1 + -ail.quantity / u.factor else ail.quantity / u.factor end) as product_qty, + sum(case when ai.type in ('out_refund','in_invoice') then - ail.quantity*ail.price_unit * -1 + -ail.price_subtotal else - ail.quantity*ail.price_unit + ail.price_subtotal end) / cr.rate as price_total, + +-- +-- FIXME the line total incl tax can't be caculated by deviding the invoice total / number of lines +-- sum(case when ai.type in ('out_refund','in_invoice') then - ai.amount_total * -1 + -ai.amount_total else ai.amount_total - end) / (CASE WHEN + end) / (CASE WHEN (select count(l.id) from account_invoice_line as l left join account_invoice as a ON (a.id=l.invoice_id) - where a.id=ai.id) <> 0 - THEN + where a.id=ai.id) <> 0 + THEN (select count(l.id) from account_invoice_line as l left join account_invoice as a ON (a.id=l.invoice_id) - where a.id=ai.id) - ELSE 1 + where a.id=ai.id) + ELSE 1 END) / cr.rate as price_total_tax, + (case when ai.type in ('out_refund','in_invoice') then - sum(ail.quantity*ail.price_unit*-1) + sum(-ail.price_subtotal) else - sum(ail.quantity*ail.price_unit) - end) / (CASE WHEN - (case when ai.type in ('out_refund','in_invoice') - then sum(ail.quantity/u.factor*-1) - else sum(ail.quantity/u.factor) end) <> 0 - THEN - (case when ai.type in ('out_refund','in_invoice') - then sum(ail.quantity/u.factor*-1) - else sum(ail.quantity/u.factor) end) - ELSE 1 + sum(ail.price_subtotal) + end) / (CASE WHEN sum(ail.quantity/u.factor) <> 0 + THEN + (case when ai.type in ('out_refund','in_invoice') + then sum(-ail.quantity/u.factor) + else sum(ail.quantity/u.factor) end) + ELSE 1 END) / cr.rate as price_average, @@ -159,22 +164,23 @@ class account_invoice_report(osv.osv): left join account_invoice_line as l ON (a.id=l.invoice_id) where a.id=ai.id)) as due_delay, (case when ai.type in ('out_refund','in_invoice') then - ai.residual * -1 + -ai.residual else ai.residual - end)/ (CASE WHEN + end)/ (CASE WHEN (select count(l.id) from account_invoice_line as l left join account_invoice as a ON (a.id=l.invoice_id) - where a.id=ai.id) <> 0 + where a.id=ai.id) <> 0 THEN (select count(l.id) from account_invoice_line as l left join account_invoice as a ON (a.id=l.invoice_id) - where a.id=ai.id) - ELSE 1 + where a.id=ai.id) + ELSE 1 END) / cr.rate as residual from account_invoice_line as ail left join account_invoice as ai ON (ai.id=ail.invoice_id) - left join product_template pt on (pt.id=ail.product_id) + left join product_product pr on (pr.id=ail.product_id) + left join product_template pt on (pt.id=pr.product_tmpl_id) left join product_uom u on (u.id=ail.uos_id), res_currency_rate cr where cr.id in (select id from res_currency_rate cr2 where (cr2.currency_id = ai.currency_id) @@ -202,6 +208,7 @@ class account_invoice_report(osv.osv): ai.address_contact_id, ai.address_invoice_id, ai.account_id, + ail.account_id, ai.partner_bank_id, ai.residual, ai.amount_total, diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index 6c1bc3f9762..a0a9729a775 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -27,10 +27,10 @@ + - @@ -103,6 +103,7 @@ + @@ -120,6 +121,7 @@ + From 3b31cb43692cfd1a7ef1c57dff8d4fc1928c1990 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Thu, 14 Apr 2011 11:03:11 +0530 Subject: [PATCH 030/306] [FIX] project: If a project is deleted its related analytic account should also be deleted. lp bug: https://launchpad.net/bugs/758699 fixed bzr revid: uco@tinyerp.com-20110414053311-ucmrf4vkl3ogl872 --- addons/project/project.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/project/project.py b/addons/project/project.py index 134364d8b1a..9473918bf95 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -118,9 +118,11 @@ class project(osv.osv): return result.keys() def unlink(self, cr, uid, ids, *args, **kwargs): + analytic_obj = self.pool.get('account.analytic.account') for proj in self.browse(cr, uid, ids): if proj.tasks: raise osv.except_osv(_('Operation Not Permitted !'), _('You can not delete a project with tasks. I suggest you to deactivate it.')) + analytic_obj.unlink(cr, uid, [proj.analytic_account_id.id]) return super(project, self).unlink(cr, uid, ids, *args, **kwargs) _columns = { From 96d2e9b535773c30b29f3c498170a28a833f2c00 Mon Sep 17 00:00:00 2001 From: cpa-openerp Date: Fri, 15 Apr 2011 15:02:53 +0530 Subject: [PATCH 031/306] [FIX] Dataset is used to read records (read_ids method). bzr revid: cpa@tinyerp.com-20110415093253-qx78tf0001u1cg4d --- addons/base_gantt/__openerp__.py | 4 +- addons/base_gantt/controllers/main.py | 176 +-------- .../lib/dhtmlxGantt/sources/dhtmlxgantt.js | 4 +- addons/base_gantt/static/src/js/gantt.js | 366 +++++++++++------- .../base_gantt/static/src/xml/base_gantt.xml | 5 +- 5 files changed, 231 insertions(+), 324 deletions(-) diff --git a/addons/base_gantt/__openerp__.py b/addons/base_gantt/__openerp__.py index 55cec2c0863..c23f352a4f7 100644 --- a/addons/base_gantt/__openerp__.py +++ b/addons/base_gantt/__openerp__.py @@ -3,8 +3,8 @@ "version": "2.0", "depends": ['base'], "js": [ - 'static/lib/dhtmlxGantt/codebase/dhtmlxcommon.js', - 'static/lib/dhtmlxGantt/codebase/dhtmlxgantt.js', + 'static/lib/dhtmlxGantt/sources/dhtmlxcommon.js', + 'static/lib/dhtmlxGantt/sources/dhtmlxgantt.js', 'static/src/js/gantt.js' ], "css": ['static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css'], diff --git a/addons/base_gantt/controllers/main.py b/addons/base_gantt/controllers/main.py index 7edb4d28763..a2e52c0cb32 100644 --- a/addons/base_gantt/controllers/main.py +++ b/addons/base_gantt/controllers/main.py @@ -1,184 +1,24 @@ -import glob, os -from xml.etree import ElementTree -import math -import simplejson import openerpweb -import time -import datetime -from base.controllers.main import Xml2Json - +from base.controllers.main import View -COLOR_PALETTE = ['#f57900', '#cc0000', '#d400a8', '#75507b', '#3465a4', '#73d216', '#c17d11', '#edd400', - '#fcaf3e', '#ef2929', '#ff00c9', '#ad7fa8', '#729fcf', '#8ae234', '#e9b96e', '#fce94f', - '#ff8e00', '#ff0000', '#b0008c', '#9000ff', '#0078ff', '#00ff00', '#e6ff00', '#ffff00', - '#905000', '#9b0000', '#840067', '#510090', '#0000c9', '#009b00', '#9abe00', '#ffc900', ] - -_colorline = ['#%02x%02x%02x' % (25 + ((r + 10) % 11) * 23, 5 + ((g + 1) % 11) * 20, 25 + ((b + 4) % 11) * 23) for r in range(11) for g in range(11) for b in range(11) ] - -def choice_colors(n): - if n > len(COLOR_PALETTE): - return _colorline[0:-1:len(_colorline) / (n + 1)] - elif n: - return COLOR_PALETTE[:n] - return [] - -class GanttView(openerpweb.Controller): +class GanttView(View): _cp_path = "/base_gantt/ganttview" - date_start = None - date_delay = None - date_stop = None - color_field = None - - day_length = 8 - fields = {} - events = [] - calendar_fields = {} - ids = [] model = '' domain = [] context = {} - event_res = [] - colors = {} - color_values = [] @openerpweb.jsonrequest def load(self, req, model, view_id): - m = req.session.model(model) - r = m.fields_view_get(view_id, 'gantt') - r["arch"] = Xml2Json.convert_to_structure(r["arch"]) - return {'fields_view':r} - - @openerpweb.jsonrequest - def get_events(self, req, **kw): - - self.model = kw['model'] - self.fields = kw['fields'] - self.day_length = kw['day_length'] - self.calendar_fields = kw['calendar_fields'] - self.color_field = kw.get('color_field') or self.color_field or None - self.fields[self.color_field] = "" - self.colors = kw.get('colors') or {} - self.text = self.calendar_fields['text']['name'] + fields_view = self.fields_view_get(req, model, view_id, 'gantt') + return {'fields_view':fields_view} - self.date_start = self.calendar_fields['date_start']['name'] - self.fields[self.date_start] = "" - - if self.calendar_fields.get('date_stop'): - self.date_stop = self.calendar_fields['date_stop']['name'] - self.fields[self.date_stop] = "" - if self.calendar_fields.get('date_delay'): - self.date_delay = self.calendar_fields['date_delay']['name'] - self.fields[self.date_delay] = "" - if self.calendar_fields.get('parent'): - self.parent = self.calendar_fields['parent']['name'] - self.fields[self.parent] = "" - - model = req.session.model(self.model) - event_ids = model.search([]) - - return self.create_event(event_ids, model) - - def create_event(self, event_ids, model): - - self.events = model.read(event_ids, self.fields.keys()) - result = [] - for evt in self.events: - - event_res = {} - key = evt[self.color_field] - name = key - value = key - if isinstance(key, list): # M2O, XMLRPC returns List instead of Tuple - name = key[0] - value = key[-1] - evt[self.color_field] = key = key[-1] - if isinstance(key, tuple): # M2O - value, name = key - - self.colors[key] = (name, value, None) - - st_date = evt.get(self.date_start) - if st_date: - self.set_format(st_date) - if self.date_delay: - duration = evt.get(self.date_delay) - else: - en_date = evt.get(self.date_stop) - - duration = (time.mktime(time.strptime(en_date, self.format))-\ - time.mktime(time.strptime(st_date, self.format)))/ (60 * 60) - - if duration > self.day_length : - d = math.floor(duration / 24) - h = duration % 24 - duration = d * self.day_length + h - - event_res = {} - event_res['start_date'] = st_date - event_res['duration'] = duration - event_res['text'] = evt.get(self.text) - event_res['id'] = evt['id'] - event_res['parent'] = evt.get(self.parent) - result.append(event_res) - - colors = choice_colors(len(self.colors)) - for i, (key, value) in enumerate(self.colors.items()): - self.colors[key] = [value[0], value[1], colors[i]] - - return {'result': result,'sidebar': self.colors} - - def set_format(self, st_date): - if len(st_date) == 10 : - self.format = "%Y-%m-%d" - else : - self.format = "%Y-%m-%d %H:%M:%S" - return - - def check_format(self, date): - if self.format == "%Y-%m-%d %H:%M:%S": - date = date + " 00:00:00" - return date - - @openerpweb.jsonrequest - def on_event_resize(self, req, **kw): - if self.date_delay: - key = self.date_delay - value = kw['duration'] - else: - key = self.date_stop - value = self.check_format(kw['end_date']) - try: - model = req.session.model(self.model) - res = model.write(kw['id'], {key : value}) - except Exception, e: - print "eeeeeeeeeeeeeeeeeeeeeeeeeee",e - return True - - @openerpweb.jsonrequest - def on_event_drag(self, req, **kw): - start_date = self.check_format(kw['start_date']) - if self.date_delay: - key = self.date_delay - value = kw['duration'] - else: - key = self.date_stop - value = self.check_format(kw['end_date']) - try: - model = req.session.model(self.model) - res = model.write(kw['id'], {self.date_start : start_date, key : value}) - except Exception, e: - print "eeeeeeeeeeeeeeeeeeeeeeeeeee",e - return True - @openerpweb.jsonrequest def reload_gantt(self, req, **kw): model = req.session.model(kw['model']) - if (kw['domain']): - domain = (kw['color_field'],'in', kw['domain']) - event_ids = model.search([domain]) - else: - event_ids = model.search([]) - return self.create_event(event_ids, model) + domain = kw['domain'] + + event_ids = model.search(domain) + return event_ids \ No newline at end of file diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js b/addons/base_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js index 52b9b562e96..7efcd730293 100644 --- a/addons/base_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js +++ b/addons/base_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js @@ -348,7 +348,7 @@ GanttProject.prototype.create = function() * @type: public * @topic: 0 */ -function GanttChart() +function GanttChart(day_length) { this.Error = new GanttError(); this.dhtmlXMLSenderObject = new dhtmlXMLSenderObject(this); @@ -356,7 +356,7 @@ function GanttChart() //settings this.heightTaskItem = 12; this.dayInPixels = 24; - this.hoursInDay = 8; + this.hoursInDay = day_length; this._showTreePanel = true; this._showTooltip = true; this.isShowDescTask = false; diff --git a/addons/base_gantt/static/src/js/gantt.js b/addons/base_gantt/static/src/js/gantt.js index f8391f2744b..f23da0c580d 100644 --- a/addons/base_gantt/static/src/js/gantt.js +++ b/addons/base_gantt/static/src/js/gantt.js @@ -7,7 +7,8 @@ QWeb.add_template('/base_gantt/static/src/xml/base_gantt.xml'); openerp.base.views.add('gantt', 'openerp.base_gantt.GanttView'); openerp.base_gantt.GanttView = openerp.base.Controller.extend({ - init: function(view_manager, session, element_id, dataset, view_id) { +init: function(view_manager, session, element_id, dataset, view_id) { + this._super(session, element_id); this.view_manager = view_manager; this.dataset = dataset; @@ -16,82 +17,224 @@ openerp.base_gantt.GanttView = openerp.base.Controller.extend({ this.fields_views = {}; this.widgets = {}; this.widgets_counter = 0; - this.fields = {}; - this.datarecord = {}; - this.calendar_fields = {}; - }, - do_show: function () { - // TODO: re-trigger search - this.$element.show(); - }, - do_hide: function () { - this.$element.hide(); + this.fields = this.dataset.fields ? this.dataset.fields: {}; + this.ids = this.dataset.ids; + this.name = ""; + this.date_start = ""; + this.date_delay = ""; + this.date_stop = ""; + this.color_field = ""; + this.day_lenth = 8; + this.colors = []; + this.color_values = []; + this.calendar_fields = {}; + this.info_fields = []; + this.domain = this.dataset._domain ? this.dataset._domain: []; + this.context = {}; + }, + start: function() { + this.rpc("/base_gantt/ganttview/load", {"model": this.model, "view_id": this.view_id}, this.on_loaded); + }, + on_loaded: function(data) { + + var self = this; this.fields_view = data.fields_view; - var self = this; this.name = this.fields_view.name || this.fields_view.arch.attrs.string; this.view_id = this.fields_view.view_id; this.date_start = this.fields_view.arch.attrs.date_start; this.date_delay = this.fields_view.arch.attrs.date_delay; this.date_stop = this.fields_view.arch.attrs.date_stop; - this.color_field = this.fields_view.arch.attrs.color; + this.color_field = this.fields_view.arch.attrs.color; this.day_length = this.fields_view.arch.attrs.day_length || 8; this.colors = this.fields_view.arch.attrs.colors; - this.fields = this.fields_view.fields; this.text = this.fields_view.arch.children[0].children[0].attrs.name; this.parent = this.fields_view.arch.children[0].attrs.link; - - this.calendar_fields['parent'] = {'name': this.parent}; - this.calendar_fields['date_start'] = {'name': this.date_start}; - this.calendar_fields['text'] = {'name': this.text}; - if(this.date_delay) - this.calendar_fields['date_delay'] = {'name': this.date_delay}; - if(this.date_stop) - this.calendar_fields['date_stop'] = {'name': this.date_stop}; - - this.calendar_fields['day_length'] = this.day_length; - this.rpc('/base_gantt/ganttview/get_events', - {'model': this.model, - 'fields': this.fields, - 'color_field': this.color_field, - 'day_length': this.day_length, - 'calendar_fields': this.calendar_fields, - 'colors': this.colors, - 'info_fields': this.info_fields - }, - function(res) { - self.create_gantt(); - self.load_event(res); - }) + + this.format = "%Y-%m-%d"; + this.time = "00:00:00"; + + self.create_gantt(); + self.get_events(self.ids); + this.$element.html(QWeb.render("GanttView", {"view": this, "fields_view": this.fields_view})); }, + + create_gantt: function() { + + ganttChartControl = new GanttChart(this.day_length); + ganttChartControl.setImagePath("/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/"); + ganttChartControl.setEditable(true); + ganttChartControl.showTreePanel(true); + ganttChartControl.showContextMenu(true); + ganttChartControl.showDescTask(true,'d,s-f'); + ganttChartControl.showDescProject(true,'n,d'); + + }, + + get_events: function(event_ids) { + + var self = this; + this.dataset.read_ids(event_ids, {}, function(result) { + self.load_event(result); + }); + + }, + + load_event: function(events) { + + var self = this; + var result = events; + var project_id = new Array(); + var project = new Array(); + var sidebar = {} + var j = -1; + + for (i in result) { + + if (result[i][this.date_start] != false){ + var parent_id = result[i][this.parent][0]; + var parent_name = result[i][this.parent][1]; + + if (jQuery.inArray(parent_id, project_id) == -1){ + if (parent_id == undefined){ + parent_name = ""; + } + j = j + 1; + project[j] = new GanttProjectInfo(parent_id, parent_name, new Date(2011, 1, 1)); + project_id[j] = parent_id; + } + + var id = result[i]['id']; + var text = result[i][this.text]; + + var start_date = this.convert_date_format(result[i][this.date_start]); + + if (this.date_stop != undefined){ + if (result[i][this.date_stop] != false){ + var stop_date = this.convert_date_format(result[i][this.date_stop]); + var duration= self.hours_between(start_date, stop_date); + } + else{ + var duration = 0; + } + } + else{ + var duration = result[i][this.date_delay]; + } + if (duration == false) + duration = 0 + + var task = new GanttTaskInfo(id, text, start_date, duration, 100, ""); + + k = project_id.indexOf(parent_id); + project[k].addTask(task); + } + } + + for (i in project_id){ + ganttChartControl.addProject(project[i]); + } + + ganttChartControl.create("GanttDiv"); + ganttChartControl.attachEvent("onTaskEndResize", function(task) {self.on_task_end_resize(task);}) + ganttChartControl.attachEvent("onTaskEndDrag", function(task) {self.on_task_end_drag(task);}) + + }, + + hours_between: function(date1, date2) { + + var ONE_DAY = 1000 * 60 * 60 * 24 + var date1_ms = date1.getTime() + var date2_ms = date2.getTime() + var difference_ms = Math.abs(date1_ms - date2_ms) + + d = Math.round(difference_ms / ONE_DAY) + h = Math.round(difference_ms % ONE_DAY) + + return (d * this.day_length) + h; + + }, + + on_task_end_resize : function(task) { + + var event_id = task.getId(); + var data = {}; + + if (this.date_stop != undefined){ + data[this.date_stop] = this.reverse_convert_date_format(task.getFinishDate()); + }else{ + data[this.date_delay] = task.getDuration(); + } + this.dataset.write(event_id, data, function(result) {}); + + }, + + on_task_end_drag : function(task) { + + var event_id = task.getId(); + var data = {}; + + data[this.date_start] = this.reverse_convert_date_format(task.getEST()); + + if (this.date_stop != undefined){ + data[this.date_stop] = this.reverse_convert_date_format(task.getFinishDate()); + }else{ + data[this.date_delay] = task.getDuration(); + } + + this.dataset.write(event_id, data, function(result) {}); + + }, + + do_show: function () { + + this.$element.show(); + + }, + + do_hide: function () { + + this.$element.hide(); + + }, + convert_date_format: function(date) { - date=date+""; - if(typeof (date)!="string"||date.length===0){ + var self = this; + + if (date.length == 19){ + self.format = "%Y-%m-%d %H:%M:%S"; + self.time = date.split(' ')[1]; + } + + date = date+""; + if(typeof (date) != "string" || date.length === 0){ return null; } var iso=date.split("-"); - if(iso.length===0){ + if(iso.length === 0){ return null; } var day = iso[2]; + var iso_hours = day.split(' '); if (iso_hours.length > 1) { day = iso_hours[0]; - var iso_date_hours = iso_hours[1].split(':') + var iso_date_hours = iso_hours[1].split(':'); var new_date = new Date(iso[0], iso[1] - 1, day); new_date.setHours(iso_date_hours[0]); new_date.setMinutes(iso_date_hours[1]); new_date.setSeconds(iso_date_hours[2]); + } else { var new_date = new Date(iso[0], iso[1] - 1, day); @@ -100,125 +243,52 @@ openerp.base_gantt.GanttView = openerp.base.Controller.extend({ new_date.setMonth(iso[1]-1); new_date.setDate(day); return new_date; + }, - create_gantt: function() { - ganttChartControl = new GanttChart(); - ganttChartControl.setImagePath("/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/"); - ganttChartControl.setEditable(true); - ganttChartControl.showTreePanel(true); - ganttChartControl.showContextMenu(true); - ganttChartControl.showDescTask(true,'d,s-f'); - ganttChartControl.showDescProject(true,'n,d'); - }, - load_event: function(res) { - var self = this - var result = res.result; - var sidebar = res.sidebar; - var project_id = new Array(); - var project = new Array(); - var j = -1; - var self = this; - for (i in result) { - - var parent_id = result[i]['parent'][0]; - var parent_name = result[i]['parent'][1]; - - if (jQuery.inArray(parent_id, project_id) == -1){ - if (parent_id == undefined){ - parent_name = ""; - } - j = j + 1; - project[j] = new GanttProjectInfo(parent_id, parent_name, new Date(2011, 1, 1)); - project_id[j] = parent_id; - } - - var id = result[i]['id']; - var text = result[i]['text']; - var start_date = this.convert_date_format(result[i]['start_date']); - var duration = result[i]['duration']; - - var task = new GanttTaskInfo(id, text, start_date, duration, 100, ""); - - k = project_id.indexOf(parent_id); - project[k].addTask(task); + reverse_convert_date_format: function(date) { + var self = this; - } - for (i in project_id){ - ganttChartControl.addProject(project[i]); - } - ganttChartControl.create("GanttDiv"); - ganttChartControl.attachEvent("onTaskEndResize", function(task) {self.on_task_end_resize(task);}) - ganttChartControl.attachEvent("onTaskEndDrag", function(task) {self.on_task_end_drag(task);}) + if (self.format == "%Y-%m-%d %H:%M:%S") + { + return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()+' '+self.time; + } + else + { + return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate(); + } - //Create Sidebar - if (jQuery('#cal-sidebar-option').length == 0){ - jQuery('#gantt-sidebar').append( - jQuery('',{'width':'100%','cellspacing': 0, 'cellpadding': 0, 'id':'cal-sidebar-option'}) - ) - for(s in sidebar) { - jQuery('#cal-sidebar-option').append( - jQuery('').append( - jQuery(' From ee0f98590e521a1cfa90e3b846aab8d11dc11508 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 4 May 2011 16:52:33 +0200 Subject: [PATCH 120/306] [FIX] account: improved order of account_period in order to have the period for opening entries first and fixed in common report wizard the bug that was selecting entries from opening period too when we were printing entries from january to march (because of same date_start for january and opening period). Also fixed the query_get when giving the periods directly in the context (previously it was doing a very weird thing with the clause where_move_lines_by_date defined again and it was not compliant with the opening period new change) bzr revid: qdp-launchpad@openerp.com-20110504145233-icq3a40l9pahy7hm --- addons/account/account.py | 7 +++++-- addons/account/account_move_line.py | 10 +--------- addons/account/wizard/account_report_common.py | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index c11d7394100..a6e83308385 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -879,7 +879,7 @@ class account_period(osv.osv): _defaults = { 'state': 'draft', } - _order = "date_start" + _order = "date_start, special desc" def _check_duration(self,cr,uid,ids,context=None): obj_period = self.browse(cr, uid, ids[0], context=context) @@ -961,7 +961,10 @@ class account_period(osv.osv): raise osv.except_osv(_('Error'), _('You should have chosen periods that belongs to the same company')) if period_date_start > period_date_stop: raise osv.except_osv(_('Error'), _('Start period should be smaller then End period')) - return self.search(cr, uid, [('date_start', '>=', period_date_start), ('date_stop', '<=', period_date_stop), ('company_id', '=', company1_id)]) + #for period from = january, we want to exclude the opening period (but it has same date_from, so we have to check if period_from is special or not to include that clause or not in the search). + if period_from.special: + return self.search(cr, uid, [('date_start', '>=', period_date_start), ('date_stop', '<=', period_date_stop), ('company_id', '=', company1_id)]) + return self.search(cr, uid, [('date_start', '>=', period_date_start), ('date_stop', '<=', period_date_stop), ('company_id', '=', company1_id), ('special', '=', False)]) account_period() diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 9eeea323fb1..8d920f12db3 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -68,7 +68,6 @@ class account_move_line(osv.osv): if state: if state.lower() not in ['all']: where_move_state= " AND "+obj+".move_id IN (SELECT id FROM account_move WHERE account_move.state = '"+state+"')" - if context.get('period_from', False) and context.get('period_to', False) and not context.get('periods', False): if initial_bal: period_company_id = fiscalperiod_obj.browse(cr, uid, context['period_from'], context=context).company_id.id @@ -82,14 +81,7 @@ class account_move_line(osv.osv): period_ids = fiscalperiod_obj.search(cr, uid, [('id', 'in', context['periods'])], order='date_start', limit=1) if period_ids and period_ids[0]: first_period = fiscalperiod_obj.browse(cr, uid, period_ids[0], context=context) - where_move_lines_by_date = " AND " +obj+".move_id IN (SELECT id FROM account_move WHERE date < '" +first_period.date_start+"')" - # Find the old periods where date start of those periods less then Start period - periods = fiscalperiod_obj.search(cr, uid, [('date_start', '<', first_period.date_start)]) - periods = ','.join([str(x) for x in periods]) - if periods: - query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) AND id IN (%s)) %s %s" % (fiscalyear_clause, periods, where_move_state, where_move_lines_by_date) - else: - query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s)) %s %s" % (fiscalyear_clause, where_move_state, where_move_lines_by_date) + query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) AND date_start <= '%s' AND id NOT IN %s) %s %s" % (fiscalyear_clause, first_period.date_start, tuple(context['periods']), where_move_state, where_move_lines_by_date) else: ids = ','.join([str(x) for x in context['periods']]) query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) AND id IN (%s)) %s %s" % (fiscalyear_clause, ids, where_move_state, where_move_lines_by_date) diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index 7a8a0365208..6784e44f779 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -68,7 +68,7 @@ class account_common_report(osv.osv_memory): FROM account_period p LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id) WHERE f.id = %s - ORDER BY p.date_start ASC + ORDER BY p.date_start ASC, p.special ASC LIMIT 1) AS period_start UNION SELECT * FROM (SELECT p.id From 826bbaa0a35293728feda20a808f096cdda14a6e Mon Sep 17 00:00:00 2001 From: Launchpad Translations on behalf of openerp <> Date: Thu, 5 May 2011 04:40:18 +0000 Subject: [PATCH 121/306] Launchpad automatic translations update. bzr revid: launchpad_translations_on_behalf_of_openerp-20110505044018-zo2laq7vbyynd7p7 --- addons/account/i18n/pt_BR.po | 4 +- addons/account/i18n/vi.po | 12 +- addons/base_setup/i18n/vi.po | 76 ++--- addons/base_tools/i18n/vi.po | 8 +- addons/crm/i18n/vi.po | 448 ++++++++++++++-------------- addons/hr/i18n/vi.po | 64 ++-- addons/sale/i18n/vi.po | 44 +-- addons/stock/i18n/zh_CN.po | 10 +- addons/stock_location/i18n/zh_CN.po | 104 ++++--- addons/stock_planning/i18n/zh_CN.po | 62 ++-- 10 files changed, 434 insertions(+), 398 deletions(-) diff --git a/addons/account/i18n/pt_BR.po b/addons/account/i18n/pt_BR.po index a1abf106de4..e3c4f508e2f 100644 --- a/addons/account/i18n/pt_BR.po +++ b/addons/account/i18n/pt_BR.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-05-04 04:36+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-05-05 04:40+0000\n" +"X-Generator: Launchpad (build 12959)\n" #. module: account #: model:process.transition,name:account.process_transition_supplierreconcilepaid0 diff --git a/addons/account/i18n/vi.po b/addons/account/i18n/vi.po index 7fde9c626ae..f1c1a881d02 100644 --- a/addons/account/i18n/vi.po +++ b/addons/account/i18n/vi.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2011-05-02 17:22+0000\n" +"PO-Revision-Date: 2011-05-04 19:28+0000\n" "Last-Translator: Phong Nguyen-Thanh \n" "Language-Team: Vietnamese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-05-03 04:39+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-05-05 04:39+0000\n" +"X-Generator: Launchpad (build 12959)\n" #. module: account #: model:process.transition,name:account.process_transition_supplierreconcilepaid0 @@ -2923,7 +2923,7 @@ msgstr "View" #: code:addons/account/account.py:2951 #, python-format msgid "BNK%s" -msgstr "" +msgstr "BNK%s" #. module: account #: code:addons/account/account.py:2906 @@ -3904,7 +3904,7 @@ msgstr "Tháng" #. module: account #: field:account.invoice.report,uom_name:0 msgid "Reference UoM" -msgstr "" +msgstr "ĐVĐ Tham chiếu" #. module: account #: field:account.account,note:0 @@ -9759,7 +9759,7 @@ msgstr "Các báo cáo thống kê" #: field:account.installer.modules,progress:0 #: field:wizard.multi.charts.accounts,progress:0 msgid "Configuration Progress" -msgstr "Configuration Progress" +msgstr "Tiến trình cấu hình" #. module: account #: view:account.fiscal.position.template:0 diff --git a/addons/base_setup/i18n/vi.po b/addons/base_setup/i18n/vi.po index 64b39ebd7c4..5c7aacdebce 100644 --- a/addons/base_setup/i18n/vi.po +++ b/addons/base_setup/i18n/vi.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2010-11-24 09:29+0000\n" -"Last-Translator: OpenERP Administrators \n" +"PO-Revision-Date: 2011-05-04 16:45+0000\n" +"Last-Translator: Phong Nguyen-Thanh \n" "Language-Team: Vietnamese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:03+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-05-05 04:39+0000\n" +"X-Generator: Launchpad (build 12959)\n" #. module: base_setup #: field:base.setup.company,city:0 @@ -25,7 +25,7 @@ msgstr "Thành phố" #. module: base_setup #: view:base.setup.installer:0 msgid "Install" -msgstr "" +msgstr "Cài đặt" #. module: base_setup #: field:base.setup.installer,account_voucher:0 @@ -35,7 +35,7 @@ msgstr "Hóa đơn" #. module: base_setup #: field:base.setup.installer,hr:0 msgid "Human Resources" -msgstr "Quản trị Nhân lực" +msgstr "Quản trị Nguồn nhân lực" #. module: base_setup #: field:base.setup.company,email:0 @@ -50,7 +50,7 @@ msgstr "Số tài khoản ngân hàng" #. module: base_setup #: field:base.setup.installer,profile_tools:0 msgid "Extra Tools" -msgstr "" +msgstr "Các công cụ Mở rộng" #. module: base_setup #: field:base.setup.company,rml_footer1:0 @@ -77,7 +77,7 @@ msgstr "CSDL của bạn đã được tạo" #. module: base_setup #: field:base.setup.installer,point_of_sale:0 msgid "Point of Sales" -msgstr "" +msgstr "Điểm bán hàng" #. module: base_setup #: field:base.setup.installer,association:0 @@ -95,13 +95,13 @@ msgstr "" #: code:addons/base_setup/__init__.py:50 #, python-format msgid "The following users have been installed : \n" -msgstr "" +msgstr "Những người sử dụng sau đã được cài đặt: \n" #. module: base_setup #: field:base.setup.company,progress:0 #: field:base.setup.installer,progress:0 msgid "Configuration Progress" -msgstr "" +msgstr "Tiến trình cấu hình" #. module: base_setup #: field:base.setup.company,rml_footer2:0 @@ -122,7 +122,7 @@ msgstr "" #. module: base_setup #: field:base.setup.installer,marketing:0 msgid "Marketing" -msgstr "" +msgstr "Tiếp thị" #. module: base_setup #: field:base.setup.company,company_id:0 @@ -151,7 +151,7 @@ msgstr "" #. module: base_setup #: field:base.setup.installer,report_designer:0 msgid "Advanced Reporting" -msgstr "" +msgstr "Báo cáo cao cấp" #. module: base_setup #: field:base.setup.company,phone:0 @@ -161,7 +161,7 @@ msgstr "Điện thoại" #. module: base_setup #: view:base.setup.company:0 msgid "res_config_contents" -msgstr "" +msgstr "res_config_contents" #. module: base_setup #: view:base.setup.company:0 @@ -240,7 +240,7 @@ msgstr "" #. module: base_setup #: model:ir.model,name:base_setup.model_base_setup_company msgid "base.setup.company" -msgstr "" +msgstr "base.setup.company" #. module: base_setup #: help:base.setup.installer,purchase:0 @@ -265,7 +265,7 @@ msgstr "" #. module: base_setup #: model:ir.model,name:base_setup.model_base_setup_installer msgid "base.setup.installer" -msgstr "" +msgstr "base.setup.installer" #. module: base_setup #: field:base.setup.company,country_id:0 @@ -285,7 +285,7 @@ msgstr "Kế toán & Tài chính" #. module: base_setup #: field:base.setup.installer,auction:0 msgid "Auction Houses" -msgstr "" +msgstr "Nhà bán đấu giá" #. module: base_setup #: field:base.setup.company,zip:0 @@ -295,7 +295,7 @@ msgstr "Mã bưu điện" #. module: base_setup #: view:base.setup.config:0 msgid "Start Configuration" -msgstr "" +msgstr "Bắt đầu cấu hình" #. module: base_setup #: help:base.setup.installer,knowledge:0 @@ -315,12 +315,12 @@ msgstr "" #: view:base.setup.company:0 #: model:ir.actions.act_window,name:base_setup.action_base_setup_company msgid "Company Configuration" -msgstr "" +msgstr "Cấu hình Công ty" #. module: base_setup #: field:base.setup.company,logo:0 msgid "Logo" -msgstr "" +msgstr "Biểu tượng" #. module: base_setup #: help:base.setup.installer,point_of_sale:0 @@ -333,7 +333,7 @@ msgstr "" #. module: base_setup #: field:base.setup.installer,purchase:0 msgid "Purchase Management" -msgstr "" +msgstr "Quản lý Mua hàng" #. module: base_setup #: help:base.setup.installer,sale:0 @@ -343,7 +343,7 @@ msgstr "" #. module: base_setup #: field:base.setup.installer,stock:0 msgid "Warehouse Management" -msgstr "" +msgstr "Quản lý Kho hàng" #. module: base_setup #: field:base.setup.installer,project:0 @@ -353,17 +353,17 @@ msgstr "Quản lý dự án" #. module: base_setup #: field:base.setup.config,installed_users:0 msgid "Installed Users" -msgstr "" +msgstr "Người sử dụng đã được cài đặt" #. module: base_setup #: view:base.setup.config:0 msgid "New Database" -msgstr "" +msgstr "CSDL mới" #. module: base_setup #: field:base.setup.installer,crm:0 msgid "Customer Relationship Management" -msgstr "" +msgstr "Quản lý Quan hệ Khách hàng" #. module: base_setup #: help:base.setup.installer,auction:0 @@ -390,34 +390,34 @@ msgstr "" #. module: base_setup #: field:base.setup.company,rml_header1:0 msgid "Report Header" -msgstr "" +msgstr "Tiêu đề Báo cáo" #. module: base_setup #: view:base.setup.config:0 msgid "Information about your new database" -msgstr "" +msgstr "Thông tin về CSDL mới của bạn" #. module: base_setup #: field:base.setup.company,config_logo:0 #: field:base.setup.config,config_logo:0 #: field:base.setup.installer,config_logo:0 msgid "Image" -msgstr "" +msgstr "Hình ảnh" #. module: base_setup #: field:base.setup.installer,product_expiry:0 msgid "Food Industry" -msgstr "" +msgstr "Công nghiệp Thực phẩm" #. module: base_setup #: field:base.setup.installer,mrp:0 msgid "Manufacturing" -msgstr "" +msgstr "Sản xuất" #. module: base_setup #: view:base.setup.company:0 msgid "Your Logo - Use a size of about 450x150 pixels." -msgstr "" +msgstr "Biểu trưng - Sử dụng kích thước khoảng 450x150 pixels." #. module: base_setup #: help:base.setup.company,rml_footer1:0 @@ -430,33 +430,33 @@ msgstr "" #. module: base_setup #: field:base.setup.company,website:0 msgid "Company Website" -msgstr "" +msgstr "Trang web Công ty" #. module: base_setup #: view:base.setup.installer:0 msgid "Install Specific Industry Applications" -msgstr "" +msgstr "Cài đặt các Ứng dụng đặc thù theo ngành" #. module: base_setup #: field:base.setup.company,street:0 msgid "Street" -msgstr "" +msgstr "Đường phố" #. module: base_setup #: view:base.setup.company:0 msgid "Configure Your Company Information" -msgstr "" +msgstr "Cấu hình Thông tin Công ty của Bạn" #. module: base_setup #: help:base.setup.company,website:0 msgid "Example: http://openerp.com" -msgstr "" +msgstr "Ví dụ: http://openerp.com" #. module: base_setup #: view:base.setup.installer:0 #: model:ir.actions.act_window,name:base_setup.action_base_setup_installer msgid "Install Applications" -msgstr "" +msgstr "Cài đặt các Ứng dụng" #. module: base_setup #: help:base.setup.installer,crm:0 @@ -476,7 +476,7 @@ msgstr "" #. module: base_setup #: model:ir.module.module,shortdesc:base_setup.module_meta_information msgid "Base Setup" -msgstr "" +msgstr "Thiết lập cơ sở" #. module: base_setup #: help:base.setup.installer,association:0 @@ -488,7 +488,7 @@ msgstr "" #. module: base_setup #: model:ir.model,name:base_setup.model_base_setup_config msgid "base.setup.config" -msgstr "" +msgstr "base.setup.config" #~ msgid "The certificate ID of the module must be unique !" #~ msgstr "Mã chứng nhận của mô đun này phải là duy nhất !" diff --git a/addons/base_tools/i18n/vi.po b/addons/base_tools/i18n/vi.po index 9c908debdc7..790e4f9515e 100644 --- a/addons/base_tools/i18n/vi.po +++ b/addons/base_tools/i18n/vi.po @@ -8,19 +8,19 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2011-05-01 17:00+0000\n" +"PO-Revision-Date: 2011-05-04 18:47+0000\n" "Last-Translator: Phong Nguyen-Thanh \n" "Language-Team: Vietnamese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-05-02 04:37+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-05-05 04:40+0000\n" +"X-Generator: Launchpad (build 12959)\n" #. module: base_tools #: model:ir.module.module,shortdesc:base_tools.module_meta_information msgid "Common base for tools modules" -msgstr "" +msgstr "Cơ sở chung cho mô-đun công cụ" #. module: base_tools #: model:ir.module.module,description:base_tools.module_meta_information diff --git a/addons/crm/i18n/vi.po b/addons/crm/i18n/vi.po index 27d818c5a7f..384a36da22b 100644 --- a/addons/crm/i18n/vi.po +++ b/addons/crm/i18n/vi.po @@ -8,14 +8,14 @@ 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-19 21:50+0000\n" -"Last-Translator: Tran Tuan \n" +"PO-Revision-Date: 2011-05-04 18:43+0000\n" +"Last-Translator: Phong Nguyen-Thanh \n" "Language-Team: Vietnamese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:00+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-05-05 04:39+0000\n" +"X-Generator: Launchpad (build 12959)\n" #. module: crm #: view:crm.lead.report:0 @@ -87,7 +87,7 @@ msgstr "Chọn Các Cơ hội" #: view:crm.phonecall2phonecall:0 #: view:crm.send.mail:0 msgid " " -msgstr "" +msgstr " " #. module: crm #: view:crm.lead.report:0 @@ -158,7 +158,7 @@ msgstr "Hàng năm" #. module: crm #: field:crm.segmentation.line,name:0 msgid "Rule Name" -msgstr "" +msgstr "Tên quy tắc" #. module: crm #: view:crm.case.resource.type:0 @@ -200,7 +200,7 @@ msgstr "Cảnh báo!" #: model:ir.actions.act_window,name:crm.action_report_crm_opportunity #: model:ir.ui.menu,name:crm.menu_report_crm_opportunities_tree msgid "Opportunities Analysis" -msgstr "" +msgstr "Phân tích Cơ hội" #. module: crm #: field:crm.lead,partner_id:0 @@ -323,7 +323,7 @@ msgstr "" #. module: crm #: selection:crm.meeting,class:0 msgid "Public" -msgstr "" +msgstr "Công khai" #. module: crm #: model:ir.actions.act_window,name:crm.crm_case_resource_type_act @@ -341,7 +341,7 @@ msgstr "" #. module: crm #: selection:crm.meeting,end_type:0 msgid "Forever" -msgstr "" +msgstr "Vô hạn" #. module: crm #: help:crm.lead,optout:0 @@ -353,7 +353,7 @@ msgstr "" #. module: crm #: model:process.transition,name:crm.process_transition_leadpartner0 msgid "Prospect Partner" -msgstr "" +msgstr "Đối tác Tiềm năng" #. module: crm #: field:crm.lead,contact_name:0 @@ -393,7 +393,7 @@ msgstr "" #: code:addons/crm/crm_lead.py:209 #, python-format msgid "The lead '%s' has been opened." -msgstr "" +msgstr "Đầu mối '%s' đã được mở." #. module: crm #: model:process.transition,name:crm.process_transition_opportunitymeeting0 @@ -430,7 +430,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "Communication" -msgstr "" +msgstr "Liên hệ" #. module: crm #: field:crm.case.section,change_responsible:0 @@ -460,13 +460,13 @@ msgstr "" #. module: crm #: field:crm.lead,write_date:0 msgid "Update Date" -msgstr "" +msgstr "Ngày cập nhật" #. module: crm #: view:crm.lead2opportunity.action:0 #: field:crm.lead2opportunity.action,name:0 msgid "Select Action" -msgstr "" +msgstr "Chọn Hành động" #. module: crm #: field:base.action.rule,trg_categ_id:0 @@ -479,57 +479,57 @@ msgstr "" #: field:crm.phonecall.report,categ_id:0 #: field:crm.phonecall2phonecall,categ_id:0 msgid "Category" -msgstr "" +msgstr "Phân loại" #. module: crm #: view:crm.lead.report:0 msgid "#Opportunities" -msgstr "" +msgstr "Số lượng Cơ hội" #. module: crm #: model:crm.case.resource.type,name:crm.type_oppor2 msgid "Campaign 1" -msgstr "" +msgstr "Chiến dịch 1" #. module: crm #: model:crm.case.resource.type,name:crm.type_oppor1 msgid "Campaign 2" -msgstr "" +msgstr "Chiến dịch 2" #. module: crm #: view:crm.meeting:0 msgid "Privacy" -msgstr "" +msgstr "Sự riêng tư" #. module: crm #: view:crm.lead.report:0 msgid "Opportunity Analysis" -msgstr "" +msgstr "Phân tích Cơ hội" #. module: crm #: help:crm.meeting,location:0 msgid "Location of Event" -msgstr "" +msgstr "Địa điểm tổ chức sự kiện" #. module: crm #: field:crm.meeting,rrule:0 msgid "Recurrent Rule" -msgstr "" +msgstr "Quy tắc lặp lại" #. module: crm #: model:crm.case.resource.type,name:crm.type_lead1 msgid "Version 4.2" -msgstr "" +msgstr "Phiên bản 4.2" #. module: crm #: model:crm.case.resource.type,name:crm.type_lead2 msgid "Version 4.4" -msgstr "" +msgstr "Phiên bản 4.4" #. module: crm #: help:crm.installer,fetchmail:0 msgid "Allows you to receive E-Mails from POP/IMAP server." -msgstr "" +msgstr "Cho phép bạn nhận Thư điện tử từ máy chủ POP/IMAP." #. module: crm #: model:process.transition,note:crm.process_transition_opportunitymeeting0 @@ -553,12 +553,12 @@ msgstr "" #: model:ir.actions.act_window,name:crm.crm_partner2opportunity #, python-format msgid "Create Opportunity" -msgstr "" +msgstr "Tạo Cơ hội" #. module: crm #: view:crm.installer:0 msgid "Configure" -msgstr "" +msgstr "Cấu hình" #. module: crm #: code:addons/crm/crm.py:378 @@ -571,7 +571,7 @@ msgstr "" #. module: crm #: model:ir.module.module,shortdesc:crm.module_meta_information msgid "Customer & Supplier Relationship Management" -msgstr "" +msgstr "Quản lý Quan hệ Khách hàng & Nhà cung cấp" #. module: crm #: selection:crm.lead.report,month:0 @@ -583,7 +583,7 @@ msgstr "Tháng Sáu" #. module: crm #: selection:crm.segmentation,state:0 msgid "Not Running" -msgstr "" +msgstr "Không chạy" #. module: crm #: view:crm.send.mail:0 @@ -594,12 +594,12 @@ msgstr "" #. module: crm #: field:crm.lead,email:0 msgid "E-Mail" -msgstr "" +msgstr "Thư điện tử" #. module: crm #: field:crm.installer,wiki_sale_faq:0 msgid "Sale FAQ" -msgstr "" +msgstr "Các câu hỏi thường gặp về Bán hàng" #. module: crm #: model:ir.model,name:crm.model_crm_send_mail_attachment @@ -665,7 +665,7 @@ msgstr "" #. module: crm #: selection:crm.meeting,end_type:0 msgid "End date" -msgstr "" +msgstr "Ngày kết thúc" #. module: crm #: constraint:base.action.rule:0 @@ -692,7 +692,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "Communication history" -msgstr "" +msgstr "Lịch sử trao đổi thông tin" #. module: crm #: help:crm.phonecall,canal_id:0 @@ -706,12 +706,12 @@ msgstr "" #: code:addons/crm/crm_meeting.py:93 #, python-format msgid "The meeting '%s' has been confirmed." -msgstr "" +msgstr "Cuộc gặp '%s' đã được xác nhận." #. module: crm #: field:crm.case.section,user_id:0 msgid "Responsible User" -msgstr "" +msgstr "Người chịu trách nhiệm" #. module: crm #: code:addons/crm/wizard/crm_phonecall_to_partner.py:53 @@ -729,7 +729,7 @@ msgstr "" #. module: crm #: view:res.users:0 msgid "Current Activity" -msgstr "" +msgstr "Hoạt động hiện tại" #. module: crm #: help:crm.meeting,exrule:0 @@ -741,7 +741,7 @@ msgstr "" #. module: crm #: field:crm.case.section,resource_calendar_id:0 msgid "Working Time" -msgstr "" +msgstr "Thời gian làm việc" #. module: crm #: view:crm.segmentation.line:0 @@ -851,7 +851,7 @@ msgstr "" #: view:crm.lead2partner:0 #: view:crm.phonecall2partner:0 msgid "Continue" -msgstr "" +msgstr "Tiếp tục" #. module: crm #: field:crm.segmentation,som_interval:0 @@ -861,7 +861,7 @@ msgstr "" #. module: crm #: field:crm.meeting,byday:0 msgid "By day" -msgstr "" +msgstr "Theo ngày" #. module: crm #: field:base.action.rule,act_section_id:0 @@ -872,7 +872,7 @@ msgstr "" #: view:calendar.attendee:0 #: field:calendar.attendee,categ_id:0 msgid "Event Type" -msgstr "" +msgstr "Loại sự kiện" #. module: crm #: model:ir.model,name:crm.model_crm_installer @@ -882,7 +882,7 @@ msgstr "crm.installer" #. module: crm #: field:crm.segmentation,exclusif:0 msgid "Exclusive" -msgstr "" +msgstr "Độc quyền" #. module: crm #: code:addons/crm/crm_opportunity.py:91 @@ -934,7 +934,7 @@ msgstr "" #: field:crm.lead.report,create_date:0 #: field:crm.phonecall.report,create_date:0 msgid "Create Date" -msgstr "" +msgstr "Ngày tạo" #. module: crm #: field:crm.lead,ref2:0 @@ -976,7 +976,7 @@ msgstr "" #: model:ir.ui.menu,name:crm.menu_crm_case_opp #: model:process.node,name:crm.process_node_opportunities0 msgid "Opportunities" -msgstr "" +msgstr "Các cơ hội" #. module: crm #: field:crm.segmentation,categ_id:0 @@ -987,7 +987,7 @@ msgstr "" #: view:crm.add.note:0 #: model:ir.actions.act_window,name:crm.action_crm_add_note msgid "Add Note" -msgstr "" +msgstr "Thêm Ghi chú" #. module: crm #: field:crm.lead,is_supplier_add:0 @@ -1053,7 +1053,7 @@ msgstr "" #: field:crm.lead,mobile:0 #: field:crm.phonecall,partner_mobile:0 msgid "Mobile" -msgstr "" +msgstr "Số di động" #. module: crm #: field:crm.meeting,end_type:0 @@ -1075,12 +1075,12 @@ msgstr "" #. module: crm #: view:board.board:0 msgid "My Meetings" -msgstr "" +msgstr "Các cuộc gặp của tôi" #. module: crm #: field:crm.lead,ref:0 msgid "Reference" -msgstr "" +msgstr "Tham chiếu" #. module: crm #: field:crm.lead,optin:0 @@ -1101,7 +1101,7 @@ msgstr "" #: field:res.partner,meeting_ids:0 #, python-format msgid "Meetings" -msgstr "" +msgstr "Các cuộc gặp" #. module: crm #: view:crm.meeting:0 @@ -1114,12 +1114,12 @@ msgstr "" #: field:crm.meeting,date_action_next:0 #: field:crm.phonecall,date_action_next:0 msgid "Next Action" -msgstr "" +msgstr "Hành động kế tiếp" #. module: crm #: field:crm.meeting,end_date:0 msgid "Repeat Until" -msgstr "" +msgstr "Lặp lại cho đến khi" #. module: crm #: field:crm.meeting,date_deadline:0 @@ -1151,17 +1151,17 @@ msgstr "" #: field:crm.phonecall,user_id:0 #: view:res.partner:0 msgid "Responsible" -msgstr "" +msgstr "Chịu trách nhiệm" #. module: crm #: view:res.partner:0 msgid "Previous" -msgstr "" +msgstr "Trước" #. module: crm #: view:crm.lead:0 msgid "Statistics" -msgstr "" +msgstr "Thống kê" #. module: crm #: view:crm.meeting:0 @@ -1173,7 +1173,7 @@ msgstr "Từ" #: view:crm.lead2opportunity.action:0 #: view:res.partner:0 msgid "Next" -msgstr "" +msgstr "Tiếp theo" #. module: crm #: view:crm.lead:0 @@ -1185,7 +1185,7 @@ msgstr "" #: model:crm.case.stage,name:crm.stage_opportunity5 #: view:crm.lead:0 msgid "Won" -msgstr "" +msgstr "Thắng" #. module: crm #: field:crm.lead.report,delay_expected:0 @@ -1200,7 +1200,7 @@ msgstr "" #. module: crm #: field:crm.send.mail,html:0 msgid "HTML formatting?" -msgstr "" +msgstr "Định dạng HTML?" #. module: crm #: field:crm.case.stage,type:0 @@ -1211,7 +1211,7 @@ msgstr "" #: view:crm.phonecall.report:0 #: view:res.partner:0 msgid "Type" -msgstr "" +msgstr "Loại" #. module: crm #: view:crm.segmentation:0 @@ -1224,14 +1224,14 @@ msgstr "" #: selection:crm.phonecall,priority:0 #: selection:crm.phonecall.report,priority:0 msgid "Lowest" -msgstr "" +msgstr "Thấp nhất" #. module: crm #: view:crm.add.note:0 #: view:crm.send.mail:0 #: field:crm.send.mail.attachment,binary:0 msgid "Attachment" -msgstr "" +msgstr "Văn bản đính kèm" #. module: crm #: selection:crm.lead.report,month:0 @@ -1248,7 +1248,7 @@ msgstr "Tháng Tám" #: field:crm.phonecall,create_date:0 #: field:crm.phonecall.report,creation_date:0 msgid "Creation Date" -msgstr "" +msgstr "Ngày tạo" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor5 @@ -1287,7 +1287,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "History Information" -msgstr "" +msgstr "Thông tin lịch sử" #. module: crm #: field:base.action.rule,act_mail_to_partner:0 @@ -1302,12 +1302,12 @@ msgstr "" #. module: crm #: field:crm.meeting,class:0 msgid "Mark as" -msgstr "" +msgstr "Đánh dấu là" #. module: crm #: field:crm.meeting,count:0 msgid "Repeat" -msgstr "" +msgstr "Lặp lại" #. module: crm #: help:crm.meeting,rrule_type:0 @@ -1383,7 +1383,7 @@ msgstr "" #. module: crm #: field:crm.partner2opportunity,name:0 msgid "Opportunity Name" -msgstr "" +msgstr "Tên Cơ hội" #. module: crm #: help:crm.case.section,active:0 @@ -1396,12 +1396,12 @@ msgstr "" #: view:crm.lead.report:0 #: view:crm.phonecall.report:0 msgid " Year " -msgstr "" +msgstr " Năm " #. module: crm #: field:crm.meeting,edit_all:0 msgid "Edit All" -msgstr "" +msgstr "Chỉnh sửa Tất cả" #. module: crm #: field:crm.meeting,fr:0 @@ -1411,12 +1411,12 @@ msgstr "Thứ sáu" #. module: crm #: model:ir.model,name:crm.model_crm_lead msgid "crm.lead" -msgstr "" +msgstr "crm.lead" #. module: crm #: field:crm.meeting,write_date:0 msgid "Write Date" -msgstr "" +msgstr "Ngày Ghi" #. module: crm #: view:crm.meeting:0 @@ -1449,7 +1449,7 @@ msgstr "Tạo một đối tác" #. module: crm #: field:crm.segmentation,state:0 msgid "Execution Status" -msgstr "" +msgstr "Tình trạng Thực hiện" #. module: crm #: selection:crm.meeting,week_list:0 @@ -1466,7 +1466,7 @@ msgstr "" #: field:crm.case.section,complete_name:0 #: field:crm.send.mail,attachment_ids:0 msgid "unknown" -msgstr "" +msgstr "chưa xác định" #. module: crm #: field:crm.lead,id:0 @@ -1489,7 +1489,7 @@ msgstr "" #: field:crm.phonecall2phonecall,date:0 #: view:res.partner:0 msgid "Date" -msgstr "" +msgstr "Ngày" #. module: crm #: view:crm.lead:0 @@ -1502,12 +1502,12 @@ msgstr "Bộ lọc mở rộng..." #. module: crm #: field:crm.phonecall2opportunity,name:0 msgid "Opportunity Summary" -msgstr "" +msgstr "Tóm tắt Cơ hội" #. module: crm #: view:crm.phonecall.report:0 msgid "Search" -msgstr "" +msgstr "Tìm kiếm" #. module: crm #: view:board.board:0 @@ -1528,7 +1528,7 @@ msgstr "" #: view:crm.lead:0 #: view:res.partner:0 msgid "History" -msgstr "" +msgstr "Lịch sử" #. module: crm #: model:ir.actions.act_window,help:crm.crm_segmentation_tree-act @@ -1541,7 +1541,7 @@ msgstr "" #. module: crm #: field:crm.case.section,code:0 msgid "Code" -msgstr "" +msgstr "Mã" #. module: crm #: field:crm.case.section,child_ids:0 @@ -1564,12 +1564,12 @@ msgstr "" #. module: crm #: field:crm.meeting,freq:0 msgid "Frequency" -msgstr "" +msgstr "Tần suất" #. module: crm #: view:crm.lead:0 msgid "References" -msgstr "" +msgstr "Các tham chiếu" #. module: crm #: code:addons/crm/crm.py:392 @@ -1583,12 +1583,12 @@ msgstr "" #: view:res.partner:0 #, python-format msgid "Cancel" -msgstr "" +msgstr "Hủy bỏ" #. module: crm #: model:ir.model,name:crm.model_res_users msgid "res.users" -msgstr "" +msgstr "res.users" #. module: crm #: model:ir.model,name:crm.model_crm_merge_opportunity @@ -1605,7 +1605,7 @@ msgstr "" #: view:crm.meeting:0 #: view:crm.phonecall:0 msgid "Current" -msgstr "" +msgstr "Hiện tại" #. module: crm #: field:crm.meeting,exrule:0 @@ -1635,7 +1635,7 @@ msgstr "" #. module: crm #: view:crm.meeting:0 msgid "Search Meetings" -msgstr "" +msgstr "Tìm kiếm Cuộc gặp" #. module: crm #: selection:crm.segmentation.line,expr_name:0 @@ -1651,12 +1651,12 @@ msgstr "" #. module: crm #: selection:crm.segmentation.line,expr_operator:0 msgid "=" -msgstr "" +msgstr "=" #. module: crm #: selection:crm.meeting,state:0 msgid "Unconfirmed" -msgstr "" +msgstr "Chưa được xác nhận" #. module: crm #: model:ir.actions.act_window,help:crm.action_report_crm_opportunity @@ -1675,13 +1675,13 @@ msgstr "" #: field:crm.segmentation,name:0 #: field:crm.send.mail.attachment,name:0 msgid "Name" -msgstr "" +msgstr "Tên" #. module: crm #: field:crm.meeting,alarm_id:0 #: field:crm.meeting,base_calendar_alarm_id:0 msgid "Alarm" -msgstr "" +msgstr "Nhắc nhở" #. module: crm #: model:ir.actions.act_window,help:crm.crm_lead_stage_act @@ -1700,7 +1700,7 @@ msgstr "" #. module: crm #: field:crm.lead,birthdate:0 msgid "Birthdate" -msgstr "" +msgstr "Ngày sinh" #. module: crm #: view:crm.meeting:0 @@ -1731,7 +1731,7 @@ msgstr "" #: selection:crm.phonecall,priority:0 #: selection:crm.phonecall.report,priority:0 msgid "High" -msgstr "" +msgstr "Cao" #. module: crm #: model:process.node,note:crm.process_node_partner0 @@ -1754,7 +1754,7 @@ msgstr "" #. module: crm #: selection:crm.meeting,week_list:0 msgid "Saturday" -msgstr "" +msgstr "Thứ Bảy" #. module: crm #: selection:crm.meeting,byday:0 @@ -1774,17 +1774,17 @@ msgstr "" #. module: crm #: field:crm.meeting,we:0 msgid "Wed" -msgstr "" +msgstr "Thứ Tư" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor6 msgid "Potential Reseller" -msgstr "" +msgstr "Đại lý bán hàng tiềm năng" #. module: crm #: field:crm.lead.report,planned_revenue:0 msgid "Planned Revenue" -msgstr "" +msgstr "Kế hoạch doanh thu" #. module: crm #: view:crm.lead:0 @@ -1803,7 +1803,7 @@ msgstr "" #. module: crm #: view:crm.meeting:0 msgid "Invitation details" -msgstr "" +msgstr "Chi tiết lời mời" #. module: crm #: field:crm.case.section,parent_id:0 @@ -1818,17 +1818,17 @@ msgstr "" #. module: crm #: selection:crm.segmentation,state:0 msgid "Running" -msgstr "" +msgstr "Đang thực hiện" #. module: crm #: selection:crm.meeting,freq:0 msgid "Hours" -msgstr "" +msgstr "Giờ" #. module: crm #: field:crm.lead,zip:0 msgid "Zip" -msgstr "" +msgstr "Mã bưu chính" #. module: crm #: code:addons/crm/crm_lead.py:213 @@ -1839,7 +1839,7 @@ msgstr "" #. module: crm #: view:crm.installer:0 msgid "title" -msgstr "" +msgstr "danh xưng" #. module: crm #: model:crm.case.categ,name:crm.categ_phone1 @@ -1864,7 +1864,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "Communication History" -msgstr "" +msgstr "Lịch sử trao đổi thông tin" #. module: crm #: selection:crm.meeting,show_as:0 @@ -1874,17 +1874,17 @@ msgstr "" #. module: crm #: view:crm.installer:0 msgid "Synchronization" -msgstr "" +msgstr "Đồng bộ" #. module: crm #: field:crm.case.section,allow_unlink:0 msgid "Allow Delete" -msgstr "" +msgstr "Cho phép Xóa" #. module: crm #: field:crm.meeting,mo:0 msgid "Mon" -msgstr "" +msgstr "Thứ Hai" #. module: crm #: selection:crm.lead,priority:0 @@ -1892,7 +1892,7 @@ msgstr "" #: selection:crm.phonecall,priority:0 #: selection:crm.phonecall.report,priority:0 msgid "Highest" -msgstr "" +msgstr "Cao nhất" #. module: crm #: model:ir.actions.act_window,help:crm.crm_case_categ_phone_incoming0 @@ -1906,14 +1906,14 @@ msgstr "" #. module: crm #: help:crm.meeting,recurrency:0 msgid "Recurrent Meeting" -msgstr "" +msgstr "Cuộc gặp lặp lại" #. module: crm #: view:crm.case.section:0 #: view:crm.lead:0 #: field:crm.lead,description:0 msgid "Notes" -msgstr "" +msgstr "Ghi chú" #. module: crm #: selection:crm.meeting,freq:0 @@ -1923,7 +1923,7 @@ msgstr "" #. module: crm #: field:crm.segmentation.line,expr_value:0 msgid "Value" -msgstr "" +msgstr "Giá trị" #. module: crm #: view:crm.lead:0 @@ -1935,7 +1935,7 @@ msgstr "" #: view:crm.lead:0 #: field:crm.lead,partner_name:0 msgid "Customer Name" -msgstr "" +msgstr "Tên Khách hàng" #. module: crm #: model:ir.actions.act_window,help:crm.crm_case_categ_meet @@ -2000,7 +2000,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "Extra Info" -msgstr "" +msgstr "Thông tin bổ sung" #. module: crm #: view:crm.merge.opportunity:0 @@ -2017,7 +2017,7 @@ msgstr "" #. module: crm #: model:ir.model,name:crm.model_crm_phonecall msgid "crm.phonecall" -msgstr "" +msgstr "crm.phonecall" #. module: crm #: model:crm.case.resource.type,name:crm.type_lead3 @@ -2027,18 +2027,18 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "Create" -msgstr "" +msgstr "Tạo" #. module: crm #: view:crm.lead:0 msgid "Dates" -msgstr "" +msgstr "Ngày" #. module: crm #: code:addons/crm/crm.py:492 #, python-format msgid "Send" -msgstr "" +msgstr "Gửi" #. module: crm #: view:crm.lead:0 @@ -2049,7 +2049,7 @@ msgstr "" #: view:crm.phonecall.report:0 #: field:crm.phonecall.report,priority:0 msgid "Priority" -msgstr "" +msgstr "Độ ưu tiên" #. module: crm #: field:crm.segmentation,sales_purchase_active:0 @@ -2064,17 +2064,17 @@ msgstr "" #. module: crm #: field:crm.meeting,location:0 msgid "Location" -msgstr "" +msgstr "Địa điểm" #. module: crm #: view:crm.lead:0 msgid "Reply" -msgstr "" +msgstr "Phản hồi" #. module: crm #: selection:crm.meeting,freq:0 msgid "Weeks" -msgstr "" +msgstr "Tuần" #. module: crm #: model:process.node,note:crm.process_node_meeting0 @@ -2085,7 +2085,7 @@ msgstr "" #: code:addons/crm/crm.py:375 #, python-format msgid "Error !" -msgstr "" +msgstr "Lỗi !" #. module: crm #: model:ir.actions.act_window,help:crm.crm_meeting_categ_action @@ -2103,7 +2103,7 @@ msgstr "" #: view:crm.opportunity2phonecall:0 #: view:crm.phonecall2phonecall:0 msgid "Planned Date" -msgstr "" +msgstr "Ngày dự kiến" #. module: crm #: field:crm.meeting,base_calendar_url:0 @@ -2113,7 +2113,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "Expected Revenues" -msgstr "" +msgstr "Doanh thu Dự kiến" #. module: crm #: model:crm.case.resource.type,name:crm.type_lead6 @@ -2151,7 +2151,7 @@ msgstr "" #. module: crm #: help:crm.meeting,count:0 msgid "Repeat x times" -msgstr "" +msgstr "Lặp lại x lần" #. module: crm #: model:ir.actions.act_window,name:crm.crm_case_section_act @@ -2180,7 +2180,7 @@ msgstr "" #. module: crm #: field:crm.installer,outlook:0 msgid "MS-Outlook" -msgstr "" +msgstr "MS-Outlook" #. module: crm #: view:crm.phonecall:0 @@ -2201,7 +2201,7 @@ msgstr "" #: view:crm.phonecall.report:0 #: field:crm.phonecall.report,month:0 msgid "Month" -msgstr "" +msgstr "Tháng" #. module: crm #: view:crm.lead:0 @@ -2209,7 +2209,7 @@ msgstr "" #: model:ir.ui.menu,name:crm.menu_crm_case_categ0_act_leads #: model:process.node,name:crm.process_node_leads0 msgid "Leads" -msgstr "" +msgstr "Các đầu mối" #. module: crm #: model:ir.actions.act_window,help:crm.crm_case_category_act_leads_all @@ -2230,19 +2230,19 @@ msgstr "" #: selection:crm.lead2partner,action:0 #: selection:crm.phonecall2partner,action:0 msgid "Create a new partner" -msgstr "" +msgstr "Tạo một đối tác mới" #. module: crm #: view:crm.meeting:0 #: view:res.partner:0 msgid "Start Date" -msgstr "" +msgstr "Ngày bắt đầu" #. module: crm #: selection:crm.phonecall,state:0 #: view:crm.phonecall.report:0 msgid "Todo" -msgstr "" +msgstr "Việc cần làm" #. module: crm #: view:crm.meeting:0 @@ -2252,7 +2252,7 @@ msgstr "" #. module: crm #: view:crm.meeting:0 msgid "Decline" -msgstr "" +msgstr "Từ chối" #. module: crm #: help:crm.lead,optin:0 @@ -2269,7 +2269,7 @@ msgstr "" #: view:crm.add.note:0 #, python-format msgid "Note" -msgstr "" +msgstr "Ghi chú" #. module: crm #: constraint:res.users:0 @@ -2282,7 +2282,7 @@ msgstr "" #: selection:crm.phonecall,priority:0 #: selection:crm.phonecall.report,priority:0 msgid "Low" -msgstr "" +msgstr "Thấp" #. module: crm #: selection:crm.add.note,state:0 @@ -2296,7 +2296,7 @@ msgstr "" #: selection:crm.phonecall.report,state:0 #: selection:crm.send.mail,state:0 msgid "Closed" -msgstr "" +msgstr "Đã được đóng" #. module: crm #: view:crm.installer:0 @@ -2306,7 +2306,7 @@ msgstr "" #. module: crm #: model:crm.case.categ,name:crm.categ_meet2 msgid "Internal Meeting" -msgstr "" +msgstr "Cuộc họp nội bộ" #. module: crm #: code:addons/crm/crm.py:411 @@ -2352,7 +2352,7 @@ msgstr "" #: field:crm.lead,phone:0 #: field:crm.phonecall,partner_phone:0 msgid "Phone" -msgstr "" +msgstr "Điện thoại" #. module: crm #: field:crm.case.section,active:0 @@ -2383,12 +2383,12 @@ msgstr "" #. module: crm #: selection:crm.segmentation.line,expr_operator:0 msgid ">" -msgstr "" +msgstr ">" #. module: crm #: view:crm.meeting:0 msgid "Uncertain" -msgstr "" +msgstr "Không chắc chắn" #. module: crm #: field:crm.send.mail,email_cc:0 @@ -2399,12 +2399,12 @@ msgstr "" #: view:crm.send.mail:0 #: model:ir.actions.act_window,name:crm.action_crm_send_mail msgid "Send Mail" -msgstr "" +msgstr "Gửi thư" #. module: crm #: selection:crm.meeting,freq:0 msgid "Months" -msgstr "" +msgstr "Tháng" #. module: crm #: help:crm.installer,wiki_sale_faq:0 @@ -2423,12 +2423,12 @@ msgstr "" #: field:crm.lead2partner,action:0 #: field:crm.phonecall2partner,action:0 msgid "Action" -msgstr "" +msgstr "Hành động" #. module: crm #: field:crm.installer,crm_claim:0 msgid "Claims" -msgstr "" +msgstr "Các khiếu nại" #. module: crm #: field:crm.segmentation,som_interval_decrease:0 @@ -2440,12 +2440,12 @@ msgstr "" #: view:crm.lead:0 #: view:crm.send.mail:0 msgid "Attachments" -msgstr "" +msgstr "Tập tin đính kèm" #. module: crm #: selection:crm.meeting,rrule_type:0 msgid "Weekly" -msgstr "" +msgstr "Hàng tuần" #. module: crm #: code:addons/crm/wizard/crm_send_email.py:72 @@ -2471,12 +2471,12 @@ msgstr "" #: selection:crm.meeting,state:0 #: selection:crm.phonecall,state:0 msgid "Done" -msgstr "" +msgstr "Hoàn tất" #. module: crm #: help:crm.meeting,interval:0 msgid "Repeat every (Days/Week/Month/Year)" -msgstr "" +msgstr "Lặp lại mỗi (Ngày/Tuần/Tháng/Năm)" #. module: crm #: field:crm.segmentation,som_interval_max:0 @@ -2501,17 +2501,17 @@ msgstr "" #: view:res.partner:0 #, python-format msgid "Open" -msgstr "" +msgstr "Mở" #. module: crm #: selection:crm.meeting,week_list:0 msgid "Tuesday" -msgstr "" +msgstr "Thứ Ba" #. module: crm #: field:crm.lead,city:0 msgid "City" -msgstr "" +msgstr "Thành phố/Quận" #. module: crm #: selection:crm.meeting,show_as:0 @@ -2521,7 +2521,7 @@ msgstr "" #. module: crm #: field:crm.meeting,interval:0 msgid "Repeat every" -msgstr "" +msgstr "Lặp lại mỗi" #. module: crm #: field:crm.installer,crm_helpdesk:0 @@ -2571,7 +2571,7 @@ msgstr "" #. module: crm #: field:crm.lead,job_id:0 msgid "Main Job" -msgstr "" +msgstr "Công việc Chính" #. module: crm #: field:base.action.rule,trg_max_history:0 @@ -2588,7 +2588,7 @@ msgstr "" #: view:crm.meeting:0 #: field:crm.meeting,categ_id:0 msgid "Meeting Type" -msgstr "" +msgstr "Loại Cuộc họp" #. module: crm #: code:addons/crm/wizard/crm_lead_to_opportunity.py:312 @@ -2613,12 +2613,12 @@ msgstr "" #: view:crm.meeting:0 #: view:res.partner:0 msgid "End Date" -msgstr "" +msgstr "Ngày kết thúc" #. module: crm #: selection:crm.meeting,byday:0 msgid "Third" -msgstr "" +msgstr "Thứ ba" #. module: crm #: help:crm.segmentation,som_interval_max:0 @@ -2635,17 +2635,17 @@ msgstr "" #. module: crm #: field:crm.installer,thunderbird:0 msgid "Thunderbird" -msgstr "" +msgstr "Thunderbird" #. module: crm #: view:crm.lead.report:0 msgid "# of Emails" -msgstr "" +msgstr "SL Thư điện tử" #. module: crm #: view:crm.lead:0 msgid "Search Leads" -msgstr "" +msgstr "Tìm kiếm Đầu mối" #. module: crm #: view:crm.lead.report:0 @@ -2662,7 +2662,7 @@ msgstr "" #. module: crm #: field:crm.meeting,week_list:0 msgid "Weekday" -msgstr "" +msgstr "Ngày trong tuần" #. module: crm #: view:crm.lead:0 @@ -2677,7 +2677,7 @@ msgstr "" #. module: crm #: model:ir.model,name:crm.model_calendar_attendee msgid "Attendee information" -msgstr "" +msgstr "Thông tin Người tham dự" #. module: crm #: view:crm.segmentation:0 @@ -2723,14 +2723,14 @@ msgstr "" #: field:crm.meeting,date_action_last:0 #: field:crm.phonecall,date_action_last:0 msgid "Last Action" -msgstr "" +msgstr "Hành động Cuối cùng" #. module: crm #: field:crm.meeting,duration:0 #: field:crm.phonecall,duration:0 #: field:crm.phonecall.report,duration:0 msgid "Duration" -msgstr "" +msgstr "Thời lượng" #. module: crm #: field:crm.send.mail,reply_to:0 @@ -2765,12 +2765,12 @@ msgstr "" #. module: crm #: selection:crm.meeting,week_list:0 msgid "Sunday" -msgstr "" +msgstr "Chủ nhật" #. module: crm #: selection:crm.meeting,byday:0 msgid "Fourth" -msgstr "" +msgstr "Thứ tư" #. module: crm #: selection:crm.add.note,state:0 @@ -2788,7 +2788,7 @@ msgstr "" #. module: crm #: field:crm.lead,fax:0 msgid "Fax" -msgstr "" +msgstr "Fax" #. module: crm #: model:ir.actions.act_window,help:crm.crm_case_category_act_oppor11 @@ -2809,7 +2809,7 @@ msgstr "" #. module: crm #: view:crm.meeting:0 msgid "Assignment" -msgstr "" +msgstr "Phân công" #. module: crm #: field:crm.lead,company_id:0 @@ -2819,17 +2819,17 @@ msgstr "" #: view:crm.phonecall.report:0 #: field:crm.phonecall.report,company_id:0 msgid "Company" -msgstr "" +msgstr "Công ty" #. module: crm #: selection:crm.meeting,week_list:0 msgid "Friday" -msgstr "" +msgstr "Thứ Sáu" #. module: crm #: field:crm.meeting,allday:0 msgid "All Day" -msgstr "" +msgstr "Cả ngày" #. module: crm #: field:crm.segmentation.line,operator:0 @@ -2845,7 +2845,7 @@ msgstr "" #. module: crm #: field:crm.case.categ,object_id:0 msgid "Object Name" -msgstr "" +msgstr "Tên đối tượng" #. module: crm #: help:crm.lead,email_from:0 @@ -2872,14 +2872,14 @@ msgstr "" #. module: crm #: selection:crm.meeting,byday:0 msgid "Last" -msgstr "" +msgstr "Cuối cùng" #. module: crm #: field:crm.lead,message_ids:0 #: field:crm.meeting,message_ids:0 #: field:crm.phonecall,message_ids:0 msgid "Messages" -msgstr "" +msgstr "Các thông điệp" #. module: crm #: help:crm.case.stage,on_change:0 @@ -2899,7 +2899,7 @@ msgstr "Lỗi!" #: field:crm.opportunity2phonecall,name:0 #: field:crm.phonecall2phonecall,name:0 msgid "Call summary" -msgstr "" +msgstr "Tóm tắt cuộc gọi" #. module: crm #: selection:crm.add.note,state:0 @@ -2911,7 +2911,7 @@ msgstr "" #: selection:crm.phonecall.report,state:0 #: selection:crm.send.mail,state:0 msgid "Cancelled" -msgstr "" +msgstr "Đã hủy" #. module: crm #: field:crm.add.note,body:0 @@ -2933,12 +2933,12 @@ msgstr "" #: view:crm.lead.report:0 #: view:crm.phonecall.report:0 msgid " Month " -msgstr "" +msgstr " Tháng " #. module: crm #: view:crm.lead:0 msgid "Links" -msgstr "" +msgstr "Các liên kết" #. module: crm #: model:ir.actions.act_window,help:crm.crm_lead_categ_action @@ -2978,13 +2978,13 @@ msgstr "" #. module: crm #: view:crm.lead.report:0 msgid "# Mails" -msgstr "" +msgstr "SL Thư" #. module: crm #: code:addons/crm/wizard/crm_phonecall_to_opportunity.py:57 #, python-format msgid "Warning" -msgstr "" +msgstr "Cảnh báo" #. module: crm #: field:crm.phonecall,name:0 @@ -3015,7 +3015,7 @@ msgstr "" #. module: crm #: selection:crm.meeting,state:0 msgid "Confirmed" -msgstr "" +msgstr "Đã xác nhận" #. module: crm #: help:crm.send.mail,email_cc:0 @@ -3027,12 +3027,12 @@ msgstr "" #. module: crm #: view:crm.meeting:0 msgid "Confirm" -msgstr "" +msgstr "Xác nhận" #. module: crm #: field:crm.meeting,su:0 msgid "Sun" -msgstr "" +msgstr "Chủ Nhật" #. module: crm #: field:crm.phonecall.report,section_id:0 @@ -3042,7 +3042,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "Total of Planned Revenue" -msgstr "" +msgstr "Tổng Kế hoạch Doanh thu" #. module: crm #: code:addons/crm/crm.py:375 @@ -3060,18 +3060,18 @@ msgstr "" #. module: crm #: selection:crm.meeting,select1:0 msgid "Day of month" -msgstr "" +msgstr "Ngày trong tháng" #. module: crm #: field:crm.lead2opportunity,probability:0 msgid "Success Rate (%)" -msgstr "" +msgstr "Tỉ lệ Thành công (%)" #. module: crm #: model:crm.case.stage,name:crm.stage_lead1 #: model:crm.case.stage,name:crm.stage_opportunity1 msgid "New" -msgstr "" +msgstr "Mới" #. module: crm #: view:crm.meeting:0 @@ -3084,7 +3084,7 @@ msgstr "" #: field:crm.meeting,email_from:0 #: field:crm.phonecall,email_from:0 msgid "Email" -msgstr "" +msgstr "Thư điện tử" #. module: crm #: view:crm.lead:0 @@ -3093,7 +3093,7 @@ msgstr "" #: field:crm.lead.report,channel_id:0 #: field:crm.phonecall,canal_id:0 msgid "Channel" -msgstr "" +msgstr "Kênh" #. module: crm #: model:ir.actions.act_window,name:crm.opportunity2phonecall_act @@ -3129,7 +3129,7 @@ msgstr "" #. module: crm #: selection:crm.meeting,class:0 msgid "Confidential" -msgstr "" +msgstr "Bí mật" #. module: crm #: help:crm.meeting,date_deadline:0 @@ -3156,18 +3156,18 @@ msgstr "" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor4 msgid "Need Information" -msgstr "" +msgstr "Cần thêm thông tin" #. module: crm #: model:process.transition,name:crm.process_transition_leadopportunity0 msgid "Prospect Opportunity" -msgstr "" +msgstr "Cơ hội Tiềm năng" #. module: crm #: view:crm.installer:0 #: model:ir.actions.act_window,name:crm.action_crm_installer msgid "CRM Application Configuration" -msgstr "" +msgstr "Cấu hình Ứng dụng CRM" #. module: crm #: field:base.action.rule,act_categ_id:0 @@ -3177,12 +3177,12 @@ msgstr "" #. module: crm #: view:crm.case.section:0 msgid "Configuration" -msgstr "" +msgstr "Cấu hình" #. module: crm #: field:crm.meeting,th:0 msgid "Thu" -msgstr "" +msgstr "Thứ Năm" #. module: crm #: view:crm.add.note:0 @@ -3199,7 +3199,7 @@ msgstr "" #: view:crm.lead.report:0 #: view:crm.phonecall.report:0 msgid " Month-1 " -msgstr "" +msgstr " Tháng-1 " #. module: crm #: help:crm.installer,sale_crm:0 @@ -3209,7 +3209,7 @@ msgstr "" #. module: crm #: selection:crm.meeting,rrule_type:0 msgid "Daily" -msgstr "" +msgstr "Hàng ngày" #. module: crm #: model:crm.case.stage,name:crm.stage_lead2 @@ -3225,7 +3225,7 @@ msgstr "" #. module: crm #: selection:crm.meeting,byday:0 msgid "First" -msgstr "" +msgstr "Đầu tiên" #. module: crm #: selection:crm.lead.report,month:0 @@ -3237,7 +3237,7 @@ msgstr "Tháng Mười hai" #. module: crm #: field:crm.installer,config_logo:0 msgid "Image" -msgstr "" +msgstr "Hình ảnh" #. module: crm #: view:base.action.rule:0 @@ -3264,19 +3264,19 @@ msgstr "" #. module: crm #: field:crm.meeting,vtimezone:0 msgid "Timezone" -msgstr "" +msgstr "Múi giờ" #. module: crm #: field:crm.lead2opportunity.partner,msg:0 #: field:crm.lead2partner,msg:0 #: view:crm.send.mail:0 msgid "Message" -msgstr "" +msgstr "Thông điệp" #. module: crm #: field:crm.meeting,sa:0 msgid "Sat" -msgstr "" +msgstr "Thứ Bảy" #. module: crm #: view:crm.lead:0 @@ -3284,7 +3284,7 @@ msgstr "" #: view:crm.lead.report:0 #: view:crm.phonecall.report:0 msgid "Salesman" -msgstr "" +msgstr "Nhân viên bán hàng" #. module: crm #: field:crm.lead,date_deadline:0 @@ -3309,7 +3309,7 @@ msgstr "" #. module: crm #: view:crm.lead:0 msgid "Partner Name" -msgstr "" +msgstr "Tên đối tác" #. module: crm #: model:crm.case.categ,name:crm.categ_phone2 @@ -3322,7 +3322,7 @@ msgstr "Gọi đi" #: field:crm.lead,date_open:0 #: field:crm.phonecall,date_open:0 msgid "Opened" -msgstr "" +msgstr "Đã mở" #. module: crm #: view:crm.case.section:0 @@ -3394,7 +3394,7 @@ msgstr "" #. module: crm #: field:crm.meeting,attendee_ids:0 msgid "Attendees" -msgstr "" +msgstr "Người tham dự" #. module: crm #: view:crm.meeting:0 @@ -3403,7 +3403,7 @@ msgstr "" #: model:process.node,name:crm.process_node_meeting0 #: model:res.request.link,name:crm.request_link_meeting msgid "Meeting" -msgstr "" +msgstr "Cuộc họp" #. module: crm #: model:ir.model,name:crm.model_crm_case_categ @@ -3414,7 +3414,7 @@ msgstr "" #: view:crm.lead:0 #: view:crm.phonecall:0 msgid "7 Days" -msgstr "" +msgstr "7 Ngày" #. module: crm #: view:board.board:0 @@ -3434,7 +3434,7 @@ msgstr "" #. module: crm #: field:crm.installer,progress:0 msgid "Configuration Progress" -msgstr "" +msgstr "Tiến trình cấu hình" #. module: crm #: selection:crm.lead,priority:0 @@ -3442,7 +3442,7 @@ msgstr "" #: selection:crm.phonecall,priority:0 #: selection:crm.phonecall.report,priority:0 msgid "Normal" -msgstr "" +msgstr "Bình thường" #. module: crm #: field:crm.lead,street2:0 @@ -3471,7 +3471,7 @@ msgstr "" #: field:crm.lead.report,user_id:0 #: field:crm.phonecall.report,user_id:0 msgid "User" -msgstr "" +msgstr "Người sử dụng" #. module: crm #: selection:crm.lead.report,month:0 @@ -3515,7 +3515,7 @@ msgstr "" #. module: crm #: model:process.process,name:crm.process_process_contractprocess0 msgid "Contract" -msgstr "" +msgstr "Hợp đồng" #. module: crm #: model:crm.case.resource.type,name:crm.type_lead4 @@ -3529,17 +3529,17 @@ msgstr "" #: code:addons/crm/wizard/crm_send_email.py:270 #, python-format msgid "Error" -msgstr "" +msgstr "Lỗi" #. module: crm #: view:crm.lead.report:0 msgid "Planned Revenues" -msgstr "" +msgstr "Kế hoạch doanh thu" #. module: crm #: model:crm.case.categ,name:crm.categ_oppor7 msgid "Need Consulting" -msgstr "" +msgstr "Cần Tư vấn" #. module: crm #: constraint:crm.segmentation:0 @@ -3567,7 +3567,7 @@ msgstr "" #. module: crm #: sql_constraint:res.users:0 msgid "You can not have two users with the same login !" -msgstr "" +msgstr "Bạn không thể có hai người sử dụng với cùng tên đăng nhập" #. module: crm #: code:addons/crm/wizard/crm_merge_opportunities.py:100 @@ -3581,7 +3581,7 @@ msgstr "" #: view:res.partner:0 #, python-format msgid "Close" -msgstr "" +msgstr "Ðóng" #. module: crm #: view:crm.lead:0 @@ -3608,18 +3608,18 @@ msgstr "" #. module: crm #: selection:crm.meeting,week_list:0 msgid "Thursday" -msgstr "" +msgstr "Thứ Năm" #. module: crm #: view:crm.meeting:0 #: field:crm.send.mail,email_to:0 msgid "To" -msgstr "" +msgstr "Đến" #. module: crm #: selection:crm.meeting,class:0 msgid "Private" -msgstr "" +msgstr "Riêng" #. module: crm #: field:crm.lead,function:0 @@ -3645,7 +3645,7 @@ msgstr "" #: field:crm.segmentation,description:0 #: view:res.partner:0 msgid "Description" -msgstr "" +msgstr "Mô tả" #. module: crm #: field:base.action.rule,trg_section_id:0 @@ -3665,7 +3665,7 @@ msgstr "" #: field:res.partner,section_id:0 #: field:res.users,context_section_id:0 msgid "Sales Team" -msgstr "" +msgstr "Nhóm bán hàng" #. module: crm #: selection:crm.lead.report,month:0 @@ -3693,7 +3693,7 @@ msgstr "" #. module: crm #: field:crm.lead,street:0 msgid "Street" -msgstr "" +msgstr "Đường phố" #. module: crm #: view:crm.lead.report:0 @@ -3703,13 +3703,13 @@ msgstr "" #. module: crm #: field:crm.case.section,working_hours:0 msgid "Working Hours" -msgstr "" +msgstr "Giờ làm việc" #. module: crm #: view:crm.lead:0 #: field:crm.lead,is_customer_add:0 msgid "Customer" -msgstr "" +msgstr "Khách hàng" #. module: crm #: selection:crm.lead.report,month:0 @@ -3730,7 +3730,7 @@ msgstr "" #: model:crm.case.stage,name:crm.stage_opportunity6 #: view:crm.lead:0 msgid "Lost" -msgstr "" +msgstr "Thua" #. module: crm #: field:crm.lead,country_id:0 @@ -3750,7 +3750,7 @@ msgstr "" #. module: crm #: selection:crm.meeting,week_list:0 msgid "Wednesday" -msgstr "" +msgstr "Thứ Tư" #. module: crm #: selection:crm.lead.report,month:0 @@ -3762,7 +3762,7 @@ msgstr "Tháng Tư" #. module: crm #: field:crm.case.resource.type,name:0 msgid "Campaign Name" -msgstr "" +msgstr "Tên Chiến dịch" #. module: crm #: model:ir.model,name:crm.model_crm_phonecall_report @@ -3777,13 +3777,13 @@ msgstr "" #. module: crm #: field:crm.meeting,select1:0 msgid "Option" -msgstr "" +msgstr "Tùy chọn" #. module: crm #: model:crm.case.stage,name:crm.stage_lead4 #: model:crm.case.stage,name:crm.stage_opportunity4 msgid "Negotiation" -msgstr "" +msgstr "Đàm phán" #. module: crm #: view:crm.lead:0 @@ -3794,17 +3794,17 @@ msgstr "" #: field:crm.case.stage,sequence:0 #: field:crm.meeting,sequence:0 msgid "Sequence" -msgstr "" +msgstr "Trình tự" #. module: crm #: field:crm.send.mail,body:0 msgid "Message Body" -msgstr "" +msgstr "Thân Thư" #. module: crm #: view:crm.meeting:0 msgid "Accept" -msgstr "" +msgstr "Chấp nhận" #. module: crm #: field:crm.segmentation.line,expr_name:0 diff --git a/addons/hr/i18n/vi.po b/addons/hr/i18n/vi.po index b21680cd6a7..a9dceaca413 100644 --- a/addons/hr/i18n/vi.po +++ b/addons/hr/i18n/vi.po @@ -13,14 +13,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:15+0000\n" -"PO-Revision-Date: 2010-11-22 07:23+0000\n" -"Last-Translator: OpenERP Administrators \n" +"PO-Revision-Date: 2011-05-04 19:00+0000\n" +"Last-Translator: Phong Nguyen-Thanh \n" "Language-Team: Vietnamese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:31+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-05-05 04:40+0000\n" +"X-Generator: Launchpad (build 12959)\n" #. module: hr #: model:process.node,name:hr.process_node_openerpuser0 @@ -165,7 +165,7 @@ msgstr "chung" #. module: hr #: model:hr.employee.marital.status,name:hr.hr_employee_marital_status_married msgid "Married" -msgstr "" +msgstr "Đã kết hôn" #. module: hr #: constraint:hr.employee:0 @@ -189,7 +189,7 @@ msgstr "" #. module: hr #: view:hr.employee:0 msgid "Position" -msgstr "" +msgstr "Chức vụ" #. module: hr #: model:ir.actions.act_window,name:hr.action2 @@ -212,7 +212,7 @@ msgstr "" #. module: hr #: field:hr.employee,identification_id:0 msgid "Identification No" -msgstr "" +msgstr "Số CMND" #. module: hr #: field:hr.job,no_of_employee:0 @@ -233,7 +233,7 @@ msgstr "" #. module: hr #: field:hr.installer,hr_evaluation:0 msgid "Periodic Evaluations" -msgstr "" +msgstr "Đánh giá Định kỳ" #. module: hr #: field:hr.installer,hr_timesheet_sheet:0 @@ -314,12 +314,12 @@ msgstr "Báo cáo" #. module: hr #: model:ir.model,name:hr.model_ir_actions_act_window msgid "ir.actions.act_window" -msgstr "" +msgstr "ir.actions.act_window" #. module: hr #: model:ir.actions.act_window,name:hr.open_board_hr msgid "Human Resources Dashboard" -msgstr "" +msgstr "Bảng điều khiển Nguồn nhân lực" #. module: hr #: view:hr.employee:0 @@ -359,7 +359,7 @@ msgstr "" #. module: hr #: help:hr.employee,sinid:0 msgid "Social Insurance Number" -msgstr "" +msgstr "Số BHXH" #. module: hr #: model:hr.employee.marital.status,name:hr.hr_employee_marital_status_divorced @@ -403,7 +403,7 @@ msgstr "Nam" #. module: hr #: field:hr.installer,progress:0 msgid "Configuration Progress" -msgstr "" +msgstr "Tiến trình cấu hình" #. module: hr #: model:ir.actions.act_window,name:hr.open_view_categ_form @@ -420,12 +420,12 @@ msgstr "Loại nhân viên" #. module: hr #: field:hr.installer,config_logo:0 msgid "Image" -msgstr "" +msgstr "Hình ảnh" #. module: hr #: model:process.process,name:hr.process_process_employeecontractprocess0 msgid "Employee Contract" -msgstr "" +msgstr "Hợp đồng Lao động" #. module: hr #: help:hr.installer,hr_evaluation:0 @@ -447,7 +447,7 @@ msgstr "" #. module: hr #: field:hr.installer,hr_recruitment:0 msgid "Recruitment Process" -msgstr "" +msgstr "Quy trình tuyển dụng" #. module: hr #: field:hr.employee,category_ids:0 @@ -508,7 +508,7 @@ msgstr "Trạng thái" #. module: hr #: view:hr.installer:0 msgid "Configure" -msgstr "" +msgstr "Cấu hình" #. module: hr #: model:ir.actions.act_window,name:hr.open_view_categ_tree @@ -519,7 +519,7 @@ msgstr "Cấu trúc hạng mục" #. module: hr #: field:hr.employee,partner_id:0 msgid "unknown" -msgstr "" +msgstr "không rõ" #. module: hr #: field:hr.installer,hr_holidays:0 @@ -583,7 +583,7 @@ msgstr "" #. module: hr #: sql_constraint:res.users:0 msgid "You can not have two users with the same login !" -msgstr "" +msgstr "Bạn không thể có hai người sử dụng với cùng tên đăng nhập" #. module: hr #: view:hr.job:0 @@ -613,12 +613,12 @@ msgstr "" #. module: hr #: field:hr.employee,photo:0 msgid "Photo" -msgstr "" +msgstr "Ảnh" #. module: hr #: model:ir.model,name:hr.model_res_users msgid "res.users" -msgstr "" +msgstr "res.users" #. module: hr #: field:hr.installer,hr_payroll_account:0 @@ -633,12 +633,12 @@ msgstr "Thông tin cá nhân" #. module: hr #: field:hr.employee,passport_id:0 msgid "Passport No" -msgstr "" +msgstr "Số Hộ chiếu" #. module: hr #: view:res.users:0 msgid "Current Activity" -msgstr "" +msgstr "Hoạt động hiện tại" #. module: hr #: help:hr.installer,hr_expense:0 @@ -650,7 +650,7 @@ msgstr "" #. module: hr #: view:hr.job:0 msgid "Current" -msgstr "" +msgstr "Hiện tại" #. module: hr #: field:hr.department,parent_id:0 @@ -677,7 +677,7 @@ msgstr "Tham dự" #: view:hr.employee.marital.status:0 #: view:hr.job:0 msgid "Description" -msgstr "" +msgstr "Mô tả" #. module: hr #: help:hr.installer,hr_contract:0 @@ -692,12 +692,12 @@ msgstr "" #. module: hr #: model:hr.employee.marital.status,name:hr.hr_employee_marital_status_single msgid "Single" -msgstr "" +msgstr "Chưa kết hôn" #. module: hr #: field:hr.job,name:0 msgid "Job Name" -msgstr "" +msgstr "Tên công việc" #. module: hr #: view:hr.job:0 @@ -708,7 +708,7 @@ msgstr "" #. module: hr #: field:hr.employee,mobile_phone:0 msgid "Mobile" -msgstr "" +msgstr "Số di động" #. module: hr #: view:hr.department:0 @@ -730,7 +730,7 @@ msgstr "Ghi chú" #. module: hr #: model:ir.model,name:hr.model_hr_installer msgid "hr.installer" -msgstr "" +msgstr "hr.installer" #. module: hr #: view:board.board:0 @@ -740,13 +740,13 @@ msgstr "" #. module: hr #: field:hr.employee,resource_id:0 msgid "Resource" -msgstr "" +msgstr "Nguồn lực" #. module: hr #: view:hr.installer:0 #: model:ir.actions.act_window,name:hr.action_hr_installer msgid "Human Resources Application Configuration" -msgstr "" +msgstr "Cấu hình Ứng dụng Nguồn Nhân lực" #. module: hr #: field:hr.employee,gender:0 @@ -767,7 +767,7 @@ msgstr "Nhân viên" #. module: hr #: field:hr.employee,bank_account_id:0 msgid "Bank Account" -msgstr "" +msgstr "Tài khoản ngân hàng" #. module: hr #: field:hr.department,name:0 @@ -777,7 +777,7 @@ msgstr "Tên phòng/ban" #. module: hr #: help:hr.employee,ssnid:0 msgid "Social Security Number" -msgstr "" +msgstr "Số An sinh Xã hội" #. module: hr #: model:process.node,note:hr.process_node_openerpuser0 diff --git a/addons/sale/i18n/vi.po b/addons/sale/i18n/vi.po index d5e8725a172..53be86ad82e 100644 --- a/addons/sale/i18n/vi.po +++ b/addons/sale/i18n/vi.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:16+0000\n" -"PO-Revision-Date: 2011-02-23 17:49+0000\n" -"Last-Translator: Anhnv Vinabis \n" +"PO-Revision-Date: 2011-05-04 19:22+0000\n" +"Last-Translator: Phong Nguyen-Thanh \n" "Language-Team: Vietnamese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:16+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-05-05 04:40+0000\n" +"X-Generator: Launchpad (build 12959)\n" #, python-format #~ msgid "" @@ -521,7 +521,7 @@ msgstr "Tháng Ba" #. module: sale #: help:sale.order,amount_total:0 msgid "The total amount." -msgstr "" +msgstr "Tổng số tiền." #. module: sale #: field:sale.order.line,price_subtotal:0 @@ -739,7 +739,7 @@ msgstr "" #. module: sale #: view:sale.order:0 msgid "Create Final Invoice" -msgstr "" +msgstr "Tạo Hoá đơn cuối cùng" #. module: sale #: field:sale.order,partner_shipping_id:0 @@ -845,7 +845,7 @@ msgstr "Số lượng" #. module: sale #: view:sale.order:0 msgid "References" -msgstr "" +msgstr "Các tham chiếu" #. module: sale #: model:process.transition.action,name:sale.process_transition_action_cancel0 @@ -971,7 +971,7 @@ msgstr "" #. module: sale #: field:sale.installer,delivery:0 msgid "Delivery Costs" -msgstr "" +msgstr "Chi phí giao hàng" #. module: sale #: view:sale.order:0 @@ -1094,7 +1094,7 @@ msgstr "" #: view:sale.make.invoice:0 #: view:sale.order.line.make.invoice:0 msgid "Create Invoices" -msgstr "" +msgstr "Tạo các hóa đơn" #. module: sale #: view:sale.order:0 @@ -1197,7 +1197,7 @@ msgstr "Chờ kế toán viên xem xét" #: view:sale.report:0 #: field:sale.report,uom_name:0 msgid "Reference UoM" -msgstr "" +msgstr "ĐVĐ Tham chiếu" #. module: sale #: model:ir.model,name:sale.model_sale_order_line_make_invoice @@ -1281,7 +1281,7 @@ msgstr "Hoàn thành" #. module: sale #: model:ir.model,name:sale.model_sale_installer msgid "sale.installer" -msgstr "" +msgstr "sale.installer" #. module: sale #: model:process.node,name:sale.process_node_invoice0 @@ -1310,7 +1310,7 @@ msgstr "" #. module: sale #: view:sale.order.line:0 msgid "To Do" -msgstr "" +msgstr "Cần thực hiện" #. module: sale #: field:sale.order,picking_policy:0 @@ -1406,7 +1406,7 @@ msgstr "Đơn vị đo của sản phẩm" #. module: sale #: view:sale.order:0 msgid "Logistic" -msgstr "" +msgstr "Giao nhận" #. module: sale #: view:sale.order.line:0 @@ -1449,12 +1449,12 @@ msgstr "Trạng thái" #. module: sale #: view:sale.config.picking_policy:0 msgid "res_config_contents" -msgstr "" +msgstr "res_config_contents" #. module: sale #: field:sale.order,client_order_ref:0 msgid "Customer Reference" -msgstr "" +msgstr "Tham chiếu của Khách hàng" #. module: sale #: field:sale.order,amount_total:0 @@ -1507,12 +1507,12 @@ msgstr "" #: field:sale.report,company_id:0 #: field:sale.shop,company_id:0 msgid "Company" -msgstr "" +msgstr "Công ty" #. module: sale #: field:sale.make.invoice,invoice_date:0 msgid "Invoice Date" -msgstr "" +msgstr "Ngày Hóa đơn" #. module: sale #: help:sale.advance.payment.inv,amount:0 @@ -1804,7 +1804,7 @@ msgstr "" #: field:sale.config.picking_policy,progress:0 #: field:sale.installer,progress:0 msgid "Configuration Progress" -msgstr "" +msgstr "Tiến trình cấu hình" #. module: sale #: model:ir.actions.act_window,name:sale.action_order_line_product_tree @@ -1814,7 +1814,7 @@ msgstr "Bán sản phẩm" #. module: sale #: field:sale.order,date_order:0 msgid "Ordered Date" -msgstr "" +msgstr "Ngày Đặt hàng" #. module: sale #: model:ir.actions.act_window,name:sale.action_order_form @@ -1939,7 +1939,7 @@ msgstr "Đóng" #. module: sale #: field:sale.order,shipped:0 msgid "Delivered" -msgstr "" +msgstr "Đã giao hàng" #. module: sale #: code:addons/sale/sale.py:1115 @@ -2031,7 +2031,7 @@ msgstr "" #: view:sale.order:0 #: view:sale.order.line:0 msgid "Search Sales Order" -msgstr "" +msgstr "Tìm kiếm Đơn hàng" #. module: sale #: model:process.node,name:sale.process_node_saleorderprocurement0 @@ -2075,7 +2075,7 @@ msgstr "Chọn" #: view:sale.report:0 #: field:sale.report,year:0 msgid "Year" -msgstr "" +msgstr "Năm" #. module: sale #: selection:sale.config.picking_policy,order_policy:0 diff --git a/addons/stock/i18n/zh_CN.po b/addons/stock/i18n/zh_CN.po index 0d5a4605549..2d8e2e97fa4 100644 --- a/addons/stock/i18n/zh_CN.po +++ b/addons/stock/i18n/zh_CN.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:16+0000\n" -"PO-Revision-Date: 2011-05-03 13:12+0000\n" +"PO-Revision-Date: 2011-05-04 10:26+0000\n" "Last-Translator: openerp-china.Black Jack \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-05-04 04:36+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-05-05 04:39+0000\n" +"X-Generator: Launchpad (build 12959)\n" #. module: stock #: field:product.product,track_outgoing:0 @@ -47,7 +47,7 @@ msgstr "放到新托盘" #. module: stock #: field:stock.move.split.lines,action:0 msgid "Action" -msgstr "操作" +msgstr "动作" #. module: stock #: view:stock.production.lot:0 @@ -850,7 +850,7 @@ msgstr "凭证簿" #: code:addons/stock/stock.py:1315 #, python-format msgid "is scheduled %s." -msgstr "是日程安排 %s" +msgstr "是已计划安排 %s" #. module: stock #: help:stock.picking,location_id:0 diff --git a/addons/stock_location/i18n/zh_CN.po b/addons/stock_location/i18n/zh_CN.po index d8fdbdd292e..9ff6f230169 100644 --- a/addons/stock_location/i18n/zh_CN.po +++ b/addons/stock_location/i18n/zh_CN.po @@ -7,25 +7,25 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:16+0000\n" -"PO-Revision-Date: 2011-01-27 01:25+0000\n" -"Last-Translator: Wei \"oldrev\" Li \n" +"PO-Revision-Date: 2011-05-04 10:22+0000\n" +"Last-Translator: openerp-china.Black Jack \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:37+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-05-05 04:40+0000\n" +"X-Generator: Launchpad (build 12959)\n" #. module: stock_location #: selection:product.pulled.flow,picking_type:0 #: selection:stock.location.path,picking_type:0 msgid "Sending Goods" -msgstr "发送商品" +msgstr "送货" #. module: stock_location #: view:product.product:0 msgid "Pulled Paths" -msgstr "" +msgstr "拉式路径" #. module: stock_location #: selection:product.pulled.flow,type_proc:0 @@ -35,7 +35,7 @@ msgstr "调拨" #. module: stock_location #: model:ir.model,name:stock_location.model_stock_location_path msgid "Pushed Flows" -msgstr "" +msgstr "推式流程" #. module: stock_location #: selection:stock.location.path,auto:0 @@ -50,18 +50,18 @@ msgstr "参数" #. module: stock_location #: field:stock.location.path,location_from_id:0 msgid "Source Location" -msgstr "源库位" +msgstr "来源存货地点" #. module: stock_location #: help:product.pulled.flow,cancel_cascade:0 msgid "Allow you to cancel moves related to the product pull flow" -msgstr "" +msgstr "允许您取消推式流程相关的调拨" #. module: stock_location #: model:ir.model,name:stock_location.model_product_pulled_flow #: field:product.product,flow_pull_ids:0 msgid "Pulled Flows" -msgstr "" +msgstr "推式流程" #. module: stock_location #: constraint:stock.move:0 @@ -71,7 +71,7 @@ msgstr "您必须为此产品赋予一个生产批次" #. module: stock_location #: help:product.pulled.flow,location_src_id:0 msgid "Location used by Destination Location to supply" -msgstr "" +msgstr "存货地点用在目标存货地点" #. module: stock_location #: selection:product.pulled.flow,picking_type:0 @@ -85,12 +85,12 @@ msgstr "内部" msgid "" "Pulled procurement coming from original location %s, pull rule %s, via " "original Procurement %s (#%d)" -msgstr "" +msgstr "拉式需求开始与来源存货地点 %s,拉式的规则 %s,通过源需求 %s (#%d)" #. module: stock_location #: model:ir.model,name:stock_location.model_stock_location msgid "Location" -msgstr "库位" +msgstr "存货地点" #. module: stock_location #: field:product.pulled.flow,invoice_state:0 @@ -101,7 +101,7 @@ msgstr "发票状态" #. module: stock_location #: help:product.pulled.flow,name:0 msgid "This field will fill the packing Origin and the name of its moves" -msgstr "" +msgstr "这字段填入源装箱单和它的调拨单名称." #. module: stock_location #: help:stock.location.path,auto:0 @@ -113,13 +113,15 @@ msgid "" "move has to be validated by a worker. With 'Automatic No Step Added', the " "location is replaced in the original move." msgstr "" -"这些规则确定了产品在库位树中的正确移动路径.\n" -"‘自动调拨’ 将创建库存调拨后自动确认. ‘手动操作’ 库存调拨需要人工确认. ‘自动不加入步骤’ 库位是取代调拨源库位." +"这些规则确定了产品在存货地点树中的正确移动路径.\n" +"‘自动调拨’ 将在创建仓库调拨后自动确认.\n" +" ‘手动操作’ 库存调拨需要人工确认.\n" +" ‘自动不加入步骤’ 存货地点取代调拨的来源存货地点." #. module: stock_location #: model:ir.module.module,shortdesc:stock_location.module_meta_information msgid "Warehouse Locations Paths" -msgstr "库位路径" +msgstr "仓库存货地点路径" #. module: stock_location #: view:product.product:0 @@ -149,7 +151,7 @@ msgstr "购买" #. module: stock_location #: view:product.product:0 msgid "Pushed flows" -msgstr "" +msgstr "推式流程" #. module: stock_location #: model:stock.location,name:stock_location.location_dispatch_zone @@ -164,7 +166,7 @@ msgstr "库存调拨" #. module: stock_location #: view:product.product:0 msgid "Pulled flows" -msgstr "" +msgstr "拉式流程" #. module: stock_location #: field:product.pulled.flow,company_id:0 @@ -180,7 +182,7 @@ msgstr "物流" #. module: stock_location #: help:stock.move,cancel_cascade:0 msgid "If checked, when this move is cancelled, cancel the linked move too" -msgstr "" +msgstr "如果选择,在取消这调拨时,也取消与它相关的调拨." #. module: stock_location #: selection:product.pulled.flow,type_proc:0 @@ -300,6 +302,38 @@ msgid "" "from Gate A\n" " " msgstr "" +"\n" +"这模块对库存管理增加推拉流程的应用.\n" +"它主要用在:\n" +"* 管理产品的连锁生产.\n" +"* 管理每个产品的默认存货地点.\n" +"* 根据商业需要定义您的仓库路线如:\n" +" -质量控制\n" +" -售后服务\n" +" -供应商退货\n" +"* 帮助租贷管理,为租用的产品自动生成退还调拨.\n" +"\n" +"一旦安装这个模块,在产品那增加一个tab,您可以加入推拉流程的规范,以产品cpu1为例:\n" +"\n" +"推式流程\n" +"在某些产品到达某一规划存货地点它将调拨到另一个存货地点,当然这需要经过一段时间.\n" +"原来的系统已支持这种推式的操作(它叫连锁存货地点)但它不能精确到对每一个产品.\n" +"一个推式流程需要指定相对应的连锁存货地点和一些参数如: " +"指定源存货地点的产品数量,连锁调拨是自动按流程规划的参数产生(目标存货地点,耽搁,调拨的类型,凭证簿等),这些调拨可以自动处理也可根据参数人手确认.\n" +"\n" +"拉式流程\n" +"它不同与推式流程,从某种意义上说它是不相关产品的调拨,但它是相关需求处理的一部分.\n" +"一个典型的例子:\n" +"[ 客户 ] <- A - [ 卖场 ] <- B - [ 库存 ] <~ C ~ [ 供应商 ]\n" +"当有一个需求单(销售单确认要A),来到卖场转化为B(通过推式流程\"调拨\"),再转化为对供应商C的采购订单(推式流程为采购).\n" +"技术上拉式流程允许您处理不同的需求单,它不仅取决您要什么产品,还要看是哪个存货地点需要这产品.\n" +"\n" +"案例:\n" +" CPU1: 在商店1您销售CPU1并运行计划表(scheduler).\n" +" - 仓库送货单,商店1:收货. \n" +" CPU3: 产品收货时放在货架2 做来料质量检测的临时存货地点.\n" +" 当给客户送货时: 包装列表 -> 装箱单 -> 送货单.\n" +" " #. module: stock_location #: field:product.pulled.flow,type_proc:0 @@ -309,7 +343,7 @@ msgstr "需求类型" #. module: stock_location #: help:product.pulled.flow,company_id:0 msgid "Is used to know to which company belong packings and moves" -msgstr "" +msgstr "它用来知道属于哪个公司的装箱单和调拨" #. module: stock_location #: field:product.pulled.flow,name:0 @@ -320,7 +354,7 @@ msgstr "名称" #: help:product.product,path_ids:0 msgid "" "These rules set the right path of the product in the whole location tree." -msgstr "这些规则确定了产品在整个库位树的正确路径" +msgstr "这些规则确定了产品在整个存货地点树的正确路径" #. module: stock_location #: selection:stock.location.path,auto:0 @@ -355,7 +389,7 @@ msgstr "按库存生产: 在仓库或等待重新供应时得到需求。按订 #. module: stock_location #: help:product.pulled.flow,location_id:0 msgid "Is the destination location that needs supplying" -msgstr "" +msgstr "需要提供目标存货地点" #. module: stock_location #: field:stock.location.path,product_id:0 @@ -366,7 +400,7 @@ msgstr "产品" #: code:addons/stock_location/procurement_pull.py:118 #, python-format msgid "Pulled from another location via procurement %d" -msgstr "" +msgstr "通过需求%d 拉到另一个存货地点" #. module: stock_location #: model:stock.location,name:stock_location.stock_location_qualitytest0 @@ -377,7 +411,7 @@ msgstr "质量控制" #: selection:product.pulled.flow,invoice_state:0 #: selection:stock.location.path,invoice_state:0 msgid "Not Applicable" -msgstr "" +msgstr "无效" #. module: stock_location #: field:stock.location.path,delay:0 @@ -390,12 +424,12 @@ msgstr "延期(天)" msgid "" "Picking for pulled procurement coming from original location %s, pull rule " "%s, via original Procurement %s (#%d)" -msgstr "" +msgstr "拉式装箱单来自来源存货地点 %s,拉式规则 %s,通过原来的需求 %s (#%d)" #. module: stock_location #: field:product.product,path_ids:0 msgid "Pushed Flow" -msgstr "" +msgstr "推式流程" #. module: stock_location #: code:addons/stock_location/procurement_pull.py:89 @@ -403,7 +437,7 @@ msgstr "" msgid "" "Move for pulled procurement coming from original location %s, pull rule %s, " "via original Procurement %s (#%d)" -msgstr "" +msgstr "拉式调拨需求来自源存货地点 %s,拉式规则 %s,通过原来的需求 %s (#%d)" #. module: stock_location #: constraint:stock.move:0 @@ -413,12 +447,12 @@ msgstr "您尝试为另外的产品赋予批次" #. module: stock_location #: model:ir.model,name:stock_location.model_procurement_order msgid "Procurement" -msgstr "请料单" +msgstr "需求单" #. module: stock_location #: field:stock.location.path,location_dest_id:0 msgid "Destination Location" -msgstr "目标库位" +msgstr "目标存货地点" #. module: stock_location #: field:stock.location.path,auto:0 @@ -448,12 +482,12 @@ msgstr "错误:无效的(EAN)条码" msgid "" "Depending on the company, choose whatever you want to receive or send " "products" -msgstr "" +msgstr "根据公司,选择您是收货还是发货" #. module: stock_location #: model:stock.location,name:stock_location.location_order msgid "Order Processing" -msgstr "" +msgstr "订单处理" #. module: stock_location #: field:stock.location.path,name:0 @@ -465,19 +499,19 @@ msgstr "操作" #: field:product.product,path_ids:0 #: view:stock.location.path:0 msgid "Location Paths" -msgstr "库位路径" +msgstr "存货地点路径" #. module: stock_location #: field:product.pulled.flow,journal_id:0 #: field:stock.location.path,journal_id:0 msgid "Journal" -msgstr "" +msgstr "凭证簿" #. module: stock_location #: field:product.pulled.flow,cancel_cascade:0 #: field:stock.move,cancel_cascade:0 msgid "Cancel Cascade" -msgstr "" +msgstr "取消级联" #. module: stock_location #: selection:product.pulled.flow,invoice_state:0 diff --git a/addons/stock_planning/i18n/zh_CN.po b/addons/stock_planning/i18n/zh_CN.po index db9fd8dc2a3..4c7a16c7287 100644 --- a/addons/stock_planning/i18n/zh_CN.po +++ b/addons/stock_planning/i18n/zh_CN.po @@ -8,21 +8,21 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:16+0000\n" -"PO-Revision-Date: 2011-05-03 15:22+0000\n" +"PO-Revision-Date: 2011-05-05 03:45+0000\n" "Last-Translator: openerp-china.Black Jack \n" "Language-Team: Chinese (Simplified) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-05-04 04:36+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-05-05 04:40+0000\n" +"X-Generator: Launchpad (build 12959)\n" #. module: stock_planning #: code:addons/stock_planning/wizard/stock_planning_createlines.py:73 #, python-format msgid "" "No forecasts for selected period or no products in selected category !" -msgstr "" +msgstr "选定的期间没预计,选定的类别没产品!" #. module: stock_planning #: help:stock.planning,stock_only:0 @@ -30,92 +30,92 @@ msgid "" "Check to calculate stock location of selected warehouse only. If not " "selected calculation is made for input, stock and output location of " "warehouse." -msgstr "" +msgstr "对选定的仓库检测核算库存存货地点,如果没选定核算的方式是仓库的入库,出仓的存货地点." #. module: stock_planning #: field:stock.planning,maximum_op:0 msgid "Maximum Rule" -msgstr "" +msgstr "最大库存规则" #. module: stock_planning #: field:stock.sale.forecast,analyzed_period1_per_company:0 msgid "This Copmany Period1" -msgstr "" +msgstr "公司期间1" #. module: stock_planning #: view:stock.planning:0 #: view:stock.sale.forecast:0 msgid "Group By..." -msgstr "" +msgstr "分组..." #. module: stock_planning #: help:stock.sale.forecast,product_amt:0 msgid "" "Forecast value which will be converted to Product Quantity according to " "prices." -msgstr "" +msgstr "估值将为价格乘于产品数量." #. module: stock_planning #: code:addons/stock_planning/stock_planning.py:621 #: code:addons/stock_planning/stock_planning.py:663 #, python-format msgid "Incoming Left must be greater than 0 !" -msgstr "" +msgstr "输入必须大于0!" #. module: stock_planning #: help:stock.planning,outgoing_before:0 msgid "" "Planned Out in periods before calculated. Between start date of current " "period and one day before start of calculated period." -msgstr "" +msgstr "计划在计算后,在当前期间的开始时间和计算期间之后的某天." #. module: stock_planning #: code:addons/stock_planning/wizard/stock_planning_forecast.py:59 #, python-format msgid "No products in selected category !" -msgstr "" +msgstr "在选定的类别没产品!" #. module: stock_planning #: help:stock.sale.forecast.createlines,warehouse_id:0 msgid "" "Warehouse which forecasts will concern. If during stock planning you will " "need sales forecast for all warehouses choose any warehouse now." -msgstr "" +msgstr "关注仓库的预计.如果在库存计划期间您需要在所有仓库中选择一个当前仓库的销售预计." #. module: stock_planning #: field:stock.planning,outgoing_left:0 msgid "Expected Out" -msgstr "" +msgstr "预计出仓" #. module: stock_planning #: view:stock.sale.forecast:0 msgid " " -msgstr "" +msgstr " " #. module: stock_planning #: field:stock.planning,incoming_left:0 msgid "Incoming Left" -msgstr "" +msgstr "输入" #. module: stock_planning #: view:stock.planning:0 msgid "Requisition history" -msgstr "" +msgstr "请求日志" #. module: stock_planning #: view:stock.sale.forecast.createlines:0 msgid "Create Forecasts Lines" -msgstr "" +msgstr "创建预计明细" #. module: stock_planning #: help:stock.planning,outgoing:0 msgid "Quantity of all confirmed outgoing moves in calculated Period." -msgstr "" +msgstr "在计算期间所有确认的出仓调拨数量" #. module: stock_planning #: view:stock.period.createlines:0 msgid "Create Daily Periods" -msgstr "" +msgstr "创建每天的周期" #. module: stock_planning #: view:stock.planning:0 @@ -125,7 +125,7 @@ msgstr "" #: field:stock.sale.forecast,company_id:0 #: field:stock.sale.forecast.createlines,company_id:0 msgid "Company" -msgstr "" +msgstr "公司" #. module: stock_planning #: code:addons/stock_planning/stock_planning.py:640 @@ -135,51 +135,53 @@ msgid "" "\n" " Initial Stock: " msgstr "" +"\n" +" 初始仓库: " #. module: stock_planning #: help:stock.planning,warehouse_forecast:0 msgid "" "All sales forecasts for selected Warehouse of selected Product during " "selected Period." -msgstr "" +msgstr "在选定的期间所选定的仓库里指定产品的所有销售预计." #. module: stock_planning #: model:ir.ui.menu,name:stock_planning.menu_stock_period_creatlines msgid "Create Stock and Sales Periods" -msgstr "" +msgstr "创建库存和销售周期" #. module: stock_planning #: view:stock.planning:0 msgid "Minimum Stock Rule Indicators" -msgstr "" +msgstr "最小库存规则标识" #. module: stock_planning #: help:stock.sale.forecast.createlines,period_id:0 msgid "Period which forecasts will concern." -msgstr "" +msgstr "期间的预计将被关注" #. module: stock_planning #: field:stock.planning,stock_only:0 msgid "Stock Location Only" -msgstr "" +msgstr "只有库存存货地点" #. module: stock_planning #: help:stock.planning,already_out:0 msgid "" "Quantity which is already dispatched out of this warehouse in current period." -msgstr "" +msgstr "本期这仓库已派件出去的数量" #. module: stock_planning #: help:stock.planning,procure_to_stock:0 msgid "" "Chect to make procurement to stock location of selected warehouse. If not " "selected procurement will be made into input location of warehouse." -msgstr "" +msgstr "选择指定仓库需求的存货地点,如果不选择需求将用这仓库的入库存货地点." #. module: stock_planning #: view:stock.planning:0 msgid "Current Period Situation" -msgstr "" +msgstr "本期状况" #. module: stock_planning #: view:stock.period.createlines:0 @@ -191,7 +193,7 @@ msgstr "创建月度" msgid "" "Warehouse used as source in supply pick move created by 'Supply from Another " "Warhouse'." -msgstr "" +msgstr "仓库作为调拨的起点." #. module: stock_planning #: model:ir.model,name:stock_planning.model_stock_period_createlines From df85c026193d15465364194bb52ac08f040fe3ba Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 5 May 2011 11:16:31 +0530 Subject: [PATCH 122/306] [FIX]stock:Field name does not exist when export data from physiacal inventory lp bug: https://launchpad.net/bugs/774057 fixed bzr revid: ron@tinyerp.com-20110505054631-k5qzt5pizfhwp1qk --- addons/stock/stock.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 8e60ba9ab50..2d516f1a8a5 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2623,6 +2623,7 @@ stock_inventory() class stock_inventory_line(osv.osv): _name = "stock.inventory.line" _description = "Inventory Line" + _rec_name = "inventory_id" _columns = { 'inventory_id': fields.many2one('stock.inventory', 'Inventory', ondelete='cascade', select=True), 'location_id': fields.many2one('stock.location', 'Location', required=True), From 3e4c8c38da7754aba8eabb81f80946b09bfbbcd0 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 5 May 2011 08:31:50 +0200 Subject: [PATCH 123/306] [IMP] cleanup CSS bzr revid: xmo@openerp.com-20110505063150-3jvolxw42i3dwk3w --- addons/base/static/src/css/base.css | 62 ++++++++++++----------------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index 43021e32bc6..0ca1c995b33 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -1,8 +1,8 @@ -/* TODO: seperate openerp webclient page css from openerp views css */ +/* TODO: separate openerp web client page css from openerp views css */ body { padding: 0; margin: 0; - font-family: helvetica, sans, arial; + font-family: helvetica, arial, sans-serif; font-size: 80%; } @@ -85,7 +85,7 @@ body.openerp { /* Menu */ .openerp .sf-menu { - margin-bottom: 0px; + margin-bottom: 0; } /* .sf-menu a { @@ -169,10 +169,9 @@ body.openerp { border: none; } .openerp .secondary_menu h4 { - padding: 0 0 2px; + padding: 0 0 2px 10px; border: none; background: none; - padding-left: 10px; } .openerp .secondary_menu h3 span, .openerp .secondary_menu h4 span { left: 0 !important; @@ -224,10 +223,9 @@ body.openerp { margin-right: 10px; line-height: 63px; text-align: center; - border-bottom: 1px solid black; - border-right: 1px solid black; - border-top: 1px solid white; - border-left: 1px solid white; + border: 1px solid white; + border-right-color: black; + border-bottom-color: black; background: #FFFFFF; background: -moz-linear-gradient(top, #FFFFFF 0%, #CECECE 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#CECECE)); @@ -301,7 +299,6 @@ body.openerp { right: 0; top: 5px; padding: 1px 4px 2px; - background: #333; background: rgba(0, 0, 0, 0.75); border-radius: 7px; -moz-border-radius: 7px; @@ -316,9 +313,9 @@ body.openerp { overflow: hidden; padding: 5px 0; position: relative; - -moz-box-shadow: inset 0px 3px 5px rgba(0, 0, 0, 0.4); - -webkit-box-shadow: inset 0px 3px 5px rgba(0, 0, 0, 0.4); - box-shadow: inset 0px 3px 5px rgba(0, 0, 0, 0.4); + -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); } .openerp div.oe_footer p.oe_footer_powered { left: 50%; @@ -337,7 +334,7 @@ body.openerp { /* Main Application */ .openerp .oe-application { - padding: 0px; + padding: 0; height: 100%; } @@ -380,7 +377,7 @@ body.openerp { background: #AAAAAA; } .openerp .filter_icon { - padding: 1px 2px 0px 2px; + padding: 1px 2px 0 2px; margin-left: 0; margin-right: 0; } @@ -544,17 +541,17 @@ body.openerp { /* Notebook */ .openerp .oe_form_notebook { - padding: 0px; + padding: 0; background: none; - border-width: 0px; + border-width: 0; } .openerp .oe_form_notebook ul.ui-tabs-nav { - padding-left: 0px; + padding-left: 0; background: transparent; - border-width: 0px 0px 1px 0px; - border-radius: 0px; - -moz-border-radius: 0px; - -webkit-border-radius: 0px; + border-width: 0 0 1px 0; + border-radius: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; line-height: 0.5em; } .openerp .oe_form_notebook ul.ui-tabs-nav li { @@ -562,7 +559,7 @@ body.openerp { } .openerp .oe_form_notebook .ui-tabs-panel { background: #f9f9f9; - border-width: 0px 1px 1px 1px; + border-width: 0 1px 1px 1px; } .openerp .oe_form_notebook .ui-tabs-selected { background: #f9f9f9; @@ -571,7 +568,7 @@ body.openerp { /* Form */ .openerp table.oe_frame td { color: #4c4c4c; - font-weight: 80%; + font-weight: bold; } .openerp .required.error { border: 1px solid #900; @@ -700,9 +697,7 @@ body.openerp { padding:0; margin:0; width:180px; - border-left-color: #D2CFCF; - border-left-style: solid; - border-left-width: 1px; + border-left: 1px solid #D2CFCF; height:100%; font-family: Ubuntu, Helvetica, sans-serif; font-size: 0.9em; @@ -730,17 +725,14 @@ body.openerp { font-family: Ubuntu, Helvetica, sans-serif; font-size: 1.15em; color: #8E8E8E; - text-shadow: white 0px 1px 0px; + text-shadow: white 0 1px 0; padding-left: 10px; padding-right: 21px; height: 21px; background: url(../img/sideheader-a-bg.png) repeat-x; - border-color: #D2CFCF; - border-style: solid; - border-top-width: 1px; - border-bottom-width: 1px; - border-left-width: 0; + border: 1px solid #D2CFCF; border-right-width: 0; + border-left-width: 0; } .openerp .view-manager-main-sidebar ul { @@ -757,9 +749,7 @@ body.openerp { .openerp .toggle-sidebar { cursor: pointer; - border-color: #D2CFCF; - border-style: solid; - border-width: 1px; + border: 1px solid #D2CFCF; display: block; background: url(../img/toggle-a-bg.png); width: 21px; From 94b53db19581be7b039bf24579480d1299ea5ec1 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 5 May 2011 08:41:43 +0200 Subject: [PATCH 124/306] [FIX] incorrect documentation of get_*_string in nonliterals.Context and nonliterals.Domain: the 'session' parameter has not existed in a long time bzr revid: xmo@openerp.com-20110505064143-1e25gm967nxb9gyb --- openerpweb/nonliterals.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/openerpweb/nonliterals.py b/openerpweb/nonliterals.py index a0805c9c0c2..1584628f777 100644 --- a/openerpweb/nonliterals.py +++ b/openerpweb/nonliterals.py @@ -80,10 +80,6 @@ class Domain(object): def get_domain_string(self): """ Retrieves the domain string linked to this non-literal domain in the provided session. - - :param session: the OpenERP Session used to store the domain string in - the first place. - :type session: openerpweb.openerpweb.OpenERPSession """ return self.session.domains_store[self.key] @@ -129,10 +125,6 @@ class Context(object): def get_context_string(self): """ Retrieves the context string linked to this non-literal context in the provided session. - - :param session: the OpenERP Session used to store the context string in - the first place. - :type session: openerpweb.openerpweb.OpenERPSession """ return self.session.contexts_store[self.key] From 8e7459c3b501cb2efbf046a2f02a8868be1bfec1 Mon Sep 17 00:00:00 2001 From: "sma (Tiny)" Date: Thu, 5 May 2011 12:31:46 +0530 Subject: [PATCH 125/306] [IMP] Create initiall 'create', 'edit', 'close' from m2o auto creation. bzr revid: sma@tinyerp.com-20110505070146-2be5r6tj7tavv3hl --- addons/base/static/src/css/base.css | 27 +++++++++ addons/base/static/src/js/data.js | 4 +- addons/base/static/src/js/form.js | 10 +++- addons/base/static/src/js/m2o.js | 92 +++++++++++++++++++++++++---- 4 files changed, 120 insertions(+), 13 deletions(-) diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index dc16c772785..b700aea2702 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -836,5 +836,32 @@ body.openerp { display: none; } +.create_m2o { + background-color: #4C4C4C; + height: 1.5em; + left: 0; + overflow: hidden; + padding-bottom: 0.05em; + padding-top: 0.05em; + top: 0; +} + +.a_m2o { + background-color: white; + border: 0.05em solid gray; + cursor: pointer; + font-family: arial; + font-size: 0.8em; + font-style: italic; + font-weight: bold; + margin: 10px; + margin-left: 10px; + margin-right: 10px; + padding-left: 10px; + padding-right: 10px; + padding-top: 0.1em; + text-decoration: none; + width: 4em; +} /* ------------- End autocomplete ------- */ diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index b9dc86d1f00..107ba65e468 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -89,12 +89,12 @@ openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base. context: this.context }, callback); }, - create: function(data, callback) { + create: function(data, callback, error_callback) { return this.rpc('/base/dataset/create', { model: this.model, data: data, context: this.context - }, callback); + }, callback, error_callback); }, write: function (id, data, callback) { return this.rpc('/base/dataset/save', { diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index 3a2db9e4e53..bf3c806140a 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -817,6 +817,12 @@ openerp.base.form.FieldMany2OneDatasSet = openerp.base.DataSetStatic.extend({ }, }); +openerp.base.form.FieldMany2OneViewManager = openerp.base.ViewManager.extend({ + init: function(session, element_id, dataset, views) { + this._super(session, element_id, dataset, views); + } +}); + openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({ init: function(view, node) { this._super(view, node); @@ -826,7 +832,9 @@ openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({ start: function() { this.$element = $('#' + this.element_id); this.dataset = new openerp.base.form.FieldMany2OneDatasSet(this.session, this.field.relation); - new openerp.base.m2o(this.$element, this.field.relation, this.dataset, this.session) + var views = [ [false,"list"], [false,"form"] ]; + this.viewmanager = new openerp.base.form.FieldMany2OneViewManager(this.view.session, this.element_id, this.dataset, views); + new openerp.base.m2o(this.viewmanager, this.$element, this.field.relation, this.dataset, this.session) this.$element.find('input').change(this.on_ui_change); }, set_value: function(value) { diff --git a/addons/base/static/src/js/m2o.js b/addons/base/static/src/js/m2o.js index d12ddf05ad5..f59e76471b5 100644 --- a/addons/base/static/src/js/m2o.js +++ b/addons/base/static/src/js/m2o.js @@ -1,9 +1,10 @@ openerp.base.m2o = function(openerp) { openerp.base.m2o = openerp.base.Controller.extend({ - init: function(element_id, model, dataset, session) { + init: function(view_manager, element_id, model, dataset, session) { this._super(element_id, model, dataset, session); + this.view_manager = view_manager this.session = session; this.element = element_id.find('input'); this.relation = model; @@ -34,7 +35,7 @@ openerp.base.m2o = openerp.base.Controller.extend({ if(!this.relation) { return; } - var self = this + var self = this; this.dataset.name_search(this.element.val(), function(response) { var res = response.result[0]; self.element.val(res[1]); @@ -133,8 +134,6 @@ openerp.base.m2o = openerp.base.Controller.extend({ $resultsHolder.empty().append($fancyTable); this.updateSelectedResult(); $resultsHolder.show(); - } else { - $resultsHolder.hide(); } return true; }, @@ -199,9 +198,11 @@ openerp.base.m2o = openerp.base.Controller.extend({ event_list.start(); event_list.do_reload(); } - if ($selectedRow.find('td').attr('id') == 'create') { + if ($selectedRow.find('td').attr('id') == 'create') { + return this.PseudoDialogue(); } + this.setCompletionText($selectedRow, true); this.clearResults(); break; @@ -270,10 +271,6 @@ openerp.base.m2o = openerp.base.Controller.extend({ setCompletionText: function ($selectedRow, flag) { var $cell = $selectedRow.find('td'); - if ($cell.attr('id')) { - this.element.val(''); - return; - } var autoCompleteText = $cell.find('span').text(); autoCompleteText = flag ? autoCompleteText : this.lastSearch + '[' + autoCompleteText.substring(this.lastSearch.length) + ']' this.element.val(autoCompleteText); @@ -289,5 +286,80 @@ openerp.base.m2o = openerp.base.Controller.extend({ this.numResultRows = 0; this.lastSearch = null; }, + + PseudoDialogue: function(){ + var parent_element = jQuery("#autoCompleteResults_" + this.name); + var $DiaTable = jQuery('
').append( - jQuery('
') - .append( - jQuery('', - { - 'type': 'checkbox', - 'id':sidebar[s][0], - 'value':sidebar[s][0] - }).bind('click',function(){ - self.reload_gantt(self.color_field,self.model) - }), - sidebar[s][1] - ) - .css('background-color',sidebar[s][sidebar[s].length-1]) - ) - ) - ) - } - } }, - reload_gantt: function(color_field, model) { - var domain = []; - var self = this; - jQuery('input[type=checkbox]:checked','#cal-sidebar-option').each(function() { - domain.push(parseInt(jQuery(this).attr('id'))) - }); + + reload_gantt: function(domain) { + + var self = this; + this.rpc('/base_gantt/ganttview/reload_gantt',{ - 'domain':domain, - 'color_field':color_field, - 'model': model - },function(res) { + 'domain': domain, + 'model': self.model + },function(event_ids) { ganttChartControl.clearAll(); jQuery("#GanttDiv").children().remove(); - self.load_event(res); + self.get_events(event_ids); }); - }, - reverse_convert_date_format: function(date) { - return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate(); + }, - on_task_end_resize : function(task) { - this.rpc('/base_gantt/ganttview/on_event_resize', - {'id' : task.getId(), - 'end_date' : this.reverse_convert_date_format(task.getFinishDate()), - 'duration' : task.getDuration() - }, - function(result) { - }) - }, - on_task_end_drag : function(task) { - this.rpc('/base_gantt/ganttview/on_event_drag', - {'id' : task.getId(), - 'start_date' : this.reverse_convert_date_format(task.getEST()), - 'end_date' : this.reverse_convert_date_format(task.getFinishDate()), - 'duration' : task.getDuration() - }, - function(result) { - }) + do_search: function (domains, contexts, groupbys) { + var self = this; + return this.rpc('/base/session/eval_domain_and_context', { + domains: domains, + contexts: contexts, + group_by_seq: groupbys + }, function (results) { + + self.dataset.context = results.context; + self.dataset.domain = results.domain; + return self.reload_gantt(self.dataset.domain); + }); } - + }); // here you may tweak globals object, if any, and play with on_* or do_* callbacks on them diff --git a/addons/base_gantt/static/src/xml/base_gantt.xml b/addons/base_gantt/static/src/xml/base_gantt.xml index 72c14ceb16c..c85abf0cad8 100644 --- a/addons/base_gantt/static/src/xml/base_gantt.xml +++ b/addons/base_gantt/static/src/xml/base_gantt.xml @@ -3,12 +3,9 @@

- -
+
-
-
From 26e21b097e151c1d93aea77049ca5eab2758728a Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 19 Apr 2011 17:34:59 +0200 Subject: [PATCH 032/306] [FIX] account: fix error on initial balance if we don't give any criteria lp bug: https://launchpad.net/bugs/744789 fixed bzr revid: qdp-launchpad@openerp.com-20110419153459-fpd1zitw5ud3lzct --- addons/account/account_move_line.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 83a67df9178..e541a8f7490 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -93,6 +93,10 @@ class account_move_line(osv.osv): else: query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s)) %s %s" % (fiscalyear_clause, where_move_state, where_move_lines_by_date) + if initial_bal and not context.get('periods', False) and not where_move_lines_by_date: + #we didn't pass any filter in the context, and the initial balance can't be computed using only the fiscalyear otherwise entries will be summed twice + #so we have to invalidate this query + query += " AND 1=2" if context.get('journal_ids', False): query += ' AND '+obj+'.journal_id IN (%s)' % ','.join(map(str, context['journal_ids'])) From bf5a922f889e81e1393523c3b9a3837932961b36 Mon Sep 17 00:00:00 2001 From: "vda (OpenERP)" Date: Thu, 21 Apr 2011 10:53:16 +0530 Subject: [PATCH 033/306] [FIX] Dashboard demo using jquery.dashboard plugin. bzr revid: vda@tinyerp.com-20110421052316-w501b07mhegthk7a --- addons/base/static/src/js/form.js | 1 + addons/base_dashboard/__init__.py | 1 + addons/base_dashboard/__openerp__.py | 11 + addons/base_dashboard/controllers/__init__.py | 1 + addons/base_dashboard/controllers/main.py | 9 + addons/base_dashboard/static/data.html | 1 + .../lib/jquery.dashboard/css/dashboardui.css | 264 +++++ .../jquery.dashboard/js/jquery.dashboard.js | 938 ++++++++++++++++++ .../static/src/dashboard_template.html | 85 ++ .../base_dashboard/static/src/js/dashboard.js | 89 ++ .../static/src/xml/base_dashboard.xml | 17 + 11 files changed, 1417 insertions(+) create mode 100644 addons/base_dashboard/__init__.py create mode 100644 addons/base_dashboard/__openerp__.py create mode 100644 addons/base_dashboard/controllers/__init__.py create mode 100644 addons/base_dashboard/controllers/main.py create mode 100644 addons/base_dashboard/static/data.html create mode 100644 addons/base_dashboard/static/lib/jquery.dashboard/css/dashboardui.css create mode 100644 addons/base_dashboard/static/lib/jquery.dashboard/js/jquery.dashboard.js create mode 100644 addons/base_dashboard/static/src/dashboard_template.html create mode 100644 addons/base_dashboard/static/src/js/dashboard.js create mode 100644 addons/base_dashboard/static/src/xml/base_dashboard.xml diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index 85cdb9b8368..9efa3cd01b6 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -911,6 +911,7 @@ openerp.base.form.FieldReference = openerp.base.form.Field.extend({ * Registry of form widgets, called by :js:`openerp.base.FormView` */ openerp.base.form.widgets = new openerp.base.Registry({ + 'hpaned': 'openerp.base.form.Hpaned', 'group' : 'openerp.base.form.WidgetFrame', 'notebook' : 'openerp.base.form.WidgetNotebook', 'separator' : 'openerp.base.form.WidgetSeparator', diff --git a/addons/base_dashboard/__init__.py b/addons/base_dashboard/__init__.py new file mode 100644 index 00000000000..355939a4922 --- /dev/null +++ b/addons/base_dashboard/__init__.py @@ -0,0 +1 @@ +import controllers \ No newline at end of file diff --git a/addons/base_dashboard/__openerp__.py b/addons/base_dashboard/__openerp__.py new file mode 100644 index 00000000000..a5230cda40b --- /dev/null +++ b/addons/base_dashboard/__openerp__.py @@ -0,0 +1,11 @@ +{ + "name": "Base Dashboard", + "version": "2.0", + "depends": ['base'], + "js": [ + 'static/lib/jquery.dashboard/js/jquery.dashboard.js', + 'static/src/js/dashboard.js' + ], + "css": ['static/lib/jquery.dashboard/css/dashboardui.css'], + 'active': True +} diff --git a/addons/base_dashboard/controllers/__init__.py b/addons/base_dashboard/controllers/__init__.py new file mode 100644 index 00000000000..039d9715fab --- /dev/null +++ b/addons/base_dashboard/controllers/__init__.py @@ -0,0 +1 @@ +import main \ No newline at end of file diff --git a/addons/base_dashboard/controllers/main.py b/addons/base_dashboard/controllers/main.py new file mode 100644 index 00000000000..bb761a82696 --- /dev/null +++ b/addons/base_dashboard/controllers/main.py @@ -0,0 +1,9 @@ +from base.controllers.main import View +import openerpweb + +class Dashboard(View): + _cp_path = "/base_dashboard/dashboard" + + @openerpweb.jsonrequest + def load(self, req, node): + return \ No newline at end of file diff --git a/addons/base_dashboard/static/data.html b/addons/base_dashboard/static/data.html new file mode 100644 index 00000000000..d533476cc83 --- /dev/null +++ b/addons/base_dashboard/static/data.html @@ -0,0 +1 @@ +content 4 content 4 content 4 content 4 content 4 content 4 content 4 content 4 content 4 content 4 content 4 \ No newline at end of file diff --git a/addons/base_dashboard/static/lib/jquery.dashboard/css/dashboardui.css b/addons/base_dashboard/static/lib/jquery.dashboard/css/dashboardui.css new file mode 100644 index 00000000000..6aa79f39f12 --- /dev/null +++ b/addons/base_dashboard/static/lib/jquery.dashboard/css/dashboardui.css @@ -0,0 +1,264 @@ +.ui-icon { + cursor:default; +} +.widgetheader { + cursor:move; +} +.column { + min-height:1500px; +} + +#layout-dialog .selected { + background: no-repeat scroll 0px -51px transparent; +} +#layout-dialog .layoutchoice { + width: 82px; + height: 51px; + float:left; + list-style-type:none; + margin:5px; + padding:0; +} +.selectedcolumn { + border: 3px dashed #aaaaaa; +} +.emptycolumn { + font-size:20px; + font-weight:bold; + color: #aaaaaa; + padding: 5px 5px 5px 5px; +} + +.dashboard { + margin-top: 5px; +} +.right { + float:right; +} +.widgetheader { + padding:2px 2px 5px 5px; +} +.ui-icon { + float:left; +} +.widgetcontent { + padding:2px 2px 5px 5px; +} +.widget { + margin-bottom:10px; +} +.column { + float:left; + margin:0 1% -1.5em; + padding:0; + width:47.5%; +} + +.layout-a .column { +width:98%; +} +.layout-a .column.second, .layout-a .column.third { +display:none; +} +.layout-aa .column { +width:47.5%; +} +.layout-aa .third { +display:none; +} +.layout-ba .column { +width:68%; +} +.layout-ba .first { +width:27%; +} +.layout-ba .third { +display:none; +} +.layout-ab .column { +width:27%; +} +.layout-ab .first { +width:68%; +} +.layout-ab .third { +display:none; +} +.layout-aaa .column { + width:30.9%; +} + +body { + margin:0; + color:#333333; + font:12px/1.4 arial,FreeSans,Helvetica,sans-serif; +} + +.headerlink { + color:#ffffff; +} + +.headerlinks { + text-align:right; + margin-right:20px; + line-height:24px; + text-decoration:underline; + font-weight:bold; +} + +.headerbox { + height:148px; +} + +.ui-widget-overlay { + opacity:0.5; +} + +/*.loading { + padding: 50px; + text-align: center; + background-image:loading.gif; +}*/ + + +#layout-dialog ul { + margin:0; + padding:0; +} + +#layout-dialog ul li a, #layout-dialog ul li a:link, #layout-dialog ul li a:visited { + border:1px solid #BBBBBB; + display:block; + float:left; + margin:0 1em 1em 0; + outline:medium none; + padding:0.35em; + width:auto; +} + +.hidden { + display:none; +} + +.controls { + border:1px solid #BBBBBB; + float:none; + margin:0; + padding:4px 0; +} + +.controls { + width:100px; + background:none repeat scroll 0 0 #dddddd; + border:1px solid #6A8EB3; + color:#000000; + margin-top:-1px; + padding:4px 0; + position:absolute; + right:0; + z-index:2003; +} + +.controls li { + float:none; + margin:0; + padding:0; + list-style-type:none; + margin:0 0 0 0.2em; + width:auto; + position:static; +} + +.controls li a { + color:#000000; + font-weight:normal; + float:none; + margin:0; + text-decoration:none; + width:auto; + padding-left:5px; +} + +.hiddenmenu { + position:relative; +} + +.dialog .categories { + list-style:none outside none; + height: 414px; +} + +.dialog .categories li.selected button { + color:#FFFFFF; + font-weight:800; +} +.dialog .categories li button { + background:none repeat scroll 0 0 transparent; + border:medium none; + color:#666666; + font-family:"segoe ui",helvetica,arial,sans-serif; + font-size:0.8em; + padding:0.4em 1.2em; + text-align:left; + width:100%; +} +ul.categories button { + cursor:pointer; +} + +.widgetitem { + border:2px none white; + float:left; + font-size:0.77em; + height:142px; + margin:0; + overflow:hidden; + padding:0 20px 0 142px; + width:152px; +} + +ol.widgets { + float:left; + list-style:none outside none; + margin:-10px; + padding:0; + width:auto; +} + +.dialog .panel-body { + overflow:auto; + padding:10px; +} + +.dialog .categories { + background:none repeat scroll 0 0 #FFFFFF; + border-right:1px solid #F0F0F0; + float:left; + height:100%; + list-style:none outside none; + margin:0 1.17em 0 0; + padding:10px 0 0; + width:25%; +} + +.dialog .categories li.selected { + background:none repeat scroll 0 0 #6699CC; + color:#FFFFFF; +} + +.widgetitem .add-button { + float:left; + margin:81px 0 0 -131px; + width:auto; +} + +.widgetitem h3 { + margin:11px 0 0; + padding:0; +} + +.widgetitem img { + border:1px solid #999999; + float:left; + margin:10px 0 0 -132px; +} \ No newline at end of file diff --git a/addons/base_dashboard/static/lib/jquery.dashboard/js/jquery.dashboard.js b/addons/base_dashboard/static/lib/jquery.dashboard/js/jquery.dashboard.js new file mode 100644 index 00000000000..32aac9ffa85 --- /dev/null +++ b/addons/base_dashboard/static/lib/jquery.dashboard/js/jquery.dashboard.js @@ -0,0 +1,938 @@ +/* + * dashboard 1.0 + * http://www.gxdeveloperweb.com/dashboard/ + * + * Copyright (c) 2010 Mark Machielsen + * + * Dual licensed under the MIT and GPL licenses (same as jQuery): + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +(function($) { // Create closure. + + // Constructor for dashboard object. + $.fn.dashboard = function(options) { + // Public properties of dashboard. + var dashboard = {}; + var loading; + var widgetDirectoryUrl; + dashboard.layout; + dashboard.element = this; + dashboard.id = this.attr("id"); + dashboard.widgets = {}; + dashboard.widgetsToAdd = {}; + dashboard.widgetCategories = {}; + dashboard.initialized = false; + + // Public methods + dashboard.serialize = function() { + dashboard.log('entering serialize function',1); + var r = '{"layout": "' + dashboard.layout.id + '", "data" : ['; + // add al widgets in the right order + var i=0; + if ($('.' + opts.columnClass).length == 0) dashboard.log(opts.columnClass + ' class not found',5); + $('.' + opts.columnClass).each(function() { + $(this).children().each(function() { + if ($(this).hasClass(opts.widgetClass)) { + if (i > 0) { r+= ','; } + r+= (dashboard.getWidget($(this).attr("id"))).serialize(); + i++; + } + }); + }); + r+= ']}'; + return r; + } + + dashboard.log = function(msg, level) { + if (level >= opts.debuglevel && typeof console != 'undefined') { + var l = ''; + if (level == 1) l = 'INFO'; + if (level == 2) l = 'EVENT'; + if (level == 3) l = 'WARNING'; + if (level == 5) l = 'ERROR'; + console.log(l + ' - ' + msg); + } + } + + dashboard.setLayout = function(layout) { + if (layout != null) { + dashboard.log('entering setLayout function with layout ' + layout.id,1); + } else { + dashboard.log('entering setLayout function with layout null',1); + } + dashboard.layout = layout; + + loading.remove(); + if (dashboard.layout != null) { + if (typeof opts.layoutClass != 'undefined') { + this.element.find('.' + opts.layoutClass).addClass(dashboard.layout.classname); + } else { + this.element.html(dashboard.layout.html); + } + } + + // make the columns sortable, see http://jqueryui.com/demos/sortable/ for explaination + $('.' + opts.columnClass).sortable({ + connectWith: $('.' + opts.columnClass), + opacity: opts.opacity, + handle: '.' + opts.widgetHeaderClass, + over: function(event, ui) { + $(this).addClass("selectedcolumn"); + }, + out: function(event, ui) { + $(this).removeClass("selectedcolumn"); + }, + receive: function(event, ui) { + // update the column attribute for the widget + var w = dashboard.getWidget(ui.item.attr("id")); + w.column = getColumnIdentifier($(this).attr("class")); + + dashboard.log('dashboardStateChange event thrown for widget ' + w.id,2); + dashboard.element.trigger("dashboardStateChange",{"stateChange":"widgetMoved","widget":w}); + + dashboard.log('widgetDropped event thrown for widget ' + w.id,2); + w.element.trigger("widgetDropped",{"widget":w}); + }, + deactivate: function(event, ui) { + // This event is called for each column + dashboard.log('Widget is dropped: check if the column is now empty.',1); + var childLength = $(this).children().length; + if (childLength == 0) { + dashboard.log('adding the empty text to the column',1); + $(this).html('
' + opts.emptyColumnHtml + '
'); + } else { + if (childLength == 2) { + // remove the empty column HTML + $(this).find('.emptycolumn').remove(); + } + } + }, + start: function(event, ui) { + ui.item.find('.' + opts.widgetTitleClass).addClass('noclick'); + }, + stop: function(event, ui) { + //sorting changed (within one list) + setTimeout(function(){ + ui.item.find('.' + opts.widgetTitleClass).removeClass('noclick'); + }, 300); + } + + }); + + fixSortableColumns(); + + // trigger the dashboardLayoutLoaded event + dashboard.log('dashboardLayoutLoaded event thrown',2); + dashboard.element.trigger("dashboardLayoutLoaded"); + } + + // This is a workaround for the following problem: when I drag a widget from column2 to column1, sometimes the widget is + // moved to column3, which is not visible + function fixSortableColumns() { + dashboard.log('entering fixSortableColumns function',1); + $('.nonsortablecolumn').removeClass('nonsortablecolumn').addClass(opts.columnClass); + $('.' + opts.columnClass).filter(function() {return $(this).css("display") == 'none'}).addClass('nonsortablecolumn').removeClass(opts.columnClass); + } + + function getColumnIdentifier(classes) { + dashboard.log('entering getColumnIdentifier function',1); + var r; + var s = classes.split(" "); + for (var i = 0;i < s.length;i++) { + if (s[i].indexOf(opts.columnPrefix) === 0) { r = s[i] }; + }; + return r.replace(opts.columnPrefix,''); + } + + dashboard.loadLayout = function() { + dashboard.log('entering loadLayout function',1); + if (typeof opts.json_data.url != 'undefined' && opts.json_data.url.length > 0) { + // ajax option + dashboard.log('Getting JSON feed : ' + opts.json_data.url,1); + $.getJSON(opts.json_data.url, function(json) { + if (json == null) { + alert('Unable to get json. If you are using chrome: there is an issue with loading json with local files. It works on a server :-)',5); + return; + } + // set the layout + var currentLayout = (typeof dashboard.layout != 'undefined') ? dashboard.layout : getLayout(json.layout); + dashboard.setLayout(currentLayout); + dashboard.loadWidgets(json.data); + }); + } else { + // set the layout +// var currentLayout; +// if(typeof dashboard.layout != 'undefined') { +// currentLayout = dashboard.layout +// } + var currentLayout = (typeof dashboard.layout != 'undefined') ? dashboard.layout : getLayout(opts.json_data.layout); + dashboard.setLayout(currentLayout); + dashboard.loadWidgets(opts.json_data.data); + } + }; + + dashboard.addWidget = function(obj, column) { + dashboard.log('entering addWidget function',1); + // add the widget to the column + var wid = obj.id; + + // check if the widget is already registered and available in the dom + if (typeof dashboard.widgets[wid] != 'undefined' && $('#' + wid).length > 0) { + var wi = $('#' + wid); + column = dashboard.widgets[wid].column; + + // add it to the column + wi.appendTo(column); + + } else { + // build the widget + dashboard.log('Applying template : ' + opts.widgetTemplate,1); + if ($('#' + opts.widgetTemplate).length == 0) dashboard.log('Template "' + opts.widgetTemplate + ' not found',5); + var widgetStr = tmpl($('#' + opts.widgetTemplate).html(), obj); + var wi = $(widgetStr); + + // add it to the column + wi.appendTo(column); + + dashboard.widgets[wid] = widget({ + id: wid, + element: wi, + column: obj.column, + url: (typeof obj.url != 'undefined' ? obj.url : null), + editurl: obj.editurl, + title: obj.title, + open: obj.open, + metadata: obj.metadata + }); + } + + dashboard.log('widgetAdded event thrown for widget ' + wid,2); + dashboard.widgets[wid].element.trigger("widgetAdded", {"widget":dashboard.widgets[wid]}); + + if (dashboard.initialized) { + dashboard.log('dashboardStateChange event thrown for widget ' + wid,2); + dashboard.element.trigger("dashboardStateChange",{"stateChange":"widgetAdded","widget":wi}); + } + } + + dashboard.loadWidgets = function(data) { + dashboard.log('entering loadWidgets function',1); + dashboard.element.find('.' + opts.columnClass).empty(); + + + // This is for the manual feed + $(data).each(function() { + var column = this.column; + dashboard.addWidget(this, dashboard.element.find('.' + opts.columnPrefix + column)); + }); // end loop for widgets + + // check if there are widgets in the temp dashboard which needs to be moved + // this is not the correct place, but otherwise we are too late + + // check if there are still widgets in the temp + $('#tempdashboard').find('.' + opts.widgetClass).each(function() { + // append it to the first column + var firstCol = dashboard.element.find('.' + opts.columnClass + ':first'); + $(this).appendTo(firstCol); + + // set the new column + dashboard.getWidget($(this).attr("id")).column = firstCol.attr("id"); + }); + $('#tempdashboard').remove(); + + // add the text to the empty columns + $('.' + opts.columnClass).each(function() { + if ($(this).children().length == 0) { + $(this).html('
' + opts.emptyColumnHtml + '
'); + } + }); + + dashboard.initialized = true; + }; + + dashboard.init = function() { + dashboard.log('entering init function',1); + // load the widgets as fast as we can. After that add the binding + dashboard.loadLayout(); + } + + dashboard.getWidget = function(id) { + dashboard.log('entering getWidget function',1); + var wi = dashboard.widgets[id]; + if (typeof wi != 'undefined') { + return wi; + } else { + return null; + } + } + + + // Merge in the caller's options with the defaults. + var opts = $.extend({}, $.fn.dashboard.defaults, options); + var addOpts = $.extend({}, $.fn.dashboard.defaults.addWidgetSettings, options.addWidgetSettings); + var layoutOpts = $.extend({}, $.fn.dashboard.defaults.editLayoutSettings, options.editLayoutSettings); + + // Execution 'forks' here and restarts in init(). Tell the user we're busy with a loading. + var loading = $(opts.loadingHtml).appendTo(dashboard.element); + + /** + * widget object + * Private sub-class of dashboard + * Constructor starts + */ + function widget(widget) { + + dashboard.log('entering widget constructor',1); + // Merge default options with the options defined for this widget. + widget = $.extend({}, $.fn.dashboard.widget.defaults, widget); + + // public functions + widget.openContent = function() { + // hide the open link, show the close link + widget.element.find('.widgetOpen').hide(); + widget.element.find('.widgetClose').show(); + + dashboard.log('entering openContent function',1); + widget.open = true; + if (!widget.loaded) { + // load the content in the widget if the state == open + if (this.url != '' && this.url != null && typeof this.url != 'undefined') { + // add the loading + $(opts.loadingHtml).appendTo(widget.element.find('.' + opts.widgetContentClass)); + + dashboard.log('widgetShow event thrown for widget ' + widget.id,2); + widget.element.trigger("widgetShow", {"widget":widget}); + + widget.element.find('.' + opts.widgetContentClass).load(this.url, function(response, status, xhr) { + if (status == "error") { + widget.element.find('.' + opts.widgetContentClass).html(opts.widgetNotFoundHtml); + } + widget.loaded = true; + dashboard.log('widgetLoaded event thrown for widget ' + widget.id,2); + widget.element.trigger("widgetLoaded", {"widget":widget}); + }); + } else { + dashboard.log('widgetShow event thrown for widget ' + widget.id,2); + widget.element.trigger("widgetShow", {"widget":widget}); + + dashboard.log('widgetLoaded event thrown',2); + widget.element.trigger("widgetLoaded", {"widget":widget}); + } + } else { + dashboard.log('widgetShow event thrown for widget ' + widget.id,2); + widget.element.trigger("widgetShow", {"widget":widget}); + } + if (dashboard.initialized) { + dashboard.log('dashboardStateChange event thrown for widget ' + widget.id,2); + dashboard.element.trigger("dashboardStateChange",{"stateChange":"widgetOpened","widget":widget}); + } + }; + widget.refreshContent = function() { + dashboard.log('entering refreshContent function',1); + widget.loaded = false; + if (widget.open) { + widget.openContent(); + } + } + widget.setTitle = function(newTitle){ + dashboard.log('entering setTitle function',1); + widget.title=newTitle; + widget.element.find('.' + opts.widgetTitleClass).html(newTitle); + if (dashboard.initialized) { + dashboard.log('dashboardStateChange event thrown for widget ' + widget.id,2); + dashboard.element.trigger("dashboardStateChange",{"stateChange":"titleChanged","widget":widget}); + } + } + widget.closeContent = function() { + dashboard.log('entering closeContent function',1); + widget.open = false; + + dashboard.log('widgetHide event thrown for widget ' + widget.id,2); + widget.element.trigger("widgetHide", {"widget":widget}); + + // show the open link, hide the close link + widget.element.find('.widgetOpen').show(); + widget.element.find('.widgetClose').hide(); + + dashboard.log('dashboardStateChange event thrown for widget ' + widget.id,2); + dashboard.element.trigger("dashboardStateChange",{"stateChange":"widgetClosed","widget":widget}); + }; + widget.addMetadataValue = function(name, value) { + dashboard.log('entering addMetadataValue function',1); + if (typeof widget.metadata == 'undefined') { + widget.metadata = {}; + } + widget.metadata[name] = value; + dashboard.log('dashboardStateChange event thrown for widget ' + widget.id,2); + dashboard.element.trigger("dashboardStateChange",{"stateChange":"metadataChanged","widget":widget}); + }; + widget.openMenu = function() { + dashboard.log('entering openMenu function',1); + widget.element.find('.' + opts.menuClass).show(); + }; + widget.closeMenu = function() { + dashboard.log('entering closeMenu function',1); + widget.element.find('.' + opts.menuClass).hide(); + }; + widget.remove = function() { + dashboard.log('entering remove function',1); + widget.element.remove(); + dashboard.log('widgetDeleted event thrown for widget ' + widget.id,2); + widget.element.trigger('widgetDeleted', {"widget":widget}); + + dashboard.log('dashboardStateChange event thrown for widget ' + widget.id,2); + dashboard.element.trigger("dashboardStateChange",{"stateChange":"widgetRemoved","widget":widget}); + }; + widget.serialize = function() { + dashboard.log('entering serialize function',1); + var r = '{"title" : "' + widget.title + '", "id" : "' + widget.id + '", "column" : "' + widget.column + '","editurl" : "' + widget.editurl + '","open" : ' + widget.open + ',"url" : "' + widget.url + '"'; + + if (typeof widget.metadata != 'undefined') { + r+= ',"metadata":{' + var obj = widget.metadata; + var i=0; + for(var item in obj) { + if (i > 0) { r+= ',' }; + + // FIXME: support for more than string, eg numbers subobjects + r+= '"' + item + '":"' + obj[item] + '"'; + i++; + } + r+= '}' + + } + + r += '}'; + return r; + }; + widget.openFullscreen = function() { + dashboard.log('entering openFullscreen function',1); + widget.fullscreen = true; + + // create a clone + var clone = widget.element.clone(); + + // move the dashboard + var temp = $(''); + temp.appendTo($("body")); + dashboard.element.children().appendTo(temp); + + // add the clone to the dashboard + var fs = $('
    '); + fs.appendTo(dashboard.element); + clone.appendTo(fs); + + }; + widget.closeFullscreen = function() { + dashboard.log('entering closeFullscreen function',1); + widget.fullscreen = false; + + // remove the fullscreen + $('#fullscreen_' + dashboard.id).remove(); + + // move the content from the tempdashboard back + $('#tempdashboard_' + dashboard.id).children().appendTo(dashboard.element); + $('#tempdashboard_' + dashboard.id).remove(); + + }; + widget.openSettings = function() { + dashboard.log('entering openSettings function',1); + widget.element.find('.' + opts.widgetContentClass).load(widget.editurl); + }; + + // called when widget is initialized + if (widget.open) { + widget.openContent(); + } + + widget.initialized = true; + + dashboard.log('widgetInitialized event thrown',2); + widget.element.trigger("widgetInitialized", {"widget":widget}); + + return widget; + }; + + + // FIXME: can this be done easier?? + function getLayout(id) { + dashboard.log('entering getLayout function',1); + var r = null; + var first = null; + if (typeof opts.layouts != 'undefined') { + + $.each(opts.layouts,function(i, item) { + if (i == 0) { first = item; } + if (item.id == id) { + r = item; + } + }); + } + if (r == null) { r = first } + return r; + } + + + $('#' + dashboard.id + ' .menutrigger').live('click', function() { + dashboard.log('widgetOpenMenu event thrown for widget ' + widget.id,2); + var wi = dashboard.getWidget($(this).closest('.' + opts.widgetClass).attr("id")); + + wi.element.trigger('widgetOpenMenu', {"widget":wi}); + return false; + }); + + // add event handlers to the menu + $('#' + dashboard.id + ' .' + opts.widgetFullScreenClass).live('click',function(e) { + // close the menu + dashboard.log('widgetCloseMenu event thrown for widget ' + widget.id,2); + var wi = dashboard.getWidget($(this).closest('.' + opts.widgetClass).attr("id")); + wi.element.trigger('widgetCloseMenu', {"widget":wi}); + + if (wi.fullscreen) { + dashboard.log('widgetCloseFullScreen event thrown for widget ' + wi.id,2); + wi.element.trigger('widgetCloseFullScreen', {"widget":wi}); + } else { + dashboard.log('widgetOpenFullScreen event thrown for widget ' + wi.id,2); + wi.element.trigger('widgetOpenFullScreen', {"widget":wi}); + } + return false; + }); + + $('#' + dashboard.id + ' .controls li').live('click',function(e) { + // close the menu + dashboard.log('widgetCloseMenu event thrown for widget ' + widget.id,2); + + var wi = dashboard.getWidget($(this).closest('.' + opts.widgetClass).attr("id")); + wi.element.trigger('widgetCloseMenu', {"widget":wi}); + + // use the class on the li to determine what action to trigger + dashboard.log($(this).attr('class') + ' event thrown for widget ' + widget.id,2); + + var wi = dashboard.getWidget($(this).closest('.' + opts.widgetClass).attr("id")); + wi.element.trigger($(this).attr('class'), {"widget":wi}); + return false; + }); + + // add the menu events (by default triggers are connected in dashboard_jsonfeed) + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetCloseMenu',function(e,o) { + dashboard.log("Closing menu " + $(this).attr("id"),1); + o.widget.closeMenu(); + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetOpenMenu',function(e,o) { + dashboard.log("Opening menu " + $(this).attr("id"),1); + o.widget.openMenu(); + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetDelete',function(e,o) { + if (confirm(opts.deleteConfirmMessage)) { + dashboard.log("Removing widget " + $(this).attr("id"),1); + o.widget.remove(); + } + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetRefresh',function(e,o) { + o.widget.refreshContent(); + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetSetTitle',function(event, o) { + o.widget.setTitle(o.title); + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetClose',function(e,o) { + dashboard.log("Closing widget " + $(this).attr("id"),1); + o.widget.closeContent(); + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetOpen',function(e,o) { + dashboard.log("Opening widget " + $(this).attr("id"),1); + o.widget.openContent(); + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetShow',function() { + $(this).find('.' + opts.widgetContentClass).show(); + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetHide',function() { + $(this).find('.' + opts.widgetContentClass).hide(); + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetAddMetadataValue',function(e,o) { + dashboard.log("Changing metadata for widget " + $(this).attr("id") + ", metadata name: " + o.name + ", value: " + o.value, 1); + o.widget.addMetadataValue(o.name, o.value); + }); + + // Define a toggle event when clicking at the header + $('#' + dashboard.id + ' .' + opts.widgetTitleClass).live('click',function(e) { + dashboard.log("Click on the header detected for widget " + $(this).attr("id"),1); + if (!$(this).hasClass('noclick')) { + var wi = dashboard.getWidget($(this).closest('.' + opts.widgetClass).attr("id")); + if (wi.open) { + dashboard.log('widgetClose event thrown for widget ' + wi,2); + wi.element.trigger('widgetClose', {"widget":wi}); + } else { + dashboard.log('widgetOpen event thrown for widget ' + wi,2); + wi.element.trigger('widgetOpen', {"widget":wi}); + } + } + return false; + }); + + $('#' + dashboard.id + ' .' + opts.widgetHeaderClass).live('mouseover',function () { + $(this).find('.' + opts.iconsClass).removeClass("hidden"); + }); + + $('#' + dashboard.id + ' .' + opts.widgetHeaderClass).live('mouseout', function () { + $(this).find('.' + opts.iconsClass).addClass("hidden"); + }); + + $('body').click(function() { + $('.' + opts.menuClass).hide(); + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetOpenFullScreen',function(e,o) { + o.widget.openFullscreen(); + }); + + $('.' + opts.widgetClass).live('widgetCloseFullScreen',function(e,o) { + o.widget.closeFullscreen(); + }); + + $('#' + dashboard.id + ' .' + opts.widgetClass).live('widgetEdit',function(e,o) { + o.widget.openSettings(); + }); + + if ($('#' + addOpts.dialogId).length == 0) dashboard.log('Unable to find ' + addOpts.dialogId,5); + $('#' + addOpts.dialogId).dialog({ + autoOpen: false, + height: 414, + width: 550, + modal: true, + buttons: { + Cancel: function() { + $(this).dialog('close'); + } + }, + close: function() { + //close + } + }); + + if ($('#' + layoutOpts.dialogId).length == 0) dashboard.log('Unable to find ' + layoutOpts.dialogId,5); + $('#' + layoutOpts.dialogId).dialog({ + autoOpen: false, + height: 300, + width: 600, + modal: true + }); + + $('.' + layoutOpts.openDialogClass).live('click', function(){ + dashboard.log('dashboardOpenLayoutDialog event thrown',2); + dashboard.element.trigger("dashboardOpenLayoutDialog"); + return false; + }); + + dashboard.element.live('dashboardOpenLayoutDialog', function(){ + dashboard.log('Opening dialog ' + layoutOpts.dialogId,1); + $('#' + layoutOpts.dialogId).dialog('open'); + + // add the layout images + var h = $('#' + layoutOpts.dialogId).find('.' + layoutOpts.layoutClass); + h.empty(); + if (h.children().length == 0) { + dashboard.log('Number of layouts : ' + opts.layouts.length,1); + $.each(opts.layouts,function(i, item) { + dashboard.log('Applying template : ' + layoutOpts.layoutTemplate,1); + if ($('#' + layoutOpts.layoutTemplate).length == 0) dashboard.log('Template "' + layoutOpts.layoutTemplate + ' not found',5); + h.append(tmpl($('#' + layoutOpts.layoutTemplate).html(), item)); + }); + } + + // set the selected class for the selected layout + $('.' + layoutOpts.selectLayoutClass).removeClass(layoutOpts.selectedLayoutClass); + $('#' + dashboard.layout.id).addClass(layoutOpts.selectedLayoutClass); + + bindSelectLayout(); + }); + + + dashboard.element.live('dashboardStateChange', function(){ + if (typeof opts.stateChangeUrl != 'undefined' && opts.stateChangeUrl != null && opts.stateChangeUrl != '') { + $.ajax({type: 'POST', + url: opts.stateChangeUrl, + data: { dashboard: dashboard.element.attr("id"), settings: dashboard.serialize() }, + success: function(data){ + if (data == "NOK" || data.indexOf('NOK') != -1){ + dashboard.log('dashboardSaveFailed event thrown',2); + dashboard.element.trigger("dashboardSaveFailed"); + } else { + dashboard.log('dashboardSuccessfulSaved event thrown',2); + dashboard.element.trigger("dashboardSuccessfulSaved"); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown){ + dashboard.log('dashboardSaveFailed event thrown',2); + dashboard.element.trigger("dashboardSaveFailed"); + }, + dataType: "text" + }); + } + }); + + + dashboard.element.live('dashboardCloseLayoutDialog', function(){ + // close the dialog + $('#' + layoutOpts.dialogId).dialog('close'); + }); + + // FIXME: why doesn't the live construct work in this case + function bindSelectLayout() { + if ($('.' + layoutOpts.selectLayoutClass).length == 0) dashboard.log('Unable to find ' + layoutOpts.selectLayoutClass,5); + $('.' + layoutOpts.selectLayoutClass).bind('click', function(e){ + var currentLayout = dashboard.layout; + + dashboard.log('dashboardCloseLayoutDialog event thrown',2); + dashboard.element.trigger('dashboardCloseLayoutDialog'); + + // Now set the new layout + var newLayout = getLayout($(this).attr("id")); + dashboard.layout = newLayout; + + // remove the class of the old layout + if (typeof opts.layoutClass != 'undefined') { + dashboard.element.find('.' + opts.layoutClass).removeClass(currentLayout.classname).addClass(newLayout.classname); + + fixSortableColumns(); + + // check if there are widgets in hidden columns, move them to the first column + if ($('.' + opts.columnClass).length == 0) dashboard.log('Unable to find ' + opts.columnClass,5); + dashboard.element.find('.' + opts.columnClass).each(function() { + if ($(this).css("display") == "none") { + // move the widgets to the first column + $(this).children().appendTo(dashboard.element.find('.' + opts.columnClass + ':first')); + } + + $('.emptycolumn').remove(); + // add the text to the empty columns + $('.' + opts.columnClass).each(function() { + if ($(this).children().length == 0) { + $(this).html('
    ' + opts.emptyColumnHtml + '
    '); + } + }); + + + }); + + } else { + // set the new layout, but first move the dashboard to a temp + var temp = $(''); + temp.appendTo($("body")); + + dashboard.element.children().appendTo(temp); + + // reload the dashboard + dashboard.init(); + } + + // throw an event upon changing the layout. + dashboard.log('dashboardChangeLayout event thrown',2); + dashboard.element.trigger('dashboardLayoutChanged'); + + }); + return false; + } + + $('.' + addOpts.selectCategoryClass).live('click', function(){ + dashboard.log('addWidgetDialogSelectCategory event thrown',2); + dashboard.element.trigger('addWidgetDialogSelectCategory', {"category":$(this)}); + return false; + }); + + dashboard.element.live('addWidgetDialogSelectCategory', function(e, obj){ + // remove the category selection + $('.' + addOpts.selectCategoryClass).removeClass(addOpts.selectedCategoryClass); + + // empty the widgets div + $('#' + addOpts.dialogId).find('.' + addOpts.widgetClass).empty(); + + // select the category + $(obj.category).addClass(addOpts.selectedCategoryClass); + + // get the widgets + url = dashboard.widgetCategories[$(obj.category).attr("id")]; + + dashboard.log('Getting JSON feed : ' + url,1); + $.getJSON(url, {"cache":true}, function(json) { + // load the widgets from the category + if (json.data == 0) dashboard.log('Empty data returned',3); + $.each(json.data, function(i,item){ + dashboard.widgetsToAdd[item.id] = item; + + dashboard.log('Applying template : ' + addOpts.widgetTemplate,1); + if ($('#' + addOpts.widgetTemplate).length == 0) dashboard.log('Template "' + addOpts.widgetTemplate + ' not found',5); + var html = tmpl($('#' + addOpts.widgetTemplate).html(), item); + $('#' + addOpts.dialogId).find('.' + addOpts.widgetClass).append(html); + }); + }); + + dashboard.log('addWidgetDialogWidgetsLoaded event thrown',2); + dashboard.element.trigger('addWidgetDialogWidgetsLoaded'); + }); + + + $('.' + addOpts.addWidgetClass).live('click', function(){ + var widget = dashboard.widgetsToAdd[$(this).attr("id").replace('addwidget','')]; + dashboard.log('dashboardAddWidget event thrown',2); + dashboard.element.trigger('dashboardAddWidget', {"widget":widget}); + + dashboard.log('dashboardCloseWidgetDialog event thrown',2); + dashboard.element.trigger('dashboardCloseWidgetDialog'); + return false; + }); + + $('.' + addOpts.openDialogClass).live('click', function(){ + dashboard.log('dashboardOpenWidgetDialog event thrown',2); + dashboard.element.trigger('dashboardOpenWidgetDialog'); + return false; + }); + + dashboard.element.live('dashboardCloseWidgetDialog', function(){ + // close the dialog + $('#' + addOpts.dialogId).dialog('close'); + }); + + dashboard.element.live('dashboardOpenWidgetDialog', function(){ + + //remove existing categories/widgets from the DOM, to prevent duplications + $('#' + addOpts.dialogId).find('.' + addOpts.categoryClass).empty(); + $('#' + addOpts.dialogId).find('.' + addOpts.widgetClass).empty(); + + dashboard.log('Opening dialog ' + addOpts.dialogId,1); + $('#' + addOpts.dialogId).dialog('open'); + + dashboard.log('Getting JSON feed : ' + addOpts.widgetDirectoryUrl,1); + $.getJSON(addOpts.widgetDirectoryUrl, function(json) { + if (json.category == 0) dashboard.log('Empty data returned',3); + $.each(json.category, function(i,item){ + // Add the categories to the dashboard + dashboard.widgetCategories[item.id] = item.url; + + dashboard.log('Applying template : ' + addOpts.categoryTemplate,1); + if ($('#' + addOpts.categoryTemplate).length == 0) dashboard.log('Template "' + addOpts.categoryTemplate + ' not found',5); + var html = tmpl($('#' + addOpts.categoryTemplate).html(),item); + $('#' + addOpts.dialogId).find('.' + addOpts.categoryClass).append(html); + }); + dashboard.log('addWidgetDialogCategoriesLoaded event thrown',2); + dashboard.element.trigger('addWidgetDialogCategoriesLoaded'); + + dashboard.log('addWidgetDialogSelectCategory event thrown',2); + dashboard.element.trigger('addWidgetDialogSelectCategory', {"category":$('#' + addOpts.dialogId).find('.' + addOpts.categoryClass + '>li:first')}); + + }); + + }); + + return dashboard; + }; + + + // Public static properties of dashboard. Default settings. + $.fn.dashboard.defaults = { + debuglevel:3, + json_data: {}, + simple_data: {}, + loadingHtml: '
    Loading, please wait

    Loading...

    ', + emptyColumnHtml: 'Drag your widgets here', + widgetTemplate: 'widgettemplate', + columnPrefix: 'column-', + opacity:"0.2", + deleteConfirmMessage: "Are you sure you want to delete this widget?", + widgetNotFoundHtml: "The content of this widget is not available anymore. You may remove this widget.", + columnClass: 'column', + widgetClass: 'widget', + menuClass: 'controls', + widgetContentClass: 'widgetcontent', + widgetTitleClass: 'widgettitle', + widgetHeaderClass: 'widgetheader', + widgetFullScreenClass: 'widgetopenfullscreen', + iconsClass: 'icons', + stateChangeUrl: '', + + addWidgetSettings: { + openDialogClass: 'openaddwidgetdialog', + addWidgetClass: 'addwidget', + selectCategoryClass: 'selectcategory', + selectedCategoryClass: 'selected', + categoryClass: 'categories', + widgetClass: 'widgets', + + dialogId: 'addwidgetdialog', + + categoryTemplate: 'categorytemplate', + widgetTemplate: 'addwidgettemplate' + }, + editLayoutSettings: { + dialogId: 'editLayout', + layoutClass: 'layoutselection', + selectLayoutClass: 'layoutchoice', + selectedLayoutClass: 'selected', + openDialogClass: 'editlayout', + layoutTemplate: 'selectlayouttemplate' + } + + + }; + + // Default widget settings. + $.fn.dashboard.widget = { + defaults: { + open: true, + fullscreen: false, + loaded: false, + url: '', + metadata: {} + } + }; + +})(jQuery); // end of closure + + +// Simple JavaScript Templating +// John Resig - http://ejohn.org/ - MIT Licensed +(function(){ + var cache = {}; + + this.tmpl = function tmpl(str, data){ + // Figure out if we're getting a template, or if we need to + // load the template - and be sure to cache the result. + + var fn = !/\W/.test(str) ? + cache[str] = cache[str] || + tmpl(document.getElementById(str).innerHTML) : + + // Generate a reusable function that will serve as a template + // generator (and which will be cached). + new Function("obj", + "var p=[],print=function(){p.push.apply(p,arguments);};" + + + // Introduce the data as local variables using with(){} + "with(obj){p.push('" + + + // Convert the template into pure JavaScript + str + .replace(/[\r\t\n]/g, " ") + .split("<%").join("\t") + .replace(/((^|%>)[^\t]*)'/g, "$1\r") + .replace(/\t=(.*?)%>/g, "',$1,'") + .split("\t").join("');") + .split("%>").join("p.push('") + .split("\r").join("\\'") + + "');}return p.join('');"); + + // Provide some basic currying to the user + return data ? fn( data ) : fn; + }; +})(); diff --git a/addons/base_dashboard/static/src/dashboard_template.html b/addons/base_dashboard/static/src/dashboard_template.html new file mode 100644 index 00000000000..f78f8b861a8 --- /dev/null +++ b/addons/base_dashboard/static/src/dashboard_template.html @@ -0,0 +1,85 @@ + + + + + + + + + +
    +
      +
    + +
    +
      +
    +
    +
    + + +
    +
    +

    Choose dashboard layout

    +
      +
    +
    +
    \ No newline at end of file diff --git a/addons/base_dashboard/static/src/js/dashboard.js b/addons/base_dashboard/static/src/js/dashboard.js new file mode 100644 index 00000000000..4b09dee21dc --- /dev/null +++ b/addons/base_dashboard/static/src/js/dashboard.js @@ -0,0 +1,89 @@ +openerp.base_dashboard = function(openerp) { +QWeb.add_template('/base_dashboard/static/src/xml/base_dashboard.xml'); +openerp.base.form.Hpaned = openerp.base.form.Widget.extend({ + init: function(view, node) { + + this._super(view, node); + this.template = "Hpaned"; + }, + start: function() { + this._super.apply(this, arguments); + this.$element.html(QWeb.render(this.template)) + }, + + render: function() { + var self = this; + jQuery('body').append( + jQuery('
    ', {'id': 'dashboard_templates'}).hide() + ); + + $("#dashboard_templates").load("/base_dashboard/static/src/dashboard_template.html", function(result){ + self.render_dashboard() + }); + }, + + render_dashboard: function() { + var self = this; + var data = {"layout": "layout2","data": []} + var get_column = ['first', 'second', 'third']; + var children = this.node.children; + + var action = [] + for (child in children) { + action.push({}) + var ch_widget = children[child]['children']; + for (ch in ch_widget) { + if (ch_widget[ch].tag == 'action') { +// var _act = new openerp.base.form.Action(this.view, ch_widget[ch]); +// action[child][ch] = _act.render(); + data['data'].push({ + "title": ch_widget[ch].attrs.string, + "id": ch_widget[ch].attrs.name, + "column": get_column[child], + "url": "/base_dashboard/static/data.html", + "open": true + }) + } + } + } + + var board = jQuery('#dashboard').dashboard({ + layoutClass:'layout', + json_data: data + }); + board.init(); + } +}); + +openerp.base.form.Action = openerp.base.form.Widget.extend({ + init: function(view, node) { + this._super(view, node); + this.template = "Action"; + }, + start: function() { + this._super.apply(this, arguments); + }, + + render: function(){ + return QWeb.render(this.template, {'node': this.node}); + } + +}); + +openerp.base.form.Vpaned = openerp.base.form.Widget.extend({ + init: function(view, node) { + this._super(view, node); + this.template = "Vpaned"; + }, + start: function() { + this._super.apply(this, arguments); + }, + + render: function(){ + return QWeb.render(this.template); + } +}); + +} + + diff --git a/addons/base_dashboard/static/src/xml/base_dashboard.xml b/addons/base_dashboard/static/src/xml/base_dashboard.xml new file mode 100644 index 00000000000..8d26197780c --- /dev/null +++ b/addons/base_dashboard/static/src/xml/base_dashboard.xml @@ -0,0 +1,17 @@ + \ No newline at end of file From 309493382d2105996982acaffa524255be1cb421 Mon Sep 17 00:00:00 2001 From: skh Date: Thu, 21 Apr 2011 12:09:36 +0530 Subject: [PATCH 034/306] [FIX] [PS] List view of leaves type contains different fields as the form view lp bug: https://launchpad.net/bugs/751299 fixed bzr revid: skh@tinyerp.com-20110421063936-a2k70vufxdvt3efm --- addons/hr_holidays/hr_holidays_view.xml | 28 +++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 3f3a79c45cd..1fb5ac5e7ae 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -361,12 +361,6 @@ - - - - - - @@ -396,7 +390,19 @@ - + + hr.holidays.status.leave.type.tree + hr.holidays.status + tree + + + + + + + + + hr.holidays.status.search hr.holidays.status @@ -408,19 +414,19 @@ - + Leave Type ir.actions.act_window hr.holidays.status form tree,form - + - + - + Date: Thu, 21 Apr 2011 12:50:31 +0530 Subject: [PATCH 035/306] [FIX] [PS] List view of leaves type contains different fields as the form view lp bug: https://launchpad.net/bugs/751299 fixed bzr revid: skh@tinyerp.com-20110421072031-r6l3uxk91bewcfrk --- addons/hr_holidays/hr_holidays_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 1fb5ac5e7ae..25d0deff9a4 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -394,7 +394,7 @@ hr.holidays.status.leave.type.tree hr.holidays.status tree - + 10 From c6cc93fcb0a3987c47d87038dbda6fdeff9da97f Mon Sep 17 00:00:00 2001 From: skh Date: Thu, 21 Apr 2011 17:42:26 +0530 Subject: [PATCH 036/306] [FIX] [PS] List view of leaves type contains different fields as the form view lp bug: https://launchpad.net/bugs/751299 fixed bzr revid: skh@tinyerp.com-20110421121226-40h4sahiuoydnjgt --- addons/hr_holidays/hr_holidays_view.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 25d0deff9a4..7ba9df629f3 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -390,8 +390,8 @@ - - hr.holidays.status.leave.type.tree + + hr.holidays.status.normal.tree hr.holidays.status tree 10 @@ -421,7 +421,7 @@ hr.holidays.status form tree,form - + From aba97f892a5e3a699c3074b402445af5d68724c3 Mon Sep 17 00:00:00 2001 From: "pso (OpenERP)" Date: Mon, 25 Apr 2011 17:40:48 +0530 Subject: [PATCH 037/306] [FIX] analytic_user_function: Fixed KeyError ('amount') lp bug: https://launchpad.net/bugs/768968 fixed bzr revid: pso@tinyerp.com-20110425121048-rbur3dny3ou88tpf --- .../analytic_user_function/analytic_user_function.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index 04f66fb8daa..79f3a17fdbc 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -66,7 +66,7 @@ class hr_analytic_timesheet(osv.osv): return False - def on_change_account_id(self, cr, uid, ids, account_id, user_id=False, unit_amount=0): + def on_change_account_id(self, cr, uid, ids, account_id, user_id=False, unit_amount=0.0): res = {} if not (account_id): #avoid a useless call to super @@ -98,11 +98,11 @@ class hr_analytic_timesheet(osv.osv): 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) # Compute based on pricetype - amount_unit = self.on_change_unit_amount(cr, uid, ids, - r.product_id.id, unit_amount, False, r.product_id.uom_id.id)['value']['amount'] - - amount = unit_amount * amount_unit - res ['value']['amount']= - round(amount, 2) + if unit_amount: + amount_unit = self.on_change_unit_amount(cr, uid, ids, + r.product_id.id, unit_amount, False, r.product_id.uom_id.id)['value']['amount'] + amount = unit_amount * amount_unit + res ['value']['amount']= - round(amount, 2) res ['value']['general_account_id']= a return res From ec5cbcc7857a172f302ca952650ed711254dbdb9 Mon Sep 17 00:00:00 2001 From: "pso (OpenERP)" Date: Mon, 25 Apr 2011 18:33:41 +0530 Subject: [PATCH 038/306] [IMP] analytic_user_function: Improved on_change_user_id method bzr revid: pso@tinyerp.com-20110425130341-tkjmjmeg9e76sxyg --- .../analytic_user_function/analytic_user_function.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index 79f3a17fdbc..d9d260c6940 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -106,7 +106,7 @@ class hr_analytic_timesheet(osv.osv): res ['value']['general_account_id']= a return res - def on_change_user_id(self, cr, uid, ids, user_id, account_id, unit_amount=0): + def on_change_user_id(self, cr, uid, ids, user_id, account_id, unit_amount=0.0): res = {} if not (user_id): #avoid a useless call to super @@ -133,11 +133,12 @@ class hr_analytic_timesheet(osv.osv): 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) # Compute based on pricetype - amount_unit = self.on_change_unit_amount(cr, uid, ids, - r.product_id.id, unit_amount, False, r.product_id.uom_id.id)['value']['amount'] + if unit_amount: + amount_unit = self.on_change_unit_amount(cr, uid, ids, + r.product_id.id, unit_amount, False, r.product_id.uom_id.id)['value']['amount'] - amount = unit_amount * amount_unit - res ['value']['amount']= - round(amount, 2) + amount = unit_amount * amount_unit + res ['value']['amount']= - round(amount, 2) res ['value']['general_account_id']= a return res From 3889421b1a6073e028b323624e49363209067a62 Mon Sep 17 00:00:00 2001 From: "pso (OpenERP)" Date: Mon, 25 Apr 2011 18:50:30 +0530 Subject: [PATCH 039/306] [IMP] analytic_user_function: Improvement bzr revid: pso@tinyerp.com-20110425132030-hgbb7l0j37xaje5x --- addons/analytic_user_function/analytic_user_function.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index d9d260c6940..7fbd53db3de 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -66,7 +66,7 @@ class hr_analytic_timesheet(osv.osv): return False - def on_change_account_id(self, cr, uid, ids, account_id, user_id=False, unit_amount=0.0): + def on_change_account_id(self, cr, uid, ids, account_id, user_id=False, unit_amount=0): res = {} if not (account_id): #avoid a useless call to super @@ -106,7 +106,7 @@ class hr_analytic_timesheet(osv.osv): res ['value']['general_account_id']= a return res - def on_change_user_id(self, cr, uid, ids, user_id, account_id, unit_amount=0.0): + def on_change_user_id(self, cr, uid, ids, user_id, account_id, unit_amount=0): res = {} if not (user_id): #avoid a useless call to super From eb389dcdff816670fe5d49c6b2e9d2adb99b4e1e Mon Sep 17 00:00:00 2001 From: "Ferdinand @ Camptocamp" <> Date: Tue, 26 Apr 2011 12:12:46 +0530 Subject: [PATCH 040/306] [FIX] account: invoices - missing field in tree view bzr revid: ara@tinyerp.com-20110426064246-30f8pgfpwjlhxj2y --- addons/account/account_invoice_view.xml | 1 + addons/account_payment/account_payment_view.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 43f09bebc49..fa8517a9a8c 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -123,6 +123,7 @@ + diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml index 6f7acc7a367..76197140b49 100644 --- a/addons/account_payment/account_payment_view.xml +++ b/addons/account_payment/account_payment_view.xml @@ -150,6 +150,7 @@ + @@ -291,6 +292,7 @@ + From 74ee03a36cb223d93ebf42ce82bd301479e3b52d Mon Sep 17 00:00:00 2001 From: Marco Dieckhoff Date: Tue, 26 Apr 2011 16:33:13 +0200 Subject: [PATCH 041/306] [FIX] Bug 718609 changed domain into a preselect for the "To Purchase" filter button bzr revid: dieckhoff@bksrvlinux5-20110426143313-923gtt37lwqustqn --- addons/product/product_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 83240716715..87b7f7323a3 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -13,7 +13,7 @@ - + @@ -204,7 +204,7 @@ ir.actions.act_window product.product form - [('purchase_ok','=',1)] + {"search_default_filter_to_purchase":1} Products can be purchased and/or sold. They can be raw materials, stockable products, consumables or services. The Product form contains detailed information about your products related to procurement logistics, sales price, product category, suppliers and so on. From b2a3d521faf426e6affcea10d1dee3f707065a90 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 27 Apr 2011 12:33:18 +0530 Subject: [PATCH 042/306] [FIX] account: payment term line need at least 5 to 6 digits precision bzr revid: ara@tinyerp.com-20110427070318-nq5757mhtqbay99o --- addons/account/account.py | 2 +- addons/account/data/account_data2.xml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 1dab0d077af..fec7f39d86e 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -102,7 +102,7 @@ class account_payment_term_line(osv.osv): ('fixed', 'Fixed Amount')], 'Valuation', required=True, help="""Select here the kind of valuation related to this payment term line. Note that you should have your last line with the type 'Balance' to ensure that the whole amount will be threated."""), - 'value_amount': fields.float('Value Amount', digits=(16, 6), help="For Value percent enter % ratio between 0-1."), + 'value_amount': fields.float('Value Amount', digits_compute=dp.get_precision('Payment Term'), help="For Value percent enter % ratio between 0-1."), 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \ "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."), 'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."), diff --git a/addons/account/data/account_data2.xml b/addons/account/data/account_data2.xml index 4f482b496af..4a44c726960 100644 --- a/addons/account/data/account_data2.xml +++ b/addons/account/data/account_data2.xml @@ -21,7 +21,10 @@ - + + Payment Term + 6 + From 5060d7111c0c08abd77b69c19a3777f0e3088abf Mon Sep 17 00:00:00 2001 From: "sma (Tiny)" Date: Wed, 27 Apr 2011 17:50:51 +0530 Subject: [PATCH 043/306] [IMP] Implement many2one initiall work. bzr revid: sma@tinyerp.com-20110427122051-h80fka7fqjz0fcpz --- addons/base/controllers/main.py | 6 +++ addons/base/static/src/base.html | 1 + addons/base/static/src/css/base.css | 59 +++++++++++++++++++++++++++++ addons/base/static/src/js/base.js | 1 + addons/base/static/src/js/data.js | 10 +++++ addons/base/static/src/js/form.js | 16 ++++++++ addons/base/static/src/xml/base.xml | 5 ++- addons/base/static/test/test.html | 1 + 8 files changed, 98 insertions(+), 1 deletion(-) diff --git a/addons/base/controllers/main.py b/addons/base/controllers/main.py index 8faca685300..a1560936213 100644 --- a/addons/base/controllers/main.py +++ b/addons/base/controllers/main.py @@ -420,6 +420,12 @@ class DataSet(openerpweb.Controller): r = m.default_get(fields, context) return {'result': r} + @openerpweb.jsonrequest + def name_search(self, req, model, search_str, domain=[], context={}): + m = req.session.model(model) + r = m.name_search(search_str, domain, 'ilike', context) + return {'result': r} + class View(openerpweb.Controller): def fields_view_get(self, request, model, view_id, view_type, transform=True, toolbar=False, submenu=False): diff --git a/addons/base/static/src/base.html b/addons/base/static/src/base.html index 83fbfcecefc..8d18b2f14ca 100644 --- a/addons/base/static/src/base.html +++ b/addons/base/static/src/base.html @@ -23,6 +23,7 @@ + diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index 1bd004b53f6..dc16c772785 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -779,3 +779,62 @@ body.openerp { background: url(http://placekitten.com/g/212/100) repeat; } +/* Many2one Autosearch */ + +.openerp .combo_img { + position: absolute; + margin-left: -19px; + margin-top: 3px; +} + +.openerp .autoTextResults { + position: absolute; + z-index: 1000; + background-color: #fff; + border: 1px solid #333; + display: none; + padding: 0 2px 0 2px; + min-width: 132px; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + color: #1F1F1F; + overflow: auto; +} + +.openerp table.autoTextTable { + border: none; + font-family: arial, sans-serif; + font-size: 13px; + font-style: normal; + font-variant: normal; + font-weight: normal; + width: 100%; +} + +.openerp table.autoTextTable tr.autoTextNormalRow td { +} + +.openerp table.autoTextTable tr.autoTextSelectedRow td { + background-color: DarkGray; + color: #1F1F1F; + cursor: pointer; +} + +.openerp table.autoTextTable ul{ + list-style-image:none; + list-style-type:none; +} + +.openerp table.autoTextTable td a.autoTextHighlight { + font-weight: bold; + text-decoration: none; + color: #FFF; +} + +.openerp table.autoTextTable td.autoTextHidden { + display: none; +} + +/* ------------- End autocomplete ------- */ + diff --git a/addons/base/static/src/js/base.js b/addons/base/static/src/js/base.js index 504f5ca744d..615b2c8e889 100644 --- a/addons/base/static/src/js/base.js +++ b/addons/base/static/src/js/base.js @@ -125,6 +125,7 @@ openerp.base = function(instance) { openerp.base.views(instance); openerp.base.search(instance); openerp.base.list(instance); + openerp.base.m2o(instance); openerp.base.form(instance); }; diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index a29f320b79c..79482f33430 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -118,6 +118,16 @@ openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base. ids: ids, args: args }, callback); + + }, + name_search: function (search_str, callback) { + search_str = search_str || ''; + return this.rpc('/base/dataset/name_search', { + model: this.model, + search_str: search_str, + domain: this.domain || [], + context: this.context + }, callback); }, exec_workflow: function (id, signal, callback) { return this.rpc('/base/dataset/exec_workflow', { diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index 84d7fe0babd..9a5e092b142 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -824,10 +824,24 @@ openerp.base.form.FieldSelection = openerp.base.form.Field.extend({ } }); +openerp.base.form.FieldMany2OneDatasSet = openerp.base.DataSetStatic.extend({ + start: function() { + }, + write: function (id, data, callback) { + this._super(id, data, callback); + }, +}); + openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({ init: function(view, node) { this._super(view, node); this.template = "FieldMany2One"; + this.is_field_m2o = true; + }, + start: function() { + this.$element = $('#' + this.element_id); + this.dataset = new openerp.base.form.FieldMany2OneDatasSet(this.session, this.field.relation); + new openerp.base.m2o(this.$element, this.field.relation, this.dataset) }, set_value: function(value) { this._super.apply(this, arguments); @@ -837,6 +851,8 @@ openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({ this.value = value[0]; } this.$element.find('input').val(show_value); + // Need to replace this `text` with original `id` after discuss with xmo + this.$element.find('input').attr('text', this.value); } }); diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml index b49ef2c7d6a..c59229511a9 100644 --- a/addons/base/static/src/xml/base.xml +++ b/addons/base/static/src/xml/base.xml @@ -257,7 +257,7 @@
    + +
    diff --git a/addons/base/static/test/test.html b/addons/base/static/test/test.html index 5fcf4f4c594..b71e8231bd7 100644 --- a/addons/base/static/test/test.html +++ b/addons/base/static/test/test.html @@ -21,6 +21,7 @@ + - + + + @@ -34,6 +37,7 @@ + + + + + +Please, check your console for results + + + + diff --git a/addons/base/static/lib/qweb/qweb-benchmark.xml b/addons/base/static/lib/qweb/qweb-benchmark.xml new file mode 100644 index 00000000000..124f420e2cd --- /dev/null +++ b/addons/base/static/lib/qweb/qweb-benchmark.xml @@ -0,0 +1,61 @@ + + + + +
    +
    + x +

    title

    +

    text

    +
    +
    + x + +

    title

    +

    text

    +
    +
    + + d.iter = 'one,two,three,four,five'.split(',') + + + + + + + + 1 + true +
    +
    + + height: 200px; border: 1px solid red; +
    + + * : + + Ok this is good ! + Hi there ! + [] + + + () + +
    +
    +
    + x +

    title

    +

    text

    +
    +
    + + +
    + x + +

    Here's your value : () !!

    +
    +
    + + From ff691a34b5b25ff2365ac8c0ba451757c50cfbf8 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 4 May 2011 16:05:35 +0200 Subject: [PATCH 117/306] [ADD] sorting support in list views * Fix sorting in DataSet.do_search_read (would not fix ordering of read results, yielding a semi-random order instead of the one returned by search) * Add sort parameter support to ListView.fill() * Improve handling of sort parameter on DataSetSearch - Queue up fields to sort on (most important last) by calling 'dataset.sort(fieldname)' repeatedly - Get back a sort string fit for sending to OpenERP (server) by calling 'dataset.sort()' (without arguments) * Adds sorting on list view by clicking on headers bzr revid: xmo@openerp.com-20110504140535-ydj8zs33lt0dgcwy --- addons/base/controllers/main.py | 16 +++++++++----- addons/base/static/src/js/data.js | 33 +++++++++++++++++++++++++++-- addons/base/static/src/js/list.js | 10 ++++++++- addons/base/static/src/xml/base.xml | 2 +- 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/addons/base/controllers/main.py b/addons/base/controllers/main.py index 8faca685300..424313bc6d2 100644 --- a/addons/base/controllers/main.py +++ b/addons/base/controllers/main.py @@ -346,12 +346,17 @@ class DataSet(openerpweb.Controller): :rtype: list """ Model = request.session.model(model) + ids = Model.search(domain or [], offset or 0, limit or False, sort or False, request.context) + if fields and fields == ['id']: # shortcut read if we only want the ids return map(lambda id: {'id': id}, ids) - return Model.read(ids, fields or False, request.context) + + reads = Model.read(ids, fields or False, request.context) + reads.sort(key=lambda obj: ids.index(obj['id'])) + return reads @openerpweb.jsonrequest def get(self, request, model, ids, fields=False): @@ -556,11 +561,11 @@ class ListView(View): @openerpweb.jsonrequest def fill(self, request, model, id, domain, - offset=0, limit=False): - return self.do_fill(request, model, id, domain, offset, limit) + offset=0, limit=False, sort=None): + return self.do_fill(request, model, id, domain, offset, limit, sort) def do_fill(self, request, model, id, domain, - offset=0, limit=False): + offset=0, limit=False, sort=None): """ Returns all information needed to fill a table: * view with processed ``editable`` flag @@ -580,9 +585,10 @@ class ListView(View): """ view = self.fields_view_get(request, model, id, toolbar=True) + print sort rows = DataSet().do_search_read(request, model, offset=offset, limit=limit, - domain=domain) + domain=domain, sort=sort) eval_context = request.session.evaluation_context( request.context) return { diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index 6d566f4de0a..c7c129e7fec 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -144,7 +144,7 @@ openerp.base.DataSetSearch = openerp.base.DataSet.extend({ init: function(session, model) { this._super(session, model); this.domain = []; - this.sort = []; + this._sort = []; this.offset = 0; // subset records[offset:offset+limit] // is it necessary ? @@ -166,7 +166,7 @@ openerp.base.DataSetSearch = openerp.base.DataSet.extend({ fields: fields, domain: this.domain, context: this.context, - sort: this.sort, + sort: this.sort(), offset: offset, limit: limit }, function (records) { @@ -177,6 +177,35 @@ openerp.base.DataSetSearch = openerp.base.DataSet.extend({ } callback(records); }); + }, + /** + * Reads or changes sort criteria on the dataset. + * + * If not provided with any argument, serializes the sort criteria to + * an SQL-like form usable by OpenERP's ORM. + * + * If given a field, will set that field as first sorting criteria or, + * if the field is already the first sorting criteria, will reverse it. + * + * @param {String} [field] field to sort on, reverses it (toggle from ASC to DESC) if already the main sort criteria + * @param {Boolean} [force_reverse=false] forces inserting the field as DESC + * @returns {String|undefined} + */ + sort: function (field, force_reverse) { + if (!field) { + return _.map(this._sort, function (criteria) { + if (criteria[0] === '-') { + return criteria.slice(1) + ' DESC'; + } + return criteria; + }).join(', '); + } + + var reverse = force_reverse || (this._sort[0] === field); + this._sort = _.without(this._sort, field, '-' + field); + + this._sort.unshift((reverse ? '-' : '') + field); + return undefined; } }); diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index cc84efa65f2..308b73f8925 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -130,6 +130,13 @@ openerp.base.ListView = openerp.base.Controller.extend( this.$element.find('#oe-list-delete') .hide() .click(this.do_delete_selected); + this.$element.find('thead').delegate('th[data-id]', 'click', function (e) { + e.stopPropagation(); + + self.dataset.sort($(this).data('id')); + + self.do_reload(); + }); var $table = this.$element.find('table'); // Cell events @@ -318,7 +325,8 @@ openerp.base.ListView = openerp.base.Controller.extend( 'model': this.dataset.model, 'id': this.view_id, 'context': this.dataset.context, - 'domain': this.dataset.domain + 'domain': this.dataset.domain, + 'sort': this.dataset.sort && this.dataset.sort() }, this.do_fill_table); }, /** diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml index ef4cbba46b0..b2b2bd7d2c4 100644 --- a/addons/base/static/src/xml/base.xml +++ b/addons/base/static/src/xml/base.xml @@ -181,7 +181,7 @@
    - + From d133fde981eb19e911c407afdfe09667bb736962 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 4 May 2011 16:38:40 +0200 Subject: [PATCH 118/306] [IMP] QWeb2 optimization bzr revid: fme@openerp.com-20110504143840-gl3lypjt4n85ixpm --- .../base/static/lib/qweb/qweb-benchmark.html | 1 + .../base/static/lib/qweb/qweb-benchmark.xml | 3 +- addons/base/static/lib/qweb/qweb2.js | 65 ++++++++++--------- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/addons/base/static/lib/qweb/qweb-benchmark.html b/addons/base/static/lib/qweb/qweb-benchmark.html index 2863d3e551a..0cc67e7e54f 100644 --- a/addons/base/static/lib/qweb/qweb-benchmark.html +++ b/addons/base/static/lib/qweb/qweb-benchmark.html @@ -16,6 +16,7 @@ console.time("Load template with QWeb2"); var engine = new QWeb2.Engine("qweb-benchmark.xml") + engine.debug = true; console.timeEnd("Load template with QWeb2") var iter = 1000; diff --git a/addons/base/static/lib/qweb/qweb-benchmark.xml b/addons/base/static/lib/qweb/qweb-benchmark.xml index 124f420e2cd..71452572e51 100644 --- a/addons/base/static/lib/qweb/qweb-benchmark.xml +++ b/addons/base/static/lib/qweb/qweb-benchmark.xml @@ -2,8 +2,7 @@ - -
    +
    x

    title

    diff --git a/addons/base/static/lib/qweb/qweb2.js b/addons/base/static/lib/qweb/qweb2.js index cd72c2579f5..4343e10923f 100644 --- a/addons/base/static/lib/qweb/qweb2.js +++ b/addons/base/static/lib/qweb/qweb2.js @@ -20,8 +20,8 @@ var QWeb2 = { } throw prefix + ": " + message; }, - js_escape: function(s) { - return "'" + s.replace(/\r?\n/g, "\\n").replace(/'/g, "\\'") + "'"; + js_escape: function(s, noquotes) { + return (noquotes ? '' : "'") + s.replace(/\r?\n/g, "\\n").replace(/'/g, "\\'") + (noquotes ? '' : "'"); }, html_escape: function(s, attribute) { if (s === null || s === undefined) { @@ -143,6 +143,7 @@ QWeb2.Engine = (function() { function Engine() { // TODO: handle prefix at template level : t-prefix="x" this.prefix = 't'; + this.debug = false; this.templates_resources = []; // TODO: implement this.reload() this.templates = {}; this.compiled_templates = {}; @@ -312,6 +313,34 @@ QWeb2.Element = (function() { QWeb2.tools.extend(Element.prototype, { compile : function() { + var r = [], + instring = false, + lines = this._compile().split('\n'); + for (var i = 0, ilen = lines.length; i < ilen; i++) { + var m, line = lines[i]; + if (m = line.match(/^(\s*)\/\/@string=(.*)/)) { + if (instring) { + if (this.engine.debug) { + // Split string lines in indented r.push arguments + r.push((m[2].indexOf("\\n") != -1 ? "',\n\t" + m[1] + "'" : '') + m[2]); + } else { + r.push(m[2]); + } + } else { + r.push(m[1] + "r.push('" + m[2]); + instring = true; + } + } else { + if (instring) { + r.push("');\n"); + } + instring = false; + r.push(line + '\n'); + } + } + return r.join(''); + }, + _compile : function() { switch (this.node.nodeType) { case 3: case 4: @@ -320,15 +349,15 @@ QWeb2.Element = (function() { case 1: this.compile_element(); } - var r = this.flatten_output(this._top); + var r = this._top.join(''); if (this.process_children) { for (var i = 0, ilen = this.children.length; i < ilen; i++) { var child = this.children[i]; child._indent = this._indent; - r += child.compile(); + r += child._compile(); } } - r += this.flatten_output(this._bottom); + r += this._bottom.join(''); return r; }, format_expression : function(e) { @@ -407,39 +436,17 @@ QWeb2.Element = (function() { get_indent : function() { return new Array(this._indent + 1).join("\t"); }, - flatten_output : function(out) { - var r = ''; - for (var i = 0, ilen = out.length; i < ilen; i++) { - var val = out[i]; - if (val.constructor === Array) { - r += val[0] + "r.push(" + this.engine.tools.js_escape(val[1]) + ");\n"; - } else { - r += val; - } - } - return r; - }, top : function(s) { return this._top.push(this.get_indent() + s + '\n'); }, top_string : function(s) { - var top = this._top; - if (top.length && top[top.length - 1].constructor === Array) { - return top[top.length - 1][1] += s; - } else { - return top.push([this.get_indent(), s]); - } + return this._top.push(this.get_indent() + "//@string=" + this.engine.tools.js_escape(s, true) + '\n'); }, bottom : function(s) { return this._bottom.unshift(this.get_indent() + s + '\n'); }, bottom_string : function(s) { - var bottom = this._bottom; - if (bottom.length && bottom[0].constructor === Array) { - return bottom[0][1] += s; - } else { - return bottom.unshift([this.get_indent(), s]); - } + return this._bottom.unshift(this.get_indent() + "//@string=" + this.engine.tools.js_escape(s, true) + '\n'); }, compile_element : function() { for (var i = 0, ilen = QWeb2.actions_precedence.length; i < ilen; i++) { From 075902f5c2b0febd70adf5209b4eef2cfb0813b8 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 4 May 2011 16:47:53 +0200 Subject: [PATCH 119/306] [IMP] make sortable columns look sortable (and sorted) a bit bzr revid: xmo@openerp.com-20110504144753-zemygt44re3o8z0m --- addons/base/controllers/main.py | 10 ++++++++++ addons/base/static/src/css/base.css | 5 +++++ addons/base/static/src/js/data.js | 2 +- addons/base/static/src/js/list.js | 3 +++ addons/base/static/src/xml/base.xml | 4 +++- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/addons/base/controllers/main.py b/addons/base/controllers/main.py index 424313bc6d2..085e48d89e0 100644 --- a/addons/base/controllers/main.py +++ b/addons/base/controllers/main.py @@ -591,6 +591,16 @@ class ListView(View): domain=domain, sort=sort) eval_context = request.session.evaluation_context( request.context) + + if sort: + sort_criteria = sort.split(',')[0].split(' ') + print sort, sort_criteria + view['sorted'] = { + 'field': sort_criteria[0], + 'reversed': sort_criteria[1] == 'DESC' + } + else: + view['sorted'] = {} return { 'view': view, 'records': [ diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index 1bd004b53f6..43021e32bc6 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -485,6 +485,11 @@ body.openerp { .openerp .oe-listview td, .openerp .oe-listview th { vertical-align: middle; + text-align: left; +} +.openerp .oe-listview th.oe-sortable, +.openerp .oe-listview th.oe-sortable .ui-icon { + cursor: pointer; } .openerp .oe-listview .oe-field-cell { diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index c7c129e7fec..da0f18001a8 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -197,7 +197,7 @@ openerp.base.DataSetSearch = openerp.base.DataSet.extend({ if (criteria[0] === '-') { return criteria.slice(1) + ' DESC'; } - return criteria; + return criteria + ' ASC'; }).join(', '); } diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index 308b73f8925..e9061fa7121 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -123,6 +123,8 @@ openerp.base.ListView = openerp.base.Controller.extend( this.visible_columns = _.filter(this.columns, function (column) { return column.invisible !== '1'; }); + + if (!this.fields_view.sorted) { this.fields_view.sorted = {}; } this.$element.html(QWeb.render("ListView", this)); // Head hook @@ -135,6 +137,7 @@ openerp.base.ListView = openerp.base.Controller.extend( self.dataset.sort($(this).data('id')); + // TODO: should only reload content (and set the right column to a sorted display state) self.do_reload(); }); diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml index b2b2bd7d2c4..bcd8db9444f 100644 --- a/addons/base/static/src/xml/base.xml +++ b/addons/base/static/src/xml/base.xml @@ -181,9 +181,11 @@
    - + +
    ', { + "name": "create_m2o" + this.name, + "id": "create_m2o" + this.name}); + var $tbl = jQuery('').appendTo($DiaTable); + var onClick = jQuery.proxy(this, 'getOnclick'); + + jQuery('').append( + jQuery('', {'class':'create_m2o'}).append( + jQuery('').appendTo($table); - - var rendered = $.Deferred(); - var render_body = function () { - setTimeout(function () { - $body.append( - QWeb.render("ListView.rows", { - columns: columns, - rows: rows.slice(body*PAGE_SIZE, (body+1)*PAGE_SIZE), - options: options - })); - ++body; - if (body < bodies_count) { - render_body(); - } else { - rendered.resolve(); - } - }, 0); - }; - render_body(); - - return rendered.promise().then(function () { - $old_body.remove(); - }); + this.list.refresh(); }, /** * Used to handle a click on a table row, if no other handler caught the @@ -383,10 +353,43 @@ openerp.base.ListView = openerp.base.Controller.extend( * Handles deletion of all selected lines */ do_delete_selected: function () { - var selection = this.get_selection(); + var selection = this.list.get_selection(); if (selection.length) { this.dataset.unlink(selection); } + } + // TODO: implement reorder (drag and drop rows) +}); +_.extend(openerp.base.ListView.prototype, openerp.base.ActionExecutor); + +openerp.base.ListView.List = Class.extend({ + init: function (opts) { + var self = this; + // columns, rows, options + + this.options = opts.options; + this.columns = opts.columns; + this.rows = opts.rows; + + this.$_element = $('') + .appendTo(document.body) + .delegate('th.oe-record-selector', 'click', function (e) { + e.stopImmediatePropagation(); + $(self).trigger('selected', [self.get_selection()]); + }); + }, + move_to: function (element) { + this.$current = this.$_element.clone(true).appendTo(element); + this.render(); + return this; + }, + render: function () { + this.$current.empty().append($(QWeb.render('ListView.rows', this))); + return this; + }, + refresh: function () { + this.render(); + return this; }, /** * Gets the ids of all currently selected records, if any @@ -397,15 +400,15 @@ openerp.base.ListView = openerp.base.Controller.extend( return []; } var rows = this.rows; - return this.$element.find('th.oe-record-selector input:checked') + return this.$current.find('th.oe-record-selector input:checked') .closest('tr').map(function () { return rows[$(this).prevAll().length].data.id.value; }).get(); } - // TODO: implement sort (click on column headers), if sorted, the list can not be reordered anymore - // TODO: implement reorder (drag and drop rows) + // Click events: action, delete, row itself + // drag and drop + // editable? }); -_.extend(openerp.base.ListView.prototype, openerp.base.ActionExecutor); openerp.base.TreeView = openerp.base.Controller.extend({ }); From abad28af0ddf6955b0b7d36bfbd23cf9f3f4ce8a Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 6 May 2011 14:33:51 +0200 Subject: [PATCH 150/306] [FIX] l10n_be: fixed reference to chart.template bzr revid: qdp-launchpad@openerp.com-20110506123351-f2e7easypso96hb6 --- addons/l10n_be/account_tax_template.xml | 450 ++++++++++++------------ 1 file changed, 225 insertions(+), 225 deletions(-) diff --git a/addons/l10n_be/account_tax_template.xml b/addons/l10n_be/account_tax_template.xml index 33fa9583b65..a4d42779a97 100644 --- a/addons/l10n_be/account_tax_template.xml +++ b/addons/l10n_be/account_tax_template.xml @@ -22,7 +22,7 @@ 1 - + 11 @@ -43,7 +43,7 @@ 1 - + 20 @@ -64,7 +64,7 @@ 1 - + 21 @@ -85,7 +85,7 @@ 1 - + 30 @@ -106,7 +106,7 @@ 1 - + 31 @@ -127,7 +127,7 @@ 1 - + 40 @@ -144,7 +144,7 @@ 1 1 - + 41 @@ -161,7 +161,7 @@ 1 1 - + 50 @@ -178,7 +178,7 @@ 1 1 - + 60 @@ -195,7 +195,7 @@ 1 1 - + 61 @@ -212,7 +212,7 @@ 1 1 - + 62 @@ -229,7 +229,7 @@ 1 1 - + 70 @@ -246,7 +246,7 @@ 1 1 - + 110 @@ -261,7 +261,7 @@ 1 1 - + 111 @@ -283,7 +283,7 @@ 1 - + 112 @@ -300,7 +300,7 @@ -1 1 - + 120 @@ -315,7 +315,7 @@ 1 1 - + 121 @@ -337,7 +337,7 @@ 1 - + 122 @@ -354,7 +354,7 @@ -1 1 - + 130 @@ -369,7 +369,7 @@ 1 1 - + 131 @@ -391,7 +391,7 @@ 1 - + 132 @@ -408,7 +408,7 @@ -1 1 - + 140 @@ -423,7 +423,7 @@ 1 1 - + 141 @@ -441,7 +441,7 @@ 1 1 - + 142 @@ -458,7 +458,7 @@ -1 1 - + 210 @@ -473,7 +473,7 @@ 1 1 - + 211 @@ -495,7 +495,7 @@ 1 - + 212 @@ -512,7 +512,7 @@ -1 1 - + 220 @@ -527,7 +527,7 @@ 1 1 - + 221 @@ -549,7 +549,7 @@ 1 - + 222 @@ -566,7 +566,7 @@ -1 1 - + 230 @@ -581,7 +581,7 @@ 1 1 - + 231 @@ -603,7 +603,7 @@ 1 - + 232 @@ -620,7 +620,7 @@ -1 1 - + 240 @@ -635,7 +635,7 @@ 1 1 - + 241 @@ -657,7 +657,7 @@ 1 - + 242 @@ -674,7 +674,7 @@ -1 1 - + 250 @@ -689,7 +689,7 @@ 1 1 - + 251 @@ -711,7 +711,7 @@ 1 - + 252 @@ -728,7 +728,7 @@ -1 1 - + 260 @@ -743,7 +743,7 @@ 1 1 - + 261 @@ -765,7 +765,7 @@ 1 - + 262 @@ -782,7 +782,7 @@ -1 1 - + 270 @@ -797,7 +797,7 @@ 1 1 - + 271 @@ -815,7 +815,7 @@ 1 1 - + 272 @@ -832,7 +832,7 @@ -1 1 - + 280 @@ -847,7 +847,7 @@ 1 1 - + 281 @@ -865,7 +865,7 @@ 1 1 - + 282 @@ -882,7 +882,7 @@ -1 1 - + 310 @@ -897,7 +897,7 @@ 1 1 - + 311 @@ -919,7 +919,7 @@ 1 - + 312 @@ -936,7 +936,7 @@ -1 1 - + 320 @@ -951,7 +951,7 @@ 1 1 - + 321 @@ -973,7 +973,7 @@ 1 - + 322 @@ -990,7 +990,7 @@ -1 1 - + 330 @@ -1005,7 +1005,7 @@ 1 1 - + 331 @@ -1027,7 +1027,7 @@ 1 - + 332 @@ -1044,7 +1044,7 @@ -1 1 - + 340 @@ -1059,7 +1059,7 @@ 1 1 - + 341 @@ -1077,7 +1077,7 @@ 1 1 - + 342 @@ -1094,7 +1094,7 @@ -1 1 - + 410 @@ -1109,7 +1109,7 @@ 1 1 - + 411 @@ -1130,7 +1130,7 @@ 1 1 - + 412 @@ -1151,7 +1151,7 @@ -1 1 - + 413 @@ -1168,7 +1168,7 @@ -1 1 - + 420 @@ -1183,7 +1183,7 @@ 1 1 - + 421 @@ -1204,7 +1204,7 @@ 1 1 - + 422 @@ -1225,7 +1225,7 @@ -1 1 - + 423 @@ -1242,7 +1242,7 @@ -1 1 - + 430 @@ -1257,7 +1257,7 @@ 1 1 - + 431 @@ -1278,7 +1278,7 @@ 1 1 - + 432 @@ -1299,7 +1299,7 @@ -1 1 - + 433 @@ -1316,7 +1316,7 @@ -1 1 - + 440 @@ -1331,7 +1331,7 @@ 1 1 - + 441 @@ -1351,7 +1351,7 @@ 1 1 - + 442 @@ -1371,7 +1371,7 @@ -1 1 - + 443 @@ -1388,7 +1388,7 @@ -1 1 - + 510 @@ -1403,7 +1403,7 @@ 1 1 - + 511 @@ -1424,7 +1424,7 @@ 1 1 - + 512 @@ -1445,7 +1445,7 @@ -1 1 - + 512 @@ -1462,7 +1462,7 @@ -1 1 - + 520 @@ -1477,7 +1477,7 @@ 1 1 - + 521 @@ -1498,7 +1498,7 @@ 1 1 - + 522 @@ -1519,7 +1519,7 @@ -1 1 - + 523 @@ -1536,7 +1536,7 @@ -1 1 - + 530 @@ -1551,7 +1551,7 @@ 1 1 - + 531 @@ -1572,7 +1572,7 @@ 1 1 - + 532 @@ -1593,7 +1593,7 @@ -1 1 - + 533 @@ -1610,7 +1610,7 @@ -1 1 - + 540 @@ -1625,7 +1625,7 @@ 1 1 - + 541 @@ -1645,7 +1645,7 @@ 1 1 - + 542 @@ -1665,7 +1665,7 @@ -1 1 - + 543 @@ -1682,7 +1682,7 @@ -1 1 - + 610 @@ -1697,7 +1697,7 @@ 1 1 - + 611 @@ -1718,7 +1718,7 @@ 1 1 - + 612 @@ -1739,7 +1739,7 @@ -1 1 - + 613 @@ -1756,7 +1756,7 @@ -1 1 - + 620 @@ -1771,7 +1771,7 @@ 1 1 - + 621 @@ -1792,7 +1792,7 @@ 1 1 - + 622 @@ -1813,7 +1813,7 @@ -1 1 - + 623 @@ -1830,7 +1830,7 @@ -1 1 - + 630 @@ -1845,7 +1845,7 @@ 1 1 - + 631 @@ -1866,7 +1866,7 @@ 1 1 - + 632 @@ -1887,7 +1887,7 @@ -1 1 - + 633 @@ -1904,7 +1904,7 @@ -1 1 - + 640 @@ -1919,7 +1919,7 @@ 1 1 - + 641 @@ -1939,7 +1939,7 @@ 1 1 - + 642 @@ -1959,7 +1959,7 @@ -1 1 - + 643 @@ -1976,7 +1976,7 @@ -1 1 - + 710 @@ -1991,7 +1991,7 @@ 1 1 - + 711 @@ -2013,7 +2013,7 @@ 1 - + 712 @@ -2030,7 +2030,7 @@ -1 1 - + 720 @@ -2045,7 +2045,7 @@ 1 1 - + 721 @@ -2065,7 +2065,7 @@ 1 - + 722 @@ -2085,7 +2085,7 @@ 1 - + 723 @@ -2102,7 +2102,7 @@ -1 1 - + 1110 @@ -2117,7 +2117,7 @@ 1 1 - + 1111 @@ -2138,7 +2138,7 @@ 1 1 - + 1112 @@ -2159,7 +2159,7 @@ -1 1 - + 1113 @@ -2176,7 +2176,7 @@ -1 1 - + 1120 @@ -2191,7 +2191,7 @@ 1 1 - + 1121 @@ -2212,7 +2212,7 @@ 1 1 - + 1122 @@ -2233,7 +2233,7 @@ -1 1 - + 1123 @@ -2250,7 +2250,7 @@ -1 1 - + 1130 @@ -2265,7 +2265,7 @@ 1 1 - + 1131 @@ -2286,7 +2286,7 @@ 1 1 - + 1132 @@ -2307,7 +2307,7 @@ -1 1 - + 1133 @@ -2324,7 +2324,7 @@ -1 1 - + 1140 @@ -2339,7 +2339,7 @@ 1 1 - + 1141 @@ -2357,7 +2357,7 @@ 1 1 - + 1142 @@ -2375,7 +2375,7 @@ -1 1 - + 1143 @@ -2392,7 +2392,7 @@ -1 1 - + 1210 @@ -2407,7 +2407,7 @@ 1 1 - + 1211 @@ -2428,7 +2428,7 @@ 1 1 - + 1212 @@ -2449,7 +2449,7 @@ -1 1 - + 1213 @@ -2466,7 +2466,7 @@ -1 1 - + 1220 @@ -2481,7 +2481,7 @@ 1 1 - + 1221 @@ -2502,7 +2502,7 @@ 1 1 - + 1222 @@ -2523,7 +2523,7 @@ -1 1 - + 1223 @@ -2540,7 +2540,7 @@ -1 1 - + 1230 @@ -2555,7 +2555,7 @@ 1 1 - + 1231 @@ -2576,7 +2576,7 @@ 1 1 - + 1232 @@ -2597,7 +2597,7 @@ -1 1 - + 1233 @@ -2614,7 +2614,7 @@ -1 1 - + 1240 @@ -2629,7 +2629,7 @@ 1 1 - + 1241 @@ -2650,7 +2650,7 @@ 1 1 - + 1242 @@ -2671,7 +2671,7 @@ -1 1 - + 1243 @@ -2688,7 +2688,7 @@ -1 1 - + 1250 @@ -2703,7 +2703,7 @@ 1 1 - + 1251 @@ -2724,7 +2724,7 @@ 1 1 - + 1252 @@ -2745,7 +2745,7 @@ -1 1 - + 1253 @@ -2762,7 +2762,7 @@ -1 1 - + 1260 @@ -2777,7 +2777,7 @@ 1 1 - + 1261 @@ -2798,7 +2798,7 @@ 1 1 - + 1262 @@ -2819,7 +2819,7 @@ -1 1 - + 1263 @@ -2836,7 +2836,7 @@ -1 1 - + 1270 @@ -2851,7 +2851,7 @@ 1 1 - + 1271 @@ -2869,7 +2869,7 @@ 1 1 - + 1272 @@ -2887,7 +2887,7 @@ -1 1 - + 1273 @@ -2904,7 +2904,7 @@ -1 1 - + 1280 @@ -2919,7 +2919,7 @@ 1 1 - + 1281 @@ -2937,7 +2937,7 @@ 1 1 - + 1282 @@ -2955,7 +2955,7 @@ -1 1 - + 1283 @@ -2972,7 +2972,7 @@ -1 1 - + 1310 @@ -2987,7 +2987,7 @@ 1 1 - + 1311 @@ -3008,7 +3008,7 @@ 1 1 - + 1312 @@ -3029,7 +3029,7 @@ -1 1 - + 1313 @@ -3046,7 +3046,7 @@ -1 1 - + 1320 @@ -3061,7 +3061,7 @@ 1 1 - + 1321 @@ -3082,7 +3082,7 @@ 1 1 - + 1322 @@ -3103,7 +3103,7 @@ -1 1 - + 1323 @@ -3120,7 +3120,7 @@ -1 1 - + 1330 @@ -3135,7 +3135,7 @@ 1 1 - + 1331 @@ -3156,7 +3156,7 @@ 1 1 - + 1332 @@ -3177,7 +3177,7 @@ -1 1 - + 1333 @@ -3194,7 +3194,7 @@ -1 1 - + 1340 @@ -3209,7 +3209,7 @@ 1 1 - + 1341 @@ -3227,7 +3227,7 @@ 1 1 - + 1342 @@ -3245,7 +3245,7 @@ -1 1 - + 1343 @@ -3262,7 +3262,7 @@ -1 1 - + 2110 @@ -3277,7 +3277,7 @@ 1 1 - + 2111 @@ -3298,7 +3298,7 @@ 1 1 - + 2112 @@ -3319,7 +3319,7 @@ -1 1 - + 2113 @@ -3336,7 +3336,7 @@ -1 1 - + 2120 @@ -3351,7 +3351,7 @@ 1 1 - + 2121 @@ -3372,7 +3372,7 @@ 1 1 - + 2122 @@ -3393,7 +3393,7 @@ -1 1 - + 2123 @@ -3410,7 +3410,7 @@ -1 1 - + 2130 @@ -3425,7 +3425,7 @@ 1 1 - + 2131 @@ -3446,7 +3446,7 @@ 1 1 - + 2132 @@ -3467,7 +3467,7 @@ -1 1 - + 2133 @@ -3484,7 +3484,7 @@ -1 1 - + 2140 @@ -3499,7 +3499,7 @@ 1 1 - + 2141 @@ -3517,7 +3517,7 @@ 1 1 - + 2142 @@ -3534,7 +3534,7 @@ -1 1 - + 2210 @@ -3549,7 +3549,7 @@ 1 1 - + 2211 @@ -3570,7 +3570,7 @@ 1 1 - + 2212 @@ -3591,7 +3591,7 @@ -1 1 - + 2213 @@ -3608,7 +3608,7 @@ -1 1 - + 2220 @@ -3623,7 +3623,7 @@ 1 1 - + 2221 @@ -3644,7 +3644,7 @@ 1 1 - + 2222 @@ -3665,7 +3665,7 @@ -1 1 - + 2223 @@ -3682,7 +3682,7 @@ -1 1 - + 2230 @@ -3697,7 +3697,7 @@ 1 1 - + 2231 @@ -3718,7 +3718,7 @@ 1 1 - + 2232 @@ -3739,7 +3739,7 @@ -1 1 - + 2233 @@ -3756,7 +3756,7 @@ -1 1 - + 2240 @@ -3771,7 +3771,7 @@ 1 1 - + 2241 @@ -3789,7 +3789,7 @@ 1 1 - + 2242 @@ -3806,7 +3806,7 @@ -1 1 - + 2310 @@ -3821,7 +3821,7 @@ 1 1 - + 2311 @@ -3842,7 +3842,7 @@ 1 1 - + 2312 @@ -3863,7 +3863,7 @@ -1 1 - + 2313 @@ -3880,7 +3880,7 @@ -1 1 - + 2320 @@ -3895,7 +3895,7 @@ 1 1 - + 2321 @@ -3916,7 +3916,7 @@ 1 1 - + 2322 @@ -3937,7 +3937,7 @@ -1 1 - + 2323 @@ -3954,7 +3954,7 @@ -1 1 - + 2330 @@ -3969,7 +3969,7 @@ 1 1 - + 2331 @@ -3990,7 +3990,7 @@ 1 1 - + 2332 @@ -4011,7 +4011,7 @@ -1 1 - + 2333 @@ -4028,7 +4028,7 @@ -1 1 - + 2340 @@ -4043,7 +4043,7 @@ 1 1 - + 2341 @@ -4061,7 +4061,7 @@ 1 1 - + 2342 @@ -4078,7 +4078,7 @@ -1 1 - + From 6a56370799355822a55801f8b4817bce9f99fdb0 Mon Sep 17 00:00:00 2001 From: Noviat <> Date: Fri, 6 May 2011 14:36:01 +0200 Subject: [PATCH 151/306] [IMP] l10n_be: added fiscal position mapping for tax from Noviat bzr revid: qdp-launchpad@openerp.com-20110506123601-eecv6qi4y3hv1f0u --- addons/l10n_be/__openerp__.py | 1 + .../account_fiscal_position_tax_template.xml | 228 ++++++++++++++++++ addons/l10n_be/fiscal_templates.xml | 118 --------- 3 files changed, 229 insertions(+), 118 deletions(-) create mode 100644 addons/l10n_be/account_fiscal_position_tax_template.xml diff --git a/addons/l10n_be/__openerp__.py b/addons/l10n_be/__openerp__.py index b8034033a4d..6fd486f06fb 100644 --- a/addons/l10n_be/__openerp__.py +++ b/addons/l10n_be/__openerp__.py @@ -60,6 +60,7 @@ Wizards provided by this module: 'wizard/l10n_be_partner_vat_listing.xml', 'l10n_be_sequence.xml', 'fiscal_templates.xml', + 'account_fiscal_position_tax_template.xml', 'security/ir.model.access.csv' ], 'demo_xml': [], diff --git a/addons/l10n_be/account_fiscal_position_tax_template.xml b/addons/l10n_be/account_fiscal_position_tax_template.xml new file mode 100644 index 00000000000..d595e3fbe82 --- /dev/null +++ b/addons/l10n_be/account_fiscal_position_tax_template.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/l10n_be/fiscal_templates.xml b/addons/l10n_be/fiscal_templates.xml index e40cd6a3a1b..5e26a7e67c1 100644 --- a/addons/l10n_be/fiscal_templates.xml +++ b/addons/l10n_be/fiscal_templates.xml @@ -19,125 +19,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 7382bf94039776f775593173ff787fe13b4bc69b Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 6 May 2011 14:49:10 +0200 Subject: [PATCH 152/306] [FIX] l10n_be: cleaned a little the COA bzr revid: qdp-launchpad@openerp.com-20110506124910-63z6gk81x9n1iejf --- addons/l10n_be/account_pcmn_belgium.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/l10n_be/account_pcmn_belgium.xml b/addons/l10n_be/account_pcmn_belgium.xml index 9650a37c549..2f5d2c67b9d 100644 --- a/addons/l10n_be/account_pcmn_belgium.xml +++ b/addons/l10n_be/account_pcmn_belgium.xml @@ -3109,6 +3109,15 @@ + + T.V.A Déductible + 411059 + other + + + + + From 014fdf0068dc159c188f79896b769fdfdc711d50 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 9 May 2011 10:22:12 +0200 Subject: [PATCH 160/306] [IMP] move most of the clicking-on-a-list-row logic in ListView.List bzr revid: xmo@openerp.com-20110509082212-rg8rnlsheh1gvsk5 --- addons/base/static/src/js/list.js | 41 ++++++++++--------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index 502b3f331a0..62d29da0cba 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -78,6 +78,9 @@ openerp.base.ListView = openerp.base.Controller.extend( self.execute_action( action, self.dataset, self.session.action_manager, id, self.do_reload); + }, + 'row_link': function (e, index) { + self.switch_to_record(index); } }); @@ -174,9 +177,6 @@ openerp.base.ListView = openerp.base.Controller.extend( var $table = this.$element.find('table'); this.list.move_to($table); - // Global rows handlers - $table.delegate('tr', 'click', this.on_select_row); - // sidebar stuff if (this.view_manager && this.view_manager.sidebar) { this.view_manager.sidebar.set_toolbar(data.fields_view.toolbar); @@ -242,30 +242,6 @@ openerp.base.ListView = openerp.base.Controller.extend( } }, this)); }, - /** - * Base handler for clicking on a row, discovers the index of the record - * corresponding to the clicked row in the list view's dataset. - * - * Should not be overridden, use - * :js:func:`~openerp.base.ListView.switch_to_record` to customize the - * behavior of the list view when clicking on a row instead. - * - * @param {Object} event jQuery DOM event object - */ - on_select_row: function (event) { - var $target = $(event.currentTarget); - if (!$target.parent().is('tbody')) { - return; - } - // count number of preceding siblings to line clicked - var row = this.rows[$target.prevAll().length]; - - var index = _.indexOf(this.dataset.ids, row.data.id.value); - if (index == undefined || index === -1) { - return; - } - this.switch_to_record(index); - }, do_show: function () { this.$element.show(); if (this.hidden) { @@ -397,6 +373,9 @@ openerp.base.ListView.List = Class.extend( * * * The name of the action to execute (as a string) * * The id of the record to execute the action on + * `row_link` + * Triggered when a row of the table is clicked, provides the index (in + * the rows array) and id of the selected record to the handle function. * * @constructs * @param {Object} opts display options, identical to those of :js:class:`openerp.base.ListView` @@ -427,6 +406,13 @@ openerp.base.ListView.List = Class.extend( record_id = self.row_id($target.closest('tr')); $(self).trigger('action', [field, record_id]); + }) + .delegate('tr', 'click', function (e) { + e.stopPropagation(); + $(self).trigger( + 'row_link', + [self.row_position(e.currentTarget), + self.row_id(e.currentTarget)]); }); }, move_to: function (element) { @@ -475,7 +461,6 @@ openerp.base.ListView.List = Class.extend( row_id: function (row) { return this.rows[this.row_position(row)].data.id.value; } - // Click events: action, row itself // drag and drop // editable? }); From 13b326dff8e82762bd7120ca807594d7770cbccf Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 9 May 2011 11:21:27 +0200 Subject: [PATCH 161/306] [IMP] fix wording of read_group documentation bzr revid: xmo@openerp.com-20110509092127-11acwi6oieuk0uzs --- openerp/osv/orm.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index dc338d6072b..2edb0f8c824 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -2127,12 +2127,11 @@ class orm(orm_template): :param cr: database cursor :param uid: current user id :param domain: list specifying search criteria [['field_name', 'operator', 'value'], ...] - :param fields: list of fields present in the list view specified on the object - :param groupby: list of fields on which to groupby the records - :type fields_list: list (example ['field_name_1', ...]) - :param offset: optional number of records to skip - :param limit: optional max number of records to return - :param context: context arguments, like lang, time zone + :param list fields: list of fields present in the list view specified on the object + :param list groupby: fields by which the records will be grouped + :param int offset: optional number of records to skip + :param int limit: optional max number of records to return + :param dict context: context arguments, like lang, time zone :param order: optional ``order by`` specification, for overriding the natural sort ordering of the groups, see also :py:meth:`~osv.osv.osv.search` (supported only for many2one fields currently) From 1e862920fbd007237d5be61ceb06c594f5ef172f Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 9 May 2011 15:11:00 +0530 Subject: [PATCH 162/306] [FIX] sale: Customer Invoices should be translatable lp bug: https://launchpad.net/bugs/779092 fixed bzr revid: ara@tinyerp.com-20110509094100-0bqdzz0dxg1hwdxf --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index b868983b9f2..7d2b8654652 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -449,7 +449,7 @@ class sale_order(osv.osv): res_id = res and res[1] or False, return { - 'name': 'Customer Invoices', + 'name': _('Customer Invoices'), 'view_type': 'form', 'view_mode': 'form', 'view_id': [res_id], From fb753b29eede7df92c5bfbd62c780783398baa25 Mon Sep 17 00:00:00 2001 From: "Naresh (OpenERP)" Date: Mon, 9 May 2011 15:14:48 +0530 Subject: [PATCH 163/306] [IMP]:moved from misc to config file and allowed the server die if the timezone is not valid. bzr revid: nch@tinyerp.com-20110509094448-vdfs3rmbcm5tw6n4 --- openerp/tools/config.py | 5 +++-- openerp/tools/misc.py | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/openerp/tools/config.py b/openerp/tools/config.py index 1ae839ba65d..9bc15bb128a 100644 --- a/openerp/tools/config.py +++ b/openerp/tools/config.py @@ -32,7 +32,7 @@ def check_ssl(): try: from OpenSSL import SSL import socket - + return hasattr(socket, 'ssl') and hasattr(SSL, "Connection") except: return False @@ -349,7 +349,8 @@ class configmanager(object): self.options['update'] = opt.update and dict.fromkeys(opt.update.split(','), 1) or {} self.options['translate_modules'] = opt.translate_modules and map(lambda m: m.strip(), opt.translate_modules.split(',')) or ['all'] self.options['translate_modules'].sort() - + die(self.options['timezone'] and not isinstance(self.options['timezone'], basestring), + "Invalid timezone value in configuration or environment: %r, Please fix this in your configuration" %(self.options['timezone'])) if self.options['timezone']: # If an explicit TZ was provided in the config, make sure it is known try: diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py index 401d10ee035..e1a6a717e87 100644 --- a/openerp/tools/misc.py +++ b/openerp/tools/misc.py @@ -1283,11 +1283,6 @@ def detect_server_timezone(): def get_server_timezone(): # timezone detection is safe in multithread, so lazy init is ok here - if config['timezone'] and \ - not isinstance(config['timezone'], basestring): - loglevels.Logger().notifyChannel("detect_server_timezone", loglevels.LOG_WARNING, - "Invalid timezone value in configuration or environment: %r, using UTC instead. Please fix this in your configuration" %(config['timezone'])) - return 'UTC' if (not config['timezone']): config['timezone'] = detect_server_timezone() return config['timezone'] From f799fff396d8bbf3516e7d2949ae2cd4e74eb266 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 9 May 2011 12:04:45 +0200 Subject: [PATCH 164/306] [ADD] Added template inheritance to QWeb2 (t-extend) bzr revid: fme@openerp.com-20110509100445-h527yh2q4j061nxq --- .../base/static/lib/qweb/qweb-test-extend.xml | 27 +++++ addons/base/static/lib/qweb/qweb-test.js.html | 17 +++ addons/base/static/lib/qweb/qweb2.js | 107 +++++++++++++++++- 3 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 addons/base/static/lib/qweb/qweb-test-extend.xml diff --git a/addons/base/static/lib/qweb/qweb-test-extend.xml b/addons/base/static/lib/qweb/qweb-test-extend.xml new file mode 100644 index 00000000000..23e10d52599 --- /dev/null +++ b/addons/base/static/lib/qweb/qweb-test-extend.xml @@ -0,0 +1,27 @@ + + +
    • one
    +
    + +
  • 3
  • +
    + +
  • 2
  • +
    + +
  • 1
  • +
    +
    +
    + + + this.attr('class', 'main'); + + + +
    +
    + + END + +
    diff --git a/addons/base/static/lib/qweb/qweb-test.js.html b/addons/base/static/lib/qweb/qweb-test.js.html index b39527f0c13..e341fa753fd 100644 --- a/addons/base/static/lib/qweb/qweb-test.js.html +++ b/addons/base/static/lib/qweb/qweb-test.js.html @@ -5,6 +5,7 @@ + diff --git a/addons/base/static/lib/qweb/qweb2.js b/addons/base/static/lib/qweb/qweb2.js index edf8f8b2b21..3c473423a44 100644 --- a/addons/base/static/lib/qweb/qweb2.js +++ b/addons/base/static/lib/qweb/qweb2.js @@ -77,6 +77,41 @@ var QWeb2 = { } return -1; }, + xml_node_to_string : function(node, childs_only) { + if (childs_only) { + var childs = node.childNodes, r = []; + for (var i = 0, ilen = childs.length; i < ilen; i++) { + r.push(this.xml_node_to_string(childs[i])); + } + return r.join(''); + } else { + if (node.xml !== undefined) { + return node.xml; + } else { + return (new XMLSerializer()).serializeToString(node); + } + } + }, + xpath_selectNodes : function(node, expr) { + if (node.selectNodes !== undefined) { + return node.selectNodes(expr); + } else { + var xpath = new XPathEvaluator(); + try { + var result = xpath.evaluate(expr, node, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); + } catch(error) { + this.exception("Error with XPath expression '" + expr + "' : " + error); + } + var r = []; + if (result != null) { + var element; + while (element = result.iterateNext()) { + r.push(element); + } + } + return r + } + }, call: function(context, template, old_dict, _import, callback) { var new_dict = this.extend({}, old_dict); new_dict['__caller__'] = old_dict['__template__']; @@ -157,8 +192,10 @@ QWeb2.Engine = (function() { this.templates_resources = []; // TODO: implement this.reload() this.templates = {}; this.compiled_templates = {}; + this.extend_templates = {}; this.dict = {}; this.tools = QWeb2.tools; + this.jQuery = window.jQuery; for (var i = 0; i < arguments.length; i++) { this.add_template(arguments[i]); } @@ -178,8 +215,16 @@ QWeb2.Engine = (function() { return this.tools.exception(node.innerText); } var name = node.getAttribute(this.prefix + '-name'); + var extend = node.getAttribute(this.prefix + '-extend'); if (name) { this.templates[name] = node; + } else if (extend) { + delete(this.compiled_templates[extend]); + if (this.extend_templates[extend]) { + this.extend_templates[extend].push(node); + } else { + this.extend_templates[extend] = [node]; + } } } } @@ -256,15 +301,26 @@ QWeb2.Engine = (function() { "});"; }, render : function(template, dict) { - //console.time("QWeb render template " + template); + if (this.debug && window['console'] !== undefined) { + console.time("QWeb render template " + template); + } var r = this._render(template, dict); - //console.timeEnd("QWeb render template " + template); + if (this.debug && window['console'] !== undefined) { + console.timeEnd("QWeb render template " + template); + } return r; }, _render : function(template, dict) { if (this.compiled_templates[template]) { return this.compiled_templates[template].apply(this, [dict || {}]); } else if (this.templates[template]) { + var ext; + if (ext = this.extend_templates[template]) { + var extend_node; + while (extend_node = ext.shift()) { + this.extend(template, extend_node); + } + } var code = this.compile(this.templates[template]), tcompiled; try { // tcompiled = new Function(code); TODO: Check if could use this in order to avoid eval @@ -278,6 +334,53 @@ QWeb2.Engine = (function() { } else { return this.tools.exception("Template '" + template + "' not found"); } + }, + extend : function(template, extend_node) { + if (!this.jQuery) { + return this.tools.exception("Can't extend template " + template + " without jQuery"); + } + for (var i = 0, ilen = extend_node.childNodes.length; i < ilen; i++) { + var child = extend_node.childNodes[i]; + if (child.nodeType === 1) { + var xpath = child.getAttribute(this.prefix + '-xpath'), + jquery = child.getAttribute(this.prefix + '-jquery'), + operation = child.getAttribute(this.prefix + '-operation'), + target, + error_msg = "Error while extending template '" + template; + if (jquery) { + target = this.jQuery(jquery, this.templates[template]); + } else if (xpath) { + // NOTE: due to the XPath implementation, extending a template will only work once + // when using XPath because XPathResult won't match objects with other constructor than 'Element' + // As jQuery will create HTMLElements, xpath will ignore them then causing problems when a + // template has already been extended. XPath selectors will probably be removed in QWeb. + target = this.jQuery(this.tools.xpath_selectNodes(this.templates[template], xpath)); + } else { + this.tools.exception(error_msg + "No expression given"); + } + error_msg += "' (expression='" + (jquery || xpath) + "') : "; + var inner = this.tools.xml_node_to_string(child, true); + if (operation) { + var allowed_operations = "append,prepend,before,after,replace,inner".split(','); + if (this.tools.arrayIndexOf(allowed_operations, operation) == -1) { + this.tools.exception(error_msg + "Invalid operation : '" + operation + "'"); + } + operation = {'replace' : 'replaceWith', 'inner' : 'html'}[operation] || operation; + target[operation]($(inner)); + } else { + try { + var f = new Function(['$'], inner); + } catch(error) { + return this.tools.exception("Parse " + error_msg + error); + } + try { + f.apply(target, [this.jQuery]); + } catch(error) { + return this.tools.exception("Runtime " + error_msg + error); + } + } + } + } } }); return Engine; From 40b1aa2de182c9ef96572289619947176edbf78d Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 9 May 2011 12:05:41 +0200 Subject: [PATCH 165/306] [IMP] search popup wip bzr revid: nicolas.vanhoren@openerp.com-20110509100541-g0iqhn00e3q17yw4 --- addons/base/static/src/js/form.js | 27 +++++++++++++++++++++++---- addons/base/static/src/xml/base.xml | 7 ++++--- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index bf3c806140a..33c855af537 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -962,9 +962,9 @@ openerp.base.form.Many2ManyListView = openerp.base.ListView.extend({ }, do_add_record: function (e) { e.stopImmediatePropagation(); - debugger; var pop = new openerp.base.form.Many2XSelectPopup(null, this.m2m_field.view.session); - pop.select_element(null,null); + pop.select_element(this.model); + //TODO niv: add callback }, on_select_row: function(event) { var $target = $(event.currentTarget); @@ -989,14 +989,33 @@ openerp.base.form.Many2ManyListView = openerp.base.ListView.extend({ openerp.base.form.Many2XSelectPopup = openerp.base.BaseWidget.extend({ identifier_prefix: "many2xselectpopup", template: "Many2XSelectPopup", - select_element: function(model, callback) { + select_element: function(model) { this.model = model; - this.callback = callback; var html = this.render(); jQuery(html).dialog({title: '', modal: true, minWidth: 800}); this.start(); + }, + start: function() { + this.dataset = new openerp.base.DataSetSearch(this.session, this.model); + this.setup_search_view(); + }, + setup_search_view: function() { + var self = this; + if (this.searchview) { + this.searchview.stop(); + } + this.searchview = new openerp.base.SearchView(this, this.session, this.element_id + "_search", + this.dataset, false, {}); + /*this.searchview.on_search.add(function(domains, contexts, groupbys) { + //TODO niv: do it correctly + self.views[self.active_view].controller.do_search.call( + self, domains, contexts, groupbys); + });*/ + return this.searchview.start(); + }, + on_select_element: function(element_id) { } }); diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml index 7df230f3d3e..84528b75e9b 100644 --- a/addons/base/static/src/xml/base.xml +++ b/addons/base/static/src/xml/base.xml @@ -491,7 +491,8 @@ -
    +
    +
    @@ -572,8 +573,8 @@
    -
    - Brian is in the kitchen. +
    +
    From cb854aa0b39653ea6f5f6850d0956d91aeb121aa Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 9 May 2011 12:59:53 +0200 Subject: [PATCH 166/306] [FIX] Rendering issue in Chrome. bzr revid: nicolas.vanhoren@openerp.com-20110509105953-ffjp4t06p6gulumd --- addons/base/static/src/js/search.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/base/static/src/js/search.js b/addons/base/static/src/js/search.js index ae5e8551b93..efaca3c0239 100644 --- a/addons/base/static/src/js/search.js +++ b/addons/base/static/src/js/search.js @@ -121,7 +121,10 @@ openerp.base.SearchView = openerp.base.Controller.extend({ 'lines': lines, 'defaults': this.defaults }); - this.$element.html(render); + // We don't understand why the following commented line does not work in Chrome but + // the non-commented line does. As far as we investigated, only God knows. + //this.$element.html(render); + jQuery(render).appendTo(this.$element); var f = this.$element.find('form'); this.$element.find('form') From 98b32b936f36ad59a2fb985390198988648e7a53 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 9 May 2011 13:21:43 +0200 Subject: [PATCH 167/306] [IMP] product: improved order of product_category bzr revid: qdp-launchpad@openerp.com-20110509112143-hwl7z720g2fuk0co --- 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 4865f71c4f6..aad703b0afb 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -218,7 +218,7 @@ class product_category(osv.osv): 'type' : lambda *a : 'normal', } - _order = "sequence" + _order = "sequence, name" def _check_recursion(self, cr, uid, ids, context=None): level = 100 while len(ids): From a1149a97c6250aca4dfb54a0cf7817f422d5fdae Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 9 May 2011 13:52:33 +0200 Subject: [PATCH 168/306] [IMP] Many2x search popup wip. Currently working, need to add possibility to create new object. bzr revid: nicolas.vanhoren@openerp.com-20110509115233-j1j004r9yxlhm63x --- addons/base/static/src/js/form.js | 28 +++++++++++++++++++++++----- addons/base/static/src/xml/base.xml | 1 + 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index 33c855af537..37a5683360a 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -964,7 +964,15 @@ openerp.base.form.Many2ManyListView = openerp.base.ListView.extend({ e.stopImmediatePropagation(); var pop = new openerp.base.form.Many2XSelectPopup(null, this.m2m_field.view.session); pop.select_element(this.model); - //TODO niv: add callback + var self = this; + pop.on_select_element.add(function(element_id) { + if(! _.detect(self.dataset.ids, function(x) {return x == element_id;})) { + self.dataset.ids.push(element_id); + self.dataset.count = self.dataset.ids.length; + self.do_reload(); + } + pop.stop(); + }); }, on_select_row: function(event) { var $target = $(event.currentTarget); @@ -998,8 +1006,13 @@ openerp.base.form.Many2XSelectPopup = openerp.base.BaseWidget.extend({ this.start(); }, start: function() { + this._super(); this.dataset = new openerp.base.DataSetSearch(this.session, this.model); this.setup_search_view(); + this.view_list = new openerp.base.form.Many2XPopupListView( null, this.session, + this.element_id + "_view_list", this.dataset, false); + this.view_list.popup = this; + this.view_list.start(); }, setup_search_view: function() { var self = this; @@ -1008,17 +1021,22 @@ openerp.base.form.Many2XSelectPopup = openerp.base.BaseWidget.extend({ } this.searchview = new openerp.base.SearchView(this, this.session, this.element_id + "_search", this.dataset, false, {}); - /*this.searchview.on_search.add(function(domains, contexts, groupbys) { - //TODO niv: do it correctly - self.views[self.active_view].controller.do_search.call( + this.searchview.on_search.add(function(domains, contexts, groupbys) { + self.view_list.do_search.call( self, domains, contexts, groupbys); - });*/ + }); return this.searchview.start(); }, on_select_element: function(element_id) { } }); +openerp.base.form.Many2XPopupListView = openerp.base.ListView.extend({ + switch_to_record: function(index) { + this.popup.on_select_element(this.dataset.ids[index]); + } +}); + openerp.base.form.FieldReference = openerp.base.form.Field.extend({ init: function(view, node) { this._super(view, node); diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml index 84528b75e9b..d6c4d3edbb1 100644 --- a/addons/base/static/src/xml/base.xml +++ b/addons/base/static/src/xml/base.xml @@ -575,6 +575,7 @@
    +
    From d6bf99ff900c49021b32110b2a8f817e2fea3cbe Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 9 May 2011 14:03:54 +0200 Subject: [PATCH 169/306] [IMP] Removed font weight bold on form's labels bzr revid: fme@openerp.com-20110509120354-e4ssdfk66f2vtxoj --- addons/base/static/src/css/base.css | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index 0ca1c995b33..8c4df744219 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -568,7 +568,6 @@ body.openerp { /* Form */ .openerp table.oe_frame td { color: #4c4c4c; - font-weight: bold; } .openerp .required.error { border: 1px solid #900; From 84c0e981ec15fb8015fcaead877ea5faebce9dc2 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 9 May 2011 14:19:01 +0200 Subject: [PATCH 170/306] [ADD] Added clone template in QWeb2 (t-name & t-extend) bzr revid: fme@openerp.com-20110509121901-kmpcn7n6gsrjx6bl --- addons/base/static/lib/qweb/qweb-test-extend.xml | 5 +++++ addons/base/static/lib/qweb/qweb-test.js.html | 2 ++ addons/base/static/lib/qweb/qweb2.js | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/addons/base/static/lib/qweb/qweb-test-extend.xml b/addons/base/static/lib/qweb/qweb-test-extend.xml index 23e10d52599..44fda920e43 100644 --- a/addons/base/static/lib/qweb/qweb-test-extend.xml +++ b/addons/base/static/lib/qweb/qweb-test-extend.xml @@ -24,4 +24,9 @@ END + + +
  • CLONED TEMPLATE
  • +
    + diff --git a/addons/base/static/lib/qweb/qweb-test.js.html b/addons/base/static/lib/qweb/qweb-test.js.html index e341fa753fd..fda837497c4 100644 --- a/addons/base/static/lib/qweb/qweb-test.js.html +++ b/addons/base/static/lib/qweb/qweb-test.js.html @@ -251,6 +251,8 @@ test("jQuery extend", function () { equals(render('jquery-extend', {}), '
    • 1
    • 2
    • 3
    END
    ', "Extend template with jQuery"); + equals(render('jquery-extend-clone', {}), '
    • one
    • CLONED TEMPLATE
    ', + "Clone template"); }); }); diff --git a/addons/base/static/lib/qweb/qweb2.js b/addons/base/static/lib/qweb/qweb2.js index 3c473423a44..36d0dce09c4 100644 --- a/addons/base/static/lib/qweb/qweb2.js +++ b/addons/base/static/lib/qweb/qweb2.js @@ -216,6 +216,15 @@ QWeb2.Engine = (function() { } var name = node.getAttribute(this.prefix + '-name'); var extend = node.getAttribute(this.prefix + '-extend'); + if (name && extend) { + // Clone template and extend it + if (!this.templates[extend]) { + return this.tools.exception("Can't clone undefined template " + extend); + } + this.templates[name] = this.templates[extend].cloneNode(true); + extend = name; + name = undefined; + } if (name) { this.templates[name] = node; } else if (extend) { From 2e760b3699e6befced31bd16f2672cb41c1644f6 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 9 May 2011 14:48:08 +0200 Subject: [PATCH 171/306] [IMP] Force vertical resize of textareas bzr revid: fme@openerp.com-20110509124808-7bujdh4xqtn43n17 --- addons/base/static/src/css/base.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index 8c4df744219..61ad2bf8286 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -610,6 +610,9 @@ body.openerp { min-width: 90px; color: #1f1f1f; } +.openerp textarea { + resize:vertical; +} .openerp input[type="text"], .openerp input[type="password"], .openerp select, .openerp .button { height: 22px; } From 93d7852342e9bba2f714160fd6ac5d7833c46f3b Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 9 May 2011 16:10:01 +0200 Subject: [PATCH 172/306] [ADD] Added percentage in progressbar (can't center it for the moment) bzr revid: fme@openerp.com-20110509141001-33vihmt5edam0ydq --- addons/base/static/src/css/base.css | 6 ++++++ addons/base/static/src/js/form.js | 8 ++++++++ addons/base/static/src/xml/base.xml | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index 61ad2bf8286..6656dd42849 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -648,6 +648,12 @@ body.openerp { background-color: #F66; border: 1px solid #D00; } +.openerp div.oe-progressbar span { + position: absolute; + margin-left: 10px; + margin-top: 5px; + font-weight: bold; +} /* jQuery UI override */ .openerp .ui-widget { diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index 3a6ef174c8d..27beadbdecf 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -773,6 +773,14 @@ openerp.base.form.FieldProgressBar = openerp.base.form.Field.extend({ value: this.value, disabled: this.readonly }); + }, + set_value: function(value) { + this._super.apply(this, arguments); + var show_value = Number(value); + if (show_value === NaN) { + show_value = 0; + } + this.$element.find('div').progressbar('option', 'value', show_value).find('span').html(show_value + '%'); } }); diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml index aae0d445a03..8675e59818d 100644 --- a/addons/base/static/src/xml/base.xml +++ b/addons/base/static/src/xml/base.xml @@ -365,7 +365,9 @@ t-att-class="'field_' + widget.type"/> -
    +
    + +
    ').append( + jQuery('', { + 'style':'text-transform:none; white-space: nowrap', + 'title': 'Name', + 'text': 'Name :'}).after( + jQuery('', { + 'id': 'm2o_' + this.name, + 'type': 'text', + 'val':this.element.val()})))).after( + jQuery('
    ').append( + jQuery('',{ + 'id':'create', + 'text':'Create', + 'href':'javascript: void(0)', + 'click': onClick, + 'class':'a_m2o'}, 'EDIT')).append( + jQuery('',{ + 'id':'edit', + 'href':'javascript: void(0)', + 'click':onClick, + 'text':'Edit', + 'class':'a_m2o'})).append( + jQuery('',{ + 'id':'close', + 'text':'Close', + 'href':'javascript: void(0)', + 'click':onClick, + 'class':'a_m2o'})))).appendTo($tbl); + + parent_element.empty().append($DiaTable); + parent_element.show(); + }, + getOnclick : function(evt) { + if(evt.currentTarget.id == 'create') { + var self = this + this.dataset.create({'name': this.element.val()}, + function(r){}, function(r){self.on_edit(r)}); + } + + if(evt.currentTarget.id == 'edit') { + this.on_edit(); + } + + var parent_element = jQuery("#autoCompleteResults_" + this.name); + parent_element.empty(); + parent_element.hide(); + }, + + on_edit: function(r) { + var element_id = _.uniqueId("act_window_dialog"); + var dialog = jQuery('
    ', + {'id': element_id + }).dialog({title: 'test', + modal: true, + minWidth: 800, + buttons: { + Cancel: function() { + $(this).dialog("close"); + } + } + }); + var event_form = new openerp.base.FormView(this.view_manager, this.session, element_id, this.dataset, false); + event_form.start(); + }, }) -} \ No newline at end of file +} From 12de5a891b7a73f142c321ea2d013457470d1370 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 5 May 2011 11:38:53 +0200 Subject: [PATCH 126/306] [FIX] QWeb2: fix xml string detection bzr revid: fme@openerp.com-20110505093853-c692wio8uaxy1ndk --- addons/base/static/lib/qweb/qweb2.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/base/static/lib/qweb/qweb2.js b/addons/base/static/lib/qweb/qweb2.js index 4343e10923f..edf8f8b2b21 100644 --- a/addons/base/static/lib/qweb/qweb2.js +++ b/addons/base/static/lib/qweb/qweb2.js @@ -20,6 +20,16 @@ var QWeb2 = { } throw prefix + ": " + message; }, + trim: function(s, mode) { + switch (mode) { + case "left": + return s.replace(/^\s*/, ""); + case "right": + return s.replace(/\s*$/, ""); + default: + return s.replace(/^\s*|\s*$/g, ""); + } + }, js_escape: function(s, noquotes) { return (noquotes ? '' : "'") + s.replace(/\r?\n/g, "\\n").replace(/'/g, "\\'") + (noquotes ? '' : "'"); }, @@ -177,7 +187,7 @@ QWeb2.Engine = (function() { }, load_xml : function(s) { s = s.replace(/^\s*|\s*$/g, ''); - if (s[0] === ' Date: Thu, 5 May 2011 15:56:00 +0530 Subject: [PATCH 127/306] [FIX]:AttributeError lp bug: https://launchpad.net/bugs/675826 fixed bzr revid: nch@tinyerp.com-20110505102600-0zch200zndsdf383 --- openerp/tools/misc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py index 1524d95d922..d0f8faec6e0 100644 --- a/openerp/tools/misc.py +++ b/openerp/tools/misc.py @@ -159,7 +159,7 @@ def exec_pg_command(name, *args): if not prog: raise Exception('Couldn\'t find %s' % name) args2 = (prog,) + args - + return subprocess.call(args2) def exec_pg_command_pipe(name, *args): @@ -1283,6 +1283,9 @@ def detect_server_timezone(): def get_server_timezone(): # timezone detection is safe in multithread, so lazy init is ok here + if config['timezone'] and \ + not isinstance(config['timezone'], basestring): + return 'UTC' if (not config['timezone']): config['timezone'] = detect_server_timezone() return config['timezone'] From ca5a45a3134c5570dbb5047c231cd2382ad72aad Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 5 May 2011 14:00:03 +0200 Subject: [PATCH 128/306] [IMP] l10n_be: merged the enhancements for vat declaration made by Noviat bzr revid: qdp-launchpad@openerp.com-20110505120003-apzwajpwlol7gmy1 --- .../wizard/l10n_be_account_vat_declaration.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py index 03fff730bb4..38a711f995b 100644 --- a/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py +++ b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py @@ -3,6 +3,11 @@ # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). +# +# Adapted by Noviat to +# - enforce correct vat number +# - support negative balance +# - support Noviat tax code scheme # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -58,13 +63,13 @@ class l10n_be_vat_declaration(osv.osv_memory): if context is None: context = {} - list_of_tags = ['00','01','02','03','44','45','46','47','48','49','54','55','56','57','59','61','62','63','64','71','81','82','83','84','85','86','87','88','91'] + list_of_tags = ['00','01','02','03','44','45','46','47','48','49','54','55','56','57','59','61','62','63','64','71','72','81','82','83','84','85','86','87','88','91'] data_tax = self.browse(cr, uid, ids[0]) if data_tax.tax_code_id: obj_company = data_tax.tax_code_id.company_id else: obj_company = obj_user.browse(cr, uid, uid, context=context).company_id - vat_no = obj_company.partner_id.vat + vat_no = obj_company.partner_id.vat.replace(' ','').upper() if not vat_no: raise osv.except_osv(_('Data Insufficient'), _('No VAT Number Associated with Main Company!')) @@ -98,15 +103,22 @@ class l10n_be_vat_declaration(osv.osv_memory): data_of_file += '\n\t\t'+ (data['client_nihil'] and 'YES' or 'NO') +'' data_of_file +='\n\t\t\n\t\t\t' + cases_list = [] for item in tax_info: if item['code'] == '91' and ending_month != 12: #the tax code 91 can only be send for the declaration of December continue if item['code']: - if item['code'] == '71-72': - item['code']='71' + if item['code'] == 'VI': + if item['sum_period'] >= 0: + item['code'] = '71' + else: + item['code'] = '72' if item['code'] in list_of_tags: - data_of_file +='\n\t\t\t\t' + str(abs(int(round(item['sum_period']*100)))) + '' + cases_list.append(item) + cases_list.sort() + for item in cases_list: + data_of_file +='\n\t\t\t\t' + str(abs(int(round(item['sum_period']*100)))) + '' data_of_file += '\n\t\t\t\n\t\t\n\t\n' model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_vat_save')], context=context) From ecbe0ad56b210db453886ba82ad5e79e79f6fc91 Mon Sep 17 00:00:00 2001 From: "sma (Tiny)" Date: Thu, 5 May 2011 17:58:14 +0530 Subject: [PATCH 129/306] [FIX] After close create div reset all the elements. bzr revid: sma@tinyerp.com-20110505122814-iuvex47rv2kku4dl --- addons/base/static/src/js/m2o.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/addons/base/static/src/js/m2o.js b/addons/base/static/src/js/m2o.js index f59e76471b5..094c7b0d837 100644 --- a/addons/base/static/src/js/m2o.js +++ b/addons/base/static/src/js/m2o.js @@ -200,7 +200,8 @@ openerp.base.m2o = openerp.base.Controller.extend({ } if ($selectedRow.find('td').attr('id') == 'create') { - return this.PseudoDialogue(); + this.PseudoDialogue(); + break; } this.setCompletionText($selectedRow, true); @@ -235,6 +236,7 @@ openerp.base.m2o = openerp.base.Controller.extend({ } if(evt.which == 13 || evt.which == 27 || evt.which == 38 || evt.which == 40)// this.specialKeyPressed = true; + } if((evt.which == 8 || evt.which == 46)) { @@ -272,7 +274,16 @@ openerp.base.m2o = openerp.base.Controller.extend({ setCompletionText: function ($selectedRow, flag) { var $cell = $selectedRow.find('td'); var autoCompleteText = $cell.find('span').text(); + if ($cell.attr('id') == 'more') { + this.element.val(''); + return; + } + + if ($cell.attr('id') == 'create' || !autoCompleteText) + return + autoCompleteText = flag ? autoCompleteText : this.lastSearch + '[' + autoCompleteText.substring(this.lastSearch.length) + ']' + this.element.val(autoCompleteText); this.element.attr('m2o_id', $cell.attr('data-id')); this.lastTextResult = autoCompleteText; @@ -329,6 +340,7 @@ openerp.base.m2o = openerp.base.Controller.extend({ parent_element.empty().append($DiaTable); parent_element.show(); }, + getOnclick : function(evt) { if(evt.currentTarget.id == 'create') { var self = this @@ -340,9 +352,8 @@ openerp.base.m2o = openerp.base.Controller.extend({ this.on_edit(); } - var parent_element = jQuery("#autoCompleteResults_" + this.name); - parent_element.empty(); - parent_element.hide(); + jQuery("#autoCompleteResults_" + this.name).empty(); + this.clearResults(); }, on_edit: function(r) { From 521e77bde268e09ea35451d9c8a274e204fbb72d Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 5 May 2011 15:27:00 +0200 Subject: [PATCH 130/306] [IMP] l10n_be: merged the enhancements for vat listing made by Noviat bzr revid: qdp-launchpad@openerp.com-20110505132700-3lersicd60vezhx6 --- .../wizard/l10_be_partner_vat_listing.py | 151 ++++++++++-------- 1 file changed, 83 insertions(+), 68 deletions(-) diff --git a/addons/l10n_be/wizard/l10_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10_be_partner_vat_listing.py index 4c6e495ace5..66636539233 100644 --- a/addons/l10n_be/wizard/l10_be_partner_vat_listing.py +++ b/addons/l10n_be/wizard/l10_be_partner_vat_listing.py @@ -4,6 +4,11 @@ # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # +# Corrections & modifications by Noviat nv/sa, (http://www.noviat.be): +# - VAT listing based upon year in stead of fiscal year +# - sql query adapted to select only 'tax-out' move lines +# - extra button to print readable PDF report +# # 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 @@ -20,39 +25,12 @@ ############################################################################## import time import base64 - from tools.translate import _ -import tools -from decimal import Decimal from osv import fields, osv -class vat_listing_clients(osv.osv_memory): - _name = 'vat.listing.clients' - _columns = { - 'name': fields.char('Client Name', size=64), - 'vat': fields.char('VAT', size=64), - 'country': fields.char('Country', size=64), - 'amount': fields.float('Amount'), - 'turnover': fields.float('Turnover'), - } - def name_get(self, cr, uid, ids, context=None): - if not len(ids): - return [] - return [(r['id'], r['name'] or '' + ' - ' + r['vat'] or '') \ - for r in self.read(cr, uid, ids, ['name', 'vat'], - context, load='_classic_write')] - - def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): - client = self.search(cr, uid, [('vat', '=', name)]+args, limit=limit, context=context) - if not client: - client = self.search(cr, uid, [('name', 'ilike', '%%%s%%' % name)]+args, limit=limit, context=context) - return self.name_get(cr, uid, client, context=context) - -vat_listing_clients() - -class partner_vat(osv.osv_memory): +class partner_vat_13(osv.osv_memory): """ Vat Listing """ - _name = "partner.vat" + _name = "partner.vat_13" def get_partner(self, cursor, user, ids, context=None): obj_period = self.pool.get('account.period') @@ -60,8 +38,16 @@ class partner_vat(osv.osv_memory): obj_vat_lclient = self.pool.get('vat.listing.clients') obj_model_data = self.pool.get('ir.model.data') data = self.read(cursor, user, ids)[0] - period = obj_period.search(cursor, user, [('fiscalyear_id', '=', data['fyear'][0])], context=context) - p_id_list = obj_partner.search(cursor, user, [('vat_subjected', '!=', False),('customer','=',True)], context=context) + #period = obj_period.search(cursor, user, [('fiscalyear_id', '=', data['fyear'])], context=context) + year = data['year'] + date_start = year + '-01-01' + date_stop = year + '-12-31' + period = obj_period.search(cursor, user, [('date_start' ,'>=', date_start), ('date_stop','<=',date_stop)]) + if not period: + raise osv.except_osv(_('Data Insufficient!'), _('No data for the selected Year.')) + #logger.notifyChannel('addons.'+self._name, netsvc.LOG_WARNING, 'period = %s' %period ) + + p_id_list = obj_partner.search(cursor, user, [('vat_subjected', '!=', False)], context=context) if not p_id_list: raise osv.except_osv(_('Data Insufficient!'), _('No partner has a VAT Number asociated with him.')) partners = [] @@ -79,35 +65,35 @@ class partner_vat(osv.osv_memory): break if not go_ahead: continue - cursor.execute('select b.code, sum(credit)-sum(debit) from account_move_line l left join account_account a on (l.account_id=a.id) left join account_account_type b on (a.user_type=b.id) where b.code IN %s and l.partner_id=%s and l.period_id IN %s group by b.code',(('produit', 'tax', 'income'),obj_partner.id,tuple(period),)) + cursor.execute('select b.code, sum(credit)-sum(debit) from account_move_line l left join account_account a on (l.account_id=a.id) left join account_account_type b on (a.user_type=b.id) where b.code IN %s and l.partner_id=%s and l.period_id IN %s group by b.code',(('income','tax_out'),obj_partner.id,tuple(period),)) line_info = cursor.fetchall() if not line_info: continue - record['vat'] = obj_partner.vat + record['vat'] = obj_partner.vat.replace(' ','').upper() #it seems that this listing is only for belgian customers record['country'] = 'BE' - record['amount'] = Decimal(str(0.0)) - record['turnover'] = Decimal(str(0.0)) + record['amount'] = 0 + record['turnover'] = 0 record['name'] = obj_partner.name for item in line_info: - if item[0] in ('produit','income'): - record['turnover'] += Decimal(str(item[1])) + if item[0] == 'income': + record['turnover'] += item[1] else: - record['amount'] += Decimal(str(item[1])) + record['amount'] += item[1] id_client = obj_vat_lclient.create(cursor, user, record, context=context) partners.append(id_client) records.append(record) - context.update({'partner_ids': partners, 'fyear': data['fyear'], 'limit_amount': data['limit_amount'], 'mand_id':data['mand_id']}) - model_data_ids = obj_model_data.search(cursor, user, [('model','=','ir.ui.view'), ('name','=','view_vat_listing')]) + context.update({'partner_ids': partners, 'year': data['year'], 'limit_amount': data['limit_amount']}) + model_data_ids = obj_model_data.search(cursor, user, [('model','=','ir.ui.view'), ('name','=','view_vat_listing_13')]) resource_id = obj_model_data.read(cursor, user, model_data_ids, fields=['res_id'])[0]['res_id'] return { 'name': 'Vat Listing', 'view_type': 'form', 'view_mode': 'form', - 'res_model': 'partner.vat.list', + 'res_model': 'partner.vat.list_13', 'views': [(resource_id,'form')], 'context': context, 'type': 'ir.actions.act_window', @@ -115,17 +101,21 @@ class partner_vat(osv.osv_memory): } _columns = { - 'fyear': fields.many2one('account.fiscalyear','Fiscal Year', required=True), - 'mand_id': fields.char('MandataireId', size=14, required=True, help="This identifies the representative of the sending company. This is a string of 14 characters"), + 'year': fields.char('Year', size=4, required=True), 'limit_amount': fields.integer('Limit Amount', required=True), - 'test_xml': fields.boolean('Test XML file', help="Sets the XML output as test file"), } -partner_vat() + + _defaults={ + 'year': lambda *a: str(int(time.strftime('%Y'))-1), + 'limit_amount': 250, + } + +partner_vat_13() -class partner_vat_list(osv.osv_memory): +class partner_vat_list_13(osv.osv_memory): """ Partner Vat Listing """ - _name = "partner.vat.list" + _name = "partner.vat.list_13" _columns = { 'partner_ids': fields.many2many('vat.listing.clients', 'vat_partner_rel', 'vat_id', 'partner_id', 'Clients', required=False, help='You can remove clients/partners which you do not want to show in xml file'), 'name': fields.char('File Name', size=32), @@ -153,12 +143,15 @@ class partner_vat_list(osv.osv_memory): seq_declarantnum = obj_sequence.get(cursor, user, 'declarantnum') obj_cmpny = obj_users.browse(cursor, user, user, context=context).company_id company_vat = obj_cmpny.partner_id.vat + if not company_vat: raise osv.except_osv(_('Data Insufficient'),_('No VAT Number Associated with Main Company!')) - cref = company_vat + seq_controlref - dnum = cref[2:] + (seq_declarantnum or '') - obj_year= obj_fyear.browse(cursor, user, context['fyear'][0], context=context) + company_vat = company_vat.replace(' ','').upper() + SenderId = company_vat[2:] + cref = SenderId + seq_controlref + dnum = cref + seq_declarantnum + #obj_year= obj_fyear.browse(cursor, user, context['fyear'], context=context) street = zip_city = country = '' addr = obj_partner.address_get(cursor, user, [obj_cmpny.partner_id.id], ['invoice']) if addr.get('invoice',False): @@ -175,16 +168,14 @@ class partner_vat_list(osv.osv_memory): country = ads.country_id.code sender_date = time.strftime('%Y-%m-%d') -# comp_name = obj_cmpny.name - data_file = '\n\n\t\t'+ tools.ustr(obj_cmpny.name) +'\n\t\t'+ tools.ustr(street) +'\n\t\t'+ tools.ustr(zip_city) +'' - data_file += '\n\t\t'+ tools.ustr(country) +'\n\t\n' - data_comp = '\n\n\t'+str(company_vat)+'\n\t'+ tools.ustr(obj_cmpny.name) +'\n\t'+ tools.ustr(street) +'\n\t'+ tools.ustr(zip_city) +'\n\t'+ tools.ustr(country) +'\n' - data_period = '\n'+ tools.ustr(obj_year.date_stop[:4]) +'' + data_file += '\n\n\t\n\t\t'+str(company_vat)+'\n\t\t'+ comp_name +'\n\t\t'+ street +'\n\t\t'+ zip_city +'' + data_file += '\n\t\t'+ country +'\n\t\n' + data_comp = '\n\n\t'+SenderId+'\n\t'+ comp_name +'\n\t'+ street +'\n\t'+ zip_city +'\n\t'+ country +'\n' + data_period = '\n' + context['year'] +'' error_message = [] data = self.read(cursor, user, ids)[0] for partner in data['partner_ids']: @@ -195,27 +186,51 @@ class partner_vat_list(osv.osv_memory): datas.append(client_data) seq = 0 data_clientinfo = '' - sum_tax = Decimal(str(0.00)) - sum_turnover=Decimal(str(0.00)) + sum_tax = 0.00 + sum_turnover = 0.00 if len(error_message): return 'Exception : \n' +'-'*50+'\n'+ '\n'.join(error_message) for line in datas: if not line: continue - if Decimal(str(line['turnover'])) < Decimal(str(context['limit_amount'])): + if line['turnover'] < context['limit_amount']: continue seq += 1 - sum_tax +=Decimal(str(line['amount'])) - sum_turnover +=Decimal(str(line['turnover'])) - data_clientinfo += '\n\n\t\n\t\t'+ (line['vat'] or '')[2:] +'\n\t\t' + tools.ustr(line['country']) +'\n\t\n\t'+ str(int(Decimal(str(line['amount'] * 100)))) +'\n\t'+ str(int(Decimal(str(line['turnover'] * 100)))) +'\n' + sum_tax += line['amount'] + sum_turnover += line['turnover'] + data_clientinfo += '\n\n\t\n\t\t'+line['vat'].replace(' ','').upper()[2:] +'\n\t\t' + line['country'] +'\n\t\n\t'+str(int(round(line['amount'] * 100))) +'\n\t'+str(int(round(line['turnover'] * 100))) +'\n' - data_decl ='\n' - data_file += tools.ustr(data_decl) + tools.ustr(data_comp) + tools.ustr(data_period) + tools.ustr(data_clientinfo) + '\n' + data_decl ='\n' + data_file += data_decl + data_comp + str(data_period) + data_clientinfo + '\n\n' msg = 'Save the File with '".xml"' extension.' file_save = base64.encodestring(data_file.encode('utf8')) self.write(cursor, user, ids, {'file_save':file_save, 'msg':msg, 'name':'vat_list.xml'}, context=context) return True + + def print_vatlist(self, cursor, user, ids, context=None): + if context is None: + context = {} + obj_vat_lclient = self.pool.get('vat.listing.clients') + client_datas = [] + data = self.read(cursor, user, ids)[0] + for partner in data['partner_ids']: + if isinstance(partner, list) and partner: + client_datas.append(partner[2]) + else: + client_data = obj_vat_lclient.read(cursor, user, partner, context=context) + client_datas.append(client_data) + + datas = {'ids': []} + datas['model'] = 'res.company' + datas['year'] = context['year'] + datas['limit_amount'] = context['limit_amount'] + datas['client_datas'] = client_datas + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'partner.vat.listing.print', + 'datas': datas, + } -partner_vat_list() +partner_vat_list_13() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 8dba0bc05367ff07dd7c570374a2a5592ee32344 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 5 May 2011 16:32:06 +0200 Subject: [PATCH 131/306] [IMP] l10n_be: renamed file bzr revid: qdp-launchpad@openerp.com-20110505143206-efhub12ul3eo0fuy --- addons/l10n_be/wizard/__init__.py | 2 +- ...be_partner_vat_listing.py => l10n_be_partner_vat_listing.py} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename addons/l10n_be/wizard/{l10_be_partner_vat_listing.py => l10n_be_partner_vat_listing.py} (100%) diff --git a/addons/l10n_be/wizard/__init__.py b/addons/l10n_be/wizard/__init__.py index 2e09bbb17db..3201ee4dba1 100644 --- a/addons/l10n_be/wizard/__init__.py +++ b/addons/l10n_be/wizard/__init__.py @@ -19,7 +19,7 @@ # ############################################################################## -import l10_be_partner_vat_listing +import l10n_be_partner_vat_listing import l10n_be_vat_intra import l10n_be_account_vat_declaration diff --git a/addons/l10n_be/wizard/l10_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py similarity index 100% rename from addons/l10n_be/wizard/l10_be_partner_vat_listing.py rename to addons/l10n_be/wizard/l10n_be_partner_vat_listing.py From fc60bd9cd202e7a750203815225d14e65cb70167 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 5 May 2011 16:33:29 +0200 Subject: [PATCH 132/306] [IMP] l10n_be: merged the enhancements for vat listing made by Noviat (iteration 2: the views) bzr revid: qdp-launchpad@openerp.com-20110505143329-6jvmbdkcap3ygsr2 --- .../wizard/l10n_be_partner_vat_listing.xml | 157 ++++++------------ 1 file changed, 55 insertions(+), 102 deletions(-) diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml index 7ae3a0ab73e..ff05e5ecefb 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml @@ -1,110 +1,63 @@ - + - + + Partner VAT Listing + partner.vat_13 + form + +
    +
    - [[ formatLang(line.discount, digits=get_digits(dp='Sale Price')) ]] + [[ formatLang(line.discount) ]] [[ formatLang(line.price_subtotal, digits=get_digits(dp='Sale Price')) ]] [[ o.pricelist_id.currency_id.symbol ]] diff --git a/addons/sale_layout/report/report_sale_layout.rml b/addons/sale_layout/report/report_sale_layout.rml index fd9cbe90bf8..941df09aeb5 100644 --- a/addons/sale_layout/report/report_sale_layout.rml +++ b/addons/sale_layout/report/report_sale_layout.rml @@ -292,7 +292,7 @@ [[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]] [[ formatLang(a['price_unit'], digits=get_digits(dp='Sale Price')) ]] - [[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]] [[ formatLang(a['discount'], digits=get_digits(dp='Sale Price')) ]] + [[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]] [[ formatLang(a['discount']) ]] [[ a['layout_type']=='break' and removeParentNode('blockTable')]][[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]] [[ formatLang(a['price_subtotal'], digits=get_digits(dp='Sale Price')) ]] [[ o.pricelist_id.currency_id.symbol ]] From 0dcd78a54e59f89567cc079bd3399bbf73b5ea16 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 10 May 2011 10:34:20 +0200 Subject: [PATCH 176/306] [ADD] DataGroup API bzr revid: xmo@openerp.com-20110510083420-18zr6j8ab5d9c023 --- addons/base/controllers/main.py | 7 +++ addons/base/static/src/js/data.js | 79 +++++++++++++++++++++++++++++-- addons/base/static/src/js/list.js | 12 +++++ 3 files changed, 95 insertions(+), 3 deletions(-) diff --git a/addons/base/controllers/main.py b/addons/base/controllers/main.py index 085e48d89e0..e21f4fb853f 100644 --- a/addons/base/controllers/main.py +++ b/addons/base/controllers/main.py @@ -425,6 +425,13 @@ class DataSet(openerpweb.Controller): r = m.default_get(fields, context) return {'result': r} +class DataGroup(openerpweb.Controller): + _cp_path = "/base/group" + @openerpweb.jsonrequest + def read(self, request, model, group_by_fields, domain=None, context=None): + Model = request.session.model(model) + return Model.read_group(domain or False, False, group_by_fields, 0, False, context or False) + class View(openerpweb.Controller): def fields_view_get(self, request, model, view_id, view_type, transform=True, toolbar=False, submenu=False): diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index da0f18001a8..bb190e068c6 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -3,15 +3,88 @@ openerp.base.data = function(openerp) { openerp.base.DataGroup = openerp.base.Controller.extend( /** @lends openerp.base.DataGroup# */{ /** - * Management interface between views and the collection of selected OpenERP - * records (represents the view's state?) + * Management interface between views and grouped collections of OpenERP + * records * * @constructs * @extends openerp.base.Controller + * + * @param {Array} group_by sequence of fields by which to group * @param {openerp.base.Session} session Current OpenERP session + * @param {openerp.base.DataSet} dataset root dataset, holder of base view state */ - init: function(session) { + init: function(session, group_by, dataset) { this._super(session, null); + this.model = dataset.model; + this.context = dataset.context; + this.domain = dataset.domain; + + this.group_by = group_by; + + this.groups = null; + }, + fetch: function () { + var d = new $.Deferred(); + var self = this; + + if (this.groups) { + d.resolveWith(this, [this.groups]); + } else { + this.rpc('/base/group/read', { + model: this.model, + context: this.context, + domain: this.domain, + group_by_fields: this.group_by + }, function () { }).then(function (response) { + self.groups = response.result; + d.resolveWith(self, [response.result]); + }, function () { + d.rejectWith.apply(d, self, [arguments]); + }); + } + return d.promise(); + }, + /** + * Retrieves the content of the nth-level item in the DataGroup, which + * results in either a DataSet or a DataGroup instance. + * + * Calling :js:func:`~openerp.base.DataGroup.get` without having called + * :js:func:`~openerp.base.DataGroup.list` beforehand will likely result + * in an error. + * + * @param {Number} index the index of the group to open in the datagroup's collection + * @param {Function} ifDataSet executed if the item results in a DataSet, provided with the dataset as parameter and as context + * @param {Function} ifDataGroup executed if the item results in a DataSet, provided with the datagroup as parameter and as context + */ + get: function (index, ifDataSet, ifDataGroup) { + var group = this.groups[index]; + if (!group) { + throw new Error("No group at index " + index); + } + + var child_context = _.extend({}, this.context, group.__context); + if (group.__context.group_by.length) { + var datagroup = new openerp.base.DataGroup( + this.session, group.__context.group_by, { + model: this.model, + context: child_context, + domain: group.__domain + }); + ifDataGroup.call(datagroup, datagroup); + } else { + var dataset = new openerp.base.DataSetSearch(this.session, this.model); + dataset.domain = group.__domain; + dataset.context = child_context; + ifDataSet.call(dataset, dataset); + } + }, + /** + * Provides a list of all top-level items of the data group. + * + * @returns {$.Deferred} + */ + list: function () { + return this.fetch(); } }); diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index 62d29da0cba..f4a2e481418 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -290,6 +290,18 @@ openerp.base.ListView = openerp.base.Controller.extend( // TODO: handle non-empty results.group_by with read_group self.dataset.context = results.context; self.dataset.domain = results.domain; + if (results.group_by.length) { + var group = new openerp.base.DataGroup( + self.session, results.group_by, self.dataset); + group.list().then(function (lst) { + console.log(this, lst); + this.get(0, function () { + console.log('set', this); + }, function () { + console.log('group', this); + }); + }); + } return self.do_reload(); }); }, From 9ecd09d5dd7c0c1c4f8cf7f1d0d2d0790b0819fd Mon Sep 17 00:00:00 2001 From: "Ferdinand @ Camptocamp" <> Date: Tue, 10 May 2011 14:12:45 +0530 Subject: [PATCH 177/306] [FIX] account_payment: payment_order - sort by id desc to display newest on top of the list lp bug: https://launchpad.net/bugs/772509 fixed bzr revid: ara@tinyerp.com-20110510084245-b78ce2mjvw7vm4bx --- addons/account_payment/account_payment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_payment/account_payment.py b/addons/account_payment/account_payment.py index 5eadb0049b0..19de746b7c9 100644 --- a/addons/account_payment/account_payment.py +++ b/addons/account_payment/account_payment.py @@ -66,6 +66,7 @@ class payment_order(osv.osv): _name = 'payment.order' _description = 'Payment Order' _rec_name = 'reference' + _order = 'id desc' def get_wizard(self, type): logger = netsvc.Logger() From 9dcb8cfe246fb67eab8ec4db5604befc5261c5be Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 10 May 2011 12:30:46 +0200 Subject: [PATCH 179/306] [IMP] Added new object to m2m popup. bzr revid: nicolas.vanhoren@openerp.com-20110510103046-6hctgajnom4y3x91 --- addons/base/static/src/js/form.js | 43 ++++++++++++++++++++++++++++- addons/base/static/src/xml/base.xml | 11 +++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index 37a5683360a..934d8fabe10 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -1025,9 +1025,50 @@ openerp.base.form.Many2XSelectPopup = openerp.base.BaseWidget.extend({ self.view_list.do_search.call( self, domains, contexts, groupbys); }); - return this.searchview.start(); + this.searchview.on_loaded.add_last(function () { + var $buttons = self.searchview.$element.find(".oe_search-view-buttons"); + $buttons.append(QWeb.render("Many2XSelectPopup.search.buttons")); + var $nbutton = $buttons.find(".oe_many2xselectpopup-search-new"); + $nbutton.click(function() { + self.new_object(); + }); + var $cbutton = $buttons.find(".oe_many2xselectpopup-search-close"); + $cbutton.click(function() { + self.stop(); + }); + }); + this.searchview.start(); + }, on_select_element: function(element_id) { + }, + new_object: function() { + var self = this; + this.searchview.hide(); + this.view_list.$element.hide(); + this.dataset.index = null; + this.view_form = new openerp.base.FormView({}, this.session, + this.element_id + "_view_form", this.dataset, false); + this.view_form.start(); + this.view_form.on_loaded.add_last(function() { + var $buttons = self.view_form.$element.find(".oe_form_buttons"); + $buttons.html(QWeb.render("Many2XSelectPopup.form.buttons")); + var $nbutton = $buttons.find(".oe_many2xselectpopup-form-save"); + $nbutton.click(function() { + self.view_form.do_save(); + }); + var $cbutton = $buttons.find(".oe_many2xselectpopup-form-close"); + $cbutton.click(function() { + self.stop(); + }); + }); + this.view_form.on_created.add_last(function(r, success) { + if (r.result) { + var id = arguments[0].result; + self.on_select_element(id); + } + }); + this.view_form.do_show(); } }); diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml index d6c4d3edbb1..9e1646ace08 100644 --- a/addons/base/static/src/xml/base.xml +++ b/addons/base/static/src/xml/base.xml @@ -383,7 +383,7 @@

    -
    +
    @@ -576,6 +576,15 @@
    +
    + + + + + + + + From 45f47ae65c0e22e7a780806f69eedcaa57c37259 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 10 May 2011 13:07:23 +0200 Subject: [PATCH 180/306] [ADD] display groups in a most dreadful manner, need to cleanup the generation function and to handle displaying it in the correct table bzr revid: xmo@openerp.com-20110510110723-ic13ty3rs92zg9z9 --- addons/base/static/src/js/data.js | 23 +++++++++-- addons/base/static/src/js/list.js | 68 ++++++++++++++++++++++++++----- 2 files changed, 77 insertions(+), 14 deletions(-) diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index bb190e068c6..c3683ed592e 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -37,7 +37,19 @@ openerp.base.DataGroup = openerp.base.Controller.extend( /** @lends openerp.bas group_by_fields: this.group_by }, function () { }).then(function (response) { self.groups = response.result; - d.resolveWith(self, [response.result]); + // read_group results are annoying: they use the name of the + // field grouped on to hold the value and the count, so no + // generic access to those values is possible. + // Alias them to `value` and `length`. + d.resolveWith(self, [_(response.result).map(function (group) { + var field_name = self.group_by[0]; + return _.extend({}, group, { + // provide field used for grouping + grouped_on: field_name, + length: group[field_name + '_count'], + value: group[field_name] + }); + })]); }, function () { d.rejectWith.apply(d, self, [arguments]); }); @@ -52,9 +64,14 @@ openerp.base.DataGroup = openerp.base.Controller.extend( /** @lends openerp.bas * :js:func:`~openerp.base.DataGroup.list` beforehand will likely result * in an error. * + * The resulting :js:class:`~openerp.base.DataGroup` or + * :js:class:`~openerp.base.DataSet` will be provided through the relevant + * callback function. In both functions, the current DataGroup will be + * provided as context (``this``) + * * @param {Number} index the index of the group to open in the datagroup's collection - * @param {Function} ifDataSet executed if the item results in a DataSet, provided with the dataset as parameter and as context - * @param {Function} ifDataGroup executed if the item results in a DataSet, provided with the datagroup as parameter and as context + * @param {Function} ifDataSet executed if the item results in a DataSet, provided with the new dataset as parameter + * @param {Function} ifDataGroup executed if the item results in a DataSet, provided with the new datagroup as parameter */ get: function (index, ifDataSet, ifDataGroup) { var group = this.groups[index]; diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index f4a2e481418..87a59f0a469 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -61,7 +61,11 @@ openerp.base.ListView = openerp.base.Controller.extend( columns: this.columns, rows: this.rows }); - $(this.list).bind({ + this.groups = new openerp.base.ListView.Groups({ + options: this.options, + columns: this.columns + }); + $([this.list, this.groups]).bind({ 'selected': function (e, selection) { self.$element.find('#oe-list-delete') .toggle(!!selection.length); @@ -291,16 +295,10 @@ openerp.base.ListView = openerp.base.Controller.extend( self.dataset.context = results.context; self.dataset.domain = results.domain; if (results.group_by.length) { - var group = new openerp.base.DataGroup( + self.groups.datagroup = new openerp.base.DataGroup( self.session, results.group_by, self.dataset); - group.list().then(function (lst) { - console.log(this, lst); - this.get(0, function () { - console.log('set', this); - }, function () { - console.log('group', this); - }); - }); + self.$element.html(self.groups.render()); + return; } return self.do_reload(); }); @@ -476,7 +474,55 @@ openerp.base.ListView.List = Class.extend( // drag and drop // editable? }); - +openerp.base.ListView.Groups = Class.extend( + /** @lends openerp.base.ListView.Groups# */{ + /** + * Grouped display for the ListView. Handles basic DOM events and interacts + * with the :js:class:`~openerp.base.DataGroup` bound to it. + * + * Provides events similar to those of + * :js:class:`~openerp.base.ListView.List` + */ + init: function (opts) { + this.options = opts.options; + this.columns = opts.columns; + this.datagroup = {}; + }, + make_level: function (datagroup) { + var self = this, $root = $('
    '); + datagroup.list().then(function (list) { + _(list).each(function (group, index) { + var $title = $('
    ') + .text(group.grouped_on + ': ' + group.value + ' (' + group.length + ')') + .appendTo($root); + $title.click(function () { + datagroup.get(index, function (new_dataset) { + var $content = $('