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 @@
+ 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('''''' % {'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', 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: 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 @@ +
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 = { 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) 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 - - + - 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) 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 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, diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 17a0de03be6..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 @@ + @@ -1245,6 +1248,7 @@ +