Merge lp:~vauxoo/openerp-mexico-localization/7.0_l10n_mx_isinstance_ids_dev_carlos into lp:openerp-mexico-localization/7.0
- 7.0_l10n_mx_isinstance_ids_dev_carlos
- Merge into 7.0
Status: | Merged |
---|---|
Merged at revision: | 340 |
Proposed branch: | lp:~vauxoo/openerp-mexico-localization/7.0_l10n_mx_isinstance_ids_dev_carlos |
Merge into: | lp:openerp-mexico-localization/7.0 |
Diff against target: |
1508 lines (+313/-120) 48 files modified
city/partner_address.py (+0/-1) l10n_mx_account_tax_category/invoice.py (+2/-2) l10n_mx_base_vat_split/base_vat.py (+2/-3) l10n_mx_cities/tools/read_write_xml.py (+0/-4) l10n_mx_company_cif/wizard/installer.py (+8/-4) l10n_mx_company_multi_address/invoice.py (+6/-0) l10n_mx_company_multi_address/res_company.py (+1/-2) l10n_mx_diot_report/wizard/wizard_diot_report.py (+3/-0) l10n_mx_facturae/invoice.py (+36/-21) l10n_mx_facturae/ir_attachment_facturae.py (+2/-0) l10n_mx_facturae/ir_sequence_approval.py (+2/-0) l10n_mx_facturae/wizard/installer.py (+11/-6) l10n_mx_facturae/wizard/wizard_create_facturae_file.py (+2/-2) l10n_mx_facturae/wizard/wizard_invoice_facturae_txt.py (+6/-6) l10n_mx_facturae/wizard/wizard_invoice_facturae_txt_v6.py (+3/-3) l10n_mx_facturae/wizard/wizard_invoice_facturae_xml.py (+2/-2) l10n_mx_facturae/wizard/wizard_invoice_facturae_xml_v6.py (+1/-1) l10n_mx_facturae_cbb/invoice.py (+8/-8) l10n_mx_facturae_cbb/ir_attachment_facturae.py (+2/-0) l10n_mx_facturae_cbb/ir_sequence_approval.py (+2/-0) l10n_mx_facturae_cer/invoice.py (+2/-3) l10n_mx_facturae_cer/res_company.py (+10/-6) l10n_mx_facturae_pac/invoice.py (+7/-3) l10n_mx_facturae_pac_sf/invoice.py (+22/-11) l10n_mx_facturae_pac_sf/ir_attachment_facturae.py (+7/-1) l10n_mx_facturae_pac_sf/wizard/wizard_cancel_invoice_pac_sf_v6.py (+6/-2) l10n_mx_facturae_pac_sf/wizard/wizard_export_invoice_pac_sf_v6.py (+6/-2) l10n_mx_facturae_report/report/invoice_facturae_html.py (+52/-1) l10n_mx_facturae_seq/invoice.py (+2/-3) l10n_mx_facturae_seq/ir_sequence.py (+13/-6) l10n_mx_import_info/import_info.py (+3/-1) l10n_mx_import_info/product.py (+9/-3) l10n_mx_import_info/stock.py (+13/-0) l10n_mx_invoice_amount_to_text/invoice.py (+2/-3) l10n_mx_invoice_datetime/invoice.py (+11/-4) l10n_mx_invoice_discount/invoice.py (+5/-1) l10n_mx_invoice_ftp/wizard/wizard_facturae_ftp.py (+6/-1) l10n_mx_ir_attachment_facturae/invoice.py (+5/-0) l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py (+9/-0) l10n_mx_ir_attachment_facturae/res_config.py (+2/-0) l10n_mx_params_pac/params_pac.py (+2/-0) l10n_mx_partner_address/partner_address.py (+3/-1) l10n_mx_partner_address/res_company.py (+4/-0) l10n_mx_purchase_payment_method/purchase.py (+2/-0) l10n_mx_res_partner_bank/res_bank.py (+2/-0) l10n_mx_sale_payment_method/model/sale.py (+4/-2) l10n_mx_sale_payment_method/model/stock.py (+2/-0) l10n_mx_upload_ftp/upload_ftp.py (+3/-1) |
To merge this branch: | bzr merge lp:~vauxoo/openerp-mexico-localization/7.0_l10n_mx_isinstance_ids_dev_carlos |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jorge Angel Naranjo Rogel - http://www.vauxoo.com | Approve | ||
Juan Carlos Hernandez (community) | Needs Resubmitting | ||
Isaac López Zúñiga | Needs Fixing | ||
Nhomar - Vauxoo | Pending | ||
Moisés López - http://www.vauxoo.com | Pending | ||
Review via email: mp+194270@code.launchpad.net |
Commit message
Description of the change
se agrego guideline
if context is None:
context = {}
ids = isinstance(ids, (int, long)) and [ids] or ids
- 325. By Juan Carlos Hernandez
-
[IMP[l10n_
mx_facturae] modify context={} to context=None
Juan Carlos Hernandez (openerp1) wrote : | # |
Isaac,
Cambios mencionados anteriormente ya quedaron.
Juan Carlos Hernandez (openerp1) wrote : | # |
Isaac ya quedaron resueltos los comentarios que tu mencionaste
Isaac López Zúñiga (isaako34) wrote : | # |
Carlos, por favor ejecuta: rgrep "if not context" . --include=*.py
Y obtendrás los siguientes resultados, esas líneas son las que falta corregir:
./l10n_
./l10n_
./l10n_
./l10n_
./l10n_
./l10n_
./l10n_
./l10n_
./l10n_
./l10n_
./l10n_
Saludos.
- 326. By Juan Carlos Hernandez
-
[IMP][l10n_
mx]corrected if not context
Juan Carlos Hernandez (openerp1) wrote : | # |
Isaac cambios listos del if not context:
- 327. By Juan Carlos Hernandez
-
[MERGE]
- 328. By Juan Carlos Hernandez
-
[IMP][l10n_
mx_ir_attachmen t_facturae] add ids = isinstance(ids, (int, long)) and [ids] or ids
Juan Carlos Hernandez (openerp1) wrote : | # |
Isaac ya está el merge de lo ultimo y más nuevo, y ya resolví los conflictos.
Juan Carlos Hernandez (openerp1) wrote : | # |
Isaac ya quedo lista la tarea,puedes revisarla porfavor
- 329. By Juan Carlos Hernandez
-
[MERGE]
- 330. By Juan Carlos Hernandez
-
[MERGE]
- 331. By Juan Carlos Hernandez
-
[DEL][l10n_
mx_facturae_ pac_sf] del folder report - 332. By Juan Carlos Hernandez
-
[MERGE]
- 333. By Juan Carlos Hernandez
-
[IMP][l10n_
mx_facturae_ cer]add context=None
Jorge Angel Naranjo Rogel - http://www.vauxoo.com (jorge-nr) wrote : | # |
Busque los
rgrep "context={}" . --include=*.py
rgrep "if not context:" . --include=*.py
y ya no encuentra ninguna coincidencia y el runbot marca en verde 7.0-agrinos-
Preview Diff
1 | === modified file 'city/partner_address.py' |
2 | --- city/partner_address.py 2013-05-26 02:34:03 +0000 |
3 | +++ city/partner_address.py 2013-12-16 18:29:27 +0000 |
4 | @@ -68,7 +68,6 @@ |
5 | return {} |
6 | |
7 | def onchange_state_city(self, cr, uid, ids, state_id, city_id, context=None): |
8 | - |
9 | res = super(res_partner, self).onchange_state(cr, uid, ids, state_id, context) |
10 | if city_id and state_id and self.pool.get('res.country.state.city').browse(cr, uid, city_id, context).state_id.id != state_id: |
11 | if res and 'value' in res: |
12 | |
13 | === modified file 'l10n_mx_account_tax_category/invoice.py' |
14 | --- l10n_mx_account_tax_category/invoice.py 2013-05-09 23:30:27 +0000 |
15 | +++ l10n_mx_account_tax_category/invoice.py 2013-12-16 18:29:27 +0000 |
16 | @@ -37,8 +37,8 @@ |
17 | class account_invoice_tax(osv.Model): |
18 | _inherit = "account.invoice.tax" |
19 | |
20 | - def _get_tax_data(self, cr, uid, ids, field_names=None, arg=False, context={}): |
21 | - if not context: |
22 | + def _get_tax_data(self, cr, uid, ids, field_names=None, arg=False, context=None): |
23 | + if context is None: |
24 | context = {} |
25 | res = {} |
26 | for invoice_tax in self.browse(cr, uid, ids, context=context): |
27 | |
28 | === modified file 'l10n_mx_base_vat_split/base_vat.py' |
29 | --- l10n_mx_base_vat_split/base_vat.py 2013-05-09 23:34:38 +0000 |
30 | +++ l10n_mx_base_vat_split/base_vat.py 2013-12-16 18:29:27 +0000 |
31 | @@ -30,9 +30,8 @@ |
32 | class res_partner(osv.Model): |
33 | _inherit = 'res.partner' |
34 | |
35 | - def _get_base_vat_split(self, cr, uid, ids, field_names=None, arg=False, |
36 | - context={}): |
37 | - if not context: |
38 | + def _get_base_vat_split(self, cr, uid, ids, field_names=None, arg=False, context=None): |
39 | + if context is None: |
40 | context = {} |
41 | res = {} |
42 | for partner in self.browse(cr, uid, ids, context=context): |
43 | |
44 | === modified file 'l10n_mx_cities/tools/read_write_xml.py' |
45 | --- l10n_mx_cities/tools/read_write_xml.py 2013-05-09 23:41:43 +0000 |
46 | +++ l10n_mx_cities/tools/read_write_xml.py 2013-12-16 18:29:27 +0000 |
47 | @@ -56,7 +56,6 @@ |
48 | main_node = add_node('data', {"noupdate": "True"}, nodeopenerp, |
49 | xml_doc, attrs_types={"noupdate": "attribute"}) |
50 | |
51 | -print '------------Generando xml' |
52 | for elem in root[1:]: |
53 | for a in elem: |
54 | if a.tag == '{NewDataSet}c_mnpio': |
55 | @@ -113,9 +112,6 @@ |
56 | xml_doc, node_states_attrs_types, order) |
57 | node_record.appendChild(node_field_states) |
58 | |
59 | - |
60 | -print 'xml_doc to xml', xml_doc.toxml('UTF-8') |
61 | -print '\n------------xml generado con exito' |
62 | data_full_path = os.path.join(data_path, 'l10n_mx_cities.xml') |
63 | |
64 | f = open(data_full_path, 'wb') |
65 | |
66 | === modified file 'l10n_mx_company_cif/wizard/installer.py' |
67 | --- l10n_mx_company_cif/wizard/installer.py 2013-05-09 23:46:20 +0000 |
68 | +++ l10n_mx_company_cif/wizard/installer.py 2013-12-16 18:29:27 +0000 |
69 | @@ -37,12 +37,16 @@ |
70 | }, context=context) |
71 | |
72 | def execute(self, cr, uid, ids, context=None): |
73 | + if context is None: |
74 | + context = {} |
75 | + if not ids: |
76 | + return True |
77 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
78 | company_id = self.pool.get('res.users').browse( |
79 | cr, uid, [uid], context)[0].company_id.partner_id.id |
80 | - wiz_data = self.read(cr, uid, ids[0]) |
81 | - if wiz_data['cif_file']: |
82 | - self._write_company(cr, uid, wiz_data[ |
83 | - "cif_file"], company_id, context) |
84 | + wiz_data = self.read(cr, uid, ids) |
85 | + if wiz_data[0]['cif_file']: |
86 | + self._write_company(cr, uid, wiz_data[0]["cif_file"], company_id, context) |
87 | |
88 | _columns = { |
89 | 'cif_file': fields.binary('CIF', help="Fiscal Identification Card"), |
90 | |
91 | === modified file 'l10n_mx_company_multi_address/invoice.py' |
92 | --- l10n_mx_company_multi_address/invoice.py 2013-05-31 21:36:22 +0000 |
93 | +++ l10n_mx_company_multi_address/invoice.py 2013-12-16 18:29:27 +0000 |
94 | @@ -32,6 +32,8 @@ |
95 | _inherit = 'account.invoice' |
96 | |
97 | def _get_address_issued_invoice(self, cr, uid, ids, name, args, context=None): |
98 | + if context is None: |
99 | + context = {} |
100 | res = {} |
101 | journal_obj = self.pool.get('account.journal') |
102 | for id_ in ids: |
103 | @@ -52,6 +54,8 @@ |
104 | return res |
105 | |
106 | def _get_company_emitter_invoice(self, cr, uid, ids, name, args, context=None): |
107 | + if context is None: |
108 | + context = {} |
109 | res = {} |
110 | journal_obj = self.pool.get('account.journal') |
111 | for id_ in ids: |
112 | @@ -77,6 +81,8 @@ |
113 | } |
114 | |
115 | def onchange_journal_id(self, cr, uid, ids, journal_id=False, context=None): |
116 | + if context is None: |
117 | + context = {} |
118 | result = super(account_invoice, self).onchange_journal_id( |
119 | cr, uid, ids, journal_id, context=context) |
120 | address_id = journal_id and self.pool.get('account.journal').browse( |
121 | |
122 | === modified file 'l10n_mx_company_multi_address/res_company.py' |
123 | --- l10n_mx_company_multi_address/res_company.py 2013-05-10 14:44:46 +0000 |
124 | +++ l10n_mx_company_multi_address/res_company.py 2013-12-16 18:29:27 +0000 |
125 | @@ -35,8 +35,7 @@ |
126 | class res_company(osv.Model): |
127 | _inherit = 'res.company' |
128 | |
129 | - def get_address_invoice_parent_company_id(self, cr, uid, ids, field, arg, |
130 | - context=None): |
131 | + def get_address_invoice_parent_company_id(self, cr, uid, ids, field, arg, context=None): |
132 | if context is None: |
133 | context = {} |
134 | res = {} |
135 | |
136 | === modified file 'l10n_mx_diot_report/wizard/wizard_diot_report.py' |
137 | --- l10n_mx_diot_report/wizard/wizard_diot_report.py 2013-11-14 20:30:30 +0000 |
138 | +++ l10n_mx_diot_report/wizard/wizard_diot_report.py 2013-12-16 18:29:27 +0000 |
139 | @@ -64,6 +64,8 @@ |
140 | This function load in the wizard, the company used by the user, and |
141 | the previous period to the current |
142 | """ |
143 | + if context is None: |
144 | + context = {} |
145 | data = super(wizard_account_diot_mx, self).default_get(cr, uid, |
146 | fields, context=context) |
147 | time_now = datetime.date.today()+relativedelta(months=-1) |
148 | @@ -85,6 +87,7 @@ |
149 | """ |
150 | if context is None: |
151 | context = {} |
152 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
153 | acc_move_line_obj = self.pool.get('account.move.line') |
154 | acc_tax_obj = self.pool.get('account.tax') |
155 | acc_tax_category_obj = self.pool.get('account.tax.category') |
156 | |
157 | === modified file 'l10n_mx_facturae/invoice.py' |
158 | --- l10n_mx_facturae/invoice.py 2013-12-09 19:11:26 +0000 |
159 | +++ l10n_mx_facturae/invoice.py 2013-12-16 18:29:27 +0000 |
160 | @@ -142,15 +142,14 @@ |
161 | # return (False,str(e)) |
162 | return (True, ret_file_name) |
163 | |
164 | - def create_report_pdf(self, cr, uid, ids, context={}): |
165 | - if not context: |
166 | + def create_report_pdf(self, cr, uid, ids, context=None): |
167 | + if context is None: |
168 | context = {} |
169 | - id = ids[0] |
170 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
171 | (fileno, fname) = tempfile.mkstemp( |
172 | '.pdf', 'openerp_' + (False or '') + '__facturae__') |
173 | os.close(fileno) |
174 | - file = self.create_report(cr, uid, [ |
175 | - id], "account.invoice.facturae.pdf", fname) |
176 | + file = self.create_report(cr, uid, ids, "account.invoice.facturae.pdf", fname) |
177 | is_file = file[0] |
178 | fname = file[1] |
179 | if is_file and os.path.isfile(fname): |
180 | @@ -163,7 +162,7 @@ |
181 | 'datas_fname': context.get('fname'), |
182 | 'description': 'Factura-E PDF', |
183 | 'res_model': self._name, |
184 | - 'res_id': id, |
185 | + 'res_id': ids, |
186 | } |
187 | self.pool.get('ir.attachment').create( |
188 | cr, uid, data_attach, context=context) |
189 | @@ -215,8 +214,8 @@ |
190 | (ref, move_id)) |
191 | return True |
192 | |
193 | - def _get_fname_invoice(self, cr, uid, ids, field_names=None, arg=False, context={}): |
194 | - if not context: |
195 | + def _get_fname_invoice(self, cr, uid, ids, field_names=None, arg=False, context=None): |
196 | + if context is None: |
197 | context = {} |
198 | res = {} |
199 | sequence_obj = self.pool.get('ir.sequence') |
200 | @@ -247,6 +246,7 @@ |
201 | return res |
202 | |
203 | def action_cancel_draft(self, cr, uid, ids, *args): |
204 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
205 | self.write(cr, uid, ids, { |
206 | 'no_certificado': False, |
207 | 'certificado': False, |
208 | @@ -257,6 +257,9 @@ |
209 | return super(account_invoice, self).action_cancel_draft(cr, uid, ids, args) |
210 | |
211 | def action_cancel(self, cr, uid, ids, context=None): |
212 | + if context is None: |
213 | + context = {} |
214 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
215 | self.write(cr, uid, ids, { |
216 | 'date_invoice_cancel': time.strftime('%Y-%m-%d %H:%M:%S')}) |
217 | return super(account_invoice, self).action_cancel(cr, uid, ids, context=context) |
218 | @@ -351,8 +354,8 @@ |
219 | os.close(fileno) |
220 | return fname |
221 | |
222 | - def _get_file_globals(self, cr, uid, ids, context={}): |
223 | - if not context: |
224 | + def _get_file_globals(self, cr, uid, ids, context=None): |
225 | + if context is None: |
226 | context = {} |
227 | id = ids and ids[0] or False |
228 | file_globals = {} |
229 | @@ -479,7 +482,9 @@ |
230 | 'cadenaoriginal_3_2_l.xslt') or '' |
231 | return file_globals |
232 | |
233 | - def _____________get_facturae_invoice_txt_data(self, cr, uid, ids, context={}): |
234 | + def _____________get_facturae_invoice_txt_data(self, cr, uid, ids, context=None): |
235 | + if context is None: |
236 | + context = {} |
237 | # TODO: Transform date to fmt %d/%m/%Y %H:%M:%S |
238 | certificate_lib = self.pool.get('facturae.certificate.library') |
239 | fname_repmensual_xslt = self._get_file_globals( |
240 | @@ -500,7 +505,9 @@ |
241 | rep_mensual += '\r\n' |
242 | return rep_mensual, fname_tmp |
243 | |
244 | - def _get_facturae_invoice_txt_data(self, cr, uid, ids, context={}): |
245 | + def _get_facturae_invoice_txt_data(self, cr, uid, ids, context=None): |
246 | + if context is None: |
247 | + context = {} |
248 | facturae_datas = self._get_facturae_invoice_dict_data( |
249 | cr, uid, ids, context=context) |
250 | facturae_data_txt_lists = [] |
251 | @@ -587,7 +594,9 @@ |
252 | '%m%Y', time.strptime(fecha_promedio, '%Y-%m-%dT%H:%M:%S')) + '.txt' |
253 | return cad, fname |
254 | |
255 | - def _get_folio(self, cr, uid, ids, context={}): |
256 | + def _get_folio(self, cr, uid, ids, context=None): |
257 | + if context is None: |
258 | + context = {} |
259 | folio_data = {} |
260 | id = ids and ids[0] or False |
261 | if id: |
262 | @@ -667,7 +676,7 @@ |
263 | 'Not found a sequence of configuration. %s !') % (msg2)) |
264 | return folio_data |
265 | |
266 | - def _dict_iteritems_sort(self, data_dict): # cr=False, uid=False, ids=[], context={}): |
267 | + def _dict_iteritems_sort(self, data_dict): # cr=False, uid=False, ids=[], context=None): |
268 | """ |
269 | @param data_dict : Dictionary with data from invoice |
270 | """ |
271 | @@ -730,8 +739,8 @@ |
272 | doc.appendChild(node) |
273 | return doc |
274 | |
275 | - def _get_facturae_invoice_xml_data(self, cr, uid, ids, context={}): |
276 | - if not context: |
277 | + def _get_facturae_invoice_xml_data(self, cr, uid, ids, context=None): |
278 | + if context is None: |
279 | context = {} |
280 | data_dict = self._get_facturae_invoice_dict_data( |
281 | cr, uid, ids, context=context)[0] |
282 | @@ -840,15 +849,17 @@ |
283 | raise osv.except_osv('Error al validar la estructura del xml!', 'Validación de XML versión %s:\n%s'%(facturae_version, result)) |
284 | return True |
285 | |
286 | - def write_cfd_data(self, cr, uid, ids, cfd_datas, context={}): |
287 | + def write_cfd_data(self, cr, uid, ids, cfd_datas, context=None): |
288 | """ |
289 | @param cfd_datas : Dictionary with data that is used in facturae CFD and CFDI |
290 | """ |
291 | + if context is None: |
292 | + context = {} |
293 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
294 | if not cfd_datas: |
295 | cfd_datas = {} |
296 | # obtener cfd_data con varios ids |
297 | # for id in ids: |
298 | - id = ids[0] |
299 | if True: |
300 | data = {} |
301 | cfd_data = cfd_datas |
302 | @@ -864,7 +875,7 @@ |
303 | 'sello': sello, |
304 | 'cadena_original': cadena_original, |
305 | } |
306 | - self.write(cr, uid, [id], data, context=context) |
307 | + self.write(cr, uid, ids, data, context=context) |
308 | return True |
309 | |
310 | def _get_noCertificado(self, cr, uid, ids, fname_cer, pem=True, context=None): |
311 | @@ -903,7 +914,9 @@ |
312 | fname_out=fname_sign, encrypt=encrypt, type_key='PEM') |
313 | return result |
314 | |
315 | - def _xml2cad_orig(self, cr=False, uid=False, ids=False, context={}): |
316 | + def _xml2cad_orig(self, cr=False, uid=False, ids=False, context=None): |
317 | + if context is None: |
318 | + context = {} |
319 | certificate_lib = self.pool.get('facturae.certificate.library') |
320 | fname_tmp = certificate_lib.b64str_to_tempfile(cr, uid, ids, base64.encodestring( |
321 | ''), file_suffix='.txt', file_prefix='openerp__' + (False or '') + \ |
322 | @@ -941,7 +954,9 @@ |
323 | open(fname_cadorig_digest, "w").write(cadorig_digest) |
324 | return cadorig_digest, fname_cadorig_digest |
325 | |
326 | - def _get_facturae_invoice_dict_data(self, cr, uid, ids, context={}): |
327 | + def _get_facturae_invoice_dict_data(self, cr, uid, ids, context=None): |
328 | + if context is None: |
329 | + context = {} |
330 | invoices = self.browse(cr, uid, ids, context=context) |
331 | invoice_tax_obj = self.pool.get("account.invoice.tax") |
332 | invoice_datas = [] |
333 | |
334 | === modified file 'l10n_mx_facturae/ir_attachment_facturae.py' |
335 | --- l10n_mx_facturae/ir_attachment_facturae.py 2013-05-10 16:24:03 +0000 |
336 | +++ l10n_mx_facturae/ir_attachment_facturae.py 2013-12-16 18:29:27 +0000 |
337 | @@ -32,6 +32,8 @@ |
338 | _inherit = 'ir.attachment.facturae.mx' |
339 | |
340 | def _get_type(self, cr, uid, ids=None, context=None): |
341 | + if context is None: |
342 | + context = {} |
343 | types = super(ir_attachment_facturae_mx, self)._get_type( |
344 | cr, uid, ids, context=context) |
345 | types.extend([ |
346 | |
347 | === modified file 'l10n_mx_facturae/ir_sequence_approval.py' |
348 | --- l10n_mx_facturae/ir_sequence_approval.py 2013-05-10 16:24:03 +0000 |
349 | +++ l10n_mx_facturae/ir_sequence_approval.py 2013-12-16 18:29:27 +0000 |
350 | @@ -33,6 +33,8 @@ |
351 | _inherit = 'ir.sequence.approval' |
352 | |
353 | def _get_type(self, cr, uid, ids=None, context=None): |
354 | + if context is None: |
355 | + context = {} |
356 | types = super(ir_sequence_approval, self)._get_type( |
357 | cr, uid, ids, context=context) |
358 | types.extend([ |
359 | |
360 | === modified file 'l10n_mx_facturae/wizard/installer.py' |
361 | --- l10n_mx_facturae/wizard/installer.py 2013-05-10 16:24:03 +0000 |
362 | +++ l10n_mx_facturae/wizard/installer.py 2013-12-16 18:29:27 +0000 |
363 | @@ -33,6 +33,8 @@ |
364 | _description = __doc__ |
365 | |
366 | def default_get(self, cr, uid, fields_list=None, context=None): |
367 | + if context is None: |
368 | + context = {} |
369 | defaults = super(facturae_config, self).default_get( |
370 | cr, uid, fields_list=fields_list, context=context) |
371 | logo = open(addons.get_module_resource( |
372 | @@ -45,7 +47,8 @@ |
373 | @param vat : VAT that will be set in the company |
374 | @param company_id : Id from the company that the user works |
375 | """ |
376 | - print 'company_id', company_id |
377 | + if context is None: |
378 | + context = {} |
379 | partner_id = self.pool.get('res.company').browse( |
380 | cr, uid, company_id).partner_id.id |
381 | partner_obj = self.pool.get('res.partner') |
382 | @@ -55,11 +58,13 @@ |
383 | }, context=context) |
384 | |
385 | def execute(self, cr, uid, ids, context=None): |
386 | - company_id = self.pool.get('res.users').browse( |
387 | - cr, uid, [uid], context)[0].company_id.partner_id.id |
388 | - wiz_data = self.read(cr, uid, ids[0]) |
389 | - if wiz_data['vat']: |
390 | - self._assign_vat(cr, uid, wiz_data["vat"], company_id, context) |
391 | + if context is None: |
392 | + context = {} |
393 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
394 | + company_id = self.pool.get('res.users').browse(cr, uid, [uid], context)[0].company_id.partner_id.id |
395 | + wiz_data = self.read(cr, uid, ids) |
396 | + if wiz_data[0]['vat']: |
397 | + self._assign_vat(cr, uid, wiz_data[0]["vat"], company_id, context) |
398 | |
399 | _columns = { |
400 | 'vat': fields.char('VAT', 64, help='Federal Register of Causes'), |
401 | |
402 | === modified file 'l10n_mx_facturae/wizard/wizard_create_facturae_file.py' |
403 | --- l10n_mx_facturae/wizard/wizard_create_facturae_file.py 2013-05-10 16:24:03 +0000 |
404 | +++ l10n_mx_facturae/wizard/wizard_create_facturae_file.py 2013-12-16 18:29:27 +0000 |
405 | @@ -49,8 +49,8 @@ |
406 | # end_fields = {} |
407 | |
408 | |
409 | -def _create_facturae_file(self, cr, uid, data, context={}): |
410 | - if not context: |
411 | +def _create_facturae_file(self, cr, uid, data, context=None): |
412 | + if context is None: |
413 | context = {} |
414 | context.update({'date': data['form']['date']}) |
415 | pool = pooler.get_pool(cr.dbname) |
416 | |
417 | === modified file 'l10n_mx_facturae/wizard/wizard_invoice_facturae_txt.py' |
418 | --- l10n_mx_facturae/wizard/wizard_invoice_facturae_txt.py 2013-05-10 16:24:03 +0000 |
419 | +++ l10n_mx_facturae/wizard/wizard_invoice_facturae_txt.py 2013-12-16 18:29:27 +0000 |
420 | @@ -82,8 +82,8 @@ |
421 | } |
422 | |
423 | |
424 | -def _create_facturae_txt(self, cr, uid, data, context={}): |
425 | - if not context: |
426 | +def _create_facturae_txt(self, cr, uid, data, context=None): |
427 | + if context is None: |
428 | context = {} |
429 | pool = pooler.get_pool(cr.dbname) |
430 | invoice_obj = pool.get('account.invoice') |
431 | @@ -129,8 +129,8 @@ |
432 | } |
433 | |
434 | |
435 | -def _get_invoices_month(self, cr, uid, data, context={}): |
436 | - if not context: |
437 | +def _get_invoices_month(self, cr, uid, data, context=None): |
438 | + if context is None: |
439 | context = {} |
440 | pool = pooler.get_pool(cr.dbname) |
441 | invoice_obj = pool.get('account.invoice') |
442 | @@ -168,9 +168,9 @@ |
443 | return {'invoice_ids': invoice_ids} |
444 | |
445 | |
446 | -def _get_invoices_date(self, cr, uid, data, context={}): |
447 | +def _get_invoices_date(self, cr, uid, data, context=None): |
448 | # invoice_ids.append(19) |
449 | - if not context: |
450 | + if context is None: |
451 | context = {} |
452 | pool = pooler.get_pool(cr.dbname) |
453 | invoice_obj = pool.get('account.invoice') |
454 | |
455 | === modified file 'l10n_mx_facturae/wizard/wizard_invoice_facturae_txt_v6.py' |
456 | --- l10n_mx_facturae/wizard/wizard_invoice_facturae_txt_v6.py 2013-05-10 16:24:03 +0000 |
457 | +++ l10n_mx_facturae/wizard/wizard_invoice_facturae_txt_v6.py 2013-12-16 18:29:27 +0000 |
458 | @@ -104,7 +104,7 @@ |
459 | invoice_ids = [] |
460 | data = self.read(cr, uid, ids, context=context)[0] |
461 | # invoice_ids.append(19) |
462 | - if not context: |
463 | + if context is None: |
464 | context = {} |
465 | invoice_obj = self.pool.get('account.invoice') |
466 | if data['invoice_ids']: |
467 | @@ -142,7 +142,7 @@ |
468 | def get_invoices_month(self, cr, uid, ids, context=None): |
469 | invoice_ids = [] |
470 | data = self.read(cr, uid, ids, context=context)[0] |
471 | - if not context: |
472 | + if context is None: |
473 | context = {} |
474 | invoice_obj = self.pool.get('account.invoice') |
475 | invoice_ids = data['invoice_ids'] |
476 | @@ -181,7 +181,7 @@ |
477 | def create_facturae_txt(self, cr, uid, ids, context=None): |
478 | obj_model = self.pool.get('ir.model.data') |
479 | data = self.read(cr, uid, ids, context=context)[0] |
480 | - if not context: |
481 | + if context is None: |
482 | context = {} |
483 | invoice_obj = self.pool.get('account.invoice') |
484 | invoice_ids = data['invoice_ids'] |
485 | |
486 | === modified file 'l10n_mx_facturae/wizard/wizard_invoice_facturae_xml.py' |
487 | --- l10n_mx_facturae/wizard/wizard_invoice_facturae_xml.py 2013-05-10 16:24:03 +0000 |
488 | +++ l10n_mx_facturae/wizard/wizard_invoice_facturae_xml.py 2013-12-16 18:29:27 +0000 |
489 | @@ -43,8 +43,8 @@ |
490 | } |
491 | |
492 | |
493 | -def _get_invoice_facturae_xml(self, cr, uid, data, context={}): |
494 | - if not context: |
495 | +def _get_invoice_facturae_xml(self, cr, uid, data, context=None): |
496 | + if context is None: |
497 | context = {} |
498 | # context.update( {'date': data['form']['date']} ) |
499 | pool = pooler.get_pool(cr.dbname) |
500 | |
501 | === modified file 'l10n_mx_facturae/wizard/wizard_invoice_facturae_xml_v6.py' |
502 | --- l10n_mx_facturae/wizard/wizard_invoice_facturae_xml_v6.py 2013-05-10 16:24:03 +0000 |
503 | +++ l10n_mx_facturae/wizard/wizard_invoice_facturae_xml_v6.py 2013-12-16 18:29:27 +0000 |
504 | @@ -61,7 +61,7 @@ |
505 | } |
506 | |
507 | def _get_invoice_facturae_xml(self, cr, uid, data, context=None): |
508 | - if not context: |
509 | + if context is None: |
510 | context = {} |
511 | invoice_obj = self.pool.get('account.invoice') |
512 | ids = data['active_ids'] |
513 | |
514 | === modified file 'l10n_mx_facturae_cbb/invoice.py' |
515 | --- l10n_mx_facturae_cbb/invoice.py 2013-05-10 17:00:10 +0000 |
516 | +++ l10n_mx_facturae_cbb/invoice.py 2013-12-16 18:29:27 +0000 |
517 | @@ -41,9 +41,8 @@ |
518 | class account_invoice(osv.Model): |
519 | _inherit = 'account.invoice' |
520 | |
521 | - def _get_fname_invoice(self, cr, uid, ids, field_names=None, arg=False, |
522 | - context={}): |
523 | - if not context: |
524 | + def _get_fname_invoice(self, cr, uid, ids, field_names=None, arg=False, context=None): |
525 | + if context is None: |
526 | context = {} |
527 | res = {} |
528 | sequence_obj = self.pool.get('ir.sequence') |
529 | @@ -87,7 +86,7 @@ |
530 | #'date_invoice': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), |
531 | } |
532 | |
533 | - def create_report(self, cr, uid, res_ids, report_name=False, file_name=False): |
534 | + def create_report(self, cr, uid, res_ids, report_name=False, file_name=False, context=None): |
535 | """ |
536 | @param report_name : Name of report with the name of object more type |
537 | of report |
538 | @@ -95,6 +94,8 @@ |
539 | name of report that is 'openerp___facturae__' more six random |
540 | characters for no files duplicate |
541 | """ |
542 | + if context is None: |
543 | + context = {} |
544 | if not report_name or not res_ids: |
545 | return (False, Exception('Report name and Resources ids are required !!!')) |
546 | # try: |
547 | @@ -109,11 +110,10 @@ |
548 | # return (False,str(e)) |
549 | return (True, ret_file_name) |
550 | |
551 | - def create_report_pdf(self, cr, uid, ids, context={}): |
552 | - if not context: |
553 | + def create_report_pdf(self, cr, uid, ids, context=None): |
554 | + if context is None: |
555 | context = {} |
556 | - id = ids[0] |
557 | - |
558 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
559 | (fileno, fname) = tempfile.mkstemp( |
560 | '.pdf', 'openerp_' + (False or '') + '__facturae__') |
561 | os.close(fileno) |
562 | |
563 | === modified file 'l10n_mx_facturae_cbb/ir_attachment_facturae.py' |
564 | --- l10n_mx_facturae_cbb/ir_attachment_facturae.py 2013-05-10 17:00:10 +0000 |
565 | +++ l10n_mx_facturae_cbb/ir_attachment_facturae.py 2013-12-16 18:29:27 +0000 |
566 | @@ -32,6 +32,8 @@ |
567 | _inherit = 'ir.attachment.facturae.mx' |
568 | |
569 | def _get_type(self, cr, uid, ids=None, context=None): |
570 | + if context is None: |
571 | + context = {} |
572 | types = super(ir_attachment_facturae_mx, self)._get_type( |
573 | cr, uid, ids, context=context) |
574 | types.extend([ |
575 | |
576 | === modified file 'l10n_mx_facturae_cbb/ir_sequence_approval.py' |
577 | --- l10n_mx_facturae_cbb/ir_sequence_approval.py 2013-05-10 17:00:10 +0000 |
578 | +++ l10n_mx_facturae_cbb/ir_sequence_approval.py 2013-12-16 18:29:27 +0000 |
579 | @@ -32,6 +32,8 @@ |
580 | _inherit = 'ir.sequence.approval' |
581 | |
582 | def _get_type(self, cr, uid, ids=None, context=None): |
583 | + if context is None: |
584 | + context = {} |
585 | types = super(ir_sequence_approval, self)._get_type( |
586 | cr, uid, ids, context=context) |
587 | types.extend([ |
588 | |
589 | === modified file 'l10n_mx_facturae_cer/invoice.py' |
590 | --- l10n_mx_facturae_cer/invoice.py 2013-05-10 17:27:23 +0000 |
591 | +++ l10n_mx_facturae_cer/invoice.py 2013-12-16 18:29:27 +0000 |
592 | @@ -33,9 +33,8 @@ |
593 | class account_invoice(osv.Model): |
594 | _inherit = 'account.invoice' |
595 | |
596 | - def _get_invoice_certificate(self, cr, uid, ids, field_names=None, |
597 | - arg=False, context={}): |
598 | - if not context: |
599 | + def _get_invoice_certificate(self, cr, uid, ids, field_names=None, arg=False, context=None): |
600 | + if context is None: |
601 | context = {} |
602 | company_obj = self.pool.get('res.company') |
603 | certificate_obj = self.pool.get('res.company.facturae.certificate') |
604 | |
605 | === modified file 'l10n_mx_facturae_cer/res_company.py' |
606 | --- l10n_mx_facturae_cer/res_company.py 2013-12-04 17:13:45 +0000 |
607 | +++ l10n_mx_facturae_cer/res_company.py 2013-12-16 18:29:27 +0000 |
608 | @@ -85,6 +85,9 @@ |
609 | } |
610 | |
611 | def get_certificate_info(self, cr, uid, ids, context=None): |
612 | + if context is None: |
613 | + context = {} |
614 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
615 | certificate = self.browse(cr, uid, ids, context=context)[0] |
616 | cer_der_b64str = certificate.certificate_file |
617 | key_der_b64str = certificate.certificate_key_file |
618 | @@ -133,6 +136,7 @@ |
619 | fname_key_der, fname_tmp, fname_password, type_der='key') |
620 | key_pem_b64 = base64.encodestring(key_pem) |
621 | |
622 | + # date_fmt_return='%Y-%m-%d %H:%M:%S' |
623 | date_fmt_return = '%Y-%m-%d' |
624 | serial = False |
625 | try: |
626 | @@ -221,8 +225,9 @@ |
627 | class res_company(osv.Model): |
628 | _inherit = 'res.company' |
629 | |
630 | - def ____get_current_certificate(self, cr, uid, ids, field_names=None, |
631 | - arg=False, context={}): |
632 | + def ____get_current_certificate(self, cr, uid, ids, field_names=None, arg=False, context=None): |
633 | + if context is None: |
634 | + context = {} |
635 | if not field_names: |
636 | field_names = [] |
637 | res = {} |
638 | @@ -250,9 +255,8 @@ |
639 | res[company.id][f] = certificate_id |
640 | return res |
641 | |
642 | - def _get_current_certificate(self, cr, uid, ids, field_names=False, |
643 | - arg=False, context={}): |
644 | - if not context: |
645 | + def _get_current_certificate(self, cr, uid, ids, field_names=False, arg=False, context=None): |
646 | + if context is None: |
647 | context = {} |
648 | res = {}.fromkeys(ids, False) |
649 | certificate_obj = self.pool.get('res.company.facturae.certificate') |
650 | @@ -280,7 +284,7 @@ |
651 | return res |
652 | |
653 | """ |
654 | - def copy(self, cr, uid, id, default={}, context={}, done_list=[], local=False): |
655 | + def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False): |
656 | if not default: |
657 | default = {} |
658 | default = default.copy() |
659 | |
660 | === modified file 'l10n_mx_facturae_pac/invoice.py' |
661 | --- l10n_mx_facturae_pac/invoice.py 2013-11-08 23:34:19 +0000 |
662 | +++ l10n_mx_facturae_pac/invoice.py 2013-12-16 18:29:27 +0000 |
663 | @@ -44,7 +44,10 @@ |
664 | class account_invoice(osv.Model): |
665 | _inherit = 'account.invoice' |
666 | |
667 | - def _get_facturae_invoice_dict_data(self, cr, uid, ids, context={}): |
668 | + def _get_facturae_invoice_dict_data(self, cr, uid, ids, context=None): |
669 | + if context is None: |
670 | + context = {} |
671 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
672 | datas = super(account_invoice, self)._get_facturae_invoice_dict_data( |
673 | cr, uid, ids, context=context) |
674 | ir_seq_app_obj = self.pool.get('ir.sequence.approval') |
675 | @@ -103,9 +106,10 @@ |
676 | data.update(dict({'cfdi:Comprobante': dict_comprobante})) |
677 | return datas |
678 | |
679 | - def _get_facturae_invoice_xml_data(self, cr, uid, ids, context={}): |
680 | - if not context: |
681 | + def _get_facturae_invoice_xml_data(self, cr, uid, ids, context=None): |
682 | + if context is None: |
683 | context = {} |
684 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
685 | ir_seq_app_obj = self.pool.get('ir.sequence.approval') |
686 | invoice = self.browse(cr, uid, ids[0], context=context) |
687 | sequence_app_id = ir_seq_app_obj.search(cr, uid, [( |
688 | |
689 | === modified file 'l10n_mx_facturae_pac_sf/invoice.py' |
690 | --- l10n_mx_facturae_pac_sf/invoice.py 2013-08-25 09:18:53 +0000 |
691 | +++ l10n_mx_facturae_pac_sf/invoice.py 2013-12-16 18:29:27 +0000 |
692 | @@ -69,12 +69,13 @@ |
693 | help='Folio used in the electronic invoice'), |
694 | } |
695 | |
696 | - def cfdi_data_write(self, cr, uid, ids, cfdi_data, context={}): |
697 | + def cfdi_data_write(self, cr, uid, ids, cfdi_data, context=None): |
698 | """ |
699 | @params cfdi_data : * TODO |
700 | """ |
701 | - if not context: |
702 | + if context is None: |
703 | context = {} |
704 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
705 | attachment_obj = self.pool.get('ir.attachment') |
706 | cfdi_xml = cfdi_data.pop('cfdi_xml') |
707 | if cfdi_xml: |
708 | @@ -134,11 +135,11 @@ |
709 | return super(account_invoice, self).action_cancel_draft(cr, uid, ids, args) |
710 | """ |
711 | |
712 | - def _get_file(self, cr, uid, inv_ids, context={}): |
713 | - if not context: |
714 | + def _get_file(self, cr, uid, inv_ids, context=None): |
715 | + if context is None: |
716 | context = {} |
717 | - id = inv_ids[0] |
718 | - invoice = self.browse(cr, uid, [id], context=context)[0] |
719 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
720 | + invoice = self.browse(cr, uid, ids, context=context)[0] |
721 | fname_invoice = invoice.fname_invoice and invoice.fname_invoice + \ |
722 | '.xml' or '' |
723 | aids = self.pool.get('ir.attachment').search(cr, uid, [( |
724 | @@ -190,11 +191,13 @@ |
725 | parent_node.appendChild(new_node) |
726 | return new_node |
727 | |
728 | - def add_addenta_xml(self, cr, ids, xml_res_str=None, comprobante=None, context={}): |
729 | + def add_addenta_xml(self, cr, ids, xml_res_str=None, comprobante=None, context=None): |
730 | """ |
731 | @params xml_res_str : File XML |
732 | @params comprobante : Name to the Node that contain the information the XML |
733 | """ |
734 | + if context is None: |
735 | + context = {} |
736 | if xml_res_str: |
737 | node_Addenda = xml_res_str.getElementsByTagName('cfdi:Addenda') |
738 | if len(node_Addenda) == 0: |
739 | @@ -230,6 +233,8 @@ |
740 | return xml_res_str |
741 | |
742 | def _get_type_sequence(self, cr, uid, ids, context=None): |
743 | + if context is None: |
744 | + context = {} |
745 | ir_seq_app_obj = self.pool.get('ir.sequence.approval') |
746 | invoice = self.browse(cr, uid, ids[0], context=context) |
747 | sequence_app_id = ir_seq_app_obj.search(cr, uid, [( |
748 | @@ -245,6 +250,8 @@ |
749 | return comprobante |
750 | |
751 | def _get_time_zone(self, cr, uid, invoice_id, context=None): |
752 | + if context is None: |
753 | + context = {} |
754 | res_users_obj = self.pool.get('res.users') |
755 | userstz = res_users_obj.browse(cr, uid, [uid])[0].partner_id.tz |
756 | a = 0 |
757 | @@ -264,7 +271,9 @@ |
758 | timezone_present + timezone_original)*-1) |
759 | return a |
760 | |
761 | - def _get_file_cancel(self, cr, uid, inv_ids, context={}): |
762 | + def _get_file_cancel(self, cr, uid, inv_ids, context=None): |
763 | + if context is None: |
764 | + context = {} |
765 | inv_ids = inv_ids[0] |
766 | atta_obj = self.pool.get('ir.attachment') |
767 | atta_id = atta_obj.search(cr, uid, [('res_id', '=', inv_ids), ( |
768 | @@ -279,16 +288,18 @@ |
769 | "This invoice hasn't stamped, so that not possible cancel.")) |
770 | return {'file': inv_xml} |
771 | |
772 | - def write_cfd_data(self, cr, uid, ids, cfd_datas, context={}): |
773 | + def write_cfd_data(self, cr, uid, ids, cfd_datas, context=None): |
774 | """ |
775 | @param cfd_datas : Dictionary with data that is used in facturae CFDI |
776 | """ |
777 | + if context is None: |
778 | + context = {} |
779 | if not cfd_datas: |
780 | cfd_datas = {} |
781 | comprobante = self._get_type_sequence(cr, uid, ids, context=context) |
782 | # obtener cfd_data con varios ids |
783 | # for id in ids: |
784 | - id = ids[0] |
785 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
786 | if True: |
787 | data = {} |
788 | cfd_data = cfd_datas |
789 | @@ -303,5 +314,5 @@ |
790 | 'sello': sello, |
791 | 'cadena_original': cadena_original, |
792 | } |
793 | - self.write(cr, uid, [id], data, context=context) |
794 | + self.write(cr, uid, ids, data, context=context) |
795 | return True |
796 | |
797 | === modified file 'l10n_mx_facturae_pac_sf/ir_attachment_facturae.py' |
798 | --- l10n_mx_facturae_pac_sf/ir_attachment_facturae.py 2013-12-03 00:41:19 +0000 |
799 | +++ l10n_mx_facturae_pac_sf/ir_attachment_facturae.py 2013-12-16 18:29:27 +0000 |
800 | @@ -59,6 +59,8 @@ |
801 | _inherit = 'ir.attachment.facturae.mx' |
802 | |
803 | def _get_type(self, cr, uid, ids=None, context=None): |
804 | + if context is None: |
805 | + context = {} |
806 | types = super(ir_attachment_facturae_mx, self)._get_type( |
807 | cr, uid, ids, context=context) |
808 | types.extend([ |
809 | @@ -86,6 +88,8 @@ |
810 | } |
811 | |
812 | def sf_cancel(self, cr, uid, ids, context=None): |
813 | + if context is None: |
814 | + context = {} |
815 | msg = '' |
816 | certificate_obj = self.pool.get('res.company.facturae.certificate') |
817 | pac_params_obj = self.pool.get('params.pac') |
818 | @@ -155,10 +159,12 @@ |
819 | msg = _('Not found information of webservices of PAC, verify that the configuration of PAC is correct') |
820 | return {'message': msg, 'status_uuid': status_uuid, 'status': status} |
821 | |
822 | - def _upload_ws_file(self, cr, uid, ids, fdata=None, context={}): |
823 | + def _upload_ws_file(self, cr, uid, ids, fdata=None, context=None): |
824 | """ |
825 | @params fdata : File.xml codification in base64 |
826 | """ |
827 | + if context is None: |
828 | + context = {} |
829 | invoice_obj = self.pool.get('account.invoice') |
830 | pac_params_obj = invoice_obj.pool.get('params.pac') |
831 | for ir_attachment_facturae_mx_id in self.browse(cr, uid, ids, context=context): |
832 | |
833 | === modified file 'l10n_mx_facturae_pac_sf/wizard/wizard_cancel_invoice_pac_sf_v6.py' |
834 | --- l10n_mx_facturae_pac_sf/wizard/wizard_cancel_invoice_pac_sf_v6.py 2013-05-30 21:28:32 +0000 |
835 | +++ l10n_mx_facturae_pac_sf/wizard/wizard_cancel_invoice_pac_sf_v6.py 2013-12-16 18:29:27 +0000 |
836 | @@ -51,16 +51,20 @@ |
837 | class wizard_cancel_invoice_pac_sf(osv.TransientModel): |
838 | _name = 'wizard.cancel.invoice.pac.sf' |
839 | |
840 | - def _get_cancel_invoice_id(self, cr, uid, data, context={}): |
841 | + def _get_cancel_invoice_id(self, cr, uid, data, context=None): |
842 | """ |
843 | @params data : Dictionary with information of the user, and active ids |
844 | """ |
845 | + if context is None: |
846 | + context = {} |
847 | res = {} |
848 | invoice_obj = self.pool.get('account.invoice') |
849 | res = invoice_obj._get_file_cancel(cr, uid, data['active_ids']) |
850 | return res['file'] |
851 | |
852 | - def upload_cancel_to_pac(self, cr, uid, ids, context={}): |
853 | + def upload_cancel_to_pac(self, cr, uid, ids, context=None): |
854 | + if context is None: |
855 | + context = {} |
856 | res = {} |
857 | invoice_obj = self.pool.get('account.invoice') |
858 | res = invoice_obj.sf_cancel(cr, uid, context[ |
859 | |
860 | === modified file 'l10n_mx_facturae_pac_sf/wizard/wizard_export_invoice_pac_sf_v6.py' |
861 | --- l10n_mx_facturae_pac_sf/wizard/wizard_export_invoice_pac_sf_v6.py 2013-05-15 16:09:43 +0000 |
862 | +++ l10n_mx_facturae_pac_sf/wizard/wizard_export_invoice_pac_sf_v6.py 2013-12-16 18:29:27 +0000 |
863 | @@ -47,17 +47,21 @@ |
864 | class wizard_export_invoice_pac_sf_v6(osv.TransientModel): |
865 | _name = 'wizard.export.invoice.pac.sf.v6' |
866 | |
867 | - def _get_invoice_id(self, cr, uid, data, context={}): |
868 | + def _get_invoice_id(self, cr, uid, data, context=None): |
869 | """ |
870 | @params data : Dictionary with information of the user, and active ids |
871 | """ |
872 | + if context is None: |
873 | + context = {} |
874 | res = {} |
875 | invoice_obj = self.pool.get('account.invoice') |
876 | res = invoice_obj._get_file(cr, uid, data['active_ids']) |
877 | file_xml = res['file'] |
878 | return file_xml |
879 | |
880 | - def upload_to_pac(self, cr, uid, ids, context={}): |
881 | + def upload_to_pac(self, cr, uid, ids, context=None): |
882 | + if context is None: |
883 | + context = {} |
884 | res = {} |
885 | invoice_obj = self.pool.get('account.invoice') |
886 | res = invoice_obj._upload_ws_file(cr, uid, context['active_ids']) |
887 | |
888 | === modified file 'l10n_mx_facturae_report/report/invoice_facturae_html.py' |
889 | --- l10n_mx_facturae_report/report/invoice_facturae_html.py 2013-12-02 23:02:06 +0000 |
890 | +++ l10n_mx_facturae_report/report/invoice_facturae_html.py 2013-12-16 18:29:27 +0000 |
891 | @@ -37,7 +37,9 @@ |
892 | import datetime |
893 | |
894 | class invoice_facturae_html(report_sxw.rml_parse): |
895 | - def __init__(self, cr, uid, name, context): |
896 | + def __init__(self, cr, uid, name, context=None): |
897 | + if context is None: |
898 | + context = {} |
899 | super(invoice_facturae_html, self).__init__( |
900 | cr, uid, name, context=context) |
901 | self.localcontext.update({ |
902 | @@ -46,6 +48,8 @@ |
903 | 'split_string': self._split_string, |
904 | 'company_address': self._company_address, |
905 | 'subcompany_address': self._subcompany_address, |
906 | + 'get_invoice_sequence': self._get_invoice_sequence, |
907 | + 'get_approval': self._get_approval, |
908 | 'get_taxes': self._get_taxes, |
909 | 'get_taxes_ret': self._get_taxes_ret, |
910 | 'float': float, |
911 | @@ -53,6 +57,7 @@ |
912 | 'get_data_partner': self._get_data_partner, |
913 | 'get_sum_total': self._get_sum_total, |
914 | 'has_disc': self._has_disc, |
915 | + 'get_data_certificate': self._get_data_certificate, |
916 | 'get_text_promissory' : self._get_text_promissory, |
917 | }) |
918 | self.taxes = [] |
919 | @@ -81,8 +86,35 @@ |
920 | except Exception, e: |
921 | print "exception: %s" % (e) |
922 | pass |
923 | + try: |
924 | + self._get_data_certificate(o.id) |
925 | + except Exception, e: |
926 | + print "exception: %s" % (e) |
927 | + pass |
928 | return "" |
929 | |
930 | + def _get_approval(self): |
931 | + return self.approval |
932 | + |
933 | + def _get_invoice_sequence(self): |
934 | + return self.sequence |
935 | + |
936 | + def _set_invoice_sequence_and_approval(self, invoice_id): |
937 | + context = {} |
938 | + pool = pooler.get_pool(self.cr.dbname) |
939 | + invoice_obj = pool.get('account.invoice') |
940 | + sequence_obj = pool.get('ir.sequence') |
941 | + invoice = invoice_obj.browse(self.cr, self.uid, [ |
942 | + invoice_id], context=context)[0] |
943 | + context.update({'number_work': invoice.number}) |
944 | + sequence = invoice.invoice_sequence_id or False |
945 | + sequence_id = sequence and sequence.id or False |
946 | + self.sequence = sequence |
947 | + approval = sequence and sequence.approval_id or False |
948 | + approval_id = approval and approval.id or False |
949 | + self.approval = approval |
950 | + return sequence, approval |
951 | + |
952 | def _get_taxes(self): |
953 | return self.taxes |
954 | |
955 | @@ -133,6 +165,7 @@ |
956 | return self.invoice_data_dict |
957 | |
958 | def _get_facturae_data_dict(self, invoice): |
959 | + self._set_invoice_sequence_and_approval(invoice.id) |
960 | self.taxes = [ |
961 | tax for tax in invoice.tax_line if tax.tax_percent >= 0.0] |
962 | self.taxes_ret = [ |
963 | @@ -190,6 +223,24 @@ |
964 | break |
965 | return discount |
966 | |
967 | + def _get_data_certificate(self, invoice_id): |
968 | + pool = pooler.get_pool(self.cr.dbname) |
969 | + invoice_obj = pool.get('account.invoice') |
970 | + pac_params_obj = self.pool.get('params.pac') |
971 | + res={} |
972 | + invoice = invoice_obj.browse(self.cr, self.uid, invoice_id) |
973 | + pac_params_ids = pac_params_obj.search(self.cr, self.uid, [ |
974 | + ('method_type', '=', 'pac_sf_firmar'), |
975 | + ('company_id', '=', invoice.company_id.id), |
976 | + ('active', '=', True)], limit=1) |
977 | + pac_params_id = pac_params_ids and pac_params_ids[0] or False |
978 | + if pac_params_id: |
979 | + data_pac = pac_params_obj.browse(self.cr, self.uid, pac_params_id) |
980 | + res.update({ |
981 | + 'certificate_link' : data_pac.certificate_link or False, |
982 | + }) |
983 | + return res |
984 | + |
985 | def _get_text_promissory(self, company, partner, address_emitter, invoice): |
986 | text = '' |
987 | context = {} |
988 | |
989 | === modified file 'l10n_mx_facturae_seq/invoice.py' |
990 | --- l10n_mx_facturae_seq/invoice.py 2013-06-10 10:26:14 +0000 |
991 | +++ l10n_mx_facturae_seq/invoice.py 2013-12-16 18:29:27 +0000 |
992 | @@ -33,9 +33,8 @@ |
993 | class account_invoice(osv.Model): |
994 | _inherit = 'account.invoice' |
995 | |
996 | - def _get_invoice_sequence(self, cr, uid, ids, field_names=None, |
997 | - arg=False, context={}): |
998 | - if not context: |
999 | + def _get_invoice_sequence(self, cr, uid, ids, field_names=None, arg=False, context=None): |
1000 | + if context is None: |
1001 | context = {} |
1002 | res = {} |
1003 | for invoice in self.browse(cr, SUPERUSER_ID, ids): |
1004 | |
1005 | === modified file 'l10n_mx_facturae_seq/ir_sequence.py' |
1006 | --- l10n_mx_facturae_seq/ir_sequence.py 2013-09-09 16:39:45 +0000 |
1007 | +++ l10n_mx_facturae_seq/ir_sequence.py 2013-12-16 18:29:27 +0000 |
1008 | @@ -36,6 +36,8 @@ |
1009 | _rec_name = 'approval_number' |
1010 | |
1011 | def _get_type(self, cr, uid, ids=None, context=None): |
1012 | + if context is None: |
1013 | + context = {} |
1014 | types = [] |
1015 | return types |
1016 | |
1017 | @@ -76,6 +78,8 @@ |
1018 | ] |
1019 | |
1020 | def _check_numbers_range(self, cr, uid, ids, context=None): |
1021 | + if context is None: |
1022 | + context = {} |
1023 | approval = self.browse(cr, uid, ids[0], context=context) |
1024 | query = """SELECT approval_1.id AS id1, approval_2.id AS id2--\ |
1025 | approval_1.number_start, approval_1.number_end, approval_2.\ |
1026 | @@ -108,16 +112,17 @@ |
1027 | class ir_sequence(osv.Model): |
1028 | _inherit = 'ir.sequence' |
1029 | |
1030 | - def copy(self, cr, uid, id, default={}, context={}, done_list=[], local=False): |
1031 | + def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False): |
1032 | + if context is None: |
1033 | + context = {} |
1034 | if not default: |
1035 | default = {} |
1036 | default = default.copy() |
1037 | default['approval_ids'] = False |
1038 | return super(ir_sequence, self).copy(cr, uid, id, default, context=context) |
1039 | |
1040 | - def _get_current_approval(self, cr, uid, ids, field_names=None, arg=False, |
1041 | - context={}): |
1042 | - if not context: |
1043 | + def _get_current_approval(self, cr, uid, ids, field_names=None, arg=False, context=None): |
1044 | + if context is None: |
1045 | context = {} |
1046 | res = {} |
1047 | for id in ids: |
1048 | @@ -146,7 +151,9 @@ |
1049 | # s'expiring' |
1050 | } |
1051 | |
1052 | - def _check_sequence_number_diff(self, cr, uid, ids, context={}): |
1053 | + def _check_sequence_number_diff(self, cr, uid, ids, context=None): |
1054 | + if context is None: |
1055 | + context = {} |
1056 | # ahorita nadie manda a llamar esta funcion, ya que no existen los |
1057 | # warnings, como tal en OpenERP. |
1058 | sequence_number_diff_rate = 10 |
1059 | @@ -196,7 +203,7 @@ |
1060 | """ |
1061 | else: |
1062 | _validation_sequence_number_diff(self, cr, uid, ids, |
1063 | - context={}): |
1064 | + context=context): |
1065 | sequence_number_diff = sequence.approval_id.number_end \ |
1066 | - sequence.next_number |
1067 | if sequence_number_diff <= sequence_number_diff_rate: |
1068 | |
1069 | === modified file 'l10n_mx_import_info/import_info.py' |
1070 | --- l10n_mx_import_info/import_info.py 2013-05-15 16:56:26 +0000 |
1071 | +++ l10n_mx_import_info/import_info.py 2013-12-16 18:29:27 +0000 |
1072 | @@ -24,7 +24,9 @@ |
1073 | _description = "Information about customs" |
1074 | _order = 'name asc' |
1075 | |
1076 | - def _get_audit(self, cr, uid, ids, field_name, arg, context): |
1077 | + def _get_audit(self, cr, uid, ids, field_name, arg, context=None): |
1078 | + if context is None: |
1079 | + context = {} |
1080 | result = {} |
1081 | prod_obj = self.pool.get('product.product') |
1082 | for i in ids: |
1083 | |
1084 | === modified file 'l10n_mx_import_info/product.py' |
1085 | --- l10n_mx_import_info/product.py 2013-05-15 16:56:26 +0000 |
1086 | +++ l10n_mx_import_info/product.py 2013-12-16 18:29:27 +0000 |
1087 | @@ -29,10 +29,10 @@ |
1088 | _name = 'product.import.info' |
1089 | _rec_name = 'import_id' |
1090 | |
1091 | - def _get_qtymoved(self, cr, uid, ids, field_name, arg, context): |
1092 | + def _get_qtymoved(self, cr, uid, ids, field_name, arg, context=None): |
1093 | # TODO ISAAC: Metodo para calcular el la cantidad de movimientos ya imputados a esta import info. Analizar desde cero, no contemplar lo que este escrito aqui. |
1094 | # Recordar quitar los TODO. |
1095 | - if not context: |
1096 | + if context is None: |
1097 | context = {} |
1098 | ''' |
1099 | cr.execute(""" |
1100 | @@ -76,6 +76,8 @@ |
1101 | } |
1102 | |
1103 | def _check_uom(self, cr, uid, ids, context=None): |
1104 | + if context is None: |
1105 | + context = {} |
1106 | for import_info in self.browse(cr, uid, ids, context=context): |
1107 | if import_info.uom_id and import_info.uom_id.category_id.id != \ |
1108 | import_info.product_id.uom_po_id.category_id.id: |
1109 | @@ -99,6 +101,8 @@ |
1110 | |
1111 | @return: return a dict that contains new values, and context |
1112 | """ |
1113 | + if context is None: |
1114 | + context = {} |
1115 | res = {} |
1116 | if product_id: |
1117 | res = {'value': {'uom_id': self.pool.get('product.product').browse( |
1118 | @@ -112,7 +116,9 @@ |
1119 | """ |
1120 | _inherit = 'product.product' |
1121 | |
1122 | - def _has_import(self, cr, uid, ids, field_name, arg, context): |
1123 | + def _has_import(self, cr, uid, ids, field_name, arg, context=None): |
1124 | + if context is None: |
1125 | + context = {} |
1126 | result = {} |
1127 | for i in ids: |
1128 | if len(self.browse(cr, uid, [i], context)[0].import_info_ids) != 0: |
1129 | |
1130 | === modified file 'l10n_mx_import_info/stock.py' |
1131 | --- l10n_mx_import_info/stock.py 2013-08-05 06:39:25 +0000 |
1132 | +++ l10n_mx_import_info/stock.py 2013-12-16 18:29:27 +0000 |
1133 | @@ -31,6 +31,9 @@ |
1134 | } |
1135 | |
1136 | def name_get(self, cr, uid, ids, context=None): |
1137 | + if context is None: |
1138 | + context = {} |
1139 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
1140 | if not len(ids): |
1141 | return [] |
1142 | # Avoiding use 000 in show name. |
1143 | @@ -55,6 +58,8 @@ |
1144 | # product_qty_p=[{'product_id':p.product_id.id,'qty':p.qty,'uom_id':p.uom_id.id} |
1145 | # for p in move.tracking_id.import_id.product_info_ids if |
1146 | # p.product_id.id==move.product_id.id] |
1147 | + if context is None: |
1148 | + context = {} |
1149 | product_import_info_obj = self.pool.get('product.import.info') |
1150 | product_uom_obj = self.pool.get('product.uom') |
1151 | for move in self.browse(cr, uid, ids, context=context): |
1152 | @@ -100,6 +105,8 @@ |
1153 | # print "move.state",move.state |
1154 | # print "import_id",import_id |
1155 | # print "move.product_id.pack_control",move.product_id.pack_control |
1156 | + if context is None: |
1157 | + context = {} |
1158 | if move.state != 'done': |
1159 | # purchase o sale, generate a stock.move with state confirmed or |
1160 | # draft, then not validate with these states. |
1161 | @@ -132,6 +139,8 @@ |
1162 | @param context: context arguments, like lang, time zone |
1163 | @return: return a dict that contains new values, and context |
1164 | """ |
1165 | + if context is None: |
1166 | + context = {} |
1167 | return { |
1168 | 'value': {}, |
1169 | 'context': {}, |
1170 | @@ -141,6 +150,8 @@ |
1171 | """ Checks track lot with import information is assigned to stock move or not. |
1172 | @return: True or False |
1173 | """ |
1174 | + if context is None: |
1175 | + context = {} |
1176 | for move in self.browse(cr, uid, ids, context=context): |
1177 | # Check if i need to verify the track for import info. |
1178 | ex = True |
1179 | @@ -173,6 +184,8 @@ |
1180 | |
1181 | def _prepare_invoice_line(self, cr, uid, group, picking, move_line, invoice_id, |
1182 | invoice_vals, context=None): |
1183 | + if context is None: |
1184 | + context = {} |
1185 | invoice_line_data = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id, |
1186 | invoice_vals, context=context) |
1187 | invoice_line_data.update({ |
1188 | |
1189 | === modified file 'l10n_mx_invoice_amount_to_text/invoice.py' |
1190 | --- l10n_mx_invoice_amount_to_text/invoice.py 2013-05-15 17:02:24 +0000 |
1191 | +++ l10n_mx_invoice_amount_to_text/invoice.py 2013-12-16 18:29:27 +0000 |
1192 | @@ -36,9 +36,8 @@ |
1193 | class account_invoice(osv.Model): |
1194 | _inherit = 'account.invoice' |
1195 | |
1196 | - def _get_amount_to_text(self, cr, uid, ids, field_names=None, arg=False, |
1197 | - context={}): |
1198 | - if not context: |
1199 | + def _get_amount_to_text(self, cr, uid, ids, field_names=None, arg=False, context=None): |
1200 | + if context is None: |
1201 | context = {} |
1202 | res = {} |
1203 | for invoice in self.browse(cr, uid, ids, context=context): |
1204 | |
1205 | === modified file 'l10n_mx_invoice_datetime/invoice.py' |
1206 | --- l10n_mx_invoice_datetime/invoice.py 2013-10-01 22:22:41 +0000 |
1207 | +++ l10n_mx_invoice_datetime/invoice.py 2013-12-16 18:29:27 +0000 |
1208 | @@ -42,7 +42,9 @@ |
1209 | class account_payment_term(osv.Model): |
1210 | _inherit = "account.payment.term" |
1211 | |
1212 | - def compute(self, cr, uid, id, value, date_ref=False, context={}): |
1213 | + def compute(self, cr, uid, id, value, date_ref=False, context=None): |
1214 | + if context is None: |
1215 | + context = {} |
1216 | if date_ref: |
1217 | try: |
1218 | date_ref = time.strftime('%Y-%m-%d', time.strptime( |
1219 | @@ -57,9 +59,8 @@ |
1220 | _inherit = 'account.invoice' |
1221 | #_order = 'invoice_datetime asc' |
1222 | |
1223 | - def _get_date_invoice_tz(self, cr, uid, ids, field_names=None, arg=False, |
1224 | - context={}): |
1225 | - if not context: |
1226 | + def _get_date_invoice_tz(self, cr, uid, ids, field_names=None, arg=False, context=None): |
1227 | + if context is None: |
1228 | context = {} |
1229 | res = {} |
1230 | if release.version >= '6': |
1231 | @@ -95,6 +96,8 @@ |
1232 | } |
1233 | |
1234 | def create(self, cr, uid, vals, context=None): |
1235 | + if context is None: |
1236 | + context = {} |
1237 | res = self.assigned_datetime(cr, uid, vals, context=context) |
1238 | if res: |
1239 | vals.update(res) |
1240 | @@ -116,12 +119,16 @@ |
1241 | context=context) |
1242 | |
1243 | def copy(self, cr, uid, id, default=None, context=None): |
1244 | + if context is None: |
1245 | + context = {} |
1246 | if default is None: |
1247 | default = {} |
1248 | default.update({'invoice_datetime': False, 'date_invoice' : False}) |
1249 | return super(account_invoice, self).copy(cr, uid, id, default, context) |
1250 | |
1251 | def _get_time_zone(self, cr, uid, invoice_id, context=None): |
1252 | + if context is None: |
1253 | + context = {} |
1254 | res_users_obj = self.pool.get('res.users') |
1255 | userstz = res_users_obj.browse(cr, uid, [uid])[0].partner_id.tz |
1256 | a = 0 |
1257 | |
1258 | === modified file 'l10n_mx_invoice_discount/invoice.py' |
1259 | --- l10n_mx_invoice_discount/invoice.py 2013-08-25 08:49:13 +0000 |
1260 | +++ l10n_mx_invoice_discount/invoice.py 2013-12-16 18:29:27 +0000 |
1261 | @@ -45,7 +45,9 @@ |
1262 | class account_invoice(osv.Model): |
1263 | _inherit = 'account.invoice' |
1264 | |
1265 | - def _get_facturae_invoice_dict_data(self, cr, uid, ids, context={}): |
1266 | + def _get_facturae_invoice_dict_data(self, cr, uid, ids, context=None): |
1267 | + if context is None: |
1268 | + context = {} |
1269 | invoice_data_parents = super(account_invoice, self).\ |
1270 | _get_facturae_invoice_dict_data(cr, uid, ids, context) |
1271 | invoice = self.browse(cr, uid, ids)[0] |
1272 | @@ -94,6 +96,8 @@ |
1273 | cr, uid, inv, compute_taxes, ait_obj) |
1274 | |
1275 | def button_reset_taxes(self, cr, uid, ids, context=None): |
1276 | + if context is None: |
1277 | + context = {} |
1278 | invoice = self.browse(cr, uid, ids)[0] |
1279 | invoice_line_obj = self.pool.get('account.invoice.line') |
1280 | sub_tot = 0 |
1281 | |
1282 | === modified file 'l10n_mx_invoice_ftp/wizard/wizard_facturae_ftp.py' |
1283 | --- l10n_mx_invoice_ftp/wizard/wizard_facturae_ftp.py 2013-05-15 17:30:14 +0000 |
1284 | +++ l10n_mx_invoice_ftp/wizard/wizard_facturae_ftp.py 2013-12-16 18:29:27 +0000 |
1285 | @@ -43,13 +43,18 @@ |
1286 | _name = 'wizard.facturae.ftp' |
1287 | |
1288 | def invoice_ftp(self, cr, uid, ids, context=None): |
1289 | + if context is None: |
1290 | + context = {} |
1291 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
1292 | ftp_id = False |
1293 | data = self.read(cr, uid, ids)[0] |
1294 | atta_obj = self.pool.get('ir.attachment') |
1295 | atta_obj.file_ftp(cr, uid, data['files'], context=context) |
1296 | return {} |
1297 | |
1298 | - def _get_files(self, cr, uid, context): |
1299 | + def _get_files(self, cr, uid, context=None): |
1300 | + if context is None: |
1301 | + context = {} |
1302 | atta_obj = self.pool.get('ir.attachment') |
1303 | atta_ids = atta_obj.search(cr, uid, [('res_id', 'in', context[ |
1304 | 'active_ids']), ('res_model', '=', context['active_model'])], |
1305 | |
1306 | === modified file 'l10n_mx_ir_attachment_facturae/invoice.py' |
1307 | --- l10n_mx_ir_attachment_facturae/invoice.py 2013-09-25 21:19:59 +0000 |
1308 | +++ l10n_mx_ir_attachment_facturae/invoice.py 2013-12-16 18:29:27 +0000 |
1309 | @@ -32,6 +32,9 @@ |
1310 | _inherit = 'account.invoice' |
1311 | |
1312 | def action_cancel(self, cr, uid, ids, context=None): |
1313 | + if context is None: |
1314 | + context = {} |
1315 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
1316 | ir_attach_facturae_mx_obj = self.pool.get('ir.attachment.facturae.mx') |
1317 | inv_type_facturae = { |
1318 | 'out_invoice': True, |
1319 | @@ -50,6 +53,8 @@ |
1320 | return res |
1321 | |
1322 | def create_ir_attachment_facturae(self, cr, uid, ids, context=None): |
1323 | + if context is None: |
1324 | + context = {} |
1325 | attach = '' |
1326 | ir_attach_obj = self.pool.get('ir.attachment.facturae.mx') |
1327 | mod_obj = self.pool.get('ir.model.data') |
1328 | |
1329 | === modified file 'l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py' |
1330 | --- l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py 2013-12-09 19:21:48 +0000 |
1331 | +++ l10n_mx_ir_attachment_facturae/ir_attachment_facturae.py 2013-12-16 18:29:27 +0000 |
1332 | @@ -41,6 +41,8 @@ |
1333 | _inherit = ['mail.thread', 'ir.needaction_mixin'] |
1334 | |
1335 | def _get_type(self, cr, uid, ids=None, context=None): |
1336 | + if context is None: |
1337 | + context = {} |
1338 | types = [] |
1339 | return types |
1340 | |
1341 | @@ -124,6 +126,9 @@ |
1342 | if msj: |
1343 | raise osv.except_osv(_('Warning'),_(msj)) |
1344 | try: |
1345 | + if context is None: |
1346 | + context = {} |
1347 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
1348 | invoice_obj = self.pool.get('account.invoice') |
1349 | attach = '' |
1350 | msj = '' |
1351 | @@ -186,12 +191,16 @@ |
1352 | return False |
1353 | |
1354 | def action_confirm(self, cr, uid, ids, context=None): |
1355 | + if context is None: |
1356 | + context = {} |
1357 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
1358 | return self.write(cr, uid, ids, {'state': 'confirmed'}, context=context) |
1359 | |
1360 | def signal_sign(self, cr, uid, ids, context=None): |
1361 | try: |
1362 | if context is None: |
1363 | context = {} |
1364 | + ids = isinstance(ids, (int, long)) and [ids] or ids |
1365 | invoice_obj = self.pool.get('account.invoice') |
1366 | attachment_obj = self.pool.get('ir.attachment') |
1367 | attach = '' |
1368 | |
1369 | === modified file 'l10n_mx_ir_attachment_facturae/res_config.py' |
1370 | --- l10n_mx_ir_attachment_facturae/res_config.py 2013-07-31 00:21:50 +0000 |
1371 | +++ l10n_mx_ir_attachment_facturae/res_config.py 2013-12-16 18:29:27 +0000 |
1372 | @@ -35,6 +35,8 @@ |
1373 | } |
1374 | |
1375 | def get_default_email_tmp_id(self, cr, uid, fields, context=None): |
1376 | + if context is None: |
1377 | + context = {} |
1378 | email_tmp_id = False |
1379 | cr.execute( |
1380 | """ select max(id) as email_tmp_id from l10n_mx_email_config_settings """) |
1381 | |
1382 | === modified file 'l10n_mx_params_pac/params_pac.py' |
1383 | --- l10n_mx_params_pac/params_pac.py 2013-06-10 00:32:36 +0000 |
1384 | +++ l10n_mx_params_pac/params_pac.py 2013-12-16 18:29:27 +0000 |
1385 | @@ -35,6 +35,8 @@ |
1386 | _name = 'params.pac' |
1387 | |
1388 | def _get_method_type_selection(self, cr, uid, context=None): |
1389 | + if context is None: |
1390 | + context = {} |
1391 | # From module of PAC inherit this function and add new methods |
1392 | types = [] |
1393 | return types |
1394 | |
1395 | === modified file 'l10n_mx_partner_address/partner_address.py' |
1396 | --- l10n_mx_partner_address/partner_address.py 2013-12-07 02:01:16 +0000 |
1397 | +++ l10n_mx_partner_address/partner_address.py 2013-12-16 18:29:27 +0000 |
1398 | @@ -61,7 +61,9 @@ |
1399 | id = ids and ids[0] or False |
1400 | return id |
1401 | |
1402 | - def fields_view_get_address(self, cr, uid, arch, context={}): |
1403 | + def fields_view_get_address(self, cr, uid, arch, context=None): |
1404 | + if context is None: |
1405 | + context = {} |
1406 | locality = _('Locality...') |
1407 | street = _('Street...') |
1408 | street2 = _('Colony...') |
1409 | |
1410 | === modified file 'l10n_mx_partner_address/res_company.py' |
1411 | --- l10n_mx_partner_address/res_company.py 2013-09-20 18:20:54 +0000 |
1412 | +++ l10n_mx_partner_address/res_company.py 2013-12-16 18:29:27 +0000 |
1413 | @@ -32,6 +32,8 @@ |
1414 | |
1415 | def _get_address_data(self, cr, uid, ids, field_names, arg, context=None): |
1416 | """ Read the 'address' functional fields. """ |
1417 | + if context is None: |
1418 | + context = {} |
1419 | result = {} |
1420 | part_obj = self.pool.get('res.partner') |
1421 | for company in self.browse(cr, uid, ids, context=context): |
1422 | @@ -46,6 +48,8 @@ |
1423 | |
1424 | def _set_address_data(self, cr, uid, company_id, name, value, arg, context=None): |
1425 | """ Write the 'address' functional fields. """ |
1426 | + if context is None: |
1427 | + context = {} |
1428 | company = self.browse(cr, uid, company_id, context=context) |
1429 | if company.partner_id: |
1430 | part_obj = self.pool.get('res.partner') |
1431 | |
1432 | === modified file 'l10n_mx_purchase_payment_method/purchase.py' |
1433 | --- l10n_mx_purchase_payment_method/purchase.py 2013-05-17 21:03:54 +0000 |
1434 | +++ l10n_mx_purchase_payment_method/purchase.py 2013-12-16 18:29:27 +0000 |
1435 | @@ -60,6 +60,8 @@ |
1436 | } |
1437 | |
1438 | def action_invoice_create(self, cr, uid, ids, context=None): |
1439 | + if context is None: |
1440 | + context = {} |
1441 | invoice_obj = self.pool.get('account.invoice') |
1442 | res = super(purchase_order, self).action_invoice_create( |
1443 | cr, uid, ids, context=context) |
1444 | |
1445 | === modified file 'l10n_mx_res_partner_bank/res_bank.py' |
1446 | --- l10n_mx_res_partner_bank/res_bank.py 2013-06-05 20:51:07 +0000 |
1447 | +++ l10n_mx_res_partner_bank/res_bank.py 2013-12-16 18:29:27 +0000 |
1448 | @@ -33,6 +33,8 @@ |
1449 | _inherit = 'res.partner.bank' |
1450 | |
1451 | def _get_take_digits(self, cr, uid, ids, field, args, context=None): |
1452 | + if context is None: |
1453 | + context = {} |
1454 | result = {} |
1455 | res = '' |
1456 | n = -1 |
1457 | |
1458 | === modified file 'l10n_mx_sale_payment_method/model/sale.py' |
1459 | --- l10n_mx_sale_payment_method/model/sale.py 2013-08-25 08:01:46 +0000 |
1460 | +++ l10n_mx_sale_payment_method/model/sale.py 2013-12-16 18:29:27 +0000 |
1461 | @@ -53,7 +53,8 @@ |
1462 | |
1463 | def _prepare_invoice(self, cr, uid, order, lines, context=None): |
1464 | '''Overwrite this method to send the payment term new to invoice ''' |
1465 | - |
1466 | + if context is None: |
1467 | + context = {} |
1468 | res = super(inherits_sale,self)._prepare_invoice(cr, uid, order, |
1469 | lines, context) |
1470 | res.update({'pay_method_id':order.pay_method_id and\ |
1471 | @@ -68,7 +69,8 @@ |
1472 | def onchange_partner_id(self, cr, uid, ids, part, context=None): |
1473 | |
1474 | '''Overwrite this method to set payment term new to sale order ''' |
1475 | - |
1476 | + if context is None: |
1477 | + context = {} |
1478 | res = super(inherits_sale,self).onchange_partner_id(cr, uid, ids, |
1479 | part, context) |
1480 | part = self.pool.get('res.partner').browse(cr, uid, part, context) |
1481 | |
1482 | === modified file 'l10n_mx_sale_payment_method/model/stock.py' |
1483 | --- l10n_mx_sale_payment_method/model/stock.py 2013-06-06 20:38:17 +0000 |
1484 | +++ l10n_mx_sale_payment_method/model/stock.py 2013-12-16 18:29:27 +0000 |
1485 | @@ -47,6 +47,8 @@ |
1486 | """ Builds the dict containing the values for the invoice with the new |
1487 | payment term fields |
1488 | """ |
1489 | + if context is None: |
1490 | + context = {} |
1491 | res = super(inherit_picking,self)._prepare_invoice(cr, uid, picking, |
1492 | partner, inv_type, |
1493 | journal_id, |
1494 | |
1495 | === modified file 'l10n_mx_upload_ftp/upload_ftp.py' |
1496 | --- l10n_mx_upload_ftp/upload_ftp.py 2013-05-17 21:08:06 +0000 |
1497 | +++ l10n_mx_upload_ftp/upload_ftp.py 2013-12-16 18:29:27 +0000 |
1498 | @@ -50,7 +50,9 @@ |
1499 | os.close(fileno) |
1500 | return fname |
1501 | |
1502 | - def file_ftp(self, cr, uid, ids, context={}): |
1503 | + def file_ftp(self, cr, uid, ids, context=None): |
1504 | + if context is None: |
1505 | + context = {} |
1506 | ftp_id = False |
1507 | ftp_obj = pooler.get_pool(cr.dbname).get('ftp.server') |
1508 | ftp_id = ftp_obj.search(cr, uid, [('name', '!=', False)], context=None) |
Carlos, todo pinta bien, sin embargo al ejecutar los siguientes rgrep:
rgrep "context={}" . --include=*.py
rgrep "if not context:" . --include=*.py
Siguen apareciendo líneas sin el guideline, nos puedes apoyar en revisarlo por favor.
Saludos.