mirror of
https://github.com/bringout/oca-ocb-technical.git
synced 2026-04-20 11:52:01 +02:00
Initial commit: Technical packages
This commit is contained in:
commit
3473fa71a0
873 changed files with 297766 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import calendar_alarm
|
||||
from . import data
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
from odoo.addons.calendar.populate import data
|
||||
from odoo.tools import populate
|
||||
|
||||
|
||||
class Alarm(models.Model):
|
||||
_inherit = 'calendar.alarm'
|
||||
_populate_sizes = {'small': 3, 'medium': 10, 'large': 30}
|
||||
|
||||
def _populate_factories(self):
|
||||
def get_name(values, counter, **kwargs):
|
||||
return f"{str.capitalize(values['alarm_type'])} - {values['duration']} {values['interval']} (#{counter})."
|
||||
|
||||
return [
|
||||
*((field_name, populate.iterate(*zip(*data.calendar_alarm[field_name].items())))
|
||||
for field_name in ["alarm_type", "duration", "interval"]),
|
||||
('name', populate.compute(get_name)),
|
||||
]
|
||||
12
odoo-bringout-oca-ocb-calendar/calendar/populate/data.py
Normal file
12
odoo-bringout-oca-ocb-calendar/calendar/populate/data.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
calendar_alarm = {
|
||||
"alarm_type": {"email": 0.9, "notification": 0.1},
|
||||
"duration": {
|
||||
1: 0.8,
|
||||
2: 0.09,
|
||||
3: 0.11
|
||||
},
|
||||
"interval": {"hours": 0.8, "minutes": 0.1, "days": 0.1}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue