diff --git a/pos_remove_pos_category/README.rst b/pos_remove_pos_category/README.rst deleted file mode 100644 index bcdee09d..00000000 --- a/pos_remove_pos_category/README.rst +++ /dev/null @@ -1,63 +0,0 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License - -POS Remove POS Category -======================= - -This module was written to replace POS categories by product categories -in the point of sale. - -Important notes ---------------- -- When the module is installed the link beetween products and POS categories - is **overwritten** by a link beetween products and product categories - (the link is the field pos_categ_id in the table product_template) -- When the module is uninstalled the link beetween products and POS categories - is restored in an **empty** state (NULL values) - -Installation -============ - -This module depends on the `point_of_sale` Odoo official module. - -Configuration -============= - -No configuration is needed just use product categories as standard -pos categories. -You may uncheck 'Available in the Point of Sale' field -in regular product categories if you want that a category becomes invisible -in POS. -Children categories will becomes invisible too, whatever their checkbox state. - - -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 -`here `_. - - -Credits -======= - -Contributors ------------- - -* Sylvain Calador -* Simone Orsi - -Maintainer ----------- - -.. image:: http://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: http://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 http://odoo-community.org. diff --git a/pos_remove_pos_category/__init__.py b/pos_remove_pos_category/__init__.py deleted file mode 100644 index d5e4731a..00000000 --- a/pos_remove_pos_category/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2015-TODAY Akretion (). -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from . import models diff --git a/pos_remove_pos_category/__manifest__.py b/pos_remove_pos_category/__manifest__.py deleted file mode 100644 index bec002cd..00000000 --- a/pos_remove_pos_category/__manifest__.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2015-TODAY Akretion (). -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -{ - 'name': 'POS Remove POS Category', - 'version': '10.0.0.1.0', - 'author': 'Akretion, Camptocamp SA, Odoo Community Association (OCA)', - 'category': 'Sales Management', - 'depends': [ - 'point_of_sale', - ], - 'demo': [], - 'website': 'https://www.akretion.com', - 'data': [ - 'views/assets.xml', - 'views/pos_view.xml', - 'views/pos_category_view.xml', - ], - 'installable': True, -} diff --git a/pos_remove_pos_category/i18n/fr.po b/pos_remove_pos_category/i18n/fr.po deleted file mode 100644 index 4fda25a2..00000000 --- a/pos_remove_pos_category/i18n/fr.po +++ /dev/null @@ -1,74 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * pos_remove_pos_category -# -# Translators: -# OCA Transbot , 2017 -# leemannd , 2017 -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-12 02:44+0000\n" -"PO-Revision-Date: 2017-07-12 02:44+0000\n" -"Last-Translator: leemannd , 2017\n" -"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: fr\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#. module: pos_remove_pos_category -#: model:ir.ui.view,arch_db:pos_remove_pos_category.product_category_list_view -msgid "Available in POS" -msgstr "Disponible dans le PDV" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,field_description:pos_remove_pos_category.field_product_category_available_in_pos -msgid "Available in the Point of Sale" -msgstr "Disponible dans le Point de Vente" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,help:pos_remove_pos_category.field_product_category_available_in_pos -msgid "" -"Check if you want this category to appear in Point Of Sale.\n" -"If you uncheck, children categories will becomes invisible too, whatever their checkbox state." -msgstr "" -"Cochez si vous voulez que cette catégorie apparaisse dans le Point de Vente.\n" -"Si vous décochez, les catégories enfants deviendront invisible également, quel que soit l'état de leur case à cocher." - -#. module: pos_remove_pos_category -#: model:ir.model.fields,field_description:pos_remove_pos_category.field_product_category_image -msgid "Image" -msgstr "Image" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,field_description:pos_remove_pos_category.field_product_category_image_medium -msgid "Image medium" -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_ir_module_module -msgid "Module" -msgstr "Module" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_product_category -msgid "Product Category" -msgstr "Catégorie de Produit" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_product_template -msgid "Product Template" -msgstr "Modèle d'article" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,help:pos_remove_pos_category.field_product_category_image -msgid "Show Image Category in Form View" -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,help:pos_remove_pos_category.field_product_category_image_medium -msgid "Show image category button in POS" -msgstr "" diff --git a/pos_remove_pos_category/i18n/it.po b/pos_remove_pos_category/i18n/it.po deleted file mode 100644 index 6219fde9..00000000 --- a/pos_remove_pos_category/i18n/it.po +++ /dev/null @@ -1,73 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * pos_remove_pos_category -# -# Translators: -# OCA Transbot , 2017 -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-01 04:05+0000\n" -"PO-Revision-Date: 2017-03-01 04:05+0000\n" -"Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: it\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: pos_remove_pos_category -#: model:ir.ui.view,arch_db:pos_remove_pos_category.product_category_list_view -msgid "Available in POS" -msgstr "Disponibile nel POS" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,field_description:pos_remove_pos_category.field_product_category_available_in_pos -msgid "Available in the Point of Sale" -msgstr "Disponibile nel POS" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,help:pos_remove_pos_category.field_product_category_available_in_pos -msgid "" -"Check if you want this category to appear in Point Of Sale.\n" -"If you uncheck, children categories will becomes invisible too, whatever their checkbox state." -msgstr "" -"Attiva per far apparire questa categoria nel POS.\n" -"Se disattivato, anche le sotto-categorie saranno nascoste, anche se attivate singolarmente." - -#. module: pos_remove_pos_category -#: model:ir.model.fields,field_description:pos_remove_pos_category.field_product_category_image -msgid "Image" -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,field_description:pos_remove_pos_category.field_product_category_image_medium -msgid "Image medium" -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_ir_module_module -msgid "Module" -msgstr "Module" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_product_category -msgid "Product Category" -msgstr "Categoria Prodotto" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_product_template -msgid "Product Template" -msgstr "Template Prodotto" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,help:pos_remove_pos_category.field_product_category_image -msgid "Show Image Category in Form View" -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,help:pos_remove_pos_category.field_product_category_image_medium -msgid "Show image category button in POS" -msgstr "" diff --git a/pos_remove_pos_category/i18n/nl_NL.po b/pos_remove_pos_category/i18n/nl_NL.po deleted file mode 100644 index 2238b5a6..00000000 --- a/pos_remove_pos_category/i18n/nl_NL.po +++ /dev/null @@ -1,71 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * pos_remove_pos_category -# -# Translators: -# Peter Hageman , 2017 -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-05-30 02:44+0000\n" -"PO-Revision-Date: 2017-05-30 02:44+0000\n" -"Last-Translator: Peter Hageman , 2017\n" -"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: nl_NL\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: pos_remove_pos_category -#: model:ir.ui.view,arch_db:pos_remove_pos_category.product_category_list_view -msgid "Available in POS" -msgstr "Beschikbaar in de Kassa" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,field_description:pos_remove_pos_category.field_product_category_available_in_pos -msgid "Available in the Point of Sale" -msgstr "Beschikbaar in de Kassa" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,help:pos_remove_pos_category.field_product_category_available_in_pos -msgid "" -"Check if you want this category to appear in Point Of Sale.\n" -"If you uncheck, children categories will becomes invisible too, whatever their checkbox state." -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,field_description:pos_remove_pos_category.field_product_category_image -msgid "Image" -msgstr "Afbeelding" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,field_description:pos_remove_pos_category.field_product_category_image_medium -msgid "Image medium" -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_ir_module_module -msgid "Module" -msgstr "Module" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_product_category -msgid "Product Category" -msgstr "Productcategorie" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_product_template -msgid "Product Template" -msgstr "Productsjabloon" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,help:pos_remove_pos_category.field_product_category_image -msgid "Show Image Category in Form View" -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model.fields,help:pos_remove_pos_category.field_product_category_image_medium -msgid "Show image category button in POS" -msgstr "Toon afbeelding categorie-knop in Kassa" diff --git a/pos_remove_pos_category/i18n/pos_remove_pos_category.pot b/pos_remove_pos_category/i18n/pos_remove_pos_category.pot deleted file mode 100644 index 752acaeb..00000000 --- a/pos_remove_pos_category/i18n/pos_remove_pos_category.pot +++ /dev/null @@ -1,47 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * pos_remove_pos_category -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 9.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-07-24 07:13+0000\n" -"PO-Revision-Date: 2015-07-24 07:13+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: pos_remove_pos_category -#: view:product.category:pos_remove_pos_category.product_category_list_view -msgid "Available in POS" -msgstr "" - -#. module: pos_remove_pos_category -#: field:product.category,available_in_pos:0 -msgid "Available in the Point of Sale" -msgstr "" - -#. module: pos_remove_pos_category -#: help:product.category,available_in_pos:0 -msgid "Check if you want this category to appear in Point Of Sale.\n" -"If you uncheck, children categories will becomes invisible too, whatever their checkbox state." -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_ir_module_module -msgid "Module" -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_product_category -msgid "Product Category" -msgstr "" - -#. module: pos_remove_pos_category -#: model:ir.model,name:pos_remove_pos_category.model_product_template -msgid "Product Template" -msgstr "" diff --git a/pos_remove_pos_category/models/__init__.py b/pos_remove_pos_category/models/__init__.py deleted file mode 100644 index af4a9dcf..00000000 --- a/pos_remove_pos_category/models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from . import module -from . import product diff --git a/pos_remove_pos_category/models/module.py b/pos_remove_pos_category/models/module.py deleted file mode 100644 index ea7a67fc..00000000 --- a/pos_remove_pos_category/models/module.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2015-TODAY Akretion (). -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from odoo import models - - -class Module(models.Model): - - _inherit = 'ir.module.module' - - def module_uninstall(self): - - for module in self: - if module.name == 'pos_remove_pos_category': - - # As we have loose previous POS categs restore them - # in a sane empty state - - self._cr.execute( - 'UPDATE product_template SET pos_categ_id=NULL') - # And restore original constraint - self._cr.execute(''' - ALTER TABLE product_template - DROP CONSTRAINT IF EXISTS - product_template_pos_categ_id_fkey - ''') - - self._cr.execute(''' - ALTER TABLE product_template ADD CONSTRAINT - "product_template_pos_categ_id_fkey" - FOREIGN KEY (pos_categ_id) - REFERENCES pos_category(id) ON DELETE SET NULL; - ''') - - # Restore POS category menu action - # in SQL because pool/env is not available here - self._cr.execute(''' - UPDATE ir_act_window iaw SET res_model='pos.category' - FROM ir_model_data imd - WHERE - iaw.id = imd.res_id AND - imd.model = 'ir.actions.act_window' AND - imd.name = 'product_pos_category_action' - ''') - - break - - return super(Module, self).module_uninstall() diff --git a/pos_remove_pos_category/models/product.py b/pos_remove_pos_category/models/product.py deleted file mode 100644 index a7ae6ca7..00000000 --- a/pos_remove_pos_category/models/product.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2015-TODAY Akretion (). -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -import sys -from odoo import models, fields, api, tools - - -class ProductTemplate(models.Model): - _inherit = 'product.template' - - pos_categ_id = fields.Many2one('product.category', - store=True, related='categ_id') - - @api.model - def create(self, vals): - if 'categ_id' in vals: - vals['pos_categ_id'] = vals['categ_id'] - return super(ProductTemplate, self).create(vals) - - @api.multi - def write(self, vals): - if 'pos_categ_id' in vals and not vals['pos_categ_id']: - del vals['pos_categ_id'] - return super(ProductTemplate, self).write(vals) - - -class ProductCategory(models.Model): - _inherit = 'product.category' - - image = fields.Binary(help='Show Image Category in Form View') - image_medium = fields.Binary(help='Show image category button in POS', - compute="_compute_image", - inverse="_set_image", - store=True) - available_in_pos = fields.Boolean( - string="Available in the Point of Sale", - default=True, - help="Check if you want this category to appear in Point Of Sale.\n" - "If you uncheck, children categories will becomes invisible too, " - "whatever their checkbox state.") - - @api.multi - def _compute_image(self): - return dict( - (rec.id, tools.image_get_resized_images(rec.image)) for rec in - self) - - @api.one - def _set_image(self): - return self.write( - {'image': tools.image_resize_image_big(self.image_medium)}) - - -_auto_end_original = models.BaseModel._auto_end - - -@api.model -def _auto_end(self): - """ Create the foreign keys recorded by _auto_init. - (pos_remove_pos_category monkey patching) - """ - module = self._context['module'] - foreign_keys = [] - patched = 'odoo.addons.pos_remove_pos_category' in sys.modules - - for fk in self._foreign_keys: - t = fk[0] - k = fk[1] - if patched and (t, k) == ('product_template', 'pos_categ_id'): - if module == 'pos_remove_pos_category': - self._cr.execute(''' - ALTER TABLE product_template - DROP CONSTRAINT IF EXISTS - product_template_pos_categ_id_fkey - ''') - self._cr.execute(''' - UPDATE product_template - SET pos_categ_id = categ_id; - ''') - self._cr.execute(''' - ALTER TABLE product_template ADD CONSTRAINT - "product_template_pos_categ_id_fkey" - FOREIGN KEY (pos_categ_id) - REFERENCES product_category(id) ON DELETE SET NULL; - ''') - continue - foreign_keys.append(fk) - self._foreign_keys = foreign_keys - return _auto_end_original - - -models.BaseModel._auto_end = _auto_end diff --git a/pos_remove_pos_category/static/src/js/pos_remove_pos_category.js b/pos_remove_pos_category/static/src/js/pos_remove_pos_category.js deleted file mode 100644 index fc1b2ad3..00000000 --- a/pos_remove_pos_category/static/src/js/pos_remove_pos_category.js +++ /dev/null @@ -1,38 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2015-2016 Akretion (). - * Copyright (C) 2017-TODAY Camptocamp SA (). - * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - ******************************************************************************/ - -odoo.define('pos_remove_pos_category.remove_pos_category', function (require) { - "use strict"; - - var core = require('web.core'); - var pos_models = require('point_of_sale.models'); - var pos_screens = require('point_of_sale.screens'); - var Model = require('web.DataModel'); - var _t = core._t; - - var _pos_super = pos_models.PosModel.prototype; - pos_models.PosModel = pos_models.PosModel.extend({ - initialize: function(session, attributes) { - for (var i = 0 ; i < this.models.length; i++){ - if (this.models[i].model == 'pos.category') { - this.models[i].model = 'product.category'; - this.models[i].domain = [['available_in_pos', '=', true]]; - } - } - return _pos_super.initialize.apply(this, arguments); - } - }); - - // override method js POS (widgets.js) - // change pos.category by product.category - pos_screens.ProductCategoriesWidget.include({ - get_image_url: function(category){ - var image_url = '/web/binary/image?model=product.category&field=image_medium&id='; - return window.location.origin + image_url + category.id; - } - }); - -}); diff --git a/pos_remove_pos_category/views/assets.xml b/pos_remove_pos_category/views/assets.xml deleted file mode 100644 index 409a5f1c..00000000 --- a/pos_remove_pos_category/views/assets.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/pos_remove_pos_category/views/pos_category_view.xml b/pos_remove_pos_category/views/pos_category_view.xml deleted file mode 100644 index 14a6cd02..00000000 --- a/pos_remove_pos_category/views/pos_category_view.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - product.category - - - 20 - - - - - - - - - - - - product.category - - - - - - - - diff --git a/pos_remove_pos_category/views/pos_view.xml b/pos_remove_pos_category/views/pos_view.xml deleted file mode 100644 index c8e3cc54..00000000 --- a/pos_remove_pos_category/views/pos_view.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - product.template.form.inherit - product.template - - - - - 1 - - - - - product.category - -