From a54752bda22ed65afb6752bd4d516c6871523cea Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 17 Mar 2017 10:21:51 +0100 Subject: [PATCH 1/5] fix field is_ghost showing twice in product form --- .../specific_sale/views/product_views.xml | 14 -------------- 1 file changed, 14 deletions(-) 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 - - -
-
- -
-
-
-
- From 3b9cd56d428a6bd5aebea702a483de890672f6ec Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 17 Mar 2017 10:26:54 +0100 Subject: [PATCH 2/5] tidy up fields in Roctools tab --- .../specific_sale/views/sale_order_crm.xml | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) 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 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + From 4236cb3d6685ec733cad23a8c74db182b3c2c16a Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 17 Mar 2017 10:34:13 +0100 Subject: [PATCH 3/5] allow to cancel a draft SO --- odoo/local-src/specific_sale/models/sale_order.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/odoo/local-src/specific_sale/models/sale_order.py b/odoo/local-src/specific_sale/models/sale_order.py index d8d18b6e80f..070c2d548f2 100644 --- a/odoo/local-src/specific_sale/models/sale_order.py +++ b/odoo/local-src/specific_sale/models/sale_order.py @@ -148,11 +148,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() From 01089af19c52f6dd2626344e2841e943b48404bc Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 17 Mar 2017 10:36:43 +0100 Subject: [PATCH 4/5] fix required on sales_condition in Cancel state --- odoo/local-src/specific_sale/models/sale_order.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/odoo/local-src/specific_sale/models/sale_order.py b/odoo/local-src/specific_sale/models/sale_order.py index 070c2d548f2..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() From 53aff5a0a008a050b48a6cd19c3c7da5633c8c6a Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 17 Mar 2017 10:37:26 +0100 Subject: [PATCH 5/5] install sale_order_revision --- odoo/migration.yml | 1 + 1 file changed, 1 insertion(+) 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