[ADD]Note priority
This commit is contained in:
parent
e66244ca1b
commit
a22ec87316
18
note_priority/__init__.py
Normal file
18
note_priority/__init__.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from . import models
|
30
note_priority/__openerp__.py
Normal file
30
note_priority/__openerp__.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'Note Priority',
|
||||||
|
'summary': 'Basic priority management for notes',
|
||||||
|
'description': 'Basic priority management for notes',
|
||||||
|
'version': '0.1',
|
||||||
|
'category': 'Tools',
|
||||||
|
'author': 'Fabien Bourgeois',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'application': False,
|
||||||
|
'installable': True,
|
||||||
|
'depends': ['note_base'],
|
||||||
|
'data': ['views/note_priority.xml']
|
||||||
|
}
|
18
note_priority/models/__init__.py
Normal file
18
note_priority/models/__init__.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from . import note
|
27
note_priority/models/note.py
Normal file
27
note_priority/models/note.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Author: Fabien Bourgeois. Copyright Yaltik
|
||||||
|
# Copyright (C)
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from openerp import fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class Note(models.Model):
|
||||||
|
|
||||||
|
_inherit = 'note.note'
|
||||||
|
priority = fields.Selection([('0', 'Low'), ('1', 'Medium'),
|
||||||
|
('2', 'Important'), ('3', 'Urgent')],
|
||||||
|
'Priority', default='1')
|
60
note_priority/views/note_priority.xml
Normal file
60
note_priority/views/note_priority.xml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<openerp>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<!-- Form -->
|
||||||
|
<record model="ir.ui.view" id="note_priority_form">
|
||||||
|
<field name="name">Add priority field for note form</field>
|
||||||
|
<field name="model">note.note</field>
|
||||||
|
<field name="inherit_id" ref="note_base.form" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="tag_ids" position="after">
|
||||||
|
<field name="priority" widget="priority" />
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
<!-- Kanban -->
|
||||||
|
<record id="note_priority_kanban" model="ir.ui.view">
|
||||||
|
<field name="name">Note Priority on Kanban</field>
|
||||||
|
<field name="model">note.note</field>
|
||||||
|
<field name="inherit_id" ref="note.view_note_note_kanban" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath
|
||||||
|
expr="//div[contains(@t-attf-class, 'oe_kanban_content')]"
|
||||||
|
position="inside">
|
||||||
|
<p><field name="priority" widget="priority" /></p>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
<!-- Search and filter -->
|
||||||
|
<record model="ir.ui.view" id="note_priority_filter">
|
||||||
|
<field name="name">Note group by priority</field>
|
||||||
|
<field name="model">note.note</field>
|
||||||
|
<field name="inherit_id" ref="note.view_note_note_filter" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<filter string="Stage" position="after">
|
||||||
|
<filter string="Priority" context="{'group_by': 'priority'}"/>
|
||||||
|
</filter>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</openerp>
|
Loading…
Reference in New Issue
Block a user