Commit c18bcbbd authored by agb80's avatar agb80

Update l10n_mx_payment_method

Now module depends on account_payment_extension and avoids to create new
objects for payment method
Removes payment_method and acc_bank fields from invoice model
Removes l10n_mx_facturae dependency on payment method module allowing
more flexibility
parent c1ed3135
......@@ -57,4 +57,5 @@ downloads
eggs
parts
src/*.egg-info
*.orig
\ No newline at end of file
*.orig
.idea
......@@ -61,7 +61,6 @@ Requires the following programs:
"l10n_mx_notes_invoice",
"l10n_mx_res_partner_bank",
"l10n_mx_regimen_fiscal",
"l10n_mx_payment_method",
"l10n_mx_invoice_currency_chgdft",
"l10n_mx_base_vat_split",
"l10n_mx_facturae_report",
......
......@@ -858,9 +858,8 @@ class account_invoice(osv.Model):
def _get_facturae_invoice_dict_data(self, cr, uid, ids, context=None):
if context is None:
context = {}
invoices = self.browse(cr, uid, ids, context=context)
invoice_data_parents = []
for invoice in invoices:
for invoice in self.browse(cr, uid, ids, context=context):
invoice_data_parent = {}
if invoice.type == 'out_invoice':
tipoComprobante = 'ingreso'
......@@ -1091,20 +1090,15 @@ class account_invoice(osv.Model):
# Inicia seccion: Conceptos
invoice_data['Conceptos'] = []
for line in invoice.invoice_line:
# price_type = invoice._columns.has_key('price_type') and invoice.price_type or 'tax_excluded'
# if price_type == 'tax_included':
# price_unit = line.price_subtotal/line.quantity
# TODO: Encontrar alguna forma para que no tenga que descomentar
# a cada rato estas líneas para agregar compatibilidad con
# modulo TaxIncluded
price_unit = line.quantity != 0 and line.price_subtotal / \
line.quantity or 0.0
concepto = {
'cantidad': "%.2f" % (line.quantity or 0.0),
'descripcion': line.name or '',
'valorUnitario': "%.2f" % (price_unit or 0.0),
'importe': "%.2f" % (line.price_subtotal or 0.0), # round(line.price_unit *(1-(line.discount/100)),2) or 0.00),#Calc: iva, disc, qty
# Falta agregar discount
'importe': "%.2f" % (line.price_subtotal or 0.0),
# round(line.price_unit *(1-(line.discount/100)),2) or 0.00),
# TODO: Falta agregar discount
}
unidad = line.uos_id and line.uos_id.name or _('Unit(s)')
if unidad:
......@@ -1201,83 +1195,52 @@ class account_invoice(osv.Model):
"state of invoice not is draft & the date of invoice is "
"not empty")
)
if invoice_datetime < '2012-07-01':
return invoice_data_parent
invoice = self.browse(
cr, uid, ids, context={'date': invoice_datetime}
)[0]
city = invoice_data_parents and invoice_data_parents[0].get(
'Comprobante', {}).get('Emisor', {}).get('ExpedidoEn', {}).get(
'municipio', {}) or False
state = invoice_data_parents and invoice_data_parents[0].get(
'Comprobante', {}).get('Emisor', {}).get('ExpedidoEn', {}).get(
'estado', {}) or False
country = invoice_data_parents and invoice_data_parents[0].get(
'Comprobante', {}).get('Emisor', {}).get('ExpedidoEn', {}).get(
'pais', {}) or False
if city and state and country:
address = city + ' ' + state + ', ' + country
else:
invoice = self.browse(cr, uid, ids, context={
'date': invoice_datetime})[0]
city = invoice_data_parents and invoice_data_parents[0].get(
'Comprobante', {}).get('Emisor', {}).get('ExpedidoEn', {}).get(
'municipio', {}) or False
state = invoice_data_parents and invoice_data_parents[0].get(
'Comprobante', {}).get('Emisor', {}).get('ExpedidoEn', {}).get(
'estado', {}) or False
country = invoice_data_parents and invoice_data_parents[0].get(
'Comprobante', {}).get('Emisor', {}).get('ExpedidoEn', {}).get(
'pais', {}) or False
if city and state and country:
address = city + ' ' + state + ', ' + country
else:
raise osv.except_osv(
_('Address Incomplete!'),
_('Ckeck that the address of company issuing of fiscal '
'voucher is complete (City - State - Country)')
)
raise osv.except_osv(
_('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(
_('Missing Fiscal Regime!'),
_('The Fiscal Regime of the company issuing of fiscal '
'voucher is a data required')
)
if not invoice.company_emitter_id.partner_id.regimen_fiscal_id.name:
raise osv.except_osv(
_('Missing Fiscal Regime!'),
_('The Fiscal Regime of the company issuing of fiscal '
'voucher is a data required')
)
invoice_data_parents[0]['Comprobante'][
'xsi:schemaLocation'] = 'http://www.sat.gob.mx/cfd/2 http://www.sat.gob.mx/sitio_internet/cfd/2/cfdv22.xsd'
invoice_data_parents[0]['Comprobante']['version'] = '2.2'
invoice_data_parents[0]['Comprobante'][
'TipoCambio'] = invoice.rate or 1
invoice_data_parents[0]['Comprobante'][
'Moneda'] = invoice.currency_id.name or ''
invoice_data_parents[0]['Comprobante'][
'NumCtaPago'] = invoice.acc_payment.last_acc_number\
or 'No identificado'
invoice_data_parents[0]['Comprobante'][
'metodoDePago'] = invoice.pay_method_id.name or 'No identificado'
invoice_data_parents[0]['Comprobante']['Emisor']['RegimenFiscal'] = {
'Regimen': invoice.company_emitter_id.partner_id.\
regimen_fiscal_id.name or ''}
invoice_data_parents[0]['Comprobante']['LugarExpedicion'] = address
invoice_data_parents[0]['Comprobante'][
'xsi:schemaLocation'] = 'http://www.sat.gob.mx/cfd/2 http://www.sat.gob.mx/sitio_internet/cfd/2/cfdv22.xsd'
invoice_data_parents[0]['Comprobante']['version'] = '2.2'
invoice_data_parents[0]['Comprobante'][
'TipoCambio'] = invoice.rate or 1
invoice_data_parents[0]['Comprobante'][
'Moneda'] = invoice.currency_id.name or ''
invoice_data_parents[0]['Comprobante'][
'NumCtaPago'] = invoice.partner_bank_id.last_acc_number\
or 'No identificado'
invoice_data_parents[0]['Comprobante'][
'metodoDePago'] = invoice.payment_type.name or 'No identificado'
invoice_data_parents[0]['Comprobante']['Emisor']['RegimenFiscal'] = {
'Regimen': invoice.company_emitter_id.partner_id.\
regimen_fiscal_id.name or ''}
invoice_data_parents[0]['Comprobante']['LugarExpedicion'] = address
return invoice_data_parents
def onchange_partner_id(
self, cr, uid, ids, type, partner_id,
date_invoice=False, payment_term=False, partner_bank_id=False,
company_id=False
):
"""
@param type : Type of invoice
@param parter_id : Id of partner in the data base
@param date_invoice : Date of invoice
@param payment_term : Id of payment term to the invoice
@param partner_bank_id : Id of bank account that is used in the invoice
@param company_id : Id of the company from invoice
"""
res = super(account_invoice, self).onchange_partner_id(
cr, uid, ids, type,
partner_id, date_invoice, payment_term, partner_bank_id, company_id
)
partner_bank_obj = self.pool.get('res.partner.bank')
acc_partner_bank = False
if partner_id:
acc_partner_bank_ids = partner_bank_obj.search(
cr, uid, [('partner_id', '=', partner_id)], limit=1)
if acc_partner_bank_ids:
acc_partner_bank = acc_partner_bank_ids and partner_bank_obj.browse(
cr, uid, acc_partner_bank_ids)[0] or False
res['value'][
'acc_payment'] = acc_partner_bank and acc_partner_bank.id or False
return res
def invoice_validate(self, cr, uid, ids, context=None):
if context is None:
context = {}
......@@ -1380,16 +1343,16 @@ class account_invoice(osv.Model):
cr, uid, ids, context=context
)
def validate_cfdi_folio_fiscal(self, cr, uid, ids, data, context=None):
def validate_cfdi_folio_fiscal(self, cr, uid, ids, data):
# Webservice parameters
url = 'https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wsdl'
client = Client(url)
# Consume webservice
result = client.service.Consulta(
""""?re=%s&rr=%s&tt=%s&id=%s""" %
(data['vat_emitter']
or '', data['vat_receiver'] or '',
data['amount'] or 0.0, data['uuid'] or ''))
(data['vat_emitter'] or '', data['vat_receiver'] or '',
data['amount'] or 0.0, data['uuid'] or '')
)
result = result and result.Estado or ''
# If webservice does not return 'Vigente' state,
......
......@@ -188,7 +188,7 @@
<b>${_("Payment Method")}:</b>
</div>
<div class="act_as_cell">
${o.pay_method_id.name or 'Not Applicable'}
${o.payment_type.name or 'Not Applicable'}
</div>
</div>
<div class="act_as_row">
......
......@@ -25,6 +25,4 @@
#
##############################################################################
import pay_method
import partner
import invoice
......@@ -2,13 +2,12 @@
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
############################################################################
# Authors: Openpyme (<http://openpyme.mx>)
#
#
# Coded by: moylop260 (moylop260@vauxoo.com)
# Coded by: isaac (isaac@vauxoo.com)
############################################################################
# isaac (isaac@vauxoo.com)
# Agustín Cruz Lozano (agustin.cruz@openpyme.mx)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
......@@ -20,32 +19,34 @@
# 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/>.
# You should have received a copy of the GNU Affero General Public Licens
#
##############################################################################
{
"name" : "Agrega método de pago al partner y factura",
"version" : "1.0",
"author" : "Vauxoo",
"category" : "Localization/Mexico",
"description" : """Add "Payment Method" to partner and invoice,
it's used by l10n_mx_facturae module and "acc_payment" to invoice
"name": "MX Payment Method",
"version": "2.0",
"author": "OpenPyme",
"category": "Localization/Mexico",
"description": """
MX Paymet Method
================
Add "Payment Method" to partner and invoice, it's used by l10n_mx_facturae
module and "acc_payment" to invoice
""",
"website" : "www.vauxoo.com",
"license" : "AGPL-3",
"depends" : ["account", "l10n_mx_facturae_groups",
],
"demo" : [],
"data" : [
#"security/payment_method.xml",
"security/ir.model.access.csv",
"pay_method_view.xml",
"partner_view.xml",
"website": "www.openpyme.mx",
"license": "AGPL-3",
"depends": [
"account",
"account_payment_extension",
],
"demo": [
],
"data": [
"invoice_view.xml",
"data/payment_method_data.xml",
],
"installable" : True,
"active" : False,
"installable": True,
"active": False,
}
<?xml version="1.0" ?>
<openerp>
<data noupdate="1">
<record id="pay_method_efectivo" model="pay.method">
<data noupdate='1'>
<record id="pay_method_efectivo" model="payment.type">
<field name="name">Efectivo</field>
<field name="description">Efectivo</field>
<field name="code">EFE</field>
<field name="note">Efectivo</field>
<field name="suitable_bank_types" eval="[(6,0,[ref('base.bank_normal')])]" />
</record>
</data>
<data>
<record id="pay_method_transferencia_electronica" model="pay.method">
<record id="pay_method_transferencia_electronica" model="payment.type">
<field name="name">Transferencia Electrónica</field>
<field name="description">Transferencia Electrónica</field>
<field name="code">TE</field>
<field name="note">Transferencia Electrónica</field>
<field name="suitable_bank_types" eval="[(6,0,[ref('base.bank_normal')])]" />
</record>
</data>
<data>
<record id="pay_method_cheque" model="pay.method">
<record id="pay_method_cheque" model="payment.type">
<field name="name">Cheque</field>
<field name="description">Cheque</field>
<field name="code">CHK</field>
<field name="note">Cheque</field>
<field name="suitable_bank_types" eval="[(6,0,[ref('base.bank_normal')])]" />
</record>
</data>
<data>
<record id="pay_method_tarjeta_de_debito" model="pay.method">
<record id="pay_method_tarjeta_de_debito" model="payment.type">
<field name="name">Tarjeta de débito</field>
<field name="description">Tarjeta de débito</field>
<field name="code">TD</field>
<field name="note">Tarjeta de débito</field>
<field name="suitable_bank_types" eval="[(6,0,[ref('base.bank_normal')])]" />
</record>
</data>
<data>
<record id="pay_method_tarjeta_de_credito" model="pay.method">
<record id="pay_method_tarjeta_de_credito" model="payment.type">
<field name="name">Tarjeta de crédito</field>
<field name="description">Tarjeta de crédito</field>
<field name="code">TC</field>
<field name="note">Tarjeta de crédito</field>
<field name="suitable_bank_types" eval="[(6,0,[ref('base.bank_normal')])]" />
</record>
</data>
<data>
<record id="pay_method_monedero_electronico" model="pay.method">
<record id="pay_method_monedero_electronico" model="payment.type">
<field name="name">Monedero electrónico</field>
<field name="description">Monedero electrónico </field>
<field name="code">ME</field>
<field name="note">Monedero electrónico</field>
<field name="suitable_bank_types" eval="[(6,0,[ref('base.bank_normal')])]" />
</record>
</data>
</openerp>
# Spanish translation for openerp-mexico-localization
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
# This file is distributed under the same license as the openerp-mexico-localization package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * l10n_mx_payment_method
# es_MX.po <agustin.cruz@openpyme.mx>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: openerp-mexico-localization\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-11-08 03:15+0000\n"
"PO-Revision-Date: 2013-11-13 06:07+0000\n"
"Last-Translator: Federico Manuel Echeverri Choux <echeverrifm@gmail.com>\n"
"Language-Team: Spanish <es@li.org>\n"
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-12-07 05:39+0000\n"
"PO-Revision-Date: 2014-12-06 23:40-0500\n"
"Last-Translator: es_MX.po <agustin.cruz@openpyme.mx>\n"
"Language-Team: Laptop\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Virtaal 0.7.1\n"
"X-Launchpad-Export-Date: 2014-02-14 07:51+0000\n"
"X-Generator: Launchpad (build 16916)\n"
#. module: l10n_mx_payment_method
#: model:ir.model,name:l10n_mx_payment_method.model_pay_method
msgid "pay.method"
msgstr "pay.method"
#. module: l10n_mx_payment_method
#: field:account.invoice,pay_method_id:0
#: model:ir.actions.act_window,name:l10n_mx_payment_method.action_pay_method
#: model:ir.ui.menu,name:l10n_mx_payment_method.cfd_22_metodos_pago
#: view:pay.method:0
#: field:pay.method,name:0
#: field:res.partner,pay_method_id:0
msgid "Payment Method"
msgstr "Método de pago"
#. module: l10n_mx_payment_method
#: field:pay.method,description:0
msgid "Description"
msgstr "Descripción"
#. module: l10n_mx_payment_method
#: field:account.invoice,acc_payment:0
msgid "Account Number"
msgstr "Número de Cuenta"
#. module: l10n_mx_payment_method
#: help:account.invoice,pay_method_id:0
msgid ""
"Indicates the way it was paid or will be paid the invoice, "
"where the options could be: check, bank transfer, reservoir in "
" account bank, credit card, cash etc. If not know as will be "
" paid the invoice, leave empty and the XML show “Unidentified”."
msgstr ""
"Indica la forma en que se pagó o se pagará la factura, donde las opciones "
"podrían ser: cheque, transferencia bancaria, depósito en cuenta bancaria, "
"tarjeta de crédito, dinero en efectivo, etc Si no sabe como se paga la "
"factura, deje vacía y el XML muestra \"no identificada\"."
#: model:payment.type,name:l10n_mx_payment_method.pay_method_tarjeta_de_credito
#: model:payment.type,note:l10n_mx_payment_method.pay_method_tarjeta_de_credito
msgid "Tarjeta de crédito"
msgstr "Tarjeta de crédito"
#. module: l10n_mx_payment_method
#: help:res.partner,pay_method_id:0
msgid ""
"Indicates the way it was paid or will be paid the invoice, "
"where the options could be: check, bank transfer, reservoir in "
" account bank, credit card, cash etc. If not know as will be "
" paid the invoice, leave empty and the XML show “Unidentified”."
msgstr ""
"Indica la forma en que se pagó o se pagará la factura, donde las opciones "
"podrían ser: cheque, transferencia bancaria, depósito en cuenta bancaria, "
"tarjeta de crédito, dinero en efectivo, etc Si no sabe como se paga la "
"factura, deje vacía y el XML muestra \"no identificada\"."
#: model:payment.type,name:l10n_mx_payment_method.pay_method_monedero_electronico
#: model:payment.type,note:l10n_mx_payment_method.pay_method_monedero_electronico
msgid "Monedero electrónico"
msgstr "Monedero electrónico"
#. module: l10n_mx_payment_method
#: help:account.invoice,acc_payment:0
msgid ""
"Is the account with which the client pays the invoice, if "
"not know which account will used for pay leave empty and the "
"XML will show \"“Unidentified”\"."
msgstr ""
"Es la cuenta con la que el cliente paga la factura, si no sabe qué cuenta se "
"utiliza para pagar dejar vacía y el XML mostrará \"\" no identificado \".\""
#: model:payment.type,name:l10n_mx_payment_method.pay_method_transferencia_electronica
#: model:payment.type,note:l10n_mx_payment_method.pay_method_transferencia_electronica
msgid "Transferencia Electrónica"
msgstr "Transferencia Electrónica"
#. module: l10n_mx_payment_method
#: model:ir.model,name:l10n_mx_payment_method.model_account_invoice
msgid "Invoice"
msgstr "Factura"
#. module: l10n_mx_payment_method
#: model:payment.type,name:l10n_mx_payment_method.pay_method_cheque
#: model:payment.type,note:l10n_mx_payment_method.pay_method_cheque
msgid "Cheque"
msgstr "Cheque"
#. module: l10n_mx_payment_method
#: model:ir.model,name:l10n_mx_payment_method.model_res_partner
msgid "Partner"
msgstr "Empresa"
#. module: l10n_mx_payment_method
#: model:payment.type,name:l10n_mx_payment_method.pay_method_tarjeta_de_debito
#: model:payment.type,note:l10n_mx_payment_method.pay_method_tarjeta_de_debito
msgid "Tarjeta de débito"
msgstr "Tarjeta de débito"
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * l10n_mx_payment_method
#
# * l10n_mx_payment_method
# es_MX.po <agustin.cruz@openpyme.mx>, 2014.
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:31+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"POT-Creation-Date: 2014-12-07 05:39+0000\n"
"PO-Revision-Date: 2014-12-06 23:40-0500\n"
"Last-Translator: es_MX.po <agustin.cruz@openpyme.mx>\n"
"Language-Team: Laptop\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Virtaal 0.7.1\n"
"X-Launchpad-Export-Date: 2014-02-14 07:51+0000\n"
"X-Generator: Launchpad (build 16916)\n"
#. module: l10n_mx_payment_method
#: model:ir.model,name:l10n_mx_payment_method.model_pay_method
msgid "pay.method"
msgstr ""
#. module: l10n_mx_payment_method
#: field:account.invoice,pay_method_id:0
#: model:ir.actions.act_window,name:l10n_mx_payment_method.action_pay_method
#: model:ir.ui.menu,name:l10n_mx_payment_method.cfd_22_metodos_pago
#: view:pay.method:0
#: field:pay.method,name:0
#: field:res.partner,pay_method_id:0
msgid "Payment Method"
msgstr ""
msgstr "Método de pago"
#. module: l10n_mx_payment_method
#: field:pay.method,description:0
msgid "Description"
msgstr ""
#. module: l10n_mx_payment_method
#: field:account.invoice,acc_payment:0
msgid "Account Number"
msgstr ""
#. module: l10n_mx_payment_method
#: help:account.invoice,pay_method_id:0
msgid ""
"Indicates the way it was paid or will be paid the invoice, "
"where the options could be: check, bank transfer, reservoir in "
" account bank, credit card, cash etc. If not know as will be "
" paid the invoice, leave empty and the XML show “Unidentified”."
msgstr ""
#: model:payment.type,name:l10n_mx_payment_method.pay_method_tarjeta_de_credito
#: model:payment.type,note:l10n_mx_payment_method.pay_method_tarjeta_de_credito
msgid "Tarjeta de crédito"
msgstr "Tarjeta de crédito"
#. module: l10n_mx_payment_method
#: help:res.partner,pay_method_id:0
msgid ""
"Indicates the way it was paid or will be paid the invoice, "
"where the options could be: check, bank transfer, reservoir in "
" account bank, credit card, cash etc. If not know as will be "
" paid the invoice, leave empty and the XML show “Unidentified”."
msgstr ""
#: model:payment.type,name:l10n_mx_payment_method.pay_method_monedero_electronico
#: model:payment.type,note:l10n_mx_payment_method.pay_method_monedero_electronico
msgid "Monedero electrónico"
msgstr "Monedero electrónico"
#. module: l10n_mx_payment_method
#: help:account.invoice,acc_payment:0
msgid ""
"Is the account with which the client pays the invoice, if "
"not know which account will used for pay leave empty and the "
"XML will show \"“Unidentified”\"."
msgstr ""
#: model:payment.type,name:l10n_mx_payment_method.pay_method_transferencia_electronica
#: model:payment.type,note:l10n_mx_payment_method.pay_method_transferencia_electronica
msgid "Transferencia Electrónica"
msgstr "Transferencia Electrónica"
#. module: l10n_mx_payment_method
#: model:ir.model,name:l10n_mx_payment_method.model_account_invoice
msgid "Invoice"
msgstr ""
msgstr "Factura"
#. module: l10n_mx_payment_method
#: model:payment.type,name:l10n_mx_payment_method.pay_method_cheque
#: model:payment.type,note:l10n_mx_payment_method.pay_method_cheque
msgid "Cheque"
msgstr "Cheque"
#. module: l10n_mx_payment_method
#: model:ir.model,name:l10n_mx_payment_method.model_res_partner
msgid "Partner"
msgstr ""
msgstr "Empresa"
#. module: l10n_mx_payment_method
#: model:payment.type,name:l10n_mx_payment_method.pay_method_tarjeta_de_debito
#: model:payment.type,note:l10n_mx_payment_method.pay_method_tarjeta_de_debito
msgid "Tarjeta de débito"
msgstr "Tarjeta de débito"
......@@ -6,15 +6,14 @@ 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:31+0000\n"
"POT-Creation-Date: 2014-12-07 05:39+0000\n"
"PO-Revision-Date: 2014-12-07 05:39+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"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: l10n_mx_payment_method
#: model:ir.model,name:l10n_mx_payment_method.model_pay_method
......@@ -22,57 +21,42 @@ msgid "pay.method"
msgstr ""
#. module: l10n_mx_payment_method
#: field:account.invoice,pay_method_id:0
#: model:ir.actions.act_window,name:l10n_mx_payment_method.action_pay_method
#: model:ir.ui.menu,name:l10n_mx_payment_method.cfd_22_metodos_pago
#: view:pay.method:0
#: field:pay.method,name:0
#: field:res.partner,pay_method_id:0
msgid "Payment Method"
#: model:payment.type,name:l10n_mx_payment_method.pay_method_tarjeta_de_credito
#: model:payment.type,note:l10n_mx_payment_method.pay_method_tarjeta_de_credito
msgid "Tarjeta de crédito"
msgstr ""
#. module: l10n_mx_payment_method
#: field:pay.method,description:0
msgid "Description"
#: model:payment.type,name:l10n_mx_payment_method.pay_method_monedero_electronico
#: model:payment.type,note:l10n_mx_payment_method.pay_method_monedero_electronico
msgid "Monedero electrónico"
msgstr ""
#. module: l10n_mx_payment_method
#: field:account.invoice,acc_payment:0
msgid "Account Number"
#: model:payment.type,name:l10n_mx_payment_method.pay_method_transferencia_electronica
#: model:payment.type,note:l10n_mx_payment_method.pay_method_transferencia_electronica
msgid "Transferencia Electrónica"
msgstr ""
#. module: l10n_mx_payment_method
#: help:account.invoice,pay_method_id:0
msgid ""
"Indicates the way it was paid or will be paid the invoice, "
"where the options could be: check, bank transfer, reservoir in "
" account bank, credit card, cash etc. If not know as will be "
" paid the invoice, leave empty and the XML show “Unidentified”."
#: model:ir.model,name:l10n_mx_payment_method.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: l10n_mx_payment_method
#: help:res.partner,pay_method_id:0
msgid ""
"Indicates the way it was paid or will be paid the invoice, "
"where the options could be: check, bank transfer, reservoir in "
" account bank, credit card, cash etc. If not know as will be "
" paid the invoice, leave empty and the XML show “Unidentified”."
#: model:payment.type,name:l10n_mx_payment_method.pay_method_cheque
#: model:payment.type,note:l10n_mx_payment_method.pay_method_cheque
msgid "Cheque"
msgstr ""
#. module: l10n_mx_payment_method
#: help:account.invoice,acc_payment:0
msgid ""
"Is the account with which the client pays the invoice, if "
"not know which account will used for pay leave empty and the "
"XML will show \"“Unidentified”\"."
#: model:ir.model,name:l10n_mx_payment_method.model_res_partner
msgid "Partner"
msgstr ""
#. module: l10n_mx_payment_method
#: model:ir.model,name:l10n_mx_payment_method.model_account_invoice
msgid "Invoice"
#: model:payment.type,name:l10n_mx_payment_method.pay_method_tarjeta_de_debito
#: model:payment.type,note:l10n_mx_payment_method.pay_method_tarjeta_de_debito
msgid "Tarjeta de débito"
msgstr ""
#. module: l10n_mx_payment_method
#: model:ir.model,name:l10n_mx_payment_method.model_res_partner
msgid "Partner"
msgstr ""
......@@ -2,13 +2,12 @@
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
############################################################################
# Authors: Openpyme (<http://openpyme.mx>)
#
#
# Coded by: moylop260 (moylop260@vauxoo.com)
# Coded by: isaac (isaac@vauxoo.com)
############################################################################
# isaac (isaac@vauxoo.com)
# Agustín Cruz Lozano (agustin.cruz@openpyme.mx)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
......@@ -20,56 +19,22 @@
# 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/>.
# You should have received a copy of the GNU Affero General Public Licens
#
##############################################################################
from openerp.tools.translate import _
from openerp.osv import fields, osv
from openerp import tools
from openerp import netsvc
from openerp import release
import time
from xml.dom import minidom
import os
import base64
import hashlib
import tempfile
import codecs
from datetime import datetime
class account_invoice(osv.Model):
_inherit = 'account.invoice'
def onchange_partner_id(self, cr, uid, ids, type, partner_id,
date_invoice=False, payment_term=False, partner_bank_id=False,
company_id=False):
res = super(account_invoice, self).onchange_partner_id(cr, uid, ids,
type, partner_id, date_invoice, payment_term, partner_bank_id,
company_id)
pay_method_id = False
if partner_id:
partner_obj = self.pool.get('res.partner')
partner = partner_obj.browse(cr, uid, partner_id)
pay_method_id = partner and partner.pay_method_id and \
partner.pay_method_id.id or False
res['value']['pay_method_id'] = pay_method_id
return res
_columns = {
'pay_method_id': fields.many2one('pay.method', 'Payment Method',
readonly=True, states={'draft': [('readonly', False)]},
help='Indicates the way it was paid or will be paid the invoice,\
where the options could be: check, bank transfer, reservoir in \
account bank, credit card, cash etc. If not know as will be \
paid the invoice, leave empty and the XML show “Unidentified”.'),
'acc_payment': fields.many2one('res.partner.bank', 'Account Number',
readonly=True, states={'draft': [('readonly', False)]},
help='Is the account with which the client pays the invoice, \
if not know which account will used for pay leave empty and \
the XML will show "“Unidentified”".'),
'payment_type': fields.many2one(
'payment.type', 'Payment type',
help='Indicates the way it was paid or will be paid the invoice,'
'where the options could be: check, bank transfer, reservoir in '
'account bank, credit card, cash etc. If not know as will be '
'paid the invoice, leave empty and the XML show “Unidentified”.'
),
}
......@@ -5,12 +5,15 @@
<record model="ir.ui.view" id="view_account_invoice_form_inh_payment_method_22">
<field name="name">view.account.invoice.form.inh.payment_method_22</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="inherit_id" ref="account_payment_extension.invoice_form3"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='fiscal_position']" position="after">
<newline/>
<field name="pay_method_id" colspan="2" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/>
<field name="acc_payment" colspan="2" domain = "[('partner_id', '=', partner_id)]" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/>
<field name="partner_bank_id" position="replace"></field>
<xpath expr="//field[@name='payment_type']" position="replace">
<field name="payment_type" domain="[('company_id', '=', company_id)]"
on_change="onchange_payment_type(payment_type, partner_id)"
attrs="{'readonly': [('state', '=', 'paid')]}"
/>
<field name="partner_bank_id" domain="[('partner_id', '=', partner_id)]" on_change="onchange_partner_bank(partner_bank_id)"/>
</xpath>
</field>
</record>
......@@ -19,12 +22,15 @@
<record model="ir.ui.view" id="view_account_invoice_supplier_form_inh_payment_method_22">
<field name="name">view.account.invoice.supplier.form.inh.payment_method_22</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="inherit_id" ref="account_payment_extension.invoice_supplier_form2"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='fiscal_position']" position="after">
<newline/>
<field name="pay_method_id" colspan="2" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/>
<field name="acc_payment" colspan="2" domain = "[('partner_id', '=', partner_id)]" groups="l10n_mx_facturae_groups.group_l10n_mx_facturae_user"/>
<field name="partner_bank_id" position="replace"></field>
<xpath expr="//field[@name='payment_type']" position="replace">
<field name="payment_type" domain="[('company_id', '=', company_id)]"
on_change="onchange_payment_type(payment_type, partner_id)"
attrs="{'readonly': [('state', '=', 'paid')]}"
/>
<field name="partner_bank_id" domain="[('partner_id', '=', partner_id)]" on_change="onchange_partner_bank(partner_bank_id)"/>
</xpath>
</field>
</record>
......
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
############################################################################
# Coded by: moylop260 (moylop260@vauxoo.com)
# Coded by: isaac (isaac@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 time
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp import pooler, tools
from openerp import netsvc
from openerp import release
class res_partner(osv.Model):
_inherit = 'res.partner'
_columns = {
'pay_method_id': fields.many2one('pay.method', 'Payment Method',
help='Indicates the way it was paid or will be paid the invoice, \
where the options could be: check, bank transfer, reservoir in \
account bank, credit card, cash etc. If not know as will be \
paid the invoice, leave empty and the XML show “Unidentified”.'),
}
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_partner_form_inh_xml22">
<field name="name">view.partner.form.inh.xml22</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='property_payment_term']" position="before">
<field name="pay_method_id" colspan="2"/>
</xpath>
</field>
</record>
</data>
</openerp>
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
############################################################################
# Coded by: moylop260 (moylop260@vauxoo.com)
# Coded by: isaac (isaac@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 fields, osv
from openerp.tools.translate import _
from openerp import pooler, tools
import time
class pay_method(osv.Model):
_name = 'pay.method'
_columns = {
'name': fields.char('Payment Method', size=128),
'description': fields.text('Description'),
}
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_pay_method_form" model="ir.ui.view">
<field name="name">view.pay.method.form</field>
<field name="model">pay.method</field>
<field name="arch" type="xml">
<form string="Payment Method">
<field name="name"/>
<field name="description"/>
</form>
</field>
</record>
<record id="view_pay_method_tree" model="ir.ui.view">
<field name="name">view.pay.method.tree</field>
<field name="model">pay.method</field>
<field name="arch" type="xml">
<tree string="Payment Method">
<field name="name" select="1"/>
<field name="description"/>
</tree>
</field>
</record>
<record id="action_pay_method" model="ir.actions.act_window">
<field name="name">Payment Method</field>
<field name="res_model">pay.method</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
id="cfd_22_metodos_pago" name="Payment Method" parent='base.menu_config_address_book' sequence="50"
action='action_pay_method'
/>
</data>
</openerp>
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_l10n_mx_facturae_groups_manager,catalog_payment_method_l10n_mx_facturae_groups_manager,model_pay_method,l10n_mx_facturae_groups.group_l10n_mx_facturae_manager,1,1,1,1
access_l10n_mx_facturae_groups_user,catalog_payment_method_l10n_mx_facturae_groups_user,model_pay_method,l10n_mx_facturae_groups.group_l10n_mx_facturae_user,1,,,
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="res.groups" id="group_payment_method_manager">
<field name="name">Payment Method / Manager</field>
</record>
<record model="res.groups" id="group_payment_method_user">
<field name="name">Payment Method / User</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