From a6128dd27deea99acf635b39977d8e2b3a1dc0b5 Mon Sep 17 00:00:00 2001
From: Mario Solis <56165442+msolis6686@users.noreply.github.com>
Date: Wed, 25 Jan 2023 18:37:17 -0300
Subject: [PATCH 1/4] =?UTF-8?q?correcci=C3=B3n=20de=20errores?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
account_payment_group/models/account_move.py | 4 ++++
account_payment_group/report/report_payment_group.xml | 8 ++++++--
l10n_ar_financial_reports/wizard/financial_reports.py | 8 ++++++--
l10n_ar_withholding/models/account_payment.py | 5 +++++
4 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/account_payment_group/models/account_move.py b/account_payment_group/models/account_move.py
index ef27757..17727e5 100644
--- a/account_payment_group/models/account_move.py
+++ b/account_payment_group/models/account_move.py
@@ -32,6 +32,10 @@ def _compute_payment_groups(self):
# Ver como resolver esto
rec.payment_group_ids = rec.payment_move_line_ids.mapped(
'payment_id.payment_group_id')
+
+ #CAMBIO POR MARITO - tira un error porque no tiene el campo payment_move_line_ids, pero no en todos los casos...
+ """ rec.payment_group_ids = rec.payment_id.mapped(
+ 'payment_id.payment_group_id') """
def _get_tax_factor(self):
self.ensure_one()
diff --git a/account_payment_group/report/report_payment_group.xml b/account_payment_group/report/report_payment_group.xml
index d6a9451..6dda86b 100644
--- a/account_payment_group/report/report_payment_group.xml
+++ b/account_payment_group/report/report_payment_group.xml
@@ -90,7 +90,9 @@
|
|
- |
+
+
+ ( |
|
|
diff --git a/l10n_ar_financial_reports/wizard/financial_reports.py b/l10n_ar_financial_reports/wizard/financial_reports.py
index c9cef18..57f3a54 100644
--- a/l10n_ar_financial_reports/wizard/financial_reports.py
+++ b/l10n_ar_financial_reports/wizard/financial_reports.py
@@ -11,14 +11,18 @@ class FinancialReports(models.TransientModel):
def print_report(self):
if self.type_report == 'ivasale':
- invoices_ids = self.env['account.move'].search_read([('move_type','in',['out_invoice','out_refund']),('invoice_date','>=',self.date_from),('invoice_date','<=',self.date_to)])
+ #invoices_ids = self.env['account.move'].search_read([('move_type','in',['out_invoice','out_refund']),('invoice_date','>=',self.date_from),('invoice_date','<=',self.date_to)])
+ #CAMBIOS POR MARITO - se agregaron los fields necesarios para el reporte
+ invoices_ids = self.env['account.move'].search_read([('move_type','in',['out_invoice','out_refund']),('invoice_date','>=',self.date_from),('invoice_date','<=',self.date_to)],['id', 'name','l10n_ar_afip_responsibility_type_id','invoice_date','invoice_partner_display_name','document_partner','amount_total','amount_untaxed_signed','iva10','iva21','iva27','no_gravado','iva_exento','move_type'])
data = {
'from_data' : self.read()[0],
'invoices_ids' : invoices_ids
}
return self.env.ref('l10n_ar_financial_reports.action_report_iva_sale').sudo().with_context(landscape=True).report_action(self, data=data)
elif self.type_report == 'ivapurchase':
- invoices_ids = self.env['account.move'].search_read([('move_type','in',['in_invoice','in_refund']),('date','>=',self.date_from),('date','<=',self.date_to)])
+ #invoices_ids = self.env['account.move'].search_read([('move_type','in',['in_invoice','in_refund']),('date','>=',self.date_from),('date','<=',self.date_to)])
+ #CAMBIOS POR MARITO - se agregaron los fields necesarios para el reporte
+ invoices_ids = self.env['account.move'].search_read([('move_type','in',['in_invoice','in_refund']),('date','>=',self.date_from),('date','<=',self.date_to)],['id', 'name','l10n_ar_afip_responsibility_type_id','l10n_latam_amount_untaxed','invoice_date','invoice_partner_display_name','document_partner','amount_total','amount_untaxed_signed','iva10','iva21','iva27','no_gravado','iva_exento','iva_no_corresponde','move_type','amount_by_group'])
data = {
'from_data' : self.read()[0],
'invoices_ids' : invoices_ids
diff --git a/l10n_ar_withholding/models/account_payment.py b/l10n_ar_withholding/models/account_payment.py
index 0d97734..247c60b 100644
--- a/l10n_ar_withholding/models/account_payment.py
+++ b/l10n_ar_withholding/models/account_payment.py
@@ -160,6 +160,11 @@ def _seek_for_lines(self):
self.journal_id.payment_debit_account_id,
self.journal_id.payment_credit_account_id,
):
+ #CAMBIOS POR MARITO
+ #Chequeo si viene con algun impuesto de retención, y cambio la cuenta a donde apunta.
+ if self.tax_withholding_id:
+ account_imp_ret = self.tax_withholding_id.invoice_repartition_line_ids.filtered(lambda r: len(r.account_id) > 0)
+ line.account_id = account_imp_ret.account_id
liquidity_lines += line
elif line.account_id.internal_type in ('receivable', 'payable') or line.partner_id == line.company_id.partner_id:
counterpart_lines += line
From 3b5c39eb5adb1b17265a51e5c29d120babc696e7 Mon Sep 17 00:00:00 2001
From: Mario Solis <56165442+msolis6686@users.noreply.github.com>
Date: Mon, 6 Feb 2023 19:43:09 -0300
Subject: [PATCH 2/4] =?UTF-8?q?oculto=20bot=C3=B3n=20que=20no=20hace=20nad?=
=?UTF-8?q?a,=20corrigo=20el=20reporte=20de=20pago.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
account_payment_group/report/report_payment_group.xml | 2 +-
l10n_ar_withholding/views/account_move_view.xml | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/account_payment_group/report/report_payment_group.xml b/account_payment_group/report/report_payment_group.xml
index 6dda86b..5460b54 100644
--- a/account_payment_group/report/report_payment_group.xml
+++ b/account_payment_group/report/report_payment_group.xml
@@ -104,7 +104,7 @@
| |
- ( |
+ () |
|
|
diff --git a/l10n_ar_withholding/views/account_move_view.xml b/l10n_ar_withholding/views/account_move_view.xml
index e00086a..4c742a8 100644
--- a/l10n_ar_withholding/views/account_move_view.xml
+++ b/l10n_ar_withholding/views/account_move_view.xml
@@ -7,7 +7,9 @@
-
+
+
+
From 1cce88a2fce03781ac70780b7eace0054274de54 Mon Sep 17 00:00:00 2001
From: Foca
Date: Wed, 22 Feb 2023 12:59:04 -0300
Subject: [PATCH 3/4] Arreglado un bug que no permitia cancelar los recibos de
pago ya publicados.
---
account_payment_group/models/account_payment_group.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/account_payment_group/models/account_payment_group.py b/account_payment_group/models/account_payment_group.py
index b5c04d2..d259c2a 100644
--- a/account_payment_group/models/account_payment_group.py
+++ b/account_payment_group/models/account_payment_group.py
@@ -688,7 +688,7 @@ def default_get(self, fields):
if self._context.get('from_invoice') == 'yes':
invoice = self.env['account.move'].browse(self._context.get('invoice_id'))
rec['related_invoice'] = invoice.id
-
+
if self.env['ir.config_parameter'].sudo().get_param('account_payment_group.journal_def'):
payment_type = ''
@@ -758,7 +758,7 @@ def cancel(self):
# if rec.to_pay_move_line_ids:
# move.line_ids.remove_move_reconcile()
rec.payment_ids.action_cancel()
- rec.payment_ids.write({'invoice_line_ids': [(5, 0, 0)]})
+ rec.payment_ids.with_context(skip_account_move_synchronization=True).write({'invoice_line_ids': [(5, 0, 0)]})
self.write({'state': 'cancel'})
def action_draft(self):
@@ -798,7 +798,7 @@ def post(self):
'receiptbook_id': False,
})
continue
-
+
_logger.warning("2")
if not rec.document_number:
if not rec.receiptbook_id.sequence_id:
From 0524a2af2615fe707d051e89ff28012bba8ca1be Mon Sep 17 00:00:00 2001
From: Foca
Date: Tue, 15 Aug 2023 13:32:25 -0300
Subject: [PATCH 4/4] Agregado un sudo a la funcion para abrir los chceques
desde el tablero contable, ya que pide permisos de acceso tecnico. Ahora se
puede entrar normalmente sin tener esos permisos.
---
.vscode/launch.json | 24 ++++++++++++++++++++++++
account_check/models/account_journal.py | 2 +-
2 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 .vscode/launch.json
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..fd87d46
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,24 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Python: Remote Attach",
+ "type": "python",
+ "request": "attach",
+ "connect": {
+ "host": "localhost",
+ "port": 8888
+ },
+ "pathMappings": [
+ {
+ "localRoot": "${workspaceFolder}",
+ "remoteRoot": "/mnt/extra-addons/odoo-argentina"
+ }
+ ],
+ "justMyCode": false
+ }
+ ]
+}
\ No newline at end of file
diff --git a/account_check/models/account_journal.py b/account_check/models/account_journal.py
index 0dc4073..62b7a19 100644
--- a/account_check/models/account_journal.py
+++ b/account_check/models/account_journal.py
@@ -112,7 +112,7 @@ def open_action_checks(self):
else:
return False
actions = self.env.ref(action_name)
- action_read = actions.read()[0]
+ action_read = actions.sudo().read()[0]
context = literal_eval(action_read['context'])
context['search_default_journal_id'] = self.id
action_read['context'] = context
|