From ddda33015a2ccd6ca8f9a27381248e0272f244e4 Mon Sep 17 00:00:00 2001 From: houssine Date: Sun, 29 Mar 2020 21:19:23 +0200 Subject: [PATCH] [IMP] add can shop boolean on the share product It will avoid to test on hardcoded values. It also makes several shares allowing to shop product from the coop --- beesdoo_easy_my_coop/__manifest__.py | 16 ++++++++-------- beesdoo_easy_my_coop/models/__init__.py | 1 + beesdoo_easy_my_coop/models/product.py | 8 ++++++++ beesdoo_easy_my_coop/views/product.xml | 13 +++++++++++++ 4 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 beesdoo_easy_my_coop/models/product.py create mode 100644 beesdoo_easy_my_coop/views/product.xml diff --git a/beesdoo_easy_my_coop/__manifest__.py b/beesdoo_easy_my_coop/__manifest__.py index 9baa2d7..ccd9b29 100644 --- a/beesdoo_easy_my_coop/__manifest__.py +++ b/beesdoo_easy_my_coop/__manifest__.py @@ -2,7 +2,8 @@ 'name': "Beescoop link with easy my coop", 'summary': """ - Module that made the link between beesdoo customization and easy_my_coop + Module that made the link between beesdoo customization + and easy_my_coop """, 'description': """ @@ -11,23 +12,22 @@ 'author': "Beescoop - Cellule IT", 'website': "https://github.com/beescoop/Obeesdoo", - # Categories can be used to filter modules in modules listing - # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml - # for the full list 'category': 'Cooperative management', 'version': '12.0.1.0.0', - # any module necessary for this one to work correctly - 'depends': ['beesdoo_base', 'beesdoo_shift', 'easy_my_coop', 'easy_my_coop_eater'], + 'depends': ['beesdoo_base', + 'beesdoo_shift', + 'easy_my_coop', + 'easy_my_coop_eater' + ], - # always loaded 'data': [ 'data/product_share.xml', 'views/partner.xml', 'views/res_company.xml', 'views/subscription_request.xml', 'views/subscription_templates.xml', + 'views/product.xml' ], 'auto_install': True, - # only loaded in demonstration mode } diff --git a/beesdoo_easy_my_coop/models/__init__.py b/beesdoo_easy_my_coop/models/__init__.py index 00b712c..e856cc7 100644 --- a/beesdoo_easy_my_coop/models/__init__.py +++ b/beesdoo_easy_my_coop/models/__init__.py @@ -1,3 +1,4 @@ from . import res_partner from . import subscription_request from . import res_company +from . import product diff --git a/beesdoo_easy_my_coop/models/product.py b/beesdoo_easy_my_coop/models/product.py new file mode 100644 index 0000000..2bdeca0 --- /dev/null +++ b/beesdoo_easy_my_coop/models/product.py @@ -0,0 +1,8 @@ +from odoo import models, fields + + +class ProductTemplate(models.Model): + + inherit = 'product.template' + + can_shop = fields.Boolean(string="Is share?") diff --git a/beesdoo_easy_my_coop/views/product.xml b/beesdoo_easy_my_coop/views/product.xml new file mode 100644 index 0000000..6316bae --- /dev/null +++ b/beesdoo_easy_my_coop/views/product.xml @@ -0,0 +1,13 @@ + + + + product.template.share.form + product.template + + + + + + + + \ No newline at end of file