[New] Module Golem member account

This commit is contained in:
michel 2018-02-08 17:01:41 +01:00
parent 8c102ff103
commit e26cd1c149
10 changed files with 2430 additions and 27 deletions

View File

@ -24,7 +24,7 @@
'license': 'AGPL-3',
'application': True,
'installable': True,
'depends': ['account', 'golem_base', 'golem_activity', 'golem_season',
'depends': ['golem_base', 'golem_activity', 'golem_season',
'odoo_partner_merge'],
'data': ['views/golem_member_views.xml',
'views/res_partner_views.xml',

View File

@ -22,7 +22,6 @@ from odoo import models, fields, api, _
from odoo.exceptions import UserError
_LOGGER = logging.getLogger(__name__)
class ResPartner(models.Model):
""" GOLEM Member partner adaptations """
_inherit = 'res.partner'
@ -43,6 +42,7 @@ class ResPartner(models.Model):
is_member = fields.Boolean('Is member', compute='_compute_is_member')
member_number = fields.Char('Member number', related='member_id.number')
@api.depends('member_id')
def _compute_is_member(self):
""" Computes is member """
@ -105,7 +105,7 @@ class GolemMember(models.Model):
image_permission = fields.Boolean('Image permission?', default=True)
currency_id = fields.Many2one('res.currency', compute='_get_company_currency',
string="Currency")
@api.one
def _get_company_currency(self):
if self.company_id:
@ -229,17 +229,6 @@ class GolemMember(models.Model):
self.generate_number()
return res
@api.multi
def open_partner_invoices(self):
""" Open invoices member """
self.ensure_one()
return {'type': 'ir.actions.act_window',
'res_model': 'account.invoice',
'view_mode': 'tree',
'context': {'search_default_partner_id': self.partner_id.id},
'res_id': self.partner_id.id}
class GolemMemberNumber(models.Model):
""" GOLEM Member Numbers """
_name = 'golem.member.number'

View File

@ -28,19 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<sheet>
<div colspan="2"
style="background-color: #ccc; color: #fff; font-size: 150%; font-weight: bold; padding: 0.5%; text-align: center; margin-bottom: 1%;">Member form</div>
<div class="oe_button_box" name="button_box">
<button type="object" class="oe_stat_button" id="invoice_button"
icon="fa-pencil-square-o" name="open_partner_invoices"
attrs="{'invisible': [('free_member', '=', True)]}"
context="{'default_partner_id': active_id}">
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field name="total_invoiced" widget='monetary' options="{'currency_field': 'currency_id'}"/></span>
<span class="o_stat_text">Invoiced</span>
</div>
</button>
</div>
<group>
<div class="oe_title">
<h1>

View File

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
from . import models

View File

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
{
'name': 'GOLEM non-profit members',
'summary': 'Extends Odoo contacts for MJC',
'version': '10.0.1.0.0',
'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3',
'application': True,
'installable': True,
'depends': ['account', 'golem_base', 'golem_member'],
'data': ['views/golem_member_views.xml']
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
from . import golem_member

View File

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
#
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
#
# 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 <http://www.gnu.org/licenses/>.
""" GOLEM Members """
import logging
from odoo import models, fields, api, _
from odoo.exceptions import UserError
_LOGGER = logging.getLogger(__name__)
class GolemMember(models.Model):
""" GOLEM Member adaptations """
_inherit = 'golem.member'
@api.multi
def open_partner_invoices(self):
""" Open invoices member """
self.ensure_one()
return {'type': 'ir.actions.act_window',
'res_model': 'account.invoice',
'view_mode': 'tree',
'context': {'search_default_partner_id': self.partner_id.id,
'default_partner_id': self.partner_id.id}}

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Fabien Bourgeois <fabien@yaltik.com>
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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<data>
<!-- Forms -->
<record model="ir.ui.view" id="golem_member_account_form_inherit_golem_member">
<field name="name">GOLEM Member account Form</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.golem_member_form" />
<field name="arch" type="xml">
<div class="oe_title" position="after">
<div class="oe_button_box" name="button_box">
<button type="object" class="oe_stat_button" id="invoice_button"
icon="fa-pencil-square-o" name="open_partner_invoices"
attrs="{'invisible': [('free_member', '=', True)]}"
context="{'default_partner_id': active_id}">
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field name="total_invoiced" widget='monetary' options="{'currency_field': 'currency_id'}"/></span>
<span class="o_stat_text">Invoiced</span>
</div>
</button>
</div>
</div>
</field>
</record>
</data>
</odoo>