Browse Source

divers

master
root 3 years ago
parent
commit
fa176969e8
8 changed files with 32 additions and 169 deletions
  1. +4
    -7
      __manifest__.py
  2. +2
    -27
      controllers/controllers.py
  3. +0
    -25
      data/data.xml
  4. +0
    -1
      models/__init__.py
  5. +0
    -70
      models/address.py
  6. +1
    -1
      views/donation_tax_receipt.xml
  7. +22
    -37
      views/partner.xml
  8. +3
    -1
      views/payment_batch.xml

+ 4
- 7
__manifest__.py View File

@ -3,14 +3,13 @@
'name': "opendons",
'summary': """
Short (1 phrase/line) summary of the module's purpose, used as
subtitle on modules listing or apps.openerp.com""",
Donation management module""",
'description': """
Long description of module's purpose
Donation management module
""",
'author': "My Company",
'author': "COM&SENS DATA",
'website': "http://www.yourcompany.com",
# Categories can be used to filter modules in modules listing
@ -35,11 +34,9 @@
'views/product.xml',
'views/recurring_donation.xml',
'data/recurring_donation_configuration.xml',
'data/data.xml',
'views/relationship.xml',
'views/operation.xml',
'views/templates.xml',
#'views/mail_mail.xml',
'views/returnmail.xml',
'views/bank_deposit.xml',
'views/accounting_deposit.xml',
@ -68,7 +65,7 @@
'views/partner.xml'
#'views/website_donation.xml'
],


+ 2
- 27
controllers/controllers.py View File

@ -15,13 +15,7 @@ class opendons(http.Controller):
field_list=request.env[model].sudo().fields_get()
objet=request.env[model].search([('id','=',int(id))])
# result=[]
# for key in field_list:
# result.append((key,str(objet[key])))
# result.sort()
# return json.dumps(result)
result=""
for key in field_list:
result=result+str(key)+':'+str(objet[key])+'<br>'
@ -41,7 +35,7 @@ class SalesProduct(WebsiteSale):
def cart_update(self, product_id, add_qty=1, set_qty=0, **kw):
"""This route is called when adding a product to cart (no options)."""
#return kw.get('donation_amount')
sale_order = request.website.sale_get_order(force_create=True)
if sale_order.state != 'draft':
@ -75,22 +69,3 @@ class SalesProduct(WebsiteSale):
return request.redirect("/shop/cart")
# class DonationQualifier(http.Controller):
# @http.route('/donation_qualifier/donation_qualifier/', auth='public')
# def index(self, **kw):
# return "Hello, world"
# @http.route('/donation_qualifier/donation_qualifier/objects/', auth='public')
# def list(self, **kw):
# return http.request.render('donation_qualifier.listing', {
# 'root': '/donation_qualifier/donation_qualifier',
# 'objects': http.request.env['donation_qualifier.donation_qualifier'].search([]),
# })
# @http.route('/donation_qualifier/donation_qualifier/objects/<model("donation_qualifier.donation_qualifier"):obj>/', auth='public')
# def object(self, obj, **kw):
# return http.request.render('donation_qualifier.object', {
# 'object': obj
# })

+ 0
- 25
data/data.xml View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!-- <record id="opendons_type_template_rf1" model="opendons.type_template_rf">
<field name="name">generic</field>
</record>
<record id="opendons_type_template_rf2" model="opendons.type_template_rf">
<field name="name">affectation</field>
</record>
<record id="opendons_type_template_rf3" model="opendons.type_template_rf">
<field name="name">high amount</field>
</record> -->
<record id="opendons_type_donation_thanks_template1" model="opendons.type_donation_thanks_template">
<field name="name">generic</field>
</record>
<record id="opendons_type_donation_thanks_template2" model="opendons.type_donation_thanks_template">
<field name="name">affectation</field>
</record>
<record id="opendons_type_donation_thanks_template3" model="opendons.type_donation_thanks_template">
<field name="name">high amount</field>
</record>
</odoo>

+ 0
- 1
models/__init__.py View File

@ -24,7 +24,6 @@ from . import settings
from . import donation_recurring_template_letter
from . import donation_thanks_template
from . import partner_import
#from . import res_partner_bank
from .import donation_print_email_history
from .import bank_deposit
from .import accounting_deposit

+ 0
- 70
models/address.py View File

@ -1,70 +0,0 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api
from odoo.exceptions import UserError, ValidationError
from psycopg2 import sql, DatabaseError
from odoo.tools.safe_eval import safe_eval, datetime
from werkzeug import utils
class opendons_partneraddress(models.Model):
_name = 'opendons.partneraddress'
_description = 'adresses du contact'
_inherit = ['mail.thread']
#Complément d’identification du destinataire ou point de remise à l’intérieur du bâtiment : N° appartement, boite aux lettres, étage, couloir
complement_ident = fields.Char(string='N° appartment,floor',track_visibility='always')
#Complément d’identification du point géographique – extérieur du bâtiment : entrée, tour, bâtiment, immeuble, résidence
complement_geo = fields.Char(string='entry,tower,bat',track_visibility='always')
#Numéro et libellé de la voie
street1 = fields.Char(string='street1', track_visibility='always')
#Lieu dit ou service particulier de distribution – Poste restante, boite postale, etc.
street2 = fields.Char(string='street2',track_visibility='always')
#Code postal
postalcode = fields.Char(string='Postal code',track_visibility='always')
#Ville
city = fields.Char(string='City', track_visibility='always')
#Pays
country = fields.Char(string='Country', track_visibility='always')
#Compteur NPAI
npai=fields.Integer(readonly=True,string='NPAI counter',default=0,track_visibility='always')
#active
active=fields.Boolean(string='active',default=False,track_visibility='always')
date_inactive=fields.Date(readonly=True,string='Date inactive',track_visibility='always')
partner_id = fields.Many2one(
'res.partner',
string='partner',
required=True,
index=True,
readonly=True,
track_visibility='onchange',
ondelete='restrict'
)
def write(self,vals):
date_active=False
date_inactive=False
for val in vals:
if val=='active' and not vals['active']:
date_inactive=fields.Date.context_today(self)
if val=='active' and vals['active']:
date_inactive=False
date_active=fields.Date.context_today(self)
vals['date_inactive']=date_inactive
vals['date_active']=date_active
res = super(opendons_partneraddress, self).write(vals)
#Your code goes here
return res

+ 1
- 1
views/donation_tax_receipt.xml View File

@ -9,7 +9,7 @@
<field name="inherit_id" ref="donation_base.donation_tax_receipt_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='company_id']" position="after">
<field name="PDF"/>
<field name="pdf_file"/>
<field name="template_rf_id"/>
<field name="html_content_print"/>


+ 22
- 37
views/partner.xml View File

@ -248,18 +248,6 @@
<span>Bool Qualifiers</span>
</button>
<!-- <button class="oe_stat_button" type="action"
name="%(act_partner_email)d"
icon="fa-envelope">
<field string="Email" name="email_count" widget="statinfo"/>
</button>
<button class="oe_stat_button" type="action"
name="%(act_partner_phone)d"
icon="fa-phone">
<field string="Phone" name="phone_count" widget="statinfo"/>
</button> -->
<button class="oe_stat_button" type="action"
name="%(act_partner_relationship)d"
@ -293,32 +281,29 @@
</xpath>
<xpath expr="/form/sheet/div/h1" position="replace">
<group>
<group>
<field name="donor_id"/>
<field name="title" options="{&quot;no_open&quot;: True}" placeholder="" attrs="{'invisible': [('is_company', '=', True)],'required' : [('is_company', '=', False)]}"/>
<field id="individual" class="o_text_overflow" name="name" default_focus="1" placeholder="" attrs="{'required' : [('is_company', '=', False)], 'invisible': [('is_company','=', True)]}"/>
<field name="firstname" attrs="{'invisible':[('is_company','=',True)],'required' : [('is_company', '=', False)]}"/>
<field id="company" class="o_text_overflow" name="name" string="Raison sociale" default_focus="1" placeholder="" attrs="{'required' : [('is_company', '=', True)], 'invisible': [('is_company','=', False)]}"/>
<!-- <field name="source"/> -->
<!-- <field name="company_id"/> -->
<field name="parent_id" string="Company Name"
widget="res_partner_many2one"
placeholder="Company Name..."
domain="[('is_company', '=', True)]" context="{'default_is_company': True, 'show_vat': True}"
attrs="{'invisible': ['|', '&amp;', ('is_company','=', True),('parent_id', '=', False),('company_name', '!=', False),('company_name', '!=', '')]}"/>
<field name="company_name" attrs="{'invisible': ['|', '|', ('company_name', '=', False), ('company_name', '=', ''), ('is_company', '=', True)]}"/>
<button name="create_company" icon="fa-plus-square" string="Create company"
type="object" class="oe_edit_only btn-link"
attrs="{'invisible': ['|', '|', ('is_company','=', True), ('company_name', '=', ''), ('company_name', '=', False)]}"/>
<group col="4">
<group col="2">
<field name="donor_id"/>
<field name="title" options="{&quot;no_open&quot;: True}" placeholder="" attrs="{'invisible': [('is_company', '=', True)],'required' : [('is_company', '=', False)]}"/>
<field id="individual" class="o_text_overflow" name="name" default_focus="1" placeholder="" attrs="{'required' : [('is_company', '=', False)], 'invisible': [('is_company','=', True)]}"/>
<field name="firstname" attrs="{'invisible':[('is_company','=',True)],'required' : [('is_company', '=', False)]}"/>
<field id="company" class="o_text_overflow" name="name" string="Raison sociale" default_focus="1" placeholder="" attrs="{'required' : [('is_company', '=', True)], 'invisible': [('is_company','=', False)]}"/>
</group>
<group>
<field name="parent_id" string="Company Name"
widget="res_partner_many2one"
placeholder="Company Name..."
domain="[('is_company', '=', True)]" context="{'default_is_company': True, 'show_vat': True}"
attrs="{'invisible': ['|', '&amp;', ('is_company','=', True),('parent_id', '=', False),('company_name', '!=', False),('company_name', '!=', '')]}"/>
<field name="company_name" attrs="{'invisible': ['|', '|', ('company_name', '=', False), ('company_name', '=', ''), ('is_company', '=', True)]}"/>
<button name="create_company" icon="fa-plus-square" string="Create company"
type="object" class="oe_edit_only btn-link"
attrs="{'invisible': ['|', '|', ('is_company','=', True), ('company_name', '=', ''), ('company_name', '=', False)]}"/>
</group>
<group col="2">
</group>
<group col="2">
<field name="first_donation_product_id"/>
<field name="first_donation_date"/>
<field name="max_amount_donation"/>


+ 3
- 1
views/payment_batch.xml View File

@ -37,7 +37,8 @@
statusbar_visible="draft,validated,deposited_in_bank,deposited_in_accounting"/>
</header>
<sheet>
<group name="payment_batch">
<group col="4">
<group name="payment_batch" col="2">
<field name="create_date"/>
<field name="create_uid"/>
@ -57,6 +58,7 @@
<field name="company_id" invisible="1"/>
</group>
</group>
<notebook>
<page string="Donation Lines" name="lines">


Loading…
Cancel
Save