Commit d7dc60b3 authored by agb80's avatar agb80

Removed deprecated module l10n_mx_invoice_datetime

parent 0937e7ac
Pipeline #149 failed with stage
......@@ -51,7 +51,6 @@ Requires the following programs:
'report_webkit',
"l10n_mx_facturae_lib",
"l10n_mx_facturae_cer",
"l10n_mx_invoice_datetime",
"l10n_mx_account_tax_category",
"l10n_mx_facturae_seq",
"l10n_mx_company_cif",
......
......@@ -22,10 +22,10 @@
#
##############################################################################
from openerp.osv import osv
from openerp.osv import orm
class email_template(osv.Model):
class email_template(orm.Model):
""" Extend generic message composition wizard to auto attach invoice
related files when sending opening the Send Mail invoice button.
"""
......
......@@ -23,20 +23,20 @@
#
##############################################################################
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp import tools
from openerp import netsvc
import time
from xml.dom import minidom
import base64
import hashlib
import tempfile
import os
import codecs
from xml.dom import minidom
from datetime import datetime
from openerp.osv import fields, orm
from openerp.tools.translate import _
from openerp import tools, netsvc
def exec_command_pipe(name, *args):
"""
......@@ -98,7 +98,7 @@ def conv_ascii(text):
try:
text = text.replace(old, new)
except:
raise osv.except_osv(
raise orm.except_orm(
_('Warning !'),
_("Can't recode the string [%s] in the letter [%s]") %
(text, old)
......@@ -106,7 +106,25 @@ def conv_ascii(text):
return text
class account_invoice(osv.Model):
class account_payment_term(orm.Model):
_inherit = "account.payment.term"
def compute(self, cr, uid, ids, value, date_ref=False, context=None):
if context is None:
context = {}
if date_ref:
try:
date_ref = time.strftime(
'%Y-%m-%d', time.strptime(date_ref, '%Y-%m-%d %H:%M:%S')
)
except:
pass
return super(account_payment_term, self).compute(
cr, uid, ids, value, date_ref, context=context
)
class account_invoice(orm.Model):
_inherit = 'account.invoice'
def create_report(self, cr, uid, res_ids, report_name=False, file_name=False, context=None):
......@@ -157,8 +175,10 @@ class account_invoice(osv.Model):
cr, uid, 'account.invoice.' + invtype,
'code=%s', context=tmp_context)
if not number:
raise osv.except_osv(_('Warning !'), _(
'No hay una secuencia de folios bien definida. !'))
raise orm.except_orm(
_('Warning !'),
_('No hay una secuencia de folios bien definida. !')
)
if invtype in ('in_invoice', 'in_refund'):
ref = reference
else:
......@@ -240,7 +260,10 @@ class account_invoice(osv.Model):
cr, uid, [('name', '=', 'MXN')], limit=1, context=context)
currency_mxn_id = currency_mxn_ids and currency_mxn_ids[0] or False
if not currency_mxn_id:
raise osv.except_osv(_('Error !'), _('No hay moneda MXN.'))
raise orm.except_orm(
_('Error !'),
_('No hay moneda MXN.')
)
for id in ids:
invoice = self.browse(cr, uid, [id])[0]
date_format = invoice.invoice_datetime or False
......@@ -435,7 +458,7 @@ class account_invoice(osv.Model):
key_node.appendChild(text_node)
new_node.appendChild(key_node)
parent_node.appendChild(new_node)
return new_node
return new_node
def _get_type_sequence(self, cr, uid, ids, context=None):
if context is None:
......@@ -448,7 +471,7 @@ class account_invoice(osv.Model):
if sequence_app_id:
type_inv = ir_seq_app_obj.browse(
cr, uid, sequence_app_id[0], context=context).type
if 'cfdi32' in type_inv: # Revisa si en tipo es cfdi
if 'cfdi32' in type_inv: # Revisa si en tipo es cfdi
comprobante = 'cfdi:Comprobante'
else:
comprobante = 'Comprobante'
......@@ -464,8 +487,10 @@ class account_invoice(osv.Model):
inv_xml = atta_brw.datas or False
else:
inv_xml = False
raise osv.except_osv(('State of Cancellation!'), (
"This invoice hasn't stamped, so that not possible cancel."))
raise orm.except_orm(
_('State of Cancellation!'),
_("This invoice hasn't stamped, so that not possible cancel.")
)
return {'file': inv_xml}
def binary2file(self, cr, uid, ids, binary_data, file_prefix="", file_suffix=""):
......@@ -511,9 +536,11 @@ class account_invoice(osv.Model):
certificate_id.serial_number or '') + '__certificate__',
'.cer.pem')
except:
raise osv.except_osv(_('Error !'), _(
'Not captured a CERTIFICATE file in format PEM, in \
the company!'))
raise orm.except_orm(
_('Error !'),
_('Not captured a CERTIFICATE file in format PEM, in '
'the company!')
)
file_globals['fname_cer'] = fname_cer_pem
fname_key_pem = False
......@@ -523,8 +550,10 @@ class account_invoice(osv.Model):
certificate_id.serial_number or '') + '__certificate__',
'.key.pem')
except:
raise osv.except_osv(_('Error !'), _(
'Not captured a KEY file in format PEM, in the company!'))
raise orm.except_orm(
_('Error !'),
_('Not captured a KEY file in format PEM, in the company!')
)
file_globals['fname_key'] = fname_key_pem
fname_cer_no_pem = False
......@@ -568,16 +597,20 @@ class account_invoice(osv.Model):
'cadenaoriginal_2_0_l.xslt') or ''
break
if not file_globals.get('fname_xslt', False):
raise osv.except_osv(_('Warning !'), _(
'Not defined fname_xslt. !'))
raise orm.except_orm(
_('Warning !'),
_('Not defined fname_xslt. !')
)
if not os.path.isfile(file_globals.get('fname_xslt', ' ')):
raise osv.except_osv(_('Warning !'), _(
'No exist file [%s]. !') % (file_globals.get('fname_xslt', ' ')))
raise orm.except_orm(
_('Warning !'),
_('No exist file [%s]. !') % (file_globals.get('fname_xslt', ' '))
)
file_globals['serial_number'] = certificate_id.serial_number
else:
raise osv.except_osv(
raise orm.except_orm(
_('Warning !'),
_('Check date of invoice and the validity of certificate'
', & that the register of the certificate is active.')
......@@ -645,9 +678,11 @@ class account_invoice(osv.Model):
if number_work:
int(number_work)
except(ValueError):
raise osv.except_osv(_('Warning !'), _(
'The folio [%s] must be integer number, without letters')\
% (number_work))
raise orm.except_orm(
_('Warning !'),
_('The folio [%s] must be integer number, without '
'letters' % (number_work))
)
context.update({'number_work': number_work or False})
approval_id = self.pool.get('ir.sequence')._get_current_approval(
cr, uid, [sequence_id], field_names=None, arg=False,
......@@ -664,13 +699,13 @@ class account_invoice(osv.Model):
'hasta': approval.number_end or '',
}
else:
raise osv.except_osv(
raise orm.except_orm(
_('Warning !'),
_("The sequence don't have data of electronic invoice" %
sequence_id)
)
else:
raise osv.except_osv(
raise orm.except_orm(
_('Warning !'),
_('Not found a sequence of configuration')
)
......@@ -771,14 +806,14 @@ class account_invoice(osv.Model):
data_dict['cadena_original'] = txt_str
if not txt_str:
raise osv.except_osv(
raise orm.except_orm(
_('Error en Cadena original!'),
_("Can't get the string original of the voucher.\n"
"Ckeck your configuration.")
)
# TODO: Is this really needed yet?
if not data_dict['Comprobante'].get('folio', ''):
raise osv.except_osv(
raise orm.except_orm(
_('Error in Folio!'),
_("Can't get the folio of the voucher.\n"
"Before generating the XML, click on the button, "
......@@ -789,7 +824,7 @@ class account_invoice(osv.Model):
sign_str = self._get_sello(
cr=False, uid=False, ids=False, context=context)
if not sign_str:
raise osv.except_osv(
raise orm.except_orm(
_('Error in Stamp !'),
_("Can't generate the stamp of the voucher.\n"
"Ckeck your configuration")
......@@ -801,7 +836,7 @@ class account_invoice(osv.Model):
noCertificado = self._get_noCertificado(context['fname_cer'])
if not noCertificado:
raise osv.except_osv(
raise orm.except_orm(
_('Error in No. Certificate !'),
_("Can't get the Certificate Number of the voucher.\n"
"Ckeck your configuration.")
......@@ -811,7 +846,7 @@ class account_invoice(osv.Model):
cert_str = self._get_certificate_str(context['fname_cer'])
if not cert_str:
raise osv.except_osv(
raise orm.except_orm(
_('Error in Certificate!'),
_("Can't generate the Certificate of the voucher.\n"
"Ckeck your configuration.")
......@@ -857,7 +892,11 @@ class account_invoice(osv.Model):
fname_out = certificate_lib.b64str_to_tempfile(base64.encodestring(''), file_suffix='.txt', file_prefix='openerp__' + (False or '') + '__schema_validation_result__')
result = certificate_lib.check_xml_scheme(fname_data_xml, fname_scheme, fname_out)
if result: # Valida el xml mediante el archivo xsd
raise osv.except_osv('Error al validar la estructura del xml!', 'Validación de XML versión %s:\n%s' % (facturae_version, result))
raise orm.except_orm(
_('Error al validar la estructura del xml!'),
_('Validación de XML versión %s:\n%s' %
(facturae_version, result))
)
return True
def write_cfd_data(self, cr, uid, ids, cfd_data=None, context=None):
......@@ -967,7 +1006,7 @@ class account_invoice(osv.Model):
elif invoice.type == 'out_refund':
tipoComprobante = 'egreso'
else:
raise osv.except_osv(
raise orm.except_orm(
_('Warning !'),
_('Only can issue electronic invoice to customers.!')
)
......@@ -984,10 +1023,11 @@ class account_invoice(osv.Model):
number_work = invoice.number or invoice.internal_number
invoice_data_parent['Comprobante'].update({
'folio': number_work,
'fecha': invoice.date_invoice_tz and
time.strftime('%Y-%m-%dT%H:%M:%S', time.strptime(
invoice.date_invoice_tz, '%Y-%m-%d %H:%M:%S'))
or '',
'fecha': (
invoice.date_invoice_tz and
time.strftime('%Y-%m-%dT%H:%M:%S', time.strptime(invoice.date_invoice_tz, '%Y-%m-%d %H:%M:%S'))
or ''
),
'tipoDeComprobante': tipoComprobante,
'formaDePago': u'Pago en una sola exhibición',
'noCertificado': '@',
......@@ -1018,16 +1058,24 @@ class account_invoice(osv.Model):
invoice.company_emitter_id.address_invoice_parent_company_id or False
if not address_invoice:
raise osv.except_osv(_('Warning !'), _(
"Don't have defined the address issuing!"))
raise orm.except_orm(
_('Warning !'),
_("Don't have defined the address issuing!")
)
if not address_invoice_parent:
raise osv.except_osv(_('Warning !'), _(
"Don't have defined an address of invoicing from the company!"))
raise orm.except_orm(
_('Warning !'),
_("Don't have defined an address of invoicing from the "
"company!")
)
if not address_invoice_parent.vat:
raise osv.except_osv(_('Warning !'), _(
"Don't have defined RFC for the address of invoice to the company!"))
raise orm.except_orm(
_('Warning !'),
_("Don't have defined RFC for the address of invoice to "
"the company!")
)
invoice_data = invoice_data_parent['Comprobante']
invoice_data['Emisor'] = {}
......@@ -1127,7 +1175,7 @@ class account_invoice(osv.Model):
parent_id = invoice.partner_id.commercial_partner_id.id
parent_obj = partner_obj.browse(cr, uid, parent_id, context=context)
if not parent_obj.vat:
raise osv.except_osv(
raise orm.except_orm(
_('Error!'),
_("Don't have defined RFC of the partner[%s].") %
parent_obj.name
......@@ -1287,7 +1335,7 @@ class account_invoice(osv.Model):
'%Y-%m-%d') or False
if not invoice_datetime:
# TODO: Is this validation needed?
raise osv.except_osv(
raise orm.except_orm(
_('Date Invoice Empty'),
_("Can't generate a invoice without date, make sure that the "
"state of invoice not is draft & the date of invoice is "
......@@ -1308,14 +1356,14 @@ class account_invoice(osv.Model):
if city and state and country:
address = city + ' ' + state + ', ' + country
else:
raise osv.except_osv(
raise orm.except_orm(
_('Address Incomplete!'),
_('Ckeck that the address of company issuing of fiscal '
'voucher is complete (City - State - Country)')
)
if not invoice.company_emitter_id.partner_id.regimen_fiscal_id.name:
raise osv.except_osv(
raise orm.except_orm(
_('Missing Fiscal Regime!'),
_('The Fiscal Regime of the company issuing of fiscal '
'voucher is a data required')
......
......@@ -195,7 +195,8 @@ class PrintInvoice(account_print_invoice.account_invoice):
"""
legend = _('This document is a printed representation od the CFDI')
return legend
report_sxw.report_sxw(
'report.account.invoice.facturae.webkit',
'account.invoice',
......
......@@ -193,7 +193,7 @@ class ir_attachment_facturae_mx(osv.Model):
# El CFDI no ha sido timbrado
raise osv.except_osv(
_('Warning'),
_(u'Stamped Code: %s. \n Stamped Message: %s.' %
_('Stamped Code: %s. \n Stamped Message: %s.' %
(resultado['codigo'], mensaje))
)
......
......@@ -36,20 +36,19 @@ Ubuntu Package Depends:
""",
"website" : "http://www.vauxoo.com/",
"license" : "AGPL-3",
"depends" : ["l10n_mx_facturae_groups", "l10n_mx_params_pac",
"depends" : ["l10n_mx_facturae_groups", "l10n_mx_params_pac",
"l10n_mx_account_tax_category",
#"l10n_mx_facturae_report",
"l10n_mx_facturae_seq",
"l10n_mx_facturae_seq",
"l10n_mx_ir_attachment_facturae",
"l10n_mx_facturae_pac",
"l10n_mx_facturae_group_show_wizards",
"account_cancel",],
"account_cancel", ],
"demo" : [
"demo/l10n_mx_facturae_pac_sf_demo.xml",
"demo/l10n_mx_facturae_seq_demo.xml",
],
"data" : [
#"security/l10n_mx_facturae_pac_sf_security.xml",
# "security/l10n_mx_facturae_pac_sf_security.xml",
"l10n_mx_facturae_pac_sf_report.xml",
"wizard/wizard_cancel_invoice_pac_sf_view.xml",
"wizard/wizard_export_invoice_pac_sf_view_v6.xml",
......
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
############################################################################
# Coded by: moylop260 (moylop260@vauxoo.com)
# Launchpad Project Manager for Publication: Nhomar Hernandez - nhomar@vauxoo.com
############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import invoice
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
############################################################################
# Coded by: moylop260 (moylop260@vauxoo.com) modified by carlosecv74@gmail.com
# Launchpad Project Manager for Publication: Nhomar Hernandez - nhomar@vauxoo.com
############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name" : "l10n_mx_invoice_datetime",
"version" : "1.0",
"author" : "Vauxoo",
"category" : "Localization/Mexico",
"description" : """Add new field invoice_datetime for electronic invoice data
and add hour & minute to field date_invoice
""",
"website" : "http://www.vauxoo.com/",
"license" : "AGPL-3",
"depends" : [
"account",
"l10n_mx_facturae_groups",
],
"demo" : [],
"data" : [],
"installable" : True,
"active" : False,
}
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * l10n_mx_invoice_datetime
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-11-08 03:15+0000\n"
"PO-Revision-Date: 2013-11-08 04:47+0000\n"
"Last-Translator: hbto [Vauxoo] http://www.vauxoo.com "
"<humbertoarocha@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-02-14 07:51+0000\n"
"X-Generator: Launchpad (build 16916)\n"
#. module: l10n_mx_invoice_datetime
#: help:account.invoice,date_invoice_tz:0
msgid "Date of Invoice with Time Zone"
msgstr "Fecha de Factura con Zona Horaria"
#. module: l10n_mx_invoice_datetime
#: field:account.invoice,date_invoice_tz:0
msgid "Date Invoiced with TZ"
msgstr "Fecha facturado con TZ"
#. module: l10n_mx_invoice_datetime
#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_payment_term
msgid "Payment Term"
msgstr "Plazo de pago"
#. module: l10n_mx_invoice_datetime
#: help:account.invoice,invoice_datetime:0
msgid "Keep empty to use the current date"
msgstr "Mantener vacio para usar la fecha actual"
#. module: l10n_mx_invoice_datetime
#: field:account.invoice,invoice_datetime:0
msgid "Date Electronic Invoiced "
msgstr "Fecha Factura Electronica "
#. module: l10n_mx_invoice_datetime
#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_invoice
msgid "Invoice"
msgstr "Factura"
#. module: l10n_mx_invoice_datetime
#: code:addons/l10n_mx_invoice_datetime/invoice.py:180
#, python-format
msgid "Invoice dates should be equal"
msgstr "Las fechas de las facturas deben ser iguales"
#. module: l10n_mx_invoice_datetime
#: code:addons/l10n_mx_invoice_datetime/invoice.py:179
#, python-format
msgid "Warning!"
msgstr "¡Advertencia!"
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * l10n_mx_invoice_datetime
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-11-08 03:15+0000\n"
"PO-Revision-Date: 2013-09-05 16:26+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-02-14 07:51+0000\n"
"X-Generator: Launchpad (build 16916)\n"
#. module: l10n_mx_invoice_datetime
#: help:account.invoice,date_invoice_tz:0
msgid "Date of Invoice with Time Zone"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: field:account.invoice,date_invoice_tz:0
msgid "Date Invoiced with TZ"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_payment_term
msgid "Payment Term"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: help:account.invoice,invoice_datetime:0
msgid "Keep empty to use the current date"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: field:account.invoice,invoice_datetime:0
msgid "Date Electronic Invoiced "
msgstr ""
#. module: l10n_mx_invoice_datetime
#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: code:addons/l10n_mx_invoice_datetime/invoice.py:180
#, python-format
msgid "Invoice dates should be equal"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: code:addons/l10n_mx_invoice_datetime/invoice.py:179
#, python-format
msgid "Warning!"
msgstr ""
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * l10n_mx_invoice_datetime
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-11-08 03:15+0000\n"
"PO-Revision-Date: 2013-09-05 16:27+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-02-14 07:51+0000\n"
"X-Generator: Launchpad (build 16916)\n"
#. module: l10n_mx_invoice_datetime
#: help:account.invoice,date_invoice_tz:0
msgid "Date of Invoice with Time Zone"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: field:account.invoice,date_invoice_tz:0
msgid "Date Invoiced with TZ"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_payment_term
msgid "Payment Term"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: help:account.invoice,invoice_datetime:0
msgid "Keep empty to use the current date"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: field:account.invoice,invoice_datetime:0
msgid "Date Electronic Invoiced "
msgstr ""
#. module: l10n_mx_invoice_datetime
#: model:ir.model,name:l10n_mx_invoice_datetime.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: code:addons/l10n_mx_invoice_datetime/invoice.py:180
#, python-format
msgid "Invoice dates should be equal"
msgstr ""
#. module: l10n_mx_invoice_datetime
#: code:addons/l10n_mx_invoice_datetime/invoice.py:179
#, python-format
msgid "Warning!"
msgstr ""
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
############################################################################
# Coded by: moylop260 (moylop260@vauxoo.com)
# Launchpad Project Manager for Publication: Nhomar Hernandez - nhomar@vauxoo.com
############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import orm
import time
class account_payment_term(orm.Model):
_inherit = "account.payment.term"
def compute(self, cr, uid, ids, value, date_ref=False, context=None):
if context is None:
context = {}
if date_ref:
try:
date_ref = time.strftime('%Y-%m-%d', time.strptime(
date_ref, '%Y-%m-%d %H:%M:%S'))
except:
pass
return super(account_payment_term, self).compute(
cr, uid, ids, value, date_ref, context=context)
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="res.groups" id="group_res_datetime_invoice_mx">
<field name="name">DateTime Invoice MX</field>
</record>
<record model="res.groups" id="group_res_date_invoice">
<field name="name">Date Invoice</field>
</record>
</data>
</openerp>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment