From 3c2ce0ceba2a381e525d1ca991f939e71e0877d5 Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Mon, 9 Apr 2018 18:49:50 +0200 Subject: [PATCH 01/19] =?UTF-8?q?modification=20du=20calcul=20du=20quantit?= =?UTF-8?q?=C3=A9=20selon=20uom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/golem_resource_reservation.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index a18ad91..c91bf71 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -75,8 +75,11 @@ class GolemResourceReservation(models.Model): product.categ_id.property_account_income_categ_id.id delta = fields.Datetime.from_string(reservation.date_stop) - \ fields.Datetime.from_string(reservation.date_start) - quantity = (delta.days * 24) + (delta.seconds/3600.0) - + quantity = 1 + if product.uom_id.name == 'Hour(s)' or product.uom_id.name == 'Unit(s)': + quantity = int((delta.days * 24) + (delta.seconds/3600.0)) + elif product.uom_id.name == 'Day(s)': + quantity = int(delta.days + (delta.seconds/86400.0))#number of seconds in a day line_id = self.env['account.invoice.line'].create({ 'invoice_id': invoice_id.id, 'name': product.name, From 2abaabc002d0e03cd1bb918894effe02c80c6d81 Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Wed, 11 Apr 2018 21:27:07 +0200 Subject: [PATCH 02/19] wizard pour choisir les resources --- golem_resource_report/__init__.py | 20 +++++++ golem_resource_report/__manifest__.py | 33 ++++++++++++ .../reports/golem_reservation_report.xml | 8 +++ .../views/golem_resource_report_menu.xml | 14 +++++ golem_resource_report/wizard/__init__.py | 19 +++++++ .../wizard/golem_resource_report_wizard.py | 38 ++++++++++++++ .../golem_resource_report_wizard_views.xml | 52 +++++++++++++++++++ 7 files changed, 184 insertions(+) create mode 100644 golem_resource_report/__init__.py create mode 100644 golem_resource_report/__manifest__.py create mode 100644 golem_resource_report/reports/golem_reservation_report.xml create mode 100644 golem_resource_report/views/golem_resource_report_menu.xml create mode 100644 golem_resource_report/wizard/__init__.py create mode 100644 golem_resource_report/wizard/golem_resource_report_wizard.py create mode 100644 golem_resource_report/wizard/golem_resource_report_wizard_views.xml diff --git a/golem_resource_report/__init__.py b/golem_resource_report/__init__.py new file mode 100644 index 0000000..27ce4b7 --- /dev/null +++ b/golem_resource_report/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +#from . import models +from . import wizard diff --git a/golem_resource_report/__manifest__.py b/golem_resource_report/__manifest__.py new file mode 100644 index 0000000..4b14908 --- /dev/null +++ b/golem_resource_report/__manifest__.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +{ + 'name': 'GOLEM resources reports', + 'summary': 'GOLEM resources reports', + 'description': ''' GOLEM resources reports ''', + 'version': '10.0.0.0.0', + 'category': 'GOLEM', + 'author': 'Youssef El Ouahby, Fabien Bourgeois', + 'license': 'AGPL-3', + 'application': True, + 'installable': True, + 'depends': ['golem_resource'], + 'data': ['reports/golem_reservation_report.xml', + 'views/golem_resource_report_menu.xml', + 'wizard/golem_resource_report_wizard_views.xml'] +} diff --git a/golem_resource_report/reports/golem_reservation_report.xml b/golem_resource_report/reports/golem_reservation_report.xml new file mode 100644 index 0000000..71bdca2 --- /dev/null +++ b/golem_resource_report/reports/golem_reservation_report.xml @@ -0,0 +1,8 @@ + + + + diff --git a/golem_resource_report/views/golem_resource_report_menu.xml b/golem_resource_report/views/golem_resource_report_menu.xml new file mode 100644 index 0000000..3facc13 --- /dev/null +++ b/golem_resource_report/views/golem_resource_report_menu.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/golem_resource_report/wizard/__init__.py b/golem_resource_report/wizard/__init__.py new file mode 100644 index 0000000..5ae7a4c --- /dev/null +++ b/golem_resource_report/wizard/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +from . import golem_resource_report_wizard diff --git a/golem_resource_report/wizard/golem_resource_report_wizard.py b/golem_resource_report/wizard/golem_resource_report_wizard.py new file mode 100644 index 0000000..5941c40 --- /dev/null +++ b/golem_resource_report/wizard/golem_resource_report_wizard.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +""" GOLEM Resources management """ + +from odoo import models, fields, api + +class GolemResourceReportWizard(models.TransientModel): + """GOLEM Resource wizard : refusal reason for a reservation """ + _name = "golem.resource.report.wizard" + def _get_resources(self): + return self.env['golem.resource'].search([]).ids + + resource_ids = fields.Many2many('golem.resource',default=_get_resources) + selected_resource_ids = fields.Many2many('golem.resource', + domaine="[('id', in, resources_ids.ids)]") + date_start = fields.Datetime(required=True) + date_stop = fields.Datetime(required=True) + + @api.multi + def print_report(self): + for record in self: + pass diff --git a/golem_resource_report/wizard/golem_resource_report_wizard_views.xml b/golem_resource_report/wizard/golem_resource_report_wizard_views.xml new file mode 100644 index 0000000..3d226bd --- /dev/null +++ b/golem_resource_report/wizard/golem_resource_report_wizard_views.xml @@ -0,0 +1,52 @@ + + + + + + + + GOLEM resource Report Wizard Form + golem.resource.report.wizard + +
+ + + + + + + + + + + + + + +
+
+
+
+
+ +
+
From c669ddae2f9bb5801ca9681af6405f6ac8522344 Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Thu, 12 Apr 2018 00:52:05 +0200 Subject: [PATCH 03/19] code refactoring --- .../views/golem_resource_report_menu.xml | 12 +++++++--- .../wizard/golem_resource_report_wizard.py | 20 ++++++++++------ .../golem_resource_report_wizard_views.xml | 23 +++++++++---------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/golem_resource_report/views/golem_resource_report_menu.xml b/golem_resource_report/views/golem_resource_report_menu.xml index 3facc13..ec823e4 100644 --- a/golem_resource_report/views/golem_resource_report_menu.xml +++ b/golem_resource_report/views/golem_resource_report_menu.xml @@ -2,11 +2,17 @@ - + + Resources Reports + golem.resource.report.wizard + form + form + + {} + new + - diff --git a/golem_resource_report/wizard/golem_resource_report_wizard.py b/golem_resource_report/wizard/golem_resource_report_wizard.py index 5941c40..cb0dafe 100644 --- a/golem_resource_report/wizard/golem_resource_report_wizard.py +++ b/golem_resource_report/wizard/golem_resource_report_wizard.py @@ -18,21 +18,27 @@ """ GOLEM Resources management """ -from odoo import models, fields, api +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError class GolemResourceReportWizard(models.TransientModel): """GOLEM Resource wizard : refusal reason for a reservation """ _name = "golem.resource.report.wizard" - def _get_resources(self): - return self.env['golem.resource'].search([]).ids - resource_ids = fields.Many2many('golem.resource',default=_get_resources) - selected_resource_ids = fields.Many2many('golem.resource', - domaine="[('id', in, resources_ids.ids)]") + resource_ids = fields.Many2many('golem.resource') date_start = fields.Datetime(required=True) date_stop = fields.Datetime(required=True) @api.multi def print_report(self): for record in self: - pass + start_date = fields.Datetime.from_string(record.date_start) + stop_date = fields.Datetime.from_string(record.date_stop) + if start_date > stop_date: + raise ValidationError(_("Stop Date cannot be set before \ + Start Date.")) + else: + domain = [('date_start', '>', record.date_start), + ('date_stop', '<', record.date_stop), + ('resource_id', 'in', record.selected_resource_ids.ids)] + data = self.env['golem.resource.reservation'].search(domain) diff --git a/golem_resource_report/wizard/golem_resource_report_wizard_views.xml b/golem_resource_report/wizard/golem_resource_report_wizard_views.xml index 3d226bd..07aa754 100644 --- a/golem_resource_report/wizard/golem_resource_report_wizard_views.xml +++ b/golem_resource_report/wizard/golem_resource_report_wizard_views.xml @@ -27,22 +27,21 @@ along with this program. If not, see .
- - - - - - - - - - - + + + + + + + + + +
From 01a34e0e3befba759eb111840b504e423f2335ca Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Thu, 12 Apr 2018 18:25:57 +0200 Subject: [PATCH 04/19] fonction de reporting --- golem_resource_report/__init__.py | 1 + golem_resource_report/__manifest__.py | 1 + golem_resource_report/reports/__init__.py | 19 +++++ .../reports/golem_reservation_report.py | 79 +++++++++++++++++++ .../reports/golem_reservation_report.xml | 66 ++++++++++++++-- .../reports/golem_reservation_report_menu.xml | 49 ++++++++++++ .../views/golem_resource_report_menu.xml | 18 +++++ .../wizard/golem_resource_report_wizard.py | 11 ++- .../golem_resource_report_wizard_views.xml | 6 +- 9 files changed, 236 insertions(+), 14 deletions(-) create mode 100644 golem_resource_report/reports/__init__.py create mode 100644 golem_resource_report/reports/golem_reservation_report.py create mode 100644 golem_resource_report/reports/golem_reservation_report_menu.xml diff --git a/golem_resource_report/__init__.py b/golem_resource_report/__init__.py index 27ce4b7..f1d4cf2 100644 --- a/golem_resource_report/__init__.py +++ b/golem_resource_report/__init__.py @@ -18,3 +18,4 @@ #from . import models from . import wizard +from . import reports diff --git a/golem_resource_report/__manifest__.py b/golem_resource_report/__manifest__.py index 4b14908..d9c90a5 100644 --- a/golem_resource_report/__manifest__.py +++ b/golem_resource_report/__manifest__.py @@ -28,6 +28,7 @@ 'installable': True, 'depends': ['golem_resource'], 'data': ['reports/golem_reservation_report.xml', + 'reports/golem_reservation_report_menu.xml', 'views/golem_resource_report_menu.xml', 'wizard/golem_resource_report_wizard_views.xml'] } diff --git a/golem_resource_report/reports/__init__.py b/golem_resource_report/reports/__init__.py new file mode 100644 index 0000000..1c0b8fe --- /dev/null +++ b/golem_resource_report/reports/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +from . import golem_reservation_report diff --git a/golem_resource_report/reports/golem_reservation_report.py b/golem_resource_report/reports/golem_reservation_report.py new file mode 100644 index 0000000..a1858be --- /dev/null +++ b/golem_resource_report/reports/golem_reservation_report.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Youssef El Ouahby +# Copyright 2018 Fabien Bourgeois +# +# 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 . + +import time + +from odoo import models, api + + +class GolemResevationReport(models.AbstractModel): + _name = 'report.golem_resource_report.golem_reservation_report' + + def get_total_reservation(self, data): + domain = [('date_start', '>', data['date_start']), + ('date_stop', '<', data['date_stop']), + ('resource_id', 'in', data['resource_ids'])] + return self.env['golem.resource.reservation'].search_count(domain) + + + def get_data(self, data): + lst = [] + domain = [('date_start', '>', data['date_start']), + ('date_stop', '<', data['date_stop']), + ('resource_id', 'in', data['resource_ids'])] + reservations = self.env['golem.resource.reservation'].search(domain, order='date_start') + res = {} + for reservation in reservations: + res = { + 'name': reservation.name, + 'resource_name': reservation.resource_id.name, + 'client': reservation.partner_id.name, + 'date_start': reservation.date_start, + 'date_stop': reservation.date_stop + } + lst.append(res) + + #self.total_student = 0 + """for student in student_search: + self.total_student += 1 + res = { + 'name': student.name, + 'middle_name': student.middle_name, + 'last_name': student.last_name, + 'application_no': student.application_number, + } + lst.append(res)""" + return lst + + @api.model + def render_html(self, docids, data=None): + model = self.env.context.get('active_model') + docs = self.env[model].browse(self.env.context.get('active_id')) + docargs = { + 'doc_ids': self.ids, + 'doc_model': model, + 'docs': docs, + 'time': time, + 'data': data, + 'date_start': data['date_start'], + 'date_stop': data['date_stop'], + 'get_total_reservation': self.get_total_reservation(data), + 'get_data': self.get_data(data), + } + return self.env['report'] \ + .render('golem_resource_report.golem_reservation_report', docargs) diff --git a/golem_resource_report/reports/golem_reservation_report.xml b/golem_resource_report/reports/golem_reservation_report.xml index 71bdca2..60f8da5 100644 --- a/golem_resource_report/reports/golem_reservation_report.xml +++ b/golem_resource_report/reports/golem_reservation_report.xml @@ -1,8 +1,62 @@ - + + - + + + diff --git a/golem_resource_report/reports/golem_reservation_report_menu.xml b/golem_resource_report/reports/golem_reservation_report_menu.xml new file mode 100644 index 0000000..d1090cd --- /dev/null +++ b/golem_resource_report/reports/golem_reservation_report_menu.xml @@ -0,0 +1,49 @@ + + + + + + European A4 Landscape + + A4 + 0 + 0 + Landscape + 10 + 23 + 7 + 7 + + 35 + 90 + + + + diff --git a/golem_resource_report/views/golem_resource_report_menu.xml b/golem_resource_report/views/golem_resource_report_menu.xml index ec823e4..14ba437 100644 --- a/golem_resource_report/views/golem_resource_report_menu.xml +++ b/golem_resource_report/views/golem_resource_report_menu.xml @@ -1,3 +1,21 @@ + + diff --git a/golem_resource_report/wizard/golem_resource_report_wizard.py b/golem_resource_report/wizard/golem_resource_report_wizard.py index cb0dafe..c56a2f3 100644 --- a/golem_resource_report/wizard/golem_resource_report_wizard.py +++ b/golem_resource_report/wizard/golem_resource_report_wizard.py @@ -38,7 +38,10 @@ class GolemResourceReportWizard(models.TransientModel): raise ValidationError(_("Stop Date cannot be set before \ Start Date.")) else: - domain = [('date_start', '>', record.date_start), - ('date_stop', '<', record.date_stop), - ('resource_id', 'in', record.selected_resource_ids.ids)] - data = self.env['golem.resource.reservation'].search(domain) + data = self.read( + ['resource_ids', 'date_start', 'date_stop'])[0] + return self.env['report'].get_action( + self, 'golem_resource_report.golem_reservation_report', + data=data) + + diff --git a/golem_resource_report/wizard/golem_resource_report_wizard_views.xml b/golem_resource_report/wizard/golem_resource_report_wizard_views.xml index 07aa754..1cfbdea 100644 --- a/golem_resource_report/wizard/golem_resource_report_wizard_views.xml +++ b/golem_resource_report/wizard/golem_resource_report_wizard_views.xml @@ -18,7 +18,6 @@ along with this program. If not, see . --> - GOLEM resource Report Wizard Form @@ -28,7 +27,7 @@ along with this program. If not, see . - + @@ -45,7 +44,6 @@ along with this program. If not, see . - - + From 94bdd6240a280c9f57aae67b998c18e3245ebc70 Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Thu, 12 Apr 2018 18:58:19 +0200 Subject: [PATCH 05/19] =?UTF-8?q?quelques=20am=C3=A9liorations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reports/golem_reservation_report.py | 11 ----------- .../wizard/golem_resource_report_wizard_views.xml | 4 ++-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/golem_resource_report/reports/golem_reservation_report.py b/golem_resource_report/reports/golem_reservation_report.py index a1858be..6867d45 100644 --- a/golem_resource_report/reports/golem_reservation_report.py +++ b/golem_resource_report/reports/golem_reservation_report.py @@ -47,17 +47,6 @@ class GolemResevationReport(models.AbstractModel): 'date_stop': reservation.date_stop } lst.append(res) - - #self.total_student = 0 - """for student in student_search: - self.total_student += 1 - res = { - 'name': student.name, - 'middle_name': student.middle_name, - 'last_name': student.last_name, - 'application_no': student.application_number, - } - lst.append(res)""" return lst @api.model diff --git a/golem_resource_report/wizard/golem_resource_report_wizard_views.xml b/golem_resource_report/wizard/golem_resource_report_wizard_views.xml index 1cfbdea..0d28277 100644 --- a/golem_resource_report/wizard/golem_resource_report_wizard_views.xml +++ b/golem_resource_report/wizard/golem_resource_report_wizard_views.xml @@ -26,8 +26,8 @@ along with this program. If not, see .
- - + + From ce325aa0547599a2397924087bde38917a6533ca Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Fri, 13 Apr 2018 19:18:59 +0200 Subject: [PATCH 06/19] =?UTF-8?q?Am=C3=A9lioration=20de=20l'affichage=20du?= =?UTF-8?q?=20rappoort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reports/golem_reservation_report.py | 24 ++++++++++++++++++- .../reports/golem_reservation_report.xml | 22 +++++++++-------- .../wizard/golem_resource_report_wizard.py | 12 ++++++++-- 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/golem_resource_report/reports/golem_reservation_report.py b/golem_resource_report/reports/golem_reservation_report.py index 6867d45..1e84b7e 100644 --- a/golem_resource_report/reports/golem_reservation_report.py +++ b/golem_resource_report/reports/golem_reservation_report.py @@ -18,9 +18,11 @@ import time +from random import randint from odoo import models, api + class GolemResevationReport(models.AbstractModel): _name = 'report.golem_resource_report.golem_reservation_report' @@ -31,6 +33,23 @@ class GolemResevationReport(models.AbstractModel): return self.env['golem.resource.reservation'].search_count(domain) + + + def get_resource(self, data): + lst = [] + domain = [('date_start', '>', data['date_start']), + ('date_stop', '<', data['date_stop']), + ('resource_id', 'in', data['resource_ids'])] + reservations = self.env['golem.resource.reservation'].search(domain, order='date_start') + lst = reservations.mapped('resource_id.name') + return lst + + def get_client_color(self, client_id): + client_id *= 777777 + color = "#0" + str(client_id) + color = color[:7] + return color + def get_data(self, data): lst = [] domain = [('date_start', '>', data['date_start']), @@ -43,8 +62,10 @@ class GolemResevationReport(models.AbstractModel): 'name': reservation.name, 'resource_name': reservation.resource_id.name, 'client': reservation.partner_id.name, + 'client_id': self.get_client_color(reservation.partner_id.id), 'date_start': reservation.date_start, - 'date_stop': reservation.date_stop + 'date_stop': reservation.date_stop, + 'day_start': reservation.day_start } lst.append(res) return lst @@ -63,6 +84,7 @@ class GolemResevationReport(models.AbstractModel): 'date_stop': data['date_stop'], 'get_total_reservation': self.get_total_reservation(data), 'get_data': self.get_data(data), + 'get_resource': self.get_resource(data), } return self.env['report'] \ .render('golem_resource_report.golem_reservation_report', docargs) diff --git a/golem_resource_report/reports/golem_reservation_report.xml b/golem_resource_report/reports/golem_reservation_report.xml index 60f8da5..9162793 100644 --- a/golem_resource_report/reports/golem_reservation_report.xml +++ b/golem_resource_report/reports/golem_reservation_report.xml @@ -40,16 +40,18 @@ along with this program. If not, see . - - - - + + + + + + + +
- - - - - -
+ Date :
+ On behalf of :
+ client_id :
+
diff --git a/golem_resource_report/wizard/golem_resource_report_wizard.py b/golem_resource_report/wizard/golem_resource_report_wizard.py index c56a2f3..fc38925 100644 --- a/golem_resource_report/wizard/golem_resource_report_wizard.py +++ b/golem_resource_report/wizard/golem_resource_report_wizard.py @@ -40,8 +40,16 @@ class GolemResourceReportWizard(models.TransientModel): else: data = self.read( ['resource_ids', 'date_start', 'date_stop'])[0] + + lst = [] + domain = [('date_start', '>', data['date_start']), + ('date_stop', '<', data['date_stop']), + ('resource_id', 'in', data['resource_ids'])] + reservations = self.env['golem.resource.reservation'].search(domain, order='date_start') + lst = reservations.mapped('resource_id.name') + print '____________________________________' + print lst + return self.env['report'].get_action( self, 'golem_resource_report.golem_reservation_report', data=data) - - From 1398cb945d323df47286adbd5f0a085c55a3f7b3 Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Mon, 16 Apr 2018 17:10:22 +0200 Subject: [PATCH 07/19] modification couleurs --- .../reports/golem_reservation_report.py | 26 ++++++++++++++----- .../reports/golem_reservation_report.xml | 4 +-- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/golem_resource_report/reports/golem_reservation_report.py b/golem_resource_report/reports/golem_reservation_report.py index 1e84b7e..042a10d 100644 --- a/golem_resource_report/reports/golem_reservation_report.py +++ b/golem_resource_report/reports/golem_reservation_report.py @@ -44,10 +44,17 @@ class GolemResevationReport(models.AbstractModel): lst = reservations.mapped('resource_id.name') return lst - def get_client_color(self, client_id): - client_id *= 777777 - color = "#0" + str(client_id) - color = color[:7] + def get_client_color(self, partner_number): + colors = ['#FFFF5B', '#81EC54', '#47C8C8', '#FB5A66', '#E8E750', + '#CF4ACF', '#9655D2', '#FFA15B', '#5F68D5', '#60E652'] + color = "#000000" + if partner_number < 10: + color = colors[partner_number] + else: + red = randint(128, 255) + green = randint(128, 255) + blue = randint(128, 255) + color = "#" +hex(red)[2:]+hex(green)[2:]+hex(blue)[2:] return color def get_data(self, data): @@ -56,16 +63,23 @@ class GolemResevationReport(models.AbstractModel): ('date_stop', '<', data['date_stop']), ('resource_id', 'in', data['resource_ids'])] reservations = self.env['golem.resource.reservation'].search(domain, order='date_start') + partner_ids = reservations.mapped('partner_id.id') + partner_colors = {} + partner_number = 0 + for partner_id in partner_ids: + partner_colors[str(partner_id)] = self.get_client_color(partner_number) + partner_number +=1 + res = {} for reservation in reservations: res = { 'name': reservation.name, 'resource_name': reservation.resource_id.name, 'client': reservation.partner_id.name, - 'client_id': self.get_client_color(reservation.partner_id.id), 'date_start': reservation.date_start, 'date_stop': reservation.date_stop, - 'day_start': reservation.day_start + 'day_start': reservation.day_start, + 'bgcolor': partner_colors[str(reservation.partner_id.id)] } lst.append(res) return lst diff --git a/golem_resource_report/reports/golem_reservation_report.xml b/golem_resource_report/reports/golem_reservation_report.xml index 9162793..b545aff 100644 --- a/golem_resource_report/reports/golem_reservation_report.xml +++ b/golem_resource_report/reports/golem_reservation_report.xml @@ -45,10 +45,10 @@ along with this program. If not, see . - + Date :
On behalf of :
- client_id :
+ client_id :
From e7464a62b305464d352169abf118336bfaaf00d9 Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Mon, 16 Apr 2018 17:48:14 +0200 Subject: [PATCH 08/19] code refactoring --- .../reports/golem_reservation_report.py | 13 ++++++++----- .../reports/golem_reservation_report.xml | 2 -- .../wizard/golem_resource_report_wizard.py | 15 +++------------ 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/golem_resource_report/reports/golem_reservation_report.py b/golem_resource_report/reports/golem_reservation_report.py index 042a10d..d482e8a 100644 --- a/golem_resource_report/reports/golem_reservation_report.py +++ b/golem_resource_report/reports/golem_reservation_report.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . - +""" Golem Reservation Report """ import time from random import randint @@ -24,18 +24,18 @@ from odoo import models, api class GolemResevationReport(models.AbstractModel): + "Golem Reservation Report" _name = 'report.golem_resource_report.golem_reservation_report' def get_total_reservation(self, data): + "Get Reservation Count" domain = [('date_start', '>', data['date_start']), ('date_stop', '<', data['date_stop']), ('resource_id', 'in', data['resource_ids'])] return self.env['golem.resource.reservation'].search_count(domain) - - - def get_resource(self, data): + "Get Resource List" lst = [] domain = [('date_start', '>', data['date_start']), ('date_stop', '<', data['date_stop']), @@ -45,6 +45,7 @@ class GolemResevationReport(models.AbstractModel): return lst def get_client_color(self, partner_number): + "Get Client Color" colors = ['#FFFF5B', '#81EC54', '#47C8C8', '#FB5A66', '#E8E750', '#CF4ACF', '#9655D2', '#FFA15B', '#5F68D5', '#60E652'] color = "#000000" @@ -58,6 +59,7 @@ class GolemResevationReport(models.AbstractModel): return color def get_data(self, data): + "Get Resevation Data" lst = [] domain = [('date_start', '>', data['date_start']), ('date_stop', '<', data['date_stop']), @@ -68,7 +70,7 @@ class GolemResevationReport(models.AbstractModel): partner_number = 0 for partner_id in partner_ids: partner_colors[str(partner_id)] = self.get_client_color(partner_number) - partner_number +=1 + partner_number += 1 res = {} for reservation in reservations: @@ -86,6 +88,7 @@ class GolemResevationReport(models.AbstractModel): @api.model def render_html(self, docids, data=None): + "Render HTML" model = self.env.context.get('active_model') docs = self.env[model].browse(self.env.context.get('active_id')) docargs = { diff --git a/golem_resource_report/reports/golem_reservation_report.xml b/golem_resource_report/reports/golem_reservation_report.xml index b545aff..0df78a7 100644 --- a/golem_resource_report/reports/golem_reservation_report.xml +++ b/golem_resource_report/reports/golem_reservation_report.xml @@ -40,7 +40,6 @@ along with this program. If not, see . - @@ -48,7 +47,6 @@ along with this program. If not, see . diff --git a/golem_resource_report/wizard/golem_resource_report_wizard.py b/golem_resource_report/wizard/golem_resource_report_wizard.py index fc38925..684c41d 100644 --- a/golem_resource_report/wizard/golem_resource_report_wizard.py +++ b/golem_resource_report/wizard/golem_resource_report_wizard.py @@ -16,13 +16,13 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -""" GOLEM Resources management """ +""" GOLEM Resources Report Wizard """ from odoo import models, fields, api, _ from odoo.exceptions import ValidationError class GolemResourceReportWizard(models.TransientModel): - """GOLEM Resource wizard : refusal reason for a reservation """ + """GOLEM Report Wizard : Choose report parameters """ _name = "golem.resource.report.wizard" resource_ids = fields.Many2many('golem.resource') @@ -31,6 +31,7 @@ class GolemResourceReportWizard(models.TransientModel): @api.multi def print_report(self): + """ Print Report """ for record in self: start_date = fields.Datetime.from_string(record.date_start) stop_date = fields.Datetime.from_string(record.date_stop) @@ -40,16 +41,6 @@ class GolemResourceReportWizard(models.TransientModel): else: data = self.read( ['resource_ids', 'date_start', 'date_stop'])[0] - - lst = [] - domain = [('date_start', '>', data['date_start']), - ('date_stop', '<', data['date_stop']), - ('resource_id', 'in', data['resource_ids'])] - reservations = self.env['golem.resource.reservation'].search(domain, order='date_start') - lst = reservations.mapped('resource_id.name') - print '____________________________________' - print lst - return self.env['report'].get_action( self, 'golem_resource_report.golem_reservation_report', data=data) From 1b6a3c674ee02677fbbadbdce2f100e5fcd99150 Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Thu, 19 Apr 2018 13:54:15 +0200 Subject: [PATCH 09/19] Creation du wizard pour la creation rapide des reservation --- golem_resource_pack/__manifest__.py | 3 +- .../models/golem_resource_pack.py | 12 +++++ .../views/golem_resource_pack_views.xml | 7 +++ golem_resource_pack/wizard/__init__.py | 2 +- .../wizard/golem_pack_quick_reservation.py | 43 ++++++++++++++++++ .../golem_pack_quick_reservation_views.xml | 45 +++++++++++++++++++ 6 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 golem_resource_pack/wizard/golem_pack_quick_reservation.py create mode 100644 golem_resource_pack/wizard/golem_pack_quick_reservation_views.xml diff --git a/golem_resource_pack/__manifest__.py b/golem_resource_pack/__manifest__.py index df0fe6c..25d251c 100644 --- a/golem_resource_pack/__manifest__.py +++ b/golem_resource_pack/__manifest__.py @@ -20,7 +20,7 @@ 'name': 'GOLEM resources pack', 'summary': 'GOLEM resources pack', 'description': ''' GOLEM resources pack ''', - 'version': '10.0.0.0.5', + 'version': '10.0.0.0.6', 'category': 'GOLEM', 'author': 'Youssef El Ouahby, Fabien Bourgeois', 'license': 'AGPL-3', @@ -29,5 +29,6 @@ 'depends': ['golem_resource'], 'data': ['views/golem_resource_pack_views.xml', 'wizard/golem_pack_rejection_views.xml', + 'wizard/golem_pack_quick_reservation_views.xml', 'security/ir.model.access.csv'] } diff --git a/golem_resource_pack/models/golem_resource_pack.py b/golem_resource_pack/models/golem_resource_pack.py index 5fba353..f997ac4 100644 --- a/golem_resource_pack/models/golem_resource_pack.py +++ b/golem_resource_pack/models/golem_resource_pack.py @@ -52,6 +52,18 @@ class GolemResourcePack(models.Model): reservation_count = fields.Integer(compute='_compute_reservation_count') rejection_reason = fields.Text(readonly=True, track_visibility='onchange') + @api.multi + def quick_reservation(self): + """ Quick Reservation Creating""" + self.ensure_one() + pack_id = self[0] + return {'name' : _('Reservations Creating'), + 'type' : 'ir.actions.act_window', + 'res_model' : 'golem.pack.quick.reservation.wizard', + 'context': {'default_pack_id': pack_id.id}, + 'view_mode': 'form', + 'target': 'new'} + @api.depends('reservation_ids') def _compute_reservation_count(self): for pack in self: diff --git a/golem_resource_pack/views/golem_resource_pack_views.xml b/golem_resource_pack/views/golem_resource_pack_views.xml index 096a3fb..b3a38e6 100644 --- a/golem_resource_pack/views/golem_resource_pack_views.xml +++ b/golem_resource_pack/views/golem_resource_pack_views.xml @@ -61,8 +61,15 @@ along with this program. If not, see . + + + + +
Date :
On behalf of :
- client_id :
- - - +

+ : reservations
+ + From Date: + + To Date: + + +

+
-
Maison Phare toutes les reservations
- From Date: - - - To Date: -
-
+ + + + + - -
+
- + - - - - - - + + + + diff --git a/golem_resource_report/wizard/golem_resource_report_wizard.py b/golem_resource_report/wizard/golem_resource_report_wizard.py index fd6a41e..aa89300 100644 --- a/golem_resource_report/wizard/golem_resource_report_wizard.py +++ b/golem_resource_report/wizard/golem_resource_report_wizard.py @@ -26,17 +26,15 @@ class GolemResourceReportWizard(models.TransientModel): _name = "golem.resource.report.wizard" resource_ids = fields.Many2many('golem.resource') - date_start = fields.Datetime(required=True) - date_stop = fields.Datetime(required=True) + date_start = fields.Date(required=True) + date_stop = fields.Date(required=True) @api.multi def print_resource_report(self): """ Print Report """ self.ensure_one() record = self[0] - start_date = fields.Datetime.from_string(record.date_start) - stop_date = fields.Datetime.from_string(record.date_stop) - if start_date > stop_date: + if record.date_start > record.date_stop: raise ValidationError(_('Stop Date cannot be set before Start Date.')) else: data = self.read( From ff8a4df86a055f5e7753dec8425c7cee638f4185 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Fri, 25 May 2018 16:47:16 +0200 Subject: [PATCH 14/19] [FIX]GOLEM Resource Report : only validated resource should be printed --- golem_resource_report/reports/golem_reservation_report.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/golem_resource_report/reports/golem_reservation_report.py b/golem_resource_report/reports/golem_reservation_report.py index 3faa007..8540a86 100644 --- a/golem_resource_report/reports/golem_reservation_report.py +++ b/golem_resource_report/reports/golem_reservation_report.py @@ -46,7 +46,8 @@ class GolemResevationReport(models.AbstractModel): def get_data(self, data): """ Get Resevation Data """ - domain = [('date_start', '>', data['date_start']), + domain = [('state', '=', 'validated'), + ('date_start', '>', data['date_start']), ('date_stop', '<', data['date_stop']), ('resource_id', 'in', data['resource_ids'])] reservations = self.env['golem.resource.reservation'].search(domain, order='date_start') From b820207d678ff1925db291970447ba901b91bcce Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Fri, 25 May 2018 16:56:02 +0200 Subject: [PATCH 15/19] [I18N]GOLEM Resource Report : translations --- golem_resource_report/i18n/fr.po | 147 ++++++++++++++++++ .../i18n/golem_resource_report.pot | 147 ++++++++++++++++++ 2 files changed, 294 insertions(+) create mode 100644 golem_resource_report/i18n/fr.po create mode 100644 golem_resource_report/i18n/golem_resource_report.pot diff --git a/golem_resource_report/i18n/fr.po b/golem_resource_report/i18n/fr.po new file mode 100644 index 0000000..11c23b8 --- /dev/null +++ b/golem_resource_report/i18n/fr.po @@ -0,0 +1,147 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * golem_resource_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-25 14:50+0000\n" +"PO-Revision-Date: 2018-05-25 14:50+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "
\n" +" To" +msgstr "
\n" +" À" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "From Date: " +msgstr "De : " + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "To Date:" +msgstr "À :" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_resource_report_wizard_view_form +msgid "Close" +msgstr "Fermer" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_create_date +msgid "Created on" +msgstr "Créé le" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_date_start +msgid "Date start" +msgstr "Date de début" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_date_stop +msgid "Date stop" +msgstr "Date de fin" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_display_name +#: model:ir.model.fields,field_description:golem_resource_report.field_report_golem_resource_report_golem_reservation_report_display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "For" +msgstr "Pour" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "From" +msgstr "De" + +#. module: golem_resource_report +#: model:ir.model,name:golem_resource_report.model_report_golem_resource_report_golem_reservation_report +msgid "Golem Reservation Report" +msgstr "Golem Reservation Report" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_id +#: model:ir.model.fields,field_description:golem_resource_report.field_report_golem_resource_report_golem_reservation_report_id +msgid "ID" +msgstr "ID" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard___last_update +#: model:ir.model.fields,field_description:golem_resource_report.field_report_golem_resource_report_golem_reservation_report___last_update +msgid "Last Modified on" +msgstr "Dernière Modification le" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_resource_report_wizard_view_form +msgid "Print Report" +msgstr "Imprimer le rapport" + +#. module: golem_resource_report +#: model:ir.ui.menu,name:golem_resource_report.resource_report_menu +msgid "Report" +msgstr "Rapport" + +#. module: golem_resource_report +#: model:ir.actions.report.xml,name:golem_resource_report.action_report_report_admission_analysis +msgid "Reservations Report" +msgstr "Export réservations" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_resource_report_wizard_view_form +msgid "Resource Report" +msgstr "Ressource" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_resource_ids +msgid "Resource ids" +msgstr "Resources" + +#. module: golem_resource_report +#: model:ir.actions.act_window,name:golem_resource_report.golem_resource_report_action +msgid "Resources Reports" +msgstr "Ressources" + +#. module: golem_resource_report +#: code:addons/golem_resource_report/wizard/golem_resource_report_wizard.py:38 +#, python-format +msgid "Stop Date cannot be set before Start Date." +msgstr "La date de fin ne peut pas être antérieure à celle de début." + +#. module: golem_resource_report +#: model:ir.model,name:golem_resource_report.model_golem_resource_report_wizard +msgid "golem.resource.report.wizard" +msgstr "golem.resource.report.wizard" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "reservations
" +msgstr "réservations
" diff --git a/golem_resource_report/i18n/golem_resource_report.pot b/golem_resource_report/i18n/golem_resource_report.pot new file mode 100644 index 0000000..2d7477b --- /dev/null +++ b/golem_resource_report/i18n/golem_resource_report.pot @@ -0,0 +1,147 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * golem_resource_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-25 14:50+0000\n" +"PO-Revision-Date: 2018-05-25 14:50+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "
\n" +" To" +msgstr "" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "From Date: " +msgstr "" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "To Date:" +msgstr "" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_resource_report_wizard_view_form +msgid "Close" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_create_uid +msgid "Created by" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_create_date +msgid "Created on" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_date_start +msgid "Date start" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_date_stop +msgid "Date stop" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_display_name +#: model:ir.model.fields,field_description:golem_resource_report.field_report_golem_resource_report_golem_reservation_report_display_name +msgid "Display Name" +msgstr "" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "For" +msgstr "" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "From" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model,name:golem_resource_report.model_report_golem_resource_report_golem_reservation_report +msgid "Golem Reservation Report" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_id +#: model:ir.model.fields,field_description:golem_resource_report.field_report_golem_resource_report_golem_reservation_report_id +msgid "ID" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard___last_update +#: model:ir.model.fields,field_description:golem_resource_report.field_report_golem_resource_report_golem_reservation_report___last_update +msgid "Last Modified on" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_write_date +msgid "Last Updated on" +msgstr "" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_resource_report_wizard_view_form +msgid "Print Report" +msgstr "" + +#. module: golem_resource_report +#: model:ir.ui.menu,name:golem_resource_report.resource_report_menu +msgid "Report" +msgstr "" + +#. module: golem_resource_report +#: model:ir.actions.report.xml,name:golem_resource_report.action_report_report_admission_analysis +msgid "Reservations Report" +msgstr "" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_resource_report_wizard_view_form +msgid "Resource Report" +msgstr "" + +#. module: golem_resource_report +#: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_resource_ids +msgid "Resource ids" +msgstr "" + +#. module: golem_resource_report +#: model:ir.actions.act_window,name:golem_resource_report.golem_resource_report_action +msgid "Resources Reports" +msgstr "" + +#. module: golem_resource_report +#: code:addons/golem_resource_report/wizard/golem_resource_report_wizard.py:38 +#, python-format +msgid "Stop Date cannot be set before Start Date." +msgstr "" + +#. module: golem_resource_report +#: model:ir.model,name:golem_resource_report.model_golem_resource_report_wizard +msgid "golem.resource.report.wizard" +msgstr "" + +#. module: golem_resource_report +#: model:ir.ui.view,arch_db:golem_resource_report.golem_reservation_report +msgid "reservations
" +msgstr "" + From 41633d574f210c8971c54231f8ef2875951e00a0 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Fri, 25 May 2018 17:16:19 +0200 Subject: [PATCH 16/19] [FIX]GOLEM Resource Report : at least 1 resource is needed --- golem_resource_report/wizard/golem_resource_report_wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golem_resource_report/wizard/golem_resource_report_wizard.py b/golem_resource_report/wizard/golem_resource_report_wizard.py index aa89300..338118f 100644 --- a/golem_resource_report/wizard/golem_resource_report_wizard.py +++ b/golem_resource_report/wizard/golem_resource_report_wizard.py @@ -25,7 +25,7 @@ class GolemResourceReportWizard(models.TransientModel): """GOLEM Report Wizard : Choose report parameters """ _name = "golem.resource.report.wizard" - resource_ids = fields.Many2many('golem.resource') + resource_ids = fields.Many2many('golem.resource', required=True) date_start = fields.Date(required=True) date_stop = fields.Date(required=True) From 1a66cbd81c3f437c3844d604bd875c8ad741e785 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Fri, 25 May 2018 17:41:27 +0200 Subject: [PATCH 17/19] [IMP]GOLEM Resource Account : better coherence for quantities and UoM, using XMLIDS --- golem_resource_account/__manifest__.py | 2 +- .../models/golem_resource_reservation.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/golem_resource_account/__manifest__.py b/golem_resource_account/__manifest__.py index 3560e1b..50e5cfb 100644 --- a/golem_resource_account/__manifest__.py +++ b/golem_resource_account/__manifest__.py @@ -20,7 +20,7 @@ 'name': 'GOLEM resources invoicing', 'summary': 'GOLEM resources invoicing', 'description': ''' GOLEM resources invoicing ''', - 'version': '10.0.0.2.0', + 'version': '10.0.0.3.0', 'category': 'GOLEM', 'author': 'Youssef El Ouahby, Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index 94b35ac..ed92997 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -75,11 +75,13 @@ class GolemResourceReservation(models.Model): product.categ_id.property_account_income_categ_id.id delta = fields.Datetime.from_string(reservation.date_stop) - \ fields.Datetime.from_string(reservation.date_start) - quantity = 1 - if product.uom_id.name == 'Hour(s)' or product.uom_id.name == 'Unit(s)': - quantity = int((delta.days * 24) + (delta.seconds/3600.0)) - elif product.uom_id.name == 'Day(s)': - quantity = int(delta.days + (delta.seconds/86400.0))#number of seconds in a day + quantity = 1.0 + # Make quantity coherent with UoM + if product.uom_id in (self.env.ref('product.product_uom_hour'), + self.env.ref('product.product_uom_unit')): + quantity = int(round((delta.days * 24.0) + (delta.seconds/3600.0))) + elif product.uom_id == self.env.ref('product.product_uom_day'): + quantity = int(round(delta.days + (delta.seconds/86400.0))) line_id = self.env['account.invoice.line'].create({ 'invoice_id': invoice_id.id, 'name': product.name, From 392c195b424dcb4a0f519ab27ca0c48dfcd3483c Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Fri, 25 May 2018 18:18:49 +0200 Subject: [PATCH 18/19] [IMP]GOLEM Resource Report : better menus for reports, updated translations --- golem_resource_report/__manifest__.py | 2 +- golem_resource_report/i18n/fr.po | 15 ++++++++++----- .../i18n/golem_resource_report.pot | 13 +++++++++---- .../views/golem_resource_report_menu.xml | 9 ++++++--- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/golem_resource_report/__manifest__.py b/golem_resource_report/__manifest__.py index 8b40f73..9696ff5 100644 --- a/golem_resource_report/__manifest__.py +++ b/golem_resource_report/__manifest__.py @@ -20,7 +20,7 @@ 'name': 'GOLEM resources reports', 'summary': 'GOLEM resources reports', 'description': ''' GOLEM resources reports ''', - 'version': '10.0.0.1.0', + 'version': '10.0.0.1.1', 'category': 'GOLEM', 'author': 'Youssef El Ouahby, Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_resource_report/i18n/fr.po b/golem_resource_report/i18n/fr.po index 11c23b8..1315ce3 100644 --- a/golem_resource_report/i18n/fr.po +++ b/golem_resource_report/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-25 14:50+0000\n" -"PO-Revision-Date: 2018-05-25 14:50+0000\n" +"POT-Creation-Date: 2018-05-25 16:13+0000\n" +"PO-Revision-Date: 2018-05-25 16:13+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -106,7 +106,7 @@ msgid "Print Report" msgstr "Imprimer le rapport" #. module: golem_resource_report -#: model:ir.ui.menu,name:golem_resource_report.resource_report_menu +#: model:ir.ui.menu,name:golem_resource_report.report_menu msgid "Report" msgstr "Rapport" @@ -115,6 +115,11 @@ msgstr "Rapport" msgid "Reservations Report" msgstr "Export réservations" +#. module: golem_resource_report +#: model:ir.ui.menu,name:golem_resource_report.reservation_resource_day_menu +msgid "Reservations per resource and day" +msgstr "Réservations par ressource et jour" + #. module: golem_resource_report #: model:ir.ui.view,arch_db:golem_resource_report.golem_resource_report_wizard_view_form msgid "Resource Report" @@ -123,10 +128,10 @@ msgstr "Ressource" #. module: golem_resource_report #: model:ir.model.fields,field_description:golem_resource_report.field_golem_resource_report_wizard_resource_ids msgid "Resource ids" -msgstr "Resources" +msgstr "Ressources" #. module: golem_resource_report -#: model:ir.actions.act_window,name:golem_resource_report.golem_resource_report_action +#: model:ir.actions.act_window,name:golem_resource_report.reservation_resource_day_action msgid "Resources Reports" msgstr "Ressources" diff --git a/golem_resource_report/i18n/golem_resource_report.pot b/golem_resource_report/i18n/golem_resource_report.pot index 2d7477b..91ddc2f 100644 --- a/golem_resource_report/i18n/golem_resource_report.pot +++ b/golem_resource_report/i18n/golem_resource_report.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-25 14:50+0000\n" -"PO-Revision-Date: 2018-05-25 14:50+0000\n" +"POT-Creation-Date: 2018-05-25 16:13+0000\n" +"PO-Revision-Date: 2018-05-25 16:13+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -105,7 +105,7 @@ msgid "Print Report" msgstr "" #. module: golem_resource_report -#: model:ir.ui.menu,name:golem_resource_report.resource_report_menu +#: model:ir.ui.menu,name:golem_resource_report.report_menu msgid "Report" msgstr "" @@ -114,6 +114,11 @@ msgstr "" msgid "Reservations Report" msgstr "" +#. module: golem_resource_report +#: model:ir.ui.menu,name:golem_resource_report.reservation_resource_day_menu +msgid "Reservations per resource and day" +msgstr "" + #. module: golem_resource_report #: model:ir.ui.view,arch_db:golem_resource_report.golem_resource_report_wizard_view_form msgid "Resource Report" @@ -125,7 +130,7 @@ msgid "Resource ids" msgstr "" #. module: golem_resource_report -#: model:ir.actions.act_window,name:golem_resource_report.golem_resource_report_action +#: model:ir.actions.act_window,name:golem_resource_report.reservation_resource_day_action msgid "Resources Reports" msgstr "" diff --git a/golem_resource_report/views/golem_resource_report_menu.xml b/golem_resource_report/views/golem_resource_report_menu.xml index a75dc9a..0093461 100644 --- a/golem_resource_report/views/golem_resource_report_menu.xml +++ b/golem_resource_report/views/golem_resource_report_menu.xml @@ -20,7 +20,7 @@ along with this program. If not, see . - + Resources Reports golem.resource.report.wizard form @@ -31,8 +31,11 @@ along with this program. If not, see . - + + From 0421f494bc294ca16c462229ba4d6860158d36e0 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Fri, 25 May 2018 18:52:26 +0200 Subject: [PATCH 19/19] [REF][I18N]GOLEM Resource Pack : small refactorings and updated translations --- golem_resource_pack/__manifest__.py | 2 +- golem_resource_pack/i18n/fr.po | 59 +++++++++++++++++-- .../i18n/golem_resource_pack.pot | 59 +++++++++++++++++-- .../models/golem_resource_pack.py | 5 +- .../views/golem_resource_pack_views.xml | 5 +- .../wizard/golem_pack_quick_reservation.py | 35 +++++++---- .../golem_pack_quick_reservation_views.xml | 6 +- 7 files changed, 141 insertions(+), 30 deletions(-) diff --git a/golem_resource_pack/__manifest__.py b/golem_resource_pack/__manifest__.py index f12326a..9e6ac44 100644 --- a/golem_resource_pack/__manifest__.py +++ b/golem_resource_pack/__manifest__.py @@ -20,7 +20,7 @@ 'name': 'GOLEM resources pack', 'summary': 'GOLEM resources pack', 'description': ''' GOLEM resources pack ''', - 'version': '10.0.0.0.7', + 'version': '10.0.0.1.0', 'category': 'GOLEM', 'author': 'Youssef El Ouahby, Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_resource_pack/i18n/fr.po b/golem_resource_pack/i18n/fr.po index 9e37567..166e420 100644 --- a/golem_resource_pack/i18n/fr.po +++ b/golem_resource_pack/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-17 06:51+0000\n" -"PO-Revision-Date: 2018-04-17 06:51+0000\n" +"POT-Creation-Date: 2018-05-25 16:47+0000\n" +"PO-Revision-Date: 2018-05-25 16:47+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,6 +16,7 @@ msgstr "" "Plural-Forms: \n" #. module: golem_resource_pack +#: model:ir.ui.view,arch_db:golem_resource_pack.golem_pack_quick_reservation_wizard_view_form #: model:ir.ui.view,arch_db:golem_resource_pack.golem_pack_rejection_wizard_view_form #: model:ir.ui.view,arch_db:golem_resource_pack.golem_resource_pack_view_form msgid "Cancel" @@ -37,18 +38,26 @@ msgid "Confirmed" msgstr "Confirmé" #. module: golem_resource_pack +#: model:ir.ui.view,arch_db:golem_resource_pack.golem_pack_quick_reservation_wizard_view_form +msgid "Create Reservations" +msgstr "Créer les réservations" + +#. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_create_uid #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_create_uid #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_create_uid msgid "Created by" msgstr "Créé par" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_create_date #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_create_date #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_create_date msgid "Created on" msgstr "Créé le" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_display_name #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_display_name #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_display_name msgid "Display Name" @@ -59,6 +68,11 @@ msgstr "Nom affiché" msgid "Draft" msgstr "Brouillon" +#. module: golem_resource_pack +#: model:ir.model,name:golem_resource_pack.model_golem_pack_quick_reservation_wizard +msgid "GOLEM Pack Quick Reservation Wizard" +msgstr "GOLEM Pack Quick Reservation Wizard" + #. module: golem_resource_pack #: model:ir.model,name:golem_resource_pack.model_golem_resource_reservation msgid "GOLEM Reservation Model" @@ -70,24 +84,28 @@ msgid "GOLEM Resource Pack Model" msgstr "GOLEM Resource Pack Model" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_id #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_id #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_id msgid "ID" msgstr "ID" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard___last_update #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard___last_update #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack___last_update msgid "Last Modified on" msgstr "Dernière Modification le" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_write_uid #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_write_uid #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_write_uid msgid "Last Updated by" msgstr "Dernière mise à jour par" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_write_date #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_write_date #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_write_date msgid "Last Updated on" @@ -109,6 +127,7 @@ msgid "Notes, optional subject for the reservation, reason" msgstr "Notes, subjet, motif, descriptif optionnel pour la réservation" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_partner_id #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_partner_id msgid "On behalf of" msgstr "Pour le compte de" @@ -119,22 +138,33 @@ msgid "Pack" msgstr "Lot" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_pack_id #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_pack_id msgid "Pack id" msgstr "Lot" #. module: golem_resource_pack -#: code:addons/golem_resource_pack/models/golem_resource_pack.py:126 +#: code:addons/golem_resource_pack/models/golem_resource_pack.py:138 #, python-format msgid "Pack partner should be the same for all reservations" msgstr "Toutes les réservations devraient avoir le même compte" #. module: golem_resource_pack -#: code:addons/golem_resource_pack/models/golem_resource_pack.py:108 +#: code:addons/golem_resource_pack/models/golem_resource_pack.py:120 #, python-format msgid "Please enter the rejection reason" msgstr "Merci de saisir le motif de refus" +#. module: golem_resource_pack +#: model:ir.ui.view,arch_db:golem_resource_pack.golem_resource_pack_view_form +msgid "Quick Reservation" +msgstr "Réservations rapides" + +#. module: golem_resource_pack +#: model:ir.ui.view,arch_db:golem_resource_pack.golem_pack_quick_reservation_wizard_view_form +msgid "Quick Reservations" +msgstr "Réservations rapides" + #. module: golem_resource_pack #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_reason msgid "Reason" @@ -178,16 +208,37 @@ msgstr "Nombre de réservations" msgid "Reservations" msgstr "Réservations" +#. module: golem_resource_pack +#: code:addons/golem_resource_pack/models/golem_resource_pack.py:60 +#, python-format +msgid "Reservations Creation" +msgstr "Création de réservations" + +#. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_resource_ids +msgid "Resource List" +msgstr "Resource List" + #. module: golem_resource_pack #: model:ir.ui.view,arch_db:golem_resource_pack.golem_resource_pack_view_form msgid "Set to draft" msgstr "Brouillon" +#. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_date_start +msgid "Start date" +msgstr "Date de début" + #. module: golem_resource_pack #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_state msgid "State" msgstr "État" +#. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_date_stop +msgid "Stop date" +msgstr "Date de fin" + #. module: golem_resource_pack #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_user_id msgid "User" diff --git a/golem_resource_pack/i18n/golem_resource_pack.pot b/golem_resource_pack/i18n/golem_resource_pack.pot index b8d7023..93a6a25 100644 --- a/golem_resource_pack/i18n/golem_resource_pack.pot +++ b/golem_resource_pack/i18n/golem_resource_pack.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-17 06:51+0000\n" -"PO-Revision-Date: 2018-04-17 06:51+0000\n" +"POT-Creation-Date: 2018-05-25 16:47+0000\n" +"PO-Revision-Date: 2018-05-25 16:47+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,6 +16,7 @@ msgstr "" "Plural-Forms: \n" #. module: golem_resource_pack +#: model:ir.ui.view,arch_db:golem_resource_pack.golem_pack_quick_reservation_wizard_view_form #: model:ir.ui.view,arch_db:golem_resource_pack.golem_pack_rejection_wizard_view_form #: model:ir.ui.view,arch_db:golem_resource_pack.golem_resource_pack_view_form msgid "Cancel" @@ -37,18 +38,26 @@ msgid "Confirmed" msgstr "" #. module: golem_resource_pack +#: model:ir.ui.view,arch_db:golem_resource_pack.golem_pack_quick_reservation_wizard_view_form +msgid "Create Reservations" +msgstr "" + +#. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_create_uid #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_create_uid #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_create_uid msgid "Created by" msgstr "" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_create_date #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_create_date #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_create_date msgid "Created on" msgstr "" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_display_name #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_display_name #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_display_name msgid "Display Name" @@ -59,6 +68,11 @@ msgstr "" msgid "Draft" msgstr "" +#. module: golem_resource_pack +#: model:ir.model,name:golem_resource_pack.model_golem_pack_quick_reservation_wizard +msgid "GOLEM Pack Quick Reservation Wizard" +msgstr "" + #. module: golem_resource_pack #: model:ir.model,name:golem_resource_pack.model_golem_resource_reservation msgid "GOLEM Reservation Model" @@ -70,24 +84,28 @@ msgid "GOLEM Resource Pack Model" msgstr "" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_id #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_id #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_id msgid "ID" msgstr "" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard___last_update #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard___last_update #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack___last_update msgid "Last Modified on" msgstr "" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_write_uid #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_write_uid #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_write_uid msgid "Last Updated by" msgstr "" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_write_date #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_write_date #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_write_date msgid "Last Updated on" @@ -109,6 +127,7 @@ msgid "Notes, optional subject for the reservation, reason" msgstr "" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_partner_id #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_partner_id msgid "On behalf of" msgstr "" @@ -119,22 +138,33 @@ msgid "Pack" msgstr "" #. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_pack_id #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_pack_id msgid "Pack id" msgstr "" #. module: golem_resource_pack -#: code:addons/golem_resource_pack/models/golem_resource_pack.py:126 +#: code:addons/golem_resource_pack/models/golem_resource_pack.py:138 #, python-format msgid "Pack partner should be the same for all reservations" msgstr "" #. module: golem_resource_pack -#: code:addons/golem_resource_pack/models/golem_resource_pack.py:108 +#: code:addons/golem_resource_pack/models/golem_resource_pack.py:120 #, python-format msgid "Please enter the rejection reason" msgstr "" +#. module: golem_resource_pack +#: model:ir.ui.view,arch_db:golem_resource_pack.golem_resource_pack_view_form +msgid "Quick Reservation" +msgstr "" + +#. module: golem_resource_pack +#: model:ir.ui.view,arch_db:golem_resource_pack.golem_pack_quick_reservation_wizard_view_form +msgid "Quick Reservations" +msgstr "" + #. module: golem_resource_pack #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_rejection_wizard_reason msgid "Reason" @@ -178,16 +208,37 @@ msgstr "" msgid "Reservations" msgstr "" +#. module: golem_resource_pack +#: code:addons/golem_resource_pack/models/golem_resource_pack.py:60 +#, python-format +msgid "Reservations Creation" +msgstr "" + +#. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_resource_ids +msgid "Resource List" +msgstr "" + #. module: golem_resource_pack #: model:ir.ui.view,arch_db:golem_resource_pack.golem_resource_pack_view_form msgid "Set to draft" msgstr "" +#. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_date_start +msgid "Start date" +msgstr "" + #. module: golem_resource_pack #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_state msgid "State" msgstr "" +#. module: golem_resource_pack +#: model:ir.model.fields,field_description:golem_resource_pack.field_golem_pack_quick_reservation_wizard_date_stop +msgid "Stop date" +msgstr "" + #. module: golem_resource_pack #: model:ir.model.fields,field_description:golem_resource_pack.field_golem_resource_pack_user_id msgid "User" diff --git a/golem_resource_pack/models/golem_resource_pack.py b/golem_resource_pack/models/golem_resource_pack.py index 1b170d6..c88bc04 100644 --- a/golem_resource_pack/models/golem_resource_pack.py +++ b/golem_resource_pack/models/golem_resource_pack.py @@ -57,11 +57,10 @@ class GolemResourcePack(models.Model): """ Quick Reservation Creating""" self.ensure_one() pack_id = self[0] - return {'name' : _('Reservations Creating'), + return {'name' : _('Reservations Creation'), 'type' : 'ir.actions.act_window', 'res_model' : 'golem.pack.quick.reservation.wizard', - 'context': {'default_pack_id': pack_id.id, - 'default_partner_id': pack_id.partner_id.id}, + 'context': {'default_pack_id': pack_id.id}, 'view_mode': 'form', 'target': 'new'} diff --git a/golem_resource_pack/views/golem_resource_pack_views.xml b/golem_resource_pack/views/golem_resource_pack_views.xml index b3a38e6..d75233d 100644 --- a/golem_resource_pack/views/golem_resource_pack_views.xml +++ b/golem_resource_pack/views/golem_resource_pack_views.xml @@ -67,9 +67,8 @@ along with this program. If not, see . -
- Date :
- On behalf of :
-
+ + + +
+ + - + + + + From
+ To +
+

+
+ For +

+
+
+