diff --git a/website_sale_cart_selectable/README.rst b/website_sale_cart_selectable/README.rst new file mode 100644 index 0000000000..0a173052cb --- /dev/null +++ b/website_sale_cart_selectable/README.rst @@ -0,0 +1,74 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================ +Website Sale Cart Selectable +============================ + +This module was written to extend the functionality of the website to control +button add to cart. Button add to cart can now be set to be published or not. + +Installation +============ + +To install this module, you need to: + +1. Clone the branch 8.0 of the repository https://github.com/OCA/e-commerce +2. Add the path to this repository in your configuration (addons-path) +3. Update the module list +4. Go to menu *Setting -> Modules -> Local Modules* +5. Search For *Website Sale Cart Selectable* +6. Install the module + +Usage +===== + +To use this module, you need to: + +1. Go to menu *Sales -> Products -> Products* +2. Edit or create one. +3. Within the *Sales* tab, there will be a new field named *Button Add To Cart* +4. If you want the button add to cart visible on the website, just click into *Published*. + If you dont want the button add to cart visible on the website, just click into *Not Published* + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/113/8.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Michael Viriyananda + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/website_sale_cart_selectable/__init__.py b/website_sale_cart_selectable/__init__.py new file mode 100644 index 0000000000..da264b0be3 --- /dev/null +++ b/website_sale_cart_selectable/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 OpenSynergy Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/website_sale_cart_selectable/__openerp__.py b/website_sale_cart_selectable/__openerp__.py new file mode 100644 index 0000000000..bef751e414 --- /dev/null +++ b/website_sale_cart_selectable/__openerp__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# © 2016 OpenSynergy Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Website Sale Cart Selectable', + 'version': '8.0.1.0.0', + 'summary': 'Enables to controlling button add to cart per product', + 'author': 'OpenSynergy Indonesia,Odoo Community Association (OCA)', + 'website': 'https://opensynergy-indonesia.com', + 'category': 'Website', + 'depends': ['website_sale'], + 'data': [ + 'views/product_view.xml', + 'views/website_sale_template.xml' + ], + 'installable': True, + 'license': 'AGPL-3', +} diff --git a/website_sale_cart_selectable/models/__init__.py b/website_sale_cart_selectable/models/__init__.py new file mode 100644 index 0000000000..768378804e --- /dev/null +++ b/website_sale_cart_selectable/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 OpenSynergy Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import product \ No newline at end of file diff --git a/website_sale_cart_selectable/models/product.py b/website_sale_cart_selectable/models/product.py new file mode 100644 index 0000000000..2f1161c0c5 --- /dev/null +++ b/website_sale_cart_selectable/models/product.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# © 2016 OpenSynergy Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import fields, models + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + website_btn_addtocart_published = fields.Boolean( + string='Button Add To Cart', + copy=False, + default=True) diff --git a/website_sale_cart_selectable/static/description/icon.png b/website_sale_cart_selectable/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/website_sale_cart_selectable/static/description/icon.png differ diff --git a/website_sale_cart_selectable/views/product_view.xml b/website_sale_cart_selectable/views/product_view.xml new file mode 100644 index 0000000000..c42098374e --- /dev/null +++ b/website_sale_cart_selectable/views/product_view.xml @@ -0,0 +1,17 @@ + + + + + + Product Add To Cart + product.template + + + + + + + + + + diff --git a/website_sale_cart_selectable/views/website_sale_template.xml b/website_sale_cart_selectable/views/website_sale_template.xml new file mode 100644 index 0000000000..6c6c78a210 --- /dev/null +++ b/website_sale_cart_selectable/views/website_sale_template.xml @@ -0,0 +1,27 @@ + + + + + + + + + +