diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py
index 0eda4f8c3fe..09fc74507fe 100644
--- a/addons/audittrail/audittrail.py
+++ b/addons/audittrail/audittrail.py
@@ -219,6 +219,7 @@ def log_fct( db, uid, passwd, object, method, fct_src , *args ):
lines.append(line)
create_log_line(cr,uid,id,model_object,lines)
cr.commit()
+ cr.close()
return res_id
if method in ('write'):
@@ -247,6 +248,7 @@ def log_fct( db, uid, passwd, object, method, fct_src , *args ):
lines.append(line)
cr.commit()
create_log_line(cr,uid,id,model_object,lines)
+ cr.close()
return res
if method in ('read'):
@@ -273,6 +275,7 @@ def log_fct( db, uid, passwd, object, method, fct_src , *args ):
lines.append(line)
cr.commit()
create_log_line(cr,uid,id,model_object,lines)
+ cr.close()
return res
if method in ('unlink'):
@@ -296,12 +299,15 @@ def log_fct( db, uid, passwd, object, method, fct_src , *args ):
cr.commit()
create_log_line(cr,uid,id,model_object,lines)
res =fct_src( db, uid, passwd, object, method, *args)
+ cr.close()
return res
+ cr.close()
def tmp_fct(fct_src):
def execute( db, uid, passwd, object, method, *args):
pool = pooler.get_pool(db)
cr = pooler.get_db(db).cursor()
+ cr.autocommit(True)
obj=pool.get(object)
logged_uids = []
object_name=obj._name
@@ -330,12 +336,14 @@ def tmp_fct(fct_src):
if getattr(thisrule, 'log_'+field):
return log_fct(db, uid, passwd, object, method, fct_src , *args)
return fct_src( db, uid, passwd, object, method, *args)
- cr.commit()
- return my_fct( db, uid, passwd, object, method, *args)
+ res = my_fct( db, uid, passwd, object, method, *args)
cr.close()
+ return res
return execute
obj = netsvc._service['object']
obj.execute = tmp_fct(obj.execute)
obj.exportMethod(obj.execute)
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/base_module_publish/wizard/base_module_publish_all.py b/addons/base_module_publish/wizard/base_module_publish_all.py
index 6816262534b..fc2e85a153c 100644
--- a/addons/base_module_publish/wizard/base_module_publish_all.py
+++ b/addons/base_module_publish/wizard/base_module_publish_all.py
@@ -101,6 +101,9 @@ def _upload(self, cr, uid, datas, context):
], [('module', res['module_filename'],
res['module_file'])
])
+ print '-'*50
+ print result
+ print '-'*50
if result[0] == "1":
raise wizard.except_wizard('Error', 'Login failed!')
elif result[0] == "0":
@@ -126,13 +129,18 @@ def _upload(self, cr, uid, datas, context):
'auto_login': datas['form']['login'],
'auto_password': datas['form']['password']
}
+ print updata
a = urlopen('http://www.openerp.com/mtree_interface.php?module=%s' % (mod.name,))
aa = a.read()
+ print '='*40
+ print aa
if aa[0]<>'0':
updata['link_id']=aa.split('\n')[0]
updata['cat_id']=aa.split('\n')[1]
updata['option'] = 'mtree'
result = post_multipart('www.openerp.com', '/index.php', updata.items(), [])
+ print '.'*50
+ print result
return {'update': '\n'.join(log[0]), 'already': '\n'.join(log[1]),
'error': '\n'.join(log[2])}
diff --git a/addons/document/document.py b/addons/document/document.py
index 01ab5e96beb..942eefb2682 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -33,6 +33,17 @@ from content_index import content_index
import netsvc
import StringIO
+import random
+import string
+
+
+def random_name():
+ random.seed()
+ d = [random.choice(string.letters) for x in xrange(10) ]
+ name = "".join(d)
+ return name
+
+
# Unsupported WebDAV Commands:
# label
# search
@@ -462,18 +473,6 @@ class ir_action_report_xml(osv.osv):
ir_action_report_xml()
-
-import random
-import string
-
-
-def random_name():
- random.seed()
- d = [random.choice(string.letters) for x in xrange(10) ]
- name = "".join(d)
- return name
-
-
def create_directory(path):
dir_name = random_name()
path = os.path.join(path,dir_name)
diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml
index 9dd27bba66f..2d76d88341c 100644
--- a/addons/document/document_view.xml
+++ b/addons/document/document_view.xml
@@ -1,7 +1,7 @@
-
+
document.directory
diff --git a/addons/document_ics/document_demo.xml b/addons/document_ics/document_demo.xml
index 72b1e60f0f8..eb939cfd515 100644
--- a/addons/document_ics/document_demo.xml
+++ b/addons/document_ics/document_demo.xml
@@ -18,7 +18,7 @@
.ics
-
+
diff --git a/addons/event/event_demo.xml b/addons/event/event_demo.xml
index 94be31ea93d..ad25a1dbfc1 100644
--- a/addons/event/event_demo.xml
+++ b/addons/event/event_demo.xml
@@ -115,30 +115,5 @@
Thanks for registrering. The conference will begin at 2 PM and will be given by Mister Pinckaers.
-
-
- Registration for "Conference on Environment"
-
-
- 15.50
- Ticket for Conference
-
-
- Registration for "Opera of Verdi"
-
-
- Ticket for Opera
- 24.00
- 5
-
-
- Registration for "Concert of Bon Jovi"
-
-
- Ticket for Concert
- 68.00
- 2
-
-
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index b6e421fe1c3..f023436172f 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -685,8 +685,8 @@ class mrp_production_workcenter_line(osv.osv):
_columns = {
'name': fields.char('Name', size=64, required=True),
'workcenter_id': fields.many2one('mrp.workcenter', 'Workcenter', required=True),
- 'cycle': fields.float('Nbr of cycle'),
- 'hour': fields.float('Nbr of hour'),
+ 'cycle': fields.float('Nbr of cycle', digits=(16,2)),
+ 'hour': fields.float('Nbr of hour', digits=(16,2)),
'sequence': fields.integer('Sequence', required=True),
'production_id': fields.many2one('mrp.production', 'Production Order', select=True),
}
diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py
index 20f73243638..28550179944 100755
--- a/addons/mrp_operations/mrp_operations.py
+++ b/addons/mrp_operations/mrp_operations.py
@@ -44,14 +44,13 @@ class mrp_production_workcenter_line(osv.osv):
_description = 'Production workcenters used'
_columns = {
'state': fields.selection([('draft','Draft'),('startworking', 'In Progress'),('pause','Pause'),('cancel','Canceled'),('done','Finished')],'Status', readonly=True),
+ 'date_planned': fields.related('production_id', 'date_planned', type='datetime', string='Date Planned'),
'date_start': fields.datetime('Start Date'),
'date_finnished': fields.datetime('End Date'),
- 'delay': fields.char('Delay',size=128,help="This is delay between operation start and stop in this workcenter",readonly=True),
+ 'delay': fields.float('Delay',size=128,help="This is delay between operation start and stop in this workcenter",readonly=True),
'product':fields.related('production_id','product_id',type='many2one',relation='product.product',string='Product'),
'qty':fields.related('production_id','product_qty',type='float',string='Qty'),
'uom':fields.related('production_id','product_uom',type='many2one',relation='product.uom',string='UOM'),
-
-
}
_defaults = {
'state': lambda *a: 'draft',
diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml
index 528fa936a29..1a84e3cfcf8 100755
--- a/addons/mrp_operations/mrp_operations_view.xml
+++ b/addons/mrp_operations/mrp_operations_view.xml
@@ -42,6 +42,33 @@
+
+ mrp.production.workcenter.line.calendar
+ mrp.production.workcenter.line
+ calendar
+
+
+
+
+
+
+
+
+
+
+ mrp.production.workcenter.line.gantt
+ mrp.production.workcenter.line
+ gantt
+
+
+
+
+
+
+
+
+
+
@@ -49,7 +76,7 @@
ir.actions.act_window
mrp.production.workcenter.line
form
- tree,form
+ tree,form,gantt,calendar,graph
[('id','=',active_id)]
@@ -60,7 +87,7 @@
ir.actions.act_window
mrp.production.workcenter.line
form
- tree,form,graph
+ tree,form,graph,calendar,gantt
@@ -70,7 +97,7 @@
ir.actions.act_window
mrp.production.workcenter.line
form
- tree,form,graph
+ tree,form,graph,gantt,calendar
[('state','=','confirm')]
diff --git a/addons/project/project.py b/addons/project/project.py
index d99109007bf..27789b56d5a 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -31,46 +31,6 @@ class project(osv.osv):
_name = "project.project"
_description = "Project"
- def _calc_effective(self, cr, uid, ids, name, args, context):
- ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
- res_sum = {}
- if ids2:
- cr.execute('SELECT t.project_id, COALESCE(SUM(w.hours),0) \
- FROM project_task t \
- LEFT JOIN project_task_work w \
- ON (w.task_id = t.id) \
- WHERE t.project_id in (' + ','.join([str(x) for x in ids2]) + ') \
- AND active \
- GROUP BY project_id')
- for project_id, sum in cr.fetchall():
- res_sum[project_id] = sum
- res={}
- for id in ids:
- ids3 = self.search(cr, uid, [('parent_id', 'child_of', [id])])
- res.setdefault(id, 0.0)
- for idx in ids3:
- res[id] += res_sum.get(idx, 0.0)
- return res
-
- def _calc_planned(self, cr, uid, ids, name, args, context):
- ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
- res_sum = {}
- if ids2:
- cr.execute('SELECT project_id, COALESCE(SUM(total_hours),0) \
- FROM project_task \
- WHERE project_id IN (' + ','.join([str(x) for x in ids2]) + ') \
- AND active \
- GROUP BY project_id')
- for project_id, sum in cr.fetchall():
- res_sum[project_id] = sum
- res = {}
- for id in ids:
- ids3 = self.search(cr, uid, [('parent_id', 'child_of', [id])])
- res.setdefault(id, 0.0)
- for idx in ids3:
- res[id] += res_sum.get(idx, 0.0)
- return res
-
def check_recursion(self, cursor, user, ids, parent=None):
return super(project, self).check_recursion(cursor, user, ids,
parent=parent)
@@ -83,22 +43,35 @@ class project(osv.osv):
pricelist = self.pool.get('res.partner').browse(cr, uid, part).property_product_pricelist.id
return {'value':{'contact_id': addr['contact'], 'pricelist_id': pricelist}}
- def _progress_rate(self, cr, uid, ids, name, arg, context=None):
+ def _progress_rate(self, cr, uid, ids, names, arg, context=None):
res = {}.fromkeys(ids, 0.0)
if not ids:
return res
+ ids2 = self.search(cr, uid, [('parent_id','child_of',ids)])
cr.execute('''SELECT
- project_id, sum(progress*total_hours), sum(total_hours)
+ project_id, sum(planned_hours), sum(total_hours), sum(effective_hours)
FROM
project_task
WHERE
- project_id in ('''+','.join(map(str,ids))+''') AND
+ project_id in ('''+','.join(map(str,ids2))+''') AND
state<>'cancelled'
GROUP BY
project_id''')
- for id,prog,tot in cr.fetchall():
- if tot:
- res[id] = prog / tot
+ progress = dict(map(lambda x: (x[0], (x[1],x[2],x[3])), cr.fetchall()))
+ for project in self.browse(cr, uid, ids, context=context):
+ s = [0.0,0.0,0.0]
+ tocompute = [project]
+ while tocompute:
+ p = tocompute.pop()
+ tocompute += p.child_id
+ for i in range(3):
+ s[i] += progress.get(p.id, (0.0,0.0,0.0))[i]
+ res[project.id] = {
+ 'planned_hours': s[0],
+ 'effective_hours': s[2],
+ 'total_hours': s[1],
+ 'progress_rate': s[1] and (100.0 * s[2] / s[1]) or 0.0
+ }
return res
def unlink(self, cr, uid, ids, *args, **kwargs):
@@ -117,9 +90,10 @@ class project(osv.osv):
'tasks': fields.one2many('project.task', 'project_id', "Project tasks"),
'parent_id': fields.many2one('project.project', 'Parent Project'),
'child_id': fields.one2many('project.project', 'parent_id', 'Subproject'),
- 'planned_hours': fields.function(_calc_planned, method=True, string='Planned hours', help="Sum of planned hours of all tasks related to this project."),
- 'effective_hours': fields.function(_calc_effective, method=True, string='Hours spent', help="Sum of spent hours of all tasks related to this project."),
- 'progress_rate': fields.function(_progress_rate, method=True, string='Progress', type='float', help="Percent of tasks closed according to the total of tasks todo."),
+ 'planned_hours': fields.function(_progress_rate, multi="progress", method=True, string='Planned Time', help="Sum of planned hours of all tasks related to this project."),
+ 'effective_hours': fields.function(_progress_rate, multi="progress", method=True, string='Time Spent', help="Sum of spent hours of all tasks related to this project."),
+ 'total_hours': fields.function(_progress_rate, multi="progress", method=True, string='Total Time', help="Sum of total hours of all tasks related to this project."),
+ 'progress_rate': fields.function(_progress_rate, multi="progress", method=True, string='Progress', type='float', help="Percent of tasks closed according to the total of tasks todo."),
'date_start': fields.date('Starting Date'),
'date_end': fields.date('Expected End'),
'partner_id': fields.many2one('res.partner', 'Partner'),
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index c30aa71069b..10e8d067968 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -84,6 +84,7 @@
+
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 4d9e31836ce..942c3f960d9 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -63,7 +63,7 @@ class purchase_order(osv.osv):
cur=order.pricelist_id.currency_id
for line in order.order_line:
for c in self.pool.get('account.tax').compute(cr, uid, line.taxes_id, line.price_unit, line.product_qty, order.partner_address_id.id, line.product_id, order.partner_id):
- val+= cur_obj.round(cr, uid, cur, c['amount'])
+ val+= c['amount']
res[order.id]=cur_obj.round(cr, uid, cur, val)
return res
diff --git a/addons/sale/report/order.rml b/addons/sale/report/order.rml
index 30ce25b4952..26f3e8a2cd8 100644
--- a/addons/sale/report/order.rml
+++ b/addons/sale/report/order.rml
@@ -149,7 +149,7 @@
- Invoice address :[[ o.partner_id.property_payment_term.name ]]
+ Invoice address :
[[ o.partner_invoice_id.street ]][[ o.partner_invoice_id.street2 and (', %s' % o.partner_invoice_id.street2 or '') ]]
[[ o.partner_invoice_id.zip or '' ]][[ o.partner_invoice_id.city or '' ]][[ o.partner_invoice_id.country_id and (', %s' % (o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '')) ]]
@@ -213,7 +213,7 @@
[[ o.user_id.name ]]
- [[ o.partner_id and o.partner_id.property_payment_term and o.partner_id.property_payment_term['name'] or '' ]]
+ [[ o.payment_term.name ]]
|
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index dd478f3dca1..404946e1f7b 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -79,7 +79,7 @@ class sale_order(osv.osv):
cur=order.pricelist_id.currency_id
for line in order.order_line:
for c in self.pool.get('account.tax').compute(cr, uid, line.tax_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.product_uom_qty, order.partner_invoice_id.id, line.product_id, order.partner_id):
- val+= cur_obj.round(cr, uid, cur, c['amount'])
+ val+= c['amount']
res[order.id]=cur_obj.round(cr, uid, cur, val)
return res
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index f7871d0d234..4090262a5b7 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -348,7 +348,7 @@
-
+
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 4967fe23c77..805e49b7509 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -271,26 +271,26 @@
+ name="stock.traceability.lot.upstream"
+ string="Upstream traceability"/>
+ name="stock.traceability.lot.downstream"
+ string="Downstream traceability"/>
+ name="stock.traceability.upstream"
+ string="Upstream traceability"/>
+ name="stock.traceability.downstream"
+ string="Downstream traceability"/>
Downstream traceability
diff --git a/addons/stock/wizard/stock_traceability.py b/addons/stock/wizard/stock_traceability.py
index bab1be53a49..7baee9674e8 100644
--- a/addons/stock/wizard/stock_traceability.py
+++ b/addons/stock/wizard/stock_traceability.py
@@ -52,7 +52,7 @@ class wiz_journal(wizard.interface):
'result': {'type': 'action', 'action': action_traceability(), 'state':'end'}
}
}
-wiz_journal('stock.traceability.aval')
+wiz_journal('stock.traceability.downstream')
class wiz_journal2(wizard.interface):
states = {
@@ -61,7 +61,7 @@ class wiz_journal2(wizard.interface):
'result': {'type': 'action', 'action': action_traceability('move_history_ids2'), 'state':'end'}
}
}
-wiz_journal2('stock.traceability.amont')
+wiz_journal2('stock.traceability.upstream')
class wiz_journal3(wizard.interface):
states = {
@@ -70,7 +70,7 @@ class wiz_journal3(wizard.interface):
'result': {'type': 'action', 'action': action_traceability(field='prodlot_id'), 'state':'end'}
}
}
-wiz_journal3('stock.traceability.lot.amont')
+wiz_journal3('stock.traceability.lot.upstream')
class wiz_journal4(wizard.interface):
states = {
@@ -79,7 +79,7 @@ class wiz_journal4(wizard.interface):
'result': {'type': 'action', 'action': action_traceability('move_history_ids2', 'prodlot_id'), 'state':'end'}
}
}
-wiz_journal4('stock.traceability.lot.aval')
+wiz_journal4('stock.traceability.lot.downstream')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/wiki/security/ir.model.access.csv b/addons/wiki/security/ir.model.access.csv
new file mode 100644
index 00000000000..09ea7a5589c
--- /dev/null
+++ b/addons/wiki/security/ir.model.access.csv
@@ -0,0 +1,4 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"wiki_wiki","wiki.wiki","model_wiki_wiki","base.group_user",1,1,1,1
+"wiki_groups","wiki.groups","model_wiki_groups","base.group_user",1,1,1,1
+"wiki_wiki_history","wiki.wiki.history","model_wiki_wiki_history","base.group_user",1,1,1,1
diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml
index e9a5402ec27..825537811e2 100644
--- a/addons/wiki/wiki_view.xml
+++ b/addons/wiki/wiki_view.xml
@@ -2,7 +2,7 @@
-
+