diff --git a/odoo/local-src/specific_sale/models/sale_order.py b/odoo/local-src/specific_sale/models/sale_order.py
index d8d18b6e80f..3da76911d44 100644
--- a/odoo/local-src/specific_sale/models/sale_order.py
+++ b/odoo/local-src/specific_sale/models/sale_order.py
@@ -42,7 +42,9 @@ class SaleOrder(models.Model):
string='Sales Condition',
required=True,
attachment=True,
- states={'draft': [('required', False)]}
+ copy=True,
+ states={'draft': [('required', False)],
+ 'cancel': [('required', False)]}
)
sales_condition_filename = fields.Char()
@@ -148,11 +150,13 @@ def _check_validators(self):
def write(self, vals):
# from ' draft you can switch only to 'final_quote'
+ target_state = vals.get('state', 'final_quote')
if (self.state == 'draft' and
- vals.get('state', 'final_quote') != 'final_quote'):
+ target_state not in ('cancel', 'final_quote')):
raise UserError(
- 'A Draft Sale Order can only step to "final_quote" ')
- if vals.get('state', 'draft') != 'draft':
+ _('A Draft Sale Order can only step to '
+ '"final_quote" or "cancel"'))
+ if vals.get('state', 'draft') not in ('cancel', 'draft'):
self._check_ghost()
self._check_sales_condition()
self._check_validators()
diff --git a/odoo/local-src/specific_sale/views/product_views.xml b/odoo/local-src/specific_sale/views/product_views.xml
index 1b9c643d92d..8b878ccebd7 100644
--- a/odoo/local-src/specific_sale/views/product_views.xml
+++ b/odoo/local-src/specific_sale/views/product_views.xml
@@ -15,18 +15,4 @@
-
- product.template.ghost.form
- product.template
-
-
-
-
-
-
diff --git a/odoo/local-src/specific_sale/views/sale_order_crm.xml b/odoo/local-src/specific_sale/views/sale_order_crm.xml
index 7adaa27b266..cb67595a567 100644
--- a/odoo/local-src/specific_sale/views/sale_order_crm.xml
+++ b/odoo/local-src/specific_sale/views/sale_order_crm.xml
@@ -35,15 +35,23 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/odoo/migration.yml b/odoo/migration.yml
index 8948c52245c..b714a87a057 100644
--- a/odoo/migration.yml
+++ b/odoo/migration.yml
@@ -126,3 +126,4 @@ migration:
upgrade:
- specific_crm
- specific_sale
+ - sale_order_revision