diff --git a/addons/.project b/addons/.project
deleted file mode 100644
index ada2ccca54d..00000000000
--- a/addons/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- addons-pso-process
-
-
-
-
-
- org.python.pydev.PyDevBuilder
-
-
-
-
-
- org.python.pydev.pythonNature
-
-
diff --git a/addons/.pydevproject b/addons/.pydevproject
deleted file mode 100644
index 78259a9c3db..00000000000
--- a/addons/.pydevproject
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-python 2.4
-
diff --git a/addons/account_reporting/account.py b/addons/account_reporting/account.py
index 10c74a80c24..0d6073dac7f 100644
--- a/addons/account_reporting/account.py
+++ b/addons/account_reporting/account.py
@@ -115,10 +115,6 @@ class account_report_bs(osv.osv):
ids = self.search(cr, user, args, limit=limit, context=context)
return self.name_get(cr, user, ids, context=context)
- _sql_constraints = [
- ('code_uniq', 'unique (code)', 'The code of the report entry must be unique !')
- ]
-
account_report_bs()
diff --git a/addons/base_module_quality/base_module_quality_wizard.xml b/addons/base_module_quality/base_module_quality_wizard.xml
index df75c45715a..c99b949be35 100644
--- a/addons/base_module_quality/base_module_quality_wizard.xml
+++ b/addons/base_module_quality/base_module_quality_wizard.xml
@@ -15,9 +15,9 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (
+
+ ,
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ white
+
+
+
+
+
+
+
+
+
+
+ .........
+
+
+
+
+
+
+
+
+
+
+
+
+ 15
+ 0
+
+
+
+
+
+
+
+
+
+ 6
+
+
+
+
+
+ ZapfDingbats
+ l
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ yes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ LEFT
+
+
+ CENTER
+
+
+ RIGHT
+
+
+ JUSTIFY
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Courier-BoldOblique
+
+
+ Courier-Bold
+
+
+ Courier-Oblique
+
+
+ Courier
+
+
+
+
+
+
+ Helvetica-BoldOblique
+
+
+ Helvetica-Bold
+
+
+ Helvetica-Oblique
+
+
+ Helvetica
+
+
+
+
+
+
+ Times-BoldItalic
+
+
+ Times-Bold
+
+
+ Times-Italic
+
+
+ Times-Roman
+
+
+
+
+
+
+
+ Times-Roman
+
+
+
+
+
+
+
+
+
diff --git a/addons/base_report_designer/wizard/tiny_sxw2rml/tiny_sxw2rml.py b/addons/base_report_designer/wizard/tiny_sxw2rml/tiny_sxw2rml.py
index 9bc62ac02c8..0d0ced599cb 100644
--- a/addons/base_report_designer/wizard/tiny_sxw2rml/tiny_sxw2rml.py
+++ b/addons/base_report_designer/wizard/tiny_sxw2rml/tiny_sxw2rml.py
@@ -151,6 +151,8 @@ class DomApi(DomApiGeneral):
self.buildStylePropertiesDict()
if self.styles_dom.getElementsByTagName("style:page-master").__len__()<>0:
self.page_master = self.styles_dom.getElementsByTagName("style:page-master")[0]
+ if self.styles_dom.getElementsByTagName("style:page-layout").__len__()<>0 :
+ self.page_master = self.styles_dom.getElementsByTagName("style:page-layout")[0]
self.document = self.content_dom.getElementsByTagName("office:document-content")[0]
def buildStylePropertiesDict(self):
@@ -265,7 +267,7 @@ class DomApi(DomApiGeneral):
childs = self.style_dict[style_name].childNodes
for c in childs:
- if c.nodeType == c.ELEMENT_NODE and c.nodeName == "style:properties":
+ if c.nodeType == c.ELEMENT_NODE and c.nodeName.find("properties")>0 :
for attr in c._attrs.keys():
res[attr] = c.getAttribute(attr).encode("latin-1")
return res
@@ -357,8 +359,12 @@ if __name__ == "__main__":
fname = sys.argv[1]
f = StringIO.StringIO(file(fname).read())
-
- xsl = file(os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]), 'normalized_oo2rml.xsl')).read()
+ xsl_file = 'normalized_oo2rml.xsl'
+ z = zipfile.ZipFile(fname,"r")
+ mimetype = z.read('mimetype')
+ if mimetype.split('/')[-1] == 'vnd.oasis.opendocument.text' :
+ xsl_file = 'normalized_odt2rml.xsl'
+ xsl = file(os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]), xsl_file)).read()
result = sxw2rml(f, xsl, output=opt.output, save_pict=False)
print result
diff --git a/addons/custom/corporate_odt_header.xml b/addons/custom/corporate_odt_header.xml
new file mode 100644
index 00000000000..b27eeda8ccb
--- /dev/null
+++ b/addons/custom/corporate_odt_header.xml
@@ -0,0 +1,248 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tiny sprl
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+ Phone :
+
+
+
+
+
+
+
+ Mail :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Contact : Administrator
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/mrp/schedulers.py b/addons/mrp/schedulers.py
index 6e97ba30b1e..13682e3d00b 100644
--- a/addons/mrp/schedulers.py
+++ b/addons/mrp/schedulers.py
@@ -203,6 +203,8 @@ class mrp_procurement(osv.osv):
location_id = op.warehouse_id.lot_stock_id
else:
continue
+ if qty<=0:
+ continue
proc_id = procurement_obj.create(cr, uid, {
'name': 'OP:'+str(op.id),
'date_planned': newdate.strftime('%Y-%m-%d'),
diff --git a/addons/process/process.py b/addons/process/process.py
index ff6e6378d83..b1a6002dfd9 100644
--- a/addons/process/process.py
+++ b/addons/process/process.py
@@ -50,6 +50,7 @@ class process_process(osv.osv):
_columns = {
'name': fields.char('Name', size=30,required=True, translate=True),
'active': fields.boolean('Active'),
+ 'model_id': fields.many2one('ir.model', 'Object', ondelete='set null'),
'note': fields.text('Notes', translate=True),
'node_ids': fields.one2many('process.node', 'process_id', 'Nodes')
}
@@ -64,19 +65,24 @@ class process_process(osv.osv):
if not model_ids:
return []
- nodes = pool.get('process.node').search(cr, uid, [('model_id', 'in', model_ids)])
- if not nodes:
- return []
-
- nodes = pool.get('process.node').browse(cr, uid, nodes, context)
-
- unique = []
result = []
-
- for node in nodes:
- if node.process_id.id not in unique:
- result.append((node.process_id.id, node.process_id.name))
- unique.append(node.process_id.id)
+
+ # search all processes
+ res = pool.get('process.process').search(cr, uid, [('model_id', 'in', model_ids)])
+ if res:
+ res = pool.get('process.process').browse(cr, uid, res, context)
+ for process in res:
+ result.append((process.id, process.name))
+
+ return result
+
+ # else search process nodes
+ res = pool.get('process.node').search(cr, uid, [('model_id', 'in', model_ids)])
+ if res:
+ res = pool.get('process.node').browse(cr, uid, res, context)
+ for node in res:
+ if (node.process_id.id, node.process_id.name) not in result:
+ result.append((node.process_id.id, node.process_id.name))
return result
@@ -85,21 +91,25 @@ class process_process(osv.osv):
pool = pooler.get_pool(cr.dbname)
process = pool.get('process.process').browse(cr, uid, [id])[0]
- current_object = pool.get(res_model).browse(cr, uid, [res_id], context)[0]
- current_user = pool.get('res.users').browse(cr, uid, [uid], context)[0]
-
- expr_context = Env(current_object, current_user)
-
- notes = process.note
+ states = dict(pool.get(res_model).fields_get(cr, uid, context=context).get('state', {}).get('selection', {}))
+
+ title = process.name
+
+ expr_context = {}
+ perm = None
+
+ if res_id:
+ current_object = pool.get(res_model).browse(cr, uid, [res_id], context)[0]
+ current_user = pool.get('res.users').browse(cr, uid, [uid], context)[0]
+ expr_context = Env(current_object, current_user)
+ title = _("%s - Resource: %s, State: %s") % (process.name, current_object.name, states.get(getattr(current_object, 'state'), 'N/A'))
+ perm = pool.get(res_model).perm_read(cr, uid, [res_id], context)[0]
+
+ notes = process.note or "N/A"
nodes = {}
start = []
transitions = {}
- states = dict(pool.get(res_model).fields_get(cr, uid, context=context).get('state', {}).get('selection', {}))
- title = "%s - Resource: %s, State: %s" % (process.name, current_object.name, states.get(getattr(current_object, 'state'), 'N/A'))
-
- perm = pool.get(res_model).perm_read(cr, uid, [res_id], context)[0]
-
for node in process.node_ids:
data = {}
data['name'] = node.name
@@ -126,7 +136,6 @@ class process_process(osv.osv):
try:
data['active'] = eval(node.model_states, expr_context)
except Exception, e:
- # waring: invalid state expression
pass
if not data['active']:
@@ -212,10 +221,11 @@ class process_process(osv.osv):
except:
pass
- for nid, node in nodes.items():
- if not node['gray'] and (node['active'] or node['model'] == res_model):
- update_relatives(nid, res_id, res_model)
- break
+ if res_id:
+ for nid, node in nodes.items():
+ if not node['gray'] and (node['active'] or node['model'] == res_model):
+ update_relatives(nid, res_id, res_model)
+ break
# calculate graph layout
g = tools.graph(nodes.keys(), map(lambda x: (x['source'], x['target']), transitions.values()))
diff --git a/addons/process/process_view.xml b/addons/process/process_view.xml
index 8083ba278d4..360f3499f36 100644
--- a/addons/process/process_view.xml
+++ b/addons/process/process_view.xml
@@ -17,6 +17,7 @@
+
@@ -120,6 +121,7 @@
+