16.0 lint #3

Open
jscampucci wants to merge 8 commits from 16.0-lint into 16.0
6 changed files with 36 additions and 21 deletions
Showing only changes of commit 65171f3fb4 - Show all commits

View File

@@ -6,7 +6,10 @@ class MailTemplate(models.Model):
event_attachment_name_prefix = fields.Char( event_attachment_name_prefix = fields.Char(
"Attachment name prefix", "Attachment name prefix",
help="If there is an attachment in event registration, or in event, with a name that starts with this name, it will be attached to the mail.", help="""
If there is an attachment in event registration, or in event,
with a name that starts with this name, it will be attached to the mail.
""",
) )
def generate_email(self, res_ids, fields): def generate_email(self, res_ids, fields):
@@ -18,10 +21,9 @@ class MailTemplate(models.Model):
res_ids = [res_ids] res_ids = [res_ids]
multi_mode = False multi_mode = False
for lang, (template, template_res_ids) in self._classify_per_lang( for _, (template, template_res_ids) in self._classify_per_lang(res_ids).items():
res_ids # add reports attached to event.registration or event.event from
).items(): # attachment name
# add reports attached to event.registration or event.event from attachment name
if template.event_attachment_name_prefix: if template.event_attachment_name_prefix:
for res_id in template_res_ids: for res_id in template_res_ids:
event_registration = self.env["event.registration"].browse(res_id) event_registration = self.env["event.registration"].browse(res_id)

View File

@@ -79,7 +79,10 @@ class EventMailRegistration(models.Model):
if not template: if not template:
_logger.warning( _logger.warning(
"Cannot process ticket %s, because Mail Scheduler %s has reference to non-existent template", """
Cannot process ticket %s, because Mail Scheduler %s has
reference to non-existent template
""",
reg_mail.registration_id, reg_mail.registration_id,
reg_mail.scheduler_id, reg_mail.scheduler_id,
) )

View File

@@ -18,6 +18,7 @@ msgstr ""
#. module: event_sequence #. module: event_sequence
#: model:ir.model.fields,field_description:event_sequence.field_event_event__current_sequence_id #: model:ir.model.fields,field_description:event_sequence.field_event_event__current_sequence_id
#: model_terms:ir.ui.view,arch_db:event_sequence.view_event_form_event_sequence
msgid "Current sequence" msgid "Current sequence"
msgstr "Séquence en cours" msgstr "Séquence en cours"
@@ -45,12 +46,6 @@ msgstr "Séquence"
msgid "Sequences" msgid "Sequences"
msgstr "Séquences" msgstr "Séquences"
#. module: event_sequence
#: model_terms:ir.ui.view,arch_db:event_sequence.view_event_form_event_sequence
msgid "Current sequence"
msgstr "Séquence en cours"
#. module: event_sequence #. module: event_sequence
#: model_terms:ir.ui.view,arch_db:event_sequence.view_event_track_by_sequence_kanban #: model_terms:ir.ui.view,arch_db:event_sequence.view_event_track_by_sequence_kanban
msgid "hours" msgid "hours"

View File

@@ -31,7 +31,8 @@ class EventTrack(models.Model):
Return default values of calendar events. Return default values of calendar events.
""" """
return { return {
# due to google calendar unexpected notifications, for the moment we disable attendees of calendar event # due to google calendar unexpected notifications, for the moment we
# disable attendees of calendar event
# uncomment following line to re-enable # uncomment following line to re-enable
#'partner_ids':[Command.set(self.get_calendar_event_partner_value())], #'partner_ids':[Command.set(self.get_calendar_event_partner_value())],
"partner_ids": [Command.set([])], "partner_ids": [Command.set([])],

View File

@@ -15,7 +15,8 @@ Link event tracks locations to calendar event
---------------------------------------------------- ----------------------------------------------------
* Add Partner field on event track location * Add Partner field on event track location
* Add partner "location" to calendar event * Add partner "location" to calendar event
* Update calendar event if event track location change (or partner in event track location) * Update calendar event if event track location change
(or partner in event track location)
* Alert if location is used * Alert if location is used

View File

@@ -6,8 +6,12 @@ from odoo.tools import format_date
class EventTrack(models.Model): class EventTrack(models.Model):
_inherit = "event.track" _inherit = "event.track"
location_already_in_use = fields.Boolean("Location already in use", compute="_compute_location_already_in_use") location_already_in_use = fields.Boolean(
location_already_in_use_message = fields.Text(compute="_compute_location_already_in_use") "Location already in use", compute="_compute_location_already_in_use"
)
location_already_in_use_message = fields.Text(
compute="_compute_location_already_in_use"
)
@api.depends("date", "duration", "location_id") @api.depends("date", "duration", "location_id")
def _compute_location_already_in_use(self): def _compute_location_already_in_use(self):
@@ -19,7 +23,8 @@ class EventTrack(models.Model):
for calendar_event in track.calendar_event_ids: for calendar_event in track.calendar_event_ids:
if track.location_id and calendar_event.start: if track.location_id and calendar_event.start:
# search if other calendar event exists for same day on same location # search if other calendar event exists for same day on
# same location
search_other_calendar_events = [ search_other_calendar_events = [
("event_track_id.location_id", "=", track.location_id.id), ("event_track_id.location_id", "=", track.location_id.id),
("start", ">=", calendar_event.start.replace(hour=0, minute=0)), ("start", ">=", calendar_event.start.replace(hour=0, minute=0)),
@@ -32,14 +37,22 @@ class EventTrack(models.Model):
# search only on other event tracks # search only on other event tracks
if track.id or track.id.origin: if track.id or track.id.origin:
search_other_calendar_events.append(("event_track_id", "!=", track.id or track.id.origin)) search_other_calendar_events.append(
("event_track_id", "!=", track.id or track.id.origin)
)
# search calendar events not already founded # search calendar events not already founded
if already_found_other_calendar_event_ids: if already_found_other_calendar_event_ids:
search_other_calendar_events.append(("id", "not in", already_found_other_calendar_event_ids)) search_other_calendar_events.append(
("id", "not in", already_found_other_calendar_event_ids)
)
other_calendar_events = self.env["calendar.event"].search(search_other_calendar_events) other_calendar_events = self.env["calendar.event"].search(
already_found_other_calendar_event_ids.extend(other_calendar_events.ids) search_other_calendar_events
)
already_found_other_calendar_event_ids.extend(
other_calendar_events.ids
)
if other_calendar_events: if other_calendar_events:
location_already_in_use = True location_already_in_use = True