Skip to content

Commit

Permalink
Revert "[FIX] Solucion Alternativa: Agrego un boton para agregar pago…
Browse files Browse the repository at this point in the history
…s al pyment group y evitar errores de JS"

This reverts commit 07d4fd7.
  • Loading branch information
jjscarafia committed Mar 25, 2023
1 parent 1cc9fdb commit 9638f19
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 28 deletions.
2 changes: 1 addition & 1 deletion account_payment_group/__manifest__.py
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Payment with Multiple methods",
"version": "16.0.1.1.0",
"version": "16.0.1.2.0",
"category": "Accounting",
"website": "www.adhoc.com.ar",
"author": "ADHOC SA, AITIC S.A.S",
Expand Down
20 changes: 0 additions & 20 deletions account_payment_group/models/account_payment_group.py
Expand Up @@ -286,26 +286,6 @@ def action_payment_sent(self):
'context': ctx,
}

def action_add_payment_line(self):
view = self.env.ref('account_payment_group.view_account_payment_from_group_form')
ctx = {
'default_move_journal_types': ('bank', 'cash'),
'default_company_id': self.company_id.id,
'default_payment_group_id': self.id
}
return {
'name': _('Pay'),
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'account.payment',
'views': [(view.id, 'form')],
'view_id': view.id,
'target': 'new',
'context': ctx,
}


def payment_print(self):
self.ensure_one()
self.sent = True
Expand Down
7 changes: 3 additions & 4 deletions account_payment_group/views/account_payment_group_view.xml
Expand Up @@ -128,15 +128,14 @@
<button name="%(action_account_payment_group_invoice_wizard)d" string="+ Debit Note" states="draft" type="action"/>
<button name="%(action_account_payment_group_invoice_wizard)d" string="+ Credit Note" states="draft" context="{'refund': True}" type="action"/>
<field
name="to_pay_move_line_ids"
context="{'tree_view_ref': 'account_payment_group.view_move_line_tree'}"
domain="[('partner_id.commercial_partner_id', '=', commercial_partner_id),('account_id.reconcile', '=', True),('reconciled', '=', False), ('full_reconcile_id', '=', False), ('company_id', '=', company_id), ('move_id.state', '=', 'posted'), ('account_id.account_type', '=', 'asset_receivable' if partner_type == 'customer' else 'liability_payable')]"/>
name="to_pay_move_line_ids"
context="{'tree_view_ref': 'account_payment_group.view_move_line_tree'}"
domain="[('partner_id.commercial_partner_id', '=', commercial_partner_id),('account_id.reconcile', '=', True),('reconciled', '=', False), ('full_reconcile_id', '=', False), ('company_id', '=', company_id), ('move_id.state', '=', 'posted'), ('account_id.account_type', '=', 'asset_receivable' if partner_type == 'customer' else 'liability_payable')]"/>
</page>
<!-- no las pudimos hacer invisibles porque nos da error al venir de una factura y querer hacer las to pay lines tmb invisibles. lo bueno de hacerlas invisibles era que al confirmar se pasaba a las payment lines automaticamente -->
<page string="Payment Lines" attrs="{'invisible': [('payment_subtype', '=', 'double_validation'), ('state', '=', 'draft')]}">
<!-- pasar en el contexto company_id es necesario para que se elija bien el primer diario sugerido -->
<field name="payment_ids" context="{'form_view_ref': 'account_payment_group.view_account_payment_from_group_form', 'tree_view_ref': 'account_payment_group.view_account_payment_from_group_tree', 'default_move_journal_types': ('bank', 'cash'), 'default_company_id': company_id}" attrs="{'readonly': [('state', 'not in', ['draft', 'confirmed'])]}"/>
<button name="action_add_payment_line" type="object" col="2" string="Add payment" attrs="{'invisible': [('state', 'not in', ['draft', 'confirmed'])]}"/>
</page>
<page string="Debts" attrs="{'invisible': ['|', ('payment_subtype', '!=', 'simple'), ('state', '!=', 'draft')]}">
<p>
Expand Down
3 changes: 0 additions & 3 deletions account_payment_group/views/account_payment_view.xml
Expand Up @@ -33,9 +33,6 @@
<field name="priority">90</field>
<field name="mode">primary</field>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="create">0</attribute>
</tree>
<field name="payment_method_line_id" position="attributes">
<attribute name="invisible">1</attribute>
</field>
Expand Down

0 comments on commit 9638f19

Please sign in to comment.