Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] l10n_ar_edi_ux: agregar funcionalidad de debitar cheques propios.
Tarea: 34995 Lo hacemos acá y no en l10n_ar_ux porque no tenemos enterprise y usamos acá un metodo de account_accountant.
- Loading branch information
1 parent
391993c
commit c6d3051
Showing
8 changed files
with
96 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<odoo> | ||
|
||
<record id="view_account_payment_form_inherited" model="ir.ui.view"> | ||
<field name="name">account.payment.form.inherited</field> | ||
<field name="model">account.payment</field> | ||
<field name="inherit_id" ref="account.view_account_payment_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//button[@name='action_post']" position="after"> | ||
<button name="%(action_debit_check_wizard)d" string="Debit check" type="action" attrs="{'invisible': ['|', '|', ('payment_method_code', '!=', 'check_printing'), ('state', '!=', 'posted'), ('is_move_sent', '=', False)]}"/> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
############################################################################## | ||
# For copyright and license notices, see __manifest__.py file in module root | ||
# directory | ||
############################################################################## | ||
from odoo import fields, models, _ | ||
from odoo.exceptions import ValidationError | ||
|
||
|
||
class AccountCheckActionWizard(models.TransientModel): | ||
_name = 'account.check.action.wizard' | ||
_description = 'Account Check Action Wizard' | ||
|
||
date = fields.Date( | ||
default=fields.Date.context_today, | ||
required=True, | ||
) | ||
|
||
def action_confirm(self): | ||
payment = self.env['account.payment'].browse( | ||
self._context.get('active_id', False)) | ||
move_line_ids = [payment.line_ids.filtered(lambda x: not x.reconciled).id] | ||
# [{'name': '554', 'balance': 16135.35, 'account_id': 10429, 'journal_id': 132, 'date': '2023-12-19'}] | ||
import pdb; pdb.set_trace() | ||
new_mv_line_dicts = [{'name': f'Débito cheque nro {payment.check_number}', | ||
'balance': abs(payment.line_ids.filtered(lambda x: not x.reconciled).balance), | ||
'account_id': payment.journal_id.outbound_payment_method_line_ids.filtered(lambda x: x.code=='manual').payment_account_id.id, | ||
'journal_id': payment.journal_id.check_debit_journal_id.id, | ||
'date':self.date, | ||
}] | ||
self.env['account.reconciliation.widget']._process_move_lines(move_line_ids, new_mv_line_dicts) |
28 changes: 28 additions & 0 deletions
28
l10n_ar_edi_ux/wizards/account_check_action_wizard_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record model="ir.ui.view" id="account_check_action_wizard_form_view"> | ||
<field name="name">account.check.action.wizard.form</field> | ||
<field name="model">account.check.action.wizard</field> | ||
<field name="arch" type="xml"> | ||
<form string="Check Action"> | ||
<group > | ||
<field name="date"/> | ||
</group> | ||
<footer> | ||
<button string="Confirm" name="action_confirm" type="object" class="oe_highlight"/> | ||
or | ||
<button string="Cancel" class="oe_link" special="cancel"/> | ||
</footer> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="action_debit_check_wizard" model="ir.actions.act_window"> | ||
<field name="name">Check Action</field> | ||
<field name="res_model">account.check.action.wizard</field> | ||
<field name="view_mode">form</field> | ||
<field name="target">new</field> | ||
</record> | ||
|
||
</odoo> |