Skip to content

Commit

Permalink
[ADD] account_payment: add kanban
Browse files Browse the repository at this point in the history
closes #447

Signed-off-by: Filoquin adhoc <maq@adhoc.com.ar>
  • Loading branch information
rov-adhoc committed Feb 9, 2024
1 parent 3152ce1 commit 2dbc053
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
11 changes: 10 additions & 1 deletion account_payment_group/views/account_payment_group_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,16 @@
<!-- 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'])]}"/>
<field name="payment_ids"
mode="form,tree,kanban"
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',
'kanban_view_ref': 'account_payment_group.view_account_payment_kanban_mobile',
'default_move_journal_types': ('bank', 'cash'),
'default_company_id': company_id
}"
attrs="{'readonly': [('state', 'not in', ['draft', 'confirmed'])]}"/>
</page>
<page string="Debts" attrs="{'invisible': ['|', ('payment_subtype', '!=', 'simple'), ('state', '!=', 'draft')]}">
<p>
Expand Down
47 changes: 46 additions & 1 deletion account_payment_group/views/account_payment_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@
<field name="name">Transfers</field>
<field name="res_model">account.payment</field>
<field name="view_mode">tree,form,graph</field>
<field name="context">{'form_view_ref': 'account_payment_group.view_account_payment_form2', 'default_payment_type': 'outbound', 'default_is_internal_transfer': True, 'default_move_journal_types': ('bank', 'cash')}</field>
<field name="context">
{'form_view_ref': 'account_payment_group.view_account_payment_form2',
'default_payment_type': 'outbound',
'default_is_internal_transfer': True,
'default_move_journal_types': ('bank', 'cash')}
</field>
<field name="domain">[('is_internal_transfer', '=', 'transfer')]</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Expand All @@ -170,6 +175,46 @@
</field>
</record>

<record id="view_account_payment_kanban_mobile" model="ir.ui.view">
<field name="name">account.payment.kanban.mobile</field>
<field name="model">account.payment</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="payment_type"/>
<field name="amount"/>
<field name="date"/>
<field name="ref"/>
<field name="journal_id"/>
<field name="payment_method_line_id"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="row">
<div class="col-6">
<span><field name="payment_type" widget="radio"/></span>
<span><field name="amount" /></span>
</div>
<div class="col-6">
<span class="float-end">
<field name="date" />
<field name="ref" string="Memo"/>
</span>
</div>
<div class="col-6">
<span class="float-end">
<field name="journal_id"/>
<field name="payment_method_line_id" required="1" options="{'no_create': True, 'no_open': True}"/>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>


<menuitem action="action_account_payments_transfer" id="menu_action_account_payments_transfer" parent="menu_finance_bank_and_cash" sequence="30" groups="account.group_account_user"/>

</odoo>

0 comments on commit 2dbc053

Please sign in to comment.