Browse Source

[REF] Rename module name to "pos_remove_pos_category"

pull/20/head
Sylvain Calador 10 years ago
parent
commit
287b2e9ce1
  1. 10
      pos_product_category/views/pos_product_category.xml
  2. 12
      pos_remove_pos_category/README.rst
  3. 0
      pos_remove_pos_category/__init__.py
  4. 4
      pos_remove_pos_category/__openerp__.py
  5. 6
      pos_remove_pos_category/i18n/fr.po
  6. 6
      pos_remove_pos_category/i18n/pos_remove_pos_category.pot
  7. 2
      pos_remove_pos_category/module.py
  8. 0
      pos_remove_pos_category/point_of_sale_view.xml
  9. 6
      pos_remove_pos_category/product.py
  10. 2
      pos_remove_pos_category/static/src/js/pos_remove_pos_category.js
  11. 10
      pos_remove_pos_category/views/pos_remove_pos_category.xml

10
pos_product_category/views/pos_product_category.xml

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="pos_product_category assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_product_category/static/src/js/pos_product_category.js"></script>
</xpath>
</template>
</data>
</openerp>

12
pos_product_category/README.rst → pos_remove_pos_category/README.rst

@ -1,14 +1,16 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License :alt: License
POS Product Category
====================
POS Remove POS Category
=======================
This module was written to replace POS categories by product categories.
This module was written to replace POS categories by product categories
in the point of sale.
Important notes:
Important notes
---------------
- When the module is installed the link beetween products and POS categories - When the module is installed the link beetween products and POS categories
is **overwritten** by a link beetween product categories
is **overwritten** by a link beetween products and product categories
(the link is the field pos_categ_id in the table product_template) (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 - When the module is uninstalled the link beetween products and POS categories
is restored in an **empty** state (NULL values) is restored in an **empty** state (NULL values)

0
pos_product_category/__init__.py → pos_remove_pos_category/__init__.py

4
pos_product_category/__openerp__.py → pos_remove_pos_category/__openerp__.py

@ -20,7 +20,7 @@
############################################################################## ##############################################################################
{ {
'name': 'POS Product Category',
'name': 'POS Remove POS Category',
'version': '0.1', 'version': '0.1',
'author': 'Akretion, Odoo Community Association (OCA)', 'author': 'Akretion, Odoo Community Association (OCA)',
'category': 'Sales Management', 'category': 'Sales Management',
@ -31,7 +31,7 @@
'website': 'https://www.akretion.com', 'website': 'https://www.akretion.com',
'data': [ 'data': [
'point_of_sale_view.xml', 'point_of_sale_view.xml',
'views/pos_product_category.xml',
'views/pos_remove_pos_category.xml',
], ],
'installable': True, 'installable': True,
'auto_install': False, 'auto_install': False,

6
pos_product_category/i18n/fr.po → pos_remove_pos_category/i18n/fr.po

@ -1,6 +1,6 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * pos_product_category
# * pos_remove_pos_category
# #
msgid "" msgid ""
msgstr "" msgstr ""
@ -15,8 +15,8 @@ msgstr ""
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Plural-Forms: \n" "Plural-Forms: \n"
#. module: pos_product_category
#: model:ir.model,name:pos_product_category.model_product_template
#. module: pos_remove_pos_category
#: model:ir.model,name:pos_remove_pos_category.model_product_template
msgid "Product Template" msgid "Product Template"
msgstr "Modèle d'article" msgstr "Modèle d'article"

6
pos_product_category/i18n/pos_product_category.pot → pos_remove_pos_category/i18n/pos_remove_pos_category.pot

@ -1,6 +1,6 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * pos_product_category
# * pos_remove_pos_category
# #
msgid "" msgid ""
msgstr "" msgstr ""
@ -15,8 +15,8 @@ msgstr ""
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Plural-Forms: \n" "Plural-Forms: \n"
#. module: pos_product_category
#: model:ir.model,name:pos_product_category.model_product_template
#. module: pos_remove_pos_category
#: model:ir.model,name:pos_remove_pos_category.model_product_template
msgid "Product Template" msgid "Product Template"
msgstr "" msgstr ""

2
pos_product_category/module.py → pos_remove_pos_category/module.py

@ -31,7 +31,7 @@ class Module(models.Model):
context = context or {} context = context or {}
for module in self.browse(cr, uid, ids, context=context): for module in self.browse(cr, uid, ids, context=context):
if module.name == 'pos_product_category':
if module.name == 'pos_remove_pos_category':
# As we have loose previous POS categs restore them # As we have loose previous POS categs restore them
# in a sane empty state # in a sane empty state

0
pos_product_category/point_of_sale_view.xml → pos_remove_pos_category/point_of_sale_view.xml

6
pos_product_category/product.py → pos_remove_pos_category/product.py

@ -46,16 +46,16 @@ _auto_end_original = models.BaseModel._auto_end
def _auto_end(self, cr, context=None): def _auto_end(self, cr, context=None):
""" Create the foreign keys recorded by _auto_init. """ Create the foreign keys recorded by _auto_init.
(pos_product_category monkey patching)
(pos_remove_pos_category monkey patching)
""" """
context = context or {} context = context or {}
module = context['module'] module = context['module']
foreign_keys = [] foreign_keys = []
patched = 'openerp.addons.pos_product_category' in sys.modules
patched = 'openerp.addons.pos_remove_pos_category' in sys.modules
for t, k, r, d in self._foreign_keys: for t, k, r, d in self._foreign_keys:
if patched and (t, k) == ('product_template', 'pos_categ_id'): if patched and (t, k) == ('product_template', 'pos_categ_id'):
if module == 'pos_product_category':
if module == 'pos_remove_pos_category':
cr.execute(''' cr.execute('''
ALTER TABLE product_template ALTER TABLE product_template
DROP CONSTRAINT IF EXISTS DROP CONSTRAINT IF EXISTS

2
pos_product_category/static/src/js/pos_product_category.js → pos_remove_pos_category/static/src/js/pos_remove_pos_category.js

@ -16,7 +16,7 @@
* *
******************************************************************************/ ******************************************************************************/
openerp.pos_product_category = function(instance, local) {
openerp.pos_remove_pos_category = function(instance, local) {
module = instance.point_of_sale; module = instance.point_of_sale;
var initialize_original = module.PosModel.prototype.initialize; var initialize_original = module.PosModel.prototype.initialize;

10
pos_remove_pos_category/views/pos_remove_pos_category.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="pos_remove_pos_category assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_remove_pos_category/static/src/js/pos_remove_pos_category.js"></script>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save