38 lines
2.4 KiB
XML
38 lines
2.4 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">
|
|
<field name="company_id" options="{'no_create': True}"/>
|
|
<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"/>
|
|
</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> |