From b1e2af84b1d840fcd522369e8a349eb319914cfa Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 20 Aug 2020 20:01:34 -0500 Subject: [PATCH] Remove CORE ID field when creating product --- tailbone_corepos/views/products.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tailbone_corepos/views/products.py b/tailbone_corepos/views/products.py index bc12d06..0ed2fdc 100644 --- a/tailbone_corepos/views/products.py +++ b/tailbone_corepos/views/products.py @@ -54,6 +54,12 @@ class ProductView(base.ProductsView): model = self.rattail_config.get_model() g.set_filter('corepos_id', model.CoreProduct.corepos_id) + def configure_form(self, f): + super(ProductView, self).configure_form(f) + + if self.creating: + f.remove('corepos_id') + def get_version_child_classes(self): model = self.rattail_config.get_model() return super(ProductView, self).get_version_child_classes() + [