[ADD]: adding changes from account_voucher_payment module to account_voucher module
[odoo/odoo.git] / addons / account_voucher / voucher_payment_receipt_view.xml
index b08d46d..02c7d7d 100644 (file)
@@ -8,7 +8,7 @@
             <field name="arch" type="xml">
                 <form string="Bill Payment">
                     <group col="6" colspan="4">
-                        <field name="partner_id" on_change="onchange_partner_id(partner_id, type)"/>
+                        <field name="partner_id" on_change="onchange_partner_id(partner_id, type, journal_id)"/>
                         <field name="name" colspan="4"/>
                         <field name="journal_id" domain="[('type','in',['bank', 'cash'])]" widget="selection" select="1" on_change="onchange_journal(journal_id,type)"/>
                         <field name="account_id" domain="[('type','=','other')]" widget="selection" on_change="onchange_account(account_id)" readonly="1"/>
@@ -16,8 +16,8 @@
                     </group>
                     <notebook colspan="4">
                         <page string="Payment Information">
-                            <field name="payment_ids" colspan="4" nolabel="1" height="180">
-                                <tree string="Payment Lines" editable="top">
+                            <field name="payment_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
+                                <tree string="Payment Lines" editable="bottom">
                                     <field name="ref" on_change="onchange_partner(parent.partner_id,type,parent.type, parent.currency_id)"/>
                                     <field name="amount"/>
                                     <field name="account_id"/>
@@ -53,6 +53,7 @@
                         <button name="recheck_voucher" string="Approve" states="recheck" icon="terp-check"/>
                         <button name="cancel_voucher" string="Cancel" states="draft,proforma,recheck"  icon="gtk-cancel"/>
                         <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
+                        <button name="%(action_view_account_voucher_unreconcile)d" string="Unreconcile" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
                     </group>
                 </form>
             </field>
             <field name="arch" type="xml">
                 <form string="Sales Payment">
                     <group col="6" colspan="4">
-                        <field name="partner_id" on_change="onchange_partner_id(partner_id, type)"/>
-                        <field name="name" colspan="4"/>
-                        <field name="journal_id" domain="[('type','in',['bank', 'cash'])]" widget="selection" select="1" on_change="onchange_journal(journal_id,type)"/>
-                        <field name="account_id" domain="[('type','=','other')]" widget="selection" on_change="onchange_account(account_id)" readonly="1"/>
-                        <field name="number"/>
+                        <field name="partner_id" on_change="onchange_partner_id(partner_id, type, journal_id)" string="Customer"/>
+                        <field name="journal_id"
+                            domain="[('type','in',['bank', 'cash'])]"
+                            widget="selection" select="1"
+                            on_change="onchange_journal(journal_id,type)"
+                            string="Payment Method"/>
+                        <field name="amount"/>
+                        <field name="reference" select="1" string="Payment Ref"/>
+                        <field name="name" colspan="4" required="1"/>
+                        <field name="account_id"
+                            domain="[('type','=','other')]"
+                            widget="selection"
+                            on_change="onchange_account(account_id)"
+                            invisible="True"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Payment Information">
-                            <field name="payment_ids" colspan="4" nolabel="1" height="180">
-                                <tree string="Payment Lines" editable="top">
-                                    <field name="ref" on_change="onchange_partner(parent.partner_id,type,parent.type, parent.currency_id)"/>
-                                    <field name="amount"/>
-                                    <field name="account_id"/>
-                                    <field name="type" on_change="onchange_type(parent.partner_id,type,parent.type, parent.currency_id)"/>
-                                    <field name="account_analytic_id"/>
+                            <field name="payment_ids" on_change="onchange_price(payment_ids, False, False)" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
+                                <tree string="Payment Lines" editable="bottom">
+                                    <field name="move_line_id" context="{'journal_id':parent.journal_id, 'type':parent.type, 'partner_id':parent.partner_id}" on_change="onchange_move_line_id(move_line_id)" domain="[('account_id.type','=','receivable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id), ('debit','>',0)]"/>
+                                    <field name="account_id"  domain="[('type','=','receivable')]"/>
+                                    <field name="date_original"/>
+                                    <field name="date_due"/>
+                                    <field name="amount_original"/>
+                                    <field name="amount_unreconciled" sum="Open Balance"/>
+                                    <field name="amount" sum="Payment"/>
                                 </tree>
                             </field>
                             <group col="2" colspan="3">
-                                <separator string="Narration" colspan="2"/>
+                                <separator string="Internal Notes" colspan="2"/>
                                 <field name="narration" colspan="2" nolabel="1"/>
                             </group>
                             <group col="2" colspan="1">
                                 <separator string="Other Information" colspan="2"/>
-                                <field name="reference" select="1"/>
                                 <field name="date" select="1" on_change="onchange_date(date)"/>
-                                <field name="currency_id" select="1" attrs="{'readonly':[('type','in',['sale', 'purchase'])]}"/>
-                                <field name="type" on_change="onchange_journal(journal_id,type)"/>
+                                <field name="currency_id" select="1"
+                                    attrs="{'readonly':[('type','in',['sale', 'purchase'])]}"/>
+                                <field name="number"/>
+                                <field name="type" on_change="onchange_journal(journal_id,type)" invisible="1"/>
                             </group>
                         </page>
-                        <page string="Journal Items">
+                        <page string="Journal Items" groups="base.group_extended">
                             <group col="6" colspan="4">
                                 <field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
                                 <field name="period_id"/>
                         <button name="recheck_voucher" string="Approve" states="recheck" icon="terp-check"/>
                         <button name="cancel_voucher" string="Cancel" states="draft,proforma,recheck"  icon="gtk-cancel"/>
                         <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
+                        <button name="%(action_view_account_voucher_unreconcile)d" string="Unreconcile" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
                     </group>
                 </form>
             </field>