diff --git a/ext/custom-addons/dp_custom/models/product.py b/ext/custom-addons/dp_custom/models/product.py index 0ca5c0f5..02993c21 100644 --- a/ext/custom-addons/dp_custom/models/product.py +++ b/ext/custom-addons/dp_custom/models/product.py @@ -42,6 +42,9 @@ else: class ReportIntrastatCode(models.Model): _inherit = "report.intrastat.code" + _sql_constraints = [ + ('name_uniq', 'unique(name)', 'Der Intrastat-Code muss eindeutig sein'), + ] active = fields.Boolean(string='Active', default=True, help="If unchecked, it will allow you to hide the code without removing it.") diff --git a/ext/custom-addons/dp_custom/views/product_views.xml b/ext/custom-addons/dp_custom/views/product_views.xml index 4d9dc0e8..40050656 100644 --- a/ext/custom-addons/dp_custom/views/product_views.xml +++ b/ext/custom-addons/dp_custom/views/product_views.xml @@ -190,40 +190,44 @@ action="product_xcategory_action"/> - - - report.intrastat.code.tz_tree - report.intrastat.code - - - - - + + + report.intrastat.code.tz_tree + report.intrastat.code + + + + name asc + + + - - - report.intrastat.code.tz_form - report.intrastat.code - - + + + + + report.intrastat.code.tz_form + report.intrastat.code + + - -
- -
-
-
-
+ +
+ +
+
+
+
- + report.intrastat.code.search report.intrastat.code {'filter_active': 1} @@ -235,7 +239,7 @@ - +