Merge lp:~unifield-team/unifield-web/jfb-utp-433 into lp:unifield-web

Proposed by jftempo
Status: Merged
Merged at revision: 4711
Proposed branch: lp:~unifield-team/unifield-web/jfb-utp-433
Merge into: lp:unifield-web
Diff against target: 103 lines (+36/-4)
3 files modified
addons/openerp/controllers/impex.py (+3/-2)
addons/openerp/controllers/templates/expxml.mako (+32/-1)
addons/openerp/static/javascript/form.js (+1/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/jfb-utp-433
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+163538@code.launchpad.net
To post a comment you must log in.
4710. By jftempo

UTP-433 Negative number

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/impex.py'
2--- addons/openerp/controllers/impex.py 2013-02-01 08:49:54 +0000
3+++ addons/openerp/controllers/impex.py 2013-05-23 13:00:37 +0000
4@@ -32,6 +32,8 @@
5 import simplejson
6 import time
7 from openobject.i18n import format
8+import re
9+
10
11 product_remove_fields = ['qty_available', 'virtual_available', 'product_amc', 'reviewed_consumption', 'monthly_consumption']
12 def datas_read(ids, model, flds, context=None):
13@@ -373,7 +375,7 @@
14 def export_html(self, fields, result, view_name):
15 cherrypy.response.headers['Content-Type'] = 'application/vnd.ms-excel'
16 cherrypy.response.headers['Content-Disposition'] = 'attachment; filename="%s_%s.xls"'%(view_name, time.strftime('%Y%m%d'))
17- return {'fields': fields, 'result': result, 'title': 'Export %s %s'%(view_name, time.strftime(format.get_datetime_format()))}
18+ return {'fields': fields, 'result': result, 'title': 'Export %s %s'%(view_name, time.strftime(format.get_datetime_format())), 're': re}
19
20
21 @expose(content_type="application/octet-stream")
22@@ -419,7 +421,6 @@
23 else:
24 ids = params.ids or []
25 result = datas_read(ids, params.model, flds, context=ctx)
26-
27 if result.get('warning'):
28 common.warning(unicode(result.get('warning', False)), _('Export Error'))
29 return False
30
31=== modified file 'addons/openerp/controllers/templates/expxml.mako'
32--- addons/openerp/controllers/templates/expxml.mako 2012-03-09 10:17:43 +0000
33+++ addons/openerp/controllers/templates/expxml.mako 2013-05-23 13:00:37 +0000
34@@ -19,6 +19,7 @@
35 </Borders>
36 </Style>
37 <Style ss:ID="ssBorder">
38+<NumberFormat ss:Format="Standard"/>
39 <Alignment ss:Vertical="Center" ss:WrapText="1"/>
40 <Borders>
41 <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
42@@ -27,6 +28,26 @@
43 <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
44 </Borders>
45 </Style>
46+<Style ss:ID="sShortDate">
47+ <NumberFormat ss:Format="Short Date"/>
48+ <Alignment ss:Vertical="Center" ss:WrapText="1"/>
49+ <Borders>
50+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
51+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" />
52+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
53+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
54+ </Borders>
55+</Style>
56+<Style ss:ID="sDate">
57+ <NumberFormat ss:Format="General Date"/>
58+ <Alignment ss:Vertical="Center" ss:WrapText="1"/>
59+ <Borders>
60+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
61+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" />
62+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
63+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
64+ </Borders>
65+</Style>
66 </Styles>
67 <Worksheet ss:Name="Sheet">
68 <Table ss:ExpandedColumnCount="${len(fields)}" ss:ExpandedRowCount="${len(result)+1}" x:FullColumns="1"
69@@ -42,10 +63,20 @@
70 % for row in result:
71 <Row>
72 % for d in row:
73-<Cell ss:StyleID="ssBorder">
74 % if d in ('True', 'False'):
75+ <Cell ss:StyleID="ssBorder">
76 <Data ss:Type="Boolean">${d=='True' and '1' or '0'}</Data>
77+ % elif d and re.match('^[0-9]{4}-[0-9]{2}-[0-9]{2}$', d):
78+ <Cell ss:StyleID="sShortDate">
79+ <Data ss:Type="DateTime">${d}T00:00:00.000</Data>
80+ % elif d and re.match('^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$', d):
81+ <Cell ss:StyleID="sDate">
82+ <Data ss:Type="DateTime">${d.replace(' ','T')}.000</Data>
83+ % elif d and re.match('^-?[0-9]+\.?[0-9]*$', d):
84+ <Cell ss:StyleID="ssBorder">
85+ <Data ss:Type="Number">${d}</Data>
86 % else:
87+ <Cell ss:StyleID="ssBorder">
88 <Data ss:Type="String">${d or ''}</Data>
89 % endif
90 </Cell>
91
92=== modified file 'addons/openerp/static/javascript/form.js'
93--- addons/openerp/static/javascript/form.js 2013-03-14 14:46:39 +0000
94+++ addons/openerp/static/javascript/form.js 2013-05-23 13:00:37 +0000
95@@ -787,7 +787,7 @@
96 }
97
98 var parent_context = openobject.dom.get(prefix.concat('_terp_context').join('/'));
99- var search_domain = openobject.dom.get(prefix.concat('_terp_domain').join('/'));
100+ var search_domain = openobject.dom.get(prefix.concat('_terp_search_domain').join('/'));
101 if (search_domain) {
102 params['_terp_search_domain'] = search_domain.value;
103 }

Subscribers

People subscribed via source and target branches

to all changes: