[MERGE] lp:807543
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>
Tue, 18 Oct 2011 12:19:34 +0000 (14:19 +0200)
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>
Tue, 18 Oct 2011 12:19:34 +0000 (14:19 +0200)
bzr revid: qdp-launchpad@openerp.com-20111018121934-0k482zv4jxtp0uyb

1  2 
addons/account/account_invoice_view.xml
addons/account_cancel/account_cancel_view.xml

                                  <field name="amount_tax"/>
                                  <field name="reconciled"/>
                                  <field name="amount_total"/>
 -                                <field name="state"/>
 +                                <field name="state" widget="statusbar" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
                                  <field name="residual"/>
                                  <group col="6" colspan="4">
-                                     <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
+                                     <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel" groups="base.group_no_one"/>
                                      <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
                                      <button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
--                                    <button name="%(action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
++                                    <button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" icon="gtk-convert" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
                                      <button name="invoice_open" states="draft,proforma2" string="Approve" icon="terp-camera_test"/>
                                  </group>
                              </group>
                                  <field name="amount_tax"/>
                                  <field name="reconciled"/>
                                  <field name="amount_total"/>
 -                                <field name="state"/>
 +                                <field name="state" widget="statusbar" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
                                  <field name="residual"/>
                                  <group col="8" colspan="4" groups="base.group_user">
-                                     <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
+                                     <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel" groups="base.group_no_one"/>
                                      <button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
  
-                                     <button name='%(action_account_state_open)d' type='action' string='Re-Open' attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" icon="gtk-convert" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
++                                    <button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" icon="gtk-convert" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
                                      <button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
 -                                    <button name='%(action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
                                      <button name="invoice_proforma2" states="draft" string="PRO-FORMA" icon="terp-gtk-media-pause" groups="account.group_account_user"/>
                                      <button name="invoice_open" states="draft,proforma2" string="Validate" icon="gtk-go-forward"/>
                                      <button name="%(account_invoices)d" string="Print Invoice" type="action" icon="gtk-print" states="open,paid,proforma,sale,proforma2"/>
                  </field>
              </field>
          </record>
+         <record id="invoice_form_cancel_inherit" model="ir.ui.view">
+             <field name="name">invoice.form.cancel.inherit</field>
+             <field name="model">account.invoice</field>
+             <field name="type">form</field>
+             <field name="inherit_id" ref="account.invoice_form"/>
+             <field name="arch" type="xml">
 -                <xpath expr="/form/notebook/page/group/group/button[@name='%(account.action_account_state_open)d']" position="replace">
 -                    <button name='%(account.action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="account.group_account_invoice"/>
 -                </xpath>
+                 <xpath expr="/form/notebook/page/group/group/button[@name='invoice_cancel']" position="replace">
+                     <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel" groups="account.group_account_invoice"/>
+                 </xpath>
+             </field>
+         </record>
+         <record id="invoice_supplier_cancel_form_inherit" model="ir.ui.view">
+             <field name="name">invoice.supplier.cancel.form.inherit</field>
+             <field name="model">account.invoice</field>
+             <field name="type">form</field>
+             <field name="inherit_id" ref="account.invoice_supplier_form"/>
+             <field name="arch" type="xml">
 -                <xpath expr="/form/notebook/page/group/group/button[@name='%(account.action_account_state_open)d']" position="replace">
 -                    <button name='%(account.action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="account.group_account_invoice"/>
 -                </xpath>
+                 <xpath expr="/form/notebook/page/group/group/button[@name='invoice_cancel']" position="replace">
+                     <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel" groups="account.group_account_invoice"/>
+                 </xpath>
+             </field>
+         </record>
      </data>
  </openerp>