vendor_batch_payment_merge/views/account_batch_payment_views.xml

43 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_batch_payment_form_inherit" model="ir.ui.view">
<field name="name">account.batch.payment.form.inherit</field>
<field name="model">account.batch.payment</field>
<field name="inherit_id" ref="account_batch_payment.view_batch_payment_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='batch_content']" position="after">
<page string="Direct Payment Lines" name="direct_payment_lines">
<field name="direct_payment_line_ids">
<tree editable="bottom">
<<<<<<< HEAD
<field name="company_id" options="{'no_create': True}"/>
=======
<field name="company_id" column_invisible="True"/>
>>>>>>> 2b945da (feat: Implement intercompany settlement logic for batch payments, adding dedicated company accounts and a new settlement wizard.)
<field name="partner_id" domain="parent.batch_type == 'outbound' and [('supplier_rank', '>', 0)] or [('customer_rank', '>', 0)]" options="{'no_create': True}"/>
<field name="amount" sum="Total"/>
<field name="expense_account_id"/>
<field name="memo"/>
<field name="date"/>
<field name="payment_id" readonly="1"/>
<field name="branch_move_id" readonly="1" optional="hide"/>
</tree>
</field>
</page>
</xpath>
<xpath expr="//header" position="inside">
<button name="generate_payments_from_lines" string="Generate Payments" type="object"
class="oe_highlight" invisible="state != 'draft'"/>
</xpath>
<!-- Override payment_ids to remove journal_id constraint to allow cross-company branch payments -->
<xpath expr="//field[@name='payment_ids']" position="before">
<field name="company_id" invisible="1"/>
</xpath>
<xpath expr="//field[@name='payment_ids']" position="attributes">
<attribute name="domain">[('batch_payment_id', '=', False), ('state', '=', 'posted'), ('is_move_sent', '=', False), ('payment_method_id', '=', payment_method_id), ('payment_type','=',batch_type), ('amount', '!=', 0)]</attribute>
<!-- Context to allow viewing payments across all companies the user has access to -->
<attribute name="context">{'default_payment_type': batch_type, 'default_journal_id': journal_id}</attribute>
</xpath>
</field>
</record>
</odoo>