Launchpad automatic translations update.
[odoo/odoo.git] / addons / account_voucher / voucher_payment_receipt_view.xml
index a167300..1169d5e 100644 (file)
@@ -12,7 +12,7 @@
                     <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
                     <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
                     <field name="partner_id" string="Customer" filter_domain="[('partner_id','child_of',self)]"/>
-                    <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/>
+                    <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/> <!-- Keep widget=selection on this field to pass numeric `self` value, which is not the case for regular m2o widgets! -->
                     <field name="period_id"/>
                     <group expand="0" string="Group By...">
                         <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
@@ -35,7 +35,7 @@
                     <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
                     <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
                     <field name="partner_id" string="Supplier" filter_domain="[('partner_id','child_of',self)]"/>
-                    <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/>
+                    <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('bank','cash'))]"/> <!-- Keep widget=selection on this field to pass numeric `self` value, which is not the case for regular m2o widgets! -->
                     <field name="period_id"/>
                     <group expand="0" string="Group By...">
                         <filter string="Supplier" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
@@ -46,6 +46,9 @@
                 </search>
             </field>
         </record>
+
+        <!-- TODO: merge the 3 voucher form views of this file into a single view -->
+        <!-- Low priority view... If we open a voucher from a m2o, for example. -->
         <record model="ir.ui.view" id="view_low_priority_payment_form">
             <field name="name">account.voucher.payment.low.priority.form</field>
             <field name="model">account.voucher</field>
                                 </group>
                                 <group string="Other Information" col="4">
                                     <field name="currency_id" colspan="4" groups="base.group_multi_currency"/>
-                                    <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
+                                    <field name="payment_rate" required="1" colspan="3" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
                                     <field name="payment_rate_currency_id" colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
                                     <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
                                     <field name="number" colspan="4"/>
             </field>
         </record>
 
+        <!-- Supplier Payment -->
         <record model="ir.ui.view" id="view_vendor_payment_form">
             <field name="name">account.voucher.payment.form</field>
             <field name="model">account.voucher</field>
                                     <field name="narration" colspan="2" nolabel="1"/>
                                 </group>
                                 <group>
-                                    <group col="4" attrs="{'invisible':[('is_multi_currency','=',False)]}">
-                                        <separator string="Currency Options" colspan="4"/>
+                                    <group col="2" attrs="{'invisible':[('is_multi_currency','=',False)]}">
+                                        <separator string="Currency Options" colspan="2"/>
                                         <field name="is_multi_currency" invisible="1"/>
-                                        <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
-                                        <field name="payment_rate_currency_id" colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
-                                        <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
+                                       <label for="payment_rate" colspan="1"/>
+                                       <div>
+                                            <field name="payment_rate" required="1" class="oe_inline" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
+                                            <field name="payment_rate_currency_id" class="oe_inline" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
+                                        </div>
+                                        <field name="currency_help_label" colspan="2" nolabel="1" class="oe_grey"/>
+                                        <field name="paid_amount_in_company_currency" colspan="2" invisible="1"/>
                                     </group>
                                     <group col="2">
                                         <separator string="Payment Options" colspan="2"/>
         <menuitem action="action_vendor_payment" icon="STOCK_JUSTIFY_FILL" sequence="12"
             id="menu_action_vendor_payment"  parent="account.menu_finance_payables"/>
 
+        <!-- Register Payment Form (old Pay Invoice wizard) -->
         <record model="ir.ui.view" id="view_vendor_receipt_dialog_form">
             <field name="name">account.voucher.receipt.dialog.form</field>
             <field name="model">account.voucher</field>
                     <group>
                         <group>
                                 <field name="writeoff_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
-                                <field name="payment_option" required="1"/>
+                                <field name="payment_option" required="1" attrs="{'invisible':[('writeoff_amount','=',0)]}"/>
                                 <field name="writeoff_acc_id"
-                                        attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
+                                        attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)], 'required':[('payment_option','=','with_writeoff')]}"
                                         domain="[('type','=','other')]"/>
                                 <field name="comment"
-                                        attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
+                                        attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
                                 <field name="analytic_id"
-                                        groups="analytic.group_analytic_accounting"/>
+                                        groups="analytic.group_analytic_accounting"
+                                        attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
                             </group>
                             <group>
                         </group>
                                 <group>
                                     <field name="narration" colspan="2" nolabel="1"/>
                                 </group>
-                                <group col="4" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
+                                <group col="4" attrs="{'invisible':[('is_multi_currency','=',False)]}">
                                     <field name="is_multi_currency" invisible="1"/>
-                                    <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
+                                    <field name="payment_rate" required="1" colspan="3" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
                                     <field name="payment_rate_currency_id" colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
                                     <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
                                 </group>
         </record>
 
 
+        <!-- Customer Payment -->
         <record model="ir.ui.view" id="view_vendor_receipt_form">
             <field name="name">account.voucher.receipt.form</field>
             <field name="model">account.voucher</field>
                                 <group>
                                     <field name="narration" colspan="2" nolabel="1"/>
                                 </group>
-                                <group col="4" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
+                                <group col="4" attrs="{'invisible':[('is_multi_currency','=',False)]}">
                                     <field name="is_multi_currency" invisible="1"/>
-                                    <field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
-                                    <field name="payment_rate_currency_id" colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
+                                   <label for="payment_rate" colspan="1"/>
+                                   <div>
+                                        <field name="payment_rate" required="1" class="oe_inline" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
+                                        <field name="payment_rate_currency_id" class="oe_inline" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
+                                    </div>
+                                    <field name="currency_help_label" colspan="2" nolabel="1" class="oe_grey"/>
                                     <field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
                                 </group>
                                 <group>
                                     <field name="writeoff_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
-                                    <field name="payment_option" required="1"/>
+                                    <field name="payment_option" required="1" attrs="{'invisible':[('writeoff_amount','=',0)]}"/>
                                     <field name="writeoff_acc_id"
-                                           attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
+                                           attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)], 'required':[('payment_option','=','with_writeoff')]}"
                                            domain="[('type','=','other')]"/>
                                     <field name="comment"
-                                           attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
+                                           attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
                                     <field name="analytic_id"
-                                           groups="analytic.group_analytic_accounting"/>
+                                           groups="analytic.group_analytic_accounting"
+                                           attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
                                 </group>
                             </group>
                         </page>