From 6898b2230a2eb1a837dc0c349d0cc4f332344e49 Mon Sep 17 00:00:00 2001 From: "nel@tinyerp.com" <> Date: Tue, 29 Sep 2009 13:58:04 +0200 Subject: [PATCH 01/13] set product id on move lines bzr revid: nel@tinyerp.com-20090929115804-9we1ivhac1ayzbuk --- addons/stock/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 039dfdd99fd..1d7b69c6b3a 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1266,6 +1266,7 @@ class stock_move(osv.osv): (0, 0, { 'name': move.name, 'quantity': move.product_qty, + 'product_id': move.product_id and move.product_id.id or False, 'credit': amount, 'account_id': acc_src, 'ref': ref, @@ -1273,6 +1274,7 @@ class stock_move(osv.osv): 'partner_id': partner_id}), (0, 0, { 'name': move.name, + 'product_id': move.product_id and move.product_id.id or False, 'quantity': move.product_qty, 'debit': amount, 'account_id': acc_dest, From 34645503b72e0e7196f98f0ebca0902009afddba Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Tue, 29 Sep 2009 17:50:27 +0530 Subject: [PATCH 02/13] [IMP] base_module_quality: styles on different tests bzr revid: mra@tinyerp.com-20090929122027-8e01uw61dwax00h3 --- .../base_module_quality.py | 32 +++++++++++++ .../object_test/object_test.py | 48 ++++--------------- .../pep8_test/pep8_test.py | 22 ++------- .../pylint_test/pylint_test.py | 36 +++----------- .../speed_test/speed_test.py | 21 ++------ .../structure_test/structure_test.py | 26 ++-------- .../terp_test/terp_test.py | 23 ++------- addons/base_module_quality/wizard/__init__.py | 2 - .../workflow_test/workflow_test.py | 21 ++------ 9 files changed, 65 insertions(+), 166 deletions(-) diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index d584177a993..70568090439 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -161,6 +161,38 @@ class abstract_quality_check(object): def add_quatation(self, x_no, y_no): return x_no/y_no + def get_style(self): + # This function return style tag with specified styles for html pages + style = ''' + ''' + return style + + class module_quality_check(osv.osv): _name = 'module.quality.check' _columns = { diff --git a/addons/base_module_quality/object_test/object_test.py b/addons/base_module_quality/object_test/object_test.py index ada0b944cb4..87329b480c7 100644 --- a/addons/base_module_quality/object_test/object_test.py +++ b/addons/base_module_quality/object_test/object_test.py @@ -40,7 +40,6 @@ Test checks for fields, views, security rules, dependancy level return None def run_test(self, cr, uid, module_path): - pool = pooler.get_pool(cr.dbname) module_name = module_path.split('/')[-1] obj_list = self.get_objects(cr, uid, module_name) @@ -184,24 +183,9 @@ Test checks for fields, views, security rules, dependancy level def get_result_details(self, dict_obj): res = "" if dict_obj != {}: - str_html = ''' Fields Result - ''' + str_html = ''' Fields Result%s'''%(self.get_style()) res += str_html - header = ('%s%s%s', [_('Object Name'), _('Field name'), _('Suggestion')]) + header = ('%s%s%s', [_('Object Name'), _('Field name'), _('Suggestion')]) if not self.error: for key in dict_obj.keys(): data_list = [] @@ -211,34 +195,18 @@ Test checks for fields, views, security rules, dependancy level for i in data_list: count = count + 1 final_dict[key + str(count)] = i - res_str = '' + self.format_html_table(header, data_list=final_dict) + '

' - res += res_str.replace('''
' + res += res_str.replace('''' return "" def get_result_general(self, dict_obj, name=''): - str_html = ''' %s Result - '''% (name) - header = ('', [_('Object Name'), _('Suggestion')]) + str_html = ''' %s Result%s
%s%s
'''% (name, self.get_style()) + header = ('', [_('Object Name'), _('Suggestion')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_obj) + '
%s%s
' - res = res.replace('''Result - - ''' - header = ('', [_('Object Name'), _('Line number'), _('Suggestion')]) + str_html = '''Result%s
%s%s%s
'''%(self.get_style()) + header = ('', [_('Object Name'), _('Line number'), _('Suggestion')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_obj) + '
%s%s%s
' - res = res.replace(''' - - - ''' + self.result_details += '''%s'''%(self.get_style()) for file_py in list_files: if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__terp__.py'): if not flag: @@ -104,17 +82,18 @@ class quality_test(base_module_quality.abstract_quality_check): dict_py[file_py] = [file_py, _("Unable to parse the result. Check the details.")] replace_string = '' replace_string += res - replace_string = replace_string.replace(''' - ''' - header = ('', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')]) + str_html = '''%s
%s%s%s%s%s%s
'''%(self.get_style()) + header = ('', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_speed) + '
%s%s%s%s%s%s
' - res = res.replace(''' - ''' - header = ('', [_('File Name'), _('Feedback about structure of module')]) + str_html = '''%s
%s%s
'''%(self.get_style()) + header = ('', [_('File Name'), _('Feedback about structure of module')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_struct) + '
%s%s
' - res = res.replace(''' - ''' - header = ('', [_('Tag Name'), _('Feed back About terp file of Module')]) + str_html = '''%s
%s%s
'''%(self.get_style()) + header = ('', [_('Tag Name'), _('Feed back About terp file of Module')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_terp) + '
%s%s
' - res = res.replace(''' - ''' - header = ('', [_('Object Name'), _('Feed back About Workflow of Module')]) + str_html = '''%s
%s%s
'''%(self.get_style()) + header = ('', [_('Object Name'), _('Feed back About Workflow of Module')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_wf) + '
%s%s
' - res = res.replace(''' Date: Tue, 29 Sep 2009 19:26:59 +0530 Subject: [PATCH 03/13] [REVERT] Document : BAD Fix jvo@tinyerp.com-20090925134942-y663miys2ocgwi56 bzr revid: jvo@tinyerp.com-20090929135659-3zf9j2m8a8py2qvx --- addons/document/document.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 4b1a5c715e3..460c52a9698 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -651,11 +651,11 @@ class document_file(osv.osv): def create(self, cr, uid, vals, context={}): vals['title']=vals['name'] vals['parent_id'] = context.get('parent_id',False) or vals.get('parent_id',False) -# if not vals.get('res_id', False) and context.get('default_res_id',False): -# vals['res_id']=context.get('default_res_id',False) -# if not vals.get('res_model', False) and context.get('default_res_model',False): -# vals['res_model']=context.get('default_res_model',False) - vals['res_model'] = "report.document.user" + if not vals.get('res_id', False) and context.get('default_res_id',False): + vals['res_id']=context.get('default_res_id',False) + if not vals.get('res_model', False) and context.get('default_res_model',False): + vals['res_model']=context.get('default_res_model',False) + if vals.get('res_id', False) and vals.get('res_model',False): obj_model=self.pool.get(vals['res_model']) result = obj_model.read(cr, uid, [vals['res_id']], context=context) @@ -695,7 +695,6 @@ class document_file(osv.osv): res = content_index(base64.decodestring(datas), vals['datas_fname'], vals.get('content_type', None)) super(document_file,self).write(cr, uid, [result], { 'index_content' : res, - 'res_id' : result }) cr.commit() except: From 4cedadb41522d5db5a1db27dd8c20e43161e44c6 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 29 Sep 2009 20:22:09 +0530 Subject: [PATCH 04/13] [FIX] Stock : Stock move lines on Production Order well-structured lp bug: https://launchpad.net/bugs/438705 fixed bzr revid: jvo@tinyerp.com-20090929145209-yfkyl3z7ot5rpyus --- addons/stock/stock_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 17a0de03be6..4dd89b614aa 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1245,6 +1245,7 @@ + Date: Wed, 30 Sep 2009 12:57:07 +0530 Subject: [PATCH 05/13] [FIX] Report_project :wrong average of closing days counting lp bug: https://launchpad.net/bugs/439041 fixed bzr revid: jvo@tinyerp.com-20090930072707-japt0gv7zj8v6s5b --- addons/report_project/report_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/report_project/report_project.py b/addons/report_project/report_project.py index b87961e9ee7..933af3e5a46 100644 --- a/addons/report_project/report_project.py +++ b/addons/report_project/report_project.py @@ -47,7 +47,7 @@ class report_project_task_user(osv.osv): t.user_id, t.project_id, sum(planned_hours) as hours_planned, - to_char(avg(date_close::abstime-t.create_date::timestamp), 'DD"d" HH12:MI:SS') as closing_days, + to_char(avg(date_close::abstime-t.create_date::timestamp), 'DD"d" HH24:MI:SS') as closing_days, sum(w.hours) as hours_effective, ((sum(planned_hours)-sum(w.hours))/count(distinct t.id))::decimal(16,2) as hours_delay from project_task t From 777942a9ba67e889dfe57757498668b2c2f52eaf Mon Sep 17 00:00:00 2001 From: "SME(OpenERP)" <> Date: Thu, 1 Oct 2009 17:02:20 +0530 Subject: [PATCH 06/13] [FIX] Product : Pricelist types getting translated on Pricelist lp bug: https://launchpad.net/bugs/439469 fixed bzr revid: jvo@tinyerp.com-20091001113220-v5j8aaop9y560yen --- addons/product/pricelist.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index a1bec9c74ba..3170a7662a1 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -81,8 +81,18 @@ product_pricelist_type() class product_pricelist(osv.osv): def _pricelist_type_get(self, cr, uid, context={}): - cr.execute('select key,name from product_pricelist_type order by name') - return cr.fetchall() + pricelist_type_obj = self.pool.get('product.pricelist.type') + pricelist_type_ids = pricelist_type_obj.search(cr, uid, [], order='name') + pricelist_types = pricelist_type_obj.read(cr, uid, pricelist_type_ids, ['key','name'], context=context) + + res = [] + + for type in pricelist_types: + res.append((type['key'],type['name'])) + + return res +# cr.execute('select key,name from product_pricelist_type order by name') +# return cr.fetchall() _name = "product.pricelist" _description = "Pricelist" _columns = { From a91bea57dacb2d4b0832b0ddabf88f6c83ae4ac3 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 1 Oct 2009 19:06:32 +0530 Subject: [PATCH 07/13] [FIX] Base_report_creator : Calendar view problems on custom report bzr revid: jvo@tinyerp.com-20091001133632-xjfiek5rrob854ok --- addons/base_report_creator/base_report_creator.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index af7049bd894..bcca40a153e 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -107,7 +107,16 @@ class report_creator(osv.osv): else: temp_list.append('''''' % {'name':'field'+str(i)}) i+=1 - arch += '''<%(view_type)s string="%(string)s" date_start="%(date_start)s" date_delay="%(date_delay)s" color="%(color)s">''' %set_dict + arch += '''<%(view_type)s string="%(string)s" date_start="%(date_start)s" ''' %set_dict + if set_dict.get('date_delay',False): + arch +=''' date_delay="%(date_delay)s" '''%set_dict + + if set_dict.get('date_stop',False): + arch +=''' date_stop="%(date_stop)s" '''%set_dict + + if set_dict.get('color',False): + arch +=''' color="%(color)s"'''%set_dict + arch += '''>''' arch += ''.join(temp_list) else: arch += '<%s string="%s">\n' % (view_type, report.name) @@ -375,7 +384,7 @@ class report_creator_field(osv.osv): 'report_id': fields.many2one('base_report_creator.report','Report', on_delete='cascade'), 'group_method': fields.selection([('group','Grouped'),('sum','Sum'),('min','Minimum'),('count','Count'),('max','Maximum'),('avg','Average')], 'Grouping Method', required=True), 'graph_mode': fields.selection([('','/'),('x','X Axis'),('y','Y Axis')], 'Graph Mode'), - 'calendar_mode': fields.selection([('','/'),('date_start','Starting Date'),('date_end','Ending Date'),('date_delay','Delay'),('color','Uniq Colors')], 'Calendar Mode'), + 'calendar_mode': fields.selection([('','/'),('date_start','Starting Date'),('date_end','Ending Date'),('date_delay','Delay'),('date_stop','End Date'),('color','Unique Colors')], 'Calendar Mode'), } _defaults = { 'group_method': lambda *args: 'group', From 585c8ab6bd7ffdfb4d34fa24ed30de72c1692097 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 1 Oct 2009 19:44:25 +0530 Subject: [PATCH 08/13] [FIX] Hr_timesheet : Allowing user to enter Analytic Journal if not linked with employee(Working hours tree view) lp bug: https://launchpad.net/bugs/439208 fixed bzr revid: jvo@tinyerp.com-20091001141425-ebe4oz4p5kzgcumo --- addons/hr_timesheet/hr_timesheet_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml index e6769788cbb..add70579c66 100644 --- a/addons/hr_timesheet/hr_timesheet_view.xml +++ b/addons/hr_timesheet/hr_timesheet_view.xml @@ -16,6 +16,7 @@ + From f04d6c24c99ebdad9d12f9ba72e5307de19d2ab5 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Sat, 3 Oct 2009 15:45:23 +0530 Subject: [PATCH 09/13] [FIX] Purchase : POL had a wrong tree view which is unused till now lp bug: https://launchpad.net/bugs/440557 fixed bzr revid: jvo@tinyerp.com-20091003101523-udaqx36d3tkmx0f4 --- addons/purchase/purchase_view.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 972d91206f3..2d020bd6180 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -215,10 +215,8 @@ tree - - + - From ecad1e7e6c58e53be1710c33d390f518080dddb9 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Sat, 3 Oct 2009 16:23:53 +0530 Subject: [PATCH 10/13] [FIX] Purchase : Setting the value of payment term while creatying invoice from PO lp bug: https://launchpad.net/bugs/438725 fixed bzr revid: jvo@tinyerp.com-20091003105353-4153l3coj3g30bvn --- addons/purchase/purchase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index f5bb716f9d1..5661deedeee 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -329,7 +329,8 @@ class purchase_order(osv.osv): 'journal_id': len(journal_ids) and journal_ids[0] or False, 'origin': o.name, 'invoice_line': il, - 'fiscal_position': o.partner_id.property_account_position.id + 'fiscal_position': o.partner_id.property_account_position.id, + 'payment_term':o.partner_id.property_payment_term and o.partner_id.property_payment_term.id or False, } inv_id = self.pool.get('account.invoice').create(cr, uid, inv, {'type':'in_invoice'}) self.pool.get('account.invoice').button_compute(cr, uid, [inv_id], {'type':'in_invoice'}, set_total=True) From 1f4ef0a39dbcbc908825e24de749f3b3bf4d7b09 Mon Sep 17 00:00:00 2001 From: Albert Cervera i Areny <> Date: Sat, 3 Oct 2009 19:07:16 +0530 Subject: [PATCH 11/13] [FIX] Purchase : PO with different pricelists should not be merged lp bug: https://launchpad.net/bugs/440711 fixed bzr revid: jvo@tinyerp.com-20091003133716-zkd40gb4x8hlbtfb --- addons/purchase/wizard/wizard_group.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/purchase/wizard/wizard_group.py b/addons/purchase/wizard/wizard_group.py index 6add3ad99f8..fdacf955d82 100644 --- a/addons/purchase/wizard/wizard_group.py +++ b/addons/purchase/wizard/wizard_group.py @@ -37,6 +37,7 @@ merge_form = """ * their status is draft * they belong to the same partner * are going to the same location + * have the same pricelist - lines will only be merged if: * they are exactly the same except for the quantity and unit @@ -76,7 +77,7 @@ def _merge_orders(self, cr, uid, data, context): # compute what the new orders should contain new_orders = {} for porder in [order for order in order_obj.browse(cr, uid, data['ids']) if order.state == 'draft']: - order_key = make_key(porder, ('partner_id', 'location_id')) + order_key = make_key(porder, ('partner_id', 'location_id', 'pricelist_id')) new_order = new_orders.setdefault(order_key, ({}, [])) new_order[1].append(porder.id) From 2909fc06b6bd5f97786fda3269151ec854605827 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 5 Oct 2009 12:35:13 +0530 Subject: [PATCH 12/13] [FIX] Account : Fiscal Position Template was missing a requireed field in form view lp bug: https://launchpad.net/bugs/441609 fixed bzr revid: jvo@tinyerp.com-20091005070513-30xzzzhy6ffzl71a --- addons/account/account_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 8353695f76e..97c50abdea8 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1709,6 +1709,7 @@
+ From c739c90870fb4686a6d3184d70da5c5b8215d5a2 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 5 Oct 2009 14:42:56 +0530 Subject: [PATCH 13/13] [FIX] Stock : Picking did not have 'type' field on display(inconsistent behavior from eTiny,koo) to work upon domain. lp bug: https://launchpad.net/bugs/440734 fixed bzr revid: jvo@tinyerp.com-20091005091256-8bwsqs9j5pnif4ah --- addons/stock/stock_view.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 4dd89b614aa..6281d2dd1cc 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -620,6 +620,7 @@ + @@ -811,6 +812,7 @@ + @@ -991,6 +993,7 @@ +