bzr revid: fp@tinyerp.com-20100407095552-eup9pab6ib0aj50o
This commit is contained in:
Fabien Pinckaers 2010-04-07 11:55:52 +02:00
commit e6bc0035f4
5 changed files with 35 additions and 23 deletions

View File

@ -34,7 +34,7 @@ This module implements a dashboard for CRM that includes:
* Jobs Tracking (graph)
""",
'author': 'Tiny',
'depends': ['board', 'crm', 'report_crm'],
'depends': ['board', 'crm'],
'update_xml': ['board_crm_statistical_view.xml', 'board_crm_view.xml'],
'demo_xml': ['board_crm_demo.xml'],
'installable': True,

View File

@ -27,6 +27,15 @@ class event_registration_list(osv.osv_memory):
_description = "List Event Registrations"
def open_registration(self, cr, uid, ids, context={}):
if not context.get('active_id', None):
return {
'name': 'Event Registrations',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'event.registration',
'type': 'ir.actions.act_window'
}
cr.execute('SELECT section_id FROM event_event WHERE id = %s', (context['active_id'],))
res = cr.fetchone()
return {
@ -40,4 +49,4 @@ class event_registration_list(osv.osv_memory):
event_registration_list()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -18,13 +18,15 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import base64
import time
import datetime
import base64
from osv import osv, fields
from tools.translate import _
class l10n_be_vat_declaration(osv.osv_memory):
""" Periodical VAT Declaration """
""" Vat Declaration """
_name = "l1on_be.vat.declaration"
_description = "Vat Declaration"
@ -39,7 +41,7 @@ class l10n_be_vat_declaration(osv.osv_memory):
_defaults = {
'msg': lambda *a:'''Save the File with '".xml"' extension.''',
}
}
def create_xml(self, cr, uid, ids, context={}):
obj_fyear = self.pool.get('account.fiscalyear')
@ -54,7 +56,7 @@ class l10n_be_vat_declaration(osv.osv_memory):
user_cmpny = obj_company.name
vat_no=obj_company.partner_id.vat
if not vat_no:
raise osv.except_osv(_('Data Insufficient'),_('No VAT Number Associated with Main Company!'))
raise wizard.except_wizard(_('Data Insufficient'),_('No VAT Number Associated with Main Company!'))
tax_code_ids = obj_tax_code.search(cr, uid, [], context=context)
ctx = context.copy()
@ -63,7 +65,9 @@ class l10n_be_vat_declaration(osv.osv_memory):
tax_info = obj_tax_code.read(cr, uid, tax_code_ids, ['code','sum_period'], context=ctx)
address = post_code = city = country_code = ''
city, post_code, address, country_code = obj_comp._get_default_ad(obj_company.partner_id.address)
city, post_code, address, country_code = pooler.get_pool(cr.dbname).get('res.company')._get_default_ad(obj_company.partner_id.address)
year_id = obj_fyear.find(cr, uid)
account_period = obj_acc_period.browse(cr, uid, data['period_id'], context=context)
@ -81,25 +85,24 @@ class l10n_be_vat_declaration(osv.osv_memory):
#starting month and ending month of selected period are not the same
#it means that the accounting isn't based on periods of 1 month but on quarters
quarter = str(((int(starting_month) - 1) / 3) + 1)
data_of_file += '<QUARTER>' + quarter + '</QUARTER>\n\t\t\t'
data_of_file += '<QUARTER>'+quarter+'</QUARTER>\n\t\t\t'
else:
data_of_file += '<MONTH>' + starting_month + '</MONTH>\n\t\t\t'
data_of_file += '<MONTH>'+starting_month+'</MONTH>\n\t\t\t'
data_of_file += '<YEAR>' + str(account_period.date_stop[:4]) + '</YEAR>\n\t\t</DPERIODE>\n\t\t<ASK RESTITUTION="NO" PAYMENT="NO"/>'
data_of_file += '\n\t\t<ClientListingNihil>'+ (data['form']['client_nihil'] and 'YES' or 'NO') +'</ClientListingNihil>'
data_of_file +='\n\t\t<DATA>\n\t\t\t<DATA_ELEM>'
for item in tax_info:
if item['code']:
if item['code'] == '71-72':
item['code'] = '71'
item['code']='71'
if item['code'] in list_of_tags:
data_of_file +='\n\t\t\t\t<D'+str(int(item['code'])) +'>' + str(abs(int(item['sum_period']*100))) + '</D'+str(int(item['code'])) +'>'
data_of_file +='\n\t\t\t</DATA_ELEM>\n\t\t</DATA>\n\t</VATRECORD>\n</VATSENDING>'
data['file_save'] = base64.encodestring(data_of_file)
self.write(cr, uid, ids, {'file_save':data['file_save']}, context=context)
return True
l10n_be_vat_declaration()

View File

@ -3,9 +3,9 @@
<data>
<menuitem
id="menu_finance_belgian_statement"
name="Belgium Statements"
parent="account.menu_finance_legal_statement"/>
id="menu_finance_belgian_statement"
name="Belgium Statements"
parent="account.menu_finance_legal_statement"/>
<record id="view_vat_declaration" model="ir.ui.view">
<field name="name">Select Period</field>
@ -13,12 +13,12 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Select Period">
<group colspan="4" >
<field name="period_id" select="1" default_focus="1"/>
<field name="ask_resitution"/>
<field name="ask_payment"/>
<field name="client_nihil"/>
<button colspan="1" name="create_xml" string="Create XML" type="object" icon="gtk-execute"/>
<group colspan="4" >
<field name="period_id" select="1"/>
<field name="ask_resitution"/>
<field name="ask_payment"/>
<field name="client_nihil"/>
<button colspan="1" name="create_xml" string="Create XML" type="object" default_focus="1"/>
</group>
<separator string="XML Flie has been Created." colspan="4"/>
<group colspan="4" >

View File

@ -152,9 +152,9 @@ class account_invoice(osv.osv):
## @parma date_invoice date of the invoice
## @parma payment_term inoice payment term
## @param partner_bank_id the partner linked invoice bank
## @return the dict of values with the partner_bank value updated
## @return the dict of values with the partner_bank value updated
def onchange_partner_id(self, cr, uid, ids, type, partner_id,
date_invoice=False, payment_term=False, partner_bank_id=False):
date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
""" Function that is call when the partner of the invoice is changed
it will retriev and set the good bank partner bank"""
res = super(account_invoice, self).onchange_partner_id(