From 49d05c86b239993504738e0a90847120f8993bde Mon Sep 17 00:00:00 2001 From: Niels Huylebroeck Date: Tue, 25 Aug 2009 13:53:17 +0200 Subject: [PATCH 001/104] Fixes project field not being auto-filled when creating a delegated task. Refers to bug 418541 bzr revid: niels@bubbles-it.be-20090825115317-pjwbavye3lxj4fn7 --- addons/project/project_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index f130ec8b5c0..29c67ee640a 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -307,7 +307,7 @@ - + From d8c6e2bab34290f9c924c770e97a4af295f38c2d Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 28 Aug 2009 19:03:37 +0200 Subject: [PATCH 002/104] [IMP] cchange version number bzr revid: christophe@tinyerp.com-20090828170337-7vefeuaq0975w3qi --- bin/release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/release.py b/bin/release.py index e5d56c92854..158af8793e4 100644 --- a/bin/release.py +++ b/bin/release.py @@ -22,7 +22,7 @@ ############################################################################## name = 'openerp-server' -version = '5.0.4' +version = '5.0.5-bzr' major_version = '5.0' description = 'OpenERP Server' long_desc = '''\ From 1737b613a9892cd3782c3191b0569810b1860c73 Mon Sep 17 00:00:00 2001 From: "Christophe chauvet(Syleam)" <> Date: Mon, 31 Aug 2009 11:52:43 +0530 Subject: [PATCH 003/104] [FIX] Send mail : Non-English characters were throwing error. lp bug: https://launchpad.net/bugs/421162 fixed bzr revid: jvo@tinyerp.com-20090831062243-qm4bnnvvx93xvsyi --- bin/tools/misc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index ef857ef0cb1..7760a9a851d 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -331,7 +331,7 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non email_bcc = [] if not attach: - msg = MIMEText(body or '',_subtype=subtype,_charset='utf-8') + msg = MIMEText(body.encode('utf-8') or '',_subtype=subtype,_charset='utf-8') else: msg = MIMEMultipart() @@ -362,7 +362,7 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non msg['Message-Id'] = "<%s-tinycrm-%s@%s>" % (time.time(), tinycrm, socket.gethostname()) if attach: - msg.attach( MIMEText(body or '', _charset='utf-8', _subtype=subtype) ) + msg.attach( MIMEText(body.encode('utf-8') or '', _charset='utf-8', _subtype=subtype) ) for (fname,fcontent) in attach: part = MIMEBase('application', "octet-stream") From 3eb3aa71a084a60fc0f2a8baef186f69710b6c8c Mon Sep 17 00:00:00 2001 From: "Luis Falcon(Thymbra)" <> Date: Mon, 31 Aug 2009 13:17:24 +0530 Subject: [PATCH 004/104] [IMP] Base : Rate for ARS Added bzr revid: jvo@tinyerp.com-20090831074724-gs79e4fmbkjlssia --- bin/addons/base/base_data.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/addons/base/base_data.xml b/bin/addons/base/base_data.xml index a03d0f17f3e..64c5f191fbb 100644 --- a/bin/addons/base/base_data.xml +++ b/bin/addons/base/base_data.xml @@ -1212,6 +1212,12 @@ 0.01 4 + + + 5.6 + + + INR From 19685f3ab309221beaaa0360fb4608644119fff0 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 31 Aug 2009 18:45:06 +0530 Subject: [PATCH 005/104] [FIX] Base : 'Supplier Partners' menu will open new record with supplier=1,customer=0 lp bug: https://launchpad.net/bugs/421137 fixed bzr revid: jvo@tinyerp.com-20090831131506-77gs0pq3ivb601ml --- bin/addons/base/res/partner/partner_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/addons/base/res/partner/partner_view.xml b/bin/addons/base/res/partner/partner_view.xml index 127a44e4549..6ed8118ab93 100644 --- a/bin/addons/base/res/partner/partner_view.xml +++ b/bin/addons/base/res/partner/partner_view.xml @@ -325,6 +325,7 @@ res.partner form [('supplier','=',1)] + {'default_customer':0} From 643490cad73510344d6ed02d798ee204cbf1bfb7 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 1 Sep 2009 11:34:18 +0530 Subject: [PATCH 006/104] [FIX] Account : Aged Partner Balance report for Future analysis corrected lp bug: https://launchpad.net/bugs/421907 fixed bzr revid: jvo@tinyerp.com-20090901060418-8jhhe3zzmqkmdzwi --- addons/account/report/aged_trial_balance.py | 60 ++++++++++----------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/addons/account/report/aged_trial_balance.py b/addons/account/report/aged_trial_balance.py index a4e57ff3952..652929e187d 100644 --- a/addons/account/report/aged_trial_balance.py +++ b/addons/account/report/aged_trial_balance.py @@ -59,15 +59,15 @@ class aged_trial_report(rml_parse.rml_parse): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') self.line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='line', context={'fiscalyear': form['fiscalyear']}) - self.cr.execute("SELECT DISTINCT res_partner.id AS id, " \ - "res_partner.name AS name " \ - "FROM res_partner,account_move_line AS line, account_account " \ - "WHERE (line.account_id=account_account.id) " \ - "AND ((reconcile_id IS NULL) " \ - "OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) " \ - "AND (line.partner_id=res_partner.id) " \ - "AND (account_account.company_id = %s) " \ - "ORDER BY res_partner.name", (form['date1'],form['company_id'])) + self.cr.execute("""SELECT DISTINCT res_partner.id AS id, + res_partner.name AS name + FROM res_partner,account_move_line AS line, account_account + WHERE (line.account_id=account_account.id) + AND ((reconcile_id IS NULL) + OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > '%s' ))) + AND (line.partner_id=res_partner.id) + AND (account_account.company_id = %s) + ORDER BY res_partner.name""" % (form['date1'],form['company_id'])) partners = self.cr.dictfetchall() ## mise a 0 du total for i in range(7): @@ -79,16 +79,16 @@ class aged_trial_report(rml_parse.rml_parse): # This dictionary will store the debit-credit for all partners, using partner_id as key. totals = {} - self.cr.execute("SELECT partner_id, SUM(debit-credit) " \ - "FROM account_move_line AS line, account_account " \ - "WHERE (line.account_id = account_account.id) " \ - "AND (account_account.type IN %s) " \ - "AND (partner_id in %s) " \ - "AND ((reconcile_id IS NULL) " \ - "OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > '%s' ))) " \ - "AND (account_account.company_id = %s) " \ - "AND account_account.active " \ - "GROUP BY partner_id" % (self.ACCOUNT_TYPE, partner_ids,form['date1'],form['company_id'])) + self.cr.execute("""SELECT partner_id, SUM(debit-credit) + FROM account_move_line AS line, account_account + WHERE (line.account_id = account_account.id) + AND (account_account.type IN %s) + AND (partner_id in %s) + AND ((reconcile_id IS NULL) + OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > '%s' ))) + AND (account_account.company_id = %s) + AND account_account.active + GROUP BY partner_id""" % (self.ACCOUNT_TYPE, partner_ids,form['date1'],form['company_id'])) t = self.cr.fetchall() for i in t: totals[i[0]] = i[1] @@ -96,17 +96,17 @@ class aged_trial_report(rml_parse.rml_parse): # This dictionary will store the future or past of all partners future_past = {} if form['direction_selection'] == 'future': - self.cr.execute("SELECT partner_id, SUM(debit-credit) " \ - "FROM account_move_line AS line, account_account " \ - "WHERE (line.account_id=account_account.id) " \ - "AND (account_account.type IN %s) " \ - "AND (COALESCE(date_maturity,date) < %s) " \ - "AND (partner_id in %s) " \ - "AND ((reconcile_id IS NULL) " \ - "OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) " \ - "AND (account_account.company_id = %s) " \ - "AND account_account.active " \ - "GROUP BY partner_id", (self.ACCOUNT_TYPE, form['date1'], partner_ids,form['date1'], form['company_id'])) + self.cr.execute("""SELECT partner_id, SUM(debit-credit) + FROM account_move_line AS line, account_account + WHERE (line.account_id=account_account.id) + AND (account_account.type IN %s) + AND (COALESCE(date_maturity,date) < '%s') + AND (partner_id in %s) + AND ((reconcile_id IS NULL) + OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > '%s' ))) + AND (account_account.company_id = %s) + AND account_account.active + GROUP BY partner_id"""% (self.ACCOUNT_TYPE, form['date1'], partner_ids,form['date1'], form['company_id'])) t = self.cr.fetchall() for i in t: future_past[i[0]] = i[1] From b4a0ea1fde037ef49ff1da96084cf0a0dc6a9f89 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 1 Sep 2009 12:23:34 +0530 Subject: [PATCH 007/104] [FIX] Account_tax_include : floatdivision error corrected lp bug: https://launchpad.net/bugs/422078 fixed bzr revid: jvo@tinyerp.com-20090901065334-omql949tj1gb4qu5 --- addons/account_tax_include/invoice_tax_incl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_tax_include/invoice_tax_incl.py b/addons/account_tax_include/invoice_tax_incl.py index afe21383d64..2acca1eb815 100644 --- a/addons/account_tax_include/invoice_tax_incl.py +++ b/addons/account_tax_include/invoice_tax_incl.py @@ -122,7 +122,7 @@ class account_invoice_line(osv.osv): return { 'type':'src', 'name':line.name, - 'price_unit':line.price_subtotal / line.quantity, + 'price_unit':(line.quantity) and (line.price_subtotal / line.quantity) or line.price_subtotal, 'quantity':line.quantity, 'price':line.price_subtotal, 'account_id':line.account_id.id, From d060741945525c65f61a8175e4815fbaec7817a7 Mon Sep 17 00:00:00 2001 From: "HDA (OpenERP)" Date: Tue, 1 Sep 2009 14:28:30 +0530 Subject: [PATCH 008/104] [FIX] added tooltip on tax and payment term lp bug: https://launchpad.net/bugs/421636 fixed bzr revid: hda@tinyerp.com-20090901085830-kpksxt0cabn4iywt --- 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 dad8832bda7..b4a14684a27 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -77,7 +77,7 @@ class account_payment_term_line(osv.osv): 'name': fields.char('Line Name', size=32, required=True), 'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the payment term lines from the lowest sequences to the higher ones"), 'value': fields.selection([('procent', 'Percent'), ('balance', 'Balance'), ('fixed', 'Fixed Amount')], 'Value',required=True), - 'value_amount': fields.float('Value Amount'), + 'value_amount': fields.float('Value Amount', 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)."), @@ -1206,7 +1206,7 @@ class account_tax(osv.osv): _columns = { 'name': fields.char('Tax Name', size=64, required=True, translate=True, help="This name will be displayed on reports"), 'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the tax lines from the lowest sequences to the higher ones. The order is important if you have a tax with several tax children. In this case, the evaluation order is important."), - 'amount': fields.float('Amount', required=True, digits=(14,4)), + 'amount': fields.float('Amount', required=True, digits=(14,4), help="For Tax Type percent enter % ratio between 0-1."), 'active': fields.boolean('Active'), 'type': fields.selection( [('percent','Percent'), ('fixed','Fixed'), ('none','None'), ('code','Python Code'),('balance','Balance')], 'Tax Type', required=True, help="The computation method for the tax amount."), From dbff4995df60fbbc17561e0f6b45a9fb524c90c1 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 1 Sep 2009 18:56:12 +0530 Subject: [PATCH 009/104] [FIX] project_gtd : timebox field re-arranged lp bug: https://launchpad.net/bugs/422401 fixed bzr revid: jvo@tinyerp.com-20090901132612-lzwqtjho1dsbu2z5 --- addons/project_gtd/project_gtd_view.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml index ebd9444c47c..f093c49efcb 100644 --- a/addons/project_gtd/project_gtd_view.xml +++ b/addons/project_gtd/project_gtd_view.xml @@ -159,13 +159,13 @@ form - - - - - - - + + + + + + + From 40666e1316c447aac0ca69746dba3428e087376a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= <> Date: Tue, 1 Sep 2009 20:31:36 +0530 Subject: [PATCH 010/104] [FIX] Security Loophole corrected lp bug: https://launchpad.net/bugs/422563 fixed bzr revid: jvo@tinyerp.com-20090901150136-tjpngpcfixg940b6 --- bin/osv/orm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 05b899a5eff..9838c6ba400 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -2122,16 +2122,16 @@ class orm(orm_template): if d1: cr.execute('SELECT %s FROM \"%s\" WHERE id IN (%s) AND %s ORDER BY %s' % \ (','.join(fields_pre2 + ['id']), self._table, - ','.join([str(x) for x in sub_ids]), d1, - self._order), d2) + ','.join(['%s' for x in sub_ids]), d1, + self._order),sub_ids + d2) if not cr.rowcount == len({}.fromkeys(sub_ids)): raise except_orm(_('AccessError'), _('You try to bypass an access rule (Document type: %s).') % self._description) else: cr.execute('SELECT %s FROM \"%s\" WHERE id IN (%s) ORDER BY %s' % \ (','.join(fields_pre2 + ['id']), self._table, - ','.join([str(x) for x in sub_ids]), - self._order)) + ','.join(['%s' for x in sub_ids]), + self._order), sub_ids) res.extend(cr.dictfetchall()) else: res = map(lambda x: {'id': x}, ids) From 9bf3939c28476f7c4424fda7edd62bcc54705e9e Mon Sep 17 00:00:00 2001 From: "HDA (OpenERP)" Date: Wed, 2 Sep 2009 15:43:50 +0530 Subject: [PATCH 011/104] [FIX]Module:product Added report tag for product pricelist reportso that it can be modified using OODesigner bzr revid: hda@tinyerp.com-20090902101350-803mxtvqy9ltsrbm --- addons/product/product_report.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/product/product_report.xml b/addons/product/product_report.xml index aec7212993a..ca4c3f4f356 100644 --- a/addons/product/product_report.xml +++ b/addons/product/product_report.xml @@ -2,5 +2,13 @@ + From 460f3102bc7d2edd13b8efc302bb585d5a7e079a Mon Sep 17 00:00:00 2001 From: "ACH(OpenERP)" <> Date: Wed, 2 Sep 2009 20:23:54 +0530 Subject: [PATCH 012/104] [FIX] Send Mail : Unicode error handled lp bug: https://launchpad.net/bugs/421162 fixed bzr revid: jvo@tinyerp.com-20090902145354-5b43k67lpbe513cj --- bin/tools/misc.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index 7760a9a851d..d8bd58bfcbd 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -331,7 +331,10 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non email_bcc = [] if not attach: - msg = MIMEText(body.encode('utf-8') or '',_subtype=subtype,_charset='utf-8') + try: + msg = MIMEText(body.encode('utf8') or '',_subtype=subtype,_charset='utf-8') + except: + msg = MIMEText(body or '',_subtype=subtype,_charset='utf-8') else: msg = MIMEMultipart() @@ -362,8 +365,10 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non msg['Message-Id'] = "<%s-tinycrm-%s@%s>" % (time.time(), tinycrm, socket.gethostname()) if attach: - msg.attach( MIMEText(body.encode('utf-8') or '', _charset='utf-8', _subtype=subtype) ) - + try: + msg.attach(MIMEText(body.encode('utf8') or '',_subtype=subtype,_charset='utf-8')) + except: + msg.attach(MIMEText(body or '', _charset='utf-8', _subtype=subtype) ) for (fname,fcontent) in attach: part = MIMEBase('application', "octet-stream") part.set_payload( fcontent ) From 1a22c9a2d2efac6959252b5b1b36001a0aa1e105 Mon Sep 17 00:00:00 2001 From: "VRA(OpenERP)" <> Date: Thu, 3 Sep 2009 10:54:57 +0530 Subject: [PATCH 013/104] [FIX]Account : Title of of Move Line widnows renamed lp bug: https://launchpad.net/bugs/423260 fixed bzr revid: jvo@tinyerp.com-20090903052457-lb4r0dbl2wfw6pv6 --- addons/account/account_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 60ca4626033..8353695f76e 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -787,7 +787,7 @@ - account.move.line.select + Entry Lines account.move.line form tree,form From 8ba89657d9bf42cdd9aebc2366b36546baaf0e13 Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Thu, 3 Sep 2009 15:17:05 +0530 Subject: [PATCH 014/104] [REF] Project_gtd : description added to context lp bug: https://launchpad.net/bugs/423581 fixed bzr revid: jvo@tinyerp.com-20090903094705-f6b7f9nwxiizmgkx --- addons/project_gtd/project_gtd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/project_gtd/project_gtd.py b/addons/project_gtd/project_gtd.py index 5c6d02e339f..322fe01d0bb 100644 --- a/addons/project_gtd/project_gtd.py +++ b/addons/project_gtd/project_gtd.py @@ -49,6 +49,7 @@ class one2many_mod(fields.one2many): class project_gtd_context(osv.osv): _name = "project.gtd.context" + _description = "Contexts" _columns = { 'name': fields.char('Context', size=64, required=True, select=1), 'sequence': fields.integer('Sequence'), From c9f5d954b54d976eb79e57f34fc069d4c709cb8c Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Thu, 3 Sep 2009 15:19:31 +0530 Subject: [PATCH 015/104] [REF] Project : description of task improved lp bug: https://launchpad.net/bugs/423585 fixed bzr revid: jvo@tinyerp.com-20090903094931-gijbcmr9lyqjy51g --- addons/project/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/project.py b/addons/project/project.py index a5602f860a4..72a7958e921 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -202,7 +202,7 @@ project_task_type() class task(osv.osv): _name = "project.task" - _description = "Task" + _description = "Tasks" _date_name = "date_start" def _str_get(self, task, level=0, border='***', context={}): return border+' '+(task.user_id and task.user_id.name.upper() or '')+(level and (': L'+str(level)) or '')+(' - %.1fh / %.1fh'%(task.effective_hours or 0.0,task.planned_hours))+' '+border+'\n'+ \ From 8830155b50cea945a820d0631d41cbde04c6f8aa Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Thu, 3 Sep 2009 17:34:43 +0530 Subject: [PATCH 016/104] [IMP] base_module_quality: remove certificate tag from terp test bzr revid: mra@tinyerp.com-20090903120443-stsp790fnbte28d0 --- addons/base_module_quality/terp_test/terp_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/base_module_quality/terp_test/terp_test.py b/addons/base_module_quality/terp_test/terp_test.py index db1add21340..298c8626d92 100644 --- a/addons/base_module_quality/terp_test/terp_test.py +++ b/addons/base_module_quality/terp_test/terp_test.py @@ -59,7 +59,7 @@ class quality_test(base_module_quality.abstract_quality_check): result_dict1 = {} terp_file = os.path.join(module_path,'__terp__.py') res = eval(tools.file_open(terp_file).read()) - terp_keys = ['category', 'name', 'description', 'author', 'website', 'update_xml', 'init_xml', 'depends', 'version', 'active', 'installable', 'demo_xml', 'certificate'] + terp_keys = ['category', 'name', 'description', 'author', 'website', 'update_xml', 'init_xml', 'depends', 'version', 'active', 'installable', 'demo_xml'] for key in terp_keys: if key in res: feel_good_factor += 1 # each tag should appear From 02fd0eb506ff822a8c09580be7f352d63f953ef0 Mon Sep 17 00:00:00 2001 From: "ACH,Jay" <> Date: Thu, 3 Sep 2009 18:19:28 +0530 Subject: [PATCH 017/104] [FIX] Translation issue with cache: it needed to restart server,SOLVED lp bug: https://launchpad.net/bugs/399208 fixed bzr revid: jvo@tinyerp.com-20090903124928-mbzr7ekxoo4sba49 --- bin/addons/base/ir/ir_translation.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/bin/addons/base/ir/ir_translation.py b/bin/addons/base/ir/ir_translation.py index 68e9138479e..9bf6e0ae776 100644 --- a/bin/addons/base/ir/ir_translation.py +++ b/bin/addons/base/ir/ir_translation.py @@ -143,6 +143,33 @@ class ir_translation(osv.osv): res = cr.fetchone() trad = res and res[0] or '' return trad + + def create(self, cursor, user, vals, context=None): + if not context: + context = {} + ids = super(ir_translation, self).create(cursor, user, vals, context=context) + for trans_obj in self.read(cursor, user, [ids], ['name','type','res_id'], context=context): + self._get_source.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], lang=context.get('lang','en_US')) + self._get_ids.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], context.get('lang','en_US'), [trans_obj['res_id']]) + return ids + + def write(self, cursor, user, ids, vals, context=None): + if not context: + context = {} + result = super(ir_translation, self).write(cursor, user, ids, vals, context=context) + for trans_obj in self.read(cursor, user, ids, ['name','type','res_id'], context=context): + self._get_source.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], lang=context.get('lang','en_US')) + self._get_ids.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], context.get('lang','en_US'), [trans_obj['res_id']]) + return result + + def unlink(self, cursor, user, ids, context=None): + if not context: + context = {} + for trans_obj in self.read(cursor, user, ids, ['name','type','res_id'], context=context): + self._get_source.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], lang=context.get('lang','en_US')) + self._get_ids.clear_cache(cursor.dbname, user, trans_obj['name'], trans_obj['type'], context.get('lang','en_US'), [trans_obj['res_id']]) + result = super(ir_translation, self).unlink(cursor, user, ids, context=context) + return result ir_translation() From f7c7f0bb7fa91b6f4ca9c57df77589ed5b6accc6 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 3 Sep 2009 14:50:00 +0200 Subject: [PATCH 018/104] [FIX] document: do not try to index binary documents bzr revid: chs@taupe-20090903125000-p2yhb7gh7emlr6ip --- addons/document/content_index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/document/content_index.py b/addons/document/content_index.py index d5878594644..6540b87b5ff 100644 --- a/addons/document/content_index.py +++ b/addons/document/content_index.py @@ -63,8 +63,8 @@ def content_index(content, filename=None, content_type=None): s.close() elif ext in ('.txt','.py','.patch','.html','.csv','.xml'): result = content - else: - result = content + #else: + # result = content return result # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From fafe3c939a67fb7312fd5c35196fdfd236065406 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 3 Sep 2009 15:06:49 +0200 Subject: [PATCH 019/104] [FIX] base_module_record: avoid duplications bzr revid: chs@taupe-20090903130649-d7f3hg9lr7shg94l --- addons/base_module_record/base_module_record.py | 13 +++++-------- .../wizard/base_module_record_objects.py | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py index c5ce478b6fb..d9cf8368528 100644 --- a/addons/base_module_record/base_module_record.py +++ b/addons/base_module_record/base_module_record.py @@ -145,14 +145,11 @@ class base_module_record(osv.osv): newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1]) if not newid: newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2]) -# if valitem[0]==0: -# newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2]) -# else: -# newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1]) + self.ids[(fields[key]['relation'], valitem[1])] = newid + childrecord, update = self._create_record(cr, uid, doc, fields[key]['relation'],valitem[2], newid) noupdate = noupdate or update record_list += childrecord - self.ids[(fields[key]['relation'],newid)] = newid else: pass elif fields[key]['type'] in ('many2many',): @@ -161,7 +158,7 @@ class base_module_record(osv.osv): if valitem[0]==6: for id2 in valitem[2]: id,update = self._get_id(cr, uid, fields[key]['relation'], id2) - self.ids[(fields[key]['relation'],id)] = id + self.ids[(fields[key]['relation'],id2)] = id noupdate = noupdate or update res.append(id) field = doc.createElement('field') @@ -265,7 +262,7 @@ class base_module_record(osv.osv): elif rec[4]=='create': id = self._create_id(cr, uid, rec[3],rec[5]) record,noupdate = self._create_record(cr, uid, doc, rec[3], rec[5], id) - self.ids[(rec[3],result)] = id + self.ids[(rec[3], result)] = id record_list += record elif rec[4]=='copy': @@ -276,7 +273,7 @@ class base_module_record(osv.osv): self.recording_data=rec_data id = self._create_id(cr, uid, rec[3],rec[6]) record,noupdate = self._create_record(cr, uid, doc, rec[3], rec[6], id) - self.ids[(rec[3],result)] = id + self.ids[(rec[3], result)] = id record_list += record return record_list,noupdate diff --git a/addons/base_module_record/wizard/base_module_record_objects.py b/addons/base_module_record/wizard/base_module_record_objects.py index b589485327f..ff7b79a030f 100644 --- a/addons/base_module_record/wizard/base_module_record_objects.py +++ b/addons/base_module_record/wizard/base_module_record_objects.py @@ -89,7 +89,7 @@ def _record_objects(self, cr, uid, data, context): search_ids=obj_pool.search(cr,uid,search_condition) for s_id in search_ids: args=(cr.dbname,uid,user,obj_name,'copy',s_id,{},context) - mod.recording_data.append(('query',args, {},s_id)) + mod.recording_data.append(('query',args, {}, s_id)) return {} def inter_call(self,cr,uid,data,context): From 9824b079bbf84fb01942d451de6e9a21f693283f Mon Sep 17 00:00:00 2001 From: Niels Huylebroeck Date: Thu, 3 Sep 2009 16:00:45 +0200 Subject: [PATCH 020/104] [FIX] Problem when using hr_holidays Summary Report when entering date 1 jan 2009 for example. bzr revid: niels@bubbles-it.be-20090903140045-9cv5ty32g1rgsuih --- addons/hr_holidays/report/holidays_summary_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py index 589f97f2631..2f7c32933d2 100644 --- a/addons/hr_holidays/report/holidays_summary_report.py +++ b/addons/hr_holidays/report/holidays_summary_report.py @@ -130,7 +130,7 @@ class report_custom(report_rml): while day_diff1>0: if month+i<=12: - if day_diff1>30: + if day_diff1 > lengthmonth(year,i+month)+1: # Not on 30 else you have problems when entering 01-01-2009 for example som1=datetime.date(year,month+i,1) date_xml += ['' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] i=i+1 From 2f216b53582b6b68e8753541bf1d989b4248809e Mon Sep 17 00:00:00 2001 From: Niels Huylebroeck Date: Thu, 3 Sep 2009 17:16:18 +0200 Subject: [PATCH 021/104] [FIX] +1 on the lengthmonth returns was too much, removed it bzr revid: niels@bubbles-it.be-20090903151618-54w6ciiyr36e7z28 --- addons/hr_holidays/report/holidays_summary_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py index 2f7c32933d2..a7be0e2b51c 100644 --- a/addons/hr_holidays/report/holidays_summary_report.py +++ b/addons/hr_holidays/report/holidays_summary_report.py @@ -130,7 +130,7 @@ class report_custom(report_rml): while day_diff1>0: if month+i<=12: - if day_diff1 > lengthmonth(year,i+month)+1: # Not on 30 else you have problems when entering 01-01-2009 for example + if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example som1=datetime.date(year,month+i,1) date_xml += ['' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] i=i+1 From a5488afe63cb97ab590286d4e39851567356056d Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Fri, 4 Sep 2009 11:03:10 +0530 Subject: [PATCH 022/104] [IMP]quality_integration_server: put max_limit in server connection bzr revid: hmo@tinyerp.com-20090904053310-djdif3t0fvehsh9e --- .../base_quality_interrogation.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index 2df0af247c7..620edd7dade 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -34,6 +34,8 @@ import socket admin_passwd = 'admin' waittime = 10 +wait_count = 0 +wait_limit = 12 def start_server(root_path, port, addons_path): if root_path: @@ -47,19 +49,27 @@ def clean(): ps.close() if pid: os.kill(pid,9) - + def execute(connector, method, *args): + global wait_count res = False try: res = getattr(connector,method)(*args) except socket.error,e: - if e.args[0] == 111: + if e.args[0] == 111: + if wait_count > wait_limit: + print "Server is taking too long to start, it has exceeded the maximum limit of %d seconds."%(wait_limit) + clean() + sys.exit(1) print 'Please wait %d sec to start server....'%(waittime) + wait_count += 1 time.sleep(waittime) res = execute(connector, method, *args) else: raise e - return res + wait_count = 0 + return res + def login(uri, dbname, user, pwd): conn = xmlrpclib.ServerProxy(uri + '/xmlrpc/common') @@ -110,12 +120,13 @@ def check_quality(uri, user, pwd, dbname, modules): html += "" for x,y,detail in quality_result['check_detail_ids']: if detail.get('detail') != '': - test = detail.get('name') + msg = detail.get('message') + test = detail.get('name') score = round(float(detail.get('score',0)),2) html += "
  • %s (%.2f)
  • "%(test,test,score) detail_html +="

    %s (Score : %s)

    %s
    "%(test,test,score,detail.get('detail')) detail_html +='''Go to Top''' - test_detail[test] = (score,detail.get('detail','')) + test_detail[test] = (score,msg,detail.get('detail','')) html += "
    %s"%(detail_html) final[quality_result['name']] = (quality_result['final_score'],html,test_detail) From a45c87c780a7cf37b9e78ebe58768be8bfa5c167 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 4 Sep 2009 17:01:58 +0530 Subject: [PATCH 023/104] [IMP] hr_timesheet_invoice : Misleading string on invoice analytic entries' wizard bzr revid: jvo@tinyerp.com-20090904113158-8ddrqud1x55qiqoo --- .../hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index 45205b03d2d..2b769cd1eae 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -184,7 +184,7 @@ class invoice_create(wizard.interface): _create_form = """ -
    + From 140aeda37334aef1e0c55448c3365d28b78eac67 Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Fri, 4 Sep 2009 20:22:07 +0530 Subject: [PATCH 024/104] [FIX] Account :Residual amount unclear when used with partial payments. lp bug: https://launchpad.net/bugs/424214 fixed bzr revid: jvo@tinyerp.com-20090904145207-0vfhvnougdl2599q --- addons/account/invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index b3c5316b68f..df71775b59b 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -108,7 +108,7 @@ class account_invoice(osv.osv): to_pay = inv.amount_total for lines in inv.move_lines: paid_amt = paid_amt - lines.credit + lines.debit - res[inv.id] = to_pay - abs(paid_amt) + res[inv.id] = round(to_pay - abs(paid_amt),int(config['price_accuracy'])) return res def _get_lines(self, cr, uid, ids, name, arg, context=None): @@ -892,7 +892,7 @@ class account_invoice(osv.osv): if l.account_id.id==src_account_id: line_ids.append(l.id) total += (l.debit or 0.0) - (l.credit or 0.0) - if (not total) or writeoff_acc_id: + if (not round(total,int(config['price_accuracy']))) or writeoff_acc_id: self.pool.get('account.move.line').reconcile(cr, uid, line_ids, 'manual', writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context) else: self.pool.get('account.move.line').reconcile_partial(cr, uid, line_ids, 'manual', context) From dac794192aecb0ffc3bfb8ae851ae8a370eb517e Mon Sep 17 00:00:00 2001 From: "GPA(Open ERP)" <> Date: Fri, 4 Sep 2009 20:37:37 +0530 Subject: [PATCH 025/104] [FIX] Project_gtd : Hierarchical timeboxes allowed to open lp bug: https://launchpad.net/bugs/422408 fixed bzr revid: jvo@tinyerp.com-20090904150737-1xth2slzfwek9ag1 --- addons/project_gtd/project_gtd_view.xml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml index f093c49efcb..810868fba1d 100644 --- a/addons/project_gtd/project_gtd_view.xml +++ b/addons/project_gtd/project_gtd_view.xml @@ -129,6 +129,7 @@ project.gtd.timebox.treelist project.gtd.timebox tree + child_ids 50 @@ -137,11 +138,10 @@ - My Timeboxes project.gtd.timebox - [('user_id','=',uid)] + [('user_id','=',uid),('parent_id','=',False)] tree {'record_id':False} @@ -170,7 +170,7 @@ + + TimeBox + ir.actions.act_window + project.task + form + tree,form + [('timebox_id','child_of',[active_id])] + {'timebox_id':active_id} + + + + + Tasks by Timebox + + + From 17b31648406bf1eeee8bfc35fdb247f8092f8eb6 Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Mon, 7 Sep 2009 12:13:46 +0530 Subject: [PATCH 026/104] [FIX] Project_gtd : Demo data defined for tasks(inboxes) bzr revid: jvo@tinyerp.com-20090907064346-5kpa8gxewjf6fwbg --- addons/project_gtd/project_gtd_demo.xml | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/addons/project_gtd/project_gtd_demo.xml b/addons/project_gtd/project_gtd_demo.xml index 08a9d3cc2f2..ca59a1211fd 100644 --- a/addons/project_gtd/project_gtd_demo.xml +++ b/addons/project_gtd/project_gtd_demo.xml @@ -71,6 +71,39 @@ + + + 38.0 + 38.0 + + + + + + Specific adaptation to MRP + + + + 40 + 32.0 + 32.0 + + + + + In house training + + + 50 + 24.0 + 24.0 + + + + + Validation + latest modifications. + + From fb6b27b56c0bf109b7a0d4b9df2e96dfc56657d2 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 7 Sep 2009 12:24:08 +0530 Subject: [PATCH 027/104] [FIX] Project_gtd : improved menuitems names to avoid user confusion,domain improved lp bug: https://launchpad.net/bugs/425257 fixed bzr revid: jvo@tinyerp.com-20090907065408-m33zrlfwgybknytl --- addons/project_gtd/project_gtd_view.xml | 6 +++--- addons/project_gtd/wizard/project_gtd_daily.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml index 810868fba1d..13a3f1080bc 100644 --- a/addons/project_gtd/project_gtd_view.xml +++ b/addons/project_gtd/project_gtd_view.xml @@ -115,9 +115,9 @@ - Inbox Tasks + My Inbox project.task - [('user_id','=',uid),('timebox_id','=',False),('state','in',('open','draft'))] + [('user_id','=',uid),('state','in',('open','draft'))] {'gtd_sort':True} @@ -148,7 +148,7 @@ diff --git a/addons/project_gtd/wizard/project_gtd_daily.py b/addons/project_gtd/wizard/project_gtd_daily.py index 81f6731262a..3ead091e06b 100644 --- a/addons/project_gtd/wizard/project_gtd_daily.py +++ b/addons/project_gtd/wizard/project_gtd_daily.py @@ -42,7 +42,7 @@ class wiz_timebox_open(wizard.interface): domain = "[('user_id', '=', uid)]" value = { 'domain': domain, - 'name': 'Timebox', + 'name': 'My Daily Timebox', 'view_type': 'form', 'view_mode': view_type, 'res_model': 'project.gtd.timebox', From f6566b12b50a1fe4ca5bbe68b8eacd879b359dd3 Mon Sep 17 00:00:00 2001 From: "VRA,JVO" <> Date: Mon, 7 Sep 2009 12:39:31 +0530 Subject: [PATCH 028/104] [FIX] Account : Reports from Chart of Accounts were not considering contextual value of MOVE(draft,posted) lp bug: https://launchpad.net/bugs/403972 fixed bzr revid: jvo@tinyerp.com-20090907070931-1b8fwikmdi6xc3pt --- addons/account/report/account_balance.py | 1 + addons/account/report/general_ledger.py | 2 +- addons/account/report/general_ledger_landscape.py | 1 + addons/account/wizard/wizard_account_balance_report.py | 5 +++-- addons/account/wizard/wizard_general_ledger_report.py | 3 ++- addons/account_balance/report/account_balance.py | 5 +++-- addons/account_balance/report/account_balance_landscape.py | 5 +++-- .../account_balance/wizard/wizard_account_balance_report.py | 3 ++- 8 files changed, 16 insertions(+), 9 deletions(-) diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 6f34e9d092f..ebf12dd9b08 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -93,6 +93,7 @@ class account_balance(report_sxw.rml_parse): res={} result_acc=[] ctx = self.context.copy() + ctx['state'] = form['context'].get('state','all') ctx['fiscalyear'] = form['fiscalyear'] if form['state']=='byperiod' : ctx['periods'] = form['periods'][0][2] diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index ce42653cc58..534b4d52e67 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -188,6 +188,7 @@ class general_ledger(rml_parse.rml_parse): ## We will make the test for period or date ## We will now make the test # + ctx['state'] = form['context'].get('state','all') if form.has_key('fiscalyear'): ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] @@ -195,7 +196,6 @@ class general_ledger(rml_parse.rml_parse): ctx['date_from'] = form['date_from'] ctx['date_to'] = form['date_to'] ## - # self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx) if account and account.child_consol_ids: # add ids of consolidated childs also of selected account diff --git a/addons/account/report/general_ledger_landscape.py b/addons/account/report/general_ledger_landscape.py index ef355526de3..c63c4281173 100644 --- a/addons/account/report/general_ledger_landscape.py +++ b/addons/account/report/general_ledger_landscape.py @@ -188,6 +188,7 @@ class general_ledger_landscape(rml_parse.rml_parse): ## We will make the test for period or date ## We will now make the test # + ctx['state'] = form['context'].get('state','all') if form.has_key('fiscalyear'): ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py index d8282ad440f..b7ff7c00922 100644 --- a/addons/account/wizard/wizard_account_balance_report.py +++ b/addons/account/wizard/wizard_account_balance_report.py @@ -79,7 +79,7 @@ account_fields = { } class wizard_report(wizard.interface): - def _get_defaults(self, cr, uid, data, context): + def _get_defaults(self, cr, uid, data, context={}): user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context) if user.company_id: company_id = user.company_id.id @@ -91,7 +91,8 @@ class wizard_report(wizard.interface): data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid) # data['form']['periods'] = periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])]) # data['form']['fiscalyear'] = False - data['form']['display_account']='bal_all' + data['form']['display_account'] = 'bal_all' + data['form']['context'] = context return data['form'] def _check_state(self, cr, uid, data, context): diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py index 82940bd3a16..b6b998e3bbd 100644 --- a/addons/account/wizard/wizard_general_ledger_report.py +++ b/addons/account/wizard/wizard_general_ledger_report.py @@ -130,7 +130,7 @@ def _check_state(self, cr, uid, data, context): class wizard_report(wizard.interface): - def _get_defaults(self, cr, uid, data, context): + def _get_defaults(self, cr, uid, data, context={}): user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context) if user.company_id: company_id = user.company_id.id @@ -147,6 +147,7 @@ class wizard_report(wizard.interface): data['form']['landscape']=True data['form']['fiscalyear'] = False data['form']['amount_currency'] = True + data['form']['context'] = context return data['form'] states = { diff --git a/addons/account_balance/report/account_balance.py b/addons/account_balance/report/account_balance.py index 0f0e92d9ad1..4fe498ac147 100644 --- a/addons/account_balance/report/account_balance.py +++ b/addons/account_balance/report/account_balance.py @@ -401,7 +401,8 @@ class account_balance(report_sxw.rml_parse): ctx['fiscalyear'] = id ctx['periods'] = form['periods'][0][2] - ctx['period_manner']=form['period_manner'] + ctx['period_manner'] = form['period_manner'] + ctx['state'] = form['context'].get('state','all') tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy()) if len(tmp): @@ -458,7 +459,7 @@ class account_balance(report_sxw.rml_parse): ctx['fiscalyear'] = id ctx['periods'] = form['periods'][0][2] ctx['period_manner']=form['period_manner'] - + ctx['state'] = form['context'].get('state','all') tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids,ctx.copy()) if len(tmp1): diff --git a/addons/account_balance/report/account_balance_landscape.py b/addons/account_balance/report/account_balance_landscape.py index 2638a628990..372fdf2c441 100644 --- a/addons/account_balance/report/account_balance_landscape.py +++ b/addons/account_balance/report/account_balance_landscape.py @@ -402,7 +402,8 @@ class account_balance_landscape(rml_parse.rml_parse): ctx['fiscalyear'] = id ctx['periods'] = form['periods'][0][2] - ctx['period_manner']=form['period_manner'] + ctx['period_manner'] = form['period_manner'] + ctx['state'] = form['context'].get('state','all') tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy()) if len(tmp): @@ -461,7 +462,7 @@ class account_balance_landscape(rml_parse.rml_parse): ctx['fiscalyear'] = id ctx['periods'] = form['periods'][0][2] ctx['period_manner']=form['period_manner'] - + ctx['state'] = form['context'].get('state','all') tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids,ctx.copy()) if len(tmp1): diff --git a/addons/account_balance/wizard/wizard_account_balance_report.py b/addons/account_balance/wizard/wizard_account_balance_report.py index 0f3280cb553..327b6190383 100644 --- a/addons/account_balance/wizard/wizard_account_balance_report.py +++ b/addons/account_balance/wizard/wizard_account_balance_report.py @@ -133,7 +133,8 @@ def _check(self, cr, uid, data, context): class wizard_report(wizard.interface): - def _get_defaults(self, cr, uid, data, context): + def _get_defaults(self, cr, uid, data, context={}): + data['form']['context'] = context fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear') data['form']['fiscalyear']=[fiscalyear_obj.find(cr, uid)] # p_ids=pooler.get_pool(cr.dbname).get('account.period').search(cr,uid,[('fiscalyear_id','=',fiscalyear_obj.find(cr, uid))]) From b3d0c54ef7ccbde4b0501b3a5ef3e8ddec08567a Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Mon, 7 Sep 2009 14:06:32 +0530 Subject: [PATCH 029/104] [IMP]quality_integration_server : quality html log bzr revid: hmo@tinyerp.com-20090907083632-z6pte2jqhrayjj23 --- .../base_quality_interrogation.py | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index 620edd7dade..48c2ef29278 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -117,17 +117,16 @@ def check_quality(uri, user, pwd, dbname, modules): html = '''''' html +="

    Module : %s

    "%(quality_result['name']) html += "

    Final score : %s

    "%(quality_result['final_score']) - html += "" - for x,y,detail in quality_result['check_detail_ids']: - if detail.get('detail') != '': - msg = detail.get('message') - test = detail.get('name') - score = round(float(detail.get('score',0)),2) - html += "
  • %s (%.2f)
  • "%(test,test,score) - detail_html +="

    %s (Score : %s)

    %s
    "%(test,test,score,detail.get('detail')) - detail_html +='''Go to Top''' - test_detail[test] = (score,msg,detail.get('detail','')) - html += "
    %s"%(detail_html) + html += "
    " + html += "
      " + for x,y,detail in quality_result['check_detail_ids']: + test = detail.get('name') + score = round(float(detail.get('score',0)),2) + html += "
    • %s
    • "%(test.replace(' ','-'),test) + detail_html +="

      %s (Score : %s)

      %s
      "%(test.replace(' ','-'),test,score,detail.get('detail')) + test_detail[test] = (score,detail.get('detail','')) + html += "
    %s"%(detail_html) + html += "
    " final[quality_result['name']] = (quality_result['final_score'],html,test_detail) fp = open('quality_log.pck','wb') @@ -138,7 +137,7 @@ def check_quality(uri, user, pwd, dbname, modules): else: print 'Login Failed...' clean() - sys.exit(1) + sys.exit(1) From dc8dd85fe1d7b89c56c04f3e9b97d88496343d1d Mon Sep 17 00:00:00 2001 From: "Christophe Chauvet(Syleam)" <> Date: Mon, 7 Sep 2009 15:59:47 +0530 Subject: [PATCH 030/104] [FIX] Export : Error solved while Exporting O2M records with None value of any field lp bug: https://launchpad.net/bugs/425430 fixed bzr revid: jvo@tinyerp.com-20090907102947-ne1p4q3mi1qz6gq7 --- 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 9838c6ba400..08086f5d49b 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -497,7 +497,7 @@ class orm_template(object): for rr in r : if isinstance(rr.name, browse_record): rr = rr.name - dt+=rr.name+',' + dt += rr.name or '' + ',' data[fpos] = dt[:-1] break lines += lines2[1:] From c0adc624b51a8bfadea3092fbca96bc3e319ac0f Mon Sep 17 00:00:00 2001 From: Quentin De Paoli Date: Mon, 7 Sep 2009 18:40:12 +0200 Subject: [PATCH 031/104] [FIX] multi currency reconciliations on bank statements weren't properly displayed [FIX] multi currency payments weren't correctly computed on invoice's residual amount bzr revid: qdp@cyan-20090907164012-eufzzqls4gqlkbv6 --- addons/account/account_bank_statement.py | 17 ++++++++++++++++- addons/account/account_invoice_view.xml | 4 ++++ addons/account/invoice.py | 5 ++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 0f6aca2f917..56c4ddba96e 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -213,6 +213,11 @@ class account_bank_statement(osv.osv): amount = res_currency_obj.compute(cr, uid, st.currency.id, company_currency_id, move.amount, context=context, account=acc_cur) + if st.currency.id <> company_currency_id: + amount_cur = res_currency_obj.compute(cr, uid, company_currency_id, + st.currency.id, amount, context=context, + account=acc_cur) + val['amount_currency'] = -amount_cur if move.account_id and move.account_id.currency_id and move.account_id.currency_id.id <> company_currency_id: val['currency_id'] = move.account_id.currency_id.id @@ -430,7 +435,17 @@ class account_bank_statement_reconcile(osv.osv): def name_get(self, cursor, user, ids, context=None): res= [] for o in self.browse(cursor, user, ids, context=context): - res.append((o.id, '[%.2f]' % (o.total_entry - o.total_new,))) + result = 0.0 + res_currency = '' + for line in o.line_ids: + if line.amount_currency and line.currency_id: + result += line.amount_currency + res_currency = line.currency_id.code + else: + result += line.debit - line.credit + if res_currency: + res_currency = ' ' + res_currency + res.append((o.id, '[%.2f'% (result - o.total_new,) + res_currency + ']' )) return res _columns = { diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 5b06a40acb1..6d14f25427c 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -221,6 +221,8 @@ + +
    @@ -306,6 +308,8 @@ + + diff --git a/addons/account/invoice.py b/addons/account/invoice.py index df71775b59b..ad38ff87e68 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -107,7 +107,10 @@ class account_invoice(osv.osv): paid_amt = 0.0 to_pay = inv.amount_total for lines in inv.move_lines: - paid_amt = paid_amt - lines.credit + lines.debit + if lines.amount_currency and lines.currency_id: + paid_amt += lines.amount_currency + else: + paid_amt += lines.credit + lines.debit res[inv.id] = round(to_pay - abs(paid_amt),int(config['price_accuracy'])) return res From 1d420cae792728d6f0ce74bfe4c7ee76cfb4f587 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 8 Sep 2009 19:03:40 +0530 Subject: [PATCH 032/104] [FIX] Account : Context was missing in report lp bug: https://launchpad.net/bugs/426243 fixed bzr revid: jvo@tinyerp.com-20090908133340-z0xy8i6uouoff122 --- addons/account/report/overdue.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/report/overdue.py b/addons/account/report/overdue.py index dca2f6aeff6..76ebbe7efa4 100644 --- a/addons/account/report/overdue.py +++ b/addons/account/report/overdue.py @@ -29,14 +29,14 @@ import pooler class Overdue(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(Overdue, self).__init__(cr, uid, name, context) + super(Overdue, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time' : time, 'adr_get' : self._adr_get, 'getLines' : self._lines_get, 'tel_get' : self._tel_get, }) - + self.context = context def _adr_get(self, partner, type): res = [] res_partner = pooler.get_pool(self.cr.dbname).get('res.partner') @@ -51,7 +51,7 @@ class Overdue(report_sxw.rml_parse): 'country_id' : False, } if adr_id: - result = res_partner_address.read(self.cr, self.uid, [adr_id]) + result = res_partner_address.read(self.cr, self.uid, [adr_id],context=self.context.copy()) result[0]['country_id'] = result[0]['country_id'] and result[0]['country_id'][1] or False return result From 776779e908176d65fe14695beb3bbc22bca17c21 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 9 Sep 2009 11:17:02 +0530 Subject: [PATCH 033/104] [FIX] Report: context was missing while printing any report with header in a non-English Language bzr revid: jvo@tinyerp.com-20090909054702-2ea1ugshop9cdmr1 --- bin/report/report_sxw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py index 539b8990485..1adca0b8176 100644 --- a/bin/report/report_sxw.py +++ b/bin/report/report_sxw.py @@ -156,7 +156,7 @@ class rml_parse(object): self.cr = cr self.uid = uid self.pool = pooler.get_pool(cr.dbname) - user = self.pool.get('res.users').browse(cr, uid, uid) + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) self.localcontext = { 'user': user, 'company': user.company_id, From d05666e33b0fe8c0de6dd05b78b4a4225f35ce35 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 9 Sep 2009 11:55:05 +0530 Subject: [PATCH 034/104] Account : Taxname on Invoice Tax improved,.sxw file made compatible to .rml for invoice lp bug: https://launchpad.net/bugs/407290 fixed bzr revid: jvo@tinyerp.com-20090909062505-m7wzkbvv94ywt0q6 --- addons/account/account.py | 2 +- addons/account/report/invoice.rml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index b4a14684a27..b6dd4bfb11b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1308,7 +1308,7 @@ class account_tax(osv.osv): # we compute the amount for the current tax object and append it to the result data = {'id':tax.id, - 'name':tax.name, + 'name':tax.description and tax.description + " - " + tax.name or tax.name, 'account_collected_id':tax.account_collected_id.id, 'account_paid_id':tax.account_paid_id.id, 'base_code_id': tax.base_code_id.id, diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index b2a65b73f33..902a9db3e06 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -366,7 +366,7 @@ [[ t.name ]] [[ formatLang(t.base) ]] - [[ t.tax_code_id.notprintable and removeParentNode('blockTable') or '' ]][[ formatLang(t.amount) ]] + [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]][[ formatLang(t.amount) ]] From 5178b351ad630135e35fae97505a35998c183f6e Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 9 Sep 2009 17:50:25 +0530 Subject: [PATCH 035/104] [IMP] Account : Analytic Account report following parental relationship approach(account with all its children bzr revid: jvo@tinyerp.com-20090909122025-9v7y1mlpc8gbtsi7 --- .../project/report/analytic_balance.py | 250 ++++++++++++------ .../project/report/analytic_balance.rml | 26 +- .../wizard_account_analytic_balance_report.py | 8 +- 3 files changed, 187 insertions(+), 97 deletions(-) diff --git a/addons/account/project/report/analytic_balance.py b/addons/account/project/report/analytic_balance.py index 341424984df..0c7b0cda761 100644 --- a/addons/account/project/report/analytic_balance.py +++ b/addons/account/project/report/analytic_balance.py @@ -30,17 +30,50 @@ class account_analytic_balance(report_sxw.rml_parse): super(account_analytic_balance, self).__init__(cr, uid, name, context) self.localcontext.update( { 'time': time, + 'get_objects': self._get_objects, 'lines_g': self._lines_g, - 'move_sum_debit': self._move_sum_debit, - 'move_sum_credit': self._move_sum_credit, - 'sum_debit': self._sum_debit, - 'sum_credit': self._sum_credit, + 'move_sum': self._move_sum, +# 'move_sum_debit': self._move_sum_debit, +# 'move_sum_credit': self._move_sum_credit, + 'sum_all': self._sum_all, +# 'sum_debit': self._sum_debit, +# 'sum_credit': self._sum_credit, 'sum_balance': self._sum_balance, - 'sum_quantity': self._sum_quantity, +# 'sum_quantity': self._sum_quantity, 'move_sum_balance': self._move_sum_balance, - 'move_sum_quantity': self._move_sum_quantity, +# 'move_sum_quantity': self._move_sum_quantity, }) + self.acc_ids = [] + self.read_data = [] + self.empty_acc = False + self.acc_data_dict = {}# maintains a relation with an account with its successors. + self.acc_sum_list = []# maintains a list of all ids + def get_children(self, ids): + ids2 = [] + read_data = self.pool.get('account.analytic.account').read(self.cr, self.uid, ids,['child_ids','code','complete_name','balance']) + for data in read_data: + if (data['id'] not in self.acc_ids): + inculde_empty = True + if (not self.empty_acc) and data['balance'] == 0.00: + inculde_empty = False + if inculde_empty: + self.acc_ids.append(data['id']) + self.read_data.append(data) + if data['child_ids']: + res = self.get_children(data['child_ids']) + return True + + + def _get_objects(self, empty_acc): + if self.read_data: + return self.read_data + self.empty_acc = empty_acc + self.read_data = [] + self.get_children(self.ids) + + return self.read_data + def _lines_g(self, account_id, date1, date2): account_analytic_obj = self.pool.get('account.analytic.account') ids = account_analytic_obj.search(self.cr, self.uid, @@ -68,93 +101,148 @@ class account_analytic_balance(report_sxw.rml_parse): r['credit'] = 0.0 return res - - def _move_sum_debit(self, account_id, date1, date2): - account_analytic_obj = self.pool.get('account.analytic.account') - ids = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', [account_id])]) - self.cr.execute("SELECT sum(amount) \ - FROM account_analytic_line \ - WHERE account_id in ("+ ','.join(map(str, ids)) +") \ - AND date>=%s AND date<=%s AND amount>0", - (date1, date2)) - return self.cr.fetchone()[0] or 0.0 - - def _move_sum_credit(self, account_id, date1, date2): - account_analytic_obj = self.pool.get('account.analytic.account') - ids = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', [account_id])]) - self.cr.execute("SELECT -sum(amount) \ - FROM account_analytic_line \ - WHERE account_id in ("+ ','.join(map(str, ids)) +") \ - AND date>=%s AND date<=%s AND amount<0", - (date1, date2)) - return self.cr.fetchone()[0] or 0.0 - - def _move_sum_balance(self, account_id, date1, date2): - debit = self._move_sum_debit(account_id, date1, date2) - credit = self._move_sum_credit(account_id, date1, date2) - return (debit-credit) - - def _move_sum_quantity(self, account_id, date1, date2): - account_analytic_obj = self.pool.get('account.analytic.account') - ids = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', [account_id])]) - self.cr.execute("SELECT sum(unit_amount) \ - FROM account_analytic_line \ + def _move_sum(self, account_id, date1, date2, option): + if account_id not in self.acc_data_dict: + account_analytic_obj = self.pool.get('account.analytic.account') + ids = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', [account_id])]) + self.acc_data_dict[account_id] = ids + else: + ids = self.acc_data_dict[account_id] + + if option == "credit" : + self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \ + WHERE account_id in ("+ ','.join(map(str, ids)) +") \ + AND date>=%s AND date<=%s AND amount<0", + (date1, date2)) + elif option == "debit" : + self.cr.execute("SELECT sum(amount) FROM account_analytic_line \ + WHERE account_id in ("+ ','.join(map(str, ids)) +") \ + AND date>=%s AND date<=%s AND amount>0", + (date1, date2)) + elif option == "quantity" : + self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \ WHERE account_id in ("+ ','.join(map(str, ids)) +") \ AND date>=%s AND date<=%s", (date1, date2)) return self.cr.fetchone()[0] or 0.0 - - - def _sum_debit(self, accounts, date1, date2): - ids = map(lambda x: x.id, accounts) - if not len(ids): - return 0.0 - account_analytic_obj = self.pool.get('account.analytic.account') - ids2 = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', ids)]) - self.cr.execute("SELECT sum(amount) \ - FROM account_analytic_line \ - WHERE account_id IN ("+','.join(map(str, ids2))+") \ - AND date>=%s AND date<=%s AND amount>0", - (date1, date2)) - return self.cr.fetchone()[0] or 0.0 - def _sum_credit(self, accounts, date1, date2): - ids = map(lambda x: x.id, accounts) + +# def _move_sum_debit(self, account_id, date1, date2): +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', [account_id])]) +# self.cr.execute("SELECT sum(amount) \ +# FROM account_analytic_line \ +# WHERE account_id in ("+ ','.join(map(str, ids)) +") \ +# AND date>=%s AND date<=%s AND amount>0", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 +# +# def _move_sum_credit(self, account_id, date1, date2): +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', [account_id])]) +# self.cr.execute("SELECT -sum(amount) \ +# FROM account_analytic_line \ +# WHERE account_id in ("+ ','.join(map(str, ids)) +") \ +# AND date>=%s AND date<=%s AND amount<0", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 +# + def _move_sum_balance(self, account_id, date1, date2): + debit = self._move_sum(account_id, date1, date2, 'debit') + credit = self._move_sum(account_id, date1, date2, 'credit') + return (debit-credit) + +# def _move_sum_quantity(self, account_id, date1, date2): +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', [account_id])]) +# self.cr.execute("SELECT sum(unit_amount) \ +# FROM account_analytic_line \ +# WHERE account_id in ("+ ','.join(map(str, ids)) +") \ +# AND date>=%s AND date<=%s", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 + + def _sum_all(self, accounts, date1, date2, option): + ids = map(lambda x: x['id'], accounts) + if not len(ids): return 0.0 - ids = map(lambda x: x.id, accounts) - account_analytic_obj = self.pool.get('account.analytic.account') - ids2 = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', ids)]) - self.cr.execute("SELECT -sum(amount) \ - FROM account_analytic_line \ - WHERE account_id IN ("+','.join(map(str, ids2))+") \ - AND date>=%s AND date<=%s AND amount<0", - (date1, date2)) + + if not self.acc_sum_list: + account_analytic_obj = self.pool.get('account.analytic.account') + ids2 = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', ids)]) + self.acc_sum_list = ids2 + else: + ids2 = self.acc_sum_list + + if option == "debit" : + self.cr.execute("SELECT sum(amount) FROM account_analytic_line \ + WHERE account_id IN ("+','.join(map(str, ids2))+") \ + AND date>=%s AND date<=%s AND amount>0", + (date1, date2)) + elif option == "credit" : + self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \ + WHERE account_id IN ("+','.join(map(str, ids2))+") \ + AND date>=%s AND date<=%s AND amount<0", + (date1, date2)) + elif option == "quantity" : + self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \ + WHERE account_id IN ("+','.join(map(str, ids2))+") \ + AND date>=%s AND date<=%s", + (date1, date2)) return self.cr.fetchone()[0] or 0.0 + +# def _sum_debit(self, accounts, date1, date2): +# ids = map(lambda x: x['id'], accounts) +# if not len(ids): +# return 0.0 +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids2 = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', ids)]) +# self.cr.execute("SELECT sum(amount) \ +# FROM account_analytic_line \ +# WHERE account_id IN ("+','.join(map(str, ids2))+") \ +# AND date>=%s AND date<=%s AND amount>0", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 +# +# def _sum_credit(self, accounts, date1, date2): +# ids = map(lambda x: x['id'], accounts) +# if not len(ids): +# return 0.0 +# ids = map(lambda x: x['id'], accounts) +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids2 = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', ids)]) +# self.cr.execute("SELECT -sum(amount) \ +# FROM account_analytic_line \ +# WHERE account_id IN ("+','.join(map(str, ids2))+") \ +# AND date>=%s AND date<=%s AND amount<0", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 + def _sum_balance(self, accounts, date1, date2): - debit = self._sum_debit(accounts, date1, date2) or 0.0 - credit = self._sum_credit(accounts, date1, date2) or 0.0 + debit = self._sum_all(accounts, date1, date2, 'debit') or 0.0 + credit = self._sum_all(accounts, date1, date2, 'credit') or 0.0 return (debit-credit) - def _sum_quantity(self, accounts, date1, date2): - ids = map(lambda x: x.id, accounts) - if not len(ids): - return 0.0 - account_analytic_obj = self.pool.get('account.analytic.account') - ids2 = account_analytic_obj.search(self.cr, self.uid, - [('parent_id', 'child_of', ids)]) - self.cr.execute("SELECT sum(unit_amount) \ - FROM account_analytic_line \ - WHERE account_id IN ("+','.join(map(str, ids2))+") \ - AND date>=%s AND date<=%s", - (date1, date2)) - return self.cr.fetchone()[0] or 0.0 +# def _sum_quantity(self, accounts, date1, date2): +# ids = map(lambda x: x['id'], accounts) +# if not len(ids): +# return 0.0 +# account_analytic_obj = self.pool.get('account.analytic.account') +# ids2 = account_analytic_obj.search(self.cr, self.uid, +# [('parent_id', 'child_of', ids)]) +# self.cr.execute("SELECT sum(unit_amount) \ +# FROM account_analytic_line \ +# WHERE account_id IN ("+','.join(map(str, ids2))+") \ +# AND date>=%s AND date<=%s", +# (date1, date2)) +# return self.cr.fetchone()[0] or 0.0 report_sxw.report_sxw('report.account.analytic.account.balance', 'account.analytic.account', 'addons/account/project/report/analytic_balance.rml', diff --git a/addons/account/project/report/analytic_balance.rml b/addons/account/project/report/analytic_balance.rml index 1e420418a4e..a9b39e49cc5 100644 --- a/addons/account/project/report/analytic_balance.rml +++ b/addons/account/project/report/analytic_balance.rml @@ -45,7 +45,7 @@ - + @@ -130,45 +130,45 @@ - [[ formatLang(sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit')) ]] - [[ formatLang(sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]] - [[ formatLang(sum_balance(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_balance(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'])) ]] - [[ formatLang(sum_quantity(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'quantity')) ]]
    - [[ repeatIn(objects,'o') ]] + [[ repeatIn(get_objects(data['form']['empty_acc']),'o') ]] - [[ o.code ]] + [[ o['code'] ]] - [[ o.complete_name ]] + [[ o['complete_name'] ]] - [[ formatLang(move_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'], 'debit')) ]] - [[ formatLang(move_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'], 'credit')) ]] - [[ formatLang(move_sum_balance(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(move_sum_balance(o['id'],data['form']['date1'],data['form']['date2'])) ]] - [[ formatLang(move_sum_quantity(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'], 'quantity')) ]] - [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]] + [[ repeatIn(lines_g(o['id'],data['form']['date1'],data['form']['date2']),'move_g') ]] [[ move_g['code'] ]] diff --git a/addons/account/project/wizard/wizard_account_analytic_balance_report.py b/addons/account/project/wizard/wizard_account_analytic_balance_report.py index bb487517354..57c9353ceeb 100644 --- a/addons/account/project/wizard/wizard_account_analytic_balance_report.py +++ b/addons/account/project/wizard/wizard_account_analytic_balance_report.py @@ -24,14 +24,16 @@ import time import wizard dates_form = ''' - + + ''' dates_fields = { - 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, - 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, + 'date1': {'string':'Start of Period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, + 'date2': {'string':'End of Period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, + 'empty_acc': {'string':'Empty Accounts ? ', 'type':'boolean', 'help':'Check if you want to display Accounts with 0 balance too.'}, } From 01c96820dbaf5a75db5a199f228705fda76152bd Mon Sep 17 00:00:00 2001 From: Jeroen van der Waal <> Date: Thu, 10 Sep 2009 14:42:54 +0530 Subject: [PATCH 036/104] [FIX]Fixed Partial deliveries problem lp bug: https://launchpad.net/bugs/399817 fixed bzr revid: hda@tinyerp.com-20090910091254-2xzcrzdvmgcigfmt --- addons/sale/sale.py | 19 ++++++++++++++++--- addons/stock/stock.py | 5 +++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 8afb332bc7d..1492143a7d0 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -492,7 +492,7 @@ class sale_order(osv.osv): if line.procurement_id: res.append(line.procurement_id.id) return res - + # if mode == 'finished': # returns True if all lines are done, False otherwise # if mode == 'canceled': @@ -504,9 +504,22 @@ class sale_order(osv.osv): notcanceled = False write_done_ids = [] write_cancel_ids = [] + stock_move_obj = self.pool.get('stock.move') + for order in self.browse(cr, uid, ids, context={}): - for line in order.order_line: - if (not line.procurement_id) or (line.procurement_id.state=='done'): + + #check for pending deliveries + pending_deliveries = False + + for line in order.order_line: + move_ids = stock_move_obj.search(cr, uid, [('sale_line_id','=', line.id)]) + for move in stock_move_obj.browse( cr, uid, move_ids ): + #if one of the related order lines is in state draft, auto or confirmed + #this order line is not yet delivered + if move.state in ('draft', 'auto', 'confirmed'): + pending_deliveries = True + + if ((not line.procurement_id) or (line.procurement_id.state=='done')) and not pending_deliveries: finished = True if line.state != 'done': write_done_ids.append(line.id) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 2a372d4eeed..039dfdd99fd 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1135,6 +1135,11 @@ class stock_move(osv.osv): if move.state in ('confirmed', 'waiting'): res = self.pool.get('stock.location')._product_reserve(cr, uid, [move.location_id.id], move.product_id.id, move.product_qty, {'uom': move.product_uom.id}) if res: + #_product_available_test depends on the next status for correct functioning + #the test does not work correctly if the same product occurs multiple times + #in the same order. This is e.g. the case when using the button 'split in two' of + #the stock outgoing form + self.write(cr, uid, move.id, {'state':'assigned'}) done.append(move.id) pickings[move.picking_id.id] = 1 r = res.pop(0) From d4e9825ce637aca71b106bcfc455a471de9e44e8 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 10 Sep 2009 18:18:05 +0530 Subject: [PATCH 037/104] [FIX] l10n_ch : default_value() of res.partner.bank corrected lp bug: https://launchpad.net/bugs/426831 fixed bzr revid: jvo@tinyerp.com-20090910124805-u2dgm48hxk0b79by --- addons/l10n_ch/partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_ch/partner.py b/addons/l10n_ch/partner.py index 5f3584563be..4dc9656826c 100755 --- a/addons/l10n_ch/partner.py +++ b/addons/l10n_ch/partner.py @@ -69,7 +69,7 @@ class res_partner_bank(osv.osv): if address['type'] == 'default': return address.get(field,False) elif not address['type']: - value = address[field] + value = address.get(field,False) else : value = False return value From 322a34009dc317eec8ff81e2e49ccbb57ac018f3 Mon Sep 17 00:00:00 2001 From: "Niels(Rrd15)" <> Date: Fri, 11 Sep 2009 14:47:12 +0530 Subject: [PATCH 038/104] [FIX] Project : task work behavior towards task hours corrected lp bug: https://launchpad.net/bugs/427388 fixed bzr revid: jvo@tinyerp.com-20090911091712-w5oi9z2wnjvuvb2j --- addons/project/project.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 72a7958e921..cc885eb5d95 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -433,8 +433,9 @@ class project_work(osv.osv): def write(self, cr, uid, ids,vals,context={}): if 'hours' in vals and (not vals['hours']): vals['hours'] = 0.00 - for work in self.browse(cr, uid, ids, context): - cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (vals.get('hours',0.0), work.hours, work.task_id.id)) + if 'hours' in vals: + for work in self.browse(cr, uid, ids, context): + cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (vals.get('hours',0.0), work.hours, work.task_id.id)) return super(project_work,self).write(cr, uid, ids, vals, context) def unlink(self, cr, uid, ids, *args, **kwargs): From d536112575d7f71320089485f19dd0a8c6f3323e Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 11 Sep 2009 19:42:19 +0530 Subject: [PATCH 039/104] [FIX] Project : Taks hours computed accurately. bzr revid: jvo@tinyerp.com-20090911141219-2i0wlal54ciqx975 --- addons/project/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/project.py b/addons/project/project.py index cc885eb5d95..aaf16082792 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -280,7 +280,7 @@ class task(osv.osv): 'planned_hours': fields.float('Planned Hours', required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'), 'effective_hours': fields.function(_hours_get, method=True, string='Hours Spent', multi='hours', store=True, help="Computed using the sum of the task work done."), - 'remaining_hours': fields.float('Remaining Hours', digits=(16,2), help="Total remaining time, can be re-estimated periodically by the assignee of the task."), + 'remaining_hours': fields.float('Remaining Hours', digits=(16,4), help="Total remaining time, can be re-estimated periodically by the assignee of the task."), 'total_hours': fields.function(_hours_get, method=True, string='Total Hours', multi='hours', store=True, help="Computed as: Time Spent + Remaining Time."), 'progress': fields.function(_hours_get, method=True, string='Progress (%)', multi='hours', store=True, help="Computed as: Time Spent / Total Time."), 'delay_hours': fields.function(_hours_get, method=True, string='Delay Hours', multi='hours', store=True, help="Computed as: Total Time - Estimated Time. It gives the difference of the time estimated by the project manager and the real time to close the task."), From c6e801a2d1414460f99e910a42767d9fd0db99bb Mon Sep 17 00:00:00 2001 From: "ACH(OpenERP)" <> Date: Fri, 11 Sep 2009 19:52:57 +0530 Subject: [PATCH 040/104] [FIX] hr_timesheet_sheet : Rounding value problem in float_time widget lp bug: https://launchpad.net/bugs/424177 fixed bzr revid: jvo@tinyerp.com-20090911142257-s8prbnz3lgymqsvu --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 9d8bdb1ba64..3fbf615ad18 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -576,7 +576,7 @@ class hr_timesheet_sheet_sheet_day(osv.osv): sheet_id, total_timesheet, total_attendance, - (total_attendance - total_timesheet) AS total_difference + round(cast((total_attendance - total_timesheet) as Numeric),2) AS total_difference FROM (( SELECT From 5b936460bde99ec63ace7255718eefc8c9c3e1f7 Mon Sep 17 00:00:00 2001 From: "Christophe Chauvet(Syleam)" <> Date: Fri, 11 Sep 2009 20:03:45 +0530 Subject: [PATCH 041/104] [FIX] Better translation exportation. lp bug: https://launchpad.net/bugs/425131 fixed bzr revid: jvo@tinyerp.com-20090911143345-tg9ypdltlqcguo9g --- bin/tools/translate.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/tools/translate.py b/bin/tools/translate.py index 1c0557908cf..51966b992bc 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -551,10 +551,12 @@ def trans_generate(lang, modules, dbname=None): installed_modids = modobj.search(cr, uid, [('state', '=', 'installed')]) installed_modules = map(lambda m: m['name'], modobj.read(cr, uid, installed_modids, ['name'])) - if tools.config['root_path'] in tools.config['addons_path'] : - path_list = [tools.config['root_path']] + root_path = os.path.join(tools.config['root_path'], 'addons') + + if root_path in tools.config['addons_path'] : + path_list = [root_path] else : - path_list = [tools.config['root_path'],tools.config['addons_path']] + path_list = [root_path,tools.config['addons_path']] for path in path_list: for root, dirs, files in tools.osutil.walksymlinks(path): From a4fbd2e0ffe239d3413c2aee9203565e06bbf7c8 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 11 Sep 2009 21:01:07 +0530 Subject: [PATCH 042/104] [FIX] Account : Making account.invoice.tax field language-depenant from account.tax lp bug: https://launchpad.net/bugs/407293 fixed bzr revid: jvo@tinyerp.com-20090911153107-r8dw1nf94xuyllmy --- addons/account/invoice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index ad38ff87e68..be9b4f63246 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -429,8 +429,9 @@ class account_invoice(osv.osv): ait_obj = self.pool.get('account.invoice.tax') for id in ids: cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,)) - partner = self.browse(cr, uid, id).partner_id - context.update({'lang': partner.lang}) + partner = self.browse(cr, uid, id,context=context).partner_id + if partner.lang: + context.update({'lang': partner.lang}) for taxe in ait_obj.compute(cr, uid, id, context=context).values(): ait_obj.create(cr, uid, taxe) # Update the stored value (fields.function), so we write to trigger recompute From bc8b4727657f9ffaeb14160072c0ed6e15e2d267 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Mon, 14 Sep 2009 16:16:58 +0530 Subject: [PATCH 043/104] [FIX]: fix the problem for related fields, related fields act as a many2one fields which is not exist in the db , so direct ql query will not work for them, direct sql will work only for many2one fields only to make relation with 2 tables lp bug: https://launchpad.net/bugs/379191 fixed bzr revid: mga@tinyerp.com-20090914104658-8submdrc2pjwflhy --- addons/base_report_creator/base_report_creator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index afe1ba310a5..0f3c118f219 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -214,13 +214,16 @@ class report_creator(osv.osv): reference_model_dict[v.get('relation')] = relation_count+1 else: reference_model_dict[v.get('relation')]=1 - str_where = model_dict.get(model)+"."+ k + "=" + model_dict.get(v.get('relation'))+'.id' - where_list.append(str_where) + + if isinstance(self.pool.get(model)._columns.get(k), fields.many2one): + str_where = model_dict.get(model)+"."+ k + "=" + model_dict.get(v.get('relation'))+'.id' + where_list.append(str_where) if reference_model_dict: self.model_set_id = model_dict.get(reference_model_dict.keys()[reference_model_dict.values().index(min(reference_model_dict.values()))]) if model_list and not len(model_dict.keys()) == 1: raise osv.except_osv(_('No Related Models!!'),_('These is/are model(s) (%s) in selection which is/are not related to any other model') % ','.join(model_list)) + print 'where_list : ', where_list if filter_ids and where_list<>[]: filter_list.append(' and ') filter_list.append(' ') From 9bee299b7fd0c8afe6ae2f2d574fc8945dcc97d7 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 14 Sep 2009 17:30:17 +0530 Subject: [PATCH 044/104] [FIX] hr_timesheet_invoice : Invoicing analytic entries wizard corrected for product lp bug: https://launchpad.net/bugs/427982 fixed bzr revid: jvo@tinyerp.com-20090914120017-n04v3zplm78d1shu --- .../wizard/hr_timesheet_invoice_create.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index 2b769cd1eae..6a7d878d1ae 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -92,19 +92,25 @@ class invoice_create(wizard.interface): "AND id IN (" + ','.join([str(x) for x in data['ids']]) + ") " \ "AND to_invoice IS NOT NULL " \ "GROUP BY product_id,to_invoice", (account.id,)) + for product_id,factor_id,qty in cr.fetchall(): product = pool.get('product.product').browse(cr, uid, product_id, context2) if not product: raise wizard.except_wizard(_('Error'), _('At least one line has no product !')) factor_name = '' factor = pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2) - if factor.customer_name: - factor_name = product.name+' - '+factor.customer_name + + if not data['form']['product']: + if factor.customer_name: + factor_name = product.name+' - '+factor.customer_name + else: + factor_name = product.name else: - factor_name = product.name + factor_name = pool.get('product.product').name_get(cr, uid, [data['form']['product']], context=context)[0][1] + if account.pricelist_id: pl = account.pricelist_id.id - price = pool.get('product.pricelist').price_get(cr,uid,[pl], product_id, qty or 1.0, account.partner_id.id)[pl] + price = pool.get('product.pricelist').price_get(cr,uid,[pl], data['form']['product'] or product_id, qty or 1.0, account.partner_id.id)[pl] else: price = 0.0 @@ -125,7 +131,7 @@ class invoice_create(wizard.interface): 'account_id': account_id, 'account_analytic_id': account.id, } - + # # Compute for lines # From f9a1493df58763af5e29e305933b36e51703c02e Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Mon, 14 Sep 2009 18:26:45 +0530 Subject: [PATCH 045/104] [FIX]: its better to aply the patch lp bug: https://launchpad.net/bugs/379191 fixed bzr revid: mga@tinyerp.com-20090914125645-r8hq41r0f3aj6vcd --- addons/base_report_creator/base_report_creator.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index 0f3c118f219..9959c3638db 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -199,7 +199,8 @@ class report_creator(osv.osv): fields_get = model_pool.fields_get(cr,uid) fields_filter = dict(filter(lambda x:x[1].get('relation',False) and x[1].get('relation') in rest_list - and x[1].get('type')=='many2one',fields_get.items())) + and x[1].get('type')=='many2one' + and not (isinstance(model_pool._columns[x[0]],fields.function) or isinstance(model_pool._columns[x[0]],fields.related)), fields_get.items())) if fields_filter: model in model_list and model_list.remove(model) model_count = reference_model_dict.get(model,False) @@ -215,15 +216,13 @@ class report_creator(osv.osv): else: reference_model_dict[v.get('relation')]=1 - if isinstance(self.pool.get(model)._columns.get(k), fields.many2one): - str_where = model_dict.get(model)+"."+ k + "=" + model_dict.get(v.get('relation'))+'.id' - where_list.append(str_where) + str_where = model_dict.get(model)+"."+ k + "=" + model_dict.get(v.get('relation'))+'.id' + where_list.append(str_where) if reference_model_dict: self.model_set_id = model_dict.get(reference_model_dict.keys()[reference_model_dict.values().index(min(reference_model_dict.values()))]) if model_list and not len(model_dict.keys()) == 1: raise osv.except_osv(_('No Related Models!!'),_('These is/are model(s) (%s) in selection which is/are not related to any other model') % ','.join(model_list)) - print 'where_list : ', where_list if filter_ids and where_list<>[]: filter_list.append(' and ') filter_list.append(' ') @@ -323,7 +322,7 @@ class report_creator(osv.osv): for obj in this_objs: for fld in obj.field_ids: model_column = self.pool.get(fld.field_id.model)._columns[fld.field_id.name] - if isinstance(model_column,fields.function) and not model_column.store: + if (isinstance(model_column,fields.function) or isinstance(model_column,fields.related)) and not model_column.store: return False return True From 90e6a956ec03f49ce3f1faecf67872787e35724b Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 14 Sep 2009 18:40:25 +0530 Subject: [PATCH 046/104] [FIX] CRM : Mailgate script used default uid=3 instead of 1 lp bug: https://launchpad.net/bugs/429203 fixed bzr revid: jvo@tinyerp.com-20090914131025-rcgolugvmp7v7ws1 --- addons/crm/scripts/openerp-mailgate/openerp-mailgate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py index 11169a4e215..6901fde7a14 100755 --- a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py +++ b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py @@ -309,7 +309,7 @@ if __name__ == '__main__': "with the Open ERP 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 Open ERP", default=3, type='int') + parser.add_option("-u", "--user", dest="userid", help="ID of the user in Open ERP", default=1, type='int') parser.add_option("-p", "--password", dest="password", help="Password of the user in Open ERP", default='admin') parser.add_option("-e", "--email", dest="email", help="Email address used in the From field of outgoing messages") parser.add_option("-s", "--section", dest="section", help="ID or code of the case section", default="support") From 0d565d8882c50555677fd9cbece509796e44e1e5 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Tue, 15 Sep 2009 11:14:50 +0530 Subject: [PATCH 047/104] [ADD]: add new data file which will add over due payment message to company bzr revid: mga@tinyerp.com-20090915054450-1ju59ok5ev4pw8yg --- addons/account_followup/__terp__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_followup/__terp__.py b/addons/account_followup/__terp__.py index 00e86ef2d96..5122204fa68 100644 --- a/addons/account_followup/__terp__.py +++ b/addons/account_followup/__terp__.py @@ -53,6 +53,7 @@ 'wizard/wizard_view.xml', 'followup_report_view.xml', 'followup_view.xml', + 'followup_data.xml' ], 'demo_xml': ['followup_demo.xml'], 'installable': True, From d16353aad85dd6c66005f972b8f2ac108823b86a Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Tue, 15 Sep 2009 11:15:34 +0530 Subject: [PATCH 048/104] [IMP]: add new filed to company object which will store the mesages bzr revid: mga@tinyerp.com-20090915054534-7ancl4t5bcqsif7q --- addons/account_followup/followup.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/addons/account_followup/followup.py b/addons/account_followup/followup.py index 459e3e38e3c..9efd1d0a1ff 100644 --- a/addons/account_followup/followup.py +++ b/addons/account_followup/followup.py @@ -55,6 +55,29 @@ class account_move_line(osv.osv): } account_move_line() +class res_company(osv.osv): + _inherit = "res.company" + _columns = { + 'follow_up_msg' : fields.text('Follow-up Message', translate=True), + } + + _defaults = { + 'overdue_msg': lambda *a: ''' +Date : %(date)s + +Dear %(partner_name)s, + +Please find in attachment a reminder of all your unpaid invoices, for a total amount due of: + +%(followup_amount).2f %(company_currency)s + +Thanks, +-- +%(user_signature)s +%(company_name)s + ''' + } +res_company() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 2168cad83e586daa9d0b5d1694812fd0dc0794b8 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Tue, 15 Sep 2009 11:16:21 +0530 Subject: [PATCH 049/104] [IMP]: add inherited view for company bzr revid: mga@tinyerp.com-20090915054621-7iyfnle7otqkday3 --- addons/account_followup/followup_view.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/account_followup/followup_view.xml b/addons/account_followup/followup_view.xml index 1b2d40a7cd9..cd02355dc7e 100644 --- a/addons/account_followup/followup_view.xml +++ b/addons/account_followup/followup_view.xml @@ -125,7 +125,6 @@ - @@ -136,6 +135,17 @@ - + + res.company.followup.form.inherit + + res.company + form + + + + + + + From 24233606a20a6422abc6f0b5c3aae895f4320401 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Tue, 15 Sep 2009 11:16:42 +0530 Subject: [PATCH 050/104] [CHANGE]: change a logic to read the message from company configuration bzr revid: mga@tinyerp.com-20090915054642-qg0zz31wkgdv24u8 --- addons/account_followup/wizard/wizard_followup_print.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/account_followup/wizard/wizard_followup_print.py b/addons/account_followup/wizard/wizard_followup_print.py index e271d1dbd27..9d1f4c6deef 100644 --- a/addons/account_followup/wizard/wizard_followup_print.py +++ b/addons/account_followup/wizard/wizard_followup_print.py @@ -256,8 +256,10 @@ class followup_all_print(wizard.interface): if partner_id not in partner_list: partner_list.append(partner_id) to_update[str(id)] = fups[followup_line_id][1] - - return {'partner_ids': partner_list, 'to_update': to_update} + + message = pool.get('res.users').browse(cr, uid, uid).company_id.follow_up_msg + + return {'partner_ids': partner_list, 'to_update': to_update, 'email_body':message} def _get_screen1_values(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) From 323d71fecb5a61c9bdd9be3faf0ed21a26f865f5 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 15 Sep 2009 12:43:23 +0530 Subject: [PATCH 052/104] [IMP] Rng : Accepting Groups under/after/replacing Buttons bzr revid: jvo@tinyerp.com-20090915071323-c4hcvh1uzg18p7si --- bin/addons/base/rng/view.rng | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/addons/base/rng/view.rng b/bin/addons/base/rng/view.rng index 78944519593..d69c09df72a 100644 --- a/bin/addons/base/rng/view.rng +++ b/bin/addons/base/rng/view.rng @@ -378,6 +378,7 @@ + From 4c3b285cbfed2c5920a5aed97e214b29e722b76c Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 15 Sep 2009 09:42:59 +0200 Subject: [PATCH 053/104] [FIX] #416908 computation of invoice lines bzr revid: fp@tinyerp.com-20090915074259-bbnrkmbftvawuz9d --- addons/account/invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index be9b4f63246..467bf02f661 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -435,7 +435,7 @@ class account_invoice(osv.osv): for taxe in ait_obj.compute(cr, uid, id, context=context).values(): ait_obj.create(cr, uid, taxe) # Update the stored value (fields.function), so we write to trigger recompute - self.pool.get('account.invoice').write(cr, uid, ids, {}, context=context) + self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=context) # self.pool.get('account.invoice').write(cr, uid, ids, {}, context=context) return True From dbc2adadf22d414d3fa5881293d5ee8c7ac71f2f Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 15 Sep 2009 10:17:44 +0200 Subject: [PATCH 054/104] [FIX] regression in fields.function computation bzr revid: fp@tinyerp.com-20090915081744-0l9k2v8a86fl036l --- bin/osv/orm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 08086f5d49b..f5be539a6d6 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -2469,9 +2469,10 @@ class orm(orm_template): if c[0].startswith('default_'): del rel_context[c[0]] + result = [] for field in upd_todo: for id in ids: - self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) + result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or [] for table in self._inherits: col = self._inherits[table] @@ -2533,7 +2534,7 @@ class orm(orm_template): cr.execute('update '+self._table+' set parent_right=parent_right+%s where parent_right>=%s', (distance, position)) cr.execute('update '+self._table+' set parent_left=parent_left-%s, parent_right=parent_right-%s where parent_left>=%s and parent_left<%s', (pleft-position+distance,pleft-position+distance, pleft+distance, pright+distance)) - result = self._store_get_values(cr, user, ids, vals.keys(), context) + result += self._store_get_values(cr, user, ids, vals.keys(), context) for order, object, ids, fields in result: self.pool.get(object)._store_set_values(cr, user, ids, fields, context) From 1bb8131a248921265139984f7008bb1494cab70c Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Tue, 15 Sep 2009 15:16:27 +0530 Subject: [PATCH 055/104] [ADD]: add missing file for the followup date bzr revid: mga@tinyerp.com-20090915094627-kqjklsjvaqcehsgh --- addons/account_followup/followup_data.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 addons/account_followup/followup_data.xml diff --git a/addons/account_followup/followup_data.xml b/addons/account_followup/followup_data.xml new file mode 100644 index 00000000000..2a33e65b2c8 --- /dev/null +++ b/addons/account_followup/followup_data.xml @@ -0,0 +1,19 @@ + + + + + Date : %(date)s + +Dear %(partner_name)s, + +Please find in attachment a reminder of all your unpaid invoices, for a total amount due of: + +%(followup_amount).2f %(company_currency)s + +Thanks, +-- +%(user_signature)s +%(company_name)s + + + From 7955f8e23c26ba519e07a99747636cbaef40242b Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Tue, 15 Sep 2009 15:21:33 +0530 Subject: [PATCH 056/104] [FIX]: fix problem to get the detault message bzr revid: mga@tinyerp.com-20090915095133-52t8294uj75h7a9i --- addons/account_followup/wizard/wizard_followup_print.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account_followup/wizard/wizard_followup_print.py b/addons/account_followup/wizard/wizard_followup_print.py index 9d1f4c6deef..004f62503bd 100644 --- a/addons/account_followup/wizard/wizard_followup_print.py +++ b/addons/account_followup/wizard/wizard_followup_print.py @@ -156,6 +156,7 @@ class followup_all_print(wizard.interface): if adr.email: dest = [adr.email] src = tools.config.options['smtp_user'] + #TODO : fix me to get message according to the partner language body=data['form']['email_body'] total_amt = followup_data.debit - followup_data.credit move_line = '' @@ -257,7 +258,7 @@ class followup_all_print(wizard.interface): partner_list.append(partner_id) to_update[str(id)] = fups[followup_line_id][1] - message = pool.get('res.users').browse(cr, uid, uid).company_id.follow_up_msg + message = pool.get('res.users').browse(cr, uid, uid, context=context).company_id.follow_up_msg return {'partner_ids': partner_list, 'to_update': to_update, 'email_body':message} From c2d470b4f77966cc71cbea9bcba8d79a32cc935f Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Tue, 15 Sep 2009 15:38:24 +0530 Subject: [PATCH 057/104] [FIX]: fix a problem for the overdue payment message message should be depending on the partner language and not according to the company language bzr revid: mga@tinyerp.com-20090915100824-618bu2tot1l5jlwu --- addons/account/company.py | 2 +- addons/account/report/overdue.py | 8 +++++++- addons/account/report/overdue.rml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/account/company.py b/addons/account/company.py index 403b886e012..e724b3a9775 100644 --- a/addons/account/company.py +++ b/addons/account/company.py @@ -25,7 +25,7 @@ from osv import fields, osv class res_company(osv.osv): _inherit = "res.company" _columns = { - 'overdue_msg' : fields.text('Overdue Payments Message'), + 'overdue_msg' : fields.text('Overdue Payments Message', translate=True), } _defaults = { diff --git a/addons/account/report/overdue.py b/addons/account/report/overdue.py index 76ebbe7efa4..861ad82ef9c 100644 --- a/addons/account/report/overdue.py +++ b/addons/account/report/overdue.py @@ -35,6 +35,7 @@ class Overdue(report_sxw.rml_parse): 'adr_get' : self._adr_get, 'getLines' : self._lines_get, 'tel_get' : self._tel_get, + 'message' : self._message, }) self.context = context def _adr_get(self, partner, type): @@ -80,7 +81,12 @@ class Overdue(report_sxw.rml_parse): ('state', '<>', 'draft'), ('reconcile_id', '=', False)]) movelines = moveline_obj.browse(self.cr, self.uid, movelines) return movelines - + + def _message(self, obj, company): + company_pool = pooler.get_pool(self.cr.dbname).get('res.company') + message = company_pool.browse(self.cr, self.uid, company.id, {'lang':obj.lang}).overdue_msg + return message + report_sxw.report_sxw('report.account.overdue', 'res.partner', 'addons/account/report/overdue.rml', parser=Overdue) diff --git a/addons/account/report/overdue.rml b/addons/account/report/overdue.rml index df4c69c45b4..2713b665d06 100644 --- a/addons/account/report/overdue.rml +++ b/addons/account/report/overdue.rml @@ -127,7 +127,7 @@ - [[ company.overdue_msg ]] + [[ message(o, company) ]] From 4e81bf70fc1c9d48d40648fb723441eab681af1b Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Tue, 15 Sep 2009 15:53:46 +0530 Subject: [PATCH 058/104] [FIX]: fix the problem of message depending on the partner language bzr revid: mga@tinyerp.com-20090915102346-dk516xhreyex04w9 --- .../wizard/wizard_followup_print.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/addons/account_followup/wizard/wizard_followup_print.py b/addons/account_followup/wizard/wizard_followup_print.py index 004f62503bd..70f90f2d6ae 100644 --- a/addons/account_followup/wizard/wizard_followup_print.py +++ b/addons/account_followup/wizard/wizard_followup_print.py @@ -60,8 +60,9 @@ _followup_wizard_all_form = """ + - + @@ -94,6 +95,12 @@ _followup_wizard_all_fields = { 'size': 64, 'default': 'Invoices Reminder' }, + 'partner_lang':{ + 'string': "Send Email in Partner Language", + 'type': 'boolean', + 'default':True, + 'help':'Do not change message text, if you want to send email in partner language, or configre from company' + }, 'email_body': { 'string': "Email body", 'type': 'text', @@ -156,8 +163,13 @@ class followup_all_print(wizard.interface): if adr.email: dest = [adr.email] src = tools.config.options['smtp_user'] - #TODO : fix me to get message according to the partner language - body=data['form']['email_body'] + if not data['form']['partner_lang']: + body = data['form']['email_body'] + else: + cxt = context.copy() + cxt['lang'] = partner.lang + body = pool.get('res.users').browse(cr, uid, uid, context=cxt).company_id.follow_up_msg + total_amt = followup_data.debit - followup_data.credit move_line = '' subtotal_due = 0.0 From 8316098a65481a400d00d10320301b699be4d210 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Tue, 15 Sep 2009 16:00:41 +0530 Subject: [PATCH 059/104] [IMP]quality_integration_server: get message from base_quality_module if module can not success to reach minimun score bzr revid: hmo@tinyerp.com-20090915103041-ehna9rq1sm9q1xyt --- .../quality_integration_server/base_quality_interrogation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index 48c2ef29278..a5a69898752 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -114,6 +114,7 @@ def check_quality(uri, user, pwd, dbname, modules): for module in modules: quality_result = execute(conn,'execute', dbname, uid, pwd,'module.quality.check','check_quality',module) detail_html = '' + msg = detail.get('message','') html = '''''' html +="

    Module : %s

    "%(quality_result['name']) html += "

    Final score : %s

    "%(quality_result['final_score']) @@ -124,7 +125,7 @@ def check_quality(uri, user, pwd, dbname, modules): score = round(float(detail.get('score',0)),2) html += "
  • %s
  • "%(test.replace(' ','-'),test) detail_html +="

    %s (Score : %s)

    %s
    "%(test.replace(' ','-'),test,score,detail.get('detail')) - test_detail[test] = (score,detail.get('detail','')) + test_detail[test] = (score,msg,detail.get('detail','')) html += "%s"%(detail_html) html += "" final[quality_result['name']] = (quality_result['final_score'],html,test_detail) From 7cb036f0e13e7816685cb8a24e18950247d487a5 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 15 Sep 2009 13:24:51 +0200 Subject: [PATCH 060/104] [IMP] changed interval CRM calls to 4 hours instead of one -> efficient connection pooling with cron bzr revid: fp@tinyerp.com-20090915112451-xf4j2q3pttfy2brh --- addons/crm/crm_data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_data.xml b/addons/crm/crm_data.xml index 7ba270d268f..5fc5ad1bd94 100644 --- a/addons/crm/crm_data.xml +++ b/addons/crm/crm_data.xml @@ -58,7 +58,7 @@ Check cases rules - 1 + 4 hours -1 From a5c907c11a712e976144bb03f1908f64eb0b9d47 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Tue, 15 Sep 2009 17:17:48 +0530 Subject: [PATCH 061/104] [FIX]quality_integration_server: get message from base_quality_module if module can not success to reach minimun score bzr revid: hmo@tinyerp.com-20090915114748-qk1mwa5s98j1x0wu --- .../quality_integration_server/base_quality_interrogation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index a5a69898752..65bb7f5f849 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -113,8 +113,7 @@ def check_quality(uri, user, pwd, dbname, modules): test_detail = {} for module in modules: quality_result = execute(conn,'execute', dbname, uid, pwd,'module.quality.check','check_quality',module) - detail_html = '' - msg = detail.get('message','') + detail_html = '' html = '''''' html +="

    Module : %s

    "%(quality_result['name']) html += "

    Final score : %s

    "%(quality_result['final_score']) @@ -122,6 +121,7 @@ def check_quality(uri, user, pwd, dbname, modules): html += "
      " for x,y,detail in quality_result['check_detail_ids']: test = detail.get('name') + msg = detail.get('message','') score = round(float(detail.get('score',0)),2) html += "
    • %s
    • "%(test.replace(' ','-'),test) detail_html +="

      %s (Score : %s)

      %s
      "%(test.replace(' ','-'),test,score,detail.get('detail')) From 5ecb23eb538ca750e7ec2f80844b35c1f5cd702c Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 15 Sep 2009 15:01:18 +0200 Subject: [PATCH 062/104] [IMP] Invoice Supplier Control per line/manual bzr revid: fp@tinyerp.com-20090915130118-p7ynmca1tp9wyer0 --- addons/purchase_manual/__init__.py | 25 +++ addons/purchase_manual/__terp__.py | 42 +++++ addons/purchase_manual/purchase_manual.py | 78 +++++++++ .../purchase_manual/purchase_manual_view.xml | 117 +++++++++++++ .../purchase_manual_wizard.xml | 14 ++ addons/purchase_manual/wizard/__init__.py | 1 + .../wizard/wizard_purchase_line_invoice.py | 161 ++++++++++++++++++ addons/sale/sale.py | 2 +- 8 files changed, 439 insertions(+), 1 deletion(-) create mode 100644 addons/purchase_manual/__init__.py create mode 100644 addons/purchase_manual/__terp__.py create mode 100644 addons/purchase_manual/purchase_manual.py create mode 100644 addons/purchase_manual/purchase_manual_view.xml create mode 100644 addons/purchase_manual/purchase_manual_wizard.xml create mode 100644 addons/purchase_manual/wizard/__init__.py create mode 100644 addons/purchase_manual/wizard/wizard_purchase_line_invoice.py diff --git a/addons/purchase_manual/__init__.py b/addons/purchase_manual/__init__.py new file mode 100644 index 00000000000..c15d258564d --- /dev/null +++ b/addons/purchase_manual/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +import purchase_manual +import wizard + diff --git a/addons/purchase_manual/__terp__.py b/addons/purchase_manual/__terp__.py new file mode 100644 index 00000000000..d9c3087c86c --- /dev/null +++ b/addons/purchase_manual/__terp__.py @@ -0,0 +1,42 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'Purchase Management - Manual Control of Invoice', + 'version': '1.1', + 'category': 'Generic Modules/Sales & Purchases', + 'description': """Module for purchase management, manual control of invoice""", + 'author': 'Tiny', + 'website': 'http://www.openerp.com', + 'depends': ['purchase'], + 'init_xml': [], + 'update_xml': [ + 'purchase_manual_view.xml', + 'purchase_manual_wizard.xml', + ], + 'demo_xml': [], + 'installable': True, + 'active': False, + 'certificate': False, +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/purchase_manual/purchase_manual.py b/addons/purchase_manual/purchase_manual.py new file mode 100644 index 00000000000..e5d32ca49cc --- /dev/null +++ b/addons/purchase_manual/purchase_manual.py @@ -0,0 +1,78 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields +from osv import osv +import netsvc + +class purchase_order_line(osv.osv): + _inherit='purchase.order.line' + _columns = { + 'state': fields.selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'Status', required=True, readonly=True), + 'invoice_lines': fields.many2many('account.invoice.line', 'purchase_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True), + 'invoiced': fields.boolean('Invoiced', readonly=True), + 'partner_id': fields.related('order_id','partner_id',string='Partner',readonly=True,type="many2one", relation="res.partner"), + 'date_order': fields.related('order_id','date_order',string='Order Date',readonly=True,type="date") + } + _defaults = { + 'state': lambda *args: 'draft', + 'invoiced': lambda *a: 0, + + } + def copy_data(self, cr, uid, id, default=None, context={}): + print 'copy called' + if not default: + default = {} + default.update({ + 'state':'draft', + 'invoiced':0, + 'invoice_lines':[], + }) + return super(purchase_order_line, self).copy_data(cr, uid, id, default, context) + + def action_confirm(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state': 'confirmed'}, context) + return True +purchase_order_line() + +class purchase_order(osv.osv): + _inherit='purchase.order' + def action_invoice_create(self, cr, uid, ids, context={}): + print 'Invoice Create' + res = super(purchase_order, self).action_invoice_create(cr, uid, ids, context) + for po in self.browse(cr, uid, ids, context): + todo = [] + for line in po.order_line: + todo.append(line.id) + self.pool.get('purchase.order.line').write(cr, uid, todo, {'invoiced':True}, context) + return res + + def wkf_confirm_order(self, cr, uid, ids, context={}): + res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context) + todo = [] + for po in self.browse(cr, uid, ids, context): + for line in po.order_line: + if line.state=='draft': + todo.append(line.id) + self.pool.get('purchase.order.line').action_confirm(cr, uid, todo, context) + return res +purchase_order() diff --git a/addons/purchase_manual/purchase_manual_view.xml b/addons/purchase_manual/purchase_manual_view.xml new file mode 100644 index 00000000000..5ef2d7ac3bb --- /dev/null +++ b/addons/purchase_manual/purchase_manual_view.xml @@ -0,0 +1,117 @@ + + + + + # + # Define PO Line Views + # + + purchase.order.line.form + purchase.order.line + form + 20 + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      + + + purchase.order.line.tree + purchase.order.line + tree + 20 + + + + + + + + + + + + + + + + + + # + # Inherit PO view to get buttons + # + + + Purchase Order Lines + ir.actions.act_window + purchase.order.line + tree,form + + + + tree + + + + + + form + + + + + + + Uninvoiced Purchase Order Lines + ir.actions.act_window + purchase.order.line + [('state','in',('confirmed','done')), ('invoiced','=',False)] + form + tree,form + + + + tree + + + + + + form + + + + + +
      +
      diff --git a/addons/purchase_manual/purchase_manual_wizard.xml b/addons/purchase_manual/purchase_manual_wizard.xml new file mode 100644 index 00000000000..62771cf9fbb --- /dev/null +++ b/addons/purchase_manual/purchase_manual_wizard.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/addons/purchase_manual/wizard/__init__.py b/addons/purchase_manual/wizard/__init__.py new file mode 100644 index 00000000000..616c5c7090c --- /dev/null +++ b/addons/purchase_manual/wizard/__init__.py @@ -0,0 +1 @@ +import wizard_purchase_line_invoice diff --git a/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py b/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py new file mode 100644 index 00000000000..89d7d188287 --- /dev/null +++ b/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py @@ -0,0 +1,161 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +import wizard +import netsvc +import ir +import pooler + +invoice_form = """ +
      + + +""" + +invoice_fields = { +} + +def _makeInvoices(self, cr, uid, data, context): + pool = pooler.get_pool(cr.dbname) + res = False + invoices = {} + + def make_invoice(order, lines): + a = order.partner_id.property_account_payable.id + if order.partner_id and order.partner_id.property_payment_term.id: + pay_term = order.partner_id.property_payment_term.id + else: + pay_term = False + inv = { + 'name': order.name, + 'origin': order.name, + 'type': 'in_invoice', + 'reference': "P%dPO%d" % (order.partner_id.id, order.id), + 'account_id': a, + 'partner_id': order.partner_id.id, + 'address_invoice_id': order.partner_address_id.id, + 'address_contact_id': order.partner_address_id.id, + 'invoice_line': [(6,0,lines)], + 'currency_id' : order.pricelist_id.currency_id.id, + 'comment': order.notes, + 'payment_term': pay_term, + 'fiscal_position': order.partner_id.property_account_position.id + } + inv_id = pool.get('account.invoice').create(cr, uid, inv) + return inv_id + + for line in pool.get('purchase.order.line').browse(cr,uid,data['ids']): + if (not line.invoiced) and (line.state not in ('draft','cancel')): + if not line.order_id.id in invoices: + invoices[line.order_id.id] = [] + if line.product_id: + a = line.product_id.product_tmpl_id.property_account_expense.id + if not a: + a = line.product_id.categ_id.property_account_expense_categ.id + if not a: + raise osv.except_osv(_('Error !'), + _('There is no expense account defined ' \ + 'for this product: "%s" (id:%d)') % \ + (line.product_id.name, line.product_id.id,)) + else: + a = pool.get('ir.property').get(cr, uid, + 'property_account_expense_categ', 'product.category', + context=context) + fpos = line.order_id.fiscal_position or False + a = pool.get('account.fiscal.position').map_account(cr, uid, fpos, a) + inv_id = pool.get('account.invoice.line').create(cr, uid, { + 'name': line.name, + 'origin': line.order_id.name, + 'account_id': a, + 'price_unit': line.price_unit, + 'quantity': line.product_qty, + 'uos_id': line.product_uom.id, + 'product_id': line.product_id.id or False, + 'invoice_line_tax_id': [(6, 0, [x.id for x in line.taxes_id])], + 'note': line.notes, + 'account_analytic_id': line.account_analytic_id and line.account_analytic_id.id or False, + }) + cr.execute('insert into purchase_order_line_invoice_rel (order_line_id,invoice_id) values (%s,%s)', (line.id, inv_id)) + pool.get('purchase.order.line').write(cr, uid, [line.id], {'invoiced': True}) + invoices[line.order_id.id].append((line,inv_id)) + + res = [] + for result in invoices.values(): + order = result[0][0].order_id + il = map(lambda x: x[1], result) + res.append(make_invoice(order, il)) + return {'invoice_ids': res} + + return { + 'domain': "[('id','in', ["+','.join(map(str,res))+"])]", + 'name': _('Supplier Invoices'), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'account.invoice', + 'view_id': False, + 'context': "{'type':'in_invoice'}", + 'type': 'ir.actions.act_window' + } + +class line_make_invoice(wizard.interface): + def _open_invoice(self, cr, uid, data, context): + pool_obj = pooler.get_pool(cr.dbname) + model_data_ids = pool_obj.get('ir.model.data').search(cr,uid,[('model','=','ir.ui.view'),('name','=','invoice_supplier_form')]) + resource_id = pool_obj.get('ir.model.data').read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id'] + return { + 'domain': "[('id','in', ["+','.join(map(str,data['form']['invoice_ids']))+"])]", + 'name': 'Invoices', + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'account.invoice', + 'views': [(False,'tree'),(resource_id,'form')], + 'context': "{'type':'in_invoice'}", + 'type': 'ir.actions.act_window' + } + + states = { + 'init' : { + 'actions': [], + 'result': { + 'type': 'form', + 'arch': invoice_form, + 'fields': invoice_fields, + 'state': [ + ('end', 'Cancel'), + ('invoice', 'Create invoices') + ] + } + }, + 'invoice' : { + 'actions' : [_makeInvoices], + 'result' : {'type': 'state', 'state': 'open'} + }, + 'open': { + 'actions': [], + 'result': {'type':'action', 'action':_open_invoice, 'state':'end'} + } + } + +line_make_invoice("purchase.order.line.make_invoice") + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 1492143a7d0..6b50cd3cb48 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -829,7 +829,7 @@ class sale_order_line(osv.osv): 'product_id': line.product_id.id or False, 'invoice_line_tax_id': [(6, 0, [x.id for x in line.tax_id])], 'note': line.notes, - 'account_analytic_id': line.order_id.project_id.id, + 'account_analytic_id': line.order_id.project_id and line.order_id.project_id.id or False, }) cr.execute('insert into sale_order_line_invoice_rel (order_line_id,invoice_id) values (%s,%s)', (line.id, inv_id)) self.write(cr, uid, [line.id], {'invoiced': True}) From 7a3717d54ce772c5ba61fbf30f85b64a36d26409 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 15 Sep 2009 21:09:38 +0530 Subject: [PATCH 063/104] [FIX] Hr_timesheet_invoice : Query calculation corrected lp bug: https://launchpad.net/bugs/430043 fixed bzr revid: jvo@tinyerp.com-20090915153938-2lcgt5kwwhvmayse --- addons/hr_timesheet_invoice/hr_timesheet_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index 6f29c056d34..0c16fb4ffd4 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -44,7 +44,7 @@ class account_analytic_account(osv.osv): res = {} for account in self.browse(cr, uid, ids): invoiced = {} - cr.execute('select distinct l.invoice_id from hr_analytic_timesheet h left join account_analytic_line l on (h.line_id=l.id) where account_id=1', (account.id,)) + cr.execute('select distinct(l.invoice_id) from hr_analytic_timesheet h left join account_analytic_line l on (h.line_id=l.id) where account_id=%s', (account.id,)) invoice_ids = filter(None, map(lambda x: x[0], cr.fetchall())) for invoice in self.pool.get('account.invoice').browse(cr, uid, invoice_ids, context): res.setdefault(account.id, 0.0) From d3206b046ab59987d80ac535a164d50632d36a78 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 16 Sep 2009 12:46:34 +0530 Subject: [PATCH 064/104] [FIX] Base_report_creator : Print screen report is now available for custom reports lp bug: https://launchpad.net/bugs/379645 fixed bzr revid: jvo@tinyerp.com-20090916071634-43xkyf15v1stzn4q --- addons/base_report_creator/base_report_creator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index 9959c3638db..af7049bd894 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -51,7 +51,7 @@ from tools.translate import _ class report_creator(osv.osv): _name = "base_report_creator.report" _description = "Report" - + model_set_id = False # # Should request only used fields # @@ -131,7 +131,9 @@ class report_creator(osv.osv): if (not context) or 'report_id' not in context: return super(report_creator, self).read(cr, user, ids, fields, context, load) ctx = context or {} - wp = [self._id_get(cr, user, context['report_id'], context)+(' in (%s)' % (','.join(map(lambda x: "'"+str(x)+"'",ids))))] + wp = '' + if self.model_set_id: + wp = [self._id_get(cr, user, context['report_id'], context)+(' in (%s)' % (','.join(map(lambda x: "'"+str(x)+"'",ids))))] report = self._sql_query_get(cr, user, [context['report_id']], 'sql_query', None, ctx, where_plus = wp) sql_query = report[context['report_id']] cr.execute(sql_query) From bc39c5a14b65902348b5a5ddc15b1e6a93e39ba5 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 16 Sep 2009 12:47:08 +0530 Subject: [PATCH 065/104] [FIX] Print screen : Correction when text for report is already encoded lp bug: https://launchpad.net/bugs/379645 fixed bzr revid: jvo@tinyerp.com-20090916071708-xc93saplay5apvjn --- bin/report/printscreen/ps_list.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/report/printscreen/ps_list.py b/bin/report/printscreen/ps_list.py index 8534fd5c887..d2f946e6715 100644 --- a/bin/report/printscreen/ps_list.py +++ b/bin/report/printscreen/ps_list.py @@ -51,7 +51,10 @@ class report_printscreen_list(report_int): return result def _parse_string(self, view): - dom = etree.XML(view) + try: + dom = etree.XML(view.encode('utf-8')) + except: + dom = etree.XML(view) return self._parse_node(dom) def create(self, cr, uid, ids, datas, context=None): From 81b8e008d3a99f0bd7e4ca2b54d38faf87100eaa Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Wed, 16 Sep 2009 13:10:51 +0530 Subject: [PATCH 066/104] [IMP]quality_integration_server: make link of extra-addons module in addons module automatic on install-module command bzr revid: hmo@tinyerp.com-20090916074051-hyoq3atsctz8jdhd --- Makefile | 3 +- .../base_quality_interrogation.py | 37 +++++++++++++++++-- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 39ab146c13a..7b410d19dee 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ # -*- makefile -*- addons-path := bin/addons/ +extra-addons:= '' root-path := bin/ port := 8069 net_port := 8070 @@ -22,7 +23,7 @@ drop-db: python $(interrogation_file) drop-db --database=$(database) --root-path=$(root-path) --addons-path=$(addons-path) --port=$(port) install-module: - python $(interrogation_file) install-module --modules=$(module) --database=$(database) --root-path=$(root-path) --addons-path=$(addons-path) --port=$(port) --login=$(login) --password=$(password) + python $(interrogation_file) install-module --modules=$(module) --database=$(database) --root-path=$(root-path) --addons-path=$(addons-path) --extra-addons=$(extra-addons) --port=$(port) --login=$(login) --password=$(password) upgrade-module: python $(interrogation_file) upgrade-module --modules=$(module) --database=$(database) --root-path=$(root-path) --addons-path=$(addons-path) --port=$(port) --login=$(login) --password=$(password) diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index 65bb7f5f849..b07c2baef40 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -180,7 +180,7 @@ def create_db(uri, dbname, user='admin', pwd='admin', lang='en_US'): elif res['type']=='state': state = res['state'] res = execute(wiz_conn, 'execute', dbname, uid, pwd, wiz_id, datas, state, {}) - install_module(uri, dbname, ['base_module_quality'],user,pwd) + install_module(uri, dbname, ['base_module_quality'],user=user,pwd=pwd) return True def drop_db(uri, dbname): @@ -190,12 +190,37 @@ def drop_db(uri, dbname): execute(conn, 'drop', admin_passwd, dbname) return True -def install_module(uri, dbname, modules, user='admin', pwd='admin'): +def make_links(uri, uid, dbname, source, destination, module, user, pwd): + if module in ('base','quality_integration_server'): + return True + if not os.path.islink(destination + module): + if not os.path.isdir(destination + module): + for path in source: + if os.path.isdir(path + '/' + module): + os.symlink(path + '/' + module, destination + '/' + module) + obj_conn = xmlrpclib.ServerProxy(uri + '/xmlrpc/object') + execute(obj_conn, 'execute', dbname, uid, pwd, 'ir.module.module', 'update_list') + module_ids = execute(obj_conn, 'execute', dbname, uid, pwd, 'ir.module.module', 'search', [('name','=',module)]) + if len(module_ids): + data = execute(obj_conn, 'execute', dbname, uid, pwd, 'ir.module.module', 'read', module_ids[0],['name','dependencies_id']) + dep_datas = execute(obj_conn, 'execute', dbname, uid, pwd, 'ir.module.module.dependency', 'read', data['dependencies_id'],['name']) + for dep_data in dep_datas: + make_links(uri, uid, dbname, source, destination, dep_data['name'], user, pwd) + return True + return False + +def install_module(uri, dbname, modules, addons='', extra_addons='', user='admin', pwd='admin'): uid = login(uri, dbname, user, pwd) + if extra_addons: + extra_addons = extra_addons.split(',') if uid: + if addons and extra_addons: + for module in modules: + make_links(uri, uid, dbname, extra_addons, addons, module, user, pwd) + obj_conn = xmlrpclib.ServerProxy(uri + '/xmlrpc/object') wizard_conn = xmlrpclib.ServerProxy(uri + '/xmlrpc/wizard') - module_ids = execute(obj_conn, 'execute', dbname, uid, pwd, 'ir.module.module', 'search', [('name','in',modules)]) + module_ids = execute(obj_conn, 'execute', dbname, uid, pwd, 'ir.module.module', 'search', [('name','in',modules)]) execute(obj_conn, 'execute', dbname, uid, pwd, 'ir.module.module', 'button_install', module_ids) wiz_id = execute(wizard_conn, 'create', dbname, uid, pwd, 'module.upgrade.simple') state = 'init' @@ -255,6 +280,9 @@ parser.add_option("--login", dest="login", help="specify the User Login") parser.add_option("--password", dest="pwd", help="specify the User Password") parser.add_option("--translate-in", dest="translate_in", help="specify .po files to import translation terms") +parser.add_option("--extra-addons", dest="extra_addons", + help="specify extra_addons and trunkCommunity modules path ") + (opt, args) = parser.parse_args() if len(args) != 1: parser.error("incorrect number of arguments") @@ -282,6 +310,7 @@ options = { 'modules' : opt.modules or [], 'login' : opt.login or 'admin', 'pwd' : opt.pwd or '', + 'extra-addons':opt.extra_addons or [] } options['modules'] = opt.modules and map(lambda m: m.strip(), opt.modules.split(',')) or [] @@ -297,7 +326,7 @@ try: if command == 'drop-db': drop_db(uri, options['database']) if command == 'install-module': - install_module(uri, options['database'], options['modules'], options['login'], options['pwd']) + install_module(uri, options['database'], options['modules'],options['addons-path'],options['extra-addons'],options['login'], options['pwd']) if command == 'upgrade-module': upgrade_module(uri, options['database'], options['modules'], options['login'], options['pwd']) if command == 'check-quality': From c415a9d72f4e32c265058b94f256631e99f5f17d Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Wed, 16 Sep 2009 14:50:36 +0530 Subject: [PATCH 067/104] [FIX]base : ir_cron : take minimun next_call from database for job waiting. if database does not has any job, it will take 1 day for job waiting bzr revid: hmo@tinyerp.com-20090916092036-pevdiwq24d42zanl --- bin/addons/base/ir/ir_cron.py | 38 ++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/bin/addons/base/ir/ir_cron.py b/bin/addons/base/ir/ir_cron.py index 7da956c36af..166a5781d44 100644 --- a/bin/addons/base/ir/ir_cron.py +++ b/bin/addons/base/ir/ir_cron.py @@ -27,8 +27,6 @@ import tools import pooler from osv import fields,osv -next_wait = 60 - _intervalTypes = { 'work_days': lambda interval: DateTime.RelativeDateTime(days=interval), 'days': lambda interval: DateTime.RelativeDateTime(days=interval), @@ -74,20 +72,18 @@ class ir_cron(osv.osv, netsvc.Agent): f = getattr(m, func) f(cr, uid, *args) - def _poolJobs(self, db_name, check=False): + def _poolJobs(self, db_name, check=False): try: db, pool = pooler.get_db_and_pool(db_name) except: - return False - + return False if pool._init: # retry in a few minutes - next_call = 600 + next_call = 600 else: - next_call = next_wait - cr = db.cursor() now = DateTime.now() try: + cr = db.cursor() cr.execute('select * from ir_cron where numbercall<>0 and active and nextcall<=now() order by priority') for job in cr.dictfetchall(): nextcall = DateTime.strptime(job['nextcall'], '%Y-%m-%d %H:%M:%S') @@ -115,8 +111,32 @@ class ir_cron(osv.osv, netsvc.Agent): # Can be improved to do at the min(min(nextcalls), time()+next_call) # But is this an improvement ? # + cr = db.cursor() + cr.execute('select min(nextcall) as min_next_call from ir_cron where numbercall<>0 and active and nextcall>=now()') + next_call = cr.dictfetchone()['min_next_call'] + cr.close() + if next_call: + next_call = time.mktime(time.strptime(next_call, '%Y-%m-%d %H:%M:%S')) + else: + next_call = int(time.time()) + 3600 # if do not find active cron job from database, it will run again after 1 day if not check: - self.setAlarm(self._poolJobs, int(time.time()) + next_call, db_name, db_name) + self.setAlarm(self._poolJobs, next_call, db_name, db_name) + + def create(self, cr, uid, vals, context=None): + res = super(ir_cron, self).create(cr, uid, vals, context=context) + cr.commit() + self._poolJobs(cr.dbname) + return res + def write(self, cr, user, ids, vals, context=None): + res = super(ir_cron, self).write(cr, user, ids, vals, context=context) + cr.commit() + self._poolJobs(cr.dbname) + return res + def unlink(self, cr, uid, ids, context=None): + res = super(ir_cron, self).unlink(cr, uid, ids, context=context) + cr.commit() + self._poolJobs(cr.dbname) + return res ir_cron() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From c92e018556e66c9f2e1b4547d5522ca664566d97 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Wed, 16 Sep 2009 15:55:21 +0530 Subject: [PATCH 068/104] [REM]: remove the name search method, as this method was implemented for the email address field this was looking for the related fields too in the action object, but now that is not required as now email address can be located by object.object.object.....field so its better to make this method close bzr revid: mga@tinyerp.com-20090916102521-m5xmlbmle8y2zc64 --- bin/addons/base/ir/ir_actions.py | 82 ++++++++++++++++---------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/bin/addons/base/ir/ir_actions.py b/bin/addons/base/ir/ir_actions.py index 591a8ef2e73..1403923c040 100644 --- a/bin/addons/base/ir/ir_actions.py +++ b/bin/addons/base/ir/ir_actions.py @@ -284,57 +284,57 @@ class ir_model_fields(osv.osv): 'complete_name': fields.char('Complete Name', size=64, select=1), } - def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=800): - def get_fields(cr, uid, field, rel): - result = [] - mobj = self.pool.get('ir.model') - id = mobj.search(cr, uid, [('model','=',rel)]) + def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=80): + return super(ir_model_fields, self).name_search(cr, uid, name, args, operator, context, limit) +# def get_fields(cr, uid, field, rel): +# result = [] +# mobj = self.pool.get('ir.model') +# id = mobj.search(cr, uid, [('model','=',rel)]) - obj = self.pool.get('ir.model.fields') - ids = obj.search(cr, uid, [('model_id','in',id)]) - records = obj.read(cr, uid, ids) - for record in records: - id = record['id'] - fld = field + '/' + record['name'] +# obj = self.pool.get('ir.model.fields') +# ids = obj.search(cr, uid, [('model_id','in',id)]) +# records = obj.read(cr, uid, ids) +# for record in records: +# id = record['id'] +# fld = field + '/' + record['name'] - result.append((id, fld)) - return result +# result.append((id, fld)) +# return result - if not args: - args=[] - if not context: - context={} - return super(ir_model_fields, self).name_search(cr, uid, name, args, operator, context, limit) +# if not args: +# args=[] +# if not context: +# context={} +# return super(ir_model_fields, self).name_search(cr, uid, name, args, operator, context, limit) - if context.get('key') != 'server_action': - return super(ir_model_fields, self).name_search(cr, uid, name, args, operator, context, limit) +# if context.get('key') != 'server_action': +# return super(ir_model_fields, self).name_search(cr, uid, name, args, operator, context, limit) +# result = [] +# obj = self.pool.get('ir.model.fields') +# ids = obj.search(cr, uid, args) +# records = obj.read(cr, uid, ids) +# for record in records: +# id = record['id'] +# field = record['name'] - result = [] - obj = self.pool.get('ir.model.fields') - ids = obj.search(cr, uid, args) - records = obj.read(cr, uid, ids) - for record in records: - id = record['id'] - field = record['name'] +# if record['ttype'] == 'many2one': +# rel = record['relation'] +# res = get_fields(cr, uid, field, record['relation']) +# for rs in res: +# result.append(rs) - if record['ttype'] == 'many2one': - rel = record['relation'] - res = get_fields(cr, uid, field, record['relation']) - for rs in res: - result.append(rs) +# result.append((id, field)) - result.append((id, field)) +# for rs in result: +# obj.write(cr, uid, [rs[0]], {'complete_name':rs[1]}) - for rs in result: - obj.write(cr, uid, [rs[0]], {'complete_name':rs[1]}) +# iids = [] +# for rs in result: +# iids.append(rs[0]) - iids = [] - for rs in result: - iids.append(rs[0]) +# result = super(ir_model_fields, self).name_search(cr, uid, name, [('complete_name','ilike',name), ('id','in',iids)], operator, context, limit) - result = super(ir_model_fields, self).name_search(cr, uid, name, [('complete_name','ilike',name), ('id','in',iids)], operator, context, limit) - - return result +# return result ir_model_fields() From b3a239601f9cdfde4242b560f564c530baa497b0 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Wed, 16 Sep 2009 16:37:22 +0530 Subject: [PATCH 069/104] [REM] document : remove code of get_translation and remove user context_lang from node context on getting new node because of we see some problem in this code for translation term of french bzr revid: hmo@tinyerp.com-20090916110722-4kl5t5q71im6c76i --- addons/document/document.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 21aa59661a7..082ea0144da 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -125,16 +125,7 @@ class node_class(object): def get_translation(self,value,lang): result = value - pool = pooler.get_pool(self.cr.dbname) - translation_ids = pool.get('ir.translation').search(self.cr, self.uid, [('value','=',value),('lang','=',lang),('type','=','model')]) - if len(translation_ids): - tran_id = translation_ids[0] - translation = pool.get('ir.translation').read(self.cr, self.uid, tran_id, ['res_id','name']) - res_model,field_name = tuple(translation['name'].split(',')) - res_id = translation['res_id'] - res = pool.get(res_model).read(self.cr, self.uid, res_id, [field_name]) - if res: - result = res[field_name] + #TODO : to get translation term return result def directory_list_for_child(self,nodename,parent=False): @@ -346,12 +337,8 @@ class document_directory(osv.osv): object: the object.directory or object.directory.content object2: the other object linked (if object.directory.content) """ - def get_object(self, cr, uid, uri, context={}): - lang = context.get('lang',False) - if not lang: - user = self.pool.get('res.users').browse(cr, uid, uid) - lang = user.context_lang - context['lang'] = lang + def get_object(self, cr, uid, uri, context={}): + #TODO : set user's context_lang in context if not uri: return node_class(cr, uid, '', False, context=context, type='database') turi = tuple(uri) From 4f50981946228dc2ef5075fa6f865898eb6a42ea Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 16 Sep 2009 20:17:04 +0530 Subject: [PATCH 070/104] [FIX + IMP] Sale :consistency in order report(addresses,date) lp bug: https://launchpad.net/bugs/430516 fixed lp bug: https://launchpad.net/bugs/430522 fixed bzr revid: jvo@tinyerp.com-20090916144704-1dyh5w84ng9m27td --- addons/sale/report/order.rml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/sale/report/order.rml b/addons/sale/report/order.rml index fac75e4f4d9..fa03eb1624b 100644 --- a/addons/sale/report/order.rml +++ b/addons/sale/report/order.rml @@ -138,14 +138,16 @@ [[ o.partner_shipping_id.title or '' ]] [[ o.partner_shipping_id.name ]] [[ o.partner_shipping_id.street ]] [[ o.partner_shipping_id.street2 or '' ]] - [[ o.partner_shipping_id.city or '' ]] [[ o.partner_shipping_id.zip or '' ]] + [[ o.partner_shipping_id.zip or '' ]] [[ o.partner_shipping_id.city or '' ]] [[ o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name or '' ]] [[ o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name or '' ]] Invoice address : + [[ o.partner_invoice_id.title or '' ]] [[ o.partner_invoice_id.name or '' ]] [[ o.partner_invoice_id.street ]] [[ o.partner_invoice_id.street2 and (', %s' % o.partner_invoice_id.street2 or '') ]] - [[ o.partner_invoice_id.zip or '' ]] [[ o.partner_invoice_id.city or '' ]] [[ o.partner_invoice_id.country_id and (', %s' % (o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '')) ]] + [[ o.partner_invoice_id.zip or '' ]] [[ o.partner_invoice_id.city or '' ]] + [[ o.partner_invoice_id.state_id and o.partner_invoice_id.state_id.name or '' ]] [[ o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '' ]] @@ -185,7 +187,7 @@ Your Reference - Date Ordered + [[ o.state=='draft' and 'Quotation Date' or 'Date Ordered' ]] Our Salesman From 5f2ab89a72fbaf4a1bec960ec137523670d0352b Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 16 Sep 2009 20:26:33 +0530 Subject: [PATCH 071/104] [FIX] Sale : Order Lines switches view from tree,form and view lp bug: https://launchpad.net/bugs/430577 fixed bzr revid: jvo@tinyerp.com-20090916145633-h0wic35v1p4bbe96 --- addons/sale/sale_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index f0b8da9a017..168d8c39ee6 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -110,7 +110,7 @@ - +
      From 03a072b4b78aa348a92fdfdcfa16350aadff132b Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Wed, 16 Sep 2009 20:37:35 +0530 Subject: [PATCH 072/104] [FIX] Hr_holidays : Workflow actions validations corrected lp bug: https://launchpad.net/bugs/430098 fixed bzr revid: jvo@tinyerp.com-20090916150735-2d3cb8a1ybqt164r --- addons/hr_holidays/hr.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/hr_holidays/hr.py b/addons/hr_holidays/hr.py index 5e4b1ed7a05..dc0f7a82d66 100644 --- a/addons/hr_holidays/hr.py +++ b/addons/hr_holidays/hr.py @@ -187,8 +187,11 @@ class hr_holidays(osv.osv): 'state':'validate', } ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)]) + if ids2: vals['manager_id'] = ids2[0] + else: + raise osv.except_osv(_('Warning !'),_('Either there is no Employee defined, or no User attached with it.')) self.write(cr, uid, ids, vals) self._create_holiday(cr, uid, ids) return True @@ -207,6 +210,8 @@ class hr_holidays(osv.osv): def holidays_refuse(self, cr, uid, ids, *args): ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)]) + if not ids2: + raise osv.except_osv(_('Warning !'),_('Either there is no Employee defined, or no User attached with it.')) self.write(cr, uid, ids, { 'state':'refuse', 'manager_id':ids2[0] From acfd835091f38c29a91dec8de08265c8a9800759 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Thu, 17 Sep 2009 10:17:14 +0530 Subject: [PATCH 073/104] [FIX]quality_integration_server : quality log : reduce overwrite last test log in other test logs bzr revid: hmo@tinyerp.com-20090917044714-onj9maung7o7gi97 --- .../base_quality_interrogation.py | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index b07c2baef40..9a453d85c38 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -49,14 +49,14 @@ def clean(): ps.close() if pid: os.kill(pid,9) - + def execute(connector, method, *args): - global wait_count + global wait_count res = False try: res = getattr(connector,method)(*args) except socket.error,e: - if e.args[0] == 111: + if e.args[0] == 111: if wait_count > wait_limit: print "Server is taking too long to start, it has exceeded the maximum limit of %d seconds."%(wait_limit) clean() @@ -68,8 +68,7 @@ def execute(connector, method, *args): else: raise e wait_count = 0 - return res - + return res def login(uri, dbname, user, pwd): conn = xmlrpclib.ServerProxy(uri + '/xmlrpc/common') @@ -108,12 +107,12 @@ def check_quality(uri, user, pwd, dbname, modules): uid = login(uri, dbname, user, pwd) if uid: conn = xmlrpclib.ServerProxy(uri + '/xmlrpc/object') - qualityresult = {} final = {} - test_detail = {} - for module in modules: + for module in modules: + qualityresult = {} + test_detail = {} quality_result = execute(conn,'execute', dbname, uid, pwd,'module.quality.check','check_quality',module) - detail_html = '' + detail_html = '' html = '''''' html +="

      Module : %s

      "%(quality_result['name']) html += "

      Final score : %s

      "%(quality_result['final_score']) @@ -124,7 +123,10 @@ def check_quality(uri, user, pwd, dbname, modules): msg = detail.get('message','') score = round(float(detail.get('score',0)),2) html += "
    • %s
    • "%(test.replace(' ','-'),test) - detail_html +="

      %s (Score : %s)

      %s
      "%(test.replace(' ','-'),test,score,detail.get('detail')) + if test == 'Unit Test': + if not detail.get('detail',''): + detail['detail'] = '''%s'''%(detail.get('summary','')) + detail_html +="

      %s (Score : %s)

      %s
      "%(test.replace(' ','-'),test,score,detail.get('detail','')) test_detail[test] = (score,msg,detail.get('detail','')) html += "
    %s"%(detail_html) html += "" @@ -138,7 +140,7 @@ def check_quality(uri, user, pwd, dbname, modules): else: print 'Login Failed...' clean() - sys.exit(1) + sys.exit(1) @@ -189,7 +191,7 @@ def drop_db(uri, dbname): if dbname in db_list: execute(conn, 'drop', admin_passwd, dbname) return True - + def make_links(uri, uid, dbname, source, destination, module, user, pwd): if module in ('base','quality_integration_server'): return True @@ -207,7 +209,7 @@ def make_links(uri, uid, dbname, source, destination, module, user, pwd): for dep_data in dep_datas: make_links(uri, uid, dbname, source, destination, dep_data['name'], user, pwd) return True - return False + return False def install_module(uri, dbname, modules, addons='', extra_addons='', user='admin', pwd='admin'): uid = login(uri, dbname, user, pwd) From 38633249301299371a0cd823f941a958f24074c5 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Thu, 17 Sep 2009 12:51:25 +0530 Subject: [PATCH 074/104] [FIX]quality_integration_server: fixe problem on make link of extra-module in addons bzr revid: hmo@tinyerp.com-20090917072125-y63krel1152ox742 --- .../quality_integration_server/base_quality_interrogation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index 9a453d85c38..a75477ed0f8 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -195,8 +195,8 @@ def drop_db(uri, dbname): def make_links(uri, uid, dbname, source, destination, module, user, pwd): if module in ('base','quality_integration_server'): return True - if not os.path.islink(destination + module): - if not os.path.isdir(destination + module): + if not os.path.islink(destination + '/' + module): + if not os.path.isdir(destination + '/' + module): for path in source: if os.path.isdir(path + '/' + module): os.symlink(path + '/' + module, destination + '/' + module) From 6d6bc82fca30c840cf1713dc6d5b683dc6e26475 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 17 Sep 2009 18:35:29 +0530 Subject: [PATCH 075/104] [FIX] Purchase_manual : certificate on terp displayed wrong value bzr revid: jvo@tinyerp.com-20090917130529-vdzbrr2u2yx4gjeq --- addons/purchase_manual/__terp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase_manual/__terp__.py b/addons/purchase_manual/__terp__.py index d9c3087c86c..885ac4d9d98 100644 --- a/addons/purchase_manual/__terp__.py +++ b/addons/purchase_manual/__terp__.py @@ -37,6 +37,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': False, +# 'certificate': False, } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From e6f996e75b9abcb5210685e855173597a418ea11 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Thu, 17 Sep 2009 18:39:17 +0530 Subject: [PATCH 076/104] [REF]quality_integration_server: now intsall-translate command accept input like i18n-import=purchase:ar_AR.po+sale:fr_FR.po,nl_BE.po bzr revid: hmo@tinyerp.com-20090917130917-hj4nos9bcxpqsxzv --- .../base_quality_interrogation.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index a75477ed0f8..f4e84f5194a 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -37,10 +37,8 @@ waittime = 10 wait_count = 0 wait_limit = 12 -def start_server(root_path, port, addons_path): - if root_path: - root_path += '/' - os.system('python2.5 '+root_path+'openerp-server.py --pidfile=openerp.pid --port=%s --no-netrpc --addons-path=%s' %(str(port),addons_path)) +def start_server(root_path, port, addons_path): + os.system('python2.5 %sopenerp-server.py --pidfile=openerp.pid --port=%s --no-netrpc --addons-path=%s' %(root_path, str(port), addons_path)) def clean(): if os.path.isfile('openerp.pid'): ps = open('openerp.pid') @@ -306,7 +304,7 @@ die(opt.translate_in and (not opt.db_name), options = { 'addons-path' : opt.addons_path or 'addons', 'root-path' : opt.root_path or '', - 'translate-in': opt.translate_in, + 'translate-in': [], 'port' : opt.port or 8069, 'database': opt.db_name or 'terp', 'modules' : opt.modules or [], @@ -316,7 +314,14 @@ options = { } options['modules'] = opt.modules and map(lambda m: m.strip(), opt.modules.split(',')) or [] -options['translate_in'] = opt.translate_in and map(lambda m: m.strip(), opt.translate_in.split(',')) or [] +# Hint:i18n-import=purchase:ar_AR.po+sale:fr_FR.po,nl_BE.po +if opt.translate_in: + translate = opt.translate_in + for module_name,po_files in map(lambda x:tuple(x.split(':')),translate.split('+')): + for po_file in po_files.split(','): + po_link = '%s/%s/i18n/%s'%(options['addons-path'], module_name, po_file) + options['translate-in'].append(po_link) + uri = 'http://localhost:' + str(options['port']) server_thread = threading.Thread(target=start_server, @@ -334,7 +339,7 @@ try: if command == 'check-quality': check_quality(uri, options['login'], options['pwd'], options['database'], options['modules']) if command == 'install-translation': - import_translate(uri, options['login'], options['pwd'], options['database'], options['translate_in']) + import_translate(uri, options['login'], options['pwd'], options['database'], options['translate-in']) clean() sys.exit(0) From fcf202751d872861e9a5319ec95b3d059a36dae4 Mon Sep 17 00:00:00 2001 From: Quentin De Paoli Date: Thu, 17 Sep 2009 15:16:16 +0200 Subject: [PATCH 077/104] [FIX] account: bugfixed the fiscalyear closing wizard: * wizard wasn't working if there weren't entries to report: uneeded error was raised * wizard wasn't reconciling the reported entries of the new fiscalyear (but of the old fiscalyear) bzr revid: qdp@cyan-20090917131616-hy6kdupx5j0em41q --- .../account/wizard/wizard_fiscalyear_close.py | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/addons/account/wizard/wizard_fiscalyear_close.py b/addons/account/wizard/wizard_fiscalyear_close.py index 68e69941b5c..ac9518e006b 100644 --- a/addons/account/wizard/wizard_fiscalyear_close.py +++ b/addons/account/wizard/wizard_fiscalyear_close.py @@ -192,21 +192,24 @@ def _data_save(self, cr, uid, data, context): }) pool.get('account.move.line').create(cr, uid, move) offset += limit - ids = pool.get('account.move.line').search(cr, uid, [('journal_id','=',new_journal.id), - ('period_id.fiscalyear_id','=',old_fyear.id)]) + ('period_id.fiscalyear_id','=',new_fyear.id)]) context['fy_closing'] = True - if not ids: - raise wizard.except_wizard(_('UserError'), - _('The old fiscal year does not have any entry to reconcile!')) - pool.get('account.move.line').reconcile(cr, uid, ids, context=context) + if ids: + pool.get('account.move.line').reconcile(cr, uid, ids, context=context) new_period = data['form']['period_id'] ids = pool.get('account.journal.period').search(cr, uid, [('journal_id','=',new_journal.id),('period_id','=',new_period)]) - if ids: - cr.execute('UPDATE account_fiscalyear ' \ + if not ids: + ids = [pool.get('account.journal.period').create(cr, uid, { + 'name': (new_journal.name or '')+':'+(period.code or ''), + 'journal_id': new_journal.id, + 'period_id': period.id + })] + cr.execute('UPDATE account_fiscalyear ' \ 'SET end_journal_period_id = %s ' \ - 'WHERE id = %s', (ids[0], new_fyear.id)) + 'WHERE id = %s', (ids[0], old_fyear.id)) + return {} class wiz_journal_close(wizard.interface): From cdb2371b83f20f6026f69d9228ee46d392cf9b3b Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Thu, 17 Sep 2009 15:21:26 +0200 Subject: [PATCH 078/104] [IMP] updated changelog file bzr revid: olt@tinyerp.com-20090917132126-bghsqfgbvfod54ac --- doc/Changelog | 133 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index 577dfc5a651..53607a2b975 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,136 @@ + +2009-09-17: 5.0.5 +================= + +Bugfixes (server) +----------------- + + * Not linked to a bug report: + * quality_integration_server: fixe problem on make link of extra-module in addons + * quality_integration_server : quality log : reduce overwrite last test log in other test logs + * base : ir_cron : take minimun next_call from database for job waiting. if database does not has any job, it will take 1 day for job waiting + * quality_integration_server: get message from base_quality_module if module can not success to reach minimun score + * regression in fields.function computation + * better log error, new line + * Report: context was missing while printing any report with header in a non-English Language + * https://launchpad.net/bugs/425131 + * Better translation exportation. + * https://launchpad.net/bugs/379645 + * Print screen : Correction when text for report is already encoded + * https://launchpad.net/bugs/421162 + * Send Mail : Unicode error handled + * Send mail : Non-English characters were throwing error. + * https://launchpad.net/bugs/421137 + * Base : 'Supplier Partners' menu will open new record with supplier=1,customer=0 + * https://launchpad.net/bugs/425430 + * Export : Error solved while Exporting O2M records with None value of any field + * https://launchpad.net/bugs/399208 + * Translation issue with cache: it needed to restart server,SOLVED + * https://launchpad.net/bugs/422563 + * Security Loophole corrected + + +Improvements (server) +--------------------- + + * quality_integration_server: make link of extra-addons module in addons module automatic on install-module command + * quality_integration_server: get message from base_quality_module if module can not success to reach minimun score + * Rng : Accepting Groups under/after/replacing Buttons + * quality_integration_server : quality html log + * quality_integration_server: put max_limit in server connection + * Base : Rate for ARS Added + * cchange version number + + +Bugfixes (addons) +----------------- + + * Not linked to a bug report: + * Purchase_manual : certificate on terp displayed wrong value + * fix the problem of message depending on the partner language + * fix a problem for the overdue payment message + * fix problem to get the detault message + * #416908 computation of invoice lines + * Project : Taks hours computed accurately. + * base_module_record: avoid duplications + * document: do not try to index binary documents + * +1 on the lengthmonth returns was too much, removed it + * Problem when using hr_holidays Summary Report when entering date 1 jan 2009 for example. + * multi currency reconciliations on bank statements weren't properly displayed + * multi currency payments weren't correctly computed on invoice's residual amount + * Project_gtd : Demo data defined for tasks(inboxes) + * Module:product Added report tag for product pricelist reportso that it can be modified using OODesigner + * Document : error on create if attachment not specified + * https://launchpad.net/bugs/422401 + * project_gtd : timebox field re-arranged + * https://launchpad.net/bugs/421907 + * Account : Aged Partner Balance report for Future analysis corrected + * https://launchpad.net/bugs/427388 + * Project : task work behavior towards task hours corrected + * https://launchpad.net/bugs/422408 + * Project_gtd : Hierarchical timeboxes allowed to open + * https://launchpad.net/bugs/403972 + * Account : Reports from Chart of Accounts were not considering contextual value of MOVE(draft,posted) + * https://launchpad.net/bugs/430577 + * Sale : Order Lines switches view from tree,form and view + * https://launchpad.net/bugs/425257 + * Project_gtd : improved menuitems names to avoid user confusion,domain improved + * https://launchpad.net/bugs/422078 + * Account_tax_include : floatdivision error corrected + * https://launchpad.net/bugs/423585 + * https://launchpad.net/bugs/423581 + * https://launchpad.net/bugs/416807 + * report_document : Dashboard should not display partner with no files + * https://launchpad.net/bugs/430522 + * https://launchpad.net/bugs/424214 + * Account :Residual amount unclear when used with partial payments. + * https://launchpad.net/bugs/424177 + * hr_timesheet_sheet : Rounding value problem in float_time widget + * https://launchpad.net/bugs/415056 + * https://launchpad.net/bugs/421636 + * added tooltip on tax and payment term + * https://launchpad.net/bugs/407290 + * https://launchpad.net/bugs/407293 + * Account : Making account.invoice.tax field language-depenant from account.tax + * https://launchpad.net/bugs/430043 + * Hr_timesheet_invoice : Query calculation corrected + * https://launchpad.net/bugs/379645 + * Base_report_creator : Print screen report is now available for custom reports + * https://launchpad.net/bugs/423260 + * Account : Title of of Move Line widnows renamed + * https://launchpad.net/bugs/427982 + * hr_timesheet_invoice : Invoicing analytic entries wizard corrected for product + * https://launchpad.net/bugs/426243 + * Account : Context was missing in report + * https://launchpad.net/bugs/426831 + * l10n_ch : default_value() of res.partner.bank corrected + * https://launchpad.net/bugs/430098 + * Hr_holidays : Workflow actions validations corrected + * https://launchpad.net/bugs/430516 + * https://launchpad.net/bugs/379191 + * its better to aply the patch + * fix the problem for related fields, related fields act as a many2one fields + * https://launchpad.net/bugs/429203 + * CRM : Mailgate script used default uid=3 instead of 1 + * https://launchpad.net/bugs/399817 + * Fixed Partial deliveries problem + + +Improvements (addons) +--------------------- + + * Invoice Supplier Control per line/manual + * add missing file for the followup date + * changed interval CRM calls to 4 hours instead of one -> efficient connection pooling with cron + * add inherited view for company + * add new filed to company object which will store the mesages + * add new data file which will add over due payment message to company + * Account : Analytic Account report following parental relationship approach(account with all its children + * hr_timesheet_invoice : Misleading string on invoice analytic entries' wizard + * base_module_quality: remove certificate tag from terp test + * report_dcoument : changed the misleading name of action + + 2009-08-28: 5.0.4 ================= From 0d7199a133edff51fdbd109b9337f67ba8699285 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Thu, 17 Sep 2009 15:23:35 +0200 Subject: [PATCH 079/104] [IMP] updated changelog file bzr revid: olt@tinyerp.com-20090917132335-so2fugos4sutat90 --- doc/Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/Changelog b/doc/Changelog index 53607a2b975..9ecc752e9ff 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -13,6 +13,7 @@ Bugfixes (server) * regression in fields.function computation * better log error, new line * Report: context was missing while printing any report with header in a non-English Language + * quality_integration_server: fixe problem on make link of extra-module in addons * https://launchpad.net/bugs/425131 * Better translation exportation. * https://launchpad.net/bugs/379645 From a0c0cb3bca6c0a6d9d45cceda03a41fed1cdcbc1 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Thu, 17 Sep 2009 15:53:46 +0200 Subject: [PATCH 080/104] [IMP] updated release.py to 5.0.5 bzr revid: olt@tinyerp.com-20090917135346-9vylvoy89xoffkep --- bin/release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/release.py b/bin/release.py index 158af8793e4..f26d235c5e1 100644 --- a/bin/release.py +++ b/bin/release.py @@ -22,7 +22,7 @@ ############################################################################## name = 'openerp-server' -version = '5.0.5-bzr' +version = '5.0.5' major_version = '5.0' description = 'OpenERP Server' long_desc = '''\ From 35ca7bf8a746180743701efeaadf67e3c9d9d20c Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 18 Sep 2009 11:39:13 +0530 Subject: [PATCH 081/104] [FIX] Account_followup : Sending email while sending follow up corrected. lp bug: https://launchpad.net/bugs/431821 fixed bzr revid: jvo@tinyerp.com-20090918060913-v05i5qp2468o3ufv --- .../account_followup/wizard/wizard_followup_print.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account_followup/wizard/wizard_followup_print.py b/addons/account_followup/wizard/wizard_followup_print.py index 70f90f2d6ae..7729d267365 100644 --- a/addons/account_followup/wizard/wizard_followup_print.py +++ b/addons/account_followup/wizard/wizard_followup_print.py @@ -179,7 +179,7 @@ class followup_all_print(wizard.interface): l = '--------------------------------------------------------------------------------------------------------------------------' head = l+ '\n' + 'Date'.rjust(10) + '\t' + 'Description'.rjust(10) + '\t' + 'Ref'.rjust(10) + '\t' + 'Maturity date'.rjust(10) + '\t' + 'Due'.rjust(10) + '\t' + 'Paid'.rjust(10) + '\t' + 'Maturity'.rjust(10) + '\t' + 'Litigation'.rjust(10) + '\n' + l for i in data_lines: - maturity = '' + maturity = 0.00 if i.date_maturity < time.strftime('%Y-%m-%d') and (i.debit - i.credit): maturity = i.debit - i.credit subtotal_due = subtotal_due + i.debit @@ -200,7 +200,7 @@ class followup_all_print(wizard.interface): 'date':time.strftime('%Y-%m-%d'), } body = body%val - sub = str(data['form']['email_subject']) + sub = tools.ustr(data['form']['email_subject']) msg = '' if dest: tools.email_send(src,dest,sub,body) @@ -209,15 +209,15 @@ class followup_all_print(wizard.interface): msg += partner.name + '\n' msg_unsent += msg if not msg_unsent: - summary = _("All emails have been successfully sent to Partners:.\n\n") + msg_sent + summary = _("All E-mails have been successfully sent to Partners:.\n\n") + msg_sent else: - msg_unsent = _("Mail not sent to following Partners, Email not available !\n\n") + msg_unsent - msg_sent = msg_sent and _("\n\nMail sent to following Partners successfully, !\n\n") + msg_sent + msg_unsent = _("E-Mail not sent to following Partners, Email not available !\n\n") + msg_unsent + msg_sent = msg_sent and _("\n\nE-Mail sent to following Partners successfully. !\n\n") + msg_sent line = '==========================================================================' summary = msg_unsent + line + msg_sent return {'summary' : summary} else: - return {'summary' : '\n\n\nMail not sent to any partner if you want to sent it please tick send email confirmation on wizard'} + return {'summary' : '\n\n\nE-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard.'} def _get_partners(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) From 62749f58231d3dcb6ceef161f846fdb3b39782ba Mon Sep 17 00:00:00 2001 From: "GPA(Open ERP)" <> Date: Fri, 18 Sep 2009 16:03:21 +0530 Subject: [PATCH 082/104] [FIX] Account : Move line creation was giving encoding error while automated entries were inserted,corrected lp bug: https://launchpad.net/bugs/431871 fixed bzr revid: jvo@tinyerp.com-20090918103321-duidpcu12b358dlv --- addons/account/account_move_line.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 1ed28ff2588..d7c098de206 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -28,6 +28,8 @@ from tools.translate import _ import mx.DateTime from mx.DateTime import RelativeDateTime, now, DateTime, localtime +import tools + class account_move_line(osv.osv): _name = "account.move.line" _description = "Entry lines" @@ -908,7 +910,7 @@ class account_move_line(osv.osv): 'move_id': vals['move_id'], 'journal_id': vals['journal_id'], 'period_id': vals['period_id'], - 'name': vals['name']+' '+tax['name'], + 'name': tools.ustr(vals['name'] or '') + ' ' + tools.ustr(tax['name'] or ''), 'date': vals['date'], 'partner_id': vals.get('partner_id',False), 'ref': vals.get('ref',False), @@ -927,7 +929,7 @@ class account_move_line(osv.osv): 'move_id': vals['move_id'], 'journal_id': vals['journal_id'], 'period_id': vals['period_id'], - 'name': vals['name']+' '+tax['name'], + 'name': tools.ustr(vals['name'] or '') + ' ' + tools.ustr(tax['name'] or ''), 'date': vals['date'], 'partner_id': vals.get('partner_id',False), 'ref': vals.get('ref',False), From cc08f8e3d299736731f7b5ced33d6a89c8f2980e Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 18 Sep 2009 14:28:07 +0200 Subject: [PATCH 083/104] [IMP] purchase: improve views to be directly usable in portals... bzr revid: chs@tinyerp.com-20090918122807-s6iaqfw5htxs4poe --- addons/purchase/purchase_view.xml | 35 +++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index df971a84b04..972d91206f3 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -51,7 +51,18 @@ - + + + + + + + + + + + + @@ -71,7 +82,7 @@