[IMP]Note dates : form enhancement for daily and moments, tags display addition on calendar view
This commit is contained in:
parent
c75a0ed717
commit
7d4e4dbf96
@ -29,6 +29,12 @@ class Note(models.Model):
|
||||
('night', _('Night'))], string='Moment')
|
||||
date_start = fields.Datetime('Start')
|
||||
date_stop = fields.Datetime('End')
|
||||
tag_names = fields.Char('Tag Names', compute='_compute_tag_names')
|
||||
|
||||
@api.one
|
||||
@api.depends('tag_ids')
|
||||
def _compute_tag_names(self):
|
||||
self.tag_names = u']['.join([t.name for t in self.tag_ids])
|
||||
|
||||
@api.onchange('is_daily')
|
||||
def onchange_isdaily(self):
|
||||
|
@ -27,10 +27,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="arch" type="xml">
|
||||
<field name="tag_ids" position="after">
|
||||
<field name="is_daily" />
|
||||
<field name="moment" />
|
||||
<field name="date_start" />
|
||||
<!--attrs="{'invisible': [('is_daily', '=', True)]}" />-->
|
||||
<field name="date_stop" />
|
||||
<field name="moment" class="oe_edit_only"
|
||||
attrs="{'invisible': [('is_daily', '=', True)]}" />
|
||||
<field name="date_start"
|
||||
attrs="{'invisible': [('is_daily', '=', True)]}" />
|
||||
<field name="date_stop"
|
||||
attrs="{'invisible': [('is_daily', '=', True)]}" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
@ -53,8 +55,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="model">note.note</field>
|
||||
<field name="arch" type="xml">
|
||||
<calendar date_start="date_start" date_stop="date_stop"
|
||||
color="stage_id" all_day="is_daily" display="[name]" mode="day">
|
||||
color="stage_id" all_day="is_daily" mode="day"
|
||||
display="[[tag_names]] - [name]" >
|
||||
<field name="name" />
|
||||
<field name="tag_names" />
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
|
Loading…
Reference in New Issue
Block a user