From 7bc5f2bab92ee73ca3dd046fa49a5d03570a5d70 Mon Sep 17 00:00:00 2001 From: houssine Date: Tue, 18 Sep 2018 18:25:36 +0200 Subject: [PATCH] [REM] removing unused py --- easy_my_coop/models/mail_mail.py | 53 -------------- .../wizard/cooperative_history_wizard.py | 69 ------------------- 2 files changed, 122 deletions(-) delete mode 100644 easy_my_coop/models/mail_mail.py delete mode 100644 easy_my_coop/wizard/cooperative_history_wizard.py diff --git a/easy_my_coop/models/mail_mail.py b/easy_my_coop/models/mail_mail.py deleted file mode 100644 index 4fdafe5..0000000 --- a/easy_my_coop/models/mail_mail.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2011 OpenERP S.A (). -# -# 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 openerp import SUPERUSER_ID -from openerp.osv import osv -from openerp.osv.orm import except_orm -from openerp.tools import append_content_to_html -from openerp.tools.translate import _ - - -class mail_mail(models.Model): - """ Update of mail_mail class, to remove the signin url added in the portal module """ - _inherit = 'mail.mail' - - def send_get_mail_body(self, cr, uid, mail, partner=None, context=None): - partner_obj = self.pool.get('res.partner') - body = mail.body_html - if partner: - contex_signup = dict(context or {}, signup_valid=True) - partner = partner_obj.browse(cr, SUPERUSER_ID, partner.id, context=contex_signup) - #text = _("""

Access your messages and personal documents through our Customer Portal

""") % partner.signup_url - text ='' - # partner is an user: add a link to the document if read access - if partner.user_ids and mail.model and mail.res_id \ - and self.check_access_rights(cr, partner.user_ids[0].id, 'read', raise_exception=False): - related_user = partner.user_ids[0] - try: - self.pool.get(mail.model).check_access_rule(cr, related_user.id, [mail.res_id], 'read', context=context) - url = partner_obj._get_signup_url_for_action(cr, related_user.id, [partner.id], action='', res_id=mail.res_id, model=mail.model, context=context)[partner.id] - text = _("""

Access this document directly in OpenERP

""") % url - except except_orm, e: - pass - - body = append_content_to_html(body, ("

%s

" % text), plaintext=False) - return body \ No newline at end of file diff --git a/easy_my_coop/wizard/cooperative_history_wizard.py b/easy_my_coop/wizard/cooperative_history_wizard.py deleted file mode 100644 index c88c692..0000000 --- a/easy_my_coop/wizard/cooperative_history_wizard.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Author: Houssine BAKKALI -# Copyright Open Architects Consulting -# -# 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 openerp import api, fields, models, _ - -class cooperative_report(models.TransientModel): - _name = 'cooperative.history.report' - - def _print_report(self, data): - - return {'type': 'ir.actions.report.xml', - 'report_name': data['report'], - 'datas': data} - - def check_report(self): - data = {} - - report_name = '' - obj_ids = [] - if self._context.get('active_ids') : - data['ids'] = self._context.get('active_ids', []) - else: - if self.report == 'coop_register': - report_name = 'easy_my_coop.cooperator_register_G001' - res_partner_obj = self.pool.get('res.partner') - domain = [] - domain.append(('cooperator','=','True')) - if self.display_cooperator == 'member' : - domain.append(('member','=','True')) - obj_ids = res_partner_obj.search(cr,uid, domain, order='cooperator_register_number') - elif self.report == 'operation_register' : - report_name = 'energiris_wp_sync.cooperator_subscription_G001' - obj_ids = self.pool.get('subscription.register').search(cr,uid,[], order='register_number_operation') - else : - raise osv.except_osv(_("Error!"), _("the report you've specified doesn't exist !")) - - data['model'] = context.get('active_model', 'ir.ui.menu') - data['report'] = report_name - #data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to','display_time','display_cooperator','group_by_task','group_by_task_work'], context=context)[0] - data['ids'] = obj_ids - return self._print_report(cr, uid, ids, data, context=context) - - name = fields.Char(string='Name') - report = fields.Selection([('coop_register', 'Cooperators Register'), - ('operation_register', 'Operations Register')], - string='Report', - required=True, default='coop_register') - display_cooperator = fields.Selection([('all', 'All'), - ('member', 'Effective member')], - string='Display cooperator', - required=True, default='all')