Merge lp:~vauxoo/openerp-mexico-localization/7.0-l10n_mx_invoice_datetime_rm-dev-ernesto into lp:openerp-mexico-localization/7.0

Status: Needs review
Proposed branch: lp:~vauxoo/openerp-mexico-localization/7.0-l10n_mx_invoice_datetime_rm-dev-ernesto
Merge into: lp:openerp-mexico-localization/7.0
Diff against target: 653 lines (+13/-519)
12 files modified
l10n_mx_facturae/__openerp__.py (+4/-1)
l10n_mx_facturae_cbb/__openerp__.py (+4/-1)
l10n_mx_facturae_pac_sf/test/account_invoice_cfdi_pac_sf.yml (+2/-0)
l10n_mx_invoice_datetime/__init__.py (+0/-29)
l10n_mx_invoice_datetime/__openerp__.py (+0/-50)
l10n_mx_invoice_datetime/account_invoice_view.xml (+0/-18)
l10n_mx_invoice_datetime/i18n/es.po (+0/-60)
l10n_mx_invoice_datetime/i18n/es_MX.po (+0/-59)
l10n_mx_invoice_datetime/i18n/es_VE.po (+0/-59)
l10n_mx_invoice_datetime/invoice.py (+0/-210)
l10n_mx_invoice_datetime/security/l10n_mx_facturae_security_groups_date.xml (+0/-29)
oml/__openerp__.py (+3/-3)
To merge this branch: bzr merge lp:~vauxoo/openerp-mexico-localization/7.0-l10n_mx_invoice_datetime_rm-dev-ernesto

Description of the change

l10n_mx_invoice_datetime was removed, because now in the branch lp: addons-vauxoo/7.0

To post a comment you must log in.
Revision history for this message
Jorge Angel Naranjo Rogel - http://www.vauxoo.com (jorge-nr) wrote :

@Wicho

Puedes agregar en el description del __openerp__.py en donde se encuentra el nuevo modulo.

381. By Luis Ernesto García Medina - http://www.vauxoo.com

[REF][l10n_mx_facturae, l10n_mx_facturae_cbb, oml] branch is added to the description of the modules dependent invoice_datetime

Unmerged revisions

381. By Luis Ernesto García Medina - http://www.vauxoo.com

[REF][l10n_mx_facturae, l10n_mx_facturae_cbb, oml] branch is added to the description of the modules dependent invoice_datetime

380. By Luis Ernesto García Medina - http://www.vauxoo.com

[MERGE] merge with lp:openerp-mexico-localization/7.0

379. By Luis Ernesto García Medina - http://www.vauxoo.com

[MERGE] merge with lp:openerp-mexico-localization/7.0

378. By Luis Ernesto García Medina - http://www.vauxoo.com

[REF][l10n_mx_facturae_pac_sf] change the time zone of the user to test stamped of SF

377. By Luis Ernesto García Medina - http://www.vauxoo.com

[REF]change l10n_mx_invoice_datetime for invoice_datetime

376. By Luis Ernesto García Medina - http://www.vauxoo.com

