Ajay Chauhan(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-payment_o2m_visibility-cha into 
lp:openobject-addons.

Requested reviews:
  Purnendu Singh (OpenERP) (psi-tinyerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-payment_o2m_visibility-cha/+merge/126202

Hello,

  here we solve issue for the payment info tab & o2m line for payment.
    > made the o2m visible only if the o2m is not empty
    > from invoice form (register payment button), the tab "payment 
information" should not be visible. 

Thanks,
Ajay Chauhan
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-payment_o2m_visibility-cha/+merge/126202
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-payment_o2m_visibility-cha.
=== modified file 'account_voucher/account_voucher_pay_invoice.xml'
--- account_voucher/account_voucher_pay_invoice.xml	2012-08-08 10:59:07 +0000
+++ account_voucher/account_voucher_pay_invoice.xml	2012-09-25 09:15:30 +0000
@@ -8,9 +8,9 @@
             <field name="arch" type="xml">
                 <xpath expr="//button[@name='invoice_open'][last()]" position="after">
                     <button name="invoice_pay_customer" type="object" string="Register Payment"
-                        attrs="{'invisible': ['|', ('state','!=','open'), ('sent','=',True)]}"/>
+                        attrs="{'invisible': ['|', ('state','!=','open'), ('sent','=',True)]}" context="{'payment_info':True}"/>
                     <button name="invoice_pay_customer" type="object" string="Register Payment"
-                        attrs="{'invisible': ['|', ('state','!=','open'), ('sent','=',False)]}" class="oe_highlight"/>
+                        attrs="{'invisible': ['|', ('state','!=','open'), ('sent','=',False)]}" class="oe_highlight" context="{'payment_info':True}"/>
                 </xpath>
             </field>
         </record>
@@ -20,7 +20,7 @@
             <field name="inherit_id" ref="account.invoice_supplier_form"/>
             <field name="arch" type="xml">
                 <xpath expr="//button[@name='invoice_open'][last()]" position="after">
-                    <button name="invoice_pay_customer" type="object" string="Pay" states="open" class="oe_highlight"/>
+                    <button name="invoice_pay_customer" type="object" string="Pay" states="open" class="oe_highlight" context="{'payment_info':True}"/>
                 </xpath>
             </field>
         </record>

=== modified file 'account_voucher/voucher_payment_receipt_view.xml'
--- account_voucher/voucher_payment_receipt_view.xml	2012-09-21 13:37:48 +0000
+++ account_voucher/voucher_payment_receipt_view.xml	2012-09-25 09:15:30 +0000
@@ -154,8 +154,8 @@
                         </group>
                     </group>
                     <notebook>
-                        <page string="Payment Information">
-                            <field name="line_dr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}">
+                        <page string="Payment Information" invisible="context.get('payment_info', False)">
+                            <field name="line_dr_ids" attrs="{'invisible': [('line_dr_ids','=',False)]}" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}">
                                 <tree string="Supplier Invoices and Outstanding transactions" editable="bottom" colors="gray:amount==0">
                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
                                         on_change="onchange_move_line_id(move_line_id)"
@@ -327,8 +327,8 @@
                     </group>
 
                     <notebook>
-                        <page string="Payment Information" groups="base.group_user">
-                            <field name="line_cr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
+                        <page string="Payment Information" groups="base.group_user" invisible="context.get('payment_info', False)">
+                            <field name="line_cr_ids" attrs="{'invisible': [('line_cr_ids','=',False)]}" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
                                 <tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
                                     <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
                                         on_change="onchange_move_line_id(move_line_id)"

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to