diff --git a/agreement_serviceprofile/models/agreement_serviceprofile.py b/agreement_serviceprofile/models/agreement_serviceprofile.py
index 6f676bf67..c2b2289dd 100644
--- a/agreement_serviceprofile/models/agreement_serviceprofile.py
+++ b/agreement_serviceprofile/models/agreement_serviceprofile.py
@@ -28,8 +28,11 @@ class AgreementServiceProfile(models.Model):
notes = fields.Text(string="Notes")
product_id = fields.Many2one('product.template', 'Service Product',
domain="[('is_serviceprofile', '=', True), "
- "('type', '=', 'service')]",
- required=True)
+ "('type', '=', 'service')]")
+ product_variant_id = fields.Many2one('product.product', 'Service Product Variant',
+ domain="[('is_serviceprofile', '=', True), "
+ "('type', '=', 'service')]")
+ use_product_variant = fields.Boolean('Use Product Variant', default=False)
partner_id = fields.Many2one(related='agreement_id.partner_id',
string='Partner')
diff --git a/agreement_serviceprofile/models/product.py b/agreement_serviceprofile/models/product.py
index afde8de02..55a216989 100644
--- a/agreement_serviceprofile/models/product.py
+++ b/agreement_serviceprofile/models/product.py
@@ -16,3 +16,17 @@ class ProductTemplate(models.Model):
def onchange_type(self):
if self.is_serviceprofile:
self.type = 'service'
+
+
+class ProductProduct(models.Model):
+ _inherit = 'product.product'
+
+ is_serviceprofile = fields.Boolean(
+ string="Create Service Profiles",
+ help="""If True, this product will create a service profile on the
+ agreement when the sales order is confirmed.""")
+
+ @api.onchange('is_serviceprofile')
+ def onchange_type(self):
+ if self.is_serviceprofile:
+ self.type = 'service'
diff --git a/agreement_serviceprofile/views/agreement.xml b/agreement_serviceprofile/views/agreement.xml
index c7e605b84..cd5107e67 100644
--- a/agreement_serviceprofile/views/agreement.xml
+++ b/agreement_serviceprofile/views/agreement.xml
@@ -12,6 +12,7 @@