@@ -52,7 +52,7 @@
|
||||
<form string="Invoice Line">
|
||||
<notebook>
|
||||
<page string="Line">
|
||||
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position)" select="1"/>
|
||||
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit)" select="1"/>
|
||||
<field name="uos_id"/>
|
||||
<field name="quantity" select="1"/>
|
||||
<field name="price_unit" select="1"/>
|
||||
|
||||
@@ -217,6 +217,7 @@ class partner_balance(report_sxw.rml_parse):
|
||||
"JOIN account_account ac ON (l.account_id = ac.id)" \
|
||||
"WHERE ac.type IN " + self.ACCOUNT_TYPE + " " \
|
||||
"AND l.date IN (" + self.date_lst_string + ") " \
|
||||
"AND ac.company_id = "+ str(data['form']['company_id']) +" " \
|
||||
"GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \
|
||||
"ORDER BY l.account_id,p.name")
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
@@ -184,9 +184,24 @@ Test checks for fields, views, security rules, dependancy level
|
||||
def get_result_details(self, dict_obj):
|
||||
res = ""
|
||||
if dict_obj != {}:
|
||||
str_html = '''<html><strong> Fields Result</strong><head></head><body>'''
|
||||
str_html = '''<html><strong> Fields Result</strong><head>
|
||||
<style>
|
||||
.bstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:dashed;
|
||||
border-color: gray;
|
||||
}
|
||||
.btstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:solid;
|
||||
border-color: gray;
|
||||
}
|
||||
}
|
||||
</style></head><body>'''
|
||||
res += str_html
|
||||
header = ('<tr><th width="200">%s</th><th width="200">%s</th><th width="300">%s</th></tr>', [_('Object Name'), _('Field name'), _('Suggestion')])
|
||||
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('Object Name'), _('Field name'), _('Suggestion')])
|
||||
if not self.error:
|
||||
for key in dict_obj.keys():
|
||||
data_list = []
|
||||
@@ -196,15 +211,32 @@ Test checks for fields, views, security rules, dependancy level
|
||||
for i in data_list:
|
||||
count = count + 1
|
||||
final_dict[key + str(count)] = i
|
||||
res += '<table>' + self.format_html_table(header, data_list=final_dict) + '</table><br>'
|
||||
res_str = '<table class="bstyle">' + self.format_html_table(header, data_list=final_dict) + '</table><br>'
|
||||
res += res_str.replace('''<td''', '''<td class="btstyle" ''')
|
||||
return res + '</body></html>'
|
||||
return ""
|
||||
|
||||
def get_result_general(self, dict_obj, name=''):
|
||||
str_html = '''<html><strong> %s Result</strong><head></head><body><table>'''% (name)
|
||||
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('Suggestion')])
|
||||
str_html = '''<html><strong> %s Result</strong><head>
|
||||
<style>
|
||||
.bstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:dashed;
|
||||
border-color: gray;
|
||||
}
|
||||
.btstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:solid;
|
||||
border-color: gray;
|
||||
}
|
||||
}
|
||||
</style></head><body><table class="bstyle">'''% (name)
|
||||
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('Object Name'), _('Suggestion')])
|
||||
if not self.error:
|
||||
res = str_html + self.format_html_table(header, data_list=dict_obj) + '</table></body></html>'
|
||||
res = res.replace('''<td''', '''<td class="btstyle" ''')
|
||||
return res
|
||||
return ""
|
||||
|
||||
|
||||
@@ -271,10 +271,27 @@ PEP-8 Test , copyright of py files check, method can not call from loops
|
||||
return ""
|
||||
|
||||
def get_result_general(self, dict_obj):
|
||||
str_html = '''<html><strong>Result</strong><head></head><body><table>'''
|
||||
header = ('<tr><th>%s</th><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('Line number'), _('Suggestion')])
|
||||
str_html = '''<html><strong>Result</strong><head>
|
||||
<style>
|
||||
.bstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:dashed;
|
||||
border-color: gray;
|
||||
}
|
||||
.btstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:solid;
|
||||
border-color: gray;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head><body><table class="bstyle">'''
|
||||
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('Object Name'), _('Line number'), _('Suggestion')])
|
||||
if not self.error:
|
||||
res = str_html + self.format_html_table(header, data_list=dict_obj) + '</table></body></html>'
|
||||
res = res.replace('''<td''', '''<td class="btstyle" ''')
|
||||
return res
|
||||
return ""
|
||||
|
||||
|
||||
@@ -48,11 +48,29 @@ class quality_test(base_module_quality.abstract_quality_check):
|
||||
score = 0.0
|
||||
dict_py = {}
|
||||
flag = False
|
||||
self.result_details += '''<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="/tg_widgets/openerp/css/wiki.css" media="all">
|
||||
</head>
|
||||
<body>'''
|
||||
self.result_details += '''<html><body><head>
|
||||
<style>
|
||||
.bstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:dashed;
|
||||
border-color: gray;
|
||||
}
|
||||
.btstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:solid;
|
||||
border-color: gray;
|
||||
}
|
||||
.head
|
||||
{
|
||||
color: black;background: none;font-weight: normal;margin: 0;padding-top: .5em;
|
||||
padding-bottom: .17em; border-bottom: 1px solid #aaa;
|
||||
}
|
||||
}
|
||||
</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:
|
||||
@@ -84,8 +102,19 @@ class quality_test(base_module_quality.abstract_quality_check):
|
||||
score += 0
|
||||
#self.result += file + ": "+_("Unable to parse the result. Check the details.")+"\n"
|
||||
dict_py[file_py] = [file_py, _("Unable to parse the result. Check the details.")]
|
||||
self.result_details += res.replace('''<div''', '''<div class="wikiwidget readonlyfield"''')
|
||||
|
||||
replace_string = ''
|
||||
replace_string += res
|
||||
replace_string = replace_string.replace('''<div''', '''<div style="border:1px solid #aaaaaa;background-color:#f9f9f9;padding:5px;"''')
|
||||
replace_string = replace_string.replace('''<h1''', '''<h1 style="font-size:188%" class="head" ''')
|
||||
replace_string = replace_string.replace('''<h2''', '''<h2 style="font-size:150%" class="head" ''')
|
||||
replace_string = replace_string.replace('''<h3''', '''<h3 style="font-size:132%" class="head" ''')
|
||||
replace_string = replace_string.replace('''<h4''', '''<h4 style="font-size:116%" class="head" ''')
|
||||
replace_string = replace_string.replace('''<h5''', '''<h5 style="font-size:100%" class="head" ''')
|
||||
replace_string = replace_string.replace('''<h6''', '''<h6 style="font-size:80%" class="head" ''')
|
||||
replace_string = replace_string.replace('''<table''', '''<table class="bstyle" ''')
|
||||
replace_string = replace_string.replace('''<th''', '''<th class="btstyle" ''')
|
||||
replace_string = replace_string.replace('''<td''', '''<td class="btstyle" ''')
|
||||
self.result_details += replace_string
|
||||
if not flag:
|
||||
self.error = True
|
||||
self.result = _("No python file found")
|
||||
|
||||
@@ -125,10 +125,26 @@ This test checks the speed of the module. Note that at least 5 demo data is need
|
||||
return ""
|
||||
|
||||
def get_result_details(self, dict_speed):
|
||||
str_html = '''<html><head></head><body><table border="1">'''
|
||||
header = ('<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')])
|
||||
str_html = '''<html><head>
|
||||
<style>
|
||||
.bstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:dashed;
|
||||
border-color: gray;
|
||||
}
|
||||
.btstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:solid;
|
||||
border-color: gray;
|
||||
}
|
||||
}
|
||||
</style></head><body><table class="bstyle">'''
|
||||
header = ('<tr><th class="btstyle" >%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('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) + '</table></body></html>'
|
||||
res = res.replace('''<td''', '''<td class="btstyle" ''')
|
||||
return res
|
||||
return ""
|
||||
|
||||
|
||||
@@ -170,10 +170,26 @@ This test checks if the module satisfy tiny structure
|
||||
return score
|
||||
|
||||
def get_result_details(self, dict_struct):
|
||||
str_html = '''<html><head></head><body><table>'''
|
||||
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('File Name'), _('Feedback about structure of module')])
|
||||
str_html = '''<html><head>
|
||||
<style>
|
||||
.bstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:dashed;
|
||||
border-color: gray;
|
||||
}
|
||||
.btstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:solid;
|
||||
border-color: gray;
|
||||
}
|
||||
}
|
||||
</style></head><body><table class="bstyle">'''
|
||||
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('File Name'), _('Feedback about structure of module')])
|
||||
if not self.error:
|
||||
res = str_html + self.format_html_table(header, data_list=dict_struct) + '</table></body></html>'
|
||||
res = res.replace('''<td''', '''<td class="btstyle" ''')
|
||||
return res
|
||||
return ""
|
||||
|
||||
|
||||
@@ -137,10 +137,26 @@ class quality_test(base_module_quality.abstract_quality_check):
|
||||
|
||||
def get_result_details(self, dict_terp):
|
||||
if dict_terp:
|
||||
str_html = '''<html><head></head><body><table border="1">'''
|
||||
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('Tag Name'), _('Feed back About terp file of Module')])
|
||||
str_html = '''<html><head>
|
||||
<style>
|
||||
.bstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:dashed;
|
||||
border-color: gray;
|
||||
}
|
||||
.btstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:solid;
|
||||
border-color: gray;
|
||||
}
|
||||
}
|
||||
</style></head><body><table class="bstyle">'''
|
||||
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('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) + '</table><newline/></body></html>'
|
||||
res = res.replace('''<td''', '''<td class="btstyle" ''')
|
||||
return res
|
||||
return ""
|
||||
|
||||
|
||||
@@ -134,10 +134,26 @@ class quality_test(base_module_quality.abstract_quality_check):
|
||||
return ""
|
||||
|
||||
def get_result_details(self, dict_wf):
|
||||
str_html = '''<html><head></head><body><table border="1">'''
|
||||
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('Feed back About Workflow of Module')])
|
||||
str_html = '''<html><head>
|
||||
<style>
|
||||
.bstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:dashed;
|
||||
border-color: gray;
|
||||
}
|
||||
.btstyle
|
||||
{
|
||||
border-width:2px;
|
||||
border-style:solid;
|
||||
border-color: gray;
|
||||
}
|
||||
}
|
||||
</style></head><body><table class="bstyle">'''
|
||||
header = ('<tr><th class="btstyle">%s</th><th class="btstyle">%s</th></tr>', [_('Object Name'), _('Feed back About Workflow of Module')])
|
||||
if not self.error:
|
||||
res = str_html + self.format_html_table(header, data_list=dict_wf) + '</table><newline/></body></html>'
|
||||
res = res.replace('''<td''', '''<td class="btstyle" ''')
|
||||
return res
|
||||
return ""
|
||||
|
||||
|
||||
@@ -651,10 +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)
|
||||
# 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 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)
|
||||
@@ -693,7 +694,8 @@ class document_file(osv.osv):
|
||||
try:
|
||||
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,
|
||||
'index_content' : res,
|
||||
'res_id' : result
|
||||
})
|
||||
cr.commit()
|
||||
except:
|
||||
|
||||
@@ -300,7 +300,7 @@ class mrp_repair(osv.osv):
|
||||
'invoice_id': inv_id,
|
||||
'name': name,
|
||||
'origin':repair.name,
|
||||
'account_id': a,
|
||||
'account_id': operation.product_id and operation.product_id.property_account_income and operation.product_id.property_account_income.id,
|
||||
'quantity' : operation.product_uom_qty,
|
||||
'invoice_line_tax_id': [(6,0,[x.id for x in operation.tax_id])],
|
||||
'uos_id' : operation.product_uom.id,
|
||||
|
||||
+1
-1
@@ -374,7 +374,7 @@ class sale_order(osv.osv):
|
||||
'account_id': a,
|
||||
'partner_id': order.partner_id.id,
|
||||
'address_invoice_id': order.partner_invoice_id.id,
|
||||
'address_contact_id': order.partner_invoice_id.id,
|
||||
'address_contact_id': order.partner_order_id.id,
|
||||
'invoice_line': [(6, 0, lines)],
|
||||
'currency_id': order.pricelist_id.currency_id.id,
|
||||
'comment': order.note,
|
||||
|
||||
@@ -98,6 +98,8 @@ class subscription_subscription(osv.osv):
|
||||
|
||||
def model_copy(self, cr, uid, ids, context={}):
|
||||
for row in self.read(cr, uid, ids):
|
||||
if not row.get('cron_id',False):
|
||||
continue
|
||||
cron_ids = [row['cron_id'][0]]
|
||||
remaining = self.pool.get('ir.cron').read(cr, uid, cron_ids, ['numbercall'])[0]['numbercall']
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user