[REMOVE][l10n_mx_invoice_datetime] l10n_mx_invoice_datetime was removed, because now in the branch lp: addons-vauxoo/7.0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_mx_facturae/__openerp__.py'
2--- l10n_mx_facturae/__openerp__.py 2014-03-02 03:42:39 +0000
3+++ l10n_mx_facturae/__openerp__.py 2014-08-12 21:41:04 +0000
4@@ -44,6 +44,9 @@
5 xmlstarlet
6 Ubuntu insall with:
7 sudo apt-get install xmlstarlet
8+
9+ The invoice_datetime module is available at:
10+ lp:addons-vauxoo/7.0
11 """,
12 "website" : "http://www.vauxoo.com/",
13 "license" : "AGPL-3",
14@@ -52,7 +55,7 @@
15 "document",
16 "l10n_mx_facturae_lib",
17 "l10n_mx_facturae_cer",
18- "l10n_mx_invoice_datetime",
19+ "invoice_datetime",
20 "l10n_mx_account_tax_category",
21 "l10n_mx_facturae_seq",
22 "l10n_mx_company_cif",
23
24=== modified file 'l10n_mx_facturae_cbb/__openerp__.py'
25--- l10n_mx_facturae_cbb/__openerp__.py 2013-12-09 19:21:48 +0000
26+++ l10n_mx_facturae_cbb/__openerp__.py 2014-08-12 21:41:04 +0000
27@@ -34,6 +34,9 @@
28 Codigo de Barras Bidimensional.
29 http://www.sat.gob.mx/sitio_internet/asistencia_contribuyente/principiantes/comprobantes_fiscales/66_19204.html
30 http://www.sat.gob.mx/sitio_internet/asistencia_contribuyente/principiantes/comprobantes_fiscales/66_19084.html
31+
32+ The invoice_datetime module is available at:
33+ lp:addons-vauxoo/7.0
34 """,
35 "website" : "http://www.vauxoo.com/",
36 "license" : "AGPL-3",
37@@ -42,7 +45,7 @@
38 "document",
39 "sale",#no depende de "sale" directamente, pero marca error en algunas versiones
40 "l10n_mx_partner_address",
41- "l10n_mx_invoice_datetime",
42+ "invoice_datetime",
43 "l10n_mx_facturae_seq",
44 "l10n_mx_company_cif",
45 "l10n_mx_invoice_amount_to_text",
46
47=== modified file 'l10n_mx_facturae_pac_sf/test/account_invoice_cfdi_pac_sf.yml'
48--- l10n_mx_facturae_pac_sf/test/account_invoice_cfdi_pac_sf.yml 2013-11-07 16:57:04 +0000
49+++ l10n_mx_facturae_pac_sf/test/account_invoice_cfdi_pac_sf.yml 2014-08-12 21:41:04 +0000
50@@ -25,6 +25,7 @@
51 !python {model: ir.attachment.facturae.mx}: |
52 import netsvc, tools, os, base64
53 wf_service = netsvc.LocalService("workflow")
54+ self.pool.get('res.users').write(cr, uid, uid, {'tz': "Mexico/General"})
55 cfdi_pac_sf_ids = self.search(cr, uid, [('invoice_id', '=', ref("account_invoice_cfdi_pac_sf0") ), ('state', '<>', 'cancel')], limit=1)
56 cfdi_pac_sf_id = cfdi_pac_sf_ids and cfdi_pac_sf_ids[0] or False
57 if cfdi_pac_sf_id:
58@@ -145,6 +146,7 @@
59 cfdi_pac_sf = self.browse(cr, uid, [cfdi_pac_sf_id])[0]
60 state = cfdi_pac_sf.state
61 assert state=='cancel', 'No cancel state l10n_mx attachment facturae cfdi_pac_sf'
62+ self.pool.get('res.users').write(cr, uid, uid, {'tz': "Europe/Brussels"})
63 -
64 I check that customer invoice state is "cancel"
65 -
66
67=== removed directory 'l10n_mx_invoice_datetime'
68=== removed file 'l10n_mx_invoice_datetime/__init__.py'
69--- l10n_mx_invoice_datetime/__init__.py 2012-08-07 17:03:17 +0000
70+++ l10n_mx_invoice_datetime/__init__.py 1970-01-01 00:00:00 +0000
71@@ -1,29 +0,0 @@
72-# -*- encoding: utf-8 -*-
73-###########################################################################
74-# Module Writen to OpenERP, Open Source Management Solution
75-#
76-# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
77-# All Rights Reserved.
78-# info Vauxoo (info@vauxoo.com)
79-############################################################################
80-# Coded by: moylop260 (moylop260@vauxoo.com)
81-# Launchpad Project Manager for Publication: Nhomar Hernandez - nhomar@vauxoo.com
82-############################################################################
83-#
84-# This program is free software: you can redistribute it and/or modify
85-# it under the terms of the GNU Affero General Public License as
86-# published by the Free Software Foundation, either version 3 of the
87-# License, or (at your option) any later version.
88-#
89-# This program is distributed in the hope that it will be useful,
90-# but WITHOUT ANY WARRANTY; without even the implied warranty of
91-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
92-# GNU Affero General Public License for more details.
93-#
94-# You should have received a copy of the GNU Affero General Public License
95-# along with this program. If not, see <http://www.gnu.org/licenses/>.
96-#
97-##############################################################################
98-
99-import invoice
100-
101
102=== removed file 'l10n_mx_invoice_datetime/__openerp__.py'
103--- l10n_mx_invoice_datetime/__openerp__.py 2014-05-08 21:56:57 +0000
104+++ l10n_mx_invoice_datetime/__openerp__.py 1970-01-01 00:00:00 +0000
105@@ -1,50 +0,0 @@
106-# -*- encoding: utf-8 -*-
107-###########################################################################
108-# Module Writen to OpenERP, Open Source Management Solution
109-#
110-# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
111-# All Rights Reserved.
112-# info Vauxoo (info@vauxoo.com)
113-############################################################################
114-# Coded by: moylop260 (moylop260@vauxoo.com) modified by carlosecv74@gmail.com
115-# Launchpad Project Manager for Publication: Nhomar Hernandez - nhomar@vauxoo.com
116-############################################################################
117-#
118-# This program is free software: you can redistribute it and/or modify
119-# it under the terms of the GNU Affero General Public License as
120-# published by the Free Software Foundation, either version 3 of the
121-# License, or (at your option) any later version.
122-#
123-# This program is distributed in the hope that it will be useful,
124-# but WITHOUT ANY WARRANTY; without even the implied warranty of
125-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
126-# GNU Affero General Public License for more details.
127-#
128-# You should have received a copy of the GNU Affero General Public License
129-# along with this program. If not, see <http://www.gnu.org/licenses/>.
130-#
131-##############################################################################
132-
133-{
134- "name" : "l10n_mx_invoice_datetime",
135- "version" : "1.0",
136- "author" : "Vauxoo",
137- "category" : "Localization/Mexico",
138- "description" : """Add new field invoice_datetime for electronic invoice data
139- and add hour & minute to field date_invoice
140- """,
141- "website" : "http://www.vauxoo.com/",
142- "license" : "AGPL-3",
143- "depends" : [
144- "account",
145- "l10n_mx_facturae_groups",
146-
147- ],
148- "demo" : [],
149- "data" : [
150- "security/l10n_mx_facturae_security_groups_date.xml",
151- "account_invoice_view.xml"
152- ],
153- "installable" : True,
154- "active" : False,
155-}
156
157=== removed file 'l10n_mx_invoice_datetime/account_invoice_view.xml'
158--- l10n_mx_invoice_datetime/account_invoice_view.xml 2014-05-08 21:56:57 +0000
159+++ l10n_mx_invoice_datetime/account_invoice_view.xml 1970-01-01 00:00:00 +0000
160@@ -1,18 +0,0 @@
161-<?xml version="1.0" encoding="utf-8"?>
162-<openerp>
163- <data>
164- <record model="ir.ui.view" id="account_invoice_datetime">
165- <field name="name">account.invoice.datetime</field>
166- <field name="model">account.invoice</field>
167- <field name="inherit_id" ref="account.invoice_form"/>
168- <field name="arch" type="xml">
169- <xpath expr="//field[@name='date_invoice']" position="after">
170- <field name="invoice_datetime" groups="l10n_mx_invoice_datetime.group_datetime_invoice_l10n_mx_facturae"/>
171- </xpath>
172- <xpath expr="//field[@name='date_invoice']" position="replace">
173- <field name="date_invoice" groups="l10n_mx_invoice_datetime.group_date_invoice_l10n_mx_facturae"/>
174- </xpath>
175- </field>
176- </record>
177- </data>
178-</openerp>
179
180=== removed directory 'l10n_mx_invoice_datetime/i18n'
181=== removed file 'l10n_mx_invoice_datetime/i18n/es.po'
182--- l10n_mx_invoice_datetime/i18n/es.po 2014-07-26 07:15:48 +0000
183+++ l10n_mx_invoice_datetime/i18n/es.po 1970-01-01 00:00:00 +0000
184@@ -1,60 +0,0 @@
185-# Translation of OpenERP Server.
186-# This file contains the translation of the following modules:
187-# * l10n_mx_invoice_datetime
188-#
189-msgid ""
190-msgstr ""
191-"Project-Id-Version: OpenERP Server 7.0\n"
192-"Report-Msgid-Bugs-To: \n"
193-"POT-Creation-Date: 2013-11-08 03:15+0000\n"
194-"PO-Revision-Date: 2013-11-08 04:47+0000\n"
195-"Last-Translator: hbto [Vauxoo] http://www.vauxoo.com "
196-"<humbertoarocha@gmail.com>\n"
197-"Language-Team: \n"
198-"MIME-Version: 1.0\n"
199-"Content-Type: text/plain; charset=UTF-8\n"
200-"Content-Transfer-Encoding: 8bit\n"
201-"X-Launchpad-Export-Date: 2014-07-26 07:15+0000\n"
202-"X-Generator: Launchpad (build 17131)\n"
203-
204-#. module: l10n_mx_invoice_datetime
205-#: help:account.invoice,date_invoice_tz:0
206-msgid "Date of Invoice with Time Zone"
207-msgstr "Fecha de Factura con Zona Horaria"
208-
209-#. module: l10n_mx_invoice_datetime
210-#: field:account.invoice,date_invoice_tz:0
211-msgid "Date Invoiced with TZ"
212-msgstr "Fecha facturado con TZ"
213-
214-#. module: l10n_mx_invoice_datetime
215-#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_payment_term
216-msgid "Payment Term"
217-msgstr "Plazo de pago"
218-
219-#. module: l10n_mx_invoice_datetime
220-#: help:account.invoice,invoice_datetime:0
221-msgid "Keep empty to use the current date"
222-msgstr "Mantener vacio para usar la fecha actual"
223-
224-#. module: l10n_mx_invoice_datetime
225-#: field:account.invoice,invoice_datetime:0
226-msgid "Date Electronic Invoiced "
227-msgstr "Fecha Factura Electronica "
228-
229-#. module: l10n_mx_invoice_datetime
230-#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_invoice
231-msgid "Invoice"
232-msgstr "Factura"
233-
234-#. module: l10n_mx_invoice_datetime
235-#: code:addons/l10n_mx_invoice_datetime/invoice.py:180
236-#, python-format
237-msgid "Invoice dates should be equal"
238-msgstr "Las fechas de las facturas deben ser iguales"
239-
240-#. module: l10n_mx_invoice_datetime
241-#: code:addons/l10n_mx_invoice_datetime/invoice.py:179
242-#, python-format
243-msgid "Warning!"
244-msgstr "¡Advertencia!"
245
246=== removed file 'l10n_mx_invoice_datetime/i18n/es_MX.po'
247--- l10n_mx_invoice_datetime/i18n/es_MX.po 2014-07-26 07:15:48 +0000
248+++ l10n_mx_invoice_datetime/i18n/es_MX.po 1970-01-01 00:00:00 +0000
249@@ -1,59 +0,0 @@
250-# Translation of OpenERP Server.
251-# This file contains the translation of the following modules:
252-# * l10n_mx_invoice_datetime
253-#
254-msgid ""
255-msgstr ""
256-"Project-Id-Version: OpenERP Server 7.0\n"
257-"Report-Msgid-Bugs-To: \n"
258-"POT-Creation-Date: 2013-11-08 03:15+0000\n"
259-"PO-Revision-Date: 2013-09-05 16:26+0000\n"
260-"Last-Translator: <>\n"
261-"Language-Team: \n"
262-"MIME-Version: 1.0\n"
263-"Content-Type: text/plain; charset=UTF-8\n"
264-"Content-Transfer-Encoding: 8bit\n"
265-"X-Launchpad-Export-Date: 2014-07-26 07:15+0000\n"
266-"X-Generator: Launchpad (build 17131)\n"
267-
268-#. module: l10n_mx_invoice_datetime
269-#: help:account.invoice,date_invoice_tz:0
270-msgid "Date of Invoice with Time Zone"
271-msgstr ""
272-
273-#. module: l10n_mx_invoice_datetime
274-#: field:account.invoice,date_invoice_tz:0
275-msgid "Date Invoiced with TZ"
276-msgstr ""
277-
278-#. module: l10n_mx_invoice_datetime
279-#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_payment_term
280-msgid "Payment Term"
281-msgstr ""
282-
283-#. module: l10n_mx_invoice_datetime
284-#: help:account.invoice,invoice_datetime:0
285-msgid "Keep empty to use the current date"
286-msgstr ""
287-
288-#. module: l10n_mx_invoice_datetime
289-#: field:account.invoice,invoice_datetime:0
290-msgid "Date Electronic Invoiced "
291-msgstr ""
292-
293-#. module: l10n_mx_invoice_datetime
294-#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_invoice
295-msgid "Invoice"
296-msgstr ""
297-
298-#. module: l10n_mx_invoice_datetime
299-#: code:addons/l10n_mx_invoice_datetime/invoice.py:180
300-#, python-format
301-msgid "Invoice dates should be equal"
302-msgstr ""
303-
304-#. module: l10n_mx_invoice_datetime
305-#: code:addons/l10n_mx_invoice_datetime/invoice.py:179
306-#, python-format
307-msgid "Warning!"
308-msgstr ""
309
310=== removed file 'l10n_mx_invoice_datetime/i18n/es_VE.po'
311--- l10n_mx_invoice_datetime/i18n/es_VE.po 2014-07-26 07:15:48 +0000
312+++ l10n_mx_invoice_datetime/i18n/es_VE.po 1970-01-01 00:00:00 +0000
313@@ -1,59 +0,0 @@
314-# Translation of OpenERP Server.
315-# This file contains the translation of the following modules:
316-# * l10n_mx_invoice_datetime
317-#
318-msgid ""
319-msgstr ""
320-"Project-Id-Version: OpenERP Server 7.0\n"
321-"Report-Msgid-Bugs-To: \n"
322-"POT-Creation-Date: 2013-11-08 03:15+0000\n"
323-"PO-Revision-Date: 2013-09-05 16:27+0000\n"
324-"Last-Translator: <>\n"
325-"Language-Team: \n"
326-"MIME-Version: 1.0\n"
327-"Content-Type: text/plain; charset=UTF-8\n"
328-"Content-Transfer-Encoding: 8bit\n"
329-"X-Launchpad-Export-Date: 2014-07-26 07:15+0000\n"
330-"X-Generator: Launchpad (build 17131)\n"
331-
332-#. module: l10n_mx_invoice_datetime
333-#: help:account.invoice,date_invoice_tz:0
334-msgid "Date of Invoice with Time Zone"
335-msgstr ""
336-
337-#. module: l10n_mx_invoice_datetime
338-#: field:account.invoice,date_invoice_tz:0
339-msgid "Date Invoiced with TZ"
340-msgstr ""
341-
342-#. module: l10n_mx_invoice_datetime
343-#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_payment_term
344-msgid "Payment Term"
345-msgstr ""
346-
347-#. module: l10n_mx_invoice_datetime
348-#: help:account.invoice,invoice_datetime:0
349-msgid "Keep empty to use the current date"
350-msgstr ""
351-
352-#. module: l10n_mx_invoice_datetime
353-#: field:account.invoice,invoice_datetime:0
354-msgid "Date Electronic Invoiced "
355-msgstr ""
356-
357-#. module: l10n_mx_invoice_datetime
358-#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_invoice
359-msgid "Invoice"
360-msgstr ""
361-
362-#. module: l10n_mx_invoice_datetime
363-#: code:addons/l10n_mx_invoice_datetime/invoice.py:180
364-#, python-format
365-msgid "Invoice dates should be equal"
366-msgstr ""
367-
368-#. module: l10n_mx_invoice_datetime
369-#: code:addons/l10n_mx_invoice_datetime/invoice.py:179
370-#, python-format
371-msgid "Warning!"
372-msgstr ""
373
374=== removed file 'l10n_mx_invoice_datetime/invoice.py'
375--- l10n_mx_invoice_datetime/invoice.py 2014-06-11 23:16:13 +0000
376+++ l10n_mx_invoice_datetime/invoice.py 1970-01-01 00:00:00 +0000
377@@ -1,210 +0,0 @@
378-# -*- encoding: utf-8 -*-
379-###########################################################################
380-# Module Writen to OpenERP, Open Source Management Solution
381-#
382-# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
383-# All Rights Reserved.
384-# info Vauxoo (info@vauxoo.com)
385-############################################################################
386-# Coded by: moylop260 (moylop260@vauxoo.com)
387-# Launchpad Project Manager for Publication: Nhomar Hernandez - nhomar@vauxoo.com
388-############################################################################
389-#
390-# This program is free software: you can redistribute it and/or modify
391-# it under the terms of the GNU Affero General Public License as
392-# published by the Free Software Foundation, either version 3 of the
393-# License, or (at your option) any later version.
394-#
395-# This program is distributed in the hope that it will be useful,
396-# but WITHOUT ANY WARRANTY; without even the implied warranty of
397-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
398-# GNU Affero General Public License for more details.
399-#
400-# You should have received a copy of the GNU Affero General Public License
401-# along with this program. If not, see <http://www.gnu.org/licenses/>.
402-#
403-##############################################################################
404-
405-from openerp.osv import fields, osv
406-from openerp.tools.translate import _
407-from openerp import pooler, tools
408-from openerp import netsvc
409-from openerp import release
410-import datetime
411-from pytz import timezone
412-import pytz
413-from dateutil.relativedelta import relativedelta
414-
415-import time
416-import os
417-
418-
419-class account_payment_term(osv.Model):
420- _inherit = "account.payment.term"
421-
422- def compute(self, cr, uid, id, value, date_ref=False, context=None):
423- if context is None:
424- context = {}
425- if date_ref:
426- try:
427- date_ref = time.strftime('%Y-%m-%d', time.strptime(
428- date_ref, '%Y-%m-%d %H:%M:%S'))
429- except:
430- pass
431- return super(account_payment_term, self).compute(cr, uid, id, value,
432- date_ref, context=context)
433-
434-
435-class account_invoice(osv.Model):
436- _inherit = 'account.invoice'
437- #_order = 'invoice_datetime asc'
438-
439- def _get_date_invoice_tz(self, cr, uid, ids, field_names=None, arg=False, context=None):
440- if context is None:
441- context = {}
442- res = {}
443- if release.version >= '6':
444- dt_format = tools.DEFAULT_SERVER_DATETIME_FORMAT
445- tz = context.get('tz_invoice_mx', 'America/Mexico_City')
446- for invoice in self.browse(cr, uid, ids, context=context):
447- res[invoice.id] = invoice.invoice_datetime and tools.\
448- server_to_local_timestamp(invoice.invoice_datetime,
449- tools.DEFAULT_SERVER_DATETIME_FORMAT,
450- tools.DEFAULT_SERVER_DATETIME_FORMAT, context.get(
451- 'tz_invoice_mx', 'America/Mexico_City')) or False
452- elif release.version < '6':
453- # TODO: tz change for openerp5
454- for invoice in self.browse(cr, uid, ids, context=context):
455- res[invoice.id] = invoice.date_invoice
456- return res
457-
458- _columns = {
459- # Extract date_invoice from original, but add datetime
460- #'date_invoice': fields.datetime('Date Invoiced', states={'open':[
461- #('readonly',True)],'close':[('readonly',True)]},
462- #help="Keep empty to use the current date"),
463- 'invoice_datetime': fields.datetime('Date Electronic Invoiced ',
464- states={'open': [('readonly', True)], 'close': [('readonly', True)]},
465- help="Keep empty to use the current date"),
466- 'date_invoice_tz': fields.function(_get_date_invoice_tz, method=True,
467- type='datetime', string='Date Invoiced with TZ', store=True,
468- help='Date of Invoice with Time Zone'),
469- }
470-
471- _defaults = {
472- #'date_invoice': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
473- }
474-
475- def copy(self, cr, uid, id, default=None, context=None):
476- if context is None:
477- context = {}
478- if default is None:
479- default = {}
480- default.update({'invoice_datetime': False, 'date_invoice' : False})
481- return super(account_invoice, self).copy(cr, uid, id, default, context)
482-
483- def _get_time_zone(self, cr, uid, invoice_id, context=None):
484- if context is None:
485- context = {}
486- res_users_obj = self.pool.get('res.users')
487- userstz = res_users_obj.browse(cr, uid, [uid])[0].partner_id.tz
488- a = 0
489- if userstz:
490- hours = timezone(userstz)
491- fmt = '%Y-%m-%d %H:%M:%S %Z%z'
492- now = datetime.datetime.now()
493- loc_dt = hours.localize(datetime.datetime(now.year, now.month, now.day,
494- now.hour, now.minute, now.second))
495- timezone_loc = (loc_dt.strftime(fmt))
496- diff_timezone_original = timezone_loc[-5:-2]
497- timezone_original = int(diff_timezone_original)
498- s = str(datetime.datetime.now(pytz.timezone(userstz)))
499- s = s[-6:-3]
500- timezone_present = int(s)*-1
501- a = timezone_original + ((
502- timezone_present + timezone_original)*-1)
503- return a
504-
505- def assigned_datetime(self, cr, uid, values, context=None):
506- if context is None:
507- context = {}
508- res = {}
509- if values.get('date_invoice', False) and\
510- not values.get('invoice_datetime', False):
511-
512- user_hour = self._get_time_zone(cr, uid, [], context=context)
513- time_invoice = datetime.time(abs(user_hour), 0, 0)
514-
515- date_invoice = datetime.datetime.strptime(
516- values['date_invoice'], '%Y-%m-%d').date()
517-
518- dt_invoice = datetime.datetime.combine(
519- date_invoice, time_invoice).strftime('%Y-%m-%d %H:%M:%S')
520-
521- res['invoice_datetime'] = dt_invoice
522- res['date_invoice'] = values['date_invoice']
523-
524- if values.get('invoice_datetime', False) and not\
525- values.get('date_invoice', False):
526- date_invoice = fields.datetime.context_timestamp(cr, uid,
527- datetime.datetime.strptime(values['invoice_datetime'],
528- tools.DEFAULT_SERVER_DATETIME_FORMAT), context=context)
529- res['date_invoice'] = date_invoice
530- res['invoice_datetime'] = values['invoice_datetime']
531-
532- if 'invoice_datetime' in values and 'date_invoice' in values:
533- if values['invoice_datetime'] and values['date_invoice']:
534- date_invoice = datetime.datetime.strptime(
535- values['invoice_datetime'],
536- '%Y-%m-%d %H:%M:%S').date().strftime('%Y-%m-%d')
537- if date_invoice != values['date_invoice']:
538- groups_obj = self.pool.get('res.groups')
539- group_datetime = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'l10n_mx_invoice_datetime', 'group_datetime_invoice_l10n_mx_facturae')
540- group_date = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'l10n_mx_invoice_datetime', 'group_date_invoice_l10n_mx_facturae')
541- if group_datetime and group_date:
542- users_datetime = []
543- users_date = []
544- for user in groups_obj.browse(cr, uid, [group_datetime[1]], context=context)[0].users:
545- users_datetime.append(user.id)
546- for user in groups_obj.browse(cr, uid, [group_date[1]], context=context)[0].users:
547- users_date.append(user.id)
548- if uid in users_datetime:
549- date_invoice = fields.datetime.context_timestamp(cr, uid,
550- datetime.datetime.strptime(values['invoice_datetime'],
551- tools.DEFAULT_SERVER_DATETIME_FORMAT), context=context)
552- res['date_invoice'] = date_invoice
553- res['invoice_datetime'] = values['invoice_datetime']
554- elif uid in users_date:
555- user_hour = self._get_time_zone(cr, uid, [], context=context)
556- time_invoice = datetime.time(abs(user_hour), 0, 0)
557-
558- date_invoice = datetime.datetime.strptime(
559- values['date_invoice'], '%Y-%m-%d').date()
560-
561- dt_invoice = datetime.datetime.combine(
562- date_invoice, time_invoice).strftime('%Y-%m-%d %H:%M:%S')
563-
564- res['invoice_datetime'] = dt_invoice
565- res['date_invoice'] = values['date_invoice']
566- else:
567- raise osv.except_osv(_('Warning!'), _('Invoice dates should be equal'))
568- else:
569- raise osv.except_osv(_('Warning!'), _('Invoice dates should be equal'))
570-
571- if not values.get('invoice_datetime', False) and\
572- not values.get('date_invoice', False):
573- res['date_invoice'] = fields.date.context_today(self,cr,uid,context=context)
574- res['invoice_datetime'] = fields.datetime.now()
575-
576- return res
577-
578- def action_move_create(self, cr, uid, ids, context=None):
579- for inv in self.browse(cr, uid, ids, context=context):
580- if inv.type in ('out_invoice', 'out_refund'):
581- vals_date = self.assigned_datetime(cr, uid,
582- {'invoice_datetime': inv.invoice_datetime,
583- 'date_invoice': inv.date_invoice},
584- context=context)
585- self.write(cr, uid, ids, vals_date, context=context)
586- return super(account_invoice,
587- self).action_move_create(cr, uid, ids, context=context)
588
589=== removed directory 'l10n_mx_invoice_datetime/security'
590=== removed file 'l10n_mx_invoice_datetime/security/l10n_mx_facturae_security_groups_date.xml'
591--- l10n_mx_invoice_datetime/security/l10n_mx_facturae_security_groups_date.xml 2014-05-28 22:45:13 +0000
592+++ l10n_mx_invoice_datetime/security/l10n_mx_facturae_security_groups_date.xml 1970-01-01 00:00:00 +0000
593@@ -1,29 +0,0 @@
594-<?xml version="1.0" encoding="utf-8"?>
595-<openerp>
596- <data noupdate="1">
597-
598- <record model="ir.module.category" id="module_date_invoice_l10n_mx_facturae">
599- <field name="name">Fecha FacturaE</field>
600- <field name="description">Indicate tue type of date that need was colocated in the invoice</field>
601- <field name="sequence">999</field>
602- </record>
603-
604- <record id="group_date_invoice_l10n_mx_facturae" model="res.groups">
605- <field name="name">Date</field>
606- <field name="comment">Date</field>
607- <field name="category_id" ref="module_date_invoice_l10n_mx_facturae"/>
608- </record>
609-
610- <record id="group_datetime_invoice_l10n_mx_facturae" model="res.groups">
611- <field name="name">DateTime</field>
612- <field name="comment">Date Time</field>
613- <field name="category_id" ref="module_date_invoice_l10n_mx_facturae"/>
614- <field name="users" eval="[(4, ref('base.user_root'))]"/>
615- </record>
616-
617- <record id="group_datetime_invoice_l10n_mx_facturae" model="res.groups">
618- <field name="implied_ids" eval="[(4, ref('group_datetime_invoice_l10n_mx_facturae'))]"/>
619- </record>
620-
621- </data>
622-</openerp>
623
624=== modified file 'oml/__openerp__.py'
625--- oml/__openerp__.py 2014-02-19 16:08:58 +0000
626+++ oml/__openerp__.py 2014-08-12 21:41:04 +0000
627@@ -44,7 +44,7 @@
628 "l10n_mx_import_info",
629 "l10n_mx_invoice_amount_to_text",
630 "l10n_mx_invoice_currency_chgdft",
631- "l10n_mx_invoice_datetime",
632+ "invoice_datetime",
633 "l10n_mx_invoice_ftp",
634 "l10n_mx_invoice_wkf_security",
635 "l10n_mx_ir_attachment_facturae",
636@@ -120,8 +120,6 @@
637
638 - l10n_mx_invoice_currency_chgdft
639
640- - l10n_mx_invoice_datetime
641-
642 - l10n_mx_invoice_ftp
643
644 - l10n_mx_invoice_wkf_security
645@@ -167,6 +165,8 @@
646 - hr_expense_replenishment_tax
647
648 - report_multicompany
649+
650+ - invoice_datetime
651 """,
652 "website" : "http://www.vauxoo.com",
653 "category" : "Localization/Application",