Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparing a big reorganisation of the code for v9 #22

Closed
alexis-via opened this issue Jul 21, 2016 · 13 comments
Closed

Preparing a big reorganisation of the code for v9 #22

alexis-via opened this issue Jul 21, 2016 · 13 comments

Comments

@alexis-via
Copy link
Contributor

For v9, I'm preparing a big re-organisation of the code of the donation project. Let me explain the idea and what I plan to do.

Main idea

The donation module is based on dedicated objects donation and donation.line ; so a donation is not related to a sale order nor an invoice. There are several advantages for this approach:

  • the user can encode both the donation and the related payment in a single form, so it's fast and easy.
  • we can generate an accounting entry that go directly from the bank account to the revenue account, without going through a receivable account, which reduces the number of accounting entries and avoids reconciliation.
  • the donation module only depends on the account module

In one of my new projects, I need to support:

  • online donation paid by credit card
  • mix of regular products (T-shirt, with VAT) and donations in the same order ; the whole order is paid by a single credit card transaction

For this, I need to support donations inside a sale.order (for the online shop, the basket is a draft sale.order in Odoo). So it is quite different from the current implementation and it's not easy to have those 2 implementations "compatible".

In fact, I think it is the same kind of problem between the "sale" module that provide the sale.order/sale.order.line objects and the "point_of_sale" module that provide the pos.order/pos.order.line objects. The sale.order and pos.order objects are technically independant but they are both related to the sale of goods to a customer. Why did the point_of_sale module created a dedicated object "pos.order" instead of using the "sale.order" object ? I guess it was for simplicity reasons: they wanted to have an object that could handle sale+payment+delivery at the same time (whereas the sale.order object only handles the sale and doesn't directly handle the payment and delivery).

So I plan to make this project evolve to the same kind of approach:

  1. First solution: the donation/donation.line objects will be used when you have donation+payment at the same time (equivalent to the "point_of_sale"), because it is very simple and we can have a journal item that go directly from the bank account to the revenue account (no reconciliation because we don't use a receivable account).
  2. Second solution: the sale.order/sale.order.line object will be used when you have a mix of products and donations in the same transaction and/or when you want to have donations in an online shop. In this solution, an invoice is generated so there are 2 journal items: one from the receivable account to the income account and a second one from the bank account to the receivable account and it require a reconciliation in the receivable account.
    You should be able to use only the first solution or only the second solution... or use both ! But, if you use both, you will still have the constraints linked to the fact that donation.line and sale.order.line are different objects. The main difficulty will be to be able to handle annual tax receipts in the scenario where you use the 2 solutions.

Proposed implementation

So here are my plans for the code base of this project for v9:

  • create a new module "donation_base" that will have the properties on the product object
  • create a new module "donation_sale" that will depend on donation_base
  • the "donation" module will depend on "donation_base"

I know that this change will introduce more modules and more complexity and I don't want to make this project too complex, so I propose the following simplification: the handling of tax receipts will not be handled in a separate module any more ; the handling of tax receipts will be made in the base module (the donation.tax.receipt object will be defined in the donation_base module). For associations that receive donations but are not allowed to generate tax receipts, the drawback is that they will have menu entries and object fields that they don't need ; so I plan to create a group "Donation Tax Receipt" and you will have to be in that group to see all tax-receipt related info (just like the group "Analytic Accounting").

Please give your feedback on this new idea NOW, because I'm starting the development on this new implementation tomorrow ! :)

@NL66278
Copy link

NL66278 commented Jul 21, 2016

👍 Seems a good plan to me!

@rvalyi
Copy link
Member

rvalyi commented Jul 21, 2016

👍 LGTM; quite discussed internally already

@brother-bernard
Copy link
Contributor

👍 No problem for us

alexis-via added a commit to akretion/donation that referenced this issue Jul 22, 2016
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
@qtheuret
Copy link

Will it be possible to have a mix between solution 1) and solution 2) ? I mean one donation with donation.line that doesn't generate account entries and without need to create a sale.order entry ?

Otherwise, LGTM. 👍

@alexis-via
Copy link
Contributor Author

@qtheuret I didn't understand your point. Could you explain it in more details ?

@qtheuret
Copy link

qtheuret commented Jul 29, 2016

@alexis-via Here is a scenario where the donation are paid by bank transfert :

  • The donator makes a bank transferst from his bank account to our bank account
  • He sends an e-mail to us with his name and address
  • We record a donation
  • We validate the donation but we don't want generation of account entries from the bank account at this moment. We need generation of account entries like account entries created by a sale.order (Debit in third party account and credit in product account).
  • When we receive our bank statement, we create a bank statement on Odoo and it's during bank statement reconciliation that the account entries from the bank acount should be created.

I don't know if it's possible with your future solution. With the current module, we have to create a new account journal named 'Bank transfert donations' to do this. Will this behavior expected on your future work ?

@alexis-via
Copy link
Contributor Author

alexis-via commented Jul 29, 2016

@qtheuret Donation via bank transfer are supported via the module "donation_bank_statement", but it doesn't work like you describe it. Here is how it works:

  • The donator makes a bank transferst from his bank account to our bank account
  • When we receive the money on our bank account, we import the bank statement
  • on the credit bank statement line that correspond to the donation, we identify the donator and we send the amount to a special transfer account
  • we close the bank statement
  • on the closed bank statement, there is a button to create the donations => donations are automatically created as draft
  • when we confirm the draft donations, it makes an accounting entry from special transfer accout to the revenue account and makes the reconciliation in the transfer account.

This process works very well in production in v8 and I ported it to v9 and it works the same way in v9.

@qtheuret
Copy link

Thanks @alexis-via for your reply. I'll try this behavior and our steps to manage this kind of donation.

alexis-via added a commit to akretion/donation that referenced this issue Nov 16, 2016
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
@vonpupp
Copy link

vonpupp commented Mar 14, 2017

Hello,

Congratulations on the initiative. I am newbie to Odoo but I would love to help if there is anything I can do. I am a volunteer at an NGO and we really need recurrent donations with credit card in some way on v10.

I think it would be nice to be able to allow only donations also via webshop (credit cards). Perhaps a new type of "product" would be a good approach, similar to the membership modules of vertical-association. It is also worth noticing the website_sale_donate module which is very specific but some ideas are very nice IMHO.

@brother-bernard
Copy link
Contributor

brother-bernard commented Mar 14, 2017 via email

@alexis-via
Copy link
Contributor Author

This new organisation has been implemented in v9 last year and later ported to v10, so I close this ticket.

@rafaelbn
Copy link
Member

rafaelbn commented Oct 9, 2018

@alexis-via please, are you using the Odoo ecommerce for this?

online donation paid by credit card

I don't see any link between SO an donation

We are testing this modules to see if we use them for our customer

Thanks

@alexis-via
Copy link
Contributor Author

@rafaelbn No, I use a better technology than Odoo ecommerce for this: ShopInvader! :)

If you look at the module donation_sale, you will see a link between SO and donation. The module donation_sale is an "alternative" to the donation module.

nikul-serpentcs pushed a commit to nikul-serpentcs/donation that referenced this issue Oct 10, 2018
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
nikul-serpentcs pushed a commit to nikul-serpentcs/donation that referenced this issue Oct 11, 2018
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
nikul-serpentcs pushed a commit to nikul-serpentcs/donation that referenced this issue Oct 24, 2018
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
nikul-serpentcs pushed a commit to nikul-serpentcs/donation that referenced this issue Sep 30, 2019
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
nikul-serpentcs pushed a commit to nikul-serpentcs/donation that referenced this issue Sep 30, 2019
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
nikul-serpentcs pushed a commit to nikul-serpentcs/donation that referenced this issue Sep 30, 2019
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
jarroyomorales pushed a commit to tegin/donation that referenced this issue Mar 12, 2020
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
jarroyomorales pushed a commit to tegin/donation that referenced this issue Mar 12, 2020
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
nikul-serpentcs pushed a commit to nikul-serpentcs/donation that referenced this issue Apr 27, 2020
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
nikul-serpentcs pushed a commit to nikul-serpentcs/donation that referenced this issue Apr 27, 2020
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
nikul-serpentcs pushed a commit to nikul-serpentcs/donation that referenced this issue Apr 27, 2020
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
jarroyomorales pushed a commit to tegin/donation that referenced this issue Jul 21, 2020
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
jarroyomorales pushed a commit to tegin/donation that referenced this issue Jul 21, 2020
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
albariera pushed a commit to tegin/donation that referenced this issue Feb 22, 2021
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
albariera pushed a commit to tegin/donation that referenced this issue Jun 22, 2021
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
albariera pushed a commit to tegin/donation that referenced this issue Jun 22, 2021
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
albariera pushed a commit to tegin/donation that referenced this issue Jun 23, 2021
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
albariera pushed a commit to tegin/donation that referenced this issue Jul 15, 2021
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
alexis-via added a commit to akretion/donation that referenced this issue Aug 8, 2021
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
alexis-via added a commit to akretion/donation that referenced this issue Aug 11, 2021
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
alexis-via added a commit to akretion/donation that referenced this issue Aug 12, 2021
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
alexis-via added a commit to akretion/donation that referenced this issue Oct 23, 2021
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
alexis-via added a commit to akretion/donation that referenced this issue Oct 23, 2021
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
kluna1998 pushed a commit to tegin/donation that referenced this issue Sep 6, 2022
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
alexis-via added a commit to akretion/donation that referenced this issue Feb 28, 2023
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
alexis-via added a commit to akretion/donation that referenced this issue Mar 1, 2023
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
alexis-via added a commit to akretion/donation that referenced this issue Mar 1, 2023
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
alexis-via added a commit to akretion/donation that referenced this issue Mar 17, 2023
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
alexis-via added a commit to akretion/donation that referenced this issue Apr 21, 2023
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
esteveblanch pushed a commit to esteveblanch/donation that referenced this issue Aug 15, 2024
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
esteveblanch pushed a commit to esteveblanch/donation that referenced this issue Aug 15, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants