Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Commit

Permalink
[IMP] hide button for Intercompany trade supplier invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
legalsylvain committed Jul 11, 2018
1 parent 151e3b5 commit 7821e20
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
2 changes: 2 additions & 0 deletions grap_change_views/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'simple_tax_purchase',
'purchase_discount',
'intercompany_trade_base',
'intercompany_trade_account',
'recurring_consignment',
'grap_change_access',
'product_ean13_image',
Expand All @@ -62,6 +63,7 @@
'account_invoice_triple_discount',
'web_tree_dynamic_colored_field',
'grap_qweb_report',
'invoice_verified_state',
],
'data': [
'security/res_groups.yml',
Expand Down
32 changes: 29 additions & 3 deletions grap_change_views/views/view_account_invoice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

<openerp><data>

<record id="view_account_invoice_form_customer" model="ir.ui.view">
<record id="view_account_invoice_form" model="ir.ui.view">
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="priority">200</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_line']/tree/field[@name='quantity']" position="attributes">
<attribute name="string">Qty</attribute>
Expand All @@ -27,8 +28,6 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<xpath expr="//field[@name='invoice_line']/tree/field[@name='price_subtotal']" position="attributes">
<attribute name="string">S.T.</attribute>
</xpath>


<field name="account_id" position="attributes">
<attribute name="groups">account.group_account_manager</attribute>
</field>
Expand All @@ -51,10 +50,37 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
</field>
</record>

<!-- <xpath expr="//button[@string='Refund Invoice']" position="attributes">-->
<!-- <attribute name="attrs">{'invisible': ['|', ('forbid_payment','=',True), ('state','not in',('open','proforma2','paid'))]}</attribute>-->
<!-- <attribute name="states"/>-->
<!-- </xpath>-->

<record id="view_account_invoice_form_supplier" model="ir.ui.view">
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="priority">300</field>
<field name="arch" type="xml">
<button name="invoice_verify" position="attributes">
<attribute name="attrs">{'invisible': ['|',
('intercompany_trade_readonly','=', True),
('state','not in', ('draft')),
]}</attribute>
<attribute name="states" position="replace"/>
</button>
<button name="invoice_cancel" position="attributes">
<attribute name="attrs">{'invisible': ['|',
('intercompany_trade_readonly','=', True),
('state','not in', ('draft', 'proforma2', 'open')),
]}</attribute>
<attribute name="states" position="replace"/>
</button>
<button name="action_cancel_draft" position="attributes">
<attribute name="attrs">{'invisible': ['|',
('intercompany_trade_readonly','=', True),
('state','not in', ('cancel', 'verified')),
]}</attribute>
<attribute name="states" position="replace"/>
</button>
<xpath expr="//field[@name='invoice_line']/tree/field[@name='quantity']" position="attributes">
<attribute name="string">Qty</attribute>
</xpath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<xpath expr="//field[@name='line_ids']/tree" position="attributes">
<attribute name="class">grap_change_views__view_wizard_update_invoice_supplierinfo_form</attribute>
</xpath>

<field name="current_min_quantity" position="attributes">
<attribute name="groups">base.group_no_one</attribute>
</field>
Expand Down Expand Up @@ -64,17 +63,11 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<xpath expr="//button[@name='update_supplierinfo_validate']" position="attributes">
<attribute name="groups">base.group_no_one</attribute>
</xpath>
<xpath expr="//button[@name='update_supplierinfo']" position="attributes">
<attribute name="string">Update Supplier Informations</attribute>
<attribute name="class">oe_highlight</attribute>
</xpath>
</field>
</record>

<!-- <record id="view_wizard_update_invoice_supplierinfo_form_2" model="ir.ui.view">-->
<!-- <field name="model">wizard.update.invoice.supplierinfo</field>-->
<!-- <field name="inherit_id" ref="account_invoice_supplierinfo_update.view_wizard_update_invoice_supplierinfo_form"/>-->
<!-- <field name="arch" type="xml">-->
<!-- <button name="update_supplierinfo_validate" positions="attributes">-->
<!-- <attribute name="groups">base.group_no_one</attribute>-->
<!-- </button>-->
<!-- </field>-->
<!-- </record>-->

</data></openerp>
2 changes: 1 addition & 1 deletion invoice_verified_state/data/workflow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<field name="action">wkf_verify_invoice()</field>
</record>
<record id="account.t4" model="workflow.transition">
<field name="condition">type=="out_invoice" or type=="out_refund"</field>
<field name="condition">type=="out_invoice" or type=="out_refund" or type=="in_invoice" or type=="in_refund"</field>
</record>
<record id="t15" model="workflow.transition">
<field name="act_from" ref="account.act_draft"/>
Expand Down

0 comments on commit 7821e20

Please sign in to comment.