diff --git a/base_kanban_stage/README.rst b/base_kanban_stage/README.rst index 8d2563d4e..1c7c354ea 100644 --- a/base_kanban_stage/README.rst +++ b/base_kanban_stage/README.rst @@ -35,16 +35,18 @@ Usage _inherit = 'base.kanban.abstract' * 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 - ``card_footer``: + as needed by the child model while making sure to set the ``mode`` to + ``primary`` so that inheritance works properly. 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 ``card_footer``: .. code-block:: xml My Model - Kanban View my.model + primary @@ -90,7 +92,7 @@ Contributors * Dave Lasley * Oleg Bulkin -* Daniel Reis +* Daniel Reis Maintainer ---------- diff --git a/base_kanban_stage/__openerp__.py b/base_kanban_stage/__openerp__.py index eeec97fa3..58ee4345a 100644 --- a/base_kanban_stage/__openerp__.py +++ b/base_kanban_stage/__openerp__.py @@ -9,7 +9,7 @@ 'author': "LasLabs, Odoo Community Association (OCA)", 'category': 'base', 'depends': [ - 'web_kanban', + 'base', ], 'website': 'https://laslabs.com', 'license': 'LGPL-3', diff --git a/base_kanban_stage/models/base_kanban_abstract.py b/base_kanban_stage/models/base_kanban_abstract.py index 2c699f18e..2e8ed21c8 100644 --- a/base_kanban_stage/models/base_kanban_abstract.py +++ b/base_kanban_stage/models/base_kanban_abstract.py @@ -6,10 +6,10 @@ from openerp import api, fields, models class BaseKanbanAbstract(models.AbstractModel): - '''Inherit from this class to add support for Kanban stages to your model. + """ 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.''' + the Kanban widget and must be defined as such. """ _name = 'base.kanban.abstract' _order = 'kanban_priority desc, kanban_sequence' @@ -24,7 +24,7 @@ class BaseKanbanAbstract(models.AbstractModel): ' stage and with the same priority', ) kanban_priority = fields.Selection( - selection=[('0', 'Normal'), ('5', 'Medium'), ('10', 'High')], + selection=[('0', 'Normal'), ('1', 'Medium'), ('2', 'High')], index=True, default='0', help='The priority of the record (shown as stars in Kanban views)', @@ -39,7 +39,7 @@ class BaseKanbanAbstract(models.AbstractModel): default=lambda s: s._default_stage_id(), domain=lambda s: [('res_model.model', '=', s._name)], ) - kanban_user_id = fields.Many2one( + user_id = fields.Many2one( string='Assigned To', comodel_name='res.users', index=True, @@ -105,7 +105,9 @@ class BaseKanbanAbstract(models.AbstractModel): def _read_group_stage_ids( self, domain=None, read_group_order=None, access_rights_uid=None ): - stage_model = self.env['base.kanban.stage'].sudo(access_rights_uid) + stage_model = self.env['base.kanban.stage'] + if access_rights_uid: + stage_model = stage_model.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/base_kanban_stage/views/base_kanban_abstract.xml b/base_kanban_stage/views/base_kanban_abstract.xml index 5f5615f9e..984889565 100644 --- a/base_kanban_stage/views/base_kanban_abstract.xml +++ b/base_kanban_stage/views/base_kanban_abstract.xml @@ -19,7 +19,7 @@ - +