[ADD]Notes addons, first commit
This commit is contained in:
parent
d2282ecb28
commit
ef247b4e33
17
note_tags/__init__.py
Normal file
17
note_tags/__init__.py
Normal file
@ -0,0 +1,17 @@
|
||||
# -*- 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/>.
|
BIN
note_tags/__init__.pyc
Normal file
BIN
note_tags/__init__.pyc
Normal file
Binary file not shown.
29
note_tags/__openerp__.py
Normal file
29
note_tags/__openerp__.py
Normal file
@ -0,0 +1,29 @@
|
||||
# -*- 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 tags',
|
||||
'summary': 'Note tags management',
|
||||
'description': '',
|
||||
'version': '0.1',
|
||||
'category': 'Tools',
|
||||
'author': 'Fabien Bourgeois',
|
||||
'license': 'AGPL-3',
|
||||
'installable': True,
|
||||
'depends': ['note'],
|
||||
'data': ['note_tags_view.xml']
|
||||
}
|
49
note_tags/note_tags_view.xml
Normal file
49
note_tags/note_tags_view.xml
Normal file
@ -0,0 +1,49 @@
|
||||
<?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>
|
||||
<!-- List View -->
|
||||
<record id="view_tree_note_tags" model="ir.ui.view">
|
||||
<field name="name">Note Tags</field>
|
||||
<field name="model">note.tag</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Note Tags">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Action -->
|
||||
<record id="action_note_tags_tree" model="ir.actions.act_window">
|
||||
<field name="name">Note Tags</field>
|
||||
<field name="res_model">note.tag</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- MenuItems -->
|
||||
<menuitem name="Notes" id="menu_note" parent="mail.mail_my_stuff"
|
||||
sequence="21" />
|
||||
<menuitem name="List" id="note.menu_note_notes" parent="menu_note"
|
||||
sequence="1" action="note.action_note_note"/>
|
||||
<menuitem name="Stages" id="note.menu_notes_stage"
|
||||
parent="menu_note" action="note.action_note_stage" />
|
||||
<menuitem id="menu_note_tags" name="Tags" parent="menu_note"
|
||||
action="action_note_tags_tree" />
|
||||
</data>
|
||||
</openerp>
|
19
note_task/__init__.py
Normal file
19
note_task/__init__.py
Normal file
@ -0,0 +1,19 @@
|
||||
# -*- 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 . import models
|
BIN
note_task/__init__.pyc
Normal file
BIN
note_task/__init__.pyc
Normal file
Binary file not shown.
30
note_task/__openerp__.py
Normal file
30
note_task/__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 task',
|
||||
'summary': 'Link a task to a note',
|
||||
'description': '',
|
||||
'version': '0.1',
|
||||
'category': 'Tools',
|
||||
'author': 'Fabien Bourgeois',
|
||||
'license': 'AGPL-3',
|
||||
'installable': True,
|
||||
'depends': ['note', 'project'],
|
||||
'data': ['note_task_view.xml']
|
||||
# 'qweb': [ 'static/src/xml/note_task_view_kanban.xml' ]
|
||||
}
|
40
note_task/models.py
Normal file
40
note_task/models.py
Normal file
@ -0,0 +1,40 @@
|
||||
# -*- 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 NoteTask(models.Model):
|
||||
|
||||
_inherit = 'note.note'
|
||||
task_id = fields.Many2one('project.task', 'Linked Task')
|
||||
|
||||
# @api.one
|
||||
# def onclick_note_is_done(self):
|
||||
# self.open = False
|
||||
# self.date_done = fields.date.today()
|
||||
# if self.task_id:
|
||||
# print(self.task_id.stage_id.name)
|
||||
# print('ok')
|
||||
# return True
|
||||
|
||||
|
||||
# class ProjectTask(models.Model):
|
||||
#
|
||||
# _inherit = 'project.task'
|
||||
# note_ids = fields.One2many('note.note', 'task_id', 'Linked notes')
|
111
note_task/note_task_view.xml
Normal file
111
note_task/note_task_view.xml
Normal file
@ -0,0 +1,111 @@
|
||||
<?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>
|
||||
<!-- New form -->
|
||||
<record id="note.view_note_note_form" model="ir.ui.view">
|
||||
<field name="name">Note Task</field>
|
||||
<field name="model">note.note</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Note">
|
||||
<header>
|
||||
<field
|
||||
name="stage_id"
|
||||
domain="[('user_id','=',uid)]"
|
||||
widget="statusbar"
|
||||
clickable="1" />
|
||||
</header>
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="task_id" string="Linked task" />
|
||||
<field name="tag_ids" widget="many2many_tags" string="Tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field
|
||||
name="memo"
|
||||
widget="html"
|
||||
class="oe_memo"
|
||||
editor_height="450px" />
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Form extension -->
|
||||
<!--
|
||||
<record id="view_form_note_task" model="ir.ui.view">
|
||||
<field name="name">Note Task</field>
|
||||
<field name="model">note.note</field>
|
||||
<field name="inherit_id" ref="note.view_note_note_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="tag_ids" position="after">
|
||||
<label for="task_id">Linked Task</label>
|
||||
<field name="task_id" class="oe_inline" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
-->
|
||||
<!-- Kanban extension -->
|
||||
<record id="view_kanban_note_task" model="ir.ui.view">
|
||||
<field name="name">Note Task</field>
|
||||
<field name="model">note.note</field>
|
||||
<field name="inherit_id" ref="note.view_note_note_kanban" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="tag_ids" position="after">
|
||||
<field name="task_id" />
|
||||
</field>
|
||||
<xpath
|
||||
expr="//div[contains(@t-attf-class, 'oe_kanban_content')]"
|
||||
position="inside">
|
||||
<p t-if="record.task_id.raw_value" style="color: grey">
|
||||
Linked Task : <field name="task_id"/>
|
||||
</p>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Force form view -->
|
||||
<!--
|
||||
<record model="ir.actions.act_window" id="action_form_note_task">
|
||||
<field name="name">Note</field>
|
||||
<field name="res_model">note.note</field>
|
||||
<field name="inherit_id" ref="note.action_note_note" />
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_form_note_task "/>
|
||||
</record>
|
||||
-->
|
||||
<!-- Extend Task form to view linked notes -->
|
||||
<!-- OFF ATM : problems with permissions and portal/public users
|
||||
<record id="view_form_task_notes" model="ir.ui.view">
|
||||
<field name="name">Note Task</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="inherit_id" ref="project.view_task_form2" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_id" position="after">
|
||||
<field name="note_ids" widget="many2many_tags" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
-->
|
||||
</data>
|
||||
</openerp>
|
26
note_task/note_task_view_kanban.xml
Normal file
26
note_task/note_task_view_kanban.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?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/>.
|
||||
-->
|
||||
|
||||
<templates>
|
||||
<t t-extend="kanban-box">
|
||||
<t t-jquery="div[name='tag_ids']" operation="after">
|
||||
<field name="task_id"/>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
27
note_task/static/src/xml/note_task_view_kanban.xml
Normal file
27
note_task/static/src/xml/note_task_view_kanban.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?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/>.
|
||||
-->
|
||||
|
||||
<templates>
|
||||
<t t-extend="kanban-box">
|
||||
<t t-jquery="div.oe_clear" t-operation="after">
|
||||
<span>lol</span>
|
||||
<field name="task_id" />
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
Loading…
Reference in New Issue
Block a user