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 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/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: diff --git a/account_payment_group/report/report_payment_group.xml b/account_payment_group/report/report_payment_group.xml index d6a9451..5460b54 100644 --- a/account_payment_group/report/report_payment_group.xml +++ b/account_payment_group/report/report_payment_group.xml @@ -90,7 +90,9 @@ Tipo - Diario + + + Diario (Tipo de pago) Fecha Cobro Estado Monto @@ -100,7 +102,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 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 @@ -