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 -*-
|
# -*- 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
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as
|
# it under the terms of the GNU Affero General Public License as
|
||||||
@ -18,14 +18,15 @@
|
|||||||
{
|
{
|
||||||
'name': 'GOLEM non-profit membership handling',
|
'name': 'GOLEM non-profit membership handling',
|
||||||
'summary': 'Extends Odoo membership',
|
'summary': 'Extends Odoo membership',
|
||||||
'version': '10.0.1.1.3',
|
'version': '10.0.1.1.4',
|
||||||
'category': 'GOLEM',
|
'category': 'GOLEM',
|
||||||
'author': 'Fabien Bourgeois, Michel Dessenne',
|
'author': 'Fabien Bourgeois, Michel Dessenne',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'application': False,
|
'application': False,
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'depends': ['golem_member', 'account', 'decimal_precision'],
|
'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',
|
'views/golem_member_view.xml',
|
||||||
'report/golem_member_card_templates.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 ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 10.0\n"
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-03-08 15:10+0000\n"
|
"POT-Creation-Date: 2018-07-17 15:27+0000\n"
|
||||||
"PO-Revision-Date: 2018-03-08 15:10+0000\n"
|
"PO-Revision-Date: 2018-07-17 17:47+0200\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: \n"
|
"Content-Transfer-Encoding: \n"
|
||||||
"Language: fr\n"
|
"Plural-Forms: \n"
|
||||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
|
||||||
|
|
||||||
#. module: golem_membership
|
#. module: golem_membership
|
||||||
#: model:ir.ui.view,arch_db:golem_membership.golem_member_form_inherit_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"
|
msgid "Cancel"
|
||||||
msgstr "Annuler"
|
msgstr "Annuler"
|
||||||
|
|
||||||
|
#. module: golem_membership
|
||||||
|
#: code:addons/golem_membership/models/account_config.py:43
|
||||||
|
#, python-format
|
||||||
|
msgid "Check"
|
||||||
|
msgstr "Chèque"
|
||||||
|
|
||||||
#. module: golem_membership
|
#. module: golem_membership
|
||||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_create_uid
|
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_create_uid
|
||||||
msgid "Created by"
|
msgid "Created by"
|
||||||
@ -36,6 +41,12 @@ msgstr "Créé par"
|
|||||||
msgid "Created on"
|
msgid "Created on"
|
||||||
msgstr "Créé le"
|
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
|
#. module: golem_membership
|
||||||
#: model:ir.ui.view,arch_db:golem_membership.golem_member_card_template_inherit_golem_membership
|
#: model:ir.ui.view,arch_db:golem_membership.golem_member_card_template_inherit_golem_membership
|
||||||
msgid "Date from"
|
msgid "Date from"
|
||||||
@ -47,6 +58,7 @@ msgid "Date to"
|
|||||||
msgstr "Fin"
|
msgstr "Fin"
|
||||||
|
|
||||||
#. module: golem_membership
|
#. 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
|
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_display_name
|
||||||
msgid "Display Name"
|
msgid "Display Name"
|
||||||
msgstr "Nom affiché"
|
msgstr "Nom affiché"
|
||||||
@ -56,12 +68,18 @@ msgstr "Nom affiché"
|
|||||||
msgid "GOLEM MemberShip invoicing"
|
msgid "GOLEM MemberShip invoicing"
|
||||||
msgstr "GOLEM : facturation de l'adhésion"
|
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
|
#. module: golem_membership
|
||||||
#: model:ir.ui.view,arch_db:golem_membership.golem_member_search_inherit_golem_membership
|
#: model:ir.ui.view,arch_db:golem_membership.golem_member_search_inherit_golem_membership
|
||||||
msgid "Has contributed"
|
msgid "Has contributed"
|
||||||
msgstr "A cotisé"
|
msgstr "A cotisé"
|
||||||
|
|
||||||
#. module: golem_membership
|
#. 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
|
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_id
|
||||||
msgid "ID"
|
msgid "ID"
|
||||||
msgstr "ID"
|
msgstr "ID"
|
||||||
@ -82,6 +100,7 @@ msgid "Join Membership"
|
|||||||
msgstr "Adhésion"
|
msgstr "Adhésion"
|
||||||
|
|
||||||
#. module: golem_membership
|
#. 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
|
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice___last_update
|
||||||
msgid "Last Modified on"
|
msgid "Last Modified on"
|
||||||
msgstr "Dernière Modification le"
|
msgstr "Dernière Modification le"
|
||||||
@ -142,3 +161,4 @@ msgstr "État"
|
|||||||
#: model:ir.ui.view,arch_db:golem_membership.golem_membership_invoice_form
|
#: model:ir.ui.view,arch_db:golem_membership.golem_membership_invoice_form
|
||||||
msgid "or"
|
msgid "or"
|
||||||
msgstr "ou"
|
msgstr "ou"
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 10.0\n"
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-03-08 15:09+0000\n"
|
"POT-Creation-Date: 2018-07-17 15:27+0000\n"
|
||||||
"PO-Revision-Date: 2018-03-08 15:09+0000\n"
|
"PO-Revision-Date: 2018-07-17 15:27+0000\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@ -25,6 +25,12 @@ msgstr ""
|
|||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: golem_membership
|
||||||
|
#: code:addons/golem_membership/models/account_config.py:43
|
||||||
|
#, python-format
|
||||||
|
msgid "Check"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_membership
|
#. module: golem_membership
|
||||||
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_create_uid
|
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_create_uid
|
||||||
msgid "Created by"
|
msgid "Created by"
|
||||||
@ -35,6 +41,12 @@ msgstr ""
|
|||||||
msgid "Created on"
|
msgid "Created on"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: golem_membership
|
||||||
|
#: code:addons/golem_membership/models/account_config.py:48
|
||||||
|
#, python-format
|
||||||
|
msgid "Credit Card"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_membership
|
#. module: golem_membership
|
||||||
#: model:ir.ui.view,arch_db:golem_membership.golem_member_card_template_inherit_golem_membership
|
#: model:ir.ui.view,arch_db:golem_membership.golem_member_card_template_inherit_golem_membership
|
||||||
msgid "Date from"
|
msgid "Date from"
|
||||||
@ -46,6 +58,7 @@ msgid "Date to"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_membership
|
#. 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
|
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_display_name
|
||||||
msgid "Display Name"
|
msgid "Display Name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -55,12 +68,18 @@ msgstr ""
|
|||||||
msgid "GOLEM MemberShip invoicing"
|
msgid "GOLEM MemberShip invoicing"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: golem_membership
|
||||||
|
#: model:ir.model,name:golem_membership.model_golem_membership_account_config
|
||||||
|
msgid "GOLEM Membership Account Configuration"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_membership
|
#. module: golem_membership
|
||||||
#: model:ir.ui.view,arch_db:golem_membership.golem_member_search_inherit_golem_membership
|
#: model:ir.ui.view,arch_db:golem_membership.golem_member_search_inherit_golem_membership
|
||||||
msgid "Has contributed"
|
msgid "Has contributed"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_membership
|
#. 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
|
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice_id
|
||||||
msgid "ID"
|
msgid "ID"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -81,6 +100,7 @@ msgid "Join Membership"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: golem_membership
|
#. 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
|
#: model:ir.model.fields,field_description:golem_membership.field_golem_membership_invoice___last_update
|
||||||
msgid "Last Modified on"
|
msgid "Last Modified on"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as
|
# 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
|
# 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/>.
|
# 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