From ed98567944b471de28897f471f40c13fa39a26d8 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 30 Jun 2009 18:02:29 +0530 Subject: [PATCH 01/16] [FIX] report_task : .po files corrected lp bug: https://launchpad.net/bugs/393824 fixed bzr revid: jvo@tinyerp.com-20090630123229-ptljaojwletg86av --- addons/report_task/i18n/ar_AR.po | 2 -- addons/report_task/i18n/bg_BG.po | 12 +++++++++++- addons/report_task/i18n/bs_BS.po | 4 +++- addons/report_task/i18n/ca_ES.po | 8 +++++++- addons/report_task/i18n/cs_CS.po | 1 - addons/report_task/i18n/cs_CZ.po | 2 -- addons/report_task/i18n/de_DE.po | 1 - addons/report_task/i18n/es_AR.po | 1 - addons/report_task/i18n/es_ES.po | 10 +++++++++- addons/report_task/i18n/et_EE.po | 10 +++++++++- addons/report_task/i18n/fr_FR.po | 2 -- addons/report_task/i18n/hr_HR.po | 1 - addons/report_task/i18n/hu_HU.po | 1 - addons/report_task/i18n/it_IT.po | 10 +++++++++- addons/report_task/i18n/lt_LT.po | 1 - addons/report_task/i18n/nl_BE.po | 5 ++++- addons/report_task/i18n/nl_NL.po | 8 +++++++- addons/report_task/i18n/pl_PL.po | 10 +++++++++- addons/report_task/i18n/pt_BR.po | 9 ++++++++- addons/report_task/i18n/pt_PT.po | 9 ++++++++- addons/report_task/i18n/report_task.pot | 1 - addons/report_task/i18n/ro_RO.po | 1 - addons/report_task/i18n/ru_RU.po | 13 ++++++++++++- addons/report_task/i18n/sl_SL.po | 9 ++++++++- addons/report_task/i18n/sv_SE.po | 5 ++++- addons/report_task/i18n/sv_SV.po | 5 ++++- addons/report_task/i18n/tr_TR.po | 5 ++++- addons/report_task/i18n/uk_UK.po | 13 ++++++++++++- addons/report_task/i18n/zh_CN.po | 1 - addons/report_task/i18n/zh_TW.po | 1 - 30 files changed, 128 insertions(+), 33 deletions(-) diff --git a/addons/report_task/i18n/ar_AR.po b/addons/report_task/i18n/ar_AR.po index 06f4007a448..75cc7a86d42 100644 --- a/addons/report_task/i18n/ar_AR.po +++ b/addons/report_task/i18n/ar_AR.po @@ -168,5 +168,3 @@ msgstr "" #: field:report.closed.task,project_id:0 msgid "Project" msgstr "" - -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/bg_BG.po b/addons/report_task/i18n/bg_BG.po index a0505c84ae3..724965b4579 100644 --- a/addons/report_task/i18n/bg_BG.po +++ b/addons/report_task/i18n/bg_BG.po @@ -157,4 +157,14 @@ msgstr "" #. module: report_task #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" -msgstr "Невалиден XML за преглед \ No newline at end of file +msgstr "Невалиден XML за преглед" + +#. module: report_task +#: field:report.closed.task,delay_hours:0 +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" diff --git a/addons/report_task/i18n/bs_BS.po b/addons/report_task/i18n/bs_BS.po index 0c44d1ba279..af1743751a3 100644 --- a/addons/report_task/i18n/bs_BS.po +++ b/addons/report_task/i18n/bs_BS.po @@ -165,4 +165,6 @@ msgid "Delay Hours" msgstr "" #. module: report_task -#: field:report.closed.task,project_id:0 \ No newline at end of file +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" diff --git a/addons/report_task/i18n/ca_ES.po b/addons/report_task/i18n/ca_ES.po index 15571a391d2..1471669afe0 100644 --- a/addons/report_task/i18n/ca_ES.po +++ b/addons/report_task/i18n/ca_ES.po @@ -161,4 +161,10 @@ msgstr "XML invàlid per a la definició de la vista!" #. module: report_task #: field:report.closed.task,delay_hours:0 -ms \ No newline at end of file +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" \ No newline at end of file diff --git a/addons/report_task/i18n/cs_CS.po b/addons/report_task/i18n/cs_CS.po index bb86578a3d3..af2b6458328 100644 --- a/addons/report_task/i18n/cs_CS.po +++ b/addons/report_task/i18n/cs_CS.po @@ -169,4 +169,3 @@ msgstr "" msgid "Project" msgstr "" -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/cs_CZ.po b/addons/report_task/i18n/cs_CZ.po index bfd8c0305c2..419eadaf046 100644 --- a/addons/report_task/i18n/cs_CZ.po +++ b/addons/report_task/i18n/cs_CZ.po @@ -168,5 +168,3 @@ msgstr "" #: field:report.closed.task,project_id:0 msgid "Project" msgstr "" - -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/de_DE.po b/addons/report_task/i18n/de_DE.po index 80aa37c3abd..2e0fc9473a3 100644 --- a/addons/report_task/i18n/de_DE.po +++ b/addons/report_task/i18n/de_DE.po @@ -169,4 +169,3 @@ msgstr "" msgid "Project" msgstr "" -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/es_AR.po b/addons/report_task/i18n/es_AR.po index 9b12dcb2603..855e8864046 100644 --- a/addons/report_task/i18n/es_AR.po +++ b/addons/report_task/i18n/es_AR.po @@ -169,4 +169,3 @@ msgstr "" msgid "Project" msgstr "" -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/es_ES.po b/addons/report_task/i18n/es_ES.po index 2efb4e53dae..c0cb073759b 100644 --- a/addons/report_task/i18n/es_ES.po +++ b/addons/report_task/i18n/es_ES.po @@ -160,4 +160,12 @@ msgid "Invalid XML for View Architecture!" msgstr "¡XML inválido para la definición de la vista!" #. module: report_task -#: field:report.closed.task,delay_hours: \ No newline at end of file +#: field:report.closed.task,delay_hours:0 +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/et_EE.po b/addons/report_task/i18n/et_EE.po index 999dc8e2151..917c52e295d 100644 --- a/addons/report_task/i18n/et_EE.po +++ b/addons/report_task/i18n/et_EE.po @@ -160,4 +160,12 @@ msgid "Invalid XML for View Architecture!" msgstr "Vigane XML vaate arhitektuurile!" #. module: report_task -#: field:report.close \ No newline at end of file +#: field:report.closed.task,delay_hours:0 +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/fr_FR.po b/addons/report_task/i18n/fr_FR.po index 6caaac91dc9..3555e02a532 100644 --- a/addons/report_task/i18n/fr_FR.po +++ b/addons/report_task/i18n/fr_FR.po @@ -168,5 +168,3 @@ msgstr "" #: field:report.closed.task,project_id:0 msgid "Project" msgstr "" - -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/hr_HR.po b/addons/report_task/i18n/hr_HR.po index d0839a03f6a..a8320aef6d8 100644 --- a/addons/report_task/i18n/hr_HR.po +++ b/addons/report_task/i18n/hr_HR.po @@ -169,4 +169,3 @@ msgstr "" msgid "Project" msgstr "" -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/hu_HU.po b/addons/report_task/i18n/hu_HU.po index c9cea9f3cfe..c7aa5591ce3 100644 --- a/addons/report_task/i18n/hu_HU.po +++ b/addons/report_task/i18n/hu_HU.po @@ -169,4 +169,3 @@ msgstr "" msgid "Project" msgstr "" -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/it_IT.po b/addons/report_task/i18n/it_IT.po index a02ed0373f9..ce2f19502d5 100644 --- a/addons/report_task/i18n/it_IT.po +++ b/addons/report_task/i18n/it_IT.po @@ -160,4 +160,12 @@ msgid "Invalid XML for View Architecture!" msgstr "XML non valido per Visualizzazione Architettura!" #. module: report_task -#: field:report.closed.task,delay_hou \ No newline at end of file +#: field:report.closed.task,delay_hours:0 +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/lt_LT.po b/addons/report_task/i18n/lt_LT.po index 91e24ed5f5a..d2c83df0ef1 100644 --- a/addons/report_task/i18n/lt_LT.po +++ b/addons/report_task/i18n/lt_LT.po @@ -169,4 +169,3 @@ msgstr "" msgid "Project" msgstr "" -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/nl_BE.po b/addons/report_task/i18n/nl_BE.po index aa79109b3b9..26382d06424 100644 --- a/addons/report_task/i18n/nl_BE.po +++ b/addons/report_task/i18n/nl_BE.po @@ -165,4 +165,7 @@ msgid "Delay Hours" msgstr "" #. module: report_task -#: fiel \ No newline at end of file +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/nl_NL.po b/addons/report_task/i18n/nl_NL.po index 56e69e13356..cefb0d894e5 100644 --- a/addons/report_task/i18n/nl_NL.po +++ b/addons/report_task/i18n/nl_NL.po @@ -162,4 +162,10 @@ msgstr "Ongeldige XML voor overzicht" #. module: report_task #: field:report.closed.task,delay_hours:0 msgid "Delay Hours" -m \ No newline at end of file +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/pl_PL.po b/addons/report_task/i18n/pl_PL.po index 0b41059e48e..4b4fe77c1cf 100644 --- a/addons/report_task/i18n/pl_PL.po +++ b/addons/report_task/i18n/pl_PL.po @@ -160,4 +160,12 @@ msgid "Invalid XML for View Architecture!" msgstr "XML niewłaściwy dla tej architektury wyświetlania!" #. module: report_task -#: field:report.closed.task, \ No newline at end of file +#: field:report.closed.task,delay_hours:0 +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/pt_BR.po b/addons/report_task/i18n/pt_BR.po index 99ba1039cd7..6013e9bccd6 100644 --- a/addons/report_task/i18n/pt_BR.po +++ b/addons/report_task/i18n/pt_BR.po @@ -161,4 +161,11 @@ msgstr "Invalido XML para Arquitetura da View" #. module: report_task #: field:report.closed.task,delay_hours:0 -msgid "Del \ No newline at end of file +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/pt_PT.po b/addons/report_task/i18n/pt_PT.po index bd8f192c291..fb144115dfd 100644 --- a/addons/report_task/i18n/pt_PT.po +++ b/addons/report_task/i18n/pt_PT.po @@ -161,4 +161,11 @@ msgstr "XML inválido para a arquitectura de vista" #. module: report_task #: field:report.closed.task,delay_hours:0 -msgid \ No newline at end of file +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/report_task.pot b/addons/report_task/i18n/report_task.pot index 8c8160dae23..28f5dcf9742 100644 --- a/addons/report_task/i18n/report_task.pot +++ b/addons/report_task/i18n/report_task.pot @@ -169,4 +169,3 @@ msgstr "" msgid "Project" msgstr "" -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/ro_RO.po b/addons/report_task/i18n/ro_RO.po index 5a65c4ef14f..cc5a7e15945 100644 --- a/addons/report_task/i18n/ro_RO.po +++ b/addons/report_task/i18n/ro_RO.po @@ -169,4 +169,3 @@ msgstr "" msgid "Project" msgstr "" -#. module: repo \ No newline at end of file diff --git a/addons/report_task/i18n/ru_RU.po b/addons/report_task/i18n/ru_RU.po index b26ab5fbb10..df07cb5601e 100644 --- a/addons/report_task/i18n/ru_RU.po +++ b/addons/report_task/i18n/ru_RU.po @@ -157,4 +157,15 @@ msgstr "" #. module: report_task #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" -msgstr "Неправильный XML д \ No newline at end of file +msgstr "Неправильный XML д!" + +#. module: report_task +#: field:report.closed.task,delay_hours:0 +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/sl_SL.po b/addons/report_task/i18n/sl_SL.po index 3b1cff02e71..edeeb98081c 100644 --- a/addons/report_task/i18n/sl_SL.po +++ b/addons/report_task/i18n/sl_SL.po @@ -161,4 +161,11 @@ msgstr "Neveljaven XML za arhitekturo pogleda." #. module: report_task #: field:report.closed.task,delay_hours:0 -msgid "Delay Hou \ No newline at end of file +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/sv_SE.po b/addons/report_task/i18n/sv_SE.po index f414cc4630f..051cb7381d1 100644 --- a/addons/report_task/i18n/sv_SE.po +++ b/addons/report_task/i18n/sv_SE.po @@ -165,4 +165,7 @@ msgid "Delay Hours" msgstr "" #. module: report_task -#: \ No newline at end of file +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/sv_SV.po b/addons/report_task/i18n/sv_SV.po index 859a526b645..542aa51581b 100644 --- a/addons/report_task/i18n/sv_SV.po +++ b/addons/report_task/i18n/sv_SV.po @@ -165,4 +165,7 @@ msgid "Delay Hours" msgstr "" #. module: report_task -#: \ No newline at end of file +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/tr_TR.po b/addons/report_task/i18n/tr_TR.po index b0310457714..ba807c47638 100644 --- a/addons/report_task/i18n/tr_TR.po +++ b/addons/report_task/i18n/tr_TR.po @@ -165,4 +165,7 @@ msgid "Delay Hours" msgstr "" #. module: report_task -#: field:report.closed.task,project_id:0 \ No newline at end of file +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/uk_UK.po b/addons/report_task/i18n/uk_UK.po index a7454f42fa5..1530dae5e85 100644 --- a/addons/report_task/i18n/uk_UK.po +++ b/addons/report_task/i18n/uk_UK.po @@ -157,4 +157,15 @@ msgstr "" #. module: report_task #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" -msgstr "Неправильний XML для Архітектури Ð \ No newline at end of file +msgstr "Неправильний XML для Архітектури �" + +#. module: report_task +#: field:report.closed.task,delay_hours:0 +msgid "Delay Hours" +msgstr "" + +#. module: report_task +#: field:report.closed.task,project_id:0 +msgid "Project" +msgstr "" + diff --git a/addons/report_task/i18n/zh_CN.po b/addons/report_task/i18n/zh_CN.po index 4045dfd4475..679c0c1ac11 100644 --- a/addons/report_task/i18n/zh_CN.po +++ b/addons/report_task/i18n/zh_CN.po @@ -169,4 +169,3 @@ msgstr "" msgid "Project" msgstr "" -#. module \ No newline at end of file diff --git a/addons/report_task/i18n/zh_TW.po b/addons/report_task/i18n/zh_TW.po index 445fe8a6d57..d95473ea87e 100644 --- a/addons/report_task/i18n/zh_TW.po +++ b/addons/report_task/i18n/zh_TW.po @@ -169,4 +169,3 @@ msgstr "" msgid "Project" msgstr "" -#. module: repo \ No newline at end of file From f9e8e5f27f8fa943ab8d2e392716b2abd0b6f8ef Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 30 Jun 2009 14:55:14 +0200 Subject: [PATCH 02/16] [fix] variants with extra on product list view bzr revid: fp@tinyerp.com-20090630125514-gp3gr3dodugyh90v --- addons/product/product.py | 1 + addons/product/product_view.xml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/addons/product/product.py b/addons/product/product.py index 1cb54c78d6e..c1e62e86689 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -383,6 +383,7 @@ class product_product(osv.osv): uom.id, product.list_price, context['uom']) else: res[product.id] = product.list_price + res[product.id] = (res[product.id] or 0.0) * product.price_margin + product.price_extra return res def _get_partner_code_name(self, cr, uid, ids, product_id, partner_id, context={}): diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index ef1920540e5..681b53a3088 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -116,6 +116,8 @@ + + @@ -533,6 +535,8 @@ + + From e53d2ca95b6ee9de4105b2a9270c54a48c83e5ac Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 30 Jun 2009 18:40:39 +0530 Subject: [PATCH 03/16] [REF] Account : Invioce report bzr revid: jvo@tinyerp.com-20090630131039-bzlg0jewgcb8bc32 --- addons/account/report/invoice.rml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index 10d50610720..cb6d549a7bd 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -404,13 +404,13 @@ - + Fiscal Position Remark : - [[ o.fiscal_position and format(o.fiscal_position.note) or removeParentNode('blockTable') ]] + [[ format(o.fiscal_position and o.fiscal_position.note or removeParentNode('blockTable')) ]] From 0e728b69f6128e76cfdfe8fcb7f22f4cd5de7127 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 30 Jun 2009 20:41:37 +0530 Subject: [PATCH 04/16] [FIX] hr_timesheet_sheet : date interval corrected for attendances lp bug: https://launchpad.net/bugs/393798 fixed bzr revid: jvo@tinyerp.com-20090630151137-hrcfrqavdi2zlz7a --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 17eabbc2f16..9d8bdb1ba64 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -503,8 +503,8 @@ class hr_attendance(osv.osv): LEFT JOIN (hr_attendance a \ LEFT JOIN hr_employee e \ ON (a.employee_id = e.id)) \ - ON (s.date_to >= a.name \ - AND s.date_from <= a.name \ + ON (s.date_to >= a.name::date \ + AND s.date_from <= a.name::date \ AND s.user_id = e.user_id) ' + \ qu1, qu2) res = cursor.fetchall() @@ -623,8 +623,8 @@ class hr_timesheet_sheet_sheet_day(osv.osv): LEFT JOIN hr_employee e ON (s.user_id = e.user_id)) ON (a.employee_id = e.id - AND s.date_to >= a.name - AND s.date_from <= a.name) + AND s.date_to >= a.name::date + AND s.date_from <= a.name::date) WHERE action in ('sign_in', 'sign_out') group by a.name::date, s.id )) AS foo From 26aca254b99bae2fdff67bc2cd67494797f83ccc Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Wed, 1 Jul 2009 14:26:13 +0530 Subject: [PATCH 05/16] [FIX] file attachment bug in x_object bzr revid: hmo@tinyerp.com-20090701085613-uiuufqoix2ldo8o8 --- addons/document/document.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 0d33efc5a1c..d5b61cae1f4 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -196,7 +196,7 @@ class node_class(object): else: for r in res: - if not r.name: + if not len(obj.fields_get(self.cr, self.uid, ['name'])): r.name = name_for+'%d'%r.id for invalid in INVALID_CHARS: if r.name.find(invalid) : @@ -648,7 +648,7 @@ class document_file(osv.osv): result = obj_model.read(cr, uid, [vals['res_id']], context=context) if len(result): obj=result[0] - vals['title'] = (obj['name'] or '')[:60] + vals['title'] = (obj.get('name',''))[:60] if obj_model._name=='res.partner': vals['partner_id']=obj['id'] elif obj.get('address_id',False): From 672569a73fee5f5d5a256decc03238c6f863f7ac Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Wed, 1 Jul 2009 16:20:37 +0530 Subject: [PATCH 06/16] [IMP]Directory structure is translated to the users preference language in FTP Client bzr revid: hmo@tinyerp.com-20090701105037-6fd1buk1mp6b2ado --- addons/document/document.py | 113 ++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 49 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index d5b61cae1f4..585031e1fc5 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -103,23 +103,38 @@ class node_class(object): test_nodename=test_nodename.replace('/', '_') path = self.path+'/'+test_nodename if not nodename: - n = node_class(self.cr, self.uid,path, self.object2, False, content=content, type='content', root=False) + n = node_class(self.cr, self.uid,path, self.object2, False, context=self.context, content=content, type='content', root=False) res2.append( n) else: if nodename == test_nodename: - n = node_class(self.cr, self.uid, path, self.object2, False, content=content, type='content', root=False) + n = node_class(self.cr, self.uid, path, self.object2, False, context=self.context, content=content, type='content', root=False) res2.append(n) - ids = fobj.search(self.cr, self.uid, where+[ ('parent_id','=',self.object and self.object.id or False) ], context=self.context) + ids = fobj.search(self.cr, self.uid, where+[ ('parent_id','=',self.object and self.object.id or False) ]) if self.object and self.root and (self.object.type=='ressource'): - ids += fobj.search(self.cr, self.uid, where+[ ('parent_id','=',False) ], context=self.context) + ids += fobj.search(self.cr, self.uid, where+[ ('parent_id','=',False) ]) res = fobj.browse(self.cr, self.uid, ids, context=self.context) - return map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, False, type='file', root=False), res) + res2 - + return map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, False, context=self.context, type='file', root=False), res) + res2 + + 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] + return result + def directory_list_for_child(self,nodename,parent=False): pool = pooler.get_pool(self.cr.dbname) where = [] - if nodename: + if nodename: + nodename = self.get_translation(nodename, self.context['lang']) where.append(('name','like',nodename)) if (self.object and self.object.type=='directory') or not self.object2: where.append(('parent_id','=',self.object and self.object.id or False)) @@ -130,17 +145,17 @@ class node_class(object): else: where.append(('ressource_parent_type_id','=',False)) - ids = pool.get('document.directory').search(self.cr, self.uid, where+[('ressource_id','=',0)], self.context) + ids = pool.get('document.directory').search(self.cr, self.uid, where+[('ressource_id','=',0)]) if self.object2: - ids += pool.get('document.directory').search(self.cr, self.uid, where+[('ressource_id','=',self.object2.id)], self.context) - res = pool.get('document.directory').browse(self.cr, self.uid, ids,self.context) + ids += pool.get('document.directory').search(self.cr, self.uid, where+[('ressource_id','=',self.object2.id)]) + res = pool.get('document.directory').browse(self.cr, self.uid, ids, self.context) return res def _child_get(self, nodename=False): if self.type not in ('collection','database'): return [] res = self.directory_list_for_child(nodename) - result= map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, x.type=='directory' and self.object2 or False, root=self.root), res) + result= map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, x.type=='directory' and self.object2 or False, context=self.context, root=self.root), res) if self.type=='database': pool = pooler.get_pool(self.cr.dbname) fobj = pool.get('ir.attachment') @@ -150,7 +165,7 @@ class node_class(object): file_ids=fobj.search(self.cr,self.uid,vargs) res = fobj.browse(self.cr, self.uid, file_ids, context=self.context) - result +=map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, False, type='file', root=self.root), res) + result +=map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, False, context=self.context, type='file', root=self.root), res) if self.type=='collection' and self.object.type=="ressource": where = self.object.domain and eval(self.object.domain, {'active_id':self.root}) or [] pool = pooler.get_pool(self.cr.dbname) @@ -169,12 +184,17 @@ class node_class(object): nodename=nodename.replace('__','/') for invalid in INVALID_CHARS: if nodename.find(INVALID_CHARS[invalid]) : - nodename=nodename.replace(INVALID_CHARS[invalid],invalid) + nodename=nodename.replace(INVALID_CHARS[invalid],invalid) + nodename = self.get_translation(nodename, self.context['lang']) where.append((_dirname_field,'like',nodename)) - + if self.object.ressource_tree: if obj._parent_name in obj.fields_get(self.cr,self.uid): - where.append((obj._parent_name,'=',self.object2 and self.object2.id or False)) + where.append((obj._parent_name,'=',self.object2 and self.object2.id or False)) + ids = obj.search(self.cr, self.uid, where) + res = obj.browse(self.cr, self.uid, ids,self.context) + result+= map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name.replace('/','__'), self.object, x, context=self.context, root=x.id), res) + return result else : if self.object2: return result @@ -183,31 +203,22 @@ class node_class(object): return result - ids = obj.search(self.cr, self.uid, where, self.context) - res = obj.browse(self.cr, self.uid, ids,self.context) - if _dirname_field == 'dirname': - for r in res: - if not r.dirname: - r.dirname = name_for+'%d'%r.id - for invalid in INVALID_CHARS: - if r.dirname.find(invalid) : - r.dirname=r.dirname.replace(invalid,INVALID_CHARS[invalid]) - result2 = map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.dirname.replace('/','__'), self.object, x, root=x.id), res) - - else: - for r in res: - if not len(obj.fields_get(self.cr, self.uid, ['name'])): - r.name = name_for+'%d'%r.id - for invalid in INVALID_CHARS: - if r.name.find(invalid) : - r.name=r.name.replace(invalid,INVALID_CHARS[invalid]) - result2 = map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name.replace('/','__'), self.object, x, root=x.id), res) - + ids = obj.search(self.cr, self.uid, where) + res = obj.browse(self.cr, self.uid, ids,self.context) + for r in res: + if len(obj.fields_get(self.cr, self.uid, [_dirname_field])): + r.name = eval('r.'+_dirname_field) + else: + r.name = name_for+'%d'%r.id + for invalid in INVALID_CHARS: + if r.name.find(invalid) : + r.name=r.name.replace(invalid,INVALID_CHARS[invalid]) + result2 = map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name.replace('/','__'), self.object, x, context=self.context, root=x.id), res) if result2: if self.object.ressource_tree: result += result2 else: - result = result2 + result = result2 return result def children(self): @@ -232,7 +243,7 @@ class document_directory(osv.osv): _name = 'document.directory' _description = 'Document directory' _columns = { - 'name': fields.char('Name', size=64, required=True, select=1), + 'name': fields.char('Name', size=64, required=True, select=1, translate=True), 'write_date': fields.datetime('Date Modified', readonly=True), 'write_uid': fields.many2one('res.users', 'Last Modification User', readonly=True), 'create_date': fields.datetime('Date Created', readonly=True), @@ -304,7 +315,6 @@ class document_directory(osv.osv): def __init__(self, *args, **kwargs): res = super(document_directory, self).__init__(*args, **kwargs) self._cache = {} - return res def onchange_content_id(self, cr, uid, ids, ressource_type_id): return {} @@ -312,6 +322,7 @@ class document_directory(osv.osv): def _get_childs(self, cr, uid, node, nodename=False, context={}): where = [] if nodename: + nodename = self.get_translation(nodename, self.context['lang']) where.append(('name','like',nodename)) if object: where.append(('parent_id','=',object.id)) @@ -326,12 +337,17 @@ 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={}): + 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 if not uri: - return node_class(cr, uid, '', False, type='database') + return node_class(cr, uid, '', False, context=context, type='database') turi = tuple(uri) - if False and (turi in self._cache): - (path, oo, oo2, content,type,root) = self._cache[turi] + if False and (turi in self._cache): + (path, oo, oo2, context, content,type,root) = self._cache[turi] if oo: object = self.pool.get(oo[0]).browse(cr, uid, oo[1], context) else: @@ -340,10 +356,10 @@ class document_directory(osv.osv): object2 = self.pool.get(oo2[0]).browse(cr, uid, oo2[1], context) else: object2 = False - node = node_class(cr, uid, path, object,object2, context, content, type, root) + node = node_class(cr, uid, '/', False, context=context, type='database') return node - node = node_class(cr, uid, '/', False, type='database') + node = node_class(cr, uid, '/', False, context=context, type='database') for path in uri[:]: if path: node = node.child(path) @@ -351,7 +367,7 @@ class document_directory(osv.osv): return False oo = node.object and (node.object._name, node.object.id) or False oo2 = node.object2 and (node.object2._name, node.object2.id) or False - self._cache[turi] = (node.path, oo, oo2, node.content,node.type,node.root) + self._cache[turi] = (node.path, oo, oo2, node.context, node.content,node.type,node.root) return node def get_childs(self, cr, uid, uri, context={}): @@ -378,7 +394,7 @@ class document_directory(osv.osv): ressource_parent_type_id=vals.get('ressource_parent_type_id',False) ressource_id=vals.get('ressource_id',0) if op=='write': - for directory in self.browse(cr,uid,ids): + for directory in self.browse(cr,uid,ids): if not name: name=directory.name if not parent_id: @@ -591,7 +607,7 @@ class document_file(osv.osv): res_model=vals.get('res_model',False) res_id=vals.get('res_id',0) if op=='write': - for file in self.browse(cr,uid,ids): + for file in self.browse(cr,uid,ids): if not name: name=file.name if not parent_id: @@ -603,7 +619,6 @@ class document_file(osv.osv): res=self.search(cr,uid,[('id','<>',file.id),('name','=',name),('parent_id','=',parent_id),('res_model','=',res_model),('res_id','=',res_id)]) if len(res): return False - if op=='create': res=self.search(cr,uid,[('name','=',name),('parent_id','=',parent_id),('res_id','=',res_id),('res_model','=',res_model)]) if len(res): @@ -790,6 +805,6 @@ class document_configuration_wizard(osv.osv_memory): "view_mode": 'form', 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', - 'target':'new', + 'target': 'new', } document_configuration_wizard() From 305acfe99e7083a2df63c6d3984a83de37422e25 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 2 Jul 2009 12:19:20 +0530 Subject: [PATCH 07/16] [FIX] Account_tax_include corrected to resolve conflict with account_invoice_layout lp bug: https://launchpad.net/bugs/393840 fixed bzr revid: jvo@tinyerp.com-20090702064920-mcmymhoup3dfrkfg --- addons/account_tax_include/invoice_tax_incl.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_tax_include/invoice_tax_incl.xml b/addons/account_tax_include/invoice_tax_incl.xml index 470a1ca0697..2da7895562f 100644 --- a/addons/account_tax_include/invoice_tax_incl.xml +++ b/addons/account_tax_include/invoice_tax_incl.xml @@ -21,7 +21,7 @@ account.invoice - + From 800140ddea9211a24c69e7df04da9e12887049f8 Mon Sep 17 00:00:00 2001 From: "PAP(OpenERP)" <> Date: Thu, 2 Jul 2009 12:20:54 +0530 Subject: [PATCH 08/16] [FIX] Project : Xml record corrected for view lp bug: https://launchpad.net/bugs/394436 fixed bzr revid: jvo@tinyerp.com-20090702065054-y8dr1xz0ffp5m1ed --- addons/project/project_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 97f4dc0eb28..f130ec8b5c0 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -140,8 +140,8 @@ New Project project.project form - form,tree,calendar - + form,tree + From 2bfc9b95fa982c6ec0d7a21425feaf46cd7192e9 Mon Sep 17 00:00:00 2001 From: "ame (Tiny/Axelor)" Date: Thu, 2 Jul 2009 13:11:25 +0530 Subject: [PATCH 09/16] [FIX] price unit calculation from context (web client issue). bzr revid: ame@tinyerp.com-20090702074125-f0kmzz2r5gzkvgfc --- 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 37a73adfea4..6ec083ac7cb 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -921,7 +921,7 @@ class account_invoice_line(osv.osv): if 'check_total' in context: t = context['check_total'] for l in context.get('invoice_line', {}): - if len(l) >= 3 and l[2]: + if isinstance(l, (list, tuple)) and len(l) >= 3 and l[2]: tax_obj = self.pool.get('account.tax') p = l[2].get('price_unit', 0) * (1-l[2].get('discount', 0)/100.0) t = t - (p * l[2].get('quantity')) From 1ebfdc2194db696c86887e032dc8c7b1029c023a Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Thu, 2 Jul 2009 16:02:28 +0530 Subject: [PATCH 10/16] [FIX] Sale : sale order report corrected for translation lp bug: https://launchpad.net/bugs/394640 fixed bzr revid: jvo@tinyerp.com-20090702103228-wyaykcxslxs5vljm --- addons/sale/report/order.rml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale/report/order.rml b/addons/sale/report/order.rml index 25e286f92d9..fac75e4f4d9 100644 --- a/addons/sale/report/order.rml +++ b/addons/sale/report/order.rml @@ -174,8 +174,8 @@ - [[ o.state<>'draft' and removeParentNode('para') ]] Quotation N.[[ o.name ]] - [[ o.state=='draft' and removeParentNode('para') ]] Order N.[[ o.name ]] + [[ o.state<>'draft' and removeParentNode('para') ]] Quotation N° [[ o.name ]] + [[ o.state=='draft' and removeParentNode('para') ]] Order N° [[ o.name ]] From 13a57aa62d37960e159dc98534f199fc9053d523 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 2 Jul 2009 20:08:31 +0530 Subject: [PATCH 11/16] [FIX] Account : Charts of accounts - target move options corrected lp bug: https://launchpad.net/bugs/394275 fixed bzr revid: jvo@tinyerp.com-20090702143831-e8t92cza5rbyoj4g --- addons/account/wizard/wizard_account_chart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/wizard/wizard_account_chart.py b/addons/account/wizard/wizard_account_chart.py index f60dfdcf0a2..124a8146c34 100644 --- a/addons/account/wizard/wizard_account_chart.py +++ b/addons/account/wizard/wizard_account_chart.py @@ -41,7 +41,7 @@ class wizard_account_chart(wizard.interface): 'target_move': { 'string': 'Target Moves', 'type': 'selection', - 'selection': [('all','All Entries'),('posted_only','All Posted Entries')], + 'selection': [('all','All Entries'),('posted','All Posted Entries')], 'required': True, 'default': lambda *a:"all", }, @@ -60,7 +60,7 @@ class wizard_account_chart(wizard.interface): result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree') id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] result = act_obj.read(cr, uid, [id], context=context)[0] - result['context'] = str({'fiscalyear': data['form']['fiscalyear'],'target_move':data['form']['target_move']}) + result['context'] = str({'fiscalyear': data['form']['fiscalyear'],'state':data['form']['target_move']}) if data['form']['fiscalyear']: result['name']+=':'+pooler.get_pool(cr.dbname).get('account.fiscalyear').read(cr,uid,[data['form']['fiscalyear']])[0]['code'] return result From d600449baed77583f28e5f1be750a9791ac67140 Mon Sep 17 00:00:00 2001 From: "VRA(OpenERP)" <> Date: Thu, 2 Jul 2009 20:22:27 +0530 Subject: [PATCH 12/16] [FIX] Account : Charts of accounts - Tax reports corected lp bug: https://launchpad.net/bugs/394275 fixed bzr revid: jvo@tinyerp.com-20090702145227-tdz6urlykcm01fyd --- addons/account/report/tax_report.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/addons/account/report/tax_report.py b/addons/account/report/tax_report.py index 79e59959d12..1f0332d2906 100644 --- a/addons/account/report/tax_report.py +++ b/addons/account/report/tax_report.py @@ -43,20 +43,6 @@ class tax_report(rml_parse.rml_parse): }) - def comma_me(self,amount): - - if type(amount) is float : - amount = str('%.2f'%amount) - else : - amount = str(amount) - if (amount == '0'): - return ' ' - orig = amount - new = re.sub("^(-?\d+)(\d{3})", "\g<1>'\g<2>", amount) - if orig == new: - return new - else: - return self.comma_me(new) def _get_lines(self, based_on,period_list,company_id=False, parent=False, level=0): res = self._get_codes(based_on,company_id,parent,level,period_list) @@ -73,7 +59,6 @@ class tax_report(rml_parse.rml_parse): i = 0 top_result = [] - while i < len(res): res_dict = { 'code' : res[i][1].code, @@ -106,7 +91,6 @@ class tax_report(rml_parse.rml_parse): def _get_general(self, tax_code_id,period_list ,company_id, based_on): res=[] period_sql_list = ','.join(map(str, period_list[0][2])) - if based_on == 'payments': self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \ SUM(line.debit) AS debit, \ @@ -125,6 +109,7 @@ class tax_report(rml_parse.rml_parse): AND line.account_id = account.id \ AND account.company_id = %s \ AND move.id = line.move_id \ + AND line.period_id IN ('+ period_sql_list +') \ AND ((invoice.state = %s) \ OR (invoice.id IS NULL)) \ GROUP BY account.id,account.name,account.code', ('draft',tax_code_id, @@ -144,6 +129,7 @@ class tax_report(rml_parse.rml_parse): AND line.tax_code_id = %s \ AND line.account_id = account.id \ AND account.company_id = %s \ + AND line.period_id IN ('+ period_sql_list +') \ AND account.active \ GROUP BY account.id,account.name,account.code', ('draft',tax_code_id, company_id)) From 124ce667753eaff696661cb2c556251c3107f9ea Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 2 Jul 2009 20:26:52 +0530 Subject: [PATCH 13/16] [IMP] Sale : state name display corected lp bug: https://launchpad.net/bugs/394733 fixed bzr revid: jvo@tinyerp.com-20090702145652-bp9lk7oumg4fr3w6 --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index d0f529f7cee..58240d2058f 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -193,7 +193,7 @@ class sale_order(osv.osv): ('shipping_except','Shipping Exception'), ('invoice_except','Invoice Exception'), ('done','Done'), - ('cancel','Cancel') + ('cancel','Cancelled') ], 'Order State', readonly=True, help="Gives the state of the quotation or sale order. The exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the packing list process (Shipping Exception). The 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Date Ordered'.", select=True), 'date_order':fields.date('Date Ordered', required=True, readonly=True, states={'draft':[('readonly',False)]}), From a3b98e29d585bc1fca4df4613bb8b54306740822 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 2 Jul 2009 20:41:59 +0530 Subject: [PATCH 14/16] [FIX] Purchase,Product :description of POL made widen,partner_ref changes lp bug: https://launchpad.net/bugs/394277 fixed bzr revid: jvo@tinyerp.com-20090702151159-7y5o0eumpg4vfxxe --- addons/product/product.py | 2 +- addons/purchase/purchase.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index c1e62e86689..b7ae4ea566e 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -404,7 +404,7 @@ class product_product(osv.osv): for p in self.browse(cr, uid, ids, context): data = self._get_partner_code_name(cr, uid, [], p.id, context.get('partner_id', None), context) if not data['code']: - data['name'] = p.code + data['code'] = p.code if not data['name']: data['name'] = p.name res[p.id] = (data['code'] and ('['+data['code']+'] ') or '') + \ diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 0b339908a0a..68bec40c4bc 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -432,7 +432,7 @@ class purchase_order_line(osv.osv): return res _columns = { - 'name': fields.char('Description', size=64, required=True), + 'name': fields.char('Description', size=256, required=True), 'product_qty': fields.float('Quantity', required=True, digits=(16,2)), 'date_planned': fields.datetime('Scheduled date', required=True), 'taxes_id': fields.many2many('account.tax', 'purchase_order_taxe', 'ord_id', 'tax_id', 'Taxes'), From 484d021700986e73aa15534cb7303b0457e1a4df Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Fri, 3 Jul 2009 10:50:40 +0530 Subject: [PATCH 15/16] [ADD] add base_module_quality module bzr revid: mra@tinyerp.com-20090703052040-3rokridr4h3z33xj --- addons/base_module_quality/README.txt | 11 + addons/base_module_quality/__init__.py | 26 ++ addons/base_module_quality/__terp__.py | 51 +++ .../base_module_quality.py | 250 ++++++++++++++ .../base_module_quality_view.xml | 70 ++++ .../base_module_quality_wizard.xml | 12 + .../base_module_quality/document/quality.doc | Bin 0 -> 646656 bytes addons/base_module_quality/i18n/ar_AR.po | 74 +++++ .../i18n/base_module_quality.pot | 74 +++++ addons/base_module_quality/i18n/bg_BG.po | 74 +++++ addons/base_module_quality/i18n/bs_BS.po | 74 +++++ addons/base_module_quality/i18n/ca_ES.po | 74 +++++ addons/base_module_quality/i18n/cs_CZ.po | 74 +++++ addons/base_module_quality/i18n/de_DE.po | 74 +++++ addons/base_module_quality/i18n/es_AR.po | 74 +++++ addons/base_module_quality/i18n/es_ES.po | 74 +++++ addons/base_module_quality/i18n/et_EE.po | 74 +++++ addons/base_module_quality/i18n/fr_FR.po | 74 +++++ addons/base_module_quality/i18n/hr_HR.po | 74 +++++ addons/base_module_quality/i18n/hu_HU.po | 74 +++++ addons/base_module_quality/i18n/it_IT.po | 74 +++++ addons/base_module_quality/i18n/lt_LT.po | 74 +++++ addons/base_module_quality/i18n/nl_NL.po | 74 +++++ addons/base_module_quality/i18n/pl_PL.po | 74 +++++ addons/base_module_quality/i18n/pt_BR.po | 74 +++++ addons/base_module_quality/i18n/pt_PT.po | 74 +++++ addons/base_module_quality/i18n/ro_RO.po | 74 +++++ addons/base_module_quality/i18n/ru_RU.po | 74 +++++ addons/base_module_quality/i18n/sl_SL.po | 74 +++++ addons/base_module_quality/i18n/sv_SE.po | 74 +++++ addons/base_module_quality/i18n/tr_TR.po | 74 +++++ addons/base_module_quality/i18n/uk_UK.po | 74 +++++ addons/base_module_quality/i18n/zh_CN.po | 74 +++++ addons/base_module_quality/i18n/zh_TW.po | 74 +++++ .../method_test/__init__.py | 24 ++ .../method_test/method_test.py | 85 +++++ .../object_test/__init__.py | 24 ++ .../object_test/object_test.py | 209 ++++++++++++ .../base_module_quality/pep8_test/__init__.py | 24 ++ .../pep8_test/pep8_test.py | 278 ++++++++++++++++ .../pyflakes_test/__init__.py | 24 ++ .../pyflakes_test/pyflakes_test.py | 120 +++++++ .../pylint_test/__init__.py | 26 ++ .../pylint_test/pylint_test.py | 101 ++++++ .../pylint_test/pylint_test_config.txt | 308 ++++++++++++++++++ .../security/ir.model.access.csv | 3 + .../speed_test/__init__.py | 24 ++ .../speed_test/speed_test.py | 125 +++++++ .../structure_test/__init__.py | 24 ++ .../structure_test/structure_test.py | 176 ++++++++++ .../base_module_quality/terp_test/__init__.py | 24 ++ .../terp_test/terp_test.py | 145 +++++++++ addons/base_module_quality/wizard/__init__.py | 28 ++ .../wizard/module_quality_check.py | 63 ++++ .../wizard/quality_save_report.py | 61 ++++ .../workflow_test/__init__.py | 24 ++ .../workflow_test/workflow_test.py | 150 +++++++++ 57 files changed, 4488 insertions(+) create mode 100644 addons/base_module_quality/README.txt create mode 100644 addons/base_module_quality/__init__.py create mode 100644 addons/base_module_quality/__terp__.py create mode 100644 addons/base_module_quality/base_module_quality.py create mode 100644 addons/base_module_quality/base_module_quality_view.xml create mode 100644 addons/base_module_quality/base_module_quality_wizard.xml create mode 100644 addons/base_module_quality/document/quality.doc create mode 100644 addons/base_module_quality/i18n/ar_AR.po create mode 100644 addons/base_module_quality/i18n/base_module_quality.pot create mode 100644 addons/base_module_quality/i18n/bg_BG.po create mode 100644 addons/base_module_quality/i18n/bs_BS.po create mode 100644 addons/base_module_quality/i18n/ca_ES.po create mode 100644 addons/base_module_quality/i18n/cs_CZ.po create mode 100644 addons/base_module_quality/i18n/de_DE.po create mode 100644 addons/base_module_quality/i18n/es_AR.po create mode 100644 addons/base_module_quality/i18n/es_ES.po create mode 100644 addons/base_module_quality/i18n/et_EE.po create mode 100644 addons/base_module_quality/i18n/fr_FR.po create mode 100644 addons/base_module_quality/i18n/hr_HR.po create mode 100644 addons/base_module_quality/i18n/hu_HU.po create mode 100644 addons/base_module_quality/i18n/it_IT.po create mode 100644 addons/base_module_quality/i18n/lt_LT.po create mode 100644 addons/base_module_quality/i18n/nl_NL.po create mode 100644 addons/base_module_quality/i18n/pl_PL.po create mode 100644 addons/base_module_quality/i18n/pt_BR.po create mode 100644 addons/base_module_quality/i18n/pt_PT.po create mode 100644 addons/base_module_quality/i18n/ro_RO.po create mode 100644 addons/base_module_quality/i18n/ru_RU.po create mode 100644 addons/base_module_quality/i18n/sl_SL.po create mode 100644 addons/base_module_quality/i18n/sv_SE.po create mode 100644 addons/base_module_quality/i18n/tr_TR.po create mode 100644 addons/base_module_quality/i18n/uk_UK.po create mode 100644 addons/base_module_quality/i18n/zh_CN.po create mode 100644 addons/base_module_quality/i18n/zh_TW.po create mode 100644 addons/base_module_quality/method_test/__init__.py create mode 100644 addons/base_module_quality/method_test/method_test.py create mode 100644 addons/base_module_quality/object_test/__init__.py create mode 100644 addons/base_module_quality/object_test/object_test.py create mode 100644 addons/base_module_quality/pep8_test/__init__.py create mode 100644 addons/base_module_quality/pep8_test/pep8_test.py create mode 100644 addons/base_module_quality/pyflakes_test/__init__.py create mode 100644 addons/base_module_quality/pyflakes_test/pyflakes_test.py create mode 100644 addons/base_module_quality/pylint_test/__init__.py create mode 100644 addons/base_module_quality/pylint_test/pylint_test.py create mode 100644 addons/base_module_quality/pylint_test/pylint_test_config.txt create mode 100644 addons/base_module_quality/security/ir.model.access.csv create mode 100644 addons/base_module_quality/speed_test/__init__.py create mode 100644 addons/base_module_quality/speed_test/speed_test.py create mode 100644 addons/base_module_quality/structure_test/__init__.py create mode 100644 addons/base_module_quality/structure_test/structure_test.py create mode 100644 addons/base_module_quality/terp_test/__init__.py create mode 100644 addons/base_module_quality/terp_test/terp_test.py create mode 100644 addons/base_module_quality/wizard/__init__.py create mode 100644 addons/base_module_quality/wizard/module_quality_check.py create mode 100644 addons/base_module_quality/wizard/quality_save_report.py create mode 100644 addons/base_module_quality/workflow_test/__init__.py create mode 100644 addons/base_module_quality/workflow_test/workflow_test.py diff --git a/addons/base_module_quality/README.txt b/addons/base_module_quality/README.txt new file mode 100644 index 00000000000..3819448c9c1 --- /dev/null +++ b/addons/base_module_quality/README.txt @@ -0,0 +1,11 @@ +This module provide a generic framework to define your own quality test. + + +All you have to do is to: +* create a folder with your test in 'base_module_quality' (e.g: mkdir base_module_quality\mytest) +* create a .py file in it with same name as the folder you just created (e.g: touch base_module_quality\mytest\mytest.py) +* edit your file and define a class 'quality_check' that + * inherits the class 'abstract_quality_test' (defined in base_module_quality.py) + * implements the __init__() method accordingly to what you want to test. + + diff --git a/addons/base_module_quality/__init__.py b/addons/base_module_quality/__init__.py new file mode 100644 index 00000000000..1f0d6b5dbe7 --- /dev/null +++ b/addons/base_module_quality/__init__.py @@ -0,0 +1,26 @@ +# -*- 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 base_module_quality +import wizard + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/base_module_quality/__terp__.py b/addons/base_module_quality/__terp__.py new file mode 100644 index 00000000000..9c16e9be300 --- /dev/null +++ b/addons/base_module_quality/__terp__.py @@ -0,0 +1,51 @@ +# -*- 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': 'Base module quality', + 'version': '1.0', + 'category': 'Tiny Specific Modules/Base module quality', + 'description': """ +This module's aim is to check the quality of other modules. + +It defines a wizard on the list of modules in OpenERP, which allow you to +evaluate them on different criteria such as: the respect of OpenERP coding +standards, the speed efficiency... + +This module also provides generic framework to define your own quality test. +For further info, coders may take a look into base_module_quality\README.txt + +WARNING: This module can not work as a ZIP file, you must unzip it before +using it, otherwise it may crash. + """, + 'author': 'Tiny', + 'website': 'http://www.openerp.com', + 'depends': ['base'], + 'init_xml': [], + 'update_xml': ['base_module_quality_wizard.xml', 'base_module_quality_view.xml', 'security/ir.model.access.csv'], + 'demo_xml': [], + 'installable': True, + 'active': False, + 'certificate': '0175119475677', +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py new file mode 100644 index 00000000000..ec1a50adb4a --- /dev/null +++ b/addons/base_module_quality/base_module_quality.py @@ -0,0 +1,250 @@ +# -*- 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 os + +import pooler +import osv +import tools +from tools import config +from tools.translate import _ +from osv import osv, fields + +class abstract_quality_check(object): + ''' + This Class provides... + ''' + + def __init__(self): + ''' + this method should initialize the var + ''' + #This float have to store the rating of the module. + #Used to compute the final score (average of all scores). + #0 <= self.score <= 1 + self.score = 0.0 + + #This char have to store the name of the test. + self.name = "" + + #This char have to store the aim of the test and eventually a note. + self.note = "" + + #This char have to store the result. + #Used to display the result of the test. + self.result = "" + + #This char have to store the result with more details. + #Used to provide more details if necessary. + self.result_details = "" + + # This boolean variable defines that if you do not want to calculate score and just only need detail + # or summary report for some test then you will make it False. + self.bool_count_score = True + + #This bool defines if the test can be run only if the module + #is installed. + #True => the module have to be installed. + #False => the module can be uninstalled. + self.bool_installed_only = True + + #This variable is used to give result of test more weight, + #because some tests are more critical than others. + self.ponderation = 1.0 + + #Specify test got an error on module + self.error = False + + #The tests have to subscribe itselfs in this list, that contains + #all the test that have to be performed. + self.tests = [] + self.list_folders = os.listdir(config['addons_path'] + + '/base_module_quality/') + for item in self.list_folders: + self.item = item + path = config['addons_path']+'/base_module_quality/'+item + if os.path.exists(path + '/' + item + '.py') and item not in ['report', 'wizard', 'security']: + item2 = 'base_module_quality.' + item +'.' + item + x_module = __import__(item2) + x_file = getattr(x_module, item) + x_obj = getattr(x_file, item) + self.tests.append(x_obj) +# raise 'Not Implemented' + + def run_test(self, cr, uid, module_path=""): + ''' + this method should do the test and fill the score, result and result_details var + ''' + raise osv.except_osv(_('Programming Error'), _('Test Is Not Implemented')) + + def get_objects(self, cr, uid, module): + # This function returns all object of the given module.. + pool = pooler.get_pool(cr.dbname) + ids2 = pool.get('ir.model.data').search(cr, uid, + [('module', '=', module), ('model', '=', 'ir.model')]) + model_list = [] + model_data = pool.get('ir.model.data').browse(cr, uid, ids2) + for model in model_data: + model_list.append(model.res_id) + obj_list = [] + for mod in pool.get('ir.model').browse(cr, uid, model_list): + obj_list.append(str(mod.model)) + return obj_list + + def get_model_ids(self, cr, uid, models=[]): + # This function returns all ids of the given objects.. + if not models: + return [] + pool = pooler.get_pool(cr.dbname) + return pool.get('ir.model').search(cr, uid, [('model', 'in', models)]) + + def get_ids(self, cr, uid, object_list): + #This method return dictionary with ids of records of object for module + pool = pooler.get_pool(cr.dbname) + result_ids = {} + for obj in object_list: + ids = pool.get(obj).search(cr, uid, []) + ids = filter(lambda id: id != None, ids) + result_ids[obj] = ids + return result_ids + + def format_table(self, header=[], data_list={}): #This function can work forwidget="text_wiki" + detail = "" + detail += (header[0]) % tuple(header[1]) + frow = '\n|-' + for i in header[1]: + frow += '\n| %s' + for key, value in data_list.items(): + detail += (frow) % tuple(value) + detail = detail + '\n|}' + return detail + + def format_html_table(self, header=[], data_list=[]): #This function can work for widget="html_tag" + # function create html table.... + detail = "" + detail += (header[0]) % tuple(header[1]) + frow = '' + for i in header[1]: + frow += '%s' + frow += '' + for key, value in data_list.items(): + detail += (frow) % tuple(value) + return detail + + def add_quatation(self, x_no, y_no): + return x_no/y_no + +class module_quality_check(osv.osv): + _name = 'module.quality.check' + _columns = { + 'name': fields.char('Rated Module', size=64, ), + 'final_score': fields.char('Final Score (%)', size=10,), + 'check_detail_ids': fields.one2many('module.quality.detail', 'quality_check_id', 'Tests',) + } + + def check_quality(self, cr, uid, module_name, module_state=None): + ''' + This function will calculate score of openerp module + It will return data in below format: + Format: {'final_score':'80.50', 'name': 'sale', + 'check_detail_ids': + [(0,0,{'name':'workflow_test', 'score':'100', 'ponderation':'0', 'summary': text_wiki format data, 'detail': html format data, 'state':'done', 'note':'XXXX'}), + ((0,0,{'name':'terp_test', 'score':'60', 'ponderation':'1', 'summary': text_wiki format data, 'detail': html format data, 'state':'done', 'note':'terp desctioption'}), + ..........]} + So here the detail result is in html format and summary will be in text_wiki format. + ''' + #list_folders = os.listdir(config['addons_path']+'/base_module_quality/') + pool = pooler.get_pool(cr.dbname) + obj_module = pool.get('ir.module.module') + if not module_state: + module_id = obj_module.search(cr, uid, [('name', '=', module_name)]) + if module_id: + module_state = obj_module.browse(cr, uid, module_id[0]).state + + abstract_obj = abstract_quality_check() + score_sum = 0.0 + ponderation_sum = 0.0 + create_ids = [] + for test in abstract_obj.tests: + ad = tools.config['addons_path'] + if module_name == 'base': + ad = tools.config['root_path']+'/addons' + module_path = os.path.join(ad, module_name) + val = test.quality_test() + if not val.bool_installed_only or module_state == "installed": + val.run_test(cr, uid, str(module_path)) + if not val.error: + data = { + 'name': val.name, + 'score': val.score * 100, + 'ponderation': val.ponderation, + 'summary': val.result, + 'detail': val.result_details, + 'state': 'done', + 'note': val.note, + } + if val.bool_count_score: + score_sum += val.score * val.ponderation + ponderation_sum += val.ponderation + else: + data = { + 'name': val.name, + 'score': 0, + 'summary': val.result, + 'state': 'skipped', + 'note': val.note, + } + else: + data = { + 'name': val.name, + 'note': val.note, + 'score': 0, + 'state': 'skipped', + 'summary': _("The module has to be installed before running this test.") + } + create_ids.append((0, 0, data)) + + final_score = '%.2f' % (score_sum / ponderation_sum * 100) + data = { + 'name': module_name, + 'final_score': final_score, + 'check_detail_ids' : create_ids, + } + return data + +module_quality_check() + +class module_quality_detail(osv.osv): + _name = 'module.quality.detail' + _columns = { + 'quality_check_id': fields.many2one('module.quality.check', 'Quality'), + 'name': fields.char('Name',size=128,), + 'score': fields.float('Score (%)'), + 'ponderation': fields.float('Ponderation', help='Some tests are more critical than others, so they have a bigger weight in the computation of final rating'), + 'note': fields.text('Note',), + 'summary': fields.text('Summary'), + 'detail': fields.text('Details'), + 'state': fields.selection([('done','Done'),('skipped','Skipped'),], 'State', size=6, help='The test will be completed only if the module is installed or if the test may be processed on uninstalled module.'), + } + +module_quality_detail() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/base_module_quality/base_module_quality_view.xml b/addons/base_module_quality/base_module_quality_view.xml new file mode 100644 index 00000000000..18ad04415bd --- /dev/null +++ b/addons/base_module_quality/base_module_quality_view.xml @@ -0,0 +1,70 @@ + + + + + Results of Quality Checks + module.quality.check + tree + + + + + + + + + + Results of Quality Checks + module.quality.check + form + +
+ + + + + + + +
+ + Results of Quality Checks with detail + module.quality.detail + form + +
+ + + + + + + + + + + +