From 91d1f4d5b507f8387127c7e152974c434d920364 Mon Sep 17 00:00:00 2001 From: Sebastian Kennedy <skennedy@e-mips.com.ar> Date: Mon, 1 Apr 2019 17:59:31 -0300 Subject: [PATCH 1/3] [MOD] comment --- models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/account_invoice.py b/models/account_invoice.py index 9138f4d..fdc38f2 100644 --- a/models/account_invoice.py +++ b/models/account_invoice.py @@ -505,7 +505,7 @@ class AccountInvoice(models.Model): invoice_synchronized = self.synchronize_liquidation( ws, inv.pos_ar_id.name, number_to_synchro) - # If invoice synchronized is THIS invoice + # If invoice synchronized is not THIS invoice # re validate THIS inv if invoice_synchronized != inv: invoice_to_validate = inv -- GitLab From 586f2afcb66fccbe3a6b8be207581db3e06d91aa Mon Sep 17 00:00:00 2001 From: Sebastian Kennedy <skennedy@e-mips.com.ar> Date: Thu, 16 May 2019 08:57:30 -0300 Subject: [PATCH 2/3] [MOD] Adapt code to module l10n_ar_invoice_registration_date --- models/account_invoice.py | 1 + models/res_company.py | 1 + views/account_invoice_view.xml | 3 ++- wizard/purchase_data_performance_wizard.py | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/models/account_invoice.py b/models/account_invoice.py index 9138f4d..8bdb606 100644 --- a/models/account_invoice.py +++ b/models/account_invoice.py @@ -211,6 +211,7 @@ class AccountInvoice(models.Model): if not inv.date_invoice: inv.write({ 'date_invoice': fields.Date.context_today(self), + 'real_date_invoice': fields.Date.context_today(self), }) return True diff --git a/models/res_company.py b/models/res_company.py index 1170d1f..a8d0599 100644 --- a/models/res_company.py +++ b/models/res_company.py @@ -24,6 +24,7 @@ from openerp import _, api, exceptions, fields, models from openerp.exceptions import except_orm +# TODO: Use ruca on SlaughteringEstablishment from rafalim_cattle_ranch class ResCompany(models.Model): _inherit = 'res.company' diff --git a/views/account_invoice_view.xml b/views/account_invoice_view.xml index 98acc06..c77bfd8 100644 --- a/views/account_invoice_view.xml +++ b/views/account_invoice_view.xml @@ -57,7 +57,8 @@ <field name="is_lsp" invisible="1"/> </group> <group> - <field name="date_invoice" on_change="onchange_payment_term_date_invoice(payment_term, date_invoice)" /> + <field name="date_invoice" string="Registration Date" on_change="onchange_payment_term_date_invoice(payment_term, date_invoice)" /> + <field name="real_date_invoice"/> <field name="date_due"/> <field name="pos_ar_id" attrs="{'required': True}"/> <field name="cae" string="CAI"/> diff --git a/wizard/purchase_data_performance_wizard.py b/wizard/purchase_data_performance_wizard.py index a4e1f90..8f30e17 100644 --- a/wizard/purchase_data_performance_wizard.py +++ b/wizard/purchase_data_performance_wizard.py @@ -32,6 +32,7 @@ class PurchaseDataPerformanceWizardd(models.TransientModel): fiscal_position = fiscal_position_model.browse( fiscal_position_id) invoice_vals['denomination_id'] = fiscal_position.denomination_id.id + invoice_vals['date_invoice'] = invoice_vals['real_date_invoice'] res['is_lsp'] = is_lsp return res @@ -87,6 +88,7 @@ class PurchaseDataPerformanceWizard(models.TransientModel): fiscal_position = fiscal_position_model.browse( fiscal_position_id) invoice_vals['denomination_id'] = fiscal_position.denomination_id.id + invoice_vals['date_invoice'] = invoice_vals['real_date_invoice'] res['is_lsp'] = is_lsp return res -- GitLab From 157b1306dad3ed06d501d666fd9883fadeecacc8 Mon Sep 17 00:00:00 2001 From: gbertolani <gaston.bertolani@gmail.com> Date: Fri, 30 Aug 2019 12:04:33 -0300 Subject: [PATCH 3/3] [ADD]Send mail - autoliquidation --- __openerp__.py | 1 + data/mail_template_data.xml | 73 ++++++ i18n/es_AR.po | 409 +++++++++++++++++++++------------ models/account_invoice.py | 63 ++++- views/account_invoice_view.xml | 8 + 5 files changed, 401 insertions(+), 153 deletions(-) create mode 100644 data/mail_template_data.xml diff --git a/__openerp__.py b/__openerp__.py index c71a8a4..e3ebeb3 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -32,6 +32,7 @@ "data": [ "data/wslsp_data.xml", "data/groups_data.xml", + "data/mail_template_data.xml", "views/company_view.xml", "views/wslsp_view.xml", "views/ranch_expenses_type_view.xml", diff --git a/data/mail_template_data.xml b/data/mail_template_data.xml new file mode 100644 index 0000000..e9c4419 --- /dev/null +++ b/data/mail_template_data.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" ?> +<openerp> + <data noupdate="1"> + <!--Email template --> + <record id="mail_autoliquidation_template" model="email.template"> + <field name="name">WSLSP Autoliquidation - Send by Email</field> + <field name="email_from">${(object.user_id.email or object.company_id.email or 'noreply@localhost')|safe}</field> + <field name="subject"> + No Reply - Autoliquidation (Ref ${reference}) + </field> + <field name="partner_to">${object.partner_id.id}</field> + <field name="model_id" ref="account.model_account_invoice"/> + <field name="auto_delete" eval="True"/> + <field name="lang">${object.partner_id.lang}</field> + <field name="body_html"><![CDATA[ +<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> + + <p>Hello ${object.partner_id.name},</p> + + <p>A new autoliquidation is available for you: </p> + + <p style="border-left: 1px solid #8e0000; margin-left: 30px;"> + <strong>REFERENCES</strong><br /> + number: <strong>${object.internal_number}</strong><br /> + Amount Total: <strong>${object.amount_total} ${object.currency_id.name}</strong><br /> + ${doc_type} date: ${object.date_invoice}<br /> + % if object.origin: + Order reference: ${object.origin}<br /> + % endif + </p> + + <br/> + <p>If you have any question, do not hesitate to contact us.</p> + <p>Thank you for choosing ${object.company_id.name or 'us'}!</p> + <br/> + <br/> + <div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;"> + <h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;"> + <strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3> + </div> + <div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;"> + <span style="color: #222; margin-bottom: 5px; display: block; "> + % if object.company_id.street: + ${object.company_id.street}<br/> + % endif + % if object.company_id.street2: + ${object.company_id.street2}<br/> + % endif + % if object.company_id.city or object.company_id.zip: + ${object.company_id.zip} ${object.company_id.city}<br/> + % endif + % if object.company_id.country_id: + ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> + % endif + </span> + % if object.company_id.phone: + <div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> + Phone: ${object.company_id.phone} + </div> + % endif + % if object.company_id.website: + <div> + Web : <a href="${object.company_id.website}">${object.company_id.website}</a> + </div> + %endif + <p></p> + </div> + <p><strong>Reply to administracionhacienda@rafalim.com</strong></p> +</div> + ]]></field> + </record> + </data> +</openerp> diff --git a/i18n/es_AR.po b/i18n/es_AR.po index 6ed9438..ce1c5e8 100644 --- a/i18n/es_AR.po +++ b/i18n/es_AR.po @@ -17,19 +17,149 @@ msgstr "" "Last-Translator: \n" "Language: es_419\n" +#. module: l10n_ar_wslsp +#: model:email.template,subject:l10n_ar_wslsp.mail_autoliquidation_template +msgid "\n" +" No Reply - Autoliquidation (Ref ${reference})\n" +" " +msgstr "\n" +" No Responder - Autoliquidación (Ref ${reference})\n" +" " + +#. module: l10n_ar_wslsp +#: model:email.template,body_html:l10n_ar_wslsp.mail_autoliquidation_template +msgid "\n" +"<div style=\"font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n" +"\n" +" <p>Hello ${object.partner_id.name},</p>\n" +"\n" +" <p>A new autoliquidation is available for you: </p>\n" +"\n" +" <p style=\"border-left: 1px solid #8e0000; margin-left: 30px;\">\n" +" <strong>REFERENCES</strong><br />\n" +" number: <strong>${object.internal_number}</strong><br />\n" +" Amount Total: <strong>${object.amount_total} ${object.currency_id.name}</strong><br />\n" +" ${doc_type} date: ${object.date_invoice}<br />\n" +" % if object.origin:\n" +" Order reference: ${object.origin}<br />\n" +" % endif\n" +" </p>\n" +"\n" +" <br/>\n" +" <p>If you have any question, do not hesitate to contact us.</p>\n" +" <p>Thank you for choosing ${object.company_id.name or 'us'}!</p>\n" +" <br/>\n" +" <br/>\n" +" <div style=\"width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;\">\n" +" <h3 style=\"margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;\">\n" +" <strong style=\"text-transform:uppercase;\">${object.company_id.name}</strong></h3>\n" +" </div>\n" +" <div style=\"width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;\">\n" +" <span style=\"color: #222; margin-bottom: 5px; display: block; \">\n" +" % if object.company_id.street:\n" +" ${object.company_id.street}<br/>\n" +" % endif\n" +" % if object.company_id.street2:\n" +" ${object.company_id.street2}<br/>\n" +" % endif\n" +" % if object.company_id.city or object.company_id.zip:\n" +" ${object.company_id.zip} ${object.company_id.city}<br/>\n" +" % endif\n" +" % if object.company_id.country_id:\n" +" ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>\n" +" % endif\n" +" </span>\n" +" % if object.company_id.phone:\n" +" <div style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; \">\n" +" Phone: ${object.company_id.phone}\n" +" </div>\n" +" % endif\n" +" % if object.company_id.website:\n" +" <div>\n" +" Web : <a href=\"${object.company_id.website}\">${object.company_id.website}</a>\n" +" </div>\n" +" %endif\n" +" <p></p>\n" +" </div>\n" +" <p><strong>Reply to administracionhacienda@rafalim.com</strong></p>\n" +"</div>\n" +" " +msgstr "\n" +"<div style=\"font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n" +"\n" +" <p>Hola ${object.partner_id.name},</p>\n" +"\n" +" <p>Una nueva autoliquidación está disponible para usted: </p>\n" +"\n" +" <p style=\"border-left: 1px solid #8e0000; margin-left: 30px;\">\n" +" <strong>REFERENCIAS</strong><br />\n" +" Número: <strong>${object.internal_number}</strong><br />\n" +" Monto Total: <strong>${object.amount_total} ${object.currency_id.name}</strong><br />\n" +" ${doc_type} Fecha: ${object.date_invoice}<br />\n" +" % if object.origin:\n" +" Orden de Referencia: ${object.origin}<br />\n" +" % endif\n" +" </p>\n" +"\n" +" <br/>\n" +" <p>Si usted tiene cualquier pregunta, no dude en ponerse en contacto con nosotros.</p>\n" +" <p>Gracias por elegir ${object.company_id.name or 'us'}!</p>\n" +" <br/>\n" +" <br/>\n" +" <div style=\"width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;\">\n" +" <h3 style=\"margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;\">\n" +" <strong style=\"text-transform:uppercase;\">${object.company_id.name}</strong></h3>\n" +" </div>\n" +" <div style=\"width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;\">\n" +" <span style=\"color: #222; margin-bottom: 5px; display: block; \">\n" +" % if object.company_id.street:\n" +" ${object.company_id.street}<br/>\n" +" % endif\n" +" % if object.company_id.street2:\n" +" ${object.company_id.street2}<br/>\n" +" % endif\n" +" % if object.company_id.city or object.company_id.zip:\n" +" ${object.company_id.zip} ${object.company_id.city}<br/>\n" +" % endif\n" +" % if object.company_id.country_id:\n" +" ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>\n" +" % endif\n" +" </span>\n" +" % if object.company_id.phone:\n" +" <div style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; \">\n" +" Telefono: ${object.company_id.phone}\n" +" </div>\n" +" % endif\n" +" % if object.company_id.website:\n" +" <div>\n" +" Web : <a href=\"${object.company_id.website}\">${object.company_id.website}</a>\n" +" </div>\n" +" %endif\n" +" <p></p>\n" +" </div>\n" +" <p><strong>Responder a administracionhacienda@rafalim.com</strong></p>\n" +"</div>\n" +" " + #. module: l10n_ar_wslsp #: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form msgid "(update)" msgstr "(actualizar)" #. module: l10n_ar_wslsp +#: field:ranch.commision.config,afip_code_id:0 #: field:ranch.expenses.type,afip_code_id:0 #: field:ranch.species,afip_code_id:0 msgid "AFIP code" msgstr "Código AFIP" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:119 +#: field:wslsp.category.codes,active:0 +msgid "Active" +msgstr "Active" + +#. module: l10n_ar_wslsp +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:128 #, python-format msgid "Activity Date is greater than today" msgstr "La fecha de inicio de actividad es mayor que la fecha de hoy" @@ -42,10 +172,10 @@ msgstr "Kilo Vivo" #. module: l10n_ar_wslsp #: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form msgid "Amounts" -msgstr "Montos" +msgstr "Cantidades" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:270 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:289 #, python-format msgid "An unexpected error has occurred!! \n" "" @@ -72,8 +202,6 @@ msgstr "Autorizar liquidacion a la AFIP" #. module: l10n_ar_wslsp #: field:wslsp.liquidation_type.codes,billing_type:0 -#: field:wslsp.motive.codes,billing_type:0 -#: field:wslsp.operation.codes,billing_type:0 msgid "Billing Type" msgstr "Tipo de Facturación" @@ -115,7 +243,12 @@ msgid "Cattle" msgstr "Vacuno" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:178 +#: help:account.invoice,disable_perceptions:0 +msgid "Check this if you want to disable automatic calculation of perceptions on this invoice" +msgstr "Check this if you want to disable automatic calculation of perceptions on this invoice" + +#. module: l10n_ar_wslsp +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:187 #, python-format msgid "Chore Date is less than Receipt Date" msgstr "La fecha de faena es menor que la fecha de recepción" @@ -126,6 +259,7 @@ msgid "Client Invoice" msgstr "Factura de Cliente" #. module: l10n_ar_wslsp +#: field:ranch.commision.config,code:0 #: field:wslsp.breed.codes,code:0 #: field:wslsp.category.codes,code:0 #: field:wslsp.cut.codes,code:0 @@ -140,13 +274,19 @@ msgstr "Factura de Cliente" msgid "Code" msgstr "Código" +#. module: l10n_ar_wslsp +#: code:addons/l10n_ar_wslsp/models/ranch_commision_config.py:40 +#, python-format +msgid "Commision %s does not have configured afip code" +msgstr "Comisión %s no tiene configurado un código AFIP" + #. module: l10n_ar_wslsp #: model:ir.model,name:l10n_ar_wslsp.model_res_company msgid "Companies" msgstr "CompañÃas" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/wslsp.py:95 +#: code:addons/l10n_ar_wslsp/models/wslsp.py:100 #, python-format msgid "Company Error!" msgstr "Error de la compañÃa!" @@ -215,18 +355,13 @@ msgstr "Cuit" msgid "Cuts" msgstr "Cortes" -#. module: l10n_ar_wslsp -#: field:account.invoice,dte:0 -msgid "DTE" -msgstr "DTE" - #. module: l10n_ar_wslsp #: field:wslsp.voucher_type.codes,denomination_id:0 msgid "Denomination" msgstr "Denominación" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:63 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:117 #, python-format msgid "Denomination not set in invoice" msgstr "La Denominacion no establecida en factura" @@ -246,6 +381,11 @@ msgstr "La Denominacion no establecida en factura" msgid "Desc" msgstr "Descripción" +#. module: l10n_ar_wslsp +#: field:account.invoice,disable_perceptions:0 +msgid "Disable perceptions" +msgstr "Deshabilitar Percepciones" + #. module: l10n_ar_wslsp #: field:wslsp.breed.codes,display_name:0 #: field:wslsp.category.codes,display_name:0 @@ -283,14 +423,14 @@ msgid "Email Thread" msgstr "Hilo de Mensajes" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:116 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:316 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:125 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:332 #, python-format msgid "Error" msgstr "Error" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:265 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:284 #, python-format msgid "Error [%s] \n" " Description: %s \n" @@ -302,7 +442,7 @@ msgstr "Error [%s] \n" "" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:311 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:570 #, python-format msgid "Error received was: \n" " %s" @@ -310,26 +450,27 @@ msgstr "El error recibido fue: \n" " %s" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:218 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:238 #, python-format msgid "Error when getting instance with key %s" msgstr "Error al obtener una instancia con key %s" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:699 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:866 #, python-format msgid "Error when validating the invoice. Please, see it and send the invoice again!" msgstr "Error al validar la factura. ¡Por favor, corrija los errores y envÃe la factura nuevamente!" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:109 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:112 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:153 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:157 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:161 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:167 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:173 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:189 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:117 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:120 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:166 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:170 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:174 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:180 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:186 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:202 +#: code:addons/l10n_ar_wslsp/models/ranch_commision_config.py:39 #: code:addons/l10n_ar_wslsp/models/ranch_expenses_type.py:46 #: code:addons/l10n_ar_wslsp/models/ranch_species.py:44 #: code:addons/l10n_ar_wslsp/wizard/purchase_romaneo_from_data_wizard.py:29 @@ -342,7 +483,7 @@ msgstr "Error!" #: code:addons/l10n_ar_wslsp/models/ranch_expenses_type.py:47 #, python-format msgid "Expense %s does not have configured afip expense" -msgstr "Expense %s does not have configured afip expense" +msgstr "Gasto %s no tiene configurado un gasto de AFIP" #. module: l10n_ar_wslsp #: view:wslsp.config:l10n_ar_wslsp.view_wslsp_config_form @@ -350,11 +491,6 @@ msgstr "Expense %s does not have configured afip expense" msgid "Expenses" msgstr "Gastos" -#. module: l10n_ar_wslsp -#: field:account.invoice,guide:0 -msgid "Guide" -msgstr "Guia" - #. module: l10n_ar_wslsp #: field:wslsp.config,homologation:0 msgid "Homologation" @@ -384,58 +520,58 @@ msgstr "Si es verdadero, habrá algunas validaciones que están deshabilitadas, #. module: l10n_ar_wslsp #: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form msgid "Information" -msgstr "Information" +msgstr "Información" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:173 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:182 #, python-format msgid "Invalid Chore Date" msgstr "Fecha de faena inválida" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:198 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:215 #, python-format msgid "Invalid DTE!" msgstr "DTE Inválido!" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:126 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:135 #, python-format msgid "Invalid Invoice Date" msgstr "Fecha de Factura inválida" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:149 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:158 #, python-format msgid "Invalid Operation Date" msgstr "Fecha de operación inválida" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:251 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:270 #, python-format msgid "Invalid Query Data" msgstr "Datos de consulta inválidos" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:166 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:175 #, python-format msgid "Invalid Receipt Date" msgstr "Fecha de Recepción inválida" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:161 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:170 #, python-format msgid "Invalid Reception Date" msgstr "Fecha de Recepción Inválida" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:205 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:225 #, python-format -msgid "Invalid Renspa!" -msgstr "Renspa Inválido!" +msgid "Invalid Renspa %s!" +msgstr "Invalid Renspa %s!" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:115 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:124 #, python-format msgid "Invalid start activity date" msgstr "Fecha de inicio de actividades inválida" @@ -447,10 +583,10 @@ msgid "Invoice" msgstr "Factura" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:140 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:149 #, python-format msgid "Invoice Date difference with today should be less than 10 days for product sales." -msgstr "Invoice Date difference with today should be less than 10 days for product sales." +msgstr "La diferencia entre la fecha de factura con la fecha de hoy debe ser menor a 10 dÃas para la venta de productos." #. module: l10n_ar_wslsp #: model:ir.model,name:l10n_ar_wslsp.model_account_invoice_line @@ -458,7 +594,7 @@ msgid "Invoice Line" msgstr "LÃnea de factura" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:48 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:104 #, python-format msgid "Invoice does not have a ranch purchase data associated" msgstr "Factura no tiene asociados datos de compra" @@ -476,7 +612,7 @@ msgstr "Es directo?" #. module: l10n_ar_wslsp #: field:account.invoice,is_lsp:0 msgid "Is LSP" -msgstr "Is LSP" +msgstr "Es LSP" #. module: l10n_ar_wslsp #: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form @@ -532,7 +668,7 @@ msgid "Last Updated on" msgstr "Ultima actualizacion en" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:365 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:79 #, python-format msgid "Line Invoice [%s] does not have a ranch purchase data associated" msgstr "La factura de lÃnea [%s] no tiene asociados los datos de compra" @@ -611,23 +747,21 @@ msgid "Perceptions" msgstr "Percepciones" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:358 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:353 #, python-format msgid "Perceptions amount has to be negative because it is a liquidation." msgstr "Los montos de Percepción deben ser negativos porque es una Liquidación." #. module: l10n_ar_wslsp #: selection:wslsp.liquidation_type.codes,billing_type:0 -#: selection:wslsp.motive.codes,billing_type:0 -#: selection:wslsp.operation.codes,billing_type:0 msgid "Performance" msgstr "Rendimiento" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:67 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:121 #, python-format msgid "Point of sale has not the same denomination as the invoice." -msgstr "El punto de venta no tiene la misma denominación que la factura" +msgstr "El punto de venta no tiene la misma denominación que la factura." #. module: l10n_ar_wslsp #: view:wslsp.config:l10n_ar_wslsp.view_wslsp_config_form @@ -647,10 +781,10 @@ msgstr "Puntos de Venta" #: selection:wslsp.participant_character.codes,ranch_type:0 #: selection:wslsp.tax.codes,ranch_type:0 msgid "Pork" -msgstr "Pork" +msgstr "Porcino" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:187 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:200 #, python-format msgid "Pos not found for invoice `%s` (id: %s)" msgstr "Punto de Venta no encontrado para la factura `%s` (id: %s)" @@ -714,15 +848,20 @@ msgid "Refund" msgstr "Reembolso" #. module: l10n_ar_wslsp -#: field:account.invoice,renspa:0 -msgid "Renspa" -msgstr "Renspa" +#: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form +msgid "Registration Date" +msgstr "Registration Date" #. module: l10n_ar_wslsp #: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form msgid "Responsible" msgstr "Responsable" +#. module: l10n_ar_wslsp +#: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form +msgid "Send Mail" +msgstr "Enviar Mail" + #. module: l10n_ar_wslsp #: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form msgid "Set to Draft" @@ -750,10 +889,16 @@ msgstr "Factura de proveedor" msgid "Supported Perceptions" msgstr "Percepciones soportadas" +#. module: l10n_ar_wslsp +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:433 +#, python-format +msgid "Synchronize process failed!" +msgstr "El proceso de sincronización falló!" + #. module: l10n_ar_wslsp #: help:wslsp.config,cuit:0 msgid "Tax Identification Number. Check the box if this contact is subjected to taxes. Used by the some of the legal statements." -msgstr "Número de identificación de impuestos. Marque la casilla si este contacto está sujeto a impuestos. Usado por algunas de las declaraciones legales" +msgstr "Número de identificación de impuestos. Marque la casilla si este contacto está sujeto a impuestos. Usado por algunas de las declaraciones legales." #. module: l10n_ar_wslsp #: field:wslsp.config,tax_ids:0 @@ -772,19 +917,19 @@ msgid "Taxes" msgstr "Impuestos" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:271 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:333 #, python-format msgid "The Invoice Number should be the format XXXX-XXXXXXXX" msgstr "El número de factura debe ser el formato XXXX-XXXXXXXX" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:71 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:126 #, python-format msgid "The invoice denomination does not corresponds with this fiscal position." -msgstr "La denominación de la factura no corresponde a esta posición fiscal" +msgstr "La denominación de la factura no corresponde a esta posición fiscal." #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:189 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:204 #, python-format msgid "The next number in the system [%d] does not match the one obtained from AFIP WSLSP [%d]" msgstr "El siguiente número en el sistema es el [%d] pero no corresponde con el proximo numero para AFIP WSLSP [%d]" @@ -792,41 +937,35 @@ msgstr "El siguiente número en el sistema es el [%d] pero no corresponde con el #. module: l10n_ar_wslsp #: code:addons/l10n_ar_wslsp/models/wslsp.py:120 #, python-format -msgid "The wslsp does not have a configuration for the categories [%s]" -msgstr "El wslsp no tiene una configuración para las categorÃas [%s]" - -#. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/wslsp.py:113 -#, python-format msgid "The wslsp does not have a configuration for the liquidation types [%s]" msgstr "El wslsp no tiene una configuracion para los tipos de liquidación [%s]" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/wslsp.py:106 +#: code:addons/l10n_ar_wslsp/models/wslsp.py:113 #, python-format -msgid "The wslsp does not have a configuration for the motives [%s]" -msgstr "El wslsp no tiene una configuracion para los motivos [%s]" +msgid "The wslsp does not have a configuration for the motives to autoliquidation" +msgstr "El wslsp no tiene una configuración para el motivo de autoliquidación" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/wslsp.py:127 +#: code:addons/l10n_ar_wslsp/models/wslsp.py:128 #, python-format msgid "The wslsp does not have a configuration for the operations [%s]" msgstr "El wslsp no tiene una configuracion para las operaciones [%s]" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/wslsp.py:135 +#: code:addons/l10n_ar_wslsp/models/wslsp.py:136 #, python-format msgid "The wslsp does not have a configuration for the tax [%s]" msgstr "El WSLSP no tiene una configuración para el impuesto [%s]" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:414 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:379 #, python-format msgid "The wslsp does not have a configuration for the tribute with code [%s]" msgstr "El WSLSP no tiene una configuración para el tributo con el código [%s]" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:152 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:153 #, python-format msgid "There are duplicated voucher types" msgstr "Hay tipos de voucher duplicados" @@ -838,34 +977,26 @@ msgid "There are romaneos with different troop number" msgstr "Hay romaneos con diferentes números de tropa" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:132 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:141 #, python-format msgid "There is another Invoice with a most recent date [%s] for the same Point of Sale and Denomination." msgstr "Hay otra Factura con una fecha más reciente [%s] para el mismo Punto de Venta y Denominación." #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/ranch_expenses_type.py:33 #: code:addons/l10n_ar_wslsp/models/ranch_species.py:38 -#: sql_constraint:ranch.expenses.type:0 #: sql_constraint:ranch.species:0 #, python-format msgid "There is another specie with same AFIP code" msgstr "Hay otra especie con el mismo código AFIP" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/wslsp.py:99 -#, python-format -msgid "There is no WSLSP configuration set to this company" -msgstr "No hay configuración WSLSP establecida para esta compañÃa" - -#. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/wslsp.py:95 +#: code:addons/l10n_ar_wslsp/models/wslsp.py:100 #, python-format msgid "There is no company being used by this user" msgstr "No hay ninguna compañÃa siendo utilizada por este usuario" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:95 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:148 #, python-format msgid "There is not configured voucher type with document[%s] Is Direct[%s] Denomination[%s]" msgstr "No hay un tipo de comprobante configurado con el documento [%s] Es directo [%s] Denominación [%s]" @@ -886,7 +1017,7 @@ msgid "URL for WSLSP" msgstr "URL para WSLSP" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:344 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:525 #, python-format msgid "VAT Number is same as your company so it cannot be informed to AFIP.Check Number of Point of Sale." msgstr "El CUIT es el mismo que su compañÃa y no puede ser informado a AFIP. Por favor, chequee el número del Punto de Venta." @@ -897,7 +1028,7 @@ msgid "Validate" msgstr "Validar" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:154 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:163 #, python-format msgid "Voucher Date is less that Operation Date" msgstr "La Fecha del Comprobante es menor que la Fecha de Operación" @@ -909,19 +1040,18 @@ msgid "Voucher Types" msgstr "Tipo de Comprobantes" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:115 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:119 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:126 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:139 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:149 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:153 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:161 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:166 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:173 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:177 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:188 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:198 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:205 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:124 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:128 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:135 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:148 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:158 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:162 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:170 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:175 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:182 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:186 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:215 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:225 #, python-format msgid "WSFE Error!" msgstr "WSFE Error!" @@ -929,12 +1059,12 @@ msgstr "WSFE Error!" #. module: l10n_ar_wslsp #: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form msgid "WSFE Request Details" -msgstr "WSLSP Detalles de Petición" +msgstr "WSFE Detalles de Solicitud" #. module: l10n_ar_wslsp #: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form msgid "WSFE Requests" -msgstr "WSLSP Peticiones" +msgstr "WSFE Peticiones" #. module: l10n_ar_wslsp #: model:ir.actions.act_window,name:l10n_ar_wslsp.action_pork_wslsp_autoliquidation @@ -968,12 +1098,11 @@ msgid "WSLSP Config" msgstr "WSLSP Configuración" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:413 -#: code:addons/l10n_ar_wslsp/models/wslsp.py:99 -#: code:addons/l10n_ar_wslsp/models/wslsp.py:105 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:378 #: code:addons/l10n_ar_wslsp/models/wslsp.py:112 #: code:addons/l10n_ar_wslsp/models/wslsp.py:119 -#: code:addons/l10n_ar_wslsp/models/wslsp.py:126 +#: code:addons/l10n_ar_wslsp/models/wslsp.py:127 +#: code:addons/l10n_ar_wslsp/models/wslsp.py:135 #, python-format msgid "WSLSP Config Error!" msgstr "WSLSP Error de Configuración!" @@ -994,16 +1123,22 @@ msgid "WSLSP Cuts" msgstr "WSLSP Cortes" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:47 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:94 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:98 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:364 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:357 -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:372 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:131 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:217 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:251 -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:277 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:432 +#, python-format +msgid "WSLSP Error" +msgstr "WSLSP Error" + +#. module: l10n_ar_wslsp +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:78 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:103 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:147 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:152 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:352 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:524 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:140 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:237 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:270 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:296 #, python-format msgid "WSLSP Error!" msgstr "WSLSP Error!" @@ -1019,7 +1154,7 @@ msgid "WSLSP Expenses Codes" msgstr "WSLSP Codigos de Gastos" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:698 +#: code:addons/l10n_ar_wslsp/wslsptools/wslsp_easywsy.py:865 #, python-format msgid "WSLSP Invoice Error" msgstr "WSLSP Error de Factura" @@ -1085,7 +1220,7 @@ msgid "WSLSP Taxes" msgstr "WSLSP Impuestos" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:310 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:569 #, python-format msgid "WSLSP Validation Error" msgstr "WSLSP Error de validación" @@ -1101,37 +1236,31 @@ msgid "WSLSP Voucher Types" msgstr "WSLSP Tipos de voucher" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:133 -#, python-format -msgid "Warning!" -msgstr "Cuidado!" - -#. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:187 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:188 #, python-format msgid "Wrong Number Sequence `%s` for invoice id: `%s`" msgstr "Secuencia de números incorrecta `%s` para factura id:`%s" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:120 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:175 #, python-format msgid "Wrong Number Sequence for invoice id: `%s`" msgstr "Secuencia de numeros incorrecta para la factura id: `%s`" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:112 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:167 #, python-format msgid "Wrong Number format for invoice id: `%s`" msgstr "Formato de numero incorrecto para la identificacion de la factura id: `%s`" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:126 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:181 #, python-format msgid "Wrong POS `%s` for invoice id: `%s`" msgstr "Error POS `%s` para la factura id: `%s`" #. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:116 +#: code:addons/l10n_ar_wslsp/models/account_invoice.py:171 #, python-format msgid "Wrong POS for invoice id: `%s`" msgstr "Error POS para la factura id: `%s`" @@ -1149,25 +1278,13 @@ msgstr "Error POS para la factura id: `%s`" #: field:wslsp.tax.codes,wslsp_config_id:0 #: field:wslsp.voucher_type.codes,wslsp_config_id:0 msgid "Wslsp config id" -msgstr "Wslsp configuración" +msgstr "Wslsp configuracion id" #. module: l10n_ar_wslsp #: view:account.invoice:l10n_ar_wslsp.view_invoice_wslsp_purchase_data_form msgid "XXXX-XXXXXXXX" msgstr "XXXX-XXXXXXXX" -#. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:343 -#, python-format -msgid "You cannot send a pork autoliquidation to AFIP Prod" -msgstr "No se puede enviar una autoliquidación de Porcinos a AFIP Producción" - -#. module: l10n_ar_wslsp -#: code:addons/l10n_ar_wslsp/models/account_invoice.py:242 -#, python-format -msgid "You cannot cancel an Electronic livestock sector liquidation because it has been informed to AFIP." -msgstr "No puede cancelar una liquidación electrónica del sector ganadero porque ha sido informada a la AFIP." - #. module: l10n_ar_wslsp #: view:wslsp.config:l10n_ar_wslsp.view_wslsp_config_form msgid "⇒Get Breeds" diff --git a/models/account_invoice.py b/models/account_invoice.py index 297b27a..a1b3f98 100644 --- a/models/account_invoice.py +++ b/models/account_invoice.py @@ -437,7 +437,8 @@ class AccountInvoice(models.Model): # Create and attach pdf invoice from AFIP pdf_data = invoice_vals.pop('pdf', False) if pdf_data: - invoice.attach_liquidation_report(pdf_data) + attachment = invoice.attach_liquidation_report(pdf_data) + self.send_autoliquidation_by_mail(attachment) # Add Vat Retention invoice._add_vat_retention(response) @@ -459,6 +460,53 @@ class AccountInvoice(models.Model): return invoice + def _prepare_ctx_send_mail(self, template_id): + return { + 'default_model': 'account.invoice', + 'default_use_template': bool(template_id), + 'default_template_id': template_id, + 'default_composition_mode': 'comment', + } + + @api.multi + def do_send_mail(self): + self.write({'sent': True}) + template_id = self.env.ref( + 'l10n_ar_wslsp.mail_autoliquidation_template').id + compose_form_id = self.env.ref('mail.email_compose_message_wizard_form').id + + ctx = dict(self.env.context) + ctx.update(self._prepare_ctx_send_mail(template_id)) + + return { + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'mail.compose.message', + 'views': [(compose_form_id, 'form')], + 'view_id': compose_form_id, + 'target': 'new', + 'context': str(ctx), + } + + @api.multi + def send_autoliquidation_by_mail(self, attachment): + try: + mail_obj = self.env['mail.mail'] + template = self.env.ref( + 'l10n_ar_wslsp.mail_autoliquidation_template') + values = template.generate_email(template.id, self.id) + values['recipient_ids'] = [ + (4, pid) for pid in values.get('partner_ids', list()) + ] + values['attachment_ids'] = [(6, 0, attachment.ids)] + mail = mail_obj.create(values) + mail.send() + except Exception as e: + return True + self.write({'sent': True}) + return True + @api.multi def action_aut_cae(self): #res = super(AccountInvoice, self).action_aut_cae() @@ -492,7 +540,8 @@ class AccountInvoice(models.Model): # Create and attach pdf invoice from AFIP pdf_data = invoice_vals.pop('pdf', False) if pdf_data: - inv.attach_liquidation_report(pdf_data) + attachment = inv.attach_liquidation_report(pdf_data) + self.send_autoliquidation_by_mail(attachment) inv.write(invoice_vals) # Add Vat Retention @@ -536,17 +585,17 @@ class AccountInvoice(models.Model): invoice_to_validate.signal_workflow('invoice_open') return True - @api.one + @api.multi def attach_liquidation_report(self, pdf): #Decode PDF from base64 #file_pdf = b64decode(pdf) data_attach = { - 'name' : self.internal_number + '.pdf', + 'name' : str(self.internal_number) + '.pdf', 'datas' : pdf, - 'datas_fname' : self.internal_number + '.pdf', + 'datas_fname' : str(self.internal_number) + '.pdf', 'res_model' : 'account.invoice', 'res_id' : self.id } #paso el regisruttro en el modelo attachment - self.env['ir.attachment'].create(data_attach) - return True + attachment = self.env['ir.attachment'].create(data_attach) + return attachment diff --git a/views/account_invoice_view.xml b/views/account_invoice_view.xml index c77bfd8..44bba5b 100644 --- a/views/account_invoice_view.xml +++ b/views/account_invoice_view.xml @@ -9,6 +9,13 @@ <field name="arch" type="xml"> <form string="Ranch Invoice"> <header> + <button name="do_send_mail" string="Send Mail" + type="object" attrs="{'invisible':['|', + ('sent','=',True), + ('state', '!=', 'open') + ]}" + class="oe_highlight" + groups="l10n_ar_wslsp.group_ranch_autoliquidation_user"/> <button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_highlight" groups="l10n_ar_wslsp.group_ranch_autoliquidation_user"/> <button name="%(account.action_account_invoice_refund)d" type='action' string='Refund' @@ -35,6 +42,7 @@ <field name="denomination_id" class="oe_inline" required="1" attrs="{'readonly':[('state', '!=', 'draft')]}"/> <field name="internal_number" class="oe_inline" placeholder="XXXX-XXXXXXXX" attrs="{'readonly':[('state', 'not in', ('draft', 'proforma', 'proforma2'))]}"/> </h2> + <field name="sent" invisible="1"/> <field name="type" invisible="1"/> <group> <group> -- GitLab