diff --git a/base_kanban_stage_state/README.rst b/base_kanban_stage_state/README.rst new file mode 100644 index 000000000..98bbf27be --- /dev/null +++ b/base_kanban_stage_state/README.rst @@ -0,0 +1,67 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +======================= +Base Kanban Stage State +======================= + +This module extends the functionality of base_kanban_stage to allow you to +map stages from base_kanban_stage to states. The states are: + +*. New (draft) +*. In Progress (open) +*. Pending (pending) +*. Done (done) +*. Cancelled (cancelled) +*. Exception (exception) + +Usage +===== + +To use this module, you need to: + +#. Go to ... + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/149/10.0 + +Known issues / Roadmap +====================== + +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 smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Kelly Lougheed + +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/base_kanban_stage_state/__init__.py b/base_kanban_stage_state/__init__.py new file mode 100644 index 000000000..11458e838 --- /dev/null +++ b/base_kanban_stage_state/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Specialty Medical Drugstore +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from . import models diff --git a/base_kanban_stage_state/__manifest__.py b/base_kanban_stage_state/__manifest__.py new file mode 100644 index 000000000..14fa310fa --- /dev/null +++ b/base_kanban_stage_state/__manifest__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Specialty Medical Drugstore +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). +{ + "name": "Base Kanban Stage State", + "summary": "Maps stages from base_kanban_stage to states", + "version": "10.0.1.0.0", + "category": "Base", + "website": "https://odoo-community.org/", + "author": "SMDrugstore, Odoo Community Association (OCA)", + "license": "LGPL-3", + "application": False, + "installable": True, + "depends": [ + "base_kanban_stage", + ], + "data": [ + "views/base_kanban_stage_state_view.xml", + ], +} diff --git a/base_kanban_stage_state/models/__init__.py b/base_kanban_stage_state/models/__init__.py new file mode 100644 index 000000000..d8a9ea612 --- /dev/null +++ b/base_kanban_stage_state/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Specialty Medical Drugstore +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from . import base_kanban_stage diff --git a/base_kanban_stage_state/models/base_kanban_stage.py b/base_kanban_stage_state/models/base_kanban_stage.py new file mode 100644 index 000000000..aedc9f153 --- /dev/null +++ b/base_kanban_stage_state/models/base_kanban_stage.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Specialty Medical Drugstore +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from odoo import api, fields, models + + +class BaseKanbanStage(models.Model): + _inherit = 'base.kanban.stage' + + @api.model + def _get_states(self): + return [('draft', 'New'), + ('open', 'In Progress'), + ('pending', 'Pending'), + ('done', 'Done'), + ('cancelled', 'Cancelled'), + ('exception', 'Exception')] + + state = fields.Selection(_get_states, 'State') diff --git a/base_kanban_stage_state/static/description/icon.png b/base_kanban_stage_state/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/base_kanban_stage_state/static/description/icon.png differ diff --git a/base_kanban_stage_state/tests/__init__.py b/base_kanban_stage_state/tests/__init__.py new file mode 100644 index 000000000..ad0cc73dc --- /dev/null +++ b/base_kanban_stage_state/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Specialty Medical Drugstore +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +from . import test_base_kanban_stage diff --git a/base_kanban_stage_state/tests/test_base_kanban_stage.py b/base_kanban_stage_state/tests/test_base_kanban_stage.py new file mode 100644 index 000000000..3cdcc4bb3 --- /dev/null +++ b/base_kanban_stage_state/tests/test_base_kanban_stage.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Specialty Medical Drugstore +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +from odoo.tests.common import TransactionCase + + +class TestBaseKanbanStage(TransactionCase): + def test_get_states(self): + '''It should return a list of stages''' + test_stage = self.env['base.kanban.stage'].with_context({}) + + self.assertEqual(test_stage._get_states(), + [('draft', 'New'), + ('open', 'In Progress'), + ('pending', 'Pending'), + ('done', 'Done'), + ('cancelled', 'Cancelled'), + ('exception', 'Exception')] + ) diff --git a/base_kanban_stage_state/views/base_kanban_stage_state_view.xml b/base_kanban_stage_state/views/base_kanban_stage_state_view.xml new file mode 100644 index 000000000..3226ace69 --- /dev/null +++ b/base_kanban_stage_state/views/base_kanban_stage_state_view.xml @@ -0,0 +1,18 @@ + + + + + + + Kanban Stage - Form View + base.kanban.stage + + + + + + + + +