Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
2 changes: 1 addition & 1 deletion account_check/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions account_payment_group/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions account_payment_group/models/account_payment_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions account_payment_group/report/report_payment_group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
<tr class="border-black">
<th></th>
<th>Tipo</th>
<th>Diario</th>
<!-- <th>Diario</th> -->
<!-- AGREGO EL TIPO DE PAGO EN EL REPORTE -->
<th>Diario (Tipo de pago)</th>
<th>Fecha Cobro</th>
<th>Estado</th>
<th class="text-right">Monto</th>
Expand All @@ -100,7 +102,9 @@
<tr t-foreach="o.payment_ids" t-as="p">
<td></td>
<td><span t-if="p.payment_type_copy" t-field="p.payment_type_copy"/></td>
<td><span t-if="p.journal_id" t-field="p.journal_id"/></td>
<!-- <td><span t-if="p.journal_id" t-field="p.journal_id"/></td> -->
<!-- DIARIO + TIPO DE PAGO -->
<td><span t-if="p.journal_id" t-field="p.journal_id"/> (<span t-if="p.payment_method_description" t-field="p.payment_method_description"/>)</td>
<td><span t-if="p.date" t-field="p.date"/></td>
<td><span t-if="p.state" t-field="p.state"/></td>
<td class="text-right">
Expand Down
8 changes: 6 additions & 2 deletions l10n_ar_financial_reports/wizard/financial_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions l10n_ar_withholding/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion l10n_ar_withholding/views/account_move_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="calculate_perceptions" string="Calcular Percepciones" class="oe_highlight" type="object" groups="account.group_account_invoice" attrs="{'invisible': [('move_type', 'not in', ['out_invoice', 'out_refund'])]}"/>
<!-- Oculto el botón ya que no hace nada por ahora -->
<!-- <button name="calculate_perceptions" string="Calcular Percepciones" class="oe_highlight" type="object" groups="account.group_account_invoice" attrs="{'invisible': [('move_type', 'not in', ['out_invoice', 'out_refund'])]}"/> -->
<button name="calculate_perceptions" string="Calcular Percepciones" class="oe_highlight" type="object" groups="account.group_account_invoice" attrs="{'invisible': 1}"/>
</xpath>
</field>
</record>
Expand Down