From 3577d58e336c5b515edc5e769e1127c2af8b161e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 29 Aug 2021 17:49:40 +0200 Subject: [PATCH] Add product_image module issue10545 review367221003 --- CHANGELOG | 4 +++- __init__.py | 3 +++ product.py | 6 ++++++ product.xml | 20 ++++++++++++++++++++ setup.py | 5 ++++- tests/test_web_shop.py | 2 +- tryton.cfg | 1 + view/product_image_form.xml | 9 +++++++++ view/product_image_list.xml | 8 ++++++++ 9 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 view/product_image_form.xml create mode 100644 view/product_image_list.xml diff --git a/CHANGELOG b/CHANGELOG index 5891e80156..6cd33f7a63 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ +* Add web shop check box to product image + Version 6.0.0 - 2021-05-03 * Bug fixes (see mercurial logs for details) Version 5.8.0 - 2020-11-02 -* Initial release \ No newline at end of file +* Initial release diff --git a/__init__.py b/__init__.py index 4b1f3fceb1..d961c75f7e 100644 --- a/__init__.py +++ b/__init__.py @@ -26,3 +26,6 @@ def register(): web.Shop_Attribute, product.Attribute, module='web_shop', type_='model', depends=['product_attribute']) + Pool.register( + product.Image, + module='web_shop', type_='model', depends=['product_image']) diff --git a/product.py b/product.py index 433149f913..61c72044db 100644 --- a/product.py +++ b/product.py @@ -32,3 +32,9 @@ class Attribute(metaclass=PoolMeta): web_shops = fields.Many2Many( 'web.shop-product.attribute', 'attribute', 'shop', "Web Shops", help="The list of web shops on which the attribute is published.") + + +class Image(metaclass=PoolMeta): + __name__ = 'product.image' + + web_shop = fields.Boolean("Web Shop") diff --git a/product.xml b/product.xml index fe374db258..2e7f19bc44 100644 --- a/product.xml +++ b/product.xml @@ -23,4 +23,24 @@ this repository contains the full copyright notices and license terms. --> product_attribute_form + + + + product.image + + product_image_list + + + + product.image + + product_image_form + + + + product.image + + product_image_form + + diff --git a/setup.py b/setup.py index 85b9159f1e..5051c1bb92 100755 --- a/setup.py +++ b/setup.py @@ -66,7 +66,10 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -tests_require = [get_require_version('trytond_product_attribute')] +tests_require = [ + get_require_version('trytond_product_attribute'), + get_require_version('trytond_product_image'), + ] dependency_links = [] if minor_version % 2: dependency_links.append( diff --git a/tests/test_web_shop.py b/tests/test_web_shop.py index 27c0933fc1..e6ff9367d8 100644 --- a/tests/test_web_shop.py +++ b/tests/test_web_shop.py @@ -13,7 +13,7 @@ from trytond.modules.company.tests import CompanyTestMixin class WebShopTestCase(CompanyTestMixin, ModuleTestCase): 'Test Web Shop module' module = 'web_shop' - extras = ['product_attribute'] + extras = ['product_attribute', 'product_image'] def suite(): diff --git a/tryton.cfg b/tryton.cfg index 916d2af229..f43f10ea88 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -11,6 +11,7 @@ depends: web_user extras_depend: product_attribute + product_image xml: web.xml product.xml diff --git a/view/product_image_form.xml b/view/product_image_form.xml new file mode 100644 index 0000000000..94d3d12709 --- /dev/null +++ b/view/product_image_form.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/view/product_image_list.xml b/view/product_image_list.xml new file mode 100644 index 0000000000..5d7061c832 --- /dev/null +++ b/view/product_image_list.xml @@ -0,0 +1,8 @@ + + + + + + +