diff --git a/web_kanban_stage/README.rst b/base_kanban_stage/README.rst similarity index 81% rename from web_kanban_stage/README.rst rename to base_kanban_stage/README.rst index 6c1982f61..8d2563d4e 100644 --- a/web_kanban_stage/README.rst +++ b/base_kanban_stage/README.rst @@ -8,7 +8,7 @@ Kanban - Stage Support This module provides a stage model compatible with Kanban views and the standard views needed to manage these stages. It also provides the -``web.kanban.abstract`` model, which can be inherited to add support for +``base.kanban.abstract`` model, which can be inherited to add support for Kanban views with stages to any other model. Lastly, it includes a base Kanban view that can be extended as needed. @@ -25,16 +25,16 @@ No configuration is needed or possible. Usage ===== -* Inherit from ``web.kanban.abstract`` to add Kanban stage functionality to +* Inherit from ``base.kanban.abstract`` to add Kanban stage functionality to the child model: .. code-block:: python class MyModel(models.Model): _name = 'my.model' - _inherit = 'web.kanban.abstract' + _inherit = 'base.kanban.abstract' -* Extend the provided base Kanban view (``web_kanban_abstract_view_kanban``) +* Extend the provided base Kanban view (``base_kanban_abstract_view_kanban``) as needed by the child model. The base view has four ``name`` attributes intended to provide convenient XPath access to different parts of the Kanban card. They are ``card_dropdown_menu``, ``card_header``, ``card_body``, and @@ -45,7 +45,7 @@ Usage My Model - Kanban View my.model - + @@ -65,14 +65,14 @@ Usage Known Issues / Roadmap ====================== -* The grouping logic used by ``web.kanban.abstract`` currently does not +* The grouping logic used by ``base.kanban.abstract`` currently does not support additional domains and alternate sort orders Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. In -case of trouble, please check there if your issue has already been reported. +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 smash it by providing detailed and welcomed feedback. diff --git a/web_kanban_stage/__init__.py b/base_kanban_stage/__init__.py similarity index 100% rename from web_kanban_stage/__init__.py rename to base_kanban_stage/__init__.py diff --git a/web_kanban_stage/__openerp__.py b/base_kanban_stage/__openerp__.py similarity index 83% rename from web_kanban_stage/__openerp__.py rename to base_kanban_stage/__openerp__.py index 86ab22b79..eeec97fa3 100644 --- a/web_kanban_stage/__openerp__.py +++ b/base_kanban_stage/__openerp__.py @@ -7,7 +7,7 @@ 'summary': 'Provides stage model and abstract logic for inheritance', 'version': '9.0.1.0.0', 'author': "LasLabs, Odoo Community Association (OCA)", - 'category': 'Web', + 'category': 'base', 'depends': [ 'web_kanban', ], @@ -15,8 +15,8 @@ 'license': 'LGPL-3', 'data': [ 'security/ir.model.access.csv', - 'views/web_kanban_abstract.xml', - 'views/web_kanban_stage.xml', + 'views/base_kanban_abstract.xml', + 'views/base_kanban_stage.xml', ], 'installable': True, 'application': False, diff --git a/web_kanban_stage/models/__init__.py b/base_kanban_stage/models/__init__.py similarity index 64% rename from web_kanban_stage/models/__init__.py rename to base_kanban_stage/models/__init__.py index 1b31900ee..abde8b5bd 100644 --- a/web_kanban_stage/models/__init__.py +++ b/base_kanban_stage/models/__init__.py @@ -2,5 +2,5 @@ # Copyright 2016 LasLabs Inc. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). -from . import web_kanban_abstract -from . import web_kanban_stage +from . import base_kanban_abstract +from . import base_kanban_stage diff --git a/web_kanban_stage/models/web_kanban_abstract.py b/base_kanban_stage/models/base_kanban_abstract.py similarity index 95% rename from web_kanban_stage/models/web_kanban_abstract.py rename to base_kanban_stage/models/base_kanban_abstract.py index 67cebef28..23f53d81a 100644 --- a/web_kanban_stage/models/web_kanban_abstract.py +++ b/base_kanban_stage/models/base_kanban_abstract.py @@ -5,13 +5,13 @@ from openerp import api, fields, models -class WebKanbanAbstract(models.AbstractModel): +class BaseKanbanAbstract(models.AbstractModel): '''Inherit from this class to add support for Kanban stages to your model. All public properties are preceded with kanban_ in order to isolate from child models, with the exception of stage_id, which is a required field in the Kanban widget and must be defined as such.''' - _name = 'web.kanban.abstract' + _name = 'base.kanban.abstract' _order = 'kanban_priority desc, kanban_sequence' _group_by_full = { 'stage_id': lambda s, *a, **k: s._read_group_stage_ids(*a, **k), @@ -31,7 +31,7 @@ class WebKanbanAbstract(models.AbstractModel): ) stage_id = fields.Many2one( string='Kanban Stage', - comodel_name='web.kanban.stage', + comodel_name='base.kanban.stage', track_visibility='onchange', index=True, copy=False, @@ -105,7 +105,7 @@ class WebKanbanAbstract(models.AbstractModel): def _read_group_stage_ids( self, domain=None, read_group_order=None, access_rights_uid=None ): - stage_model = self.env['web.kanban.stage'].sudo(access_rights_uid) + stage_model = self.env['base.kanban.stage'].sudo(access_rights_uid) stages = stage_model.search([('res_model.model', '=', self._name)]) names = [(r.id, r.display_name) for r in stages] fold = {r.id: r.fold for r in stages} diff --git a/web_kanban_stage/models/web_kanban_stage.py b/base_kanban_stage/models/base_kanban_stage.py similarity index 97% rename from web_kanban_stage/models/web_kanban_stage.py rename to base_kanban_stage/models/base_kanban_stage.py index b40a7aaf3..046fb5a65 100644 --- a/web_kanban_stage/models/web_kanban_stage.py +++ b/base_kanban_stage/models/base_kanban_stage.py @@ -5,8 +5,8 @@ from openerp import api, fields, models -class WebKanbanStage(models.Model): - _name = 'web.kanban.stage' +class BaseKanbanStage(models.Model): + _name = 'base.kanban.stage' _description = 'Kanban Stage' _order = 'res_model, sequence' diff --git a/base_kanban_stage/security/ir.model.access.csv b/base_kanban_stage/security/ir.model.access.csv new file mode 100644 index 000000000..b47795a31 --- /dev/null +++ b/base_kanban_stage/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_user,Kanban Stage - User Access,model_base_kanban_stage,base.group_user,1,0,0,0 +access_manager,Kanban Stage - Manager Access,model_base_kanban_stage,base.group_erp_manager,1,1,1,1 diff --git a/web_kanban_stage/static/description/icon.png b/base_kanban_stage/static/description/icon.png similarity index 100% rename from web_kanban_stage/static/description/icon.png rename to base_kanban_stage/static/description/icon.png diff --git a/web_kanban_stage/tests/__init__.py b/base_kanban_stage/tests/__init__.py similarity index 61% rename from web_kanban_stage/tests/__init__.py rename to base_kanban_stage/tests/__init__.py index 09868d7c5..05cdecf9a 100644 --- a/web_kanban_stage/tests/__init__.py +++ b/base_kanban_stage/tests/__init__.py @@ -2,5 +2,5 @@ # Copyright 2016 LasLabs Inc. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). -from . import test_web_kanban_abstract -from . import test_web_kanban_stage +from . import test_base_kanban_abstract +from . import test_base_kanban_stage diff --git a/web_kanban_stage/tests/test_web_kanban_abstract.py b/base_kanban_stage/tests/test_base_kanban_abstract.py similarity index 71% rename from web_kanban_stage/tests/test_web_kanban_abstract.py rename to base_kanban_stage/tests/test_base_kanban_abstract.py index 6a8a52faf..eb20b3cdf 100644 --- a/web_kanban_stage/tests/test_web_kanban_abstract.py +++ b/base_kanban_stage/tests/test_base_kanban_abstract.py @@ -6,29 +6,29 @@ from openerp import models from openerp.tests.common import TransactionCase -class WebKanbanAbstractTester(models.Model): - _name = 'web.kanban.abstract.tester' - _inherit = 'web.kanban.abstract' +class BaseKanbanAbstractTester(models.Model): + _name = 'base.kanban.abstract.tester' + _inherit = 'base.kanban.abstract' -class TestWebKanbanAbstract(TransactionCase): +class TestBaseKanbanAbstract(TransactionCase): def setUp(self): - super(TestWebKanbanAbstract, self).setUp() + super(TestBaseKanbanAbstract, self).setUp() - WebKanbanAbstractTester._build_model(self.registry, self.cr) - self.test_model = self.env[WebKanbanAbstractTester._name] + BaseKanbanAbstractTester._build_model(self.registry, self.cr) + self.test_model = self.env[BaseKanbanAbstractTester._name] test_model_type = self.env['ir.model'].create({ - 'model': WebKanbanAbstractTester._name, + 'model': BaseKanbanAbstractTester._name, 'name': 'Kanban Abstract - Test Model', 'state': 'base', }) - test_stage_1 = self.env['web.kanban.stage'].create({ + test_stage_1 = self.env['base.kanban.stage'].create({ 'name': 'Test Stage 1', 'res_model': test_model_type.id, }) - test_stage_2 = self.env['web.kanban.stage'].create({ + test_stage_2 = self.env['base.kanban.stage'].create({ 'name': 'Test Stage 2', 'res_model': test_model_type.id, 'fold': True, @@ -50,9 +50,9 @@ class TestWebKanbanAbstract(TransactionCase): def test_read_group_stage_ids_correct_associated_model(self): '''It should only return info for stages with right associated model''' stage_model = self.env['ir.model'].search([ - ('model', '=', 'web.kanban.stage'), + ('model', '=', 'base.kanban.stage'), ]) - self.env['web.kanban.stage'].create({ + self.env['base.kanban.stage'].create({ 'name': 'Test Stage 3', 'res_model': stage_model.id, }) diff --git a/web_kanban_stage/tests/test_web_kanban_stage.py b/base_kanban_stage/tests/test_base_kanban_stage.py similarity index 74% rename from web_kanban_stage/tests/test_web_kanban_stage.py rename to base_kanban_stage/tests/test_base_kanban_stage.py index 831e25b68..7e089ff7b 100644 --- a/web_kanban_stage/tests/test_web_kanban_stage.py +++ b/base_kanban_stage/tests/test_base_kanban_stage.py @@ -5,18 +5,18 @@ from openerp.tests.common import TransactionCase -class TestWebKanbanStage(TransactionCase): +class TestBaseKanbanStage(TransactionCase): def test_default_res_model_no_params(self): - '''It should return empty ir.model recordset if no params in context''' - test_stage = self.env['web.kanban.stage'].with_context({}) + '''It should return empty ir.model Recordset if no params in context''' + test_stage = self.env['base.kanban.stage'].with_context({}) res_model = test_stage._default_res_model() self.assertFalse(res_model) self.assertEqual(res_model._name, 'ir.model') def test_default_res_model_no_action(self): - '''It should return empty ir.model recordset if no action in params''' - test_stage = self.env['web.kanban.stage'].with_context(params={}) + '''It should return empty ir.model Recordset if no action in params''' + test_stage = self.env['base.kanban.stage'].with_context(params={}) res_model = test_stage._default_res_model() self.assertFalse(res_model) @@ -28,7 +28,7 @@ class TestWebKanbanStage(TransactionCase): 'name': 'Test Action', 'res_model': 'res.users', }) - test_stage = self.env['web.kanban.stage'].with_context( + test_stage = self.env['base.kanban.stage'].with_context( params={'action': test_action.id}, ) @@ -41,9 +41,9 @@ class TestWebKanbanStage(TransactionCase): '''It should not return ir.model record corresponding to stage model''' test_action = self.env['ir.actions.act_window'].create({ 'name': 'Test Action', - 'res_model': 'web.kanban.stage', + 'res_model': 'base.kanban.stage', }) - test_stage = self.env['web.kanban.stage'].with_context( + test_stage = self.env['base.kanban.stage'].with_context( params={'action': test_action.id}, ) diff --git a/web_kanban_stage/views/web_kanban_abstract.xml b/base_kanban_stage/views/base_kanban_abstract.xml similarity index 96% rename from web_kanban_stage/views/web_kanban_abstract.xml rename to base_kanban_stage/views/base_kanban_abstract.xml index de59bf1da..5f5615f9e 100644 --- a/web_kanban_stage/views/web_kanban_abstract.xml +++ b/base_kanban_stage/views/base_kanban_abstract.xml @@ -6,9 +6,9 @@ --> - + Kanban Abstract - Base Kanban View - web.kanban.abstract + base.kanban.abstract diff --git a/web_kanban_stage/views/web_kanban_stage.xml b/base_kanban_stage/views/base_kanban_stage.xml similarity index 74% rename from web_kanban_stage/views/web_kanban_stage.xml rename to base_kanban_stage/views/base_kanban_stage.xml index 91316f4ea..cc99617cf 100644 --- a/web_kanban_stage/views/web_kanban_stage.xml +++ b/base_kanban_stage/views/base_kanban_stage.xml @@ -6,9 +6,9 @@ --> - + Kanban Stage - Form View - web.kanban.stage + base.kanban.stage
@@ -31,9 +31,9 @@ - + Kanban Stages - Tree View - web.kanban.stage + base.kanban.stage @@ -43,9 +43,9 @@ - + Kanban Stages - Search View - web.kanban.stage + base.kanban.stage @@ -55,17 +55,18 @@ - + Kanban Stages - web.kanban.stage + base.kanban.stage ir.actions.act_window form tree,form - - + diff --git a/web_kanban_stage/security/ir.model.access.csv b/web_kanban_stage/security/ir.model.access.csv deleted file mode 100644 index afa1cb706..000000000 --- a/web_kanban_stage/security/ir.model.access.csv +++ /dev/null @@ -1,3 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_user,Kanban Stage - User Access,model_web_kanban_stage,base.group_user,1,0,0,0 -access_manager,Kanban Stage - Manager Access,model_web_kanban_stage,base.group_erp_manager,1,1,1,1