diff --git a/modules/purchase/invoice.xml b/modules/purchase/invoice.xml
index fb731ce92efc23e8b2ae4061e50abe79c90615ae_bW9kdWxlcy9wdXJjaGFzZS9pbnZvaWNlLnhtbA==..77c37edd2239b9c052210110b8af19a50489b0a8_bW9kdWxlcy9wdXJjaGFzZS9pbnZvaWNlLnhtbA== 100644
--- a/modules/purchase/invoice.xml
+++ b/modules/purchase/invoice.xml
@@ -7,8 +7,9 @@
             <field name="name">Invoices</field>
             <field name="res_model">account.invoice</field>
             <field name="context"></field>
-            <field name="domain"
-                eval="[('lines.origin.purchase.id', 'in', Eval('active_ids'), 'purchase.line')]"
+            <field
+                name="domain"
+                eval="[('purchases.id', 'in', Eval('active_ids', []))]"
                 pyson="1"/>
         </record>
         <record model="ir.action.keyword"
diff --git a/modules/sale/invoice.xml b/modules/sale/invoice.xml
index fb731ce92efc23e8b2ae4061e50abe79c90615ae_bW9kdWxlcy9zYWxlL2ludm9pY2UueG1s..77c37edd2239b9c052210110b8af19a50489b0a8_bW9kdWxlcy9zYWxlL2ludm9pY2UueG1s 100644
--- a/modules/sale/invoice.xml
+++ b/modules/sale/invoice.xml
@@ -6,8 +6,9 @@
         <record model="ir.action.act_window" id="act_invoice_form">
             <field name="name">Invoices</field>
             <field name="res_model">account.invoice</field>
-            <field name="domain"
-                eval="[If(Eval('active_ids', []) == [Eval('active_id')], ('lines.origin.sale.id', '=', Eval('active_id'), 'sale.line'), ('lines.origin.sale.id', 'in', Eval('active_ids'), 'sale.line'))]"
+            <field
+                name="domain"
+                eval="[('sales.id', 'in', Eval('active_ids', []))]"
                 pyson="1"/>
         </record>
         <record model="ir.action.keyword"
diff --git a/modules/sale_advance_payment/sale.xml b/modules/sale_advance_payment/sale.xml
index fb731ce92efc23e8b2ae4061e50abe79c90615ae_bW9kdWxlcy9zYWxlX2FkdmFuY2VfcGF5bWVudC9zYWxlLnhtbA==..77c37edd2239b9c052210110b8af19a50489b0a8_bW9kdWxlcy9zYWxlX2FkdmFuY2VfcGF5bWVudC9zYWxlLnhtbA== 100644
--- a/modules/sale_advance_payment/sale.xml
+++ b/modules/sale_advance_payment/sale.xml
@@ -9,19 +9,6 @@
             <field name="name">sale_form</field>
         </record>
 
-        <record model="ir.action.act_window" id="act_advance_invoice_form">
-            <field name="name">Advance Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="domain"
-                eval="[('lines.origin.sale.id', 'in', Eval('active_ids'), 'sale.advance_payment.condition')]"
-                pyson="1"/>
-        </record>
-        <record model="ir.action.keyword" id="act_advance_invoice_keyword1">
-            <field name="keyword">form_relate</field>
-            <field name="model">sale.sale,-1</field>
-            <field name="action" ref="act_advance_invoice_form"/>
-        </record>
-
         <record model="ir.ui.view" id="advance_payment_condition_form">
             <field name="model">sale.advance_payment.condition</field>
             <field name="type">form</field>
diff --git a/modules/sale_advance_payment/view/sale_form.xml b/modules/sale_advance_payment/view/sale_form.xml
index fb731ce92efc23e8b2ae4061e50abe79c90615ae_bW9kdWxlcy9zYWxlX2FkdmFuY2VfcGF5bWVudC92aWV3L3NhbGVfZm9ybS54bWw=..77c37edd2239b9c052210110b8af19a50489b0a8_bW9kdWxlcy9zYWxlX2FkdmFuY2VfcGF5bWVudC92aWV3L3NhbGVfZm9ybS54bWw= 100644
--- a/modules/sale_advance_payment/view/sale_form.xml
+++ b/modules/sale_advance_payment/view/sale_form.xml
@@ -9,7 +9,4 @@
         <field name="advance_payment_term"/>
         <field name="advance_payment_conditions" colspan="4"/>
     </xpath>
-    <xpath expr="//group[@id='links']" position="inside">
-        <link icon="tryton-invoice" name="sale_advance_payment.act_advance_invoice_form" empty="hide"/>
-    </xpath>
 </data>