Merge lp:~openobject-italia-core-devs/openobject-italia/7.0-l10n_it_sale-pep8 into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
- 7.0-l10n_it_sale-pep8
- Merge into italian-addons-7.0
Status: | Needs review |
---|---|
Proposed branch: | lp:~openobject-italia-core-devs/openobject-italia/7.0-l10n_it_sale-pep8 |
Merge into: | lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0 |
Diff against target: |
515 lines (+144/-107) 12 files modified
l10n_it_sale/__init__.py (+2/-2) l10n_it_sale/__openerp__.py (+5/-8) l10n_it_sale/account/__init__.py (+2/-3) l10n_it_sale/account/invoice.py (+28/-20) l10n_it_sale/partner/__init__.py (+1/-1) l10n_it_sale/partner/partner.py (+10/-7) l10n_it_sale/sale/__init__.py (+1/-2) l10n_it_sale/sale/sale.py (+28/-22) l10n_it_sale/stock/__init__.py (+1/-3) l10n_it_sale/stock/picking.py (+57/-32) l10n_it_sale/wizard/__init__.py (+1/-1) l10n_it_sale/wizard/assign_ddt.py (+8/-6) |
To merge this branch: | bzr merge lp:~openobject-italia-core-devs/openobject-italia/7.0-l10n_it_sale-pep8 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Leonardo Pistone (community) | Needs Fixing | ||
Andrea Cometa (community) | Approve | ||
andrea_cg (community) | Approve | ||
Review via email: mp+220483@code.launchpad.net |
Commit message
Description of the change
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
aggiungo che ho dovuto creare qualche variabile in più con nomi abbreviati per rimanere nelle 79 cols
Lorenzo Battistini (elbati) wrote : | # |
Se preferisci
http://
può diventare ad esempio
http://
E
http://
può diventare
http://
Discorso simile per picking.py
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
Non ci avrei mai pensato da solo...
+1
- 241. By Davide Corio
-
[IMP] code cleanup
- 242. By Davide Corio
-
[IMP] code cleanup
- 243. By Davide Corio
-
[IMP] code cleanup
Lorenzo Battistini (elbati) wrote : | # |
Grazie Davide.
Ah, solo un'altra cosa: riga 157 come mai hai tolto lo spazio?
- 244. By Davide Corio
-
[FIX] missing space
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
Umh... non te lo so dire :)
rimesso spazio
Leonardo Pistone (lepistone) wrote : | # |
l'F401 possiamo ignorarlo solo negli __init__.py. Ci sono altri import inutili che sono davvero inutili.
o in alternativa, non lo ignoriamo del tutto e mettiamo # noqa negli import di __init__.py.
ciao
Lorenzo Battistini (elbati) wrote : | # |
This project is now hosted on https:/
Unmerged revisions
- 244. By Davide Corio
-
[FIX] missing space
- 243. By Davide Corio
-
[IMP] code cleanup
- 242. By Davide Corio
-
[IMP] code cleanup
- 241. By Davide Corio
-
[IMP] code cleanup
- 240. By Davide Corio
-
[IMP] pep8
Preview Diff
1 | === modified file 'l10n_it_sale/__init__.py' |
2 | --- l10n_it_sale/__init__.py 2013-03-13 08:21:42 +0000 |
3 | +++ l10n_it_sale/__init__.py 2014-05-22 13:05:57 +0000 |
4 | @@ -1,6 +1,6 @@ |
5 | # -*- coding: utf-8 -*- |
6 | ############################################################################## |
7 | -# |
8 | +# |
9 | # Copyright (C) 2010 Associazione OpenERP Italia |
10 | # (<http://www.openerp-italia.org>). |
11 | # |
12 | @@ -21,6 +21,6 @@ |
13 | |
14 | import sale |
15 | import stock |
16 | -import account |
17 | +import account |
18 | import partner |
19 | import wizard |
20 | |
21 | === modified file 'l10n_it_sale/__openerp__.py' |
22 | --- l10n_it_sale/__openerp__.py 2013-03-14 11:11:29 +0000 |
23 | +++ l10n_it_sale/__openerp__.py 2014-05-22 13:05:57 +0000 |
24 | @@ -1,6 +1,6 @@ |
25 | # -*- coding: utf-8 -*- |
26 | ############################################################################## |
27 | -# |
28 | +# |
29 | # Copyright (C) 2010 Associazione OpenERP Italia |
30 | # (<http://www.openerp-italia.org>). |
31 | # |
32 | @@ -32,8 +32,8 @@ |
33 | 'author': 'OpenERP Italian Community', |
34 | 'website': 'http://www.openerp-italia.org', |
35 | 'license': 'AGPL-3', |
36 | - "depends" : ['stock', 'sale', 'account', 'delivery'], |
37 | - "data" : [ |
38 | + "depends": ['stock', 'sale', 'account', 'delivery'], |
39 | + "data": [ |
40 | 'wizard/assign_ddt.xml', |
41 | 'stock/picking_view.xml', |
42 | 'stock/carriage_condition_view.xml', |
43 | @@ -46,11 +46,8 @@ |
44 | 'sale/sale_view.xml', |
45 | "security/ir.model.access.csv", |
46 | 'partner/partner_view.xml', |
47 | - 'account/invoice_view.xml', |
48 | - ], |
49 | - "demo" : [], |
50 | + 'account/invoice_view.xml'], |
51 | + "demo": [], |
52 | "active": False, |
53 | "installable": True |
54 | } |
55 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
56 | - |
57 | |
58 | === modified file 'l10n_it_sale/account/__init__.py' |
59 | --- l10n_it_sale/account/__init__.py 2013-03-13 08:21:42 +0000 |
60 | +++ l10n_it_sale/account/__init__.py 2014-05-22 13:05:57 +0000 |
61 | @@ -1,6 +1,6 @@ |
62 | # -*- coding: utf-8 -*- |
63 | ############################################################################## |
64 | -# |
65 | +# |
66 | # Copyright (C) 2010 Associazione OpenERP Italia |
67 | # (<http://www.openerp-italia.org>). |
68 | # |
69 | @@ -19,5 +19,4 @@ |
70 | # |
71 | ############################################################################## |
72 | |
73 | -import invoice |
74 | - |
75 | +import invoice |
76 | |
77 | === modified file 'l10n_it_sale/account/invoice.py' |
78 | --- l10n_it_sale/account/invoice.py 2013-03-14 11:11:29 +0000 |
79 | +++ l10n_it_sale/account/invoice.py 2014-05-22 13:05:57 +0000 |
80 | @@ -1,6 +1,6 @@ |
81 | # -*- coding: utf-8 -*- |
82 | ############################################################################## |
83 | -# |
84 | +# |
85 | # Copyright (C) 2010 Associazione OpenERP Italia |
86 | # (<http://www.openerp-italia.org>). |
87 | # |
88 | @@ -20,32 +20,40 @@ |
89 | ############################################################################## |
90 | |
91 | import netsvc |
92 | -import pooler, tools |
93 | - |
94 | +import pooler |
95 | +import tools |
96 | from openerp.osv import orm, fields |
97 | -from tools.translate import _ |
98 | + |
99 | |
100 | class account_invoice(orm.Model): |
101 | - |
102 | + |
103 | _inherit = 'account.invoice' |
104 | - |
105 | + |
106 | _columns = { |
107 | -# 'order_id':fields.many2one('sale.order','Sale Order'), |
108 | - 'carriage_condition_id': fields.many2one('stock.picking.carriage_condition', 'Carriage condition'), |
109 | - 'goods_description_id': fields.many2one('stock.picking.goods_description', 'Description of goods'), |
110 | - 'transportation_reason_id': fields.many2one('stock.picking.transportation_reason', 'Reason for transportation'), |
111 | + 'carriage_condition_id': fields.many2one( |
112 | + 'stock.picking.carriage_condition', 'Carriage condition'), |
113 | + 'goods_description_id': fields.many2one( |
114 | + 'stock.picking.goods_description', 'Description of goods'), |
115 | + 'transportation_reason_id': fields.many2one( |
116 | + 'stock.picking.transportation_reason', |
117 | + 'Reason for transportation'), |
118 | } |
119 | |
120 | - def onchange_partner_id(self, cr, uid, ids, type, partner_id, |
121 | - date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): |
122 | - result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, |
123 | - date_invoice, payment_term, partner_bank_id, company_id) |
124 | + def onchange_partner_id( |
125 | + self, cr, uid, ids, type, partner_id, date_invoice=False, |
126 | + payment_term=False, partner_bank_id=False, company_id=False): |
127 | + result = super(account_invoice, self).onchange_partner_id( |
128 | + cr, uid, ids, type, partner_id, date_invoice, payment_term, |
129 | + partner_bank_id, company_id) |
130 | if partner_id: |
131 | partner = self.pool.get('res.partner').browse(cr, uid, partner_id) |
132 | - result['value']['carriage_condition_id'] = partner.carriage_condition_id.id |
133 | - result['value']['goods_description_id'] = partner.goods_description_id.id |
134 | - result['value']['transportation_reason_id'] = partner.transportation_reason_id.id |
135 | + result['value'][ |
136 | + 'carriage_condition_id' |
137 | + ] = partner.carriage_condition_id.id |
138 | + result['value'][ |
139 | + 'goods_description_id' |
140 | + ] = partner.goods_description_id.id |
141 | + result['value'][ |
142 | + 'transportation_reason_id' |
143 | + ] = partner.transportation_reason_id.id |
144 | return result |
145 | - |
146 | -account_invoice() |
147 | - |
148 | |
149 | === modified file 'l10n_it_sale/partner/__init__.py' |
150 | --- l10n_it_sale/partner/__init__.py 2013-03-13 08:21:42 +0000 |
151 | +++ l10n_it_sale/partner/__init__.py 2014-05-22 13:05:57 +0000 |
152 | @@ -1,6 +1,6 @@ |
153 | # -*- coding: utf-8 -*- |
154 | ############################################################################## |
155 | -# |
156 | +# |
157 | # Copyright (C) 2010 Associazione OpenERP Italia |
158 | # (<http://www.openerp-italia.org>). |
159 | # |
160 | |
161 | === modified file 'l10n_it_sale/partner/partner.py' |
162 | --- l10n_it_sale/partner/partner.py 2013-03-14 11:11:29 +0000 |
163 | +++ l10n_it_sale/partner/partner.py 2014-05-22 13:05:57 +0000 |
164 | @@ -1,6 +1,6 @@ |
165 | # -*- coding: utf-8 -*- |
166 | ############################################################################## |
167 | -# |
168 | +# |
169 | # Copyright (C) 2010 Associazione OpenERP Italia |
170 | # (<http://www.openerp-italia.org>). |
171 | # |
172 | @@ -21,11 +21,14 @@ |
173 | |
174 | from openerp.osv import orm, fields |
175 | |
176 | + |
177 | class res_partner(orm.Model): |
178 | _inherit = "res.partner" |
179 | - _columns = { |
180 | - 'carriage_condition_id': fields.many2one('stock.picking.carriage_condition', 'Carriage condition'), |
181 | - 'goods_description_id': fields.many2one('stock.picking.goods_description', 'Description of goods'), |
182 | - 'transportation_reason_id': fields.many2one('stock.picking.transportation_reason', 'Reason for transportation'), |
183 | - } |
184 | -res_partner() |
185 | + _columns = { |
186 | + 'carriage_condition_id': fields.many2one( |
187 | + 'stock.picking.carriage_condition', 'Carriage condition'), |
188 | + 'goods_description_id': fields.many2one( |
189 | + 'stock.picking.goods_description', 'Description of goods'), |
190 | + 'transportation_reason_id': fields.many2one( |
191 | + 'stock.picking.transportation_reason', |
192 | + 'Reason for transportation')} |
193 | |
194 | === modified file 'l10n_it_sale/sale/__init__.py' |
195 | --- l10n_it_sale/sale/__init__.py 2013-03-13 08:21:42 +0000 |
196 | +++ l10n_it_sale/sale/__init__.py 2014-05-22 13:05:57 +0000 |
197 | @@ -1,6 +1,6 @@ |
198 | # -*- coding: utf-8 -*- |
199 | ############################################################################## |
200 | -# |
201 | +# |
202 | # Copyright (C) 2010 Associazione OpenERP Italia |
203 | # (<http://www.openerp-italia.org>). |
204 | # |
205 | @@ -20,4 +20,3 @@ |
206 | ############################################################################## |
207 | |
208 | import sale |
209 | - |
210 | |
211 | === modified file 'l10n_it_sale/sale/sale.py' |
212 | --- l10n_it_sale/sale/sale.py 2013-03-14 11:11:29 +0000 |
213 | +++ l10n_it_sale/sale/sale.py 2014-05-22 13:05:57 +0000 |
214 | @@ -1,6 +1,6 @@ |
215 | # -*- coding: utf-8 -*- |
216 | ############################################################################## |
217 | -# |
218 | +# |
219 | # Copyright (C) 2010 Associazione OpenERP Italia |
220 | # (<http://www.openerp-italia.org>). |
221 | # |
222 | @@ -19,41 +19,47 @@ |
223 | # |
224 | ############################################################################## |
225 | |
226 | -import time |
227 | from openerp.osv import orm, fields |
228 | |
229 | + |
230 | class sale_order(orm.Model): |
231 | _inherit = "sale.order" |
232 | - _columns = { |
233 | + _columns = { |
234 | 'validity': fields.date('Validity'), |
235 | } |
236 | |
237 | def _make_invoice(self, cr, uid, order, lines, context={}): |
238 | - inv_id = super(sale_order, self)._make_invoice(cr, uid, order, lines, context) |
239 | - partner = self.pool.get('res.partner').browse(cr , uid, order.partner_id.id) |
240 | - self.pool.get('account.invoice').write(cr, uid, inv_id, { |
241 | -# 'order_id': order.id, |
242 | - 'carriage_condition_id': partner.carriage_condition_id.id, |
243 | - 'goods_description_id': partner.goods_description_id.id, |
244 | - 'transportation_reason_id': partner.transportation_reason_id.id, |
245 | - }) |
246 | + inv_id = super(sale_order, self)._make_invoice( |
247 | + cr, uid, order, lines, context) |
248 | + partner = self.pool.get('res.partner').browse( |
249 | + cr, uid, order.partner_id.id) |
250 | + self.pool.get('account.invoice').write( |
251 | + cr, uid, inv_id, { |
252 | + 'carriage_condition_id': |
253 | + partner.carriage_condition_id.id, |
254 | + 'goods_description_id': |
255 | + partner.goods_description_id.id, |
256 | + 'transportation_reason_id': |
257 | + partner.transportation_reason_id.id, |
258 | + }) |
259 | return inv_id |
260 | |
261 | def action_ship_create(self, cr, uid, ids, *args): |
262 | super(sale_order, self).action_ship_create(cr, uid, ids, *args) |
263 | for order in self.browse(cr, uid, ids, context={}): |
264 | - partner = self.pool.get('res.partner').browse(cr , uid, order.partner_id.id) |
265 | + partner = self.pool.get('res.partner').browse( |
266 | + cr, uid, order.partner_id.id) |
267 | picking_obj = self.pool.get('stock.picking') |
268 | - picking_ids = picking_obj.search(cr, uid, [('sale_id', '=', order.id)]) |
269 | + picking_ids = picking_obj.search( |
270 | + cr, uid, [('sale_id', '=', order.id)]) |
271 | for picking_id in picking_ids: |
272 | - picking_obj.write(cr, uid, picking_id, { |
273 | -# 'order_id': order.id, |
274 | - 'carriage_condition_id': partner.carriage_condition_id.id, |
275 | - 'goods_description_id': partner.goods_description_id.id, |
276 | - 'transportation_reason_id': partner.transportation_reason_id.id, |
277 | + picking_obj.write( |
278 | + cr, uid, picking_id, { |
279 | + 'carriage_condition_id': |
280 | + partner.carriage_condition_id.id, |
281 | + 'goods_description_id': |
282 | + partner.goods_description_id.id, |
283 | + 'transportation_reason_id': |
284 | + partner.transportation_reason_id.id, |
285 | }) |
286 | return True |
287 | - |
288 | -sale_order() |
289 | - |
290 | - |
291 | |
292 | === modified file 'l10n_it_sale/stock/__init__.py' |
293 | --- l10n_it_sale/stock/__init__.py 2013-03-13 08:21:42 +0000 |
294 | +++ l10n_it_sale/stock/__init__.py 2014-05-22 13:05:57 +0000 |
295 | @@ -1,6 +1,6 @@ |
296 | # -*- coding: utf-8 -*- |
297 | ############################################################################## |
298 | -# |
299 | +# |
300 | # Copyright (C) 2010 Associazione OpenERP Italia |
301 | # (<http://www.openerp-italia.org>). |
302 | # |
303 | @@ -20,5 +20,3 @@ |
304 | ############################################################################## |
305 | |
306 | import picking |
307 | - |
308 | - |
309 | |
310 | === modified file 'l10n_it_sale/stock/picking.py' |
311 | --- l10n_it_sale/stock/picking.py 2014-01-23 12:58:16 +0000 |
312 | +++ l10n_it_sale/stock/picking.py 2014-05-22 13:05:57 +0000 |
313 | @@ -1,6 +1,6 @@ |
314 | # -*- coding: utf-8 -*- |
315 | ############################################################################## |
316 | -# |
317 | +# |
318 | # Copyright (C) 2010-2012 Associazione OpenERP Italia |
319 | # (<http://www.openerp-italia.org>). |
320 | # |
321 | @@ -20,10 +20,12 @@ |
322 | ############################################################################## |
323 | |
324 | import netsvc |
325 | -import pooler, tools |
326 | +import pooler |
327 | +import tools |
328 | |
329 | from openerp.osv import orm, fields |
330 | |
331 | + |
332 | class stock_picking_carriage_condition(orm.Model): |
333 | """ |
334 | Carriage condition |
335 | @@ -31,10 +33,12 @@ |
336 | _name = "stock.picking.carriage_condition" |
337 | _description = "Carriage Condition" |
338 | _columns = { |
339 | - 'name':fields.char('Carriage Condition', size=64, required=True, readonly=False), |
340 | + 'name': fields.char( |
341 | + 'Carriage Condition', size=64, required=True, readonly=False), |
342 | 'note': fields.text('Note'), |
343 | } |
344 | |
345 | + |
346 | class stock_picking_goods_description(orm.Model): |
347 | """ |
348 | Description of Goods |
349 | @@ -43,9 +47,10 @@ |
350 | _description = "Description of Goods" |
351 | |
352 | _columns = { |
353 | - 'name':fields.char('Description of Goods', size=64, required=True, readonly=False), |
354 | - 'note': fields.text('Note'), |
355 | - } |
356 | + 'name': fields.char( |
357 | + 'Description of Goods', size=64, required=True, readonly=False), |
358 | + 'note': fields.text('Note')} |
359 | + |
360 | |
361 | class stock_picking_reason(orm.Model): |
362 | """ |
363 | @@ -55,51 +60,71 @@ |
364 | _description = 'Reason for transportation' |
365 | |
366 | _columns = { |
367 | - 'name':fields.char('Reason For Transportation', size=64, required=True, readonly=False), |
368 | + 'name': fields.char( |
369 | + 'Reason For Transportation', size=64, required=True, |
370 | + readonly=False), |
371 | 'note': fields.text('Note'), |
372 | } |
373 | |
374 | + |
375 | class stock_picking_out(orm.Model): |
376 | _inherit = "stock.picking.out" |
377 | - _columns = { |
378 | - 'carriage_condition_id': fields.many2one('stock.picking.carriage_condition', 'Carriage condition'), |
379 | - 'goods_description_id': fields.many2one('stock.picking.goods_description', 'Description of goods'), |
380 | - 'transportation_reason_id': fields.many2one('stock.picking.transportation_reason', 'Reason for transportation'), |
381 | - 'ddt_number': fields.char('DDT', size=64), |
382 | - 'ddt_date': fields.date('DDT date'), |
383 | + _columns = { |
384 | + 'carriage_condition_id': fields.many2one( |
385 | + 'stock.picking.carriage_condition', 'Carriage condition'), |
386 | + 'goods_description_id': fields.many2one( |
387 | + 'stock.picking.goods_description', 'Description of goods'), |
388 | + 'transportation_reason_id': fields.many2one( |
389 | + 'stock.picking.transportation_reason', |
390 | + 'Reason for transportation'), |
391 | + 'ddt_number': fields.char('DDT', size=64), |
392 | + 'ddt_date': fields.date('DDT date'), |
393 | } |
394 | |
395 | - def action_invoice_create(self, cursor, user, ids, journal_id=False, |
396 | - group=False, type='out_invoice', context=None): |
397 | - res = super(stock_picking_out, self).action_invoice_create(cursor, user, ids, journal_id, |
398 | - group, type, context) |
399 | + def action_invoice_create( |
400 | + self, cursor, user, ids, journal_id=False, group=False, |
401 | + type='out_invoice', context=None): |
402 | + res = super(stock_picking_out, self).action_invoice_create( |
403 | + cursor, user, ids, journal_id, group, type, context) |
404 | for picking in self.browse(cursor, user, ids, context=context): |
405 | - self.pool.get('account.invoice').write(cursor, user, res[picking.id], { |
406 | - 'carriage_condition_id': picking.carriage_condition_id.id, |
407 | - 'goods_description_id': picking.goods_description_id.id, |
408 | - 'transportation_reason_id': picking.transportation_reason_id.id, |
409 | + self.pool.get('account.invoice').write( |
410 | + cursor, user, res[picking.id], { |
411 | + 'carriage_condition_id': |
412 | + picking.carriage_condition_id.id, |
413 | + 'goods_description_id': |
414 | + picking.goods_description_id.id, |
415 | + 'transportation_reason_id': |
416 | + picking.transportation_reason_id.id, |
417 | }) |
418 | return res |
419 | |
420 | - #----------------------------------------------------------------------------- |
421 | + # ------------------------------------------------------------------------- |
422 | # EVITARE LA COPIA DI 'NUMERO DDT' |
423 | - #----------------------------------------------------------------------------- |
424 | + # ------------------------------------------------------------------------- |
425 | def copy(self, cr, uid, id, default=None, context=None): |
426 | if default is None: |
427 | default = {} |
428 | default.update({'ddt_number': ''}) |
429 | - return super(stock_picking_out, self).copy(cr, uid, id, default, context=context) |
430 | + return super(stock_picking_out, self).copy( |
431 | + cr, uid, id, default, context=context) |
432 | |
433 | -# Redefinition of the new fields in order to update the model stock.picking in the orm |
434 | -# FIXME: this is a temporary workaround because of a framework bug (ref: lp996816). |
435 | +# Redefinition of the new fields in order to update the model stock.picking in |
436 | +# the orm |
437 | +# FIXME: this is a temporary workaround because of a framework bug: lp996816 |
438 | # It should be removed as soon as |
439 | # the bug is fixed |
440 | + |
441 | + |
442 | class stock_picking(orm.Model): |
443 | _inherit = 'stock.picking' |
444 | - _columns = { |
445 | - 'carriage_condition_id': fields.many2one('stock.picking.carriage_condition', 'Carriage condition'), |
446 | - 'goods_description_id': fields.many2one('stock.picking.goods_description', 'Description of goods'), |
447 | - 'transportation_reason_id': fields.many2one('stock.picking.transportation_reason', 'Reason for transportation'), |
448 | - 'ddt_number': fields.char('DDT', size=64), |
449 | - 'ddt_date': fields.date('DDT date'), |
450 | + _columns = { |
451 | + 'carriage_condition_id': fields.many2one( |
452 | + 'stock.picking.carriage_condition', 'Carriage condition'), |
453 | + 'goods_description_id': fields.many2one( |
454 | + 'stock.picking.goods_description', 'Description of goods'), |
455 | + 'transportation_reason_id': fields.many2one( |
456 | + 'stock.picking.transportation_reason', |
457 | + 'Reason for transportation'), |
458 | + 'ddt_number': fields.char('DDT', size=64), |
459 | + 'ddt_date': fields.date('DDT date'), |
460 | } |
461 | |
462 | === modified file 'l10n_it_sale/wizard/__init__.py' |
463 | --- l10n_it_sale/wizard/__init__.py 2013-03-13 08:21:42 +0000 |
464 | +++ l10n_it_sale/wizard/__init__.py 2014-05-22 13:05:57 +0000 |
465 | @@ -1,6 +1,6 @@ |
466 | # -*- coding: utf-8 -*- |
467 | ############################################################################## |
468 | -# |
469 | +# |
470 | # Copyright (C) 2010 Associazione OpenERP Italia |
471 | # (<http://www.openerp-italia.org>). |
472 | # |
473 | |
474 | === modified file 'l10n_it_sale/wizard/assign_ddt.py' |
475 | --- l10n_it_sale/wizard/assign_ddt.py 2013-06-16 12:53:29 +0000 |
476 | +++ l10n_it_sale/wizard/assign_ddt.py 2014-05-22 13:05:57 +0000 |
477 | @@ -1,6 +1,6 @@ |
478 | # -*- coding: utf-8 -*- |
479 | ############################################################################## |
480 | -# |
481 | +# |
482 | # Copyright (C) 2010 Associazione OpenERP Italia |
483 | # (<http://www.openerp-italia.org>). |
484 | # |
485 | @@ -19,23 +19,25 @@ |
486 | # |
487 | ############################################################################## |
488 | |
489 | -from openerp.osv import orm, fields |
490 | +from openerp.osv import orm |
491 | from tools.translate import _ |
492 | import time |
493 | |
494 | + |
495 | class wizard_assign_ddt(orm.TransientModel): |
496 | |
497 | _name = "wizard.assign.ddt" |
498 | |
499 | def assign_ddt(self, cr, uid, ids, context=None): |
500 | picking_obj = self.pool.get('stock.picking.out') |
501 | - for picking in picking_obj.browse(cr, uid, context.get('active_ids', []), context=context): |
502 | + for picking in picking_obj.browse( |
503 | + cr, uid, context.get('active_ids', []), context=context): |
504 | if picking.ddt_number: |
505 | raise orm.except_orm('Error', _('DTT number already assigned')) |
506 | picking.write({ |
507 | - 'ddt_number': self.pool.get('ir.sequence').get(cr, uid, 'stock.ddt'), |
508 | - 'ddt_date': time.strftime('%Y-%m-%d'), |
509 | - }) |
510 | + 'ddt_number': self.pool.get('ir.sequence').get( |
511 | + cr, uid, 'stock.ddt'), |
512 | + 'ddt_date': time.strftime('%Y-%m-%d')}) |
513 | return { |
514 | 'type': 'ir.actions.act_window_close', |
515 | } |
ho escluso F401, siccome mi era parso di leggere che si preferisce tollerare il controllo piuttosto che riempire il codice di assert