diff --git a/agreement_account/demo/demo.xml b/agreement_account/demo/demo.xml
index 2d08d890..3dd2a014 100644
--- a/agreement_account/demo/demo.xml
+++ b/agreement_account/demo/demo.xml
@@ -11,7 +11,7 @@
C2C-IT0042
Hardware IT
- sale
+ sale
2017-09-10
@@ -19,7 +19,7 @@
C2C-IT0043
Fiber access office Lausanne
- sale
+ sale
@@ -27,7 +27,7 @@
AGR-VETO001
Vétérinaire
- sale
+ sale
2017-08-01
@@ -35,7 +35,7 @@
AGR-TEL001
Wazo IPBX deployment and maintenance
- sale
+ sale
2017-05-05
@@ -43,7 +43,7 @@
BUY-VOIP012
SIP Phones supply
- purchase
+ purchase
@@ -51,7 +51,7 @@
BUY-VOIP013
SIP-ISDN gateways
- purchase
+ purchase
2017-09-02
diff --git a/agreement_account/models/agreement.py b/agreement_account/models/agreement.py
index 5e8d8900..aa4f48c3 100644
--- a/agreement_account/models/agreement.py
+++ b/agreement_account/models/agreement.py
@@ -13,7 +13,7 @@ class Agreement(models.Model):
code = fields.Char(
string='Code', required=True, copy=False)
name = fields.Char(string='Name', required=True)
- type = fields.Selection([
+ agreement_type = fields.Selection([
('sale', 'Sale'),
('purchase', 'Purchase'),
], string='Type', required=True)
diff --git a/agreement_account/views/account_invoice.xml b/agreement_account/views/account_invoice.xml
index ddef6e28..0f46bcc1 100644
--- a/agreement_account/views/account_invoice.xml
+++ b/agreement_account/views/account_invoice.xml
@@ -14,8 +14,8 @@
+ domain="[('partner_id', 'child_of', commercial_partner_id), ('agreement_type', '=', 'sale')]"
+ context="{'default_partner_id': commercial_partner_id, 'default_agreement_type': 'sale'}"/>
@@ -28,8 +28,8 @@
+ domain="[('partner_id', 'child_of', commercial_partner_id), ('agreement_type', '=', 'purchase')]"
+ context="{'default_partner_id': commercial_partner_id, 'default_agreement_type': 'purchase'}"/>
diff --git a/agreement_account/views/agreement.xml b/agreement_account/views/agreement.xml
index e6a789a8..655c18c1 100644
--- a/agreement_account/views/agreement.xml
+++ b/agreement_account/views/agreement.xml
@@ -23,14 +23,14 @@
-
+
-
+
-
+
@@ -45,7 +45,7 @@
-
+
@@ -59,8 +59,8 @@
-
-
+
+
@@ -68,8 +68,8 @@
context="{'group_by': 'partner_id'}"/>
-
+
diff --git a/agreement_sale/views/agreement.xml b/agreement_sale/views/agreement.xml
index b7a31aa1..68629b55 100644
--- a/agreement_sale/views/agreement.xml
+++ b/agreement_sale/views/agreement.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/agreement_sale/views/sale_order.xml b/agreement_sale/views/sale_order.xml
index d956e99d..89c7fb21 100644
--- a/agreement_sale/views/sale_order.xml
+++ b/agreement_sale/views/sale_order.xml
@@ -14,8 +14,8 @@
+ domain="[('partner_id', 'child_of', commercial_partner_id), ('agreement_type', '=', 'sale')]"
+ context="{'default_partner_id': commercial_partner_id, 'default_agreement_type': 'sale'}"/>