From eb053822b2fcc9541abe974209ebf8b89c12fd3b Mon Sep 17 00:00:00 2001 From: Ludovic CHEVALIER Date: Thu, 3 Oct 2013 11:13:26 +0200 Subject: [PATCH] [module] +copyright --- __init__.py | 10 +++++----- __openerp__.py | 8 ++++---- remembership.py | 28 ++++++++++++++-------------- wizard/__init__.py | 21 +++++++++++++++++++++ wizard/remembership_invoice.py | 21 +++++++++++++++++++++ 5 files changed, 65 insertions(+), 23 deletions(-) diff --git a/__init__.py b/__init__.py index 0c00d91..13e9a86 100644 --- a/__init__.py +++ b/__init__.py @@ -1,17 +1,17 @@ # -*- coding: utf-8 -*- ############################################################################## # -# ReMembership module for OpenERP, Other membership module for member management. -# Copyright (C) 2012 L'Heureux Cyclage () Ludovic CHEVALIER +# Remembership module for OpenERP, Membership module enhancement and bug fixes +# Copyright (C) 2012-2013 L'Heureux Cyclage () # -# This file is a part of ReMembership +# This file is a part of Remembership # -# ReMembership is free software: you can redistribute it and/or modify +# Remembership is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# ReMembership is distributed in the hope that it will be useful, +# Remembership 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 General Public License for more details. diff --git a/__openerp__.py b/__openerp__.py index 830f216..967aceb 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -1,17 +1,17 @@ # -*- coding: utf-8 -*- ############################################################################## # -# ReMembership module for OpenERP, Other membership module for member management. +# Remembership module for OpenERP, Membership module enhancement and bug fixes # Copyright (C) 2012-2013 L'Heureux Cyclage () # -# This file is a part of ReMembership +# This file is a part of Remembership # -# ReMembership is free software: you can redistribute it and/or modify +# Remembership is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# ReMembership is distributed in the hope that it will be useful, +# Remembership 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 General Public License for more details. diff --git a/remembership.py b/remembership.py index 9a5f6c2..178fd4b 100644 --- a/remembership.py +++ b/remembership.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Remembership module for OpenERP, Overload membership module +# Remembership module for OpenERP, Membership module enhancement and bug fixes # Copyright (C) 2012-2013 L'Heureux Cyclage () # # This file is a part of Remembership @@ -31,7 +31,7 @@ from openerp.tools.translate import _ class Partner(osv.osv): _inherit = 'res.partner' - + # XXX: copied from openerp/addons/membership/membership.py def _membership_date(self, cr, uid, ids, name, args, context=None): """Return date of membership""" @@ -61,7 +61,7 @@ class Partner(osv.osv): print ("DEV: [_membership_date] [associate] date_from: %s" % str(res[partner.id]['membership_start'])) else: print ("DEV: [_membership_date] date_from: %s" % str(res[partner.id]['membership_start'])) - + if name == 'membership_stop': line_id1 = member_line_obj.search(cr, uid, [('partner', '=', partner_id),('date_cancel','=',False)], limit=1, order='date_to desc', context=context) @@ -72,7 +72,7 @@ class Partner(osv.osv): print ("DEV: [_membership_date] [associate] date_to: %s" % str(res[partner.id]['membership_stop'])) else: print ("DEV: [_membership_date] date_to: %s" % str(res[partner.id]['membership_stop'])) - + if name == 'membership_cancel': if partner.membership_state == 'canceled': line_id2 = member_line_obj.search(cr, uid, [('partner', '=', partner.id)], limit=1, order='date_cancel', context=context) @@ -105,7 +105,7 @@ class Partner(osv.osv): ids2 = res_obj.search(cr, uid, [('associate_member', 'in', ids2)], context=context) list_partner += ids2 return list_partner - + _columns = { 'member_ident': fields.char('Member identifier', size=64), 'associate_members': fields.one2many('res.partner', 'associate_member', 'Associate members', help='Members who are associated to this partner.'), @@ -137,15 +137,15 @@ class Partner(osv.osv): 'res.partner': (lambda self, cr, uid, ids, c={}: ids, ['free_member'], 10) }, help="Date on which membership has been cancelled"), } - + _sql_constraints = [ ('member_ident_uniq', 'unique(member_ident, company_id)', 'The member identifier must be unique !'), ] - + def create_membership_invoice(self, cr, uid, ids, product_id=None, datas=None, context=None): # NOTE: use context to supply date_from to account_invoice_line.create context = context and context.copy() or {} - context.update({'date_from': datas.get('date_from', None)}); + #context.update({'date_from': datas.get('date_from', None)}); # XXX: copied from openerp/addons/membership/membership.py to fix account_invoice_line creation print ("DEV: [remembership] [partner] [create_membership_invoice] ids=%s" % str(ids)) invoice_obj = self.pool.get('account.invoice') @@ -171,7 +171,7 @@ class Partner(osv.osv): line_value = { 'product_id': product_id, } - + print ("DEV: [remembership] [partner] [create_membership_invoice] ids=%s partner=%s [invoice_line_obj] [product_id_change]" % (str(ids),str(partner.id))) line_dict = invoice_line_obj.product_id_change(cr, uid, {}, product_id, False, quantity, '', 'out_invoice', partner.id, fpos_id, price_unit=amount, context=context) @@ -180,7 +180,7 @@ class Partner(osv.osv): if line_value.get('invoice_line_tax_id', False): tax_tab = [(6, 0, line_value['invoice_line_tax_id'])] line_value['invoice_line_tax_id'] = tax_tab - + print ("DEV: [remembership] [partner] [create_membership_invoice] ids=%s partner=%s [invoice_obj] [create] account=%s" % (str(ids),str(partner.id),str(account_id))) # NOTE: let account_invoice_obj.create() call account_invoice_line.create() # to have a correct membership_state: becauce now fields.function 'store' watchdogs @@ -214,7 +214,7 @@ Partner() class Product(osv.osv): _inherit = 'product.product' - + _columns = { 'membership_grouped': fields.boolean('Grouped membership product', help='Check if it\'s a grouped membership product.'), 'membership_date2date': fields.boolean('Date to date membership product', required=False, help='Check if it\'s a date to date membership product.'), @@ -225,7 +225,7 @@ Product() class account_invoice_line(osv.osv): _inherit = 'account.invoice.line' - + def write(self, cr, uid, ids, vals, context=None): member_line_obj = self.pool.get('membership.membership_line') res = super(account_invoice_line, self).write(cr, uid, ids, vals, context=context) @@ -297,13 +297,13 @@ class account_invoice_line(osv.osv): member_line_obj.unlink(cr, uid, ml_ids, context=context) print ("DEV: [remembership] [account_invoice_line] [write] : return=%s" % str(res)) return res - + def create(self, cr, uid, vals, context=None): member_line_obj = self.pool.get('membership.membership_line') res = super(account_invoice_line, self).create(cr, uid, vals, context=context) print ("DEV: [remembership] [account_invoice_line] [create] : begin res=%s" % str(res)) line = self.browse(cr, uid, res, context=context) - + if line.invoice_id.type == 'out_invoice' and line.product_id and line.product_id.membership: member_line_id = member_line_obj.search(cr, uid , [('partner' , '=', line.invoice_id.partner_id.id) diff --git a/wizard/__init__.py b/wizard/__init__.py index 995bfd9..1089ea6 100644 --- a/wizard/__init__.py +++ b/wizard/__init__.py @@ -1,3 +1,24 @@ # -*- coding: utf-8 -*- +############################################################################## +# +# Remembership module for OpenERP, Membership module enhancement and bug fixes +# Copyright (C) 2012-2013 L'Heureux Cyclage () +# +# This file is a part of Remembership +# +# Remembership is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Remembership 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## import remembership_invoice diff --git a/wizard/remembership_invoice.py b/wizard/remembership_invoice.py index 99fab8b..08a999c 100644 --- a/wizard/remembership_invoice.py +++ b/wizard/remembership_invoice.py @@ -1,4 +1,25 @@ # -*- coding: utf-8 -*- +############################################################################## +# +# Remembership module for OpenERP, Membership module enhancement and bug fixes +# Copyright (C) 2012-2013 L'Heureux Cyclage () +# +# This file is a part of Remembership +# +# Remembership is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Remembership 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## from openerp.osv import osv from openerp.osv import fields -- 2.20.1