Skip to content

Commit

Permalink
Start the update to new architecture explained in issue OCA#22
Browse files Browse the repository at this point in the history
Move from YAML tests to unittest in most modules
Use commercial_partner_id for tax receipts (to group tax receipts for a company or a familly)
On donation.line, tax_receipt_ok and in_kind are now related stored fields
  • Loading branch information
alexis-via authored and nikul-serpentcs committed Oct 11, 2018
1 parent 7e3870c commit 44e2a91
Show file tree
Hide file tree
Showing 28 changed files with 690 additions and 712 deletions.
19 changes: 15 additions & 4 deletions donation/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

========
Donation
========

Expand All @@ -19,6 +24,10 @@ To use this module, go to the menu Donations > Donations and start to register n

To have some statistics about the donations, go to the menu Reporting > Donations > Donations Analysis.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/180/9.0

Credits
=======

Expand All @@ -32,12 +41,14 @@ Contributors
Maintainer
----------

.. image:: http://odoo-community.org/logo.png
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.
To contribute to this module, please visit https://odoo-community.org.
5 changes: 2 additions & 3 deletions donation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-

from . import donation_campaign
from . import donation
from . import product
from . import models
from . import report
from . import wizard
from .post_install import update_account_journal
43 changes: 12 additions & 31 deletions donation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,29 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Donation module for Odoo
# Copyright (C) 2014-2015 Barroux Abbey (www.barroux.org)
# Copyright (C) 2014-2015 Akretion France (www.akretion.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/>.
#
##############################################################################

# © 2014-2016 Barroux Abbey (http://www.barroux.org)
# © 2014-2016 Akretion France (Alexis de Lattre <[email protected]>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': 'Donation',
'version': '9.0.0.1.0',
'version': '9.0.1.0.0',
'category': 'Accounting & Finance',
'license': 'AGPL-3',
'summary': 'Manage donations',
'author': 'Barroux Abbey, Akretion, Odoo Community Association (OCA)',
'website': 'http://www.barroux.org',
'depends': ['account_accountant'],
'depends': ['donation_base'],
'data': [
'security/donation_security.xml',
'donation_view.xml',
'account_view.xml',
'product_view.xml',
'donation_campaign_view.xml',
'users_view.xml',
'views/donation.xml',
'views/account.xml',
'views/donation_campaign.xml',
'views/users.xml',
'views/partner.xml',
'security/ir.model.access.csv',
'partner_view.xml',
'report/donation_report_view.xml',
'wizard/donation_validate_view.xml',
],
'demo': ['donation_demo.xml'],
'test': ['test/validate.yml'],
'post_init_hook': 'update_account_journal',
'demo': ['demo/donation_demo.xml'],
'installable': True,
}
130 changes: 130 additions & 0 deletions donation/demo/donation_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?>

<odoo>
<data noupdate="1">


<record id="quest_origin" model="donation.campaign">
<field name="name">Quest</field>
</record>

<record id="prospecting_origin" model="donation.campaign">
<field name="name">Prospecting</field>
</record>

<record id="catalog_origin" model="donation.campaign">
<field name="name">Catalog</field>
</record>

<record id="donation1" model="donation.donation">
<field name="currency_id" ref="base.EUR"/>
<field name="check_total">100</field>
<field name="partner_id" ref="donation_base.donor1"/>
<field name="donation_date" eval="time.strftime('%Y-%m-01')"/>
<field name="journal_id" model="account.journal"
search="[('type', '=', 'bank')]"/>
<field name="payment_ref">CHQ BNP 239023</field>
<field name="campaign_id" ref="prospecting_origin"/>
<field name="tax_receipt_option">each</field>
</record>

<record id="donation1_l1" model="donation.line">
<field name="donation_id" ref="donation1"/>
<field name="product_id" ref="donation_base.product_product_donation"/>
<field name="quantity">1</field>
<field name="unit_price">100</field>
</record>

<record id="donation2" model="donation.donation">
<field name="currency_id" ref="base.EUR"/>
<field name="check_total">120</field>
<field name="partner_id" ref="donation_base.donor2"/>
<field name="donation_date" eval="time.strftime('%Y-%m-01')"/>
<field name="journal_id" model="account.journal"
search="[('type', '=', 'bank')]"/>
<field name="payment_ref"></field>
<field name="campaign_id" ref="quest_origin"/>
<field name="tax_receipt_option">annual</field>
</record>

<record id="donation2_l1" model="donation.line">
<field name="donation_id" ref="donation2"/>
<field name="product_id" ref="donation_base.product_product_donation"/>
<field name="quantity">1</field>
<field name="unit_price">120</field>
</record>

<record id="donation3" model="donation.donation">
<field name="currency_id" ref="base.USD"/>
<field name="check_total">150</field>
<field name="partner_id" ref="donation_base.donor3"/>
<field name="donation_date" eval="time.strftime('%Y-%m-01')"/>
<field name="journal_id" model="account.journal"
search="[('type', '=', 'cash')]"/>
<field name="payment_ref"></field>
<field name="campaign_id" ref="prospecting_origin"/>
<field name="tax_receipt_option">none</field>
</record>

<record id="donation3_l1" model="donation.line">
<field name="donation_id" ref="donation3"/>
<field name="product_id" ref="donation_base.product_product_donation"/>
<field name="quantity">1</field>
<field name="unit_price">150</field>
</record>

<!-- Full in-kind donation -->
<record id="donation4" model="donation.donation">
<field name="currency_id" ref="base.EUR"/>
<field name="check_total">1000</field>
<field name="partner_id" ref="donation_base.donor1"/>
<field name="donation_date" eval="time.strftime('%Y-%m-01')"/>
<field name="journal_id" model="account.journal"
search="[('type', '=', 'bank')]"/>
<field name="payment_ref"></field>
<field name="campaign_id" ref="prospecting_origin"/>
<field name="tax_receipt_option">each</field>
</record>

<record id="donation4_l1" model="donation.line">
<field name="donation_id" ref="donation4"/>
<field name="product_id" ref="donation_base.product_product_inkind_donation"/>
<field name="quantity">1</field>
<field name="unit_price">1000</field>
<field name="in_kind" eval="True"/>
</record>

<!-- Partial in-kind donation -->
<record id="donation5" model="donation.donation">
<field name="currency_id" ref="base.EUR"/>
<field name="check_total">1200</field>
<field name="partner_id" ref="donation_base.donor1"/>
<field name="donation_date" eval="time.strftime('%Y-%m-01')"/>
<field name="journal_id" model="account.journal"
search="[('type', '=', 'bank')]"/>
<field name="payment_ref"></field>
<field name="campaign_id" ref="prospecting_origin"/>
<field name="tax_receipt_option">each</field>
</record>

<record id="donation5_l1" model="donation.line">
<field name="donation_id" ref="donation5"/>
<field name="product_id" ref="donation_base.product_product_inkind_donation"/>
<field name="quantity">1</field>
<field name="unit_price">800</field>
<field name="in_kind" eval="True"/>
</record>

<record id="donation5_l2" model="donation.line">
<field name="donation_id" ref="donation5"/>
<field name="product_id" ref="donation_base.product_product_donation"/>
<field name="quantity">1</field>
<field name="unit_price">400</field>
</record>

<record id="base.user_demo" model="res.users">
<field name="groups_id" eval="[(4, ref('group_donation_user'))]"/>
</record>

</data>
</odoo>
47 changes: 0 additions & 47 deletions donation/donation_campaign.py

This file was deleted.

Loading

0 comments on commit 44e2a91

Please sign in to comment.