Merge lp:~openerp-dev/openobject-server/trunk-dev-framework into lp:openobject-server

Proposed by Harry (OpenERP)
Status: Merged
Merged at revision: 3029
Proposed branch: lp:~openerp-dev/openobject-server/trunk-dev-framework
Merge into: lp:openobject-server
Diff against target: 213 lines (+58/-15)
9 files modified
bin/addons/__init__.py (+2/-2)
bin/addons/base/i18n/base.pot (+50/-0)
bin/addons/base/ir/ir_actions.py (+2/-3)
bin/addons/base/ir/ir_model.py (+1/-1)
bin/addons/base/module/wizard/base_module_upgrade.py (+1/-1)
bin/addons/base/res/partner/partner.py (+0/-1)
bin/addons/base/res/res_user.py (+1/-1)
bin/report/printscreen/ps_list.py (+0/-1)
bin/report/report_sxw.py (+1/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/trunk-dev-framework
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Needs Fixing
Review via email: mp+39519@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

This is incorrect because it breaks the translation (and will never work):
  _('Following modules are uninstalled or unknown. \n\n'+'\n'.join(unmet_packages)
it should be for example:
  _('Following modules are not installed or unknown: %s') % ('\n\n'+'\n'.join(unmet_packages))

For the creation of users, instead of overriding create() we should simple use _defaults, shouldn't we? The orm will automatically add _defaults in addition to provided values when create() is called, even if the client does not pass them. Wouldn't that work and be cleaner?

The rest is good, thanks!

review: Needs Fixing
2260. By Harry (OpenERP)

[FIX] base: correct warning messages

2261. By Harry (OpenERP)

[FIX] base: remove override create method of res.users object.

Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

> This is incorrect because it breaks the translation (and will never work):
> _('Following modules are uninstalled or unknown.
> \n\n'+'\n'.join(unmet_packages)
> it should be for example:
> _('Following modules are not installed or unknown: %s') %
> ('\n\n'+'\n'.join(unmet_packages))
Yes. thanks to notice.

>
> For the creation of users, instead of overriding create() we should simple use
> _defaults, shouldn't we? The orm will automatically add _defaults in addition
> to provided values when create() is called, even if the client does not pass
> them. Wouldn't that work and be cleaner?

Before defaults was not working, but now it seem work. so I removed overriding create() method.
Thanks

>
> The rest is good, thanks!

2262. By Harry (OpenERP)

[MERGE]

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/__init__.py'
2--- bin/addons/__init__.py 2010-11-17 12:39:28 +0000
3+++ bin/addons/__init__.py 2010-11-19 07:30:44 +0000
4@@ -30,7 +30,7 @@
5 import tools.osutil
6 from tools.safe_eval import safe_eval as eval
7 import pooler
8-
9+from tools.translate import _
10
11 import netsvc
12
13@@ -806,7 +806,7 @@
14 graph = create_graph(cr, ['base'], force)
15 if not graph:
16 logger.notifyChannel('init', netsvc.LOG_CRITICAL, 'module base cannot be loaded! (hint: verify addons-path)')
17- raise osv.osv.except_osv('Could not load base module', 'module base cannot be loaded! (hint: verify addons-path)')
18+ raise osv.osv.except_osv(_('Could not load base module'), _('module base cannot be loaded! (hint: verify addons-path)'))
19 has_updates = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report)
20
21 if update_module:
22
23=== modified file 'bin/addons/base/i18n/base.pot'
24--- bin/addons/base/i18n/base.pot 2010-11-18 16:28:37 +0000
25+++ bin/addons/base/i18n/base.pot 2010-11-19 07:30:44 +0000
26@@ -4392,6 +4392,7 @@
27 #: code:addons/base/module/module.py:0
28 #: code:addons/base/res/res_currency.py:0
29 #: code:addons/base/res/res_user.py:0
30+#: code:addons/base/res/ir_property.py:0
31 #, python-format
32 msgid "Error"
33 msgstr ""
34@@ -5858,6 +5859,7 @@
35
36 #. module: base
37 #: code:addons/base/module/wizard/base_module_import.py:0
38+#: code:addons/base/ir/ir_values.py:
39 #, python-format
40 msgid "Error !"
41 msgstr ""
42@@ -8956,3 +8958,51 @@
43 msgid "Russian / русский язык"
44 msgstr ""
45
46+#. module: base
47+#: code:addons/base/module/wizard/base_module_upgrade.py:0
48+#, python-format
49+msgid "Unmet dependency !"
50+msgstr ""
51+
52+#. module: base
53+#: code:addons/base/module/wizard/base_module_upgrade.py:0
54+#, python-format
55+msgid "Following modules are not installed or unknown: %s"
56+msgstr ""
57+
58+#. module: base
59+#: code:addons/base/ir/ir_model.py:0
60+#, python-format
61+msgid "Invalid search criterions"
62+msgstr ""
63+
64+#. module: base
65+#: code:addons/base/ir/ir_model.py:0
66+#, python-format
67+msgid "The osv_memory field can only be compared with = and != operator."
68+msgstr ""
69+
70+#. module: base
71+#: code:addons/base/ir/ir_values.py:0
72+#, python-format
73+msgid "You do not have the permission to perform this operation !!!"
74+msgstr ""
75+
76+#. module: base
77+#: code:addons/base/res/ir_property.py:0
78+#, python-format
79+msgid "Invalid type"
80+msgstr ""
81+
82+#. module: base
83+#: code:addons/__init__.py:0
84+#, python-format
85+msgid "Could not load base module"
86+msgstr ""
87+
88+#. module: base
89+#: code:addons/__init__.py:0
90+#, python-format
91+msgid "module base cannot be loaded! (hint: verify addons-path)"
92+msgstr ""
93+
94
95=== modified file 'bin/addons/base/ir/ir_actions.py'
96--- bin/addons/base/ir/ir_actions.py 2010-10-22 07:59:35 +0000
97+++ bin/addons/base/ir/ir_actions.py 2010-11-19 07:30:44 +0000
98@@ -485,7 +485,7 @@
99 for field in fields:
100 try:
101 obj = getattr(obj, field)
102- except Exception,e :
103+ except Exception:
104 logger.notifyChannel('Workflow', netsvc.LOG_ERROR, 'Failed to parse : %s' % (field))
105
106 return obj
107@@ -506,7 +506,7 @@
108 for field in fields:
109 try:
110 obj = getattr(obj, field)
111- except Exception,e :
112+ except Exception:
113 logger.notifyChannel('Workflow', netsvc.LOG_ERROR, 'Failed to parse : %s' % (field))
114
115 return obj
116@@ -514,7 +514,6 @@
117 def merge_message(self, cr, uid, keystr, action, context=None):
118 if context is None:
119 context = {}
120- logger = netsvc.Logger()
121 def merge(match):
122 obj_pool = self.pool.get(action.model_id.model)
123 id = context.get('active_id')
124
125=== modified file 'bin/addons/base/ir/ir_model.py'
126--- bin/addons/base/ir/ir_model.py 2010-10-20 17:17:39 +0000
127+++ bin/addons/base/ir/ir_model.py 2010-11-19 07:30:44 +0000
128@@ -57,7 +57,7 @@
129 return []
130 field, operator, value = domain[0]
131 if operator not in ['=', '!=']:
132- raise osv.except_osv('Invalid search criterions','The osv_memory field can only be compared with = and != operator.')
133+ raise osv.except_osv(_('Invalid search criterions'), _('The osv_memory field can only be compared with = and != operator.'))
134 value = bool(value) if operator == '=' else not bool(value)
135 all_model_ids = self.search(cr, uid, [], context=context)
136 is_osv_mem = self._is_osv_memory(cr, uid, all_model_ids, 'osv_memory', arg=None, context=context)
137
138=== modified file 'bin/addons/base/module/wizard/base_module_upgrade.py'
139--- bin/addons/base/module/wizard/base_module_upgrade.py 2010-10-04 14:33:36 +0000
140+++ bin/addons/base/module/wizard/base_module_upgrade.py 2010-11-19 07:30:44 +0000
141@@ -93,7 +93,7 @@
142 if dep_mod.state in ('unknown','uninstalled'):
143 unmet_packages.append(dep_mod.name)
144 if len(unmet_packages):
145- raise osv.except_osv('Unmet dependency !', 'Following modules are uninstalled or unknown. \n\n'+'\n'.join(unmet_packages))
146+ raise osv.except_osv(_('Unmet dependency !'), _('Following modules are not installed or unknown: %s') % ('\n\n' + '\n'.join(unmet_packages)))
147 mod_obj.download(cr, uid, ids, context=context)
148 cr.commit()
149 _, pool = pooler.restart_pool(cr.dbname, update_module=True)
150
151=== modified file 'bin/addons/base/res/partner/partner.py'
152--- bin/addons/base/res/partner/partner.py 2010-10-18 13:26:58 +0000
153+++ bin/addons/base/res/partner/partner.py 2010-11-19 07:30:44 +0000
154@@ -23,7 +23,6 @@
155
156 from osv import fields,osv
157 import tools
158-import ir
159 import pooler
160 from tools.translate import _
161
162
163=== modified file 'bin/addons/base/res/res_user.py'
164--- bin/addons/base/res/res_user.py 2010-11-16 12:53:38 +0000
165+++ bin/addons/base/res/res_user.py 2010-11-19 07:30:44 +0000
166@@ -265,7 +265,7 @@
167 ]
168
169 _sql_constraints = [
170- ('login_key', 'UNIQUE (login)', _('You can not have two users with the same login !'))
171+ ('login_key', 'UNIQUE (login)', 'You can not have two users with the same login !')
172 ]
173
174 def _get_email_from(self, cr, uid, ids, context=None):
175
176=== modified file 'bin/report/printscreen/ps_list.py'
177--- bin/report/printscreen/ps_list.py 2010-10-04 13:55:30 +0000
178+++ bin/report/printscreen/ps_list.py 2010-11-19 07:30:44 +0000
179@@ -139,7 +139,6 @@
180 _append_node('header-date', str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")))
181 l = []
182 t = 0
183- rowcount = 0;
184 strmax = (pageSize[0]-40) * 2.8346
185 temp = []
186 tsum = []
187
188=== modified file 'bin/report/report_sxw.py'
189--- bin/report/report_sxw.py 2010-11-02 08:22:50 +0000
190+++ bin/report/report_sxw.py 2010-11-19 07:30:44 +0000
191@@ -204,13 +204,10 @@
192 return res['datas']
193 else :
194 return ''
195- except Exception,e:
196+ except Exception:
197 return ''
198
199 def setLang(self, lang):
200- if not lang or self.default_lang.has_key(lang):
201- if not lang:
202- key = 'en_US'
203 self.localcontext['lang'] = lang
204 self.lang_dict_called = False
205 for obj in self.objects:
206@@ -519,7 +516,6 @@
207 xml_declaration=True)
208
209 rml_dom = etree.XML(rml)
210- body = rml_dom[-1]
211 elements = []
212 key1 = rml_parser.localcontext['name_space']["text"]+"p"
213 key2 = rml_parser.localcontext['name_space']["text"]+"drop-down"