forked from Yaltik/golem
[ADD]GOLEM Membership : accounting data
* Default memebrship accounts ; * New journals : check, credit card.
This commit is contained in:
parent
601971cd92
commit
ad0d5b0ff6
@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
|
||||
# Copyright 2016-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
|
||||
@ -18,14 +18,15 @@
|
||||
{
|
||||
'name': 'GOLEM non-profit membership handling',
|
||||
'summary': 'Extends Odoo membership',
|
||||
'version': '10.0.1.1.3',
|
||||
'version': '10.0.1.1.4',
|
||||
'category': 'GOLEM',
|
||||
'author': 'Fabien Bourgeois, Michel Dessenne',
|
||||
'license': 'AGPL-3',
|
||||
'application': False,
|
||||
'installable': True,
|
||||
'depends': ['golem_member', 'account', 'decimal_precision'],
|
||||
'data': ['views/golem_membership_invoice.xml',
|
||||
'data': ['data/account_data.xml',
|
||||
'views/golem_membership_invoice.xml',
|
||||
'views/golem_member_view.xml',
|
||||
'report/golem_member_card_templates.xml']
|
||||
}
|
||||
|
42
golem_membership/data/account_data.xml
Normal file
42
golem_membership/data/account_data.xml
Normal file
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
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
|
||||
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 noupdate="1">
|
||||
|
||||
<!-- Base accounts for memberships -->
|
||||
<record id="account_756" model="account.account">
|
||||
<field name="code">756</field>
|
||||
<field name="name">Cotisations des membres</field>
|
||||
<field name="company_id" eval="ref('base.main_company')" />
|
||||
<field name="user_type_id" eval="ref('account.data_account_type_revenue')" />
|
||||
<field name="reconcile" eval="True" />
|
||||
</record>
|
||||
<record id="account_756200" model="account.account">
|
||||
<field name="code">756200</field>
|
||||
<field name="name">Adhésions</field>
|
||||
<field name="company_id" eval="ref('base.main_company')" />
|
||||
<field name="user_type_id" eval="ref('account.data_account_type_revenue')" />
|
||||
<field name="reconcile" eval="True" />
|
||||
</record>
|
||||
<!-- Base Accounting settings call -->
|
||||
<function model="golem.membership.account.config" name="account_settings" />
|
||||
|
||||
</data>
|
||||
</odoo>
|
@ -6,15 +6,14 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-03-08 15:10+0000\n"
|
||||
"PO-Revision-Date: 2018-03-08 15:10+0000\n"
|
||||
"POT-Creation-Date: 2018-07-17 15:27+0000\n"
|
||||
"PO-Revision-Date: 2018-07-17 17:47+0200\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: fr\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.ui.view,arch_db:golem_membership.golem_member_form_inherit_golem_membership
|
||||
@ -26,6 +25,12 @@ msgstr "Payer une cotisation"
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#. module: golem_membership
|
||||
#: code:addons/golem_membership/models/account_config.py:43
|
||||
#, python-format
|
||||
msgid "Check"
|
||||
msgstr "Chèque"
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_create_uid
|
||||
msgid "Created by"
|
||||
@ -36,6 +41,12 @@ msgstr "Créé par"
|
||||
msgid "Created on"
|
||||
msgstr "Créé le"
|
||||
|
||||
#. module: golem_membership
|
||||
#: code:addons/golem_membership/models/account_config.py:48
|
||||
#, python-format
|
||||
msgid "Credit Card"
|
||||
msgstr "Carte bancaire"
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.ui.view,arch_db:golem_membership.golem_member_card_template_inherit_golem_membership
|
||||
msgid "Date from"
|
||||
@ -47,6 +58,7 @@ msgid "Date to"
|
||||
msgstr "Fin"
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_account_config_display_name
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nom affiché"
|
||||
@ -56,12 +68,18 @@ msgstr "Nom affiché"
|
||||
msgid "GOLEM MemberShip invoicing"
|
||||
msgstr "GOLEM : facturation de l'adhésion"
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.model,name:golem_membership.model_golem_membership_account_config
|
||||
msgid "GOLEM Membership Account Configuration"
|
||||
msgstr "GOLEM Membership Account Configuration"
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.ui.view,arch_db:golem_membership.golem_member_search_inherit_golem_membership
|
||||
msgid "Has contributed"
|
||||
msgstr "A cotisé"
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_account_config_id
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
@ -82,6 +100,7 @@ msgid "Join Membership"
|
||||
msgstr "Adhésion"
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_account_config___last_update
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice___last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Dernière Modification le"
|
||||
@ -142,3 +161,4 @@ msgstr "État"
|
||||
#: model:ir.ui.view,arch_db:golem_membership.golem_membership_invoice_form
|
||||
msgid "or"
|
||||
msgstr "ou"
|
||||
|
||||
|
@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-03-08 15:09+0000\n"
|
||||
"PO-Revision-Date: 2018-03-08 15:09+0000\n"
|
||||
"POT-Creation-Date: 2018-07-17 15:27+0000\n"
|
||||
"PO-Revision-Date: 2018-07-17 15:27+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -25,6 +25,12 @@ msgstr ""
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_membership
|
||||
#: code:addons/golem_membership/models/account_config.py:43
|
||||
#, python-format
|
||||
msgid "Check"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_create_uid
|
||||
msgid "Created by"
|
||||
@ -35,6 +41,12 @@ msgstr ""
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_membership
|
||||
#: code:addons/golem_membership/models/account_config.py:48
|
||||
#, python-format
|
||||
msgid "Credit Card"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.ui.view,arch_db:golem_membership.golem_member_card_template_inherit_golem_membership
|
||||
msgid "Date from"
|
||||
@ -46,6 +58,7 @@ msgid "Date to"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_account_config_display_name
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
@ -55,12 +68,18 @@ msgstr ""
|
||||
msgid "GOLEM MemberShip invoicing"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.model,name:golem_membership.model_golem_membership_account_config
|
||||
msgid "GOLEM Membership Account Configuration"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.ui.view,arch_db:golem_membership.golem_member_search_inherit_golem_membership
|
||||
msgid "Has contributed"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_account_config_id
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
@ -81,6 +100,7 @@ msgid "Join Membership"
|
||||
msgstr ""
|
||||
|
||||
#. module: golem_membership
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_account_config___last_update
|
||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice___last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
|
||||
# Copyright 2016-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,4 +15,4 @@
|
||||
# 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_membership
|
||||
from . import golem_membership, account_config
|
||||
|
55
golem_membership/models/account_config.py
Normal file
55
golem_membership/models/account_config.py
Normal file
@ -0,0 +1,55 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# 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 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/>.
|
||||
|
||||
""" Base Account membership configuration for GOLEM """
|
||||
|
||||
from odoo import models, api, _
|
||||
|
||||
|
||||
class AccountConfig(models.AbstractModel):
|
||||
""" GOLEM Membership Account Configuration """
|
||||
_name = 'golem.membership.account.config'
|
||||
_description = 'GOLEM Membership Account Configuration'
|
||||
|
||||
@api.model
|
||||
def account_settings(self):
|
||||
""" Please use better default taxes and account.journal config """
|
||||
account_conf_obj = self.env['account.config.settings']
|
||||
data = {'company_id': self.env.ref('base.main_company').id}
|
||||
account_conf = account_conf_obj.create(data)
|
||||
account_conf.update({
|
||||
'default_sale_tax_id': self.env.ref('l10n_fr.tva_0').id,
|
||||
'default_purchase_tax_id': self.env.ref('l10n_fr.tva_acq_normale').id
|
||||
})
|
||||
account_conf.execute()
|
||||
|
||||
journal_obj = self.env['account.journal']
|
||||
bank_journal = journal_obj.search([('type', '=', 'bank')], limit=1)
|
||||
chk_journal = journal_obj.search([('code', '=', 'CHK')])
|
||||
if not chk_journal:
|
||||
journal_obj.create({
|
||||
'name': _('Check'), 'code': 'CHK', 'type': 'bank',
|
||||
'default_debit_account_id': bank_journal.default_debit_account_id.id,
|
||||
'default_credit_account_id': bank_journal.default_credit_account_id.id
|
||||
})
|
||||
ccard_journal = journal_obj.search([('code', '=', 'CCARD')])
|
||||
if not ccard_journal:
|
||||
journal_obj.create({
|
||||
'name': _('Credit Card'), 'code': 'CCARD', 'type': 'bank',
|
||||
'default_debit_account_id': bank_journal.default_debit_account_id.id,
|
||||
'default_credit_account_id': bank_journal.default_credit_account_id.id
|
||||
})
|
Loading…
Reference in New Issue
Block a user