@ -0,0 +1,14 @@ | |||||
<odoo> | |||||
<record id="opendons_product_template_form_view" model="ir.ui.view"> | |||||
<field name="name">opendons.product.template.form</field> | |||||
<field name="model">product.template</field> | |||||
<field name="inherit_id" ref="product.product_template_form_view" /> | |||||
<field name="arch" type="xml"> | |||||
<xpath expr="//group[@name='payables']" position="after"> | |||||
<group> | |||||
<field name="analytic_account_id"/> | |||||
</group> | |||||
</xpath> | |||||
</field> | |||||
</record> | |||||
</odoo> |
@ -0,0 +1,27 @@ | |||||
from odoo import fields, models, _ | |||||
from datetime import datetime,timedelta,date | |||||
class DonationCancelWizard(models.TransientModel): | |||||
_name = 'opendons.donation_cancel.wizard' | |||||
_description = 'donation cancel wizard' | |||||
cancel_reason=fields.Selection(string='cancel reason',selection=[ | |||||
('debit error','Debit error'), | |||||
('donor error','Donor error'), | |||||
('amount error','Amount error'), | |||||
('invalid check','invalid check'), | |||||
('affectation error','Affectation error'), | |||||
('date error','Date error'), | |||||
('other','Other') | |||||
]) | |||||
donation_id=fields.Integer('donation id') | |||||
def cancelDonation(self): | |||||
donation=self.env['donation.donation'].search([('id','=',self.donation_id)]) | |||||
donation.cancel_reason=self.cancel_reason | |||||
donation.state="cancel" | |||||
donation.partner_id._update_donor_rank() | |||||
if donation.payment_state=='deposited_in_accounting': | |||||
donation.reverse_accounting_entries() |
@ -0,0 +1,18 @@ | |||||
<odoo> | |||||
<record id="donation_cancel_view" model="ir.ui.view"> | |||||
<field name="name">donation.cancel.wizard</field> | |||||
<field name="model">opendons.donation_cancel.wizard</field> | |||||
<field name="arch" type="xml"> | |||||
<form> | |||||
<p>Please select a cancel raison :</p> | |||||
<field name="cancel_reason"/> | |||||
<footer> | |||||
<button name="cancelDonation" string="cancel the donation" type="object"/> | |||||
<button string="Cancel" class="btn btn-secondary" special="cancel" /> | |||||
</footer> | |||||
</form> | |||||
</field> | |||||
</record> | |||||
</odoo> |
@ -0,0 +1,28 @@ | |||||
import datetime | |||||
import logging | |||||
from odoo import _, api, fields, models | |||||
from odoo.exceptions import UserError | |||||
from odoo.tools.misc import format_date | |||||
logger = logging.getLogger(__name__) | |||||
class TaxReceiptAnnualCreate(models.TransientModel): | |||||
_inherit = "tax.receipt.annual.create" | |||||
@api.model | |||||
def _prepare_annual_tax_receipt(self, partner, partner_dict): | |||||
vals = { | |||||
"company_id": self.company_id.id, | |||||
"currency_id": self.company_id.currency_id.id, | |||||
"amount": partner_dict["amount"], | |||||
"type": "annual", | |||||
"partner_id": partner.id, | |||||
"date": self.end_date, | |||||
"donation_date": self.end_date, | |||||
} | |||||
# designed to add add O2M fields donation_ids and invoice_ids | |||||
vals.update(partner_dict["extra_vals"]) | |||||
return vals | |||||