[IMP][QUa]GOLEM Member Account enhancements : styles, tree removal (perf), renamings, copyright notices...

This commit is contained in:
Fabien BOURGEOIS 2018-02-12 18:54:56 +01:00
parent bfa9298cef
commit bf8fc34b6b
7 changed files with 66 additions and 87 deletions

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Michel Dessenne <michel@yaltik.com>
# Copyright 2018 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

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Michel Dessenne <michel@yaltik.com>
# Copyright 2018 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
@ -17,13 +18,13 @@
{
'name': 'GOLEM members account',
'summary': 'GOLEM non-profit members account management',
'version': '10.0.1.0.0',
'summary': 'GOLEM non-profit members account',
'version': '10.0.1.0.1',
'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3',
'application': True,
'application': False,
'installable': True,
'depends': ['account', 'golem_base', 'golem_member'],
'depends': ['account', 'golem_member'],
'data': ['views/golem_member_views.xml']
}

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-12 15:36+0000\n"
"PO-Revision-Date: 2018-02-12 15:36+0000\n"
"POT-Creation-Date: 2018-02-12 17:49+0000\n"
"PO-Revision-Date: 2018-02-12 17:49+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -16,17 +16,17 @@ msgstr ""
"Plural-Forms: \n"
#. module: golem_member_account
#: model:ir.ui.view,arch_db:golem_member_account.golem_member_account_form_inherit_golem_member
#: model:ir.ui.view,arch_db:golem_member_account.golem_member_form_inherit_golem_member_account
msgid "<span class=\"o_stat_text\">Invoiced</span>"
msgstr "<span class=\"o_stat_text\">Facturé</span>"
#. module: golem_member_account
#: selection:golem.member,state_last_invoice:0
#: selection:golem.member,last_payment_state:0
msgid "Checked"
msgstr "Validé"
#. module: golem_member_account
#: selection:golem.member,state_last_invoice:0
#: selection:golem.member,last_payment_state:0
msgid "Draft"
msgstr "Brouillon"
@ -36,21 +36,16 @@ msgid "GOLEM Member"
msgstr "Adhérent"
#. module: golem_member_account
#: model:ir.model,name:golem_member_account.model_account_invoice
msgid "Invoice"
msgstr "Facture"
#: model:ir.model.fields,field_description:golem_member_account.field_golem_member_last_payment_state
msgid "Last payment state"
msgstr "État du dernier paiement"
#. module: golem_member_account
#: selection:golem.member,state_last_invoice:0
#: selection:golem.member,last_payment_state:0
msgid "Posted"
msgstr "Publié"
msgstr "Comptabilisé"
#. module: golem_member_account
#: selection:golem.member,state_last_invoice:0
#: selection:golem.member,last_payment_state:0
msgid "Reconciled"
msgstr "Rapproché"
#. module: golem_member_account
#: model:ir.model.fields,field_description:golem_member_account.field_golem_member_state_last_invoice
msgid "State last invoice"
msgstr "Etat de la drenière facture"
msgstr "Lettré"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-12 15:36+0000\n"
"PO-Revision-Date: 2018-02-12 15:36+0000\n"
"POT-Creation-Date: 2018-02-12 17:50+0000\n"
"PO-Revision-Date: 2018-02-12 17:50+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -16,17 +16,17 @@ msgstr ""
"Plural-Forms: \n"
#. module: golem_member_account
#: model:ir.ui.view,arch_db:golem_member_account.golem_member_account_form_inherit_golem_member
#: model:ir.ui.view,arch_db:golem_member_account.golem_member_form_inherit_golem_member_account
msgid "<span class=\"o_stat_text\">Invoiced</span>"
msgstr ""
#. module: golem_member_account
#: selection:golem.member,state_last_invoice:0
#: selection:golem.member,last_payment_state:0
msgid "Checked"
msgstr ""
#. module: golem_member_account
#: selection:golem.member,state_last_invoice:0
#: selection:golem.member,last_payment_state:0
msgid "Draft"
msgstr ""
@ -36,22 +36,17 @@ msgid "GOLEM Member"
msgstr ""
#. module: golem_member_account
#: model:ir.model,name:golem_member_account.model_account_invoice
msgid "Invoice"
#: model:ir.model.fields,field_description:golem_member_account.field_golem_member_last_payment_state
msgid "Last payment state"
msgstr ""
#. module: golem_member_account
#: selection:golem.member,state_last_invoice:0
#: selection:golem.member,last_payment_state:0
msgid "Posted"
msgstr ""
#. module: golem_member_account
#: selection:golem.member,state_last_invoice:0
#: selection:golem.member,last_payment_state:0
msgid "Reconciled"
msgstr ""
#. module: golem_member_account
#: model:ir.model.fields,field_description:golem_member_account.field_golem_member_state_last_invoice
msgid "State last invoice"
msgstr ""

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Michel Dessenne <michel@yaltik.com>
# Copyright 2018 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

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Michel Dessenne <michel@yaltik.com>
# Copyright 2018 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
@ -15,38 +16,34 @@
# 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__)
""" GOLEM Member adaptations """
from odoo import models, fields, api
class GolemMember(models.Model):
""" GOLEM Member adaptations """
_inherit = 'golem.member'
last_payment_state = fields.Selection([('draft', 'Draft'),
('posted', 'Posted'),
('checked', 'Checked'),
('reconciled', 'Reconciled')],
compute='_compute_last_payment_state')
@api.multi
def open_partner_invoices(self):
""" Open invoices member """
""" Open member invoices """
self.ensure_one()
return {'type': 'ir.actions.act_window',
'name': 'Invoices',
'res_model': 'account.invoice',
'view_mode': 'tree,form',
'context': {'search_default_partner_id': self.partner_id.id,
'default_partner_id': self.partner_id.id}}
state_last_invoice = fields.Selection([('draft', 'Draft'),
('posted', 'Posted'),
('checked', 'Checked'),
('reconciled', 'Reconciled')],
compute='_compute_state_of_last_invoice')
'context': {'search_default_partner_id': self[0].partner_id.id,
'default_partner_id': self[0].partner_id.id}}
@api.depends('invoice_ids')
def _compute_state_of_last_invoice(self):
def _compute_last_payment_state(self):
""" Computes last invoice payment state : check last invoice, then more
recent payment and retrieve its state """
for member in self:
@ -63,6 +60,6 @@ class GolemMember(models.Model):
last_payment_id = payment
break
if last_payment_id:
member.state_last_invoice = last_payment_id.state
member.last_payment_state = last_payment_id.state
return
member.state_last_invoice = False

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2018 Michel Dessenne <michel@yaltik.com>
Copyright 2018 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
@ -19,41 +20,29 @@ 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>
<record model="ir.ui.view" id="golem_member_form_inherit_golem_member_account">
<field name="name">GOLEM Member Form adaptations</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">
<div name="buttons" position="inside">
<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>
<field name="total_invoiced" widget='monetary'
options="{'currency_field': 'currency_id'}"/>
</span>
<span class="o_stat_text">Invoiced</span>
</div>
</button>
</div>
</div>
<field name="season_ids" position="before">
<field name="state_last_invoice" />
<field name="currency_id" invisible="1"/>
</field>
</field>
</record>
<!-- Trees -->
<record model="ir.ui.view" id="golem_member_account_tree_inherit_golem_member">
<field name="name">GOLEM Member account tree</field>
<field name="model">golem.member</field>
<field name="inherit_id" ref="golem_member.golem_member_tree" />
<field name="arch" type="xml">
<field name="contact_address" position="after">
<field name="state_last_invoice" />
<field name="comment" position="before">
<field name="last_payment_state" />
<field name="currency_id" invisible="1" />
</field>
</field>
</record>