commit
57d36da6f8
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?eclipse-pydev version="1.0"?>
|
||||
|
||||
<pydev_project>
|
||||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.4</pydev_property>
|
||||
</pydev_project>
|
|
@ -50,9 +50,9 @@
|
|||
"account_unit_test.xml",
|
||||
],
|
||||
"update_xml" : [
|
||||
"account_menuitem.xml",
|
||||
"security/account_security.xml",
|
||||
"security/ir.model.access.csv",
|
||||
"account_menuitem.xml",
|
||||
"account_wizard.xml",
|
||||
"account_view.xml",
|
||||
"account_end_fy.xml",
|
||||
|
@ -67,7 +67,7 @@
|
|||
"product_view.xml",
|
||||
"account_assert_test.xml",
|
||||
"process/invoice_process.xml",
|
||||
"process/statement_process.xml"
|
||||
"process/statement_process.xml",
|
||||
],
|
||||
"translations" : {
|
||||
"fr": "i18n/french_fr.csv"
|
||||
|
|
|
@ -281,7 +281,16 @@ class account_account(osv.osv):
|
|||
|
||||
'parent_left': fields.integer('Parent Left', select=1),
|
||||
'parent_right': fields.integer('Parent Right', select=1),
|
||||
'check_history': fields.boolean('Display History', help="Check this box if you want to print all entries when printing the General Ledger, otherwise it will only print its balance.")
|
||||
'currency_mode': fields.selection([('current','At Date'),('average','Average Rate')], 'Outgoing Currencies Rate',
|
||||
help=
|
||||
'This will select how is computed the current currency rate for outgoing transactions. '\
|
||||
'In most countries the legal method is "average" but only a few softwares are able to '\
|
||||
'manage this. So if you import from another software, you may have to use the rate at date. ' \
|
||||
'Incoming transactions, always use the rate at date.', \
|
||||
required=True),
|
||||
'check_history': fields.boolean('Display History',
|
||||
help="Check this box if you want to print all entries when printing the General Ledger, "\
|
||||
"otherwise it will only print its balance.")
|
||||
}
|
||||
|
||||
def _default_company(self, cr, uid, context={}):
|
||||
|
@ -296,6 +305,7 @@ class account_account(osv.osv):
|
|||
'company_id': _default_company,
|
||||
'active': lambda *a: True,
|
||||
'check_history': lambda *a: True,
|
||||
'currency_mode': lambda *a: 'current'
|
||||
}
|
||||
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
|
@ -552,6 +562,17 @@ class account_period(osv.osv):
|
|||
if not ids:
|
||||
raise osv.except_osv(_('Error !'), _('No period defined for this date !\nPlease create a fiscal year.'))
|
||||
return ids
|
||||
|
||||
def action_draft(self, cr, uid, ids, *args):
|
||||
users_roles = self.pool.get('res.users').browse(cr, uid, uid).roles_id
|
||||
for role in users_roles:
|
||||
if role.name=='Period':
|
||||
mode = 'draft'
|
||||
for id in ids:
|
||||
cr.execute('update account_journal_period set state=%s where period_id=%d', (mode, id))
|
||||
cr.execute('update account_period set state=%s where id=%d', (mode, id))
|
||||
return True
|
||||
|
||||
account_period()
|
||||
|
||||
class account_journal_period(osv.osv):
|
||||
|
@ -1032,9 +1053,10 @@ class account_tax_code(osv.osv):
|
|||
|
||||
_name = 'account.tax.code'
|
||||
_description = 'Tax Code'
|
||||
_rec_name = 'code'
|
||||
_columns = {
|
||||
'name': fields.char('Tax Case Name', size=64, required=True),
|
||||
'code': fields.char('Case Code', size=16),
|
||||
'code': fields.char('Case Code', size=64),
|
||||
'info': fields.text('Description'),
|
||||
'sum': fields.function(_sum, method=True, string="Year Sum"),
|
||||
'sum_period': fields.function(_sum_period, method=True, string="Period Sum"),
|
||||
|
@ -1681,9 +1703,10 @@ class account_tax_code_template(osv.osv):
|
|||
_name = 'account.tax.code.template'
|
||||
_description = 'Tax Code Template'
|
||||
_order = 'code'
|
||||
_rec_name = 'code'
|
||||
_columns = {
|
||||
'name': fields.char('Tax Case Name', size=64, required=True),
|
||||
'code': fields.char('Case Code', size=16),
|
||||
'code': fields.char('Case Code', size=64),
|
||||
'info': fields.text('Description'),
|
||||
'parent_id': fields.many2one('account.tax.code.template', 'Parent Code', select=True),
|
||||
'child_ids': fields.one2many('account.tax.code.template', 'parent_id', 'Childs Codes'),
|
||||
|
@ -1734,7 +1757,6 @@ class account_chart_template(osv.osv):
|
|||
'property_account_payable': fields.many2one('account.account.template','Payable Account'),
|
||||
'property_account_expense_categ': fields.many2one('account.account.template','Expense Category Account'),
|
||||
'property_account_income_categ': fields.many2one('account.account.template','Income Category Account'),
|
||||
'property_account_tax': fields.many2one('account.account.template','Default Tax on Partner'),
|
||||
'property_account_expense': fields.many2one('account.account.template','Expense Account on Product Template'),
|
||||
'property_account_income': fields.many2one('account.account.template','Income Account on Product Template'),
|
||||
}
|
||||
|
@ -1917,6 +1939,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
self.pool._init = True
|
||||
|
||||
children_acc_template = obj_acc_template.search(cr, uid, [('parent_id','child_of',[obj_acc_root.id])])
|
||||
children_acc_template.sort()
|
||||
for account_template in obj_acc_template.browse(cr, uid, children_acc_template):
|
||||
tax_ids = []
|
||||
for tax in account_template.tax_ids:
|
||||
|
@ -1928,7 +1951,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
code_acc = account_template.code
|
||||
if code_main<=dig and account_template.type != 'view':
|
||||
code_acc=str(code_acc) + (str('0'*(dig-code_main)))
|
||||
|
||||
vals={
|
||||
'name': (obj_acc_root.id == account_template.id) and obj_multi.company_id.name or account_template.name,
|
||||
#'sign': account_template.sign,
|
||||
|
@ -1945,7 +1967,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
}
|
||||
new_account = obj_acc.create(cr,uid,vals)
|
||||
acc_template_ref[account_template.id] = new_account
|
||||
|
||||
#reactivate the parent_store functionnality on account_account
|
||||
self.pool._init = False
|
||||
self.pool.get('account.account')._parent_store_compute(cr)
|
||||
|
@ -2035,7 +2056,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
('property_account_payable','res.partner','account.account'),
|
||||
('property_account_expense_categ','product.category','account.account'),
|
||||
('property_account_income_categ','product.category','account.account'),
|
||||
('property_account_tax','res.partner','account.tax'),
|
||||
('property_account_expense','product.template','account.account'),
|
||||
('property_account_income','product.template','account.account')
|
||||
]
|
||||
|
|
|
@ -191,8 +191,14 @@ class account_bank_statement(osv.osv):
|
|||
continue
|
||||
|
||||
torec = []
|
||||
if move.amount >= 0:
|
||||
account_id = st.journal_id.default_credit_account_id.id
|
||||
else:
|
||||
account_id = st.journal_id.default_debit_account_id.id
|
||||
acc_cur = ((move.amount<=0) and st.journal_id.default_debit_account_id) or move.account_id
|
||||
amount = res_currency_obj.compute(cr, uid, st.currency.id,
|
||||
company_currency_id, move.amount, context=context)
|
||||
company_currency_id, move.amount, context=context,
|
||||
account=acc_cur)
|
||||
if move.reconcile_id and move.reconcile_id.line_new_ids:
|
||||
for newline in move.reconcile_id.line_new_ids:
|
||||
amount += newline.amount
|
||||
|
@ -213,7 +219,8 @@ class account_bank_statement(osv.osv):
|
|||
}
|
||||
|
||||
amount = res_currency_obj.compute(cr, uid, st.currency.id,
|
||||
company_currency_id, move.amount, context=context)
|
||||
company_currency_id, move.amount, context=context,
|
||||
account=acc_cur)
|
||||
|
||||
if move.account_id and move.account_id.currency_id:
|
||||
val['currency_id'] = move.account_id.currency_id.id
|
||||
|
@ -221,7 +228,8 @@ class account_bank_statement(osv.osv):
|
|||
amount_cur = move.amount
|
||||
else:
|
||||
amount_cur = res_currency_obj.compute(cr, uid, company_currency_id,
|
||||
move.account_id.currency_id.id, amount, context=context)
|
||||
move.account_id.currency_id.id, amount, context=context,
|
||||
account=acc_cur)
|
||||
val['amount_currency'] = amount_cur
|
||||
|
||||
torec.append(account_move_line_obj.create(cr, uid, val , context=context))
|
||||
|
@ -242,11 +250,6 @@ class account_bank_statement(osv.osv):
|
|||
'period_id': st.period_id.id,
|
||||
}, context=context)
|
||||
|
||||
if amount >= 0:
|
||||
account_id = st.journal_id.default_credit_account_id.id
|
||||
else:
|
||||
account_id = st.journal_id.default_debit_account_id.id
|
||||
|
||||
# Fill the secondary amount/currency
|
||||
# if currency is not the same than the company
|
||||
amount_currency = False
|
||||
|
@ -370,10 +373,16 @@ class account_bank_statement_reconcile(osv.osv):
|
|||
context=context).company_id.currency_id.id
|
||||
currency_id = context.get('currency_id', company_currency_id)
|
||||
|
||||
acc_cur = None
|
||||
if context.get('journal_id', False) and context.get('account_id',False):
|
||||
st =self.pool.get('account.journal').browse(cursor, user, context['journal_id'])
|
||||
acc = self.pool.get('account.account').browse(cursor, user, context['account_id'])
|
||||
acc_cur = (( context.get('amount',0.0)<=0) and st.default_debit_account_id) or acc
|
||||
|
||||
for reconcile_id in ids:
|
||||
res[reconcile_id] = res_currency_obj.compute(cursor, user,
|
||||
currency_id, company_currency_id,
|
||||
context.get('amount', 0.0), context=context)
|
||||
context.get('amount', 0.0), context=context, account=acc_cur)
|
||||
return res
|
||||
|
||||
def _default_amount(self, cursor, user, context=None):
|
||||
|
@ -386,9 +395,15 @@ class account_bank_statement_reconcile(osv.osv):
|
|||
context=context).company_id.currency_id.id
|
||||
currency_id = context.get('currency_id', company_currency_id)
|
||||
|
||||
acc_cur = None
|
||||
if context.get('journal_id', False) and context.get('account_id',False):
|
||||
st =self.pool.get('account.journal').browse(cursor, user, context['journal_id'])
|
||||
acc = self.pool.get('account.account').browse(cursor, user, context['account_id'])
|
||||
acc_cur = (( context.get('amount',0.0)<=0) and st.default_debit_account_id) or acc
|
||||
|
||||
return res_currency_obj.compute(cursor, user,
|
||||
currency_id, company_currency_id,
|
||||
context.get('amount', 0.0), context=context)
|
||||
context.get('amount', 0.0), context=context, account=acc_cur)
|
||||
|
||||
def _total_currency(self, cursor, user, ids, name, attrs, context=None):
|
||||
res = {}
|
||||
|
@ -423,25 +438,11 @@ class account_bank_statement_reconcile(osv.osv):
|
|||
|
||||
def name_get(self, cursor, user, ids, context=None):
|
||||
res= []
|
||||
res_currency_obj = self.pool.get('res.currency')
|
||||
res_users_obj = self.pool.get('res.users')
|
||||
|
||||
company_currency_id = res_users_obj.browse(cursor, user, user,
|
||||
context=context).company_id.currency_id.id
|
||||
|
||||
for o in self.browse(cursor, user, ids, context=context):
|
||||
td = ''
|
||||
if o.statement_line:
|
||||
currency_id = o.statement_line[0].statement_id.currency.id
|
||||
if abs(o.statement_line[0].amount - (o.total_entry - o.total_new))>0.01:
|
||||
td = 'P '
|
||||
else:
|
||||
currency_id = company_currency_id
|
||||
res.append((o.id, '%s[%.2f-%.2f]' % (td,
|
||||
res_currency_obj.compute(cursor, user, company_currency_id,
|
||||
currency_id, o.total_entry, context=context),
|
||||
res_currency_obj.compute(cursor, user, company_currency_id,
|
||||
currency_id, o.total_new, context=context))))
|
||||
if o.total_amount:
|
||||
td = 'P '
|
||||
res.append((o.id, '%s[%.2f]' % (td, o.total_amount)))
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
|
|
|
@ -124,6 +124,7 @@
|
|||
<field name="date_due" select="1"/>
|
||||
<field name="residual"/>
|
||||
<field name="state"/>
|
||||
<field name="origin"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -149,7 +150,7 @@
|
|||
<field name="check_total" required="2"/>
|
||||
<field name="currency_id" on_change="onchange_currency_id(currency_id)" select="2"/>
|
||||
<field colspan="4" default_get="{'check_total': check_total, 'invoice_line': invoice_line, 'address_invoice_id': address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False}" name="invoice_line" nolabel="1">
|
||||
<tree editable="bottom" string="Invoice lines">
|
||||
<tree string="Invoice lines">
|
||||
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, price_unit, parent.address_invoice_id)"/>
|
||||
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id" on_change="onchange_account_id(parent.partner_id,account_id)"/>
|
||||
<field name="invoice_line_tax_id" view_mode="2"/>
|
||||
|
@ -198,7 +199,7 @@
|
|||
<field name="name" select="2"/>
|
||||
<newline/>
|
||||
<field name="number" select="2"/>
|
||||
<field name="origin"/>
|
||||
<field name="origin" select="2"/>
|
||||
<field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id"/>
|
||||
<field name="move_id"/>
|
||||
<field name="date_invoice" on_change="onchange_payment_term_date_invoice(payment_term, date_invoice)" select="1"/>
|
||||
|
@ -208,17 +209,17 @@
|
|||
<field colspan="4" name="comment" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Payments">
|
||||
<field name="payment_ids" colspan="4" nolabel="1">
|
||||
<tree string="Payments">
|
||||
<field name="date"/>
|
||||
<field name="ref"/>
|
||||
<field name="name"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<field name="payment_ids" colspan="4" nolabel="1">
|
||||
<tree string="Payments">
|
||||
<field name="date"/>
|
||||
<field name="ref"/>
|
||||
<field name="name"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -280,7 +281,7 @@
|
|||
<field name="date_due" select="1"/>
|
||||
<newline/>
|
||||
<field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank" select="2"/>
|
||||
<field name="origin"/>
|
||||
<field name="origin" select="2"/>
|
||||
<field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id"/>
|
||||
<field name="move_id"/>
|
||||
<field name="date_invoice" on_change="onchange_payment_term_date_invoice(payment_term, date_invoice)" select="1"/>
|
||||
|
@ -290,17 +291,17 @@
|
|||
<field colspan="4" name="comment" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Payments">
|
||||
<field name="payment_ids" colspan="4" nolabel="1">
|
||||
<tree string="Payments">
|
||||
<field name="date"/>
|
||||
<field name="ref"/>
|
||||
<field name="name"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<field name="payment_ids" colspan="4" nolabel="1">
|
||||
<tree string="Payments">
|
||||
<field name="date"/>
|
||||
<field name="ref"/>
|
||||
<field name="name"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -145,7 +145,9 @@ class account_move_line(osv.osv):
|
|||
ref_id = False
|
||||
move = self.pool.get('account.move').browse(cr, uid, move_id, context)
|
||||
|
||||
acc1 = False
|
||||
for l in move.line_id:
|
||||
acc1 = l.account_id
|
||||
partner_id = partner_id or l.partner_id.id
|
||||
ref_id = ref_id or l.ref
|
||||
total += (l.debit or 0.0) - (l.credit or 0.0)
|
||||
|
@ -175,6 +177,17 @@ class account_move_line(osv.osv):
|
|||
s = -total
|
||||
data['debit'] = s>0 and s or 0.0
|
||||
data['credit'] = s<0 and -s or 0.0
|
||||
|
||||
if account.currency_id:
|
||||
data['currency_id'] = account.currency_id.id
|
||||
acc = account
|
||||
if s>0:
|
||||
acc = acc1
|
||||
v = self.pool.get('res.currency').compute(cr, uid,
|
||||
account.company_id.currency_id.id,
|
||||
data['currency_id'],
|
||||
s, account=acc, account_invert=True)
|
||||
data['amount_currency'] = v
|
||||
return data
|
||||
|
||||
def _on_create_write(self, cr, uid, id, context={}):
|
||||
|
@ -325,12 +338,19 @@ class account_move_line(osv.osv):
|
|||
context=context)
|
||||
dt = period.date_start
|
||||
return dt
|
||||
def _get_currency(self, cr, uid, context={}):
|
||||
if not context.get('journal_id', False):
|
||||
return False
|
||||
cur = self.pool.get('account.journal').browse(cr, uid, context['journal_id']).currency
|
||||
return cur and cur.id or False
|
||||
|
||||
_defaults = {
|
||||
'blocked': lambda *a: False,
|
||||
'centralisation': lambda *a: 'normal',
|
||||
'date': _get_date,
|
||||
'date_created': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'state': lambda *a: 'draft',
|
||||
'currency_id': _get_currency,
|
||||
'journal_id': lambda self, cr, uid, c: c.get('journal_id', False),
|
||||
'period_id': lambda self, cr, uid, c: c.get('period_id', False),
|
||||
}
|
||||
|
@ -368,6 +388,21 @@ class account_move_line(osv.osv):
|
|||
|
||||
#TODO: ONCHANGE_ACCOUNT_ID: set account_tax_id
|
||||
|
||||
def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False):
|
||||
if (not currency_id) or (not account_id):
|
||||
return {}
|
||||
result = {}
|
||||
acc =self.pool.get('account.account').browse(cr, uid, account_id)
|
||||
if (amount>0) and journal:
|
||||
x = self.pool.get('account.journal').browse(cr, uid, journal).default_credit_account_id
|
||||
if x: acc = x
|
||||
v = self.pool.get('res.currency').compute(cr, uid, currency_id,acc.company_id.currency_id.id, amount, account=acc)
|
||||
result['value'] = {
|
||||
'debit': v>0 and v or 0.0,
|
||||
'credit': v<0 and -v or 0.0
|
||||
}
|
||||
return result
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, move_id, partner_id, account_id=None, debit=0, credit=0, date=False, journal=False):
|
||||
val = {}
|
||||
val['date_maturity'] = False
|
||||
|
@ -603,6 +638,8 @@ class account_move_line(osv.osv):
|
|||
attrs.append('required="1"')
|
||||
else:
|
||||
attrs.append('required="0"')
|
||||
if field.field in ('amount_currency','currency_id'):
|
||||
attrs.append('on_change="onchange_currency(account_id,amount_currency,currency_id,date,((\'journal_id\' in context) and context[\'journal_id\']) or {})"')
|
||||
if field.field == 'partner_id':
|
||||
attrs.append('on_change="onchange_partner_id(move_id,partner_id,account_id,debit,credit,((\'journal_id\' in context) and context[\'journal_id\']) or {})"')
|
||||
if field.field in widths:
|
||||
|
@ -749,7 +786,9 @@ class account_move_line(osv.osv):
|
|||
ctx = {}
|
||||
if 'date' in vals:
|
||||
ctx['date'] = vals['date']
|
||||
vals['amount_currency'] = cur_obj.compute(cr, uid, account.company_id.currency_id.id, account.currency_id.id, vals.get('debit', 0.0)-vals.get('credit', 0.0), context=ctx)
|
||||
vals['amount_currency'] = cur_obj.compute(cr, uid, account.company_id.currency_id.id,
|
||||
account.currency_id.id, vals.get('debit', 0.0)-vals.get('credit', 0.0),
|
||||
context=ctx)
|
||||
if not ok:
|
||||
raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal !'))
|
||||
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<report auto="False" id="account_general_ledger" menu="False" model="account.account" name="account.general.ledger" rml="account/report/general_ledger.rml" string="General Ledger"/>
|
||||
<report auto="False" id="account_3rdparty_ledger" menu="False" model="res.partner" name="account.third_party_ledger" rml="account/report/third_party_ledger.rml" string="Partner ledger"/>
|
||||
<report auto="False" id="account_account_balance" menu="False" model="account.account" name="account.account.balance" rml="account/report/account_balance.rml" string="Account balance"/>
|
||||
<report auto="False" id="account_3rdparty_account_balance" menu="False" model="account.account" name="account.partner.balance" rml="account/report/partner_balance.rml" string="Partner balance"/>
|
||||
<report auto="False" id="account_3rdparty_ledger" menu="False" model="res.partner" name="account.third_party_ledger" rml="account/report/third_party_ledger.rml" string="Partner Ledger"/>
|
||||
<report auto="False" id="account_account_balance" menu="False" model="account.account" name="account.account.balance" rml="account/report/account_balance.rml" string="Account Balance"/>
|
||||
<report auto="False" id="account_3rdparty_account_balance" menu="False" model="account.account" name="account.partner.balance" rml="account/report/partner_balance.rml" string="Partner Balance"/>
|
||||
<report auto="False" id="account_central_journal" model="account.journal.period" name="account.central.journal" rml="account/report/central_journal.rml" string="Print Central Journal"/>
|
||||
<report auto="False" id="account_general_journal" model="account.journal.period" name="account.general.journal" rml="account/report/general_journal.rml" string="Print General Journal"/>
|
||||
<report auto="False" id="account_journal" model="account.journal.period" name="account.journal.period.print" rml="account/report/account_journal.rml" string="Print Journal"/>
|
||||
<report auto="False" id="account_overdue" model="res.partner" name="account.overdue" rml="account/report/overdue.rml" string="Overdue payments"/>
|
||||
<report auto="False" id="account_overdue" model="res.partner" name="account.overdue" rml="account/report/overdue.rml" string="Overdue Payments"/>
|
||||
<report auto="False" id="account_invoices" model="account.invoice" name="account.invoice" rml="account/report/invoice.rml" string="Invoices" attachment="print-"/>
|
||||
<report id="account_transfers" model="account.transfer" name="account.transfer" string="Transfers" xml="account/report/transfer.xml" xsl="account/report/transfer.xsl"/>
|
||||
<report auto="False" id="account_intracom" menu="False" model="account.move.line" name="account.intracom" string="IntraCom"/>
|
||||
|
||||
<report id="account_move_line_list" model="account.tax.code" name="account.tax.code.entries" rml="account/report/account_tax_code.rml" string="All Entries"/>
|
||||
|
||||
<report auto="False" id="account_vat_declaration" menu="False" model="account.tax.code" name="account.vat.declaration" rml="account/report/tax_report.rml" string="Taxes report"/>
|
||||
<report auto="False" id="account_vat_declaration" menu="False" model="account.tax.code" name="account.vat.declaration" rml="account/report/tax_report.rml" string="Taxes Report"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_tax_report"
|
||||
|
|
|
@ -60,6 +60,9 @@
|
|||
<!--
|
||||
Period
|
||||
-->
|
||||
<record id="res_role_period" model="res.roles">
|
||||
<field eval=""""Period"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="view_account_period_form" model="ir.ui.view">
|
||||
<field name="name">account.period.form</field>
|
||||
|
@ -74,6 +77,7 @@
|
|||
<field name="fiscalyear_id"/>
|
||||
<separator colspan="4" string="States"/>
|
||||
<field name="state" select="1"/>
|
||||
<button name="action_draft" states="done" string="Set to Draft" type="object"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -122,8 +126,9 @@
|
|||
<page string="General Information">
|
||||
<newline/>
|
||||
<field name="currency_id" select="2"/>
|
||||
<field name="active" select="2"/>
|
||||
<field name="currency_mode" select="2"/>
|
||||
<field name="reconcile"/>
|
||||
<field name="active" select="2"/>
|
||||
<field name="check_history"/>
|
||||
<newline/>
|
||||
<newline/>
|
||||
|
@ -323,7 +328,7 @@
|
|||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
|
||||
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
|
||||
<field name="amount"/>
|
||||
<field context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id, 'currency_id': parent.currency}" name="reconcile_id"/>
|
||||
<field context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id, 'currency_id': parent.currency, 'journal_id': parent.journal_id}" name="reconcile_id"/>
|
||||
<field invisible="1" name="reconcile_amount"/>
|
||||
</tree>
|
||||
<form string="Statement lines">
|
||||
|
@ -333,7 +338,7 @@
|
|||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
|
||||
<field domain="[('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id"/>
|
||||
<field name="amount"/>
|
||||
<field context="{'partner_id':partner_id,'amount':amount,'account_id':account_id}" name="reconcile_id"/>
|
||||
<field context="{'partner_id':partner_id,'amount':amount,'account_id':account_id,'journal_id':parent.journal_id}" name="reconcile_id"/>
|
||||
<field name="ref"/>
|
||||
<separator colspan="4" string="Notes"/>
|
||||
<field colspan="4" name="note" nolabel="1"/>
|
||||
|
@ -605,6 +610,7 @@
|
|||
<field name="res_model">account.tax</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_tax_tree"/>
|
||||
<field name="domain">[('parent_id','=',False)]</field>
|
||||
</record>
|
||||
<menuitem action="action_tax_form" id="menu_action_tax_form" parent="next_id_27"/>
|
||||
|
||||
|
|
|
@ -48,19 +48,19 @@
|
|||
<menuitem action="wizard_generate_subscription" id="menu_generate_subscription" parent="account.menu_finance_periodical_processing" type="wizard"/>
|
||||
|
||||
<!-- Aged partner balance -->
|
||||
<wizard id="wizard_aged_trial_balance" menu="False" model="res.partner" name="account.aged.trial.balance" string="Aged partner balance"/>
|
||||
<wizard id="wizard_aged_trial_balance" menu="False" model="res.partner" name="account.aged.trial.balance" string="Aged Partner Balance"/>
|
||||
<menuitem id="next_id_22" name="Partner Accounts" parent="menu_finance_reporting"/>
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_aged_trial_balance" id="menu_aged_trial_balance" parent="next_id_22" type="wizard"/>
|
||||
|
||||
<!-- report-related wizards -->
|
||||
<wizard id="wizard_partner_balance_report" menu="False" model="res.partner" name="account.partner.balance.report" string="Partner balance"/>
|
||||
<wizard id="wizard_partner_balance_report" menu="False" model="res.partner" name="account.partner.balance.report" string="Partner Balance"/>
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_partner_balance_report" id="menu_partner_balance" parent="account.next_id_22" type="wizard"/>
|
||||
|
||||
<wizard id="wizard_third_party_ledger" menu="False" model="res.partner" name="account.third_party_ledger.report" string="Partner ledger"/>
|
||||
<wizard id="wizard_third_party_ledger" menu="False" model="res.partner" name="account.third_party_ledger.report" string="Partner Ledger"/>
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_third_party_ledger" id="menu_third_party_ledger" parent="account.next_id_22" type="wizard"/>
|
||||
|
||||
<wizard id="wizard_balance_report" keyword="client_print_multi" model="account.account" name="account.account.balance.report" string="Account balance"/>
|
||||
<wizard id="wizard_general_ledger_report" keyword="client_print_multi" model="account.account" name="account.general.ledger.report" string="General ledger"/>
|
||||
<wizard id="wizard_balance_report" keyword="client_print_multi" model="account.account" name="account.account.balance.report" string="Account Balance"/>
|
||||
<wizard id="wizard_general_ledger_report" keyword="client_print_multi" model="account.account" name="account.general.ledger.report" string="General Ledger"/>
|
||||
|
||||
<wizard id="wizard_invoice_state_confirm" keyword="client_action_multi" model="account.invoice" multi="True" name="account.invoice.state.confirm" string="Confirm draft invoices"/>
|
||||
<wizard id="wizard_invoice_state_cancel" keyword="client_action_multi" model="account.invoice" multi="True" name="account.invoice.state.cancel" string="Cancel selected invoices"/>
|
||||
|
@ -80,12 +80,20 @@
|
|||
<wizard string="Open State" model="account.invoice" name="account.wizard_paid_open" menu="False" id="wizard_paid_open"/>
|
||||
|
||||
<!-- generic report wizard -->
|
||||
<wizard id="wizard_account_balance_report" menu="False" model="account.account" name="account.account.balance.report" string="Account balance"/>
|
||||
<wizard id="wizard_account_balance_report" menu="False" model="account.account" name="account.account.balance.report" string="Account Balance"/>
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_account_balance_report" id="menu_account_balance_report" parent="account.menu_generic_report" type="wizard"/>
|
||||
|
||||
<wizard id="wizard_general_ledger" menu="False" model="account.account" name="account.general.ledger.report" string="General ledger"/>
|
||||
<wizard id="wizard_general_ledger" menu="False" model="account.account" name="account.general.ledger.report" string="General Ledger"/>
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_general_ledger" id="menu_general_ledger" parent="account.menu_generic_report" type="wizard"/>
|
||||
|
||||
<wizard id="wizard_print_journal" menu="False" model="account.journal.period" name="account.print.journal.report" string="Print Journal" />
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_print_journal" id="menu_print_journal" parent="account.menu_generic_report" type="wizard" />
|
||||
|
||||
<wizard id="wizard_central_journal" menu="False" model="account.journal.period" name="account.central.journal.report" string="Print Central journal" />
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_central_journal" id="menu_central_journal" parent="account.menu_generic_report" type="wizard" />
|
||||
|
||||
<wizard id="wizard_general_journal" menu="False" model="account.journal.period" name="account.general.journal.report" string="Print General journal" />
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_general_journal" id="menu_general_journal" parent="account.menu_generic_report" type="wizard" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -142,6 +142,18 @@
|
|||
<field eval="True" name="required"/>
|
||||
<field eval="6" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col17_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Currency Amt.</field>
|
||||
<field name="field">amount_currency</field>
|
||||
<field eval="8" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col18_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Currency</field>
|
||||
<field name="field">currency_id</field>
|
||||
<field eval="9" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col9_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Debit</field>
|
||||
|
@ -154,30 +166,6 @@
|
|||
<field name="field">credit</field>
|
||||
<field eval="11" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col11_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Tax</field>
|
||||
<field name="field">account_tax_id</field>
|
||||
<field eval="12" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col12_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Analytic Account</field>
|
||||
<field name="field">analytic_account_id</field>
|
||||
<field eval="13" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col17_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Currency Amt.</field>
|
||||
<field name="field">amount_currency</field>
|
||||
<field eval="14" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col18_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Currency</field>
|
||||
<field name="field">currency_id</field>
|
||||
<field eval="15" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col3_multi" model="account.journal.column">
|
||||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Ref</field>
|
||||
|
|
|
@ -149,15 +149,9 @@ your own chart of account.
|
|||
<field eval="'account.account,'+str(a_pay)" name="value"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record forcecreate="True" id="property_account_supplier_tax" model="ir.property">
|
||||
<field name="name">property_account_supplier_tax</field>
|
||||
<field name="fields_id" search="[('model','=','res.partner'),('name','=','property_account_supplier_tax')]"/>
|
||||
<field eval="False" name="value"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record forcecreate="True" id="property_account_tax" model="ir.property">
|
||||
<field name="name">property_account_tax</field>
|
||||
<field name="fields_id" search="[('model','=','res.partner'),('name','=','property_account_tax')]"/>
|
||||
<record forcecreate="True" id="property_account_position" model="ir.property">
|
||||
<field name="name">property_account_position</field>
|
||||
<field name="fields_id" search="[('model','=','res.partner'),('name','=','property_account_position')]"/>
|
||||
<field eval="False" name="value"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
@ -199,15 +193,6 @@ your own chart of account.
|
|||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
<record forcecreate="1" id="stock_journal" model="account.journal">
|
||||
<field name="name">Stock Journal</field>
|
||||
<field name="code">STJ</field>
|
||||
<field name="type">general</field>
|
||||
<field name="view_id" ref="account_journal_view"/>
|
||||
<field name="sequence_id" ref="sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Product income and expense accounts, default parameters
|
||||
-->
|
||||
|
|
|
@ -237,7 +237,7 @@ msgstr "Taxes fournisseurs"
|
|||
#. module: account
|
||||
#: rml:account.vat.declaration:0
|
||||
msgid "Tax Report"
|
||||
msgstr "Déclaration TVA"
|
||||
msgstr "Taxes Statement"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.tax.template,type:0
|
||||
|
@ -727,7 +727,7 @@ msgstr "Grand livre analytique"
|
|||
#. module: account
|
||||
#: model:ir.actions.wizard,name:account.wizard_vat_declaration
|
||||
msgid "VAT Declaration"
|
||||
msgstr "Déclaration TVA"
|
||||
msgstr "Taxes Statement"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree
|
||||
|
|
|
@ -287,7 +287,7 @@ class account_invoice(osv.osv):
|
|||
pt_obj= self.pool.get('account.payment.term')
|
||||
|
||||
if not date_invoice :
|
||||
date_invoice = self._defaults["date_invoice"](cr,uid,{})
|
||||
date_invoice = time.strftime('%Y-%m-%d')
|
||||
|
||||
pterm_list= pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
|
||||
|
||||
|
@ -857,24 +857,11 @@ class account_invoice_line(osv.osv):
|
|||
taxep=None
|
||||
lang=self.pool.get('res.partner').read(cr, uid, [partner_id])[0]['lang']
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
if type in ('out_invoice', 'out_refund'):
|
||||
taxep = self.pool.get('res.partner').browse(cr, uid, partner_id).property_account_tax
|
||||
if not taxep or not taxep.id:
|
||||
tax_id = map(lambda x: x.id, res.taxes_id)
|
||||
else:
|
||||
tax_id = [taxep.id]
|
||||
for t in res.taxes_id:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
tax_id.append(t.id)
|
||||
tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, res.taxes_id)
|
||||
else:
|
||||
taxep = self.pool.get('res.partner').browse(cr, uid, partner_id).property_account_supplier_tax
|
||||
if not taxep or not taxep.id:
|
||||
tax_id = map(lambda x: x.id, res.supplier_taxes_id)
|
||||
else:
|
||||
tax_id = [taxep.id]
|
||||
for t in res.supplier_taxes_id:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
tax_id.append(t.id)
|
||||
tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, res.supplier_taxes_id)
|
||||
if type in ('in_invoice', 'in_refund'):
|
||||
result = self.product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context)
|
||||
else:
|
||||
|
@ -891,6 +878,8 @@ class account_invoice_line(osv.osv):
|
|||
a = res.product_tmpl_id.property_account_expense.id
|
||||
if not a:
|
||||
a = res.categ_id.property_account_expense_categ.id
|
||||
|
||||
a = self.pool.get('account.fiscal.position').map_account(cr, uid, part, a)
|
||||
if a:
|
||||
result['account_id'] = a
|
||||
|
||||
|
@ -963,13 +952,9 @@ class account_invoice_line(osv.osv):
|
|||
if not (partner_id and account_id):
|
||||
return {}
|
||||
taxes = self.pool.get('account.account').browse(cr, uid, account_id).tax_ids
|
||||
taxep = self.pool.get('res.partner').browse(cr, uid, partner_id).property_account_tax
|
||||
if not taxep.id:
|
||||
return {'value': {'invoice_line_tax_id': map(lambda x: x.id, taxes or []) }}
|
||||
res = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
res.append(t.id)
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
|
||||
res = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, taxes)
|
||||
r = {'value':{'invoice_line_tax_id': res}}
|
||||
return r
|
||||
account_invoice_line()
|
||||
|
@ -1022,14 +1007,14 @@ class account_invoice_tax(osv.osv):
|
|||
if inv.type in ('out_invoice','in_invoice'):
|
||||
val['base_code_id'] = tax['base_code_id']
|
||||
val['tax_code_id'] = tax['tax_code_id']
|
||||
val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['base_sign'], context={'date': inv.date_invoice})
|
||||
val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['tax_sign'], context={'date': inv.date_invoice})
|
||||
val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')})
|
||||
val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['tax_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')})
|
||||
val['account_id'] = tax['account_collected_id'] or line.account_id.id
|
||||
else:
|
||||
val['base_code_id'] = tax['ref_base_code_id']
|
||||
val['tax_code_id'] = tax['ref_tax_code_id']
|
||||
val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['ref_base_sign'], context={'date': inv.date_invoice})
|
||||
val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['ref_tax_sign'], context={'date': inv.date_invoice})
|
||||
val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['ref_base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')})
|
||||
val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['ref_tax_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')})
|
||||
val['account_id'] = tax['account_paid_id'] or line.account_id.id
|
||||
|
||||
key = (val['tax_code_id'], val['base_code_id'], val['account_id'])
|
||||
|
|
|
@ -31,6 +31,64 @@
|
|||
from osv import fields, osv
|
||||
import ir
|
||||
|
||||
class account_fiscal_position(osv.osv):
|
||||
_name = 'account.fiscal.position'
|
||||
_description = 'Fiscal Position'
|
||||
_columns = {
|
||||
'name': fields.char('Fiscal Position', size=64, translate=True, required=True),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'account_ids': fields.one2many('account.fiscal.position.account', 'position_id', 'Accounts Mapping'),
|
||||
'tax_ids': fields.one2many('account.fiscal.position.tax', 'position_id', 'Taxes Mapping')
|
||||
}
|
||||
def map_tax(self, cr, uid, partner, taxes, context={}):
|
||||
if (not partner) or (not partner.property_account_position) :
|
||||
return map(lambda x: x.id, taxes)
|
||||
result = []
|
||||
for t in taxes:
|
||||
ok = False
|
||||
for tax in partner.property_account_position.tax_ids:
|
||||
if tax.tax_src_id.id==t.id:
|
||||
if tax.tax_dest_id:
|
||||
result.append(tax.tax_dest_id.id)
|
||||
ok=True
|
||||
if not ok:
|
||||
result.append(t.id)
|
||||
return result
|
||||
|
||||
def map_account(self, cr, uid, partner, account_id, context={}):
|
||||
if (not partner) or (not partner.property_account_position) :
|
||||
return account_id
|
||||
for pos in partner.property_account_position.account_ids:
|
||||
if pos.account_src_id.id==account_id:
|
||||
account_id = pos.account_dest_id.id
|
||||
break
|
||||
return account_id
|
||||
account_fiscal_position()
|
||||
|
||||
|
||||
class account_fiscal_position_tax(osv.osv):
|
||||
_name = 'account.fiscal.position.tax'
|
||||
_description = 'Fiscal Position Taxes Mapping'
|
||||
_rec_name = 'position_id'
|
||||
_columns = {
|
||||
'position_id': fields.many2one('account.fiscal.position', 'Fiscal Position', required=True, ondelete='cascade'),
|
||||
'tax_src_id': fields.many2one('account.tax', 'Tax Source', required=True),
|
||||
'tax_dest_id': fields.many2one('account.tax', 'Replacement Tax')
|
||||
}
|
||||
account_fiscal_position_tax()
|
||||
|
||||
|
||||
class account_fiscal_position_account(osv.osv):
|
||||
_name = 'account.fiscal.position.account'
|
||||
_description = 'Fiscal Position Accounts Mapping'
|
||||
_rec_name = 'position_id'
|
||||
_columns = {
|
||||
'position_id': fields.many2one('account.fiscal.position', 'Fiscal Position', required=True, ondelete='cascade'),
|
||||
'account_src_id': fields.many2one('account.account', 'Account Source', required=True),
|
||||
'account_dest_id': fields.many2one('account.account', 'Account Destination', required=True)
|
||||
}
|
||||
account_fiscal_position_account()
|
||||
|
||||
class res_partner(osv.osv):
|
||||
_name = 'res.partner'
|
||||
_inherit = 'res.partner'
|
||||
|
@ -109,24 +167,15 @@ class res_partner(osv.osv):
|
|||
domain="[('type', '=', 'receivable')]",
|
||||
help="This account will be used, instead of the default one, as the receivable account for the current partner",
|
||||
required=True),
|
||||
'property_account_supplier_tax': fields.property(
|
||||
'account.tax',
|
||||
'property_account_position': fields.property(
|
||||
'account.fiscal.position',
|
||||
type='many2one',
|
||||
relation='account.tax',
|
||||
string="Default Supplier Tax",
|
||||
relation='account.fiscal.position',
|
||||
string="Fiscal Position",
|
||||
method=True,
|
||||
view_load=True,
|
||||
domain=[('parent_id','=',False)],
|
||||
help="This tax will be used, instead of the default one for supplier invoices."),
|
||||
'property_account_tax': fields.property(
|
||||
'account.tax',
|
||||
type='many2one',
|
||||
relation='account.tax',
|
||||
string="Default Tax",
|
||||
method=True,
|
||||
view_load=True,
|
||||
domain=[('parent_id','=',False)],
|
||||
help="This tax will be used, instead of the default one for customers."),
|
||||
help="The fiscal position will determine taxes and the accounts used for the the partner.",
|
||||
),
|
||||
'property_payment_term': fields.property(
|
||||
'account.payment.term',
|
||||
type='many2one',
|
||||
|
|
|
@ -1,6 +1,63 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_account_position_form" model="ir.ui.view">
|
||||
<field name="name">account.fiscal.position.form</field>
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fiscal Position">
|
||||
<field name="name" select="1"/>
|
||||
<field name="company_id"/>
|
||||
<newline/>
|
||||
<field name="tax_ids" colspan="4">
|
||||
<tree string="Taxes Mapping" editable="bottom">
|
||||
<field name="tax_src_id" domain="[('parent_id','=',False)]"/>
|
||||
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
|
||||
</tree>
|
||||
<form string="Taxes Mapping">
|
||||
<field name="tax_src_id" domain="[('parent_id','=',False)]"/>
|
||||
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
|
||||
</form>
|
||||
</field>
|
||||
<field name="account_ids" colspan="4">
|
||||
<tree string="Accounts Mapping" editable="bottom">
|
||||
<field name="account_src_id"/>
|
||||
<field name="account_dest_id"/>
|
||||
</tree>
|
||||
<form string="Accounts Mapping">
|
||||
<field name="account_src_id"/>
|
||||
<field name="account_dest_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_position_tree" model="ir.ui.view">
|
||||
<field name="name">account.fiscal.position.tree</field>
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Fiscal Position">
|
||||
<field name="name"/>
|
||||
<field name="company_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_fiscal_position_form" model="ir.actions.act_window">
|
||||
<field name="name">Fiscal Positions</field>
|
||||
<field name="res_model">account.fiscal.position</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
action="action_account_fiscal_position_form"
|
||||
id="menu_action_account_fiscal_position_form"
|
||||
parent="account.menu_finance_accounting" sequence="20"/>
|
||||
|
||||
<!--
|
||||
Partners Extension
|
||||
-->
|
||||
|
@ -17,13 +74,12 @@
|
|||
<group col="2" colspan="2">
|
||||
<separator string="Customer Accounting Properties" colspan="2"/>
|
||||
<field name="property_account_receivable"/>
|
||||
<field name="property_account_tax"/>
|
||||
<field name="property_account_position"/>
|
||||
<field name="property_payment_term"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Supplier Accounting Properties" colspan="2"/>
|
||||
<field name="property_account_payable"/>
|
||||
<field name="property_account_supplier_tax"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Customer Credit" colspan="2"/>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</record>
|
||||
|
||||
<!--
|
||||
Process Node
|
||||
Process Node
|
||||
-->
|
||||
|
||||
<record id="process_node_analytic0" model="process.node">
|
||||
|
@ -23,6 +23,7 @@
|
|||
<field eval=""""Analytic"""" name="name"/>
|
||||
<field eval=""""From analytic accounts, It creates invoice."""" name="note"/>
|
||||
<field name="process_id" ref="process_process_invoiceworkflow0"/>
|
||||
<field name="subflow_id" ref="process_process_invoiceworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'open', 'pending', 'close')"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
|
@ -62,10 +63,11 @@
|
|||
<record id="process_node_bankstatement0" model="process.node">
|
||||
<field name="menu_id" ref="account.menu_bank_statement_tree2"/>
|
||||
<field name="model_id" ref="account.model_account_bank_statement"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Bank Statement"""" name="name"/>
|
||||
<field eval=""""Statement encoding produces payment entries"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_invoiceworkflow0"/>
|
||||
<!-- <field name="subflow_id" ref="process_process_statementworkflow0"/>-->
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
|
@ -102,10 +104,18 @@
|
|||
<field eval=""""object.state=='paid'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--
|
||||
Process Transition
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="res_roles_invoice0" model="res.roles">
|
||||
<field eval=""""Invoice"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="account.t5" model="workflow.transition">
|
||||
<field name="role_id" ref="res_roles_invoice0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_analyticinvoice0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
|
@ -123,6 +133,7 @@
|
|||
<field eval=""""Number of entries are generated"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_invoiceinvoice0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_draftinvoices0"/>
|
||||
<field eval="[(6,0,[ref('account.t5')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_validentries0" model="process.transition">
|
||||
|
@ -169,6 +180,17 @@
|
|||
<field model="process.node" name="target_node_id" ref="process_node_paidinvoice0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_reconciliation0"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Action
|
||||
-->
|
||||
|
||||
<record id="process_transition_action_createentries0" model="process.transition.action">
|
||||
<field eval=""""action_move_create"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Create entry"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_customerinvoice0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -78,15 +78,16 @@
|
|||
<field eval=""""Reconciliation of Entries"""" name="name"/>
|
||||
<field eval=""""Reconcilation of the entries with invoice."""" name="note"/>
|
||||
<field name="process_id" ref="process_process_statementworkflow0"/>
|
||||
<field name="subflow_id" ref="account.process_process_invoiceworkflow0"/>
|
||||
<field eval=""""object.state=='valid'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="process_transition_filestatement0" model="process.transition">
|
||||
|
||||
<record id="process_transition_filestatement0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""File statement"""" name="name"/>
|
||||
|
@ -130,6 +131,26 @@
|
|||
<field model="process.node" name="target_node_id" ref="process_node_reconciliationofentries0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_accountingstatemententries0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_statemententries0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Statement Entries"""" name="name"/>
|
||||
<field eval=""""From statement, create entries"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_paymententries0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_bankstatement0"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Action
|
||||
-->
|
||||
|
||||
<record id="process_transition_action_draftconfirmstatement0" model="process.transition.action">
|
||||
<field eval=""""button_confirm"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Confirm"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_confirmstatementfromdraft0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -91,7 +91,7 @@
|
|||
<menuitem
|
||||
action="action_account_analytic_account_tree2"
|
||||
id="account_analytic_def_chart"
|
||||
parent="account.account_analytic_def_account"/>
|
||||
parent="account_analytic_def_account"/>
|
||||
<menuitem action="action_account_analytic_account_tree2" id="account_analytic_chart" parent="account.menu_finance_charts"/>
|
||||
|
||||
<record id="analytic_account_form" model="ir.actions.act_window">
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">Analytic Balance</drawRightString>
|
||||
<drawRightString x="20cm" y="28.1cm">Analytic Balance - [[ company.currency_id.name ]]</drawRightString>
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">Cost Ledger-[[ company.currency_id.name ]]</drawRightString>
|
||||
<drawRightString x="20cm" y="28.1cm">Cost Ledger - [[ company.currency_id.name ]]</drawRightString>
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
@ -72,18 +72,20 @@
|
|||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Grant_Total">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockLeftPadding length="13.0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Account_Detail">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,0" stop="-1,0"/>
|
||||
<blockLeftPadding length="13.0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Move_Line_Detail">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
@ -111,13 +113,13 @@
|
|||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="RIGHT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
|
@ -125,6 +127,7 @@
|
|||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
|
@ -162,7 +165,7 @@
|
|||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="161.0,161.0,161.0" style="Table_Date_Sub_detail">
|
||||
<blockTable colWidths="178.0,178.0,178.0" style="Table_Date_Sub_detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Period from </para>
|
||||
|
@ -175,16 +178,16 @@
|
|||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="161.0,161.0,161.0" style="Table_Sub_Content">
|
||||
<blockTable colWidths="178.0,178.0,178.0" style="Table_Sub_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ data['form']['date1'] ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ data['form']['date1'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ data['form']['date2'] ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ data['form']['date2'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -192,7 +195,7 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<blockTable colWidths="67.0,245.0,59.0,59.0,58.0" style="Table_Header_Title" repeatRows="1">
|
||||
<blockTable colWidths="67.0,296.0,59.0,59.0,58.0" style="Table_Header_Title" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Code / Date</para>
|
||||
|
@ -212,10 +215,10 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="62.0,249.0,57.0,57.0,57.0" style="Table_Grant_Total">
|
||||
<blockTable colWidths="62.0,300.0,57.0,57.0,57.0" style="Table_Grant_Total">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_Bold_9">Total :</para>
|
||||
<para style="terp_default_Bold_9">Total :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9"><font color="white"> </font></para>
|
||||
|
@ -236,10 +239,10 @@
|
|||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
|
||||
<blockTable colWidths="62.0,249.0,57.0,57.0,57.0" style="Table_Account_Detail">
|
||||
<blockTable colWidths="55.0,306.0,58.0,57.0,57.0" style="Table_Account_Detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_Bold_9">[[ o.code ]]</para>
|
||||
<para style="terp_default_Bold_9">[[ o.code ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ o.complete_name ]]</para>
|
||||
|
@ -258,10 +261,10 @@
|
|||
<tr>
|
||||
<td>
|
||||
<para style="Standard">[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
|
||||
<blockTable colWidths="55.0,249.0,58.0,56.0,57.0" style="Table_Move_Line_Detail">
|
||||
<blockTable colWidths="55.0,300.0,58.0,56.0,57.0" style="Table_Move_Line_Detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_Bold_9">[[ move_g['code'] ]]</para>
|
||||
<para style="terp_default_Bold_9">[[ move_g['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ move_g['name'] ]]</para>
|
||||
|
@ -279,7 +282,7 @@
|
|||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
|
||||
<blockTable colWidths="48.0,248.0,59.0,55.0,58.0" style="Table_Move_Line_Content">
|
||||
<blockTable colWidths="48.0,299.0,59.0,55.0,58.0" style="Table_Move_Line_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8_Italic_Center">[[ move_a['date'] ]]</para>
|
||||
|
@ -315,4 +318,4 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">Cost Ledger-[[ company.currency_id.name ]]</drawRightString>
|
||||
<drawRightString x="20cm" y="28.1cm">Cost Ledger - [[ company.currency_id.name ]]</drawRightString>
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
@ -114,13 +114,13 @@
|
|||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="RIGHT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
|
@ -181,13 +181,13 @@
|
|||
<blockTable colWidths="161.0,161.0,161.0" style="Table_Date_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ data['form']['date1'] ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ data['form']['date1'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ data['form']['date2'] ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ data['form']['date2'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
|
|
@ -77,6 +77,47 @@ class account_balance(report_sxw.rml_parse):
|
|||
result+=r[0]+", "
|
||||
return str(result and result[:-1]) or ''
|
||||
|
||||
def transform_both_into_date_array(self,data):
|
||||
if not data['periods'][0][2] :
|
||||
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
else:
|
||||
periods_id = data['periods'][0][2]
|
||||
date_array = []
|
||||
for period_id in periods_id:
|
||||
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
|
||||
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
|
||||
|
||||
period_start_date = date_array[0]
|
||||
date_start_date = data['date_from']
|
||||
period_stop_date = date_array[-1]
|
||||
date_stop_date = data['date_to']
|
||||
|
||||
if period_start_date<date_start_date:
|
||||
start_date = period_start_date
|
||||
else :
|
||||
start_date = date_start_date
|
||||
|
||||
if date_stop_date<period_stop_date:
|
||||
stop_date = period_stop_date
|
||||
else :
|
||||
stop_date = date_stop_date
|
||||
final_date_array = []
|
||||
final_date_array = final_date_array + self.date_range(start_date, stop_date)
|
||||
self.date_lst = final_date_array
|
||||
self.date_lst.sort()
|
||||
|
||||
def transform_none_into_date_array(self,data):
|
||||
sql = "SELECT min(date) as start_date from account_move_line"
|
||||
self.cr.execute(sql)
|
||||
start_date = self.cr.fetchone()[0]
|
||||
sql = "SELECT max(date) as start_date from account_move_line"
|
||||
self.cr.execute(sql)
|
||||
stop_date = self.cr.fetchone()[0]
|
||||
array= []
|
||||
array = array + self.date_range(start_date, stop_date)
|
||||
self.date_lst = array
|
||||
self.date_lst.sort()
|
||||
|
||||
def lines(self, form, ids={}, done=None, level=1):
|
||||
if not ids:
|
||||
ids = self.ids
|
||||
|
@ -90,14 +131,18 @@ class account_balance(report_sxw.rml_parse):
|
|||
res={}
|
||||
result_acc=[]
|
||||
ctx = self.context.copy()
|
||||
if form.has_key('fiscalyear'):
|
||||
if form['state']=='byperiod' :
|
||||
self.transform_period_into_date_array(form)
|
||||
ctx['fiscalyear'] = form['fiscalyear']
|
||||
ctx['periods'] = form['periods'][0][2]
|
||||
else:
|
||||
elif form['state']== 'bydate':
|
||||
self.transform_date_into_date_array(form)
|
||||
ctx['date_from'] = form['date_from']
|
||||
ctx['date_to'] = form['date_to']
|
||||
elif form['state'] == 'all' :
|
||||
self.transform_both_into_date_array(form)
|
||||
elif form['state'] == 'none' :
|
||||
self.transform_none_into_date_array(form)
|
||||
# ctx['date_from'] = form['date_from']
|
||||
# ctx['date_to'] = form['date_to']
|
||||
|
||||
accounts = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx)
|
||||
def cmp_code(x, y):
|
||||
|
@ -169,9 +214,12 @@ class account_balance(report_sxw.rml_parse):
|
|||
"LEFT JOIN account_journal j " \
|
||||
"ON (l.journal_id = j.id) " \
|
||||
"WHERE l.account_id = '"+str(ids)+"' " \
|
||||
"AND l.date IN (" + self.date_lst_string + ") " \
|
||||
"AND l.date >= '"+self.date_lst[0]+"' " \
|
||||
"AND l.date <= '"+self.date_lst[-1]+"' " \
|
||||
"ORDER BY l.id")
|
||||
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
sum = 0.0
|
||||
for r in res:
|
||||
sum = r['debit1'] - r['credit1']
|
||||
|
@ -227,5 +275,5 @@ class account_balance(report_sxw.rml_parse):
|
|||
|
||||
def _sum_debit(self):
|
||||
return self.sum_debit
|
||||
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)
|
||||
|
||||
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="2.0" leading="0" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3a" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" fontSize="9.0" leading="14" spaceBefore="0.0" spaceAfter="6.0" alignment="RIGHT"/>
|
||||
<paraStyle name="P9" fontName="Helvetica-Bold" alignment="CENTER" fontSize="12" leftIndent="-5.0"/>
|
||||
|
@ -50,7 +50,7 @@
|
|||
<paraStyle name="P9a" fontName="Helvetica-Bold" fontSize="9" leftIndent="0.0" alignment="LEFT"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12a" fontName="Helvetica" fontSize="9.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P14" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P14" fontName="Helvetica" fontSize="8.0" leading="5" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
|
||||
<blockTableStyle id="TrLevel8">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
|
@ -80,6 +80,31 @@
|
|||
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="TrLevel_Name8">
|
||||
<blockLeftPadding length="100" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel_Name7">
|
||||
<blockLeftPadding length="80" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel_Name6">
|
||||
<blockLeftPadding length="60" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel_Name5">
|
||||
<blockLeftPadding length="40" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel_Name4">
|
||||
<blockLeftPadding length="20" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel_Name3">
|
||||
<blockLeftPadding length="0" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel_Name2">
|
||||
<blockLeftPadding length="0" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel_Name1">
|
||||
<blockLeftPadding length="0" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<paraStyle
|
||||
name="Level8"
|
||||
fontName="Helvetica-Bold"
|
||||
|
@ -266,7 +291,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td><para style="P14">[[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]][[ a['jname'] or removeParentNode('tr') ]]</para></td>
|
||||
<td><para style="P14"><font color="white">[[ a['level']<4 and removeParentNode('font') or '...'*(2) ]]</font>[[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]]<font>[ref: [[ a['ref'] or removeParentNode('font') ]] ]</font> [[ a['lname'] ]]</para></td>
|
||||
<td><para style="P14">[[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]] [[ setTag('tr','tr',{'style':('TrLevel_Name'+str(a['level']))}) ]]<font>[ref: [[ a['ref'] or removeParentNode('font') ]] ]</font> [[ a['lname'] ]]</para></td>
|
||||
<td><para style="P3">[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '0.00']]</para></td>
|
||||
<td><para style="P3">[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '0.00']]</para></td>
|
||||
<td><para style="P3">[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '0.00' ]]</para></td>
|
||||
|
@ -277,4 +302,3 @@
|
|||
</blockTable>
|
||||
</story>
|
||||
</document>
|
||||
|
||||
|
|
|
@ -45,12 +45,28 @@ class journal_print(report_sxw.rml_parse):
|
|||
'sum_credit': self._sum_credit
|
||||
})
|
||||
|
||||
def lines(self, period_id, journal_id, *args):
|
||||
def lines(self, period_id, journal_id, sort_selection='date', *args):
|
||||
if type(period_id)==type([]):
|
||||
ids_final = []
|
||||
for journal in journal_id:
|
||||
for period in period_id:
|
||||
ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
|
||||
if ids_journal_period:
|
||||
self.cr.execute('update account_journal_period set state=%s where journal_id=%d and period_id=%d and state=%s', ('printed',journal,period,'draft'))
|
||||
self.cr.commit()
|
||||
self.cr.execute('select id from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\' order by ('+ sort_selection +'),id', (period, journal))
|
||||
ids = map(lambda x: x[0], self.cr.fetchall())
|
||||
ids_final.append(ids)
|
||||
line_ids = []
|
||||
for line_id in ids_final:
|
||||
a = self.pool.get('account.move.line').browse(self.cr, self.uid, line_id )
|
||||
line_ids.append(a)
|
||||
return line_ids
|
||||
self.cr.execute('update account_journal_period set state=%s where journal_id=%d and period_id=%d and state=%s', ('printed',journal_id,period_id,'draft'))
|
||||
self.cr.commit()
|
||||
self.cr.execute('select id from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\' order by date,id', (period_id, journal_id))
|
||||
ids = map(lambda x: x[0], self.cr.fetchall())
|
||||
return self.pool.get('account.move.line').browse(self.cr, self.uid, ids)
|
||||
return self.pool.get('account.move.line').browse(self.cr, self.uid, ids )
|
||||
|
||||
def _sum_debit(self, period_id, journal_id):
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
|
||||
|
@ -60,7 +76,7 @@ class journal_print(report_sxw.rml_parse):
|
|||
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print,header=False)
|
||||
|
||||
report_sxw.report_sxw('report.account.journal.period.print.wiz', 'account.journal.period', 'addons/account/report/wizard_account_journal.rml', parser=journal_print,header=False)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -31,13 +31,13 @@ import rml_parse
|
|||
from report import report_sxw
|
||||
|
||||
class aged_trial_report(rml_parse.rml_parse):
|
||||
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(aged_trial_report, self).__init__(cr, uid, name, context)
|
||||
self.line_query = ''
|
||||
self.total_account = []
|
||||
|
||||
|
||||
|
||||
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_lines': self._get_lines,
|
||||
|
@ -46,19 +46,19 @@ class aged_trial_report(rml_parse.rml_parse):
|
|||
'get_for_period': self._get_for_period,
|
||||
'get_company': self._get_company,
|
||||
'get_currency': self._get_currency,
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
def _get_lines(self, form):
|
||||
|
||||
|
||||
if (form['result_selection'] == 'customer' ):
|
||||
self.ACCOUNT_TYPE = "('receivable')"
|
||||
elif (form['result_selection'] == 'supplier'):
|
||||
self.ACCOUNT_TYPE = "('payable')"
|
||||
else:
|
||||
self.ACCOUNT_TYPE = "('payable','receivable')"
|
||||
|
||||
|
||||
|
||||
res = []
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
|
@ -78,7 +78,7 @@ class aged_trial_report(rml_parse.rml_parse):
|
|||
for i in range(7):
|
||||
self.total_account.append(0)
|
||||
#
|
||||
|
||||
|
||||
for partner in partners:
|
||||
values = {}
|
||||
## If choise selection is in the future
|
||||
|
@ -94,7 +94,7 @@ class aged_trial_report(rml_parse.rml_parse):
|
|||
"AND account_account.active",
|
||||
(form['date1'], partner['id'],form['date1'], form['company_id']))
|
||||
before = self.cr.fetchone()
|
||||
|
||||
|
||||
self.total_account[6] = self.total_account[6] + (before and before[0] or 0.0)
|
||||
|
||||
values['direction'] = before and before[0] or 0.0
|
||||
|
@ -112,7 +112,6 @@ class aged_trial_report(rml_parse.rml_parse):
|
|||
after = self.cr.fetchone()
|
||||
self.total_account[6] = self.total_account[6] + (after and after[0] or 0.0)
|
||||
values['direction'] = after and after[0] or ""
|
||||
#print str(values['direction'])
|
||||
for i in range(5):
|
||||
self.cr.execute("SELECT SUM(debit-credit) " \
|
||||
"FROM account_move_line AS line, account_account " \
|
||||
|
@ -128,8 +127,6 @@ class aged_trial_report(rml_parse.rml_parse):
|
|||
during = self.cr.fetchone()
|
||||
# Ajout du compteur
|
||||
self.total_account[(i)] = self.total_account[(i)] + (during and during[0] or 0)
|
||||
|
||||
#print str(during)
|
||||
values[str(i)] = during and during[0] or ""
|
||||
self.cr.execute("SELECT SUM(debit-credit) " \
|
||||
"FROM account_move_line AS line, account_account " \
|
||||
|
@ -145,19 +142,16 @@ class aged_trial_report(rml_parse.rml_parse):
|
|||
values['total'] = total and total[0] or 0.0
|
||||
## Add for total
|
||||
self.total_account[(i+1)] = self.total_account[(i+1)] + (total and total[0] or 0.0)
|
||||
print self.total_account,">>>>>>>>>>>>>Total>>>>>>>>>>>>>>>>"
|
||||
values['name'] = partner['name']
|
||||
#t = 0.0
|
||||
#for i in range(5)+['direction']:
|
||||
# t+= float(values.get(str(i), 0.0) or 0.0)
|
||||
#values['total'] = t
|
||||
|
||||
|
||||
if values['total']:
|
||||
|
||||
res.append(values)
|
||||
|
||||
|
||||
total = 0.0
|
||||
|
||||
totals = {}
|
||||
for r in res:
|
||||
total += float(r['total'] or 0.0)
|
||||
|
@ -166,24 +160,17 @@ class aged_trial_report(rml_parse.rml_parse):
|
|||
totals[str(i)] += float(r[str(i)] or 0.0)
|
||||
return res
|
||||
|
||||
|
||||
|
||||
|
||||
def _get_total(self,pos):
|
||||
print self.total_account,"========_get_total========"
|
||||
period = self.total_account[int(pos)]
|
||||
return period
|
||||
return period
|
||||
|
||||
|
||||
def _get_direction(self,pos):
|
||||
|
||||
period = self.total_account[int(pos)]
|
||||
return period
|
||||
return period
|
||||
|
||||
def _get_for_period(self,pos):
|
||||
|
||||
period = self.total_account[int(pos)]
|
||||
return period
|
||||
return period
|
||||
|
||||
def _get_company(self, form):
|
||||
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).name
|
||||
|
@ -194,5 +181,5 @@ class aged_trial_report(rml_parse.rml_parse):
|
|||
|
||||
report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',
|
||||
'addons/account/report/aged_trial_balance.rml',parser=aged_trial_report,header=False)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -43,20 +43,33 @@ class journal_print(report_sxw.rml_parse):
|
|||
'sum_debit': self._sum_debit,
|
||||
'sum_credit': self._sum_credit
|
||||
})
|
||||
|
||||
|
||||
def lines(self, period_id, journal_id, *args):
|
||||
if type(period_id)==type([]):
|
||||
ids_final = []
|
||||
for journal in journal_id:
|
||||
for period in period_id:
|
||||
ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
|
||||
if ids_journal_period:
|
||||
self.cr.execute('select a.code, a.name, sum(debit) as debit, sum(credit) as credit from account_move_line l left join account_account a on (l.account_id=a.id) where l.period_id=%d and l.journal_id=%d and l.state<>\'draft\' group by a.id, a.code, a.name, l.journal_id, l.period_id', (period, journal))
|
||||
res = self.cr.dictfetchall()
|
||||
a = {'journal':self.pool.get('account.journal').browse(self.cr, self.uid, journal),'period':self.pool.get('account.period').browse(self.cr, self.uid, period)}
|
||||
res[0].update(a)
|
||||
ids_final.append(res)
|
||||
return ids_final
|
||||
self.cr.execute('select a.code, a.name, sum(debit) as debit, sum(credit) as credit from account_move_line l left join account_account a on (l.account_id=a.id) where l.period_id=%d and l.journal_id=%d and l.state<>\'draft\' group by a.id, a.code, a.name', (period_id, journal_id))
|
||||
return self.cr.dictfetchall()
|
||||
|
||||
res = self.cr.dictfetchall()
|
||||
return res
|
||||
|
||||
def _sum_debit(self, period_id, journal_id):
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
|
||||
def _sum_credit(self, period_id, journal_id):
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml',parser=journal_print, header=False)
|
||||
|
||||
report_sxw.report_sxw('report.account.central.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_central_journal.rml',parser=journal_print, header=False)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">Central Journal-[[ company.currency_id.name ]]</drawRightString>
|
||||
<drawRightString x="20cm" y="28.1cm">Central Journal - [[ company.currency_id.name ]]</drawRightString>
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
@ -103,13 +103,13 @@
|
|||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
|
@ -162,13 +162,13 @@
|
|||
<blockTable colWidths="180.0,180.0,180.0" style="Table_Subheader_Content_detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ o.journal_id.code or '' ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ o.journal_id.code or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ o.journal_id.name ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ o.journal_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
|
|
@ -66,38 +66,73 @@ class journal_print(report_sxw.rml_parse):
|
|||
return not res
|
||||
filtered_objs = filter(filter_unique, journal_period_objs)
|
||||
return map(lambda x: x.period_id, filtered_objs)
|
||||
|
||||
def lines(self, period_id):
|
||||
|
||||
def lines(self, period_id, journal_id=[]):
|
||||
if type(period_id)==type([]):
|
||||
ids_final = []
|
||||
for journal in journal_id:
|
||||
for period in period_id:
|
||||
ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
|
||||
if ids_journal_period:
|
||||
ids_final.append(ids_journal_period[0])
|
||||
data_jour_period = self.pool.get('account.journal.period').browse(self.cr, self.uid, ids_final)
|
||||
lines_data = []
|
||||
periods = []
|
||||
for data in data_jour_period:
|
||||
if not data.period_id.id in periods:
|
||||
periods.append(data.period_id.id)
|
||||
for period in periods:
|
||||
period_data = self.pool.get('account.period').browse(self.cr, self.uid, period)
|
||||
self.cr.execute('select j.code, j.name, sum(l.debit) as debit, sum(l.credit) as credit from account_move_line l left join account_journal j on (l.journal_id=j.id) where period_id=%d and journal_id in (' + ','.join(map(str, journal_id)) + ') and l.state<>\'draft\' group by j.id, j.code, j.name', (period,))
|
||||
res = self.cr.dictfetchall()
|
||||
res[0].update({'period_name':period_data.name})
|
||||
res[0].update({'pid':period})
|
||||
lines_data.append(res)
|
||||
return lines_data
|
||||
if not self.journal_ids:
|
||||
return []
|
||||
self.cr.execute('select j.code, j.name, sum(l.debit) as debit, sum(l.credit) as credit from account_move_line l left join account_journal j on (l.journal_id=j.id) where period_id=%d and journal_id in (' + self.journal_ids + ') and l.state<>\'draft\' group by j.id, j.code, j.name', (period_id,))
|
||||
return self.cr.dictfetchall()
|
||||
|
||||
def _sum_debit_period(self, period_id):
|
||||
res = self.cr.dictfetchall()
|
||||
return res
|
||||
|
||||
def _sum_debit_period(self, period_id,journal_id=None):
|
||||
if type(journal_id)==type([]):
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'', (period_id,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
if not self.journal_ids:
|
||||
return 0.0
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id in (' + self.journal_ids + ') and state<>\'draft\'', (period_id,))
|
||||
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_credit_period(self, period_id):
|
||||
|
||||
def _sum_credit_period(self, period_id,journal_id=None):
|
||||
if type(journal_id)==type([]):
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'', (period_id,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
if not self.journal_ids:
|
||||
return 0.0
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id in (' + self.journal_ids + ') and state<>\'draft\'', (period_id,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_debit(self):
|
||||
|
||||
def _sum_debit(self,period_id=None,journal_id=None):
|
||||
if type(period_id)==type([]):
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id in (' + ','.join(map(str, period_id)) + ') and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'')
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
if not self.journal_ids or not self.period_ids:
|
||||
return 0.0
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id in (' + self.period_ids + ') and journal_id in (' + self.journal_ids + ') and state<>\'draft\'')
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_credit(self):
|
||||
|
||||
def _sum_credit(self,period_id=None,journal_id=None):
|
||||
if type(period_id)==type([]):
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id in (' + ','.join(map(str, period_id)) + ') and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'')
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
if not self.journal_ids or not self.period_ids:
|
||||
return 0.0
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id in (' + self.period_ids + ') and journal_id in (' + self.journal_ids + ') and state<>\'draft\'')
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml',parser=journal_print, header=False)
|
||||
|
||||
report_sxw.report_sxw('report.account.general.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_general_journal.rml',parser=journal_print, header=False)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -82,13 +82,13 @@
|
|||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
|
@ -130,7 +130,7 @@
|
|||
<para style="terp_default_Bold_9">Printing Date :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<para style="terp_default_9">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
|
|
@ -32,6 +32,7 @@ from report import report_sxw
|
|||
import xml
|
||||
import rml_parse
|
||||
import pooler
|
||||
from osv import osv
|
||||
|
||||
class general_ledger(rml_parse.rml_parse):
|
||||
_name = 'report.account.general.ledger'
|
||||
|
@ -40,7 +41,11 @@ class general_ledger(rml_parse.rml_parse):
|
|||
|
||||
def preprocess(self, objects, data, ids):
|
||||
##
|
||||
|
||||
|
||||
self.borne_date = self.get_min_date(data['form'])
|
||||
|
||||
|
||||
##
|
||||
new_ids = []
|
||||
if (data['model'] == 'account.account'):
|
||||
|
@ -54,6 +59,7 @@ class general_ledger(rml_parse.rml_parse):
|
|||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(general_ledger, self).__init__(cr, uid, name, context)
|
||||
self.date_borne = {}
|
||||
self.query = ""
|
||||
self.child_ids = ""
|
||||
self.tot_currency = 0.0
|
||||
|
@ -109,6 +115,7 @@ class general_ledger(rml_parse.rml_parse):
|
|||
return result
|
||||
|
||||
def get_children_accounts(self, account, form):
|
||||
|
||||
self.child_ids = self.pool.get('account.account').search(self.cr, self.uid,
|
||||
[('parent_id', 'child_of', self.ids)])
|
||||
res = []
|
||||
|
@ -116,21 +123,25 @@ class general_ledger(rml_parse.rml_parse):
|
|||
## We will make the test for period or date
|
||||
## We will now make the test
|
||||
#
|
||||
if form.has_key('fiscalyear'):
|
||||
if form.has_key('fiscalyear'):
|
||||
ctx['fiscalyear'] = form['fiscalyear']
|
||||
ctx['periods'] = form['periods'][0][2]
|
||||
else:
|
||||
ctx['date_from'] = form['date_from']
|
||||
ctx['date_to'] = form['date_to']
|
||||
##
|
||||
#
|
||||
|
||||
#
|
||||
self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx)
|
||||
|
||||
for child_id in self.pool.get('account.account').search(self.cr, self.uid,
|
||||
[('parent_id', 'child_of', [account.id])]):
|
||||
|
||||
child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id)
|
||||
|
||||
sold_account = self._sum_solde_account(child_account,form)
|
||||
self.sold_accounts[child_account.id] = sold_account
|
||||
|
||||
if form['display_account'] == 'bal_mouvement':
|
||||
if child_account.type != 'view' \
|
||||
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
|
||||
|
@ -153,16 +164,24 @@ class general_ledger(rml_parse.rml_parse):
|
|||
res.append(child_account)
|
||||
|
||||
##
|
||||
if form['soldeinit']:
|
||||
## We will now compute solde initiaux
|
||||
|
||||
|
||||
## We will now compute solde initiaux
|
||||
if not len(res):
|
||||
return[account]
|
||||
else:
|
||||
for move in res:
|
||||
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date < '" + self.borne_date['max_date'] + "'" + " AND l.date > '" + self.borne_date['min_date'] + "'"
|
||||
|
||||
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date <= '" + self.borne_date['max_date'] + "'" + " AND l.date >= '" + self.borne_date['min_date'] + "'"
|
||||
self.cr.execute(SOLDEINIT)
|
||||
resultat = self.cr.dictfetchall()
|
||||
resultat = self.cr.dictfetchall()
|
||||
|
||||
if resultat[0] :
|
||||
|
||||
if resultat[0]['sum_debit'] == None:
|
||||
sum_debit = 0
|
||||
else:
|
||||
|
||||
sum_debit = resultat[0]['sum_debit']
|
||||
if resultat[0]['sum_credit'] == None:
|
||||
sum_credit = 0
|
||||
|
@ -175,47 +194,83 @@ class general_ledger(rml_parse.rml_parse):
|
|||
else:
|
||||
move.init_credit = 0
|
||||
move.init_debit = 0
|
||||
|
||||
|
||||
##
|
||||
|
||||
return res
|
||||
|
||||
def get_min_date(self,form):
|
||||
|
||||
## Get max born from account_fiscal year
|
||||
#
|
||||
sql = """ select min(fy.date_start) from account_fiscalyear
|
||||
sql = """ select min(fy.date_start) as start_date,max(fy.date_stop) as stop_date from account_fiscalyear
|
||||
As fy where fy.state <> 'close'
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_min = res[0]['min']
|
||||
#
|
||||
##
|
||||
if form.has_key('fiscalyear'):
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
if form['state'] == 'byperiod':
|
||||
## This function will return the most aged date
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) from account_period as p where p.id in ( """ + periods_id + """)
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_max = res[0]['min']
|
||||
else:
|
||||
borne_max = form['date_from']
|
||||
date_borne = {
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
elif form['state'] == 'bydate':
|
||||
borne_min = form['date_from']
|
||||
borne_max = form['date_to']
|
||||
elif form['state'] == 'all':
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
period_min = res[0]['start_date']
|
||||
period_max = res[0]['stop_date']
|
||||
date_min = form['date_from']
|
||||
date_max = form['date_to']
|
||||
if period_min<date_min:
|
||||
borne_min = period_min
|
||||
else :
|
||||
borne_min = date_min
|
||||
if date_max<period_max:
|
||||
borne_max = period_max
|
||||
else :
|
||||
borne_max = date_max
|
||||
elif form['state'] == 'none':
|
||||
sql = """
|
||||
SELECT min(date) as start_date,max(date) as stop_date FROM account_move_line """
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
self.date_borne = {
|
||||
'min_date': borne_min,
|
||||
'max_date': borne_max,
|
||||
}
|
||||
return date_borne
|
||||
return self.date_borne
|
||||
|
||||
|
||||
|
||||
def lines(self, account, form):
|
||||
|
||||
inv_types = {
|
||||
'out_invoice': 'CI: ',
|
||||
'in_invoice': 'SI: ',
|
||||
|
@ -223,18 +278,27 @@ class general_ledger(rml_parse.rml_parse):
|
|||
'in_refund': 'SR: ',
|
||||
}
|
||||
### We will now compute solde initaux
|
||||
|
||||
|
||||
if form['sortbydate'] == 'sort_date':
|
||||
sorttag = 'l.date'
|
||||
else:
|
||||
sorttag = 'j.code'
|
||||
|
||||
sql = """
|
||||
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id
|
||||
FROM account_move_line l LEFT JOIN res_currency c on (l.currency_id=c.id) JOIN account_journal j on (l.journal_id=j.id)
|
||||
AND account_id = %d AND %s
|
||||
ORDER by %s"""%(account.id,self.query,sorttag)
|
||||
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id
|
||||
FROM account_move_line as l
|
||||
LEFT JOIN res_currency c on (l.currency_id=c.id)
|
||||
JOIN account_journal j on (l.journal_id=j.id)
|
||||
AND account_id = %d
|
||||
AND %s
|
||||
WHERE l.date<='%s'
|
||||
AND l.date>='%s'
|
||||
ORDER by %s"""%(account.id,self.query,self.date_borne['max_date'],self.date_borne['min_date'],sorttag)
|
||||
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
sum = 0.0
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
for l in res:
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%d-%m-%Y %H:%M", time.localtime()) ]]</drawString>
|
||||
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
|
||||
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
|
||||
|
||||
|
||||
|
||||
<lineMode width="0.7"/>
|
||||
<lines>1cm 27.7cm 20cm 27.7cm</lines>
|
||||
|
@ -32,29 +32,28 @@
|
|||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
|
||||
|
||||
<blockTableStyle id="tbl_header">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
<blockTableStyle id="tbl_content">
|
||||
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
|
||||
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
|
||||
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#777777" start="0,0" stop="0,0"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
|
||||
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
|
@ -91,247 +90,89 @@
|
|||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<blockTable colWidths="54.0,155.0,70.0,20.0,80.0,59.0,52.0,54.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
|
||||
<blockTable colWidths="54.0,135.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3_centre">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Partner</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Mvt</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Crebit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">Balance</para>
|
||||
</td>
|
||||
<td><para style="P3">Date</para></td>
|
||||
<td><para style="P3">Partner</para></td>
|
||||
<td><para style="P3">Ref</para></td>
|
||||
<td><para style="P3">Mvt</para></td>
|
||||
<td><para style="P3">Entry Label</para></td>
|
||||
<td><para style="P4">Debit</para></td>
|
||||
<td><para style="P4">Crebit</para></td>
|
||||
<td><para style="P9">Balance</para></td>
|
||||
</tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<td>
|
||||
<blockTable colWidths="48.0,155.0,70.0,20.0,80.0,59.0,52.0,54.0" style="tbl_content">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="273.00,100.0,52.5,52.5,52.5" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="P16"></para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P3">Balance Initial</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ o.init_debit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ o.init_credit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ (o.init_debit - o.init_credit) or '0.0' ]]</para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td>
|
||||
<para style="P3">[[ line['date'] ]]</para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P3">[[ line['partner'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['ref'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['move'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
<blockTable colWidths="280.0,100.0,52.5,52.5,52.5" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code or '']] [[ o.name or '']]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td><para style="P3">[[ line['date'] or '' ]]</para></td>
|
||||
<td><para style="P3">[[ line['partner'] or '']]</para></td>
|
||||
<td><para style="P3">[[ line['ref'] or '']]</para></td>
|
||||
<td><para style="P3">[[ line['move'] or '']]</para></td>
|
||||
<td><para style="P3">[[ line['name'] or '' ]]</para></td>
|
||||
<td><para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<blockTable colWidths="59.0,125.0,66.0,20.0,100.0,50.0,50.0,50.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3_centre">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Partner</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Mvt</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Crebit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Currency</para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<td>
|
||||
<blockTable colWidths="54.0,125.0,66.0,20.0,100.0,50.0,50.0,50.0,40.0" style="tbl_content" >
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="259.00,100.0,50.0,50.0,49.0,40.00" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<para style="P9b"><u> [[ sum_currency_amount_account(a, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="P16"></para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P3">Balance Initial</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ o.init_debit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ o.init_credit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ (o.init_debit - o.init_credit) or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4"> </para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td>
|
||||
<para style="P3">[[ line['date'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['partner'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['ref'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['move'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]</para>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<blockTable colWidths="59.0,105.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="P3">Date</para></td>
|
||||
<td><para style="P3">Partner</para></td>
|
||||
<td><para style="P3">Ref</para></td>
|
||||
<td><para style="P3">Mvt</para></td>
|
||||
<td><para style="P3">Entry Label</para></td>
|
||||
<td><para style="P4">Debit</para></td>
|
||||
<td><para style="P4">Crebit</para></td>
|
||||
<td><para style="P4">Balance</para></td>
|
||||
<td><para style="P4">Currency</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="264.00,100.0,50.0,50.0,49.0,40.00" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code or '' ]] [[ o.name or '' ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td><para style="P9b"><u> [[ sum_currency_amount_account(a, data['form']) or '0.0' ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td><para style="P3">[[ line['date'] or '' ]]</para></td>
|
||||
<td><para style="P3">[[ line['partner'] or '' ]]</para></td>
|
||||
<td><para style="P3">[[ line['ref'] or '']]</para></td>
|
||||
<td><para style="P3">[[ line['move'] or '' ]]</para></td>
|
||||
<td><para style="P3">[[ line['name'] or '' ]]</para></td>
|
||||
<td><para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] or '']]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
</story>
|
||||
|
||||
|
||||
|
||||
</document>
|
||||
|
||||
|
||||
|
||||
</document>
|
|
@ -35,8 +35,8 @@ import pooler
|
|||
|
||||
class general_ledger_landscape(rml_parse.rml_parse):
|
||||
_name = 'report.account.general.ledger_landscape'
|
||||
|
||||
|
||||
|
||||
|
||||
def preprocess(self, objects, data, ids):
|
||||
##
|
||||
self.borne_date = self.get_min_date(data['form'])
|
||||
|
@ -46,18 +46,19 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
new_ids = ids
|
||||
else:
|
||||
new_ids.append(data['form']['Account_list'])
|
||||
|
||||
|
||||
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
|
||||
|
||||
super(general_ledger_landscape, self).preprocess(objects, data, new_ids)
|
||||
|
||||
|
||||
super(general_ledger_landscape, self).preprocess(objects, data, new_ids)
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(general_ledger_landscape, self).__init__(cr, uid, name, context)
|
||||
self.date_borne = {}
|
||||
self.query = ""
|
||||
self.child_ids = ""
|
||||
self.tot_currency = 0.0
|
||||
self.period_sql = ""
|
||||
self.sold_accounts = {}
|
||||
self.sold_accounts = {}
|
||||
self.localcontext.update( {
|
||||
'time': time,
|
||||
'lines': self.lines,
|
||||
|
@ -66,7 +67,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
'sum_solde_account': self._sum_solde_account,
|
||||
'sum_debit': self._sum_debit,
|
||||
'sum_credit': self._sum_credit,
|
||||
'sum_solde': self._sum_solde,
|
||||
'sum_solde': self._sum_solde,
|
||||
'get_children_accounts': self.get_children_accounts,
|
||||
'sum_currency_amount_account': self._sum_currency_amount_account
|
||||
})
|
||||
|
@ -75,7 +76,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
result = {}
|
||||
#for id in ids:
|
||||
# result.setdefault(id, False)
|
||||
|
||||
|
||||
for account_line in self.pool.get('account.move.line').browse(cr, uid, ids, context):
|
||||
# For avoid long text in the field we will limit it to 5 lines
|
||||
#
|
||||
|
@ -85,7 +86,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
num_id_move = str(account_line.move_id.id)
|
||||
num_id_line = str(account_line.id)
|
||||
account_id = str(account_line.account_id.id)
|
||||
# search the basic account
|
||||
# search the basic account
|
||||
# We have the account ID we will search all account move line from now until this time
|
||||
# We are in the case of we are on the top of the account move Line
|
||||
cr.execute('SELECT distinct(ac.code) as code_rest,ac.name as name_rest from account_account AS ac, account_move_line mv\
|
||||
|
@ -103,68 +104,102 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
result[account_line.id] = concat + '...'
|
||||
break
|
||||
rup_id+=1
|
||||
|
||||
#print str(result)
|
||||
return result
|
||||
|
||||
|
||||
def get_min_date(self,form):
|
||||
|
||||
## Get max born from account_fiscal year
|
||||
#
|
||||
sql = """ select min(fy.date_start) from account_fiscalyear
|
||||
sql = """ select min(fy.date_start) as start_date,max(fy.date_stop) as stop_date from account_fiscalyear
|
||||
As fy where fy.state <> 'close'
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_min = res[0]['min']
|
||||
#
|
||||
##
|
||||
if form.has_key('fiscalyear'):
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
if form['state'] == 'byperiod':
|
||||
## This function will return the most aged date
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) from account_period as p where p.id in ( """ + periods_id + """)
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_max = res[0]['min']
|
||||
else:
|
||||
borne_max = form['date_from']
|
||||
date_borne = {
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
elif form['state'] == 'bydate':
|
||||
borne_min = form['date_from']
|
||||
borne_max = form['date_to']
|
||||
elif form['state'] == 'all':
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
period_min = res[0]['start_date']
|
||||
period_max = res[0]['stop_date']
|
||||
date_min = form['date_from']
|
||||
date_max = form['date_to']
|
||||
if period_min<date_min:
|
||||
borne_min = period_min
|
||||
else :
|
||||
borne_min = date_min
|
||||
if date_max<period_max:
|
||||
borne_max = period_max
|
||||
else :
|
||||
borne_max = date_max
|
||||
elif form['state'] == 'none':
|
||||
|
||||
sql = """
|
||||
SELECT min(date) as start_date,max(date) as stop_date FROM account_move_line """
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
self.date_borne = {
|
||||
'min_date': borne_min,
|
||||
'max_date': borne_max,
|
||||
}
|
||||
return date_borne
|
||||
return self.date_borne
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def get_children_accounts(self, account, form):
|
||||
|
||||
|
||||
|
||||
self.child_ids = self.pool.get('account.account').search(self.cr, self.uid,
|
||||
[('parent_id', 'child_of', self.ids)])
|
||||
#
|
||||
#
|
||||
res = []
|
||||
ctx = self.context.copy()
|
||||
## We will make the test for period or date
|
||||
## We will now make the test
|
||||
#
|
||||
if form.has_key('fiscalyear'):
|
||||
if form.has_key('fiscalyear'):
|
||||
ctx['fiscalyear'] = form['fiscalyear']
|
||||
ctx['periods'] = form['periods'][0][2]
|
||||
else:
|
||||
ctx['date_from'] = form['date_from']
|
||||
ctx['date_to'] = form['date_to']
|
||||
##
|
||||
|
||||
|
||||
#
|
||||
self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx)
|
||||
|
||||
|
||||
for child_id in self.pool.get('account.account').search(self.cr, self.uid,[('parent_id', 'child_of', [account.id])]):
|
||||
child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id)
|
||||
sold_account = self._sum_solde_account(child_account,form)
|
||||
|
@ -175,7 +210,6 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
[('account_id','=',child_account.id)],
|
||||
context=ctx)) <> 0 :
|
||||
res.append(child_account)
|
||||
#print "Type de vue :" + form['display_account']
|
||||
elif form['display_account'] == 'bal_solde':
|
||||
if child_account.type != 'view' \
|
||||
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
|
||||
|
@ -183,14 +217,17 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
context=ctx)) <> 0 :
|
||||
if ( sold_account <> 0.0):
|
||||
res.append(child_account)
|
||||
else:
|
||||
else:
|
||||
if child_account.type != 'view' \
|
||||
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
|
||||
[('account_id','=',child_account.id)],
|
||||
context=ctx)) <> 0 :
|
||||
res.append(child_account)
|
||||
##
|
||||
if form['soldeinit']:
|
||||
if not len(res):
|
||||
|
||||
return [account]
|
||||
else:
|
||||
## We will now compute solde initiaux
|
||||
for move in res:
|
||||
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date < '" + self.borne_date['max_date'] + "'" + " AND l.date > '" + self.borne_date['min_date'] + "'"
|
||||
|
@ -205,17 +242,17 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
sum_credit = 0
|
||||
else:
|
||||
sum_credit = resultat[0]['sum_credit']
|
||||
|
||||
|
||||
move.init_credit = sum_credit
|
||||
move.init_debit = sum_debit
|
||||
|
||||
|
||||
else:
|
||||
move.init_credit = 0
|
||||
move.init_debit = 0
|
||||
|
||||
##
|
||||
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def lines(self, account, form):
|
||||
inv_types = {
|
||||
'out_invoice': 'CI: ',
|
||||
|
@ -229,12 +266,19 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
else:
|
||||
sorttag = 'j.code'
|
||||
sql = """
|
||||
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name, l.debit, l.credit, l.period_id
|
||||
FROM account_move_line l LEFT JOIN res_currency c on (l.currency_id=c.id) JOIN account_journal j on (l.journal_id=j.id)
|
||||
AND account_id = %d AND %s
|
||||
ORDER by %s"""%(account.id,self.query,sorttag)
|
||||
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id
|
||||
FROM account_move_line as l
|
||||
LEFT JOIN res_currency c on (l.currency_id=c.id)
|
||||
JOIN account_journal j on (l.journal_id=j.id)
|
||||
AND account_id = %d
|
||||
AND %s
|
||||
WHERE l.date<='%s'
|
||||
AND l.date>='%s'
|
||||
ORDER by %s"""%(account.id,self.query,self.date_borne['max_date'],self.date_borne['min_date'],sorttag)
|
||||
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
res = self.cr.dictfetchall()
|
||||
sum = 0.0
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
for l in res:
|
||||
|
@ -258,11 +302,11 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
if (l['credit'] > 0):
|
||||
if l['amount_currency'] != None:
|
||||
l['amount_currency'] = abs(l['amount_currency']) * -1
|
||||
|
||||
|
||||
#
|
||||
if l['amount_currency'] != None:
|
||||
self.tot_currency = self.tot_currency + l['amount_currency']
|
||||
|
||||
self.tot_currency = self.tot_currency + l['amount_currency']
|
||||
|
||||
return res
|
||||
|
||||
def _sum_debit_account(self, account, form):
|
||||
|
@ -291,7 +335,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
sum_credit += account.init_credit
|
||||
#
|
||||
##
|
||||
|
||||
|
||||
return sum_credit
|
||||
|
||||
def _sum_solde_account(self, account, form):
|
||||
|
@ -301,7 +345,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
sum_solde = self.cr.fetchone()[0] or 0.0
|
||||
if form['soldeinit']:
|
||||
sum_solde += account.init_debit - account.init_credit
|
||||
|
||||
|
||||
return sum_solde
|
||||
|
||||
def _sum_debit(self, form):
|
||||
|
@ -330,31 +374,24 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
self.cr.execute("SELECT (sum(debit) - sum(credit)) as tot_solde "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id in ("+','.join(map(str, self.child_ids))+") AND "+self.query)
|
||||
# print ("SELECT (sum(debit) - sum(credit)) as Test "\
|
||||
# "FROM account_move_line l "\
|
||||
# "WHERE l.account_id in ("+','.join(map(str, child_ids))+") AND "+query+period_sql)
|
||||
sum_solde = self.cr.fetchone()[0] or 0.0
|
||||
return sum_solde
|
||||
|
||||
|
||||
def _set_get_account_currency_code(self, account_id):
|
||||
print"====account_id=====",account_id
|
||||
self.cr.execute("SELECT c.code as code "\
|
||||
"FROM res_currency c,account_account as ac "\
|
||||
"WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id))
|
||||
result = self.cr.fetchone()
|
||||
print"====result====",result
|
||||
if result:
|
||||
self.account_currency = result[0]
|
||||
else:
|
||||
self.account_currency = False
|
||||
|
||||
|
||||
|
||||
def _sum_currency_amount_account(self, account, form):
|
||||
|
||||
self._set_get_account_currency_code(account.id)
|
||||
self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %d "%account.id)
|
||||
total = self.cr.fetchone()
|
||||
|
||||
|
||||
if self.account_currency:
|
||||
return_field = str(total[0]) + self.account_currency
|
||||
return return_field
|
||||
|
|
|
@ -24,39 +24,38 @@
|
|||
<drawString x="37.20cm" y="0.90cm">Page <pageNumber/></drawString>
|
||||
|
||||
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
|
||||
|
||||
|
||||
|
||||
<lineMode width="0.7"/>
|
||||
<lines>1.3cm 24.9cm 38.3cm 24.9cm</lines>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
</pageGraphics>
|
||||
|
||||
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
|
||||
|
||||
<blockTableStyle id="tbl_header">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
<blockTableStyle id="tbl_content">
|
||||
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
|
||||
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#777777" start="0,0" stop="0,0"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
|
||||
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
|
@ -92,335 +91,93 @@
|
|||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
|
||||
|
||||
<blockTable colWidths="55.0,35.0,180.0, 90.0,30.0,345.0,50.0,69.0,72.0,64.0,58.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="date">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="date">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P2">Partner</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P2">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P2">Mvt</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P3">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font> </para>
|
||||
<para style="P3">Counterpart</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P4">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P4">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P4">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P4">Currency</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
|
||||
<td>
|
||||
|
||||
<blockTable colWidths="50.0,35.0,180.0, 90.0,30.0,345.0,50.0,69.0,72.0,64.0,58.0" style="tbl_content" >
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="400.0,374.0,69.0,72.0,64.0,59.00" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[ sum_credit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9b"><u>[[ sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<para style="P9b"><u> [[ sum_currency_amount_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="P3_content">Balance Initial</para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ o.init_debit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ o.init_credit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ (o.init_debit - o.init_credit) or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content"> </para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<blockTable colWidths="55.0,35.0,150.0, 90.0,60.0,345.0,50.0,69.0,72.0,64.0,58.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Date</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">JNRL</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Partner</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Ref</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Mvt</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P3">Entry Label</para></td>
|
||||
<td><para style="P12"><font color="white"> </font> </para><para style="P3">Counterpart</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Debit</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Credit</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Balance</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Currency</para></td>
|
||||
</tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="404.0,375.0,69.0,72.0,64.0,59.00" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ sum_credit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[ sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td><para style="P9b"><u> [[ sum_currency_amount_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td><para style="P2_content">[[ line['date'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['code'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['partner'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['ref'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['move'] ]]</para></td>
|
||||
<td><para style="P3_content">[[ line['name'] ]]</para></td>
|
||||
<td><para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<blockTable colWidths="55.0,35.0,166.0,90.0,60.0,390.0,50.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td>
|
||||
|
||||
<para style="P2_content">[[ line['date'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['partner'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['ref'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['move'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content">[[ line['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]</para>
|
||||
</td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Date</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">JNRL</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Partner</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Ref</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Mvt</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P3">Entry Label</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P3">Counterpart</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Debit</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Credit</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Balance</para></td>
|
||||
</tr>
|
||||
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</blockTable>
|
||||
|
||||
|
||||
<blockTable colWidths="55.0,35.0,196.0,90.0,30.0,390.0,50.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="date">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="date">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P2">Partner</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P2">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P2">Mvt</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P3">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P3">Counterpart</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P4">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P4">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P4">Balance</para>
|
||||
</td>
|
||||
<blockTable colWidths="405.0,435.0,69.0,72.0,64.0" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0']]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0']]</u></para></td>
|
||||
<td><para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<blockTable colWidths="50.0,35.0,196.0, 90.0,30.0,390.0,50.0,69.0,72.0,64.0" style="tbl_content" >[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="400.0,435.0,69.0,72.0,64.0" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0']]</u></para>
|
||||
</td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0']]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P3_content">Solde Initial</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P4_content">[[ o.init_debit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ o.init_credit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ o.init_debit - o.init_credit or '0.0' ]]</para>
|
||||
</td>
|
||||
|
||||
<tr>
|
||||
[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td><para style="P2_content">[[ line['date'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['code'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['partner'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['ref'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['move'] ]]</para></td>
|
||||
<td><para style="P3_content">[[ line['name'] ]]</para></td>
|
||||
<td><para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
|
||||
</tr>
|
||||
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td>
|
||||
<para style="P2_content">[[ line['date'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['partner'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['ref'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['move'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content">[[ line['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
||||
|
||||
</story>
|
||||
</document>
|
||||
</blockTable>
|
||||
</story>
|
||||
</document>
|
|
@ -14,195 +14,193 @@
|
|||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<!-- <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,-1"/> -->
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Tableau3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="4,0" stop="4,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="5,0" stop="5,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="6,0" stop="6,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="7,0" stop="7,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Tableau6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,2" stop="7,2"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P5" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P6" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P7" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P9" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P10" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P11" fontName="Times-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12" fontName="Times-Roman" fontSize="11.0" leading="14"/>
|
||||
<paraStyle name="P13" fontName="Times-Roman" fontSize="11.0" leading="14"/>
|
||||
<paraStyle name="P14" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT"/>
|
||||
<paraStyle name="P15" fontName="Times-Roman" fontSize="11.0" leading="14"/>
|
||||
<paraStyle name="P16" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT"/>
|
||||
<paraStyle name="P17" fontName="Times-Roman" fontSize="14.0" leading="17" alignment="CENTER"/>
|
||||
<paraStyle name="P18" fontName="Times-Roman" fontSize="14.0" leading="17" alignment="LEFT"/>
|
||||
<paraStyle name="P19" fontName="Times-Roman" alignment="LEFT"/>
|
||||
<paraStyle name="P20" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||
<paraStyle name="P1" fontName="Helvetica"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="11.0" leading="14"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT"/>
|
||||
<paraStyle name="P4" fontName="Helvetica-BoldOblique" fontSize="14.0" leading="17" alignment="CENTER"/>
|
||||
<paraStyle name="P5" fontName="Helvetica-BoldOblique" fontSize="14.0" leading="17" alignment="LEFT"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" alignment="LEFT"/>
|
||||
<paraStyle name="P7" fontName="Helvetica-BoldOblique" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8a" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P14" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P15" fontName="Helvetica" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P16" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P17" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P19" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P20" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P20a" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P21" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P22" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P23" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P24" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P25" fontName="Helvetica" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="P1">[[ repeatIn(objects,'o') ]]</para>
|
||||
<para style="P1">[[ setLang(o.lang) ]]</para>
|
||||
<para style="P7">[[ repeatIn(objects,'o') ]]</para>
|
||||
<para style="P7">[[ setLang(o.lang) ]]</para>
|
||||
<blockTable colWidths="286.0,224.0" style="Tableau2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P2">
|
||||
<para style="P11">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">[[ o.name ]]</para>
|
||||
<para style="P13">[[ adr_get(o, 'invoice')['name'] ]]</para>
|
||||
<para style="P13">[[ adr_get(o, 'invoice')['street'] ]]</para>
|
||||
<para style="P13">[[ adr_get(o, 'invoice')['zip'] ]] [[ adr_get(o, 'invoice')['city'] ]]</para>
|
||||
<para style="P13">[[ adr_get(o, 'invoice')['country_id'] and adr_get(o, 'invoice')['country_id'][1] ]]</para>
|
||||
<para style="P13">
|
||||
<para style="P16">[[ o.name ]]</para>
|
||||
<para style="P17">[[ adr_get(o, 'invoice')['name'] ]]</para>
|
||||
<para style="P17">[[ adr_get(o, 'invoice')['street'] ]]</para>
|
||||
<para style="P17">[[ adr_get(o, 'invoice')['zip'] ]] [[ adr_get(o, 'invoice')['city'] ]]</para>
|
||||
<para style="P17">[[ adr_get(o, 'invoice')['country_id'] and adr_get(o, 'invoice')['country_id'][1] ]]</para>
|
||||
<para style="P17">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P13">VAT: [[ o.vat or removeParentNode('para') ]]</para>
|
||||
<para style="P17">VAT: [[ o.vat or removeParentNode('para') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P4">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P5">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P17"><font face="Helvetica">Document</font><font face="Helvetica">:</font> Customer account statement</para>
|
||||
<para style="P17">
|
||||
<font color="white"> </font>
|
||||
<font face="Helvetica">Date: </font>
|
||||
<font face="Helvetica">[[ time.strftime('%d/%m/%Y') ]]</font>
|
||||
</para>
|
||||
<para style="P18">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P13"><font face="Times-Roman">Document</font><font face="Times-Roman">:</font> Customer account statement</para>
|
||||
<para style="P13">
|
||||
<font face="Times-Roman">Date: </font>
|
||||
<font face="Times-Roman">[[ time.strftime('%d/%m/%Y') ]]</font>
|
||||
</para>
|
||||
<para style="P15"><font face="Times-Roman">Customer Ref:</font> [[ o.id ]]</para>
|
||||
<para style="P16">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P16">Dear Sir/Madam,</para>
|
||||
<para style="P16">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P16">Exception made of a mistake of our side, it seems that the following bills stay unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days.</para>
|
||||
<para style="P16">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P16">Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at [[ tel_get(company.partner_id) ]].</para>
|
||||
<para style="P16">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P16">Best regards.</para>
|
||||
<para style="P18"><font face="Helvetica">Customer Ref:</font> [[ o.id ]]</para>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="59.0,137.0,65.0,58.0,60.0,57.0,56.0,19.0" style="Tableau3">
|
||||
<para style="P19">Dear Sir/Madam,</para>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P19">Exception made of a mistake of our side, it seems that the following bills stay unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days.</para>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P19">Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at +32 81 81 37 00.</para>
|
||||
<para style="P19">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P19">Best regards.</para>
|
||||
<para style="P6">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="59.0,130.0,65.0,65.0,60.0,57.0,56.0,19.0" style="Tableau3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">Date</para>
|
||||
<para style="P20">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Description</para>
|
||||
<para style="P20">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Ref</para>
|
||||
<para style="P20">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Maturity date</para>
|
||||
<para style="P20">Maturity date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Due</para>
|
||||
<para style="P20a">Due</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Paid</para>
|
||||
<para style="P20a">Paid</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Maturity</para>
|
||||
<para style="P20a">Maturity</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Li.</para>
|
||||
<para style="P20a">Li.</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P5">
|
||||
<font face="Times-Roman">[[repeatIn(getLines(o), 'line') ]]</font>
|
||||
<font face="Times-Roman"> [[ line['date'] ]]</font>
|
||||
</para>
|
||||
<para style="P8">Sub-Total: </para>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<para style="P9">[[ '%.2f' % (reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P6">[[ line['name'] ]]</para>
|
||||
<para style="P9">[[ '%.2f' % (reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">[[ line['ref'] ]]</para>
|
||||
<para style="P9">[[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">[[ line['date_maturity'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">[[ line['debit'] and '%.2f' % (line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">[[ line['credit'] and '%.2f' % (line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">[[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and '%.2f' % ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">[[ line['blocked'] and 'X' or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="318.0,61.0,56.0,56.0,19.0" style="Tableau6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11">Sub-Total: </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11">[[ '%.2f' % (reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">
|
||||
<font face="Times-Bold">[[ '%.2f' % (reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">[[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P20">
|
||||
<para style="P15">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11">Balance: </para>
|
||||
<para style="P8">Balance: </para>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<para style="P9">[[ '%.2f' % (reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11">[[ '%.2f' % (reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]</para>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">
|
||||
|
@ -210,27 +208,52 @@
|
|||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11">
|
||||
<para style="P15">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P8a">
|
||||
<font face="Helvetica">[[repeatIn(getLines(o), 'line') ]]</font>
|
||||
<font face="Helvetica"> [[ line['date'] ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P20">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P10">[[ line['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11">[[ line['ref'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11">[[ line['date_maturity'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P14">[[ line['debit'] and '%.2f' % (line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">[[ line['credit'] and '%.2f' % (line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">[[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and '%.2f' % ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">[[ line['blocked'] and 'X' or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<para style="P1">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P14">
|
||||
<font face="Times-Roman">Total amount due: </font>
|
||||
<font face="Times-Roman">[[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] [[ company.currency_id.name ]].</font>
|
||||
<para style="P3">
|
||||
<font face="Helvetica" size="9.0">Total amount due: </font>
|
||||
<font face="Helvetica" size="9.0">[[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] [[ company.currency_id.name ]]</font>
|
||||
<font face="Helvetica">.</font>
|
||||
</para>
|
||||
<para style="P13">
|
||||
<para style="P2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
|
||||
|
|
|
@ -67,10 +67,14 @@ class partner_balance(report_sxw.rml_parse):
|
|||
return full_str_date
|
||||
|
||||
#
|
||||
|
||||
|
||||
def transform_period_into_date_array(self,data):
|
||||
## Get All Period Date
|
||||
#
|
||||
# If we have no period we will take all perdio in the FiscalYear.
|
||||
|
||||
|
||||
if not data['form']['periods'][0][2] :
|
||||
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
else:
|
||||
|
@ -79,18 +83,62 @@ class partner_balance(report_sxw.rml_parse):
|
|||
for period_id in periods_id:
|
||||
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
|
||||
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
|
||||
|
||||
self.date_lst = date_array
|
||||
self.date_lst.sort()
|
||||
|
||||
|
||||
def transform_date_into_date_array(self,data):
|
||||
|
||||
return_array = self.date_range(data['form']['date1'],data['form']['date2'])
|
||||
self.date_lst = return_array
|
||||
self.date_lst.sort()
|
||||
|
||||
|
||||
def transform_both_into_date_array(self,data):
|
||||
if not data['form']['periods'][0][2] :
|
||||
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
else:
|
||||
periods_id = data['form']['periods'][0][2]
|
||||
date_array = []
|
||||
for period_id in periods_id:
|
||||
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
|
||||
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
|
||||
|
||||
period_start_date = date_array[0]
|
||||
date_start_date = data['form']['date1']
|
||||
period_stop_date = date_array[-1]
|
||||
date_stop_date = data['form']['date2']
|
||||
|
||||
if period_start_date<date_start_date:
|
||||
start_date = period_start_date
|
||||
else :
|
||||
start_date = date_start_date
|
||||
|
||||
if date_stop_date<period_stop_date:
|
||||
stop_date = period_stop_date
|
||||
else :
|
||||
stop_date = date_stop_date
|
||||
|
||||
|
||||
final_date_array = []
|
||||
final_date_array = final_date_array + self.date_range(start_date,stop_date)
|
||||
self.date_lst = final_date_array
|
||||
self.date_lst.sort()
|
||||
|
||||
def transform_none_into_date_array(self,data):
|
||||
|
||||
sql = "SELECT min(date) as start_date from account_move_line"
|
||||
self.cr.execute(sql)
|
||||
start_date = self.cr.fetchone()[0]
|
||||
|
||||
sql = "SELECT max(date) as start_date from account_move_line"
|
||||
self.cr.execute(sql)
|
||||
stop_date = self.cr.fetchone()[0]
|
||||
|
||||
|
||||
array = []
|
||||
array = array + self.date_range(start_date,stop_date)
|
||||
self.date_lst = array
|
||||
self.date_lst.sort()
|
||||
|
||||
|
||||
def comma_me(self,amount):
|
||||
if type(amount) is float :
|
||||
|
@ -110,13 +158,27 @@ class partner_balance(report_sxw.rml_parse):
|
|||
# Transformation des date
|
||||
#
|
||||
#
|
||||
|
||||
if data['form']['fiscalyear']:
|
||||
print"data['form']['fiscalyear']=True"
|
||||
self.transform_period_into_date_array(data)
|
||||
else:
|
||||
print"data['form']['fiscalyear']=False"
|
||||
if data['form']['state'] == 'none':
|
||||
|
||||
self.transform_none_into_date_array(data)
|
||||
elif data['form']['state'] == 'bydate':
|
||||
|
||||
self.transform_date_into_date_array(data)
|
||||
elif data['form']['state'] == 'byperiod':
|
||||
|
||||
self.transform_period_into_date_array(data)
|
||||
elif data['form']['state'] == 'all':
|
||||
|
||||
self.transform_both_into_date_array(data)
|
||||
|
||||
|
||||
|
||||
# if data['form']['fiscalyear']:
|
||||
# print"data['form']['fiscalyear']=True"
|
||||
# self.transform_period_into_date_array(data)
|
||||
# else:
|
||||
# print"data['form']['fiscalyear']=False"
|
||||
# self.transform_date_into_date_array(data)
|
||||
##
|
||||
self.date_lst_string = '\'' + '\',\''.join(map(str,self.date_lst)) + '\''
|
||||
## Compute Code
|
||||
|
@ -151,6 +213,7 @@ class partner_balance(report_sxw.rml_parse):
|
|||
#
|
||||
#
|
||||
if data['form']['soldeinit'] :
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT p.ref, p.name,l.account_id,ac.name as account_name,ac.code as code , sum(debit) as debit, sum(credit) as credit, " \
|
||||
"CASE WHEN sum(debit) > sum(credit) " \
|
||||
|
@ -182,6 +245,7 @@ class partner_balance(report_sxw.rml_parse):
|
|||
#
|
||||
#
|
||||
#
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT p.ref,l.account_id,ac.name as account_name,ac.code as code ,p.name, sum(debit) as debit, sum(credit) as credit, " \
|
||||
"CASE WHEN sum(debit) > sum(credit) " \
|
||||
|
@ -461,7 +525,7 @@ class partner_balance(report_sxw.rml_parse):
|
|||
'l.date IN (' + self.date_lst_string + ') ' \
|
||||
'GROUP BY partner_id')
|
||||
a = self.cr.fetchone()[0]
|
||||
print"====self.cr.fetchone()====",a
|
||||
|
||||
if self.cr.fetchone() != None:
|
||||
result_tmp = result_tmp + (a or 0.0)
|
||||
else:
|
||||
|
@ -493,7 +557,7 @@ class partner_balance(report_sxw.rml_parse):
|
|||
(self.date_lst[0],))
|
||||
|
||||
if self.cr.fetchone() != None:
|
||||
result_tmp = float(self.cr.fetchone()[0])
|
||||
result_tmp = float(self.cr.fetchone()[0]) or 0.0
|
||||
else:
|
||||
result_tmp = 0.0
|
||||
#
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<header>
|
||||
<pageGraphics>
|
||||
<!--logo-->
|
||||
<!--<fill color="darkblue"/>-->
|
||||
|
@ -16,15 +17,15 @@
|
|||
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawString x="12.7cm" y="28.1cm">Partner Balance [[ data['form']['result_selection'] == 'customer' and '/ Débiteur' ]] [[ data['form']['result_selection'] == 'supplier' and '/ Créancier' ]] [[ data['form']['result_selection'] == 'all' and '/ Créancier et Débiteur' ]] - [[ get_currency(data['form']) ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">Partnar Balance [[ data['form']['result_selection'] == 'customer' and '/ Débiteur' ]] [[ data['form']['result_selection'] == 'supplier' and '/ Créancier' ]] [[ data['form']['result_selection'] == 'all' and '/ Créancier et Débiteur' ]] [[ company.currency_id.name ]]</drawRightString>
|
||||
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%m-%d-%y %H:%M", time.localtime()) ]]</drawString>
|
||||
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
|
||||
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
|
||||
|
||||
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
|
||||
|
||||
|
||||
|
@ -32,6 +33,7 @@
|
|||
<lines>1cm 27.7cm 20cm 27.7cm</lines>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
</pageGraphics>
|
||||
</header>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
|
@ -55,15 +57,13 @@
|
|||
<lineStyle kind="GRID" colorName="black"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
|
||||
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
|
||||
<!--<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/> -->
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
@ -84,14 +84,18 @@
|
|||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="8.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
|
||||
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="9.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
|
||||
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="8.5" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="8.5" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
|
||||
<paraStyle name="P9" fontName="Helvetica" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P9b" fontName="Helvetica-Bold" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" alignment="CENTER"/>
|
||||
|
@ -108,13 +112,190 @@
|
|||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
|
||||
<blockTableStyle id="TrLevel8">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel7">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel6">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel5">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel4">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel3">
|
||||
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="1,0"/>
|
||||
<blockLeftPadding length="0" start="0,3" stop="1,3"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel2">
|
||||
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="-1,0"/>
|
||||
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel1">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="TrLevel0">
|
||||
<lineStyle kind="LINEBELOW" colorName="#777777" start="0,2" stop="1,2"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#ffffff" start="2,2" stop="-1,2"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="LineLevel1">
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="Line1">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="Line2">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<paraStyle
|
||||
name="Level8"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Level7"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Level6"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Level5"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Level4"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Level3"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle name="Level2"
|
||||
fontSize="8.0"
|
||||
fontName="Helvetica-Bold"
|
||||
/>
|
||||
<paraStyle name="Level1"
|
||||
fontSize="8.0"
|
||||
fontName="Helvetica-Bold"
|
||||
/>
|
||||
|
||||
<paraStyle
|
||||
name="Amt_Level8"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Amt_Level7"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Amt_Level6"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Amt_Level5"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Amt_Level4"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Amt_Level3"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Amt_Level2"
|
||||
fontSize="8.0"
|
||||
fontName="Helvetica-Bold" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
|
||||
/>
|
||||
<paraStyle name="Amt_Level1"
|
||||
fontSize="8.0"
|
||||
fontName="Helvetica-Bold" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
|
||||
/>
|
||||
|
||||
<paraStyle
|
||||
name="Det_Level8"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle
|
||||
name="Det_Level7"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle
|
||||
name="Det_Level6"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle
|
||||
name="Det_Level5"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle
|
||||
name="Det_Level4"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle
|
||||
name="Det_Level3"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle name="Det_Level2"
|
||||
fontSize="8.0" leading="5"
|
||||
fontName="Times-Italic"
|
||||
/>
|
||||
<paraStyle name="Det_Level1"
|
||||
fontSize="8.0" leading="5"
|
||||
fontName="Times-Italic"
|
||||
/>
|
||||
|
||||
<paraStyle
|
||||
name="Det_Amt_Level8"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Det_Amt_Level7"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Det_Amt_Level6"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Det_Amt_Level5"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Det_Amt_Level4"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Det_Amt_Level3"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Det_Amt_Level2"
|
||||
fontSize="8.0"
|
||||
fontName="Times-Italic" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
|
||||
/>
|
||||
<paraStyle name="Det_Amt_Level1"
|
||||
fontSize="8.0"
|
||||
fontName="Times-Italic" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
|
||||
/>
|
||||
|
||||
|
||||
</stylesheet>
|
||||
<story>
|
||||
|
||||
<blockTable colWidths="61.0,240.0,60.0,60.0,60.0,60.0" repeatRows="1" style="Table2">
|
||||
<blockTable colWidths="61.0,206.0,69.0,68.0,69.0,68.0" repeatRows="1" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P12a">Code</para>
|
||||
<para style="P12a">[[ setTag('tr','tr',{'style':'Line1'}) ]] Code </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12a">Partner name</para>
|
||||
|
@ -134,7 +315,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P7">Grand total</para>
|
||||
<para style="P7">[[ setTag('tr','tr',{'style':'Line2'}) ]] Grand total</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8"></para>
|
||||
|
@ -171,22 +352,33 @@
|
|||
<para style="P3">[[ repeatIn(lines(data), 'a') ]]<font face="Helvetica">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['name'] ]] </para>
|
||||
<para style="P3">[[ a['type']==3 and ( setTag('tr','tr',{'style':'TrLevel0'})) ]] [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['type']==1 and ( setTag('blockTable','blockTable',{'style':'LineLevel1'})) ]] [[ a['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['debit'] or '0.0' ]]</para>
|
||||
<para style="P4">
|
||||
<font><u>[[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['debit'] or '0.0' ]]</u></font>
|
||||
<font>[[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['debit'] or '0.0' ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['credit'] or '0.0' ]]</para>
|
||||
<para style="P4">
|
||||
<font><u>[[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['credit'] or '0.0' ]]</u></font>
|
||||
<font>[[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['credit'] or '0.0' ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['balance'] or '0.0' ]]</para>
|
||||
<para style="P4">
|
||||
<font><u>[[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['balance'] or '0.0' ]]</u></font>
|
||||
<font>[[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['balance'] or '0.0' ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['enlitige'] or '0.0' ]]</para>
|
||||
<para style="P4">
|
||||
<font><u>[[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['enlitige'] or '0.0' ]]</u></font>
|
||||
<font>[[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['enlitige'] or '0.0' ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
</story>
|
||||
</document>
|
|
@ -102,6 +102,30 @@
|
|||
<paraStyle name="Caption" fontName="Helvetica" fontSize="1.0" leading="1" spaceBefore="0" spaceAfter="0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
|
||||
<blockTableStyle id="TrLevelaaaaaaaaaaaaaaaaaa">
|
||||
<blockLeftPadding length="300" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevelaaaaaaaaaaaaaaaaa">
|
||||
<blockLeftPadding length="280" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevelaaaaaaaaaaaaaaaa">
|
||||
<blockLeftPadding length="260" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevelaaaaaaaaaaaaaaa">
|
||||
<blockLeftPadding length="240" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevelaaaaaaaaaaaaaa">
|
||||
<blockLeftPadding length="220" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevelaaaaaaaaaaaaa">
|
||||
<blockLeftPadding length="200" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevelaaaaaaaaaaaa">
|
||||
<blockLeftPadding length="180" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevelaaaaaaaaaaa">
|
||||
<blockLeftPadding length="160" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevelaaaaaaaaaa">
|
||||
<blockLeftPadding length="140" start="1,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
|
@ -135,6 +159,39 @@
|
|||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
<paraStyle
|
||||
name="Levelaaaaaaaaaaaaaaaaaa"
|
||||
fontName="Helvetica"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Levelaaaaaaaaaaaaaaaaa"
|
||||
fontName="Helvetica"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Levelaaaaaaaaaaaaaaaa"
|
||||
fontName="Helvetica"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Levelaaaaaaaaaaaaaaa"
|
||||
fontName="Helvetica"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Levelaaaaaaaaaaaaaa"
|
||||
fontName="Helvetica"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Levelaaaaaaaaaaaaa"
|
||||
fontName="Helvetica"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Levelaaaaaaaaaaaa"
|
||||
fontName="Helvetica"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Levelaaaaaaaaaaa"
|
||||
fontName="Helvetica"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Levelaaaaaaaaaa"
|
||||
fontName="Helvetica"
|
||||
|
|
|
@ -59,7 +59,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
for date in date_array:
|
||||
full_str_date.append(str(date))
|
||||
return full_str_date
|
||||
|
||||
|
||||
#
|
||||
def transform_period_into_date_array(self,data):
|
||||
## Get All Period Date
|
||||
|
@ -67,18 +67,61 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
else:
|
||||
periods_id = data['form']['periods'][0][2]
|
||||
date_array = []
|
||||
date_array = []
|
||||
for period_id in periods_id:
|
||||
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
|
||||
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
|
||||
self.date_lst = date_array
|
||||
self.date_lst.sort()
|
||||
|
||||
|
||||
def transform_date_into_date_array(self,data):
|
||||
return_array = self.date_range(data['form']['date1'],data['form']['date2'])
|
||||
self.date_lst = return_array
|
||||
self.date_lst.sort()
|
||||
|
||||
def transform_both_into_date_array(self,data):
|
||||
|
||||
if not data['form']['periods'][0][2] :
|
||||
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
else:
|
||||
periods_id = data['form']['periods'][0][2]
|
||||
date_array = []
|
||||
for period_id in periods_id:
|
||||
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
|
||||
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
|
||||
|
||||
period_start_date = date_array[0]
|
||||
date_start_date = data['form']['date1']
|
||||
period_stop_date = date_array[-1]
|
||||
date_stop_date = data['form']['date2']
|
||||
|
||||
if period_start_date<date_start_date:
|
||||
start_date = period_start_date
|
||||
else :
|
||||
start_date = date_start_date
|
||||
|
||||
if date_stop_date<period_stop_date:
|
||||
stop_date = period_stop_date
|
||||
else :
|
||||
stop_date = date_stop_date
|
||||
final_date_array = []
|
||||
final_date_array = final_date_array + self.date_range(start_date, stop_date)
|
||||
self.date_lst = final_date_array
|
||||
self.date_lst.sort()
|
||||
|
||||
def transform_none_into_date_array(self,data):
|
||||
sql = "SELECT min(date) as start_date from account_move_line"
|
||||
self.cr.execute(sql)
|
||||
start_date = self.cr.fetchone()[0]
|
||||
sql = "SELECT max(date) as start_date from account_move_line"
|
||||
self.cr.execute(sql)
|
||||
stop_date = self.cr.fetchone()[0]
|
||||
array= []
|
||||
array = array + self.date_range(start_date, stop_date)
|
||||
self.date_lst = array
|
||||
self.date_lst.sort()
|
||||
|
||||
|
||||
def comma_me(self,amount):
|
||||
if type(amount) is float :
|
||||
amount = str('%.2f'%amount)
|
||||
|
@ -97,22 +140,31 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
for date_string in self.date_lst:
|
||||
string_map = date_string + ','
|
||||
return string_map
|
||||
|
||||
|
||||
def preprocess(self, objects, data, ids):
|
||||
PARTNER_REQUEST = ''
|
||||
if (data['model'] == 'res.partner'):
|
||||
print"data['model']",data['model']
|
||||
## Si on imprime depuis les partenaires
|
||||
if ids:
|
||||
PARTNER_REQUEST = "AND line.partner_id IN (" + ','.join(map(str, ids)) + ")"
|
||||
# Transformation des date
|
||||
#
|
||||
#
|
||||
if data['form'].has_key('fiscalyear'):
|
||||
self.transform_period_into_date_array(data)
|
||||
else:
|
||||
self.transform_date_into_date_array(data)
|
||||
# if data['form']['fiscalyear']:
|
||||
# self.transform_period_into_date_array(data)
|
||||
# else:
|
||||
# self.transform_date_into_date_array(data)
|
||||
##
|
||||
if data['form']['state'] == 'none':
|
||||
self.transform_none_into_date_array(data)
|
||||
elif data['form']['state'] == 'bydate':
|
||||
self.transform_date_into_date_array(data)
|
||||
elif data['form']['state'] == 'byperiod':
|
||||
self.transform_period_into_date_array(data)
|
||||
elif data['form']['state'] == 'all':
|
||||
self.transform_both_into_date_array(data)
|
||||
|
||||
|
||||
self.date_lst_string = '\'' + '\',\''.join(map(str,self.date_lst)) + '\''
|
||||
#
|
||||
#new_ids = [id for (id,) in self.cr.fetchall()]
|
||||
|
@ -135,14 +187,14 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
self.account_ids = ','.join([str(a) for (a,) in self.cr.fetchall()])
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
partner_to_use = []
|
||||
|
||||
|
||||
if data['form']['soldeinit'] :
|
||||
self.cr.execute(
|
||||
"SELECT DISTINCT line.partner_id " \
|
||||
"FROM account_move_line AS line, account_account AS account " \
|
||||
"WHERE line.partner_id IS NOT NULL " \
|
||||
"AND line.account_id = account.id " \
|
||||
"AND line.date < %s " \
|
||||
"AND line.date <= %s " \
|
||||
"AND line.reconcile_id IS NULL " \
|
||||
# "AND line.account_id IN (" + self.account_ids + ") " \
|
||||
" " + PARTNER_REQUEST + " " \
|
||||
|
@ -165,7 +217,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
for res_line in res:
|
||||
partner_to_use.append(res_line['partner_id'])
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
|
||||
for res_line in res:
|
||||
partner_to_use.append(res_line['partner_id'])
|
||||
new_ids = partner_to_use
|
||||
|
@ -198,7 +250,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
sum = r['debit'] - r['credit']
|
||||
r['progress'] = sum
|
||||
full_account.append(r)
|
||||
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT l.id,l.date,j.code, l.ref, l.name, l.debit, l.credit " \
|
||||
"FROM account_move_line l " \
|
||||
|
@ -216,11 +268,11 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
sum = r['debit'] - r['credit']
|
||||
r['progress'] = sum
|
||||
full_account.append(r)
|
||||
|
||||
|
||||
return full_account
|
||||
|
||||
def _sum_debit_partner(self, partner,data):
|
||||
|
||||
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
result_tmp = 0.0
|
||||
if data['form']['reconcil'] :
|
||||
|
@ -241,7 +293,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
|
||||
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT sum(debit) " \
|
||||
|
@ -251,14 +303,14 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") " ,
|
||||
(partner.id,))
|
||||
|
||||
contemp = self.cr.fetchone()
|
||||
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
return result_tmp
|
||||
|
||||
|
||||
def _sum_credit_partner(self, partner,data):
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
result_tmp = 0.0
|
||||
|
@ -280,7 +332,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line " \
|
||||
|
@ -290,13 +342,13 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"AND date IN (" + self.date_lst_string + ") " ,
|
||||
(partner.id,))
|
||||
|
||||
contemp = self.cr.fetchone()
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
return result_tmp
|
||||
|
||||
|
||||
def _sum_debit(self,data):
|
||||
if not self.ids:
|
||||
return 0.0
|
||||
|
@ -327,18 +379,18 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
# "AND account_id IN (" + self.account_ids + ") " \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
)
|
||||
|
||||
contemp = self.cr.fetchone()
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
|
||||
|
||||
return result_tmp
|
||||
|
||||
|
||||
|
||||
|
||||
def _sum_credit(self,data):
|
||||
if not self.ids:
|
||||
return 0.0
|
||||
|
@ -368,14 +420,14 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
# "AND account_id IN (" + self.account_ids + ") " \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
)
|
||||
contemp = self.cr.fetchone()
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
|
||||
|
||||
return result_tmp
|
||||
|
||||
def _get_company(self, form):
|
||||
|
@ -383,7 +435,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
|
||||
def _get_currency(self, form):
|
||||
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).currency_id.name
|
||||
|
||||
|
||||
report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner',
|
||||
'addons/account/report/third_party_ledger.rml',parser=third_party_ledger,
|
||||
header=False)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
|
||||
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<header>
|
||||
<pageGraphics>
|
||||
|
@ -19,24 +19,24 @@
|
|||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">Third Party Ledger [[ data['form']['result_selection'] == 'customer' and '/ Débiteur' ]] [[ data['form']['result_selection'] == 'supplier' and '/ Créancier' ]] [[ data['form']['result_selection'] == 'all' and '/ Créancier et Débiteur' ]]</drawRightString>
|
||||
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
||||
|
||||
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
|
||||
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
|
||||
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
|
||||
|
||||
|
||||
|
||||
<lineMode width="0.7"/>
|
||||
<lines>1cm 27.7cm 20cm 27.7cm</lines>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
|
||||
|
||||
</pageGraphics>
|
||||
</header>
|
||||
</header>
|
||||
</pageTemplate>
|
||||
|
||||
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
|
@ -53,43 +53,43 @@
|
|||
<blockBackground colorName="#e6e6e6" start="1,1" stop="1,1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,1" stop="2,1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
<blockTableStyle id="tbl_heading">
|
||||
|
||||
|
||||
<blockValign value="TOP"/>
|
||||
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="LEFT"/>
|
||||
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
|
||||
|
||||
|
||||
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockLeftPadding length="0" start="1,0" stop="1,0"/>
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="LEFT"/>
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,-1"/>
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="LEFT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#777777" start="0,0" stop="0,-1"/>
|
||||
|
||||
|
||||
|
||||
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="LEFT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
|
||||
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
|
@ -124,7 +124,7 @@
|
|||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
|
||||
|
||||
<para style="P2"><font color="white"></font></para>
|
||||
<para>
|
||||
<font color="white">[[ data['form']['page_split'] == True or removeParentNode('para') ]] </font>
|
||||
|
@ -133,7 +133,7 @@
|
|||
<blockTable colWidths="50.0,30.0,42.0,220.0,69.0,72.0,63.0" repeatRows="1" style="tbl_heading">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
|
||||
<para style="date">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -147,7 +147,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<para style="P16">Debit</para>
|
||||
</td>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">Credit</para>
|
||||
</td>
|
||||
|
@ -183,7 +183,7 @@
|
|||
<font color="white">[[ data['form']['page_split'] == False or removeParentNode('para') ]] </font>
|
||||
<font color="white">[[ repeatIn(objects, 'p') ]]</font>
|
||||
</para>
|
||||
<blockTable colWidths="200.0,137.0,69.0,72.0,63.0" style="Table5">
|
||||
<blockTable colWidths="300.0,37.0,69.0,72.0,63.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="total">[[ p.ref ]] - [[ p.name ]]</para>
|
||||
|
@ -202,7 +202,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="45.0,30.0,42.0,220.0,69.0,72.0,63.0" style="Table2">
|
||||
<blockTable colWidths="45.0,30.0,262.0,0.0,69.0,72.0,63.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P15"><font face="Helvetica">[[ repeatIn(lines(p,data), 'line') ]]</font>[[ line['date'] ]]</para>
|
||||
|
@ -211,29 +211,29 @@
|
|||
<para style="P3">[[ line['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['ref'] ]]</para>
|
||||
<para style="P3">[[ line['ref'] ]] / [[ line['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['name'] ]]</para>
|
||||
<para style="P4"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">[[ (line['debit']) or '' ]]</para>
|
||||
<para style="P5">[[ (line['debit']) or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">[[ (line['credit']) or '' ]]</para>
|
||||
<para style="P5">[[ (line['credit']) or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">[[ (line['progress']) or '' ]]</para>
|
||||
<para style="P5">[[ (line['progress']) or '0.0' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
|
@ -0,0 +1,191 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<header>
|
||||
<pageGraphics>
|
||||
<!--logo-->
|
||||
<!--<fill color="darkblue"/>-->
|
||||
<!--<stroke color="darkblue"/>-->
|
||||
|
||||
<!--TITLE COMPANY-->
|
||||
<!-- <drawString x="4.6cm" y="28.7cm">[[ company.partner_id.name ]]</drawString> -->
|
||||
|
||||
<setFont name="Helvetica-Bold" size="9"/>
|
||||
|
||||
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">Print Journal - [[ company.currency_id.name ]]</drawRightString>
|
||||
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
|
||||
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
|
||||
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
|
||||
|
||||
|
||||
<lineMode width="0.7"/>
|
||||
<lines>1cm 27.7cm 20cm 27.7cm</lines>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
</pageGraphics>
|
||||
</header>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
||||
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P5" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P6" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P7" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10a" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10b" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11a" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="Table Contents">[[ repeatIn(objects, 'o') ]]</para>
|
||||
<blockTable colWidths="65.0,62.0,58.0,62.0,174.0,57.0,61.0" style="Table1" repeatRows="1">
|
||||
<para style="terp_default_8">[[repeatIn(lines(data['form']['period_id'][0][2],data['form']['journal_id'][0][2],data['form']['sort_selection']), 'line') ]]</para>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P10a">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">Voucher No</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">A/c No.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10a">Third party</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10a">Entry label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10b">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10b">Credit</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11">[[line[0].period_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11a">[[line[0].journal_id.code ]]</para></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<para style="P12"><u>[[ '%.2f' % sum_debit(line[0].period_id.id, line[0].journal_id.id) or '0.00' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><u>[[ '%.2f' % sum_credit(line[0].period_id.id, line[0].journal_id.id) or '0.00' ]]</u></para>
|
||||
</td>
|
||||
</tr >
|
||||
<tr>
|
||||
<para style="terp_default_8">[[repeatIn(line,'l')]]</para>
|
||||
<td>
|
||||
<para style="terp_default_8">[[ l.date ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ l.ref ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ l.account_id.code ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_8">[[ l.partner_id and l.partner_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_8">[[ l.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">[[ l.debit and '%.2f' % l.debit or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">[[ l.credit and '%.2f' % l.credit or '0.00' ]]</para>
|
||||
</td>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</story>
|
||||
</document>
|
|
@ -0,0 +1,247 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<header>
|
||||
<pageGraphics>
|
||||
<setFont name="Helvetica-Bold" size="9"/>
|
||||
|
||||
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">Central Journal-[[ company.currency_id.name ]]</drawRightString>
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
|
||||
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
|
||||
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
|
||||
|
||||
|
||||
<lineMode width="0.7"/>
|
||||
<lines>1cm 27.7cm 20cm 27.7cm</lines>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
|
||||
</pageGraphics>
|
||||
</header>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_header_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Sub_Header_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Subheader_Content_detail">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Account_detail_Title">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Final_Total">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Journal_Line_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<!--blockTable colWidths="180.0,180.0,180.0" style="Table_header_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_header">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_header">Central Journal-[[ company.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable-->
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">[[ repeatIn(objects, 'o') ]]</para>
|
||||
<para style="terp_default_8">[[ repeatIn(lines(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]), 'line') ]]</para>
|
||||
<blockTable colWidths="180.0,180.0,180.0" style="Table_Sub_Header_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Journal Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Journal Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Printing Date</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="180.0,180.0,180.0" style="Table_Subheader_Content_detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ line[0]['journal'].code or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ line[0]['journal'].name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="83.0,272.0,95.0,89.0" style="Table_Account_detail_Title" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Account Num.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Account Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="80.0,272.0,94.0,87.0" style="Table_Final_Total">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9_Right">[[ '%.2f' % sum_debit(line[0]['period'].id, line[0]['journal'].id) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9_Right">[[ '%.2f' % sum_credit(line[0]['period'].id, line[0]['journal'].id) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="80.0,272.0,94.0,87.0" style="Table_Journal_Line_Content">
|
||||
<para style="terp_default_8">[[repeatIn(line,'l')]]</para>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ l['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ l['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(l['debit']) and '%.2f' % l['debit'] or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(l['credit']) and '%.2f' % l['credit'] or '0.00' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
|
@ -0,0 +1,250 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(596.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<header>
|
||||
<pageGraphics>
|
||||
<setFont name="Helvetica-Bold" size="9"/>
|
||||
|
||||
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">General Journal - [[ company.currency_id.name ]]</drawRightString>
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
|
||||
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
|
||||
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
|
||||
|
||||
|
||||
<lineMode width="0.7"/>
|
||||
<lines>1cm 27.7cm 20cm 27.7cm</lines>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
|
||||
</pageGraphics>
|
||||
</header>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Header_Title">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Print_Current_datetime">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Journal_Title">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Final_Total">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Sub_Total">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,0" stop="2,2"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="white" start="0,1" stop="-1,1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Journal_Detail">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<!--blockTable colWidths="180.0,180.0,180.0" style="Table_Header_Title">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_header">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_header">General Journal - [[ company.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable-->
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="75.0,465.0" style="Table_Print_Current_datetime">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Printing Date :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
|
||||
<blockTable colWidths="61.0,228.0,95.0,80.0,73.0" style="Table_Journal_Title" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Jrl Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Journal Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Period</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit Trans.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit Trans.</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="64.0,226.0,82.0,82.0,76.0" style="Table_Final_Total">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9_Right"><u>[[ '%.2f' % sum_debit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]) ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9_Right"><u>[[ '%.2f' % sum_credit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]) ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<para style="terp_default_9"><font>[[ repeatIn( lines( data['form']['period_id'][0][2], data['form']['journal_id'][0][2] ),'line')]]</font></para>
|
||||
<blockTable colWidths="175.0,115.0,82.0,82.0,75.0" style="Table_Sub_Total">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ line[0]['period_name'] ]] :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9_Right"><u>[[ '%.2f' % sum_debit_period( line[0]['pid'],data['form']['journal_id'][0][2]) ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9_Right"><u>[[ '%.2f' % sum_credit_period(line[0]['pid'],data['form']['journal_id'][0][2]) ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="60.0,219.0,88.0,80.0,76.0" style="Table_Journal_Detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ repeatIn(line,'l') ]]</para>
|
||||
<para style="terp_default_9">[[ l['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ l['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line[0]['period_name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ l['debit'] and ('%.2f' % l['debit']) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ l['credit'] and ('%.2f' % l['credit']) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><openerp><data noupdate="1">
|
||||
<?xml version="1.0" encoding="utf-8"?><openerp><data noupdate="0">
|
||||
|
||||
<record id="group_account_invoice" model="res.groups">
|
||||
<field name="name">Finance / Invoice</field>
|
||||
|
@ -11,4 +11,29 @@
|
|||
<record id="group_account_manager" model="res.groups">
|
||||
<field name="name">Finance / Manager</field>
|
||||
</record>
|
||||
|
||||
<record id="menu_finance_configuration" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
<record id="menu_finance_reporting" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
<record id="menu_finance_legal_statement" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
<record id="menu_finance_invoice" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('group_account_invoice')])]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
<record id="menu_automatic_reconcile" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('group_account_user')])]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
<record id="menu_finance_charts" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('group_account_user'), ref('group_account_manager')])]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
</data></openerp>
|
||||
|
|
|
@ -4,15 +4,19 @@
|
|||
"access_account_account_type","account.account.type","model_account_account_type","account.group_account_user",1,0,0,0
|
||||
"access_account_tax","account.tax","model_account_tax","account.group_account_user",1,0,0,0
|
||||
"access_account_account","account.account","model_account_account","account.group_account_user",1,0,0,0
|
||||
"access_account_account_user","account.account user","model_account_account","base.group_user",1,0,0,0
|
||||
"access_account_account_partner_manager","account.account partner manager","model_account_account","base.group_partner_manager",1,0,0,0
|
||||
"access_account_journal_view","account.journal.view","model_account_journal_view","account.group_account_user",1,0,0,0
|
||||
"access_account_journal_column","account.journal.column","model_account_journal_column","account.group_account_user",1,0,0,0
|
||||
"access_account_journal","account.journal","model_account_journal","account.group_account_user",1,0,0,0
|
||||
"access_account_period","account.period","model_account_period","account.group_account_user",1,0,0,0
|
||||
"access_account_journal_period_manager","account.journal.period manager","model_account_journal_period","account.group_account_manager",1,1,1,1
|
||||
"access_account_journal_period","account.journal.period","model_account_journal_period","account.group_account_user",1,1,1,1
|
||||
"access_account_move","account.move","model_account_move","account.group_account_user",1,1,1,1
|
||||
"access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1
|
||||
"access_account_move_reconcile","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1
|
||||
"access_account_tax_code","account.tax.code","model_account_tax_code","account.group_account_user",1,0,0,0
|
||||
"access_account_tax","account.tax","model_account_tax","account.group_account_user",1,0,0,0
|
||||
"access_account_tax_code","account.tax.code","model_account_tax_code",,1,0,0,0
|
||||
"access_account_tax","account.tax","model_account_tax",,1,0,0,0
|
||||
"access_account_model","account.model","model_account_model","account.group_account_user",1,1,1,1
|
||||
"access_account_model_line","account.model.line","model_account_model_line","account.group_account_user",1,1,1,1
|
||||
"access_account_subscription","account.subscription","model_account_subscription","account.group_account_user",1,1,1,1
|
||||
|
@ -24,25 +28,22 @@
|
|||
"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,1,1,1
|
||||
"access_wizard_multi_charts_accounts","wizard.multi.charts.accounts","model_wizard_multi_charts_accounts","account.group_account_manager",1,1,1,1
|
||||
"access_account_bank_accounts_wizard","account.bank.accounts.wizard","model_account_bank_accounts_wizard","account.group_account_manager",1,1,1,1
|
||||
"access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1
|
||||
"access_account_bank_statement","account.bank.statement","model_account_bank_statement","account.group_account_user",1,1,1,1
|
||||
"access_account_bank_statement_reconcile","account.bank.statement.reconcile","model_account_bank_statement_reconcile","account.group_account_user",1,1,1,1
|
||||
"access_account_bank_statement_reconcile_line","account.bank.statement.reconcile.line","model_account_bank_statement_reconcile_line","account.group_account_user",1,1,1,1
|
||||
"access_account_bank_statement_line","account.bank.statement.line","model_account_bank_statement_line","account.group_account_user",1,1,1,1
|
||||
"access_account_analytic_line","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
|
||||
"access_report_hr_timesheet_invoice_journal","report.hr.timesheet.invoice.journal","model_report_hr_timesheet_invoice_journal","account.group_account_manager",1,0,0,0
|
||||
"access_account_invoice","account.invoice","model_account_invoice","account.group_account_user",1,0,0,0
|
||||
"access_account_invoice_line","account.invoice.line","model_account_invoice_line","account.group_account_user",1,0,0,0
|
||||
"access_account_invoice_tax","account.invoice.tax","model_account_invoice_tax","account.group_account_user",1,0,0,0
|
||||
"access_account_analytic_account","account.analytic.account","model_account_analytic_account","account.group_account_user",1,0,0,0
|
||||
"access_account_analytic_account","account.analytic.account","model_account_analytic_account","base.group_user",1,0,0,0
|
||||
"access_account_analytic_journal","account.analytic.journal","model_account_analytic_journal","account.group_account_user",1,0,0,0
|
||||
"access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_user",1,1,1,1
|
||||
"access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_user",1,1,1,1
|
||||
"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_user",1,1,1,1
|
||||
"access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
|
||||
"access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_invoice",1,1,1,1
|
||||
"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_invoice",1,1,1,1
|
||||
"access_account_analytic_line_uinvoice","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
|
||||
"access_account_move_uinvoice","account.move","model_account_move","account.group_account_user",1,1,1,1
|
||||
"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1
|
||||
"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_user",1,1,1,1
|
||||
"access_account_move_uinvoice","account.move","model_account_move","account.group_account_invoice",1,1,1,1
|
||||
"access_account_move_line_uinvoice","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1
|
||||
"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_invoice",1,1,1,1
|
||||
"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_invoice",1,1,1,1
|
||||
"access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,1,1,1
|
||||
"access_account_payment_term_line_manager","account.payment.term.line","model_account_payment_term_line","account.group_account_manager",1,1,1,1
|
||||
"access_account_account_type_manager","account.account.type","model_account_account_type","account.group_account_manager",1,1,1,1
|
||||
|
@ -51,14 +52,29 @@
|
|||
"access_account_journal_view_manager","account.journal.view","model_account_journal_view","account.group_account_manager",1,1,1,1
|
||||
"access_account_journal_column_manager","account.journal.column","model_account_journal_column","account.group_account_manager",1,1,1,1
|
||||
"access_account_journal_manager","account.journal","model_account_journal","account.group_account_manager",1,1,1,1
|
||||
"access_account_journal_invoice","account.journal invoice","model_account_journal","account.group_account_invoice",1,0,0,0
|
||||
"access_account_period_manager","account.period","model_account_period","account.group_account_manager",1,1,1,1
|
||||
"access_account_period_invoice","account.period invoice","model_account_period","account.group_account_invoice",1,0,0,0
|
||||
"access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,1,1,1
|
||||
"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1
|
||||
"access_account_invoice_manager","account.invoice","model_account_invoice","account.group_account_manager",1,1,1,1
|
||||
"access_account_invoice_line_manager","account.invoice.line","model_account_invoice_line","account.group_account_manager",1,1,1,1
|
||||
"access_account_invoice_tax_manager","account.invoice.tax","model_account_invoice_tax","account.group_account_manager",1,1,1,1
|
||||
"access_account_invoice_group_invoice","account.invoice group invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
|
||||
"access_account_analytic_account_manager","account.analytic.account","model_account_analytic_account","account.group_account_manager",1,1,1,1
|
||||
"access_account_analytic_journal_manager","account.analytic.journal","model_account_analytic_journal","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscalyear_user","account.fiscalyear.user","model_account_fiscalyear","account.group_account_user",1,0,0,0
|
||||
"access_account_fiscalyear_invoice","account.fiscalyear.invoice","model_account_fiscalyear","account.group_account_invoice",1,0,0,0
|
||||
"access_res_currency_account_manager","res.currency account manager","base.model_res_currency","group_account_manager",1,1,1,1
|
||||
"access_res_currency_rate_account_manager","res.currency.rate account manager","base.model_res_currency_rate","group_account_manager",1,1,1,1
|
||||
"access_account_config_wizard_account_manager","account.config.wizard account manager","model_account_config_wizard","group_account_manager",1,1,1,1
|
||||
"access_account_config_wizard_system_manager","account.config.wizard system manager","model_account_config_wizard","base.group_system",1,1,1,1
|
||||
"access_account_invoice_user","account.invoice user","model_account_invoice","base.group_user",1,0,0,0
|
||||
"access_account_invoice_user","account.invoice.line user","model_account_invoice_line","base.group_user",1,0,0,0
|
||||
"access_account_invoice_user","account.invoice.tax user","model_account_invoice_tax","base.group_user",1,0,0,0
|
||||
"access_account_payment_term_partner_manager","account.payment.term partner manager","model_account_payment_term","base.group_user",1,0,0,0
|
||||
"access_account_payment_term_line_partner_manager","account.payment.term.line partner manager","model_account_payment_term_line","base.group_user",1,0,0,0
|
||||
"access_account_account_product_manager","account.account product manager","model_account_account","product.group_product_manager",1,0,0,0
|
||||
"access_account_journal_product_manager","account.journal product manager","model_account_journal","product.group_product_manager",1,0,0,0
|
||||
"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
|
||||
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
|
||||
|
|
|
|
@ -64,6 +64,9 @@ import wizard_use_model
|
|||
import wizard_state_open
|
||||
|
||||
import wizard_statement_from_invoice
|
||||
import wizard_print_journal
|
||||
import wizard_central_journal
|
||||
import wizard_general_journal
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -30,41 +30,48 @@ import wizard
|
|||
import pooler
|
||||
import time
|
||||
|
||||
report_type = '''<?xml version="1.0"?>
|
||||
<form string="Select Report Type">
|
||||
</form>'''
|
||||
|
||||
|
||||
dates_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period">
|
||||
<field name="date_from" colspan="4"/>
|
||||
<field name="date_to" colspan="4"/>
|
||||
<field name="display_account" colspan="4"/>
|
||||
|
||||
</form>'''
|
||||
|
||||
dates_fields = {
|
||||
'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
'display_account':{'string':"Display accounts",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]}
|
||||
}
|
||||
|
||||
|
||||
period_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period">
|
||||
<field name="fiscalyear" colspan="4"/>
|
||||
<field name="periods" colspan="4"/>
|
||||
<field name="display_account" colspan="4"/>
|
||||
<field name="company_id"/>
|
||||
<field name="display_account" required = "True"/>
|
||||
<newline/>
|
||||
<field name="fiscalyear"/>
|
||||
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
|
||||
<newline/>
|
||||
<separator string="Filters" colspan="4"/>
|
||||
<field name="state" required="True"/>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('state','=','byperiod'),('state','=','none')]}" colspan="4">
|
||||
<separator string="Date Filter" colspan="4"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('state','=','bydate'),('state','=','none')]}" colspan="4">
|
||||
<separator string="Filter on Periods" colspan="4"/>
|
||||
<field name="periods" colspan="4" nolabel="1"/>
|
||||
|
||||
</group>
|
||||
|
||||
</form>'''
|
||||
|
||||
|
||||
|
||||
period_fields = {
|
||||
'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
|
||||
'help': 'Keep empty for all open fiscal year'},
|
||||
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
|
||||
'state':{
|
||||
'string':"Date/Period Filter",
|
||||
'type':'selection',
|
||||
'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
|
||||
'default': lambda *a:'bydate'
|
||||
},
|
||||
'fiscalyear': {
|
||||
'string':'Fiscal year',
|
||||
'type':'many2one',
|
||||
'relation':'account.fiscalyear',
|
||||
'help':'Keep empty for all open fiscal year'
|
||||
},
|
||||
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
|
||||
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]}
|
||||
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With Movements'),('bal_solde','With Balance != 0'),('bal_all','All')]},
|
||||
'date_from': {'string':" Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
}
|
||||
|
||||
account_form = '''<?xml version="1.0"?>
|
||||
|
@ -76,9 +83,14 @@ account_fields = {
|
|||
'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
|
||||
}
|
||||
|
||||
|
||||
class wizard_report(wizard.interface):
|
||||
def _get_defaults(self, cr, uid, data, context):
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
company_id = user.company_id.id
|
||||
else:
|
||||
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
data['form']['company_id'] = company_id
|
||||
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
|
||||
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
|
||||
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
|
||||
|
@ -86,17 +98,20 @@ class wizard_report(wizard.interface):
|
|||
data['form']['display_account']='bal_all'
|
||||
return data['form']
|
||||
|
||||
def _get_defaults_fordate(self, cr, uid, data, context):
|
||||
data['form']['display_account']='bal_all'
|
||||
def _check_state(self, cr, uid, data, context):
|
||||
|
||||
if data['form']['state'] == 'bydate':
|
||||
self._check_date(cr, uid, data, context)
|
||||
data['form']['fiscalyear'] = 0
|
||||
else :
|
||||
data['form']['fiscalyear'] = 1
|
||||
return data['form']
|
||||
|
||||
|
||||
|
||||
def _check_path(self, cr, uid, data, context):
|
||||
if data['model'] == 'account.account':
|
||||
return 'checktype'
|
||||
return 'checktype'
|
||||
else:
|
||||
return 'account_selection'
|
||||
|
||||
return 'account_selection'
|
||||
|
||||
def _check_date(self, cr, uid, data, context):
|
||||
sql = """
|
||||
|
@ -108,7 +123,6 @@ class wizard_report(wizard.interface):
|
|||
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
|
||||
else:
|
||||
return 'report'
|
||||
|
||||
else:
|
||||
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
|
||||
|
||||
|
@ -123,27 +137,12 @@ class wizard_report(wizard.interface):
|
|||
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel'),('checktype','Print')]}
|
||||
},
|
||||
'checktype': {
|
||||
'actions': [],
|
||||
'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
|
||||
},
|
||||
'with_period': {
|
||||
'actions': [_get_defaults],
|
||||
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
|
||||
},
|
||||
'with_date': {
|
||||
'actions': [_get_defaults_fordate],
|
||||
'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
|
||||
},
|
||||
'checkdate': {
|
||||
'actions': [],
|
||||
'result': {'type':'choice','next_state':_check_date}
|
||||
},
|
||||
|
||||
'report': {
|
||||
'actions': [],
|
||||
'actions': [_check_state],
|
||||
'result': {'type':'print', 'report':'account.account.balance', 'state':'end'}
|
||||
}
|
||||
}
|
||||
wizard_report('account.account.balance.report')
|
||||
|
||||
|
||||
|
|
|
@ -35,76 +35,84 @@ from mx.DateTime import *
|
|||
|
||||
_aged_trial_form = """<?xml version="1.0"?>
|
||||
<form string="Aged Trial Balance">
|
||||
<field name="company_id"/>
|
||||
<newline/>
|
||||
<field name="date1"/>
|
||||
<field name="period_length"/>
|
||||
<newline/>
|
||||
<field name="result_selection"/>
|
||||
<newline/>
|
||||
<field name="direction_selection"/>
|
||||
<field name="company_id"/>
|
||||
<newline/>
|
||||
<field name="date1"/>
|
||||
<field name="period_length"/>
|
||||
<newline/>
|
||||
<field name="result_selection"/>
|
||||
<newline/>
|
||||
<field name="direction_selection"/>
|
||||
</form>"""
|
||||
|
||||
_aged_trial_fields = {
|
||||
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
|
||||
'period_length': {'string': 'Period length (days)', 'type': 'integer', 'required': True, 'default': lambda *a:30},
|
||||
'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
'result_selection':{'string':"Display partner",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]},
|
||||
'direction_selection':{'string':"Display aged balance of",'type':'selection','selection':[('past','Due amount'),('future','Not due amount')]},
|
||||
}
|
||||
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
|
||||
'period_length': {'string': 'Period length (days)', 'type': 'integer', 'required': True, 'default': lambda *a:30},
|
||||
'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
'result_selection':{
|
||||
'string':"Filter on Partners",
|
||||
'type':'selection',
|
||||
'selection':[('customer','Customer'),('supplier','Supplier'),('all','All')],
|
||||
'required':True,
|
||||
'default': lambda *a: 'customer',
|
||||
},
|
||||
'direction_selection':{
|
||||
'string':"Analysis Direction",
|
||||
'type':'selection',
|
||||
'selection':[('past','Past'),('future','Future')],
|
||||
'required':True,
|
||||
'default': lambda *a: 'past',
|
||||
},
|
||||
}
|
||||
|
||||
def _calc_dates(self, cr, uid, data, context):
|
||||
res = {}
|
||||
period_length = data['form']['period_length']
|
||||
if period_length<=0:
|
||||
raise wizard.except_wizard('UserError', 'You must enter a period length that cannot be 0 or below !')
|
||||
start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d")))
|
||||
start = DateTime(int(start.year),int(start.month),int(start.day))
|
||||
if data['form']['direction_selection'] == 'past':
|
||||
for i in range(5)[::-1]:
|
||||
stop = start - RelativeDateTime(days=period_length)
|
||||
res[str(i)] = {
|
||||
'name' : str((5-(i+1))*period_length) + '-' + str((5-i)*period_length),
|
||||
|
||||
'stop': start.strftime('%Y-%m-%d'),
|
||||
'start' : stop.strftime('%Y-%m-%d'),
|
||||
}
|
||||
start = stop - RelativeDateTime(days=1)
|
||||
else:
|
||||
for i in range(5):
|
||||
stop = start + RelativeDateTime(days=period_length)
|
||||
res[str(5-(i+1))] = {
|
||||
'name' : str((i)*period_length)+'-'+str((i+1)*period_length),
|
||||
'start': start.strftime('%Y-%m-%d'),
|
||||
'stop' : stop.strftime('%Y-%m-%d'),
|
||||
}
|
||||
start = stop + RelativeDateTime(days=1)
|
||||
return res
|
||||
res = {}
|
||||
period_length = data['form']['period_length']
|
||||
if period_length<=0:
|
||||
raise wizard.except_wizard('UserError', 'You must enter a period length that cannot be 0 or below !')
|
||||
start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d")))
|
||||
start = DateTime(int(start.year),int(start.month),int(start.day))
|
||||
if data['form']['direction_selection'] == 'past':
|
||||
for i in range(5)[::-1]:
|
||||
stop = start - RelativeDateTime(days=period_length)
|
||||
res[str(i)] = {
|
||||
'name' : str((5-(i+1))*period_length) + '-' + str((5-i)*period_length),
|
||||
|
||||
'stop': start.strftime('%Y-%m-%d'),
|
||||
'start' : stop.strftime('%Y-%m-%d'),
|
||||
}
|
||||
start = stop - RelativeDateTime(days=1)
|
||||
else:
|
||||
for i in range(5):
|
||||
stop = start + RelativeDateTime(days=period_length)
|
||||
res[str(5-(i+1))] = {
|
||||
'name' : str((i)*period_length)+'-'+str((i+1)*period_length),
|
||||
'start': start.strftime('%Y-%m-%d'),
|
||||
'stop' : stop.strftime('%Y-%m-%d'),
|
||||
}
|
||||
start = stop + RelativeDateTime(days=1)
|
||||
return res
|
||||
|
||||
class wizard_report(wizard.interface):
|
||||
def _get_defaults(self, cr, uid, data, context):
|
||||
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
|
||||
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
|
||||
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
company_id = user.company_id.id
|
||||
else:
|
||||
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
data['form']['company_id'] = company_id
|
||||
|
||||
return data['form']
|
||||
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [_get_defaults],
|
||||
'result': {'type':'form', 'arch':_aged_trial_form, 'fields':_aged_trial_fields, 'state':[('end','Cancel'),('print','Print Aged Trial Balance')]},
|
||||
},
|
||||
'print': {
|
||||
'actions': [_calc_dates],
|
||||
'result': {'type':'print', 'report':'account.aged_trial_balance', 'state':'end'},
|
||||
},
|
||||
}
|
||||
def _get_defaults(self, cr, uid, data, context):
|
||||
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
|
||||
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
company_id = user.company_id.id
|
||||
else:
|
||||
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
data['form']['company_id'] = company_id
|
||||
return data['form']
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [_get_defaults],
|
||||
'result': {'type':'form', 'arch':_aged_trial_form, 'fields':_aged_trial_fields, 'state':[('end','Cancel'),('print','Print Aged Trial Balance')]},
|
||||
},
|
||||
'print': {
|
||||
'actions': [_calc_dates],
|
||||
'result': {'type':'print', 'report':'account.aged_trial_balance', 'state':'end'},
|
||||
},
|
||||
}
|
||||
wizard_report('account.aged.trial.balance')
|
||||
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import pooler
|
||||
|
||||
form = '''<?xml version="1.0"?>
|
||||
<form string="Print Central Journal">
|
||||
<field name="journal_id"/>
|
||||
<field name="period_id"/>
|
||||
</form>'''
|
||||
|
||||
fields = {
|
||||
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
|
||||
'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
|
||||
}
|
||||
|
||||
|
||||
class wizard_print_journal(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
|
||||
},
|
||||
'print': {
|
||||
'actions': [],
|
||||
'result': {'type':'print', 'report':'account.central.journal.wiz', 'state':'end'},
|
||||
},
|
||||
}
|
||||
wizard_print_journal('account.central.journal.report')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import pooler
|
||||
|
||||
form = '''<?xml version="1.0"?>
|
||||
<form string="Print General Journal">
|
||||
<field name="journal_id"/>
|
||||
<field name="period_id"/>
|
||||
</form>'''
|
||||
|
||||
fields = {
|
||||
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
|
||||
'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
|
||||
}
|
||||
|
||||
|
||||
class wizard_print_journal(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
|
||||
},
|
||||
'print': {
|
||||
'actions': [],
|
||||
'result': {'type':'print', 'report':'account.general.journal.wiz', 'state':'end'},
|
||||
},
|
||||
}
|
||||
wizard_print_journal('account.general.journal.report')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -29,64 +29,94 @@ import pooler
|
|||
import locale
|
||||
import time
|
||||
|
||||
report_type = '''<?xml version="1.0"?>
|
||||
<form string="Select Report Type">
|
||||
</form>'''
|
||||
|
||||
dates_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period ">
|
||||
<field name="date_from" colspan="4"/>
|
||||
<field name="date_to" colspan="4"/>
|
||||
<field name="sortbydate" colspan="4"/>
|
||||
<field name="display_account" colspan="4"/>
|
||||
<field name="landscape" colspan="4"/>
|
||||
<field name="soldeinit"/>
|
||||
<field name="amount_currency" colspan="4"/>
|
||||
</form>'''
|
||||
|
||||
dates_fields = {
|
||||
'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
|
||||
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
|
||||
'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
|
||||
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
|
||||
'amount_currency':{'string':"with amount in currency",'type':'boolean'}
|
||||
|
||||
}
|
||||
#report_type = '''<?xml version="1.0"?>
|
||||
#<form string="Select Report Type">
|
||||
#</form>'''
|
||||
#
|
||||
#dates_form = '''<?xml version="1.0"?>
|
||||
#<form string="Select period ">
|
||||
# <field name="date_from" colspan="4"/>
|
||||
# <field name="date_to" colspan="4"/>
|
||||
# <field name="sortbydate" colspan="4"/>
|
||||
# <field name="display_account" colspan="4"/>
|
||||
# <field name="landscape" colspan="4"/>
|
||||
# <field name="soldeinit"/>
|
||||
# <field name="amount_currency" colspan="4"/>
|
||||
#</form>'''
|
||||
#
|
||||
#dates_fields = {
|
||||
# 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
# 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
# 'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
|
||||
# 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
|
||||
# 'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
|
||||
# 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
|
||||
# 'amount_currency':{'string':"with amount in currency",'type':'boolean'}
|
||||
#
|
||||
#}
|
||||
|
||||
account_form = '''<?xml version="1.0"?>
|
||||
<form string="Select parent account">
|
||||
<form string="Select Chart">
|
||||
<field name="Account_list" colspan="4"/>
|
||||
</form>'''
|
||||
|
||||
account_fields = {
|
||||
'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
|
||||
'Account_list': {'string':'Chart of Accounts', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
period_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period ">
|
||||
<field name="fiscalyear" colspan="4"/>
|
||||
<field name="periods" colspan="4"/>
|
||||
<field name="sortbydate" colspan="4"/>
|
||||
<field name="display_account" colspan="4"/>
|
||||
<field name="landscape" colspan="4"/>
|
||||
<field name="soldeinit"/>
|
||||
<field name="amount_currency" colspan="4"/>
|
||||
<form string="Select Date-Period">
|
||||
<field name="company_id" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="fiscalyear"/>
|
||||
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
|
||||
<newline/>
|
||||
|
||||
<field name="display_account" required="True"/>
|
||||
<field name="sortbydate" required="True"/>
|
||||
|
||||
<field name="landscape"/>
|
||||
<field name="amount_currency"/>
|
||||
<newline/>
|
||||
<separator string="Filters" colspan="4"/>
|
||||
<field name="state" required="True"/>
|
||||
<newline/>
|
||||
|
||||
<group attrs="{'invisible':[('state','=','byperiod'),('state','=','none')]}" colspan="4">
|
||||
<separator string="Date Filter" colspan="4"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('state','=','bydate'),('state','=','none')]}" colspan="4">
|
||||
<separator string="Filter on Periods" colspan="4"/>
|
||||
<field name="periods" colspan="4" nolabel="1"/>
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</form>'''
|
||||
|
||||
period_fields = {
|
||||
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
|
||||
'state':{
|
||||
'string':"Date/Period Filter",
|
||||
'type':'selection',
|
||||
'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
|
||||
'default': lambda *a:'bydate'
|
||||
},
|
||||
'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
|
||||
'help': 'Keep empty for all open fiscal year'},
|
||||
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
|
||||
'sortbydate':{'string':"Sort by:",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
|
||||
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
|
||||
'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
|
||||
'landscape':{'string':"Landscape Mode",'type':'boolean'},
|
||||
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
|
||||
'amount_currency':{'string':"with amount in currency",'type':'boolean'}
|
||||
'amount_currency':{'string':"With Currency",'type':'boolean'},
|
||||
'date_from': {'string':" Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
|
||||
}
|
||||
def _check_path(self, cr, uid, data, context):
|
||||
if data['model'] == 'account.account':
|
||||
|
@ -101,6 +131,7 @@ def _check(self, cr, uid, data, context):
|
|||
return 'report'
|
||||
|
||||
def _check_date(self, cr, uid, data, context):
|
||||
|
||||
sql = """
|
||||
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date_from'])
|
||||
cr.execute(sql)
|
||||
|
@ -113,24 +144,36 @@ def _check_date(self, cr, uid, data, context):
|
|||
|
||||
else:
|
||||
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
|
||||
|
||||
def _check_state(self, cr, uid, data, context):
|
||||
|
||||
if data['form']['state'] == 'bydate':
|
||||
_check_date(self, cr, uid, data, context)
|
||||
data['form']['fiscalyear'] = 0
|
||||
else :
|
||||
|
||||
data['form']['fiscalyear'] = 1
|
||||
return data['form']
|
||||
|
||||
|
||||
class wizard_report(wizard.interface):
|
||||
def _get_defaults(self, cr, uid, data, context):
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
company_id = user.company_id.id
|
||||
else:
|
||||
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
data['form']['company_id'] = company_id
|
||||
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
|
||||
|
||||
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
|
||||
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
|
||||
data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
data['form']['sortbydate'] = 'sort_date'
|
||||
data['form']['display_account']='bal_all'
|
||||
data['form']['landscape']=True
|
||||
data['form']['amount_currency'] = True
|
||||
return data['form']
|
||||
def _get_defaults_fordate(self, cr, uid, data, context):
|
||||
data['form']['sortbydate'] = 'sort_date'
|
||||
data['form']['display_account']='bal_all'
|
||||
data['form']['landscape']=True
|
||||
data['form']['amount_currency'] = True
|
||||
return data['form']
|
||||
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
|
@ -142,31 +185,19 @@ class wizard_report(wizard.interface):
|
|||
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel'),('checktype','Print')]}
|
||||
},
|
||||
'checktype': {
|
||||
'actions': [],
|
||||
'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
|
||||
},
|
||||
'with_period': {
|
||||
'actions': [_get_defaults],
|
||||
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('checkreport','Print')]}
|
||||
},
|
||||
'with_date': {
|
||||
'actions': [_get_defaults_fordate],
|
||||
'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
|
||||
},
|
||||
'checkdate': {
|
||||
'actions': [],
|
||||
'result': {'type':'choice','next_state':_check_date}
|
||||
},
|
||||
'checkreport': {
|
||||
'actions': [],
|
||||
'result': {'type':'choice','next_state':_check}
|
||||
},
|
||||
'report_landscape': {
|
||||
'actions': [],
|
||||
'actions': [_check_state],
|
||||
'result': {'type':'print', 'report':'account.general.ledger_landscape', 'state':'end'}
|
||||
},
|
||||
'report': {
|
||||
'actions': [],
|
||||
'actions': [_check_state],
|
||||
'result': {'type':'print', 'report':'account.general.ledger', 'state':'end'}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,64 +29,57 @@ import time
|
|||
import wizard
|
||||
import pooler
|
||||
|
||||
#report_type = '''<?xml version="1.0"?>
|
||||
#<form string="Select Report Type">
|
||||
#</form>'''
|
||||
#
|
||||
#
|
||||
#dates_form = '''<?xml version="1.0"?>
|
||||
#<form string="Select period">
|
||||
# <field name="company_id" colspan="4"/>
|
||||
# <newline/>
|
||||
# <field name="date1"/>
|
||||
# <field name="date2"/>
|
||||
# <newline/>
|
||||
# <field name="result_selection"/>
|
||||
# <field name="soldeinit"/>
|
||||
#</form>'''
|
||||
#
|
||||
#dates_fields = {
|
||||
# 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
|
||||
# 'result_selection':{'string':"Display partner ",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]},
|
||||
# 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
|
||||
# 'date1': {'string':'Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
# 'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
#}
|
||||
|
||||
period_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period" colspan = "4">
|
||||
<field name="company_id" colspan="4"/>
|
||||
<field name="state" required="True" colspan = "4"/>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('state','=','none'),('state','=','byperiod')]}" colspan = "4">
|
||||
<field name="date1"/>
|
||||
<field name="date2"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('state','=','none'),('state','=','bydate')]}" colspan = "4">
|
||||
<field name="fiscalyear" colspan="4"/>
|
||||
<field name="periods" colspan="4"/>
|
||||
</group>
|
||||
<form string="Select Date-Period">
|
||||
<field name="company_id"/>
|
||||
<field name="result_selection"/>
|
||||
<field name="soldeinit"/>
|
||||
<newline/>
|
||||
<field name="fiscalyear"/>
|
||||
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
|
||||
<newline/>
|
||||
<separator string="Filters" colspan="4"/>
|
||||
<field name="state" required="True"/>
|
||||
<newline/>
|
||||
|
||||
<group attrs="{'invisible':[('state','=','byperiod'),('state','=','none')]}" colspan="4">
|
||||
<separator string="Date Filter" colspan="4"/>
|
||||
<field name="date1"/>
|
||||
<field name="date2"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('state','=','bydate'),('state','=','none')]}" colspan="4">
|
||||
<separator string="Filter on Periods" colspan="4"/>
|
||||
<field name="periods" colspan="4" nolabel="1"/>
|
||||
|
||||
</group>
|
||||
</form>'''
|
||||
|
||||
period_fields = {
|
||||
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
|
||||
'state':{'string':"Select Report Type",'type':'selection','selection':[('none','None'),('bydate','By Date'),('byperiod','By Period')],'default': lambda *a:'none' },
|
||||
'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
|
||||
'help': 'Keep empty for all open fiscal year','states':{'none':[('readonly',True)],'bydate':[('readonly',True)]}},
|
||||
'state':{
|
||||
'string':"Date/Period Filter",
|
||||
'type':'selection',
|
||||
'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
|
||||
'default': lambda *a:'bydate'
|
||||
},
|
||||
'fiscalyear': {
|
||||
'string':'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
|
||||
'help': 'Keep empty for all open fiscal year'
|
||||
},
|
||||
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty','states':{'none':[('readonly',True)],'bydate':[('readonly',True)]}},
|
||||
'result_selection':{'string':"Display partner",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]},
|
||||
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
|
||||
'date1': {'string':'Start date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
'result_selection':{
|
||||
'string':"Partner",
|
||||
'type':'selection',
|
||||
'selection':[('customer','Receivable Accounts'),('supplier','Payable Accounts'),('all','Receivable and Payable Accounts')],
|
||||
'required':True
|
||||
},
|
||||
'soldeinit':{'string':" Inclure les soldes initiaux",'type':'boolean'},
|
||||
'date1': {'string':' Start date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
'date2': {'string':'End date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
}
|
||||
|
||||
|
||||
class wizard_report(wizard.interface):
|
||||
|
||||
def _get_load(self,cr,uid,data,context):
|
||||
def _get_defaults(self,cr,uid,data,context):
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
company_id = user.company_id.id
|
||||
|
@ -102,30 +95,12 @@ class wizard_report(wizard.interface):
|
|||
data['form']['result_selection'] = 'all'
|
||||
return data['form']
|
||||
|
||||
def _get_defaults(self, cr, uid, data, context):
|
||||
def _check_state(self, cr, uid, data, context):
|
||||
|
||||
if data['form']['state'] == 'none':
|
||||
return 'report'
|
||||
else :
|
||||
if data['form']['state'] == 'byperiod':
|
||||
data['form']['fiscalyear'] = True
|
||||
else :
|
||||
self._check_date(cr, uid, data, context)
|
||||
data['form']['fiscalyear'] = False
|
||||
|
||||
if data['form']['state'] == 'bydate' :
|
||||
self._check_date(cr, uid, data, context)
|
||||
return data['form']
|
||||
|
||||
# def _get_defaults_fordate(self, cr, uid, data, context):
|
||||
# user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
|
||||
# if user.company_id:
|
||||
# company_id = user.company_id.id
|
||||
# else:
|
||||
# company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
# data['form']['company_id'] = company_id
|
||||
# data['form']['soldeinit'] = True
|
||||
# data['form']['result_selection'] = 'all'
|
||||
# return data['form']
|
||||
|
||||
|
||||
def _check_date(self, cr, uid, data, context):
|
||||
|
||||
sql = """
|
||||
|
@ -141,27 +116,14 @@ class wizard_report(wizard.interface):
|
|||
else:
|
||||
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
|
||||
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [_get_load],
|
||||
'actions': [_get_defaults],
|
||||
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
|
||||
},
|
||||
# 'with_period': {
|
||||
# 'actions': [_get_defaults],
|
||||
# 'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
|
||||
# },
|
||||
# 'with_date': {
|
||||
# 'actions': [_get_defaults_fordate],
|
||||
# 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
|
||||
# },
|
||||
## 'checkdate': {
|
||||
## 'actions': [],
|
||||
## 'result': {'type':'choice','next_state':_check_date}
|
||||
## },
|
||||
|
||||
'report': {
|
||||
'actions': [_get_defaults],
|
||||
'actions': [_check_state],
|
||||
'result': {'type':'print', 'report':'account.partner.balance', 'state':'end'}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import pooler
|
||||
|
||||
form = '''<?xml version="1.0"?>
|
||||
<form string="Print Journal">
|
||||
<field name="journal_id"/>
|
||||
<field name="period_id"/>
|
||||
<field name="sort_selection"/>
|
||||
</form>'''
|
||||
|
||||
fields = {
|
||||
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
|
||||
'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
|
||||
'sort_selection':{
|
||||
'string':"Entries Sorted By",
|
||||
'type':'selection',
|
||||
'selection':[('date','By date'),('ref','Reference Number')],
|
||||
'required':True,
|
||||
'default': lambda *a: 'date',
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
class wizard_print_journal(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
|
||||
},
|
||||
'print': {
|
||||
'actions': [],
|
||||
'result': {'type':'print', 'report':'account.journal.period.print.wiz', 'state':'end'},
|
||||
},
|
||||
}
|
||||
wizard_print_journal('account.print.journal.report')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -30,65 +30,65 @@ import wizard
|
|||
import pooler
|
||||
|
||||
|
||||
report_type = '''<?xml version="1.0"?>
|
||||
<form string="Select Report Type">
|
||||
</form>'''
|
||||
|
||||
|
||||
dates_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period">
|
||||
<field name="company_id" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="date1"/>
|
||||
<field name="date2"/>
|
||||
<newline/>
|
||||
<field name="result_selection"/>
|
||||
<field name="soldeinit"/>
|
||||
<field name="reconcil"/>
|
||||
<newline/>
|
||||
<field name="page_split"/>
|
||||
</form>'''
|
||||
|
||||
dates_fields = {
|
||||
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
|
||||
'date1': {'string':'Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
'result_selection':{'string':"Display partners",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]},
|
||||
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
|
||||
'reconcil':{'string':"Inclure les ecritures reconsiliees",'type':'boolean'},
|
||||
'page_split':{'string':"Un partenaire par page",'type':'boolean'},
|
||||
}
|
||||
|
||||
period_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period">
|
||||
<field name="company_id" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="fiscalyear" colspan="4"/>
|
||||
<field name="periods" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="result_selection"/>
|
||||
<field name="soldeinit"/>
|
||||
<form string="Select Date-Period">
|
||||
|
||||
<field name="company_id"/>
|
||||
<field name="result_selection"/>
|
||||
<newline/>
|
||||
<field name="fiscalyear"/>
|
||||
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
|
||||
<group colspan = "4" >
|
||||
<field name="reconcil"/>
|
||||
<newline/>
|
||||
<field name="page_split"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator string="Filters" colspan="4"/>
|
||||
<field name="state" required="True"/>
|
||||
<newline/>
|
||||
|
||||
<group attrs="{'invisible':[('state','=','byperiod'),('state','=','none')]}" colspan="4">
|
||||
<separator string="Date Filter" colspan="4"/>
|
||||
<field name="date1"/>
|
||||
<field name="date2"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('state','=','bydate'),('state','=','none')]}" colspan="4">
|
||||
<separator string="Filter on Periods" colspan="4"/>
|
||||
<field name="periods" colspan="4" nolabel="1"/>
|
||||
</group>
|
||||
|
||||
</form>'''
|
||||
|
||||
period_fields = {
|
||||
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
|
||||
'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
|
||||
'help': 'Keep empty for all open fiscal year'},
|
||||
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
|
||||
'result_selection':{'string':"Display partners",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]},
|
||||
'state':{
|
||||
'string':"Date/Period Filter",
|
||||
'type':'selection',
|
||||
'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
|
||||
'default': lambda *a:'bydate'
|
||||
},
|
||||
'fiscalyear': {
|
||||
'string':'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
|
||||
'help': 'Keep empty for all open fiscal year'
|
||||
},
|
||||
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty','states':{'none':[('readonly',True)],'bydate':[('readonly',True)]}},
|
||||
'result_selection':{
|
||||
'string':"Partner",
|
||||
'type':'selection',
|
||||
'selection':[('customer','Receivable Accounts'),('supplier','Payable Accounts'),('all','Receivable and Payable Accounts')],
|
||||
'required':True
|
||||
},
|
||||
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
|
||||
'reconcil':{'string':"Inclure les ecritures reconsiliees",'type':'boolean'},
|
||||
'page_split':{'string':"Un partenaire par page",'type':'boolean'},
|
||||
'reconcil':{'string':" Include Reconciled Entries",'type':'boolean'},
|
||||
'page_split':{'string':"One Partner Per Page",'type':'boolean'},
|
||||
'date1': {'string':' Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
}
|
||||
|
||||
|
||||
class wizard_report(wizard.interface):
|
||||
|
||||
def _get_defaults(self, cr, uid, data, context):
|
||||
|
||||
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
|
||||
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
|
||||
data['form']['display_account']='bal_all'
|
||||
|
@ -100,26 +100,15 @@ class wizard_report(wizard.interface):
|
|||
else:
|
||||
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
data['form']['company_id'] = company_id
|
||||
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
|
||||
data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
data['form']['page_split'] = False
|
||||
data['form']['reconcil'] = False
|
||||
data['form']['soldeinit'] = True
|
||||
return data['form']
|
||||
|
||||
def _get_defaults_fordate(self, cr, uid, data, context):
|
||||
data['form']['result_selection'] = 'all'
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
company_id = user.company_id.id
|
||||
else:
|
||||
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
data['form']['company_id'] = company_id
|
||||
data['form']['page_split'] = False
|
||||
data['form']['reconcil'] = False
|
||||
data['form']['soldeinit'] = True
|
||||
return data['form']
|
||||
|
||||
|
||||
def _check_date(self, cr, uid, data, context):
|
||||
|
||||
sql = """
|
||||
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date1'])
|
||||
cr.execute(sql)
|
||||
|
@ -132,27 +121,24 @@ class wizard_report(wizard.interface):
|
|||
|
||||
else:
|
||||
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
|
||||
|
||||
|
||||
def _check_state(self, cr, uid, data, context):
|
||||
if data['form']['state'] == 'byperiod':
|
||||
data['form']['fiscalyear'] = True
|
||||
else :
|
||||
self._check_date(cr, uid, data, context)
|
||||
data['form']['fiscalyear'] = False
|
||||
return data['form']
|
||||
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
|
||||
},
|
||||
'with_period': {
|
||||
'actions': [_get_defaults],
|
||||
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
|
||||
},
|
||||
'with_date': {
|
||||
'actions': [_get_defaults_fordate],
|
||||
'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
|
||||
},
|
||||
'checkdate': {
|
||||
'actions': [],
|
||||
'result': {'type':'choice','next_state':_check_date}
|
||||
},
|
||||
'report': {
|
||||
'actions': [],
|
||||
'actions': [_check_state],
|
||||
'result': {'type':'print', 'report':'account.third_party_ledger', 'state':'end'}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_account_analytic_plan_line,account.analytic.plan.line,model_account_analytic_plan_line,account.group_account_user,1,1,1,1
|
||||
access_account_analytic_plan_instance,account.analytic.plan.instance,model_account_analytic_plan_instance,account.group_account_user,1,1,1,1
|
||||
access_account_analytic_plan_instance_line,account.analytic.plan.instance.line,model_account_analytic_plan_instance_line,account.group_account_user,1,1,1,1
|
||||
access_account_analytic_plan_line_invoice,account.analytic.plan.line.invoice,model_account_analytic_plan_line,account.group_account_user,1,1,1,1
|
||||
access_account_analytic_plan_instance_invoice,account.analytic.plan.instance.invoice,model_account_analytic_plan_instance,account.group_account_user,1,1,1,1
|
||||
access_account_analytic_plan_instance_line_invoice,account.analytic.plan.instance.line.invoice,model_account_analytic_plan_instance_line,account.group_account_user,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_account_analytic_plan","account.analytic.plan","model_account_analytic_plan","account.group_account_user",1,1,1,1
|
||||
"access_account_analytic_plan_line","account.analytic.plan.line","model_account_analytic_plan_line","account.group_account_user",1,1,1,1
|
||||
"access_account_analytic_plan_instance","account.analytic.plan.instance","model_account_analytic_plan_instance","account.group_account_user",1,1,1,1
|
||||
"access_account_analytic_plan_instance_line","account.analytic.plan.instance.line","model_account_analytic_plan_instance_line","account.group_account_user",1,1,1,1
|
||||
"access_account_analytic_plan_line_invoice","account.analytic.plan.line.invoice","model_account_analytic_plan_line","account.group_account_user",1,1,1,1
|
||||
"access_account_analytic_plan_instance_manager","account.analytic.plan.instance manager","model_account_analytic_plan_instance","account.group_account_manager",1,1,1,1
|
||||
"access_account_analytic_plan_instance_line_manager","account.analytic.plan.instance.line manager","model_account_analytic_plan_instance_line","account.group_account_manager",1,1,1,1
|
||||
|
|
|
|
@ -50,8 +50,9 @@
|
|||
"demo_xml" : ["followup_demo.xml"],
|
||||
"update_xml" : [
|
||||
"security/ir.model.access.csv",
|
||||
"wizard/wizard_view.xml",
|
||||
"followup_view.xml",
|
||||
"followup_report_view.xml"
|
||||
"followup_report_view.xml",
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
|
|
|
@ -42,12 +42,6 @@
|
|||
|
||||
<report auto="False" id="account_followup_followup_report" menu="False" model="account_followup.followup" name="account_followup.followup.print" rml="account_followup/report/rappel.rml" string="Followup Report"/>
|
||||
|
||||
<record id="action_account_followup_all_wizard" model="ir.actions.wizard">
|
||||
<field name="name">Send followups</field>
|
||||
<field name="wiz_name">account_followup.followup.print.all</field>
|
||||
</record>
|
||||
<menuitem action="action_account_followup_all_wizard" id="account_followup_wizard_menu" parent="account.menu_finance_periodical_processing" type="wizard"/>
|
||||
|
||||
|
||||
<record id="account_move_line_partner_tree" model="ir.ui.view">
|
||||
<field name="name">account.move.line.partner.tree</field>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><openerp><data noupdate="0">
|
||||
<wizard string="Send followups"
|
||||
name="account_followup.followup.print.all"
|
||||
id="action_account_followup_all_wizard"
|
||||
model="account_followup.followup" />
|
||||
|
||||
<menuitem action="action_account_followup_all_wizard"
|
||||
id="account_followup_wizard_menu"
|
||||
parent="account.menu_finance_periodical_processing"
|
||||
type="wizard" />
|
||||
</data></openerp>
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_payment_type,payment.type,model_payment_type,group_account_payment,1,1,1,1
|
||||
access_payment_mode,payment.mode,model_payment_mode,group_account_payment,1,1,1,1
|
||||
access_payment_order,payment.order,model_payment_order,group_account_payment,1,1,1,1
|
||||
access_payment_line,payment.line,model_payment_line,group_account_payment,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_payment_type","payment.type","model_payment_type","group_account_payment",1,1,1,1
|
||||
"access_payment_mode","payment.mode","model_payment_mode","group_account_payment",1,1,1,1
|
||||
"access_payment_order","payment.order","model_payment_order","group_account_payment",1,1,1,1
|
||||
"access_payment_line","payment.line","model_payment_line","group_account_payment",1,1,1,1
|
||||
"access_account_journal_payement","account.journal payment","account.model_account_journal","group_account_payment",1,0,0,0
|
||||
"access_account_invoice_payment","account.invoice payment","account.model_account_invoice","group_account_payment",1,0,0,0
|
||||
"access_account_move_line_payment","account.move.line payment","account.model_account_move_line","group_account_payment",1,0,0,0
|
||||
|
|
|
|
@ -32,19 +32,22 @@
|
|||
import pooler
|
||||
import time
|
||||
from report import report_sxw
|
||||
from crm.report import report_businessopp
|
||||
from report.interface import report_int
|
||||
from reportlab.graphics.shapes import Drawing
|
||||
from reportlab.graphics.charts.barcharts import VerticalBarChart
|
||||
import reportlab.lib.colors as colors
|
||||
|
||||
#from report.interface import report_int
|
||||
#from reportlab.graphics.shapes import Drawing
|
||||
#from reportlab.graphics.charts.barcharts import VerticalBarChart
|
||||
#import reportlab.lib.colors as colors
|
||||
#from reportlab.graphics.widgetbase import Widget, TypedPropertyCollection
|
||||
#from reportlab.graphics.charts.textlabels import BarChartLabel
|
||||
#from reportlab.graphics import renderPM
|
||||
from report.render import render
|
||||
from report.interface import report_int
|
||||
#from report.render import render
|
||||
#from report.interface import report_int
|
||||
from pychart import *
|
||||
import StringIO
|
||||
theme.use_color = 1
|
||||
theme.default_font_family = "Helvetica-Bold"
|
||||
theme.default_font_size = 18
|
||||
theme.default_line_width = 1.0
|
||||
import tools
|
||||
|
||||
|
||||
|
@ -78,7 +81,7 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
|||
if not name=='array':
|
||||
return super(accounting_report_indicator,self).repeatIn(lst, name, nodes_parent=False)
|
||||
|
||||
value=['X-Axis']
|
||||
value=['Data']
|
||||
value.extend(self.header_name)
|
||||
type=['string'].extend(['float']*len(self.header_name))
|
||||
width=[40]*(len(self.header_name)+1)
|
||||
|
@ -123,18 +126,19 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
|||
def lines(self,data):
|
||||
res={}
|
||||
result=[]
|
||||
obj_inds=self.pool.get('account.report.report').browse(self.cr,self.uid,data['indicator_id'])
|
||||
ind_ids=self.pool.get('account.report.report').search(self.cr,self.uid,[])
|
||||
obj_inds=self.pool.get('account.report.report').browse(self.cr,self.uid,ind_ids)
|
||||
|
||||
def find_child(obj):
|
||||
self.list.append(obj)
|
||||
if obj.child_ids:
|
||||
for child in obj.child_ids:
|
||||
find_child(child)
|
||||
return True
|
||||
# def find_child(obj):
|
||||
# self.list.append(obj)
|
||||
# if obj.child_ids:
|
||||
# for child in obj.child_ids:
|
||||
# find_child(child)
|
||||
# return True
|
||||
#
|
||||
# find_child(obj_inds)
|
||||
|
||||
find_child(obj_inds)
|
||||
|
||||
for obj_ind in self.list:
|
||||
for obj_ind in obj_inds:
|
||||
res = {
|
||||
'id':obj_ind.id,
|
||||
'name':obj_ind.name,
|
||||
|
@ -143,10 +147,8 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
|||
'disp_graph':obj_ind.disp_graph,
|
||||
'note':obj_ind.note,
|
||||
'type':obj_ind.type,
|
||||
'last':False,
|
||||
}
|
||||
result.append(res)
|
||||
result[-1]['last']=True
|
||||
return result
|
||||
|
||||
def getarray(self,data,object):
|
||||
|
@ -156,28 +158,40 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
|||
self.header_val=[str(x) for x in self.header_val]
|
||||
temp_dict=zip(self.header_name,self.header_val)
|
||||
res=dict(temp_dict)
|
||||
res['X-Axis']='Value'
|
||||
res['Data']='Value'
|
||||
result.append(res)
|
||||
return result
|
||||
|
||||
|
||||
def test1(self,data,object,intercall=False):
|
||||
path=tools.config['root_path']+"/Temp_images/Image"
|
||||
obj_history=self.pool.get('account.report.history')
|
||||
|
||||
if data['select_base']=='year':
|
||||
tuple_search=('fiscalyear_id','in',data['base_selection'][0][2])
|
||||
base='year'
|
||||
else:
|
||||
tuple_search=('period_id','in',data['base_selection'][0][2])
|
||||
base='period'
|
||||
|
||||
history_ids=obj_history.search(self.cr,self.uid,[('name','=',object['id']),tuple_search])
|
||||
history_ids.sort()
|
||||
obj_his=obj_history.browse(self.cr,self.uid,history_ids)
|
||||
|
||||
data_val=[]
|
||||
data_period=[]
|
||||
for item in obj_his:
|
||||
data_val.append(item.val)
|
||||
data_period.append(item.period_id.name)
|
||||
if base=='period':
|
||||
for item in obj_his:
|
||||
data_val.append(item.val)
|
||||
data_period.append(item.period_id.name)
|
||||
else:
|
||||
for i in data['base_selection'][0][2]:
|
||||
val_temp=[]
|
||||
data_period.append(self.pool.get('account.fiscalyear').browse(self.cr,self.uid,i).name)
|
||||
for item in obj_his:
|
||||
if item.fiscalyear_id.id==i:
|
||||
val_temp.append(item.val)
|
||||
data_val.append(sum(val_temp))
|
||||
|
||||
self.header_name=data_period
|
||||
self.header_val=data_val
|
||||
|
||||
|
@ -218,25 +232,28 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
|||
# drawing.save(formats=['png'],fnRoot=path+str(self.count),title="helo")
|
||||
# renderPM.drawToFile(drawing1, 'example1.jpg','jpg')
|
||||
import os
|
||||
dirname ='Temp_images'
|
||||
if not os.path.isdir('./' + dirname + '/'):
|
||||
os.mkdir('./' + dirname + '/')
|
||||
pdf_string = StringIO.StringIO()
|
||||
can = canvas.init('Image'+str(self.count)+".png")
|
||||
chart_object.set_defaults(line_plot.T, line_style=None)
|
||||
path=tools.config['addons_path']+"/account_report/tmp_images/image"
|
||||
|
||||
dirname =tools.config['addons_path']+'/account_report/tmp_images/'
|
||||
if not os.path.isdir(dirname):
|
||||
os.mkdir(dirname)
|
||||
|
||||
can = canvas.init('image'+str(self.count)+".png")
|
||||
# can.clip(0,0,600,400)
|
||||
|
||||
data=zip(self.header_name,self.header_val)
|
||||
|
||||
ar = area.T(size = (400,200),x_coord = category_coord.T(data, 0), y_range = (0, None),
|
||||
x_axis = axis.X(label="Period//Year",format="/a-30{}%s"),
|
||||
ar = area.T(size = (650,450),x_coord = category_coord.T(data, 0), y_range = (None, None),
|
||||
x_axis = axis.X(label="Period // Year",format="/a-30{}%s"),
|
||||
y_axis = axis.Y(label="Value"))
|
||||
|
||||
|
||||
ar.add_plot(bar_plot.T(data = data, label = "Value",fill_style=fill_style.red))
|
||||
ar.add_plot(bar_plot.T(data = data,width=15, data_label_format="/o/15{}%s",label = "Value",fill_style=fill_style.red))
|
||||
ar.draw()
|
||||
|
||||
can.close()
|
||||
os.system('cp '+'Image'+str(self.count)+'.png ' +path+str(self.count)+'.png')
|
||||
os.system('rm '+'Image'+str(self.count)+'.png')
|
||||
os.system('cp '+'image'+str(self.count)+'.png ' +path+str(self.count)+'.png')
|
||||
os.system('rm '+'image'+str(self.count)+'.png')
|
||||
# can.endclip()
|
||||
return path+str(self.count)+'.png'
|
||||
|
||||
report_sxw.report_sxw('report.print.indicators', 'account.report.history',
|
||||
|
|
|
@ -3,6 +3,12 @@
|
|||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
|
||||
<pageGraphics>
|
||||
<setFont name="Helvetica" size="8.5"/>
|
||||
<drawString x="10.5cm" y="1cm"><pageNumber/></drawString>
|
||||
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
</pageGraphics>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
|
@ -17,90 +23,75 @@
|
|||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,0" stop="-1,-1"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,1" stop="0,1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,1" stop="1,1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,1" stop="2,1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Times-Roman" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P1" alignment="CENTER" fontName="Helvetica" fontSize="8.5" leading="10" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Times-BoldItalic" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Times-Bold" fontSize="18.0" leading="22" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Times-Roman" fontSize="13.0" leading="16" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P8" fontName="Times-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Times-Roman" fontSize="8.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Times-Roman" fontSize="16.0" leading="20" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Times-Roman" fontSize="10.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P14" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="10.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="8.5" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="8.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" fontSize="16.0" leading="20" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" fontSize="9.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<blockTable colWidths="146.0,223.0,158.0" repeatRows="1" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">Indicators</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P5">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">Currency: <font face="Times-Roman" size="11.0">[[ company.currency_id.name]]</font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<blockTable colWidths="520.0" style="Standard_Outline">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">Indicators</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="264.0,264.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P14">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Currency: <font face="Times-Roman" size="11.0">[[ company.currency_id.name]]</font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P4">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P3">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<blockTable colWidths="362.0,166.0" repeatRows="1" style="Table4">
|
||||
<para style="P1">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<blockTable colWidths="362.0,166.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P6">Name</para>
|
||||
|
@ -113,22 +104,23 @@
|
|||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P3"><seqReset/></para>
|
||||
<section>
|
||||
<para style="P1">[[ repeatIn(lines(data['form']),'o')]]</para>
|
||||
<blockTable colWidths="362.0,166.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11">[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]][[ o['name'] ]]</para>
|
||||
<para style="P11"><b>(<seq/>)</b> [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]<u>[[ o['name'] ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11">[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]][[ o['code'] ]]</para>
|
||||
<para style="P11">[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]<u>[[ o['code'] ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P1">[[ o['disp_graph'] and setTag('para','image',{'file':test(data['form'],o)}) or removeParentNode('para') ]]</para>
|
||||
<para style="P1">[[ o['disp_graph'] and setTag('para','image',{'width':'450.00','height':'215.00','file':test(data['form'],o)}) or removeParentNode('para') ]]</para>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
@ -139,48 +131,50 @@
|
|||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="528.0" repeatRows="1" style="Table3">
|
||||
<blockTable colWidths="14.0,500.0,14.0" repeatRows="1" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11"><b>Expression :</b> [[ o['expression'] ]]</para>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5"><b>Expression :</b> [[ o['expression'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="528.0" repeatRows="1" style="Table3">
|
||||
<blockTable colWidths="14.0,500.0,14.0" repeatRows="1" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11"><b>Notes :</b> [[ o['note'] ]]</para>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5"><b>Notes :</b> [[ o['note'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<pageBreak>[[ o['last'] and removeParentNode('pageBreak')]]</pageBreak>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="362.0,166.0" repeatRows="1" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P6">Name[[ o['last'] and removeParentNode('blockTable')]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P6">Code</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<hr color="black" thickness="1.5"/>
|
||||
</section>
|
||||
</story>
|
||||
</document>
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_account_report_report,account.report.report,model_account_report_report,base.group_user,1,0,0,0
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_account_report_report","account.report.report","model_account_report_report","account.group_account_manager",1,0,0,0
|
||||
"access_account_report_history","account.report.history","model_account_report_history","account.group_account_manager",1,0,0,0
|
||||
|
|
|
|
@ -33,12 +33,12 @@ import pooler
|
|||
|
||||
form = '''<?xml version="1.0"?>
|
||||
<form string="Print Indicators">
|
||||
<field name="indicator_id"/>
|
||||
<label string="Select the criteria based on which Indicators will be printed."/>
|
||||
<newline/>
|
||||
<field name="select_base"/>
|
||||
</form>'''
|
||||
|
||||
fields = {
|
||||
'indicator_id': {'string':'Choose Indicator', 'type':'many2one', 'relation': 'account.report.report','required':True,},
|
||||
'select_base': {'string':'Choose Criteria', 'type':'selection','selection':[('year','Based On Fiscal Years'),('periods','Based on Fiscal Periods')],'required':True,},
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,11 @@ def _load_base(self, cr, uid, data, context):
|
|||
next_fields['base_selection']['relation']='account.period'
|
||||
return data['form']
|
||||
|
||||
def _check_len(self, cr, uid, data, context):
|
||||
if len(data['form']['base_selection'][0][2])>12:
|
||||
raise wizard.except_wizard('User Error!',"Please select maximum 12 records to fit the page-width.")
|
||||
return data['form']
|
||||
|
||||
class wizard_print_indicators(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
|
@ -72,7 +77,7 @@ class wizard_print_indicators(wizard.interface):
|
|||
'result': {'type':'form', 'arch':next_form, 'fields':next_fields, 'state':[('end','Cancel'),('print','Print')]}
|
||||
},
|
||||
'print': {
|
||||
'actions':[],
|
||||
'actions':[_check_len],
|
||||
'result' :{'type':'print','report':'print.indicators', 'state':'end'}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import voucher
|
||||
import voucher_account
|
||||
import report
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"name" : "India Accounting",
|
||||
"version" : "1.0",
|
||||
"author" : "Tiny",
|
||||
"description": """
|
||||
India Accounting module includes all the basic requirenment of
|
||||
Basic Accounting, plus new things which available are
|
||||
* Indian Account Chart
|
||||
* New Invoice - (Local, Retail)
|
||||
* Invoice Report
|
||||
* Tax structure
|
||||
* Journals
|
||||
* VAT Declaration report
|
||||
* Accounting Periods
|
||||
""",
|
||||
"category" : "Generic Modules/Accounting",
|
||||
"website" : "http://tinyerp.com",
|
||||
"depends" : ["base", "account"],
|
||||
"init_xml" : [
|
||||
],
|
||||
|
||||
"demo_xml" : [
|
||||
],
|
||||
|
||||
"update_xml" : [
|
||||
"account_voucher_sequence.xml",
|
||||
"account_view.xml",
|
||||
"account_report.xml",
|
||||
"voucher_view.xml",
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0"?>
|
||||
<terp>
|
||||
<data>
|
||||
|
||||
<report id="report_account_voucher"
|
||||
string="Voucher Report (Cr/Dr)"
|
||||
model="account.voucher"
|
||||
name="voucher.cash_receipt"
|
||||
rml="account_voucher/report/report_voucher.rml"
|
||||
auto="False"
|
||||
header = "False"
|
||||
menu="True"/>
|
||||
|
||||
|
||||
<report id="report_account_voucher_amt"
|
||||
string="Voucher Report"
|
||||
model="account.voucher"
|
||||
name="voucher.cash_amount"
|
||||
rml="account_voucher/report/report_voucher_amount.rml"
|
||||
auto="False"
|
||||
header = "False"
|
||||
menu="True"/>
|
||||
|
||||
</data>
|
||||
</terp>
|
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="account_form1">
|
||||
<field name="name">account.form</field>
|
||||
<field name="inherit_id" ref="account.view_account_form"/>
|
||||
<field name="model">account.account</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="user_type" position="after">
|
||||
<field name="diff" select="2" />
|
||||
<field name="balance" string="Closing Balance" select="2"/>
|
||||
<field name="type1" select="2" />
|
||||
<field name="open_bal" select="2"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="account_form2">
|
||||
<field name="name">account.form</field>
|
||||
<field name="inherit_id" ref="account.view_account_form"/>
|
||||
<field name="model">account.account</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="user_type" position="replace">
|
||||
<field name="user_type" select="1" on_change="onchange_type(user_type,type1)"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="account_form3">
|
||||
<field name="name">account.form</field>
|
||||
<field name="inherit_id" ref="account.view_account_tree"/>
|
||||
<field name="model">account.account</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="open_bal" select="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="account_form4">
|
||||
<field name="name">account.form</field>
|
||||
<field name="inherit_id" ref="account.view_account_tree"/>
|
||||
<field name="model">account.account</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="balance" position="replace">
|
||||
<field name="balance" />
|
||||
<field name="type1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
|
||||
<data noupdate="1">
|
||||
<record model="res.request.link" id="req_link_voucher">
|
||||
<field name="name">Voucher</field>
|
||||
<field name="object">account.voucher</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Sequences types for vouchers
|
||||
-->
|
||||
<record model="ir.sequence.type" id="seq_type_cash_rec_voucher">
|
||||
<field name="name">Account Cash Received Voucher</field>
|
||||
<field name="code">account.voucher.rec_voucher</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.sequence.type" id="seq_type_cash_pay_voucher">
|
||||
<field name="name">Account Cash Payble Voucher</field>
|
||||
<field name="code">account.voucher.pay_voucher</field>
|
||||
</record>
|
||||
<record model="ir.sequence.type" id="seq_type_bank_rec_voucher">
|
||||
<field name="name">Account Bank Received Voucher</field>
|
||||
<field name="code">account.voucher.bank_rec_voucher</field>
|
||||
</record>
|
||||
<record model="ir.sequence.type" id="seq_type_bank_pay_voucher">
|
||||
<field name="name">Account Bank Payble Voucher</field>
|
||||
<field name="code">account.voucher.bank_pay_voucher</field>
|
||||
</record>
|
||||
<record model="ir.sequence.type" id="seq_type_contra_voucher">
|
||||
<field name="name">Account Contra Voucher</field>
|
||||
<field name="code">account.voucher.cont_voucher</field>
|
||||
</record>
|
||||
<record model="ir.sequence.type" id="seq_type_jou_sale_voucher">
|
||||
<field name="name">Account Journal Voucher</field>
|
||||
<field name="code">account.voucher.journal_sale_vou</field>
|
||||
</record>
|
||||
<record model="ir.sequence.type" id="seq_type_jou_pur_voucher">
|
||||
<field name="name">Account Journal Voucher</field>
|
||||
<field name="code">account.voucher.journal_pur_vou</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Sequences for vouchers
|
||||
-->
|
||||
<record model="ir.sequence" id="seq_cash_rec_voucher">
|
||||
<field name="name">Account Cash Received Voucher</field>
|
||||
<field name="code">account.voucher.rec_voucher</field>
|
||||
<field name="padding" eval="3"/>
|
||||
<field name="prefix">%(year)s/</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.sequence" id="seq_cash_pay_voucher">
|
||||
<field name="name">Account Cash Payble Voucher</field>
|
||||
<field name="code">account.voucher.pay_voucher</field>
|
||||
<field name="padding" eval="3"/>
|
||||
<field name="prefix">%(year)s/</field>
|
||||
</record>
|
||||
<record model="ir.sequence" id="seq_bank_rec_voucher">
|
||||
<field name="name">Account Bank Received Voucher</field>
|
||||
<field name="code">account.voucher.bank_rec_voucher</field>
|
||||
<field name="padding" eval="3"/>
|
||||
<field name="prefix">%(year)s/</field>
|
||||
</record>
|
||||
<record model="ir.sequence" id="seq_bank_pay_voucher">
|
||||
<field name="name">Account Bank Payble Voucher</field>
|
||||
<field name="code">account.voucher.bank_pay_voucher</field>
|
||||
<field name="padding" eval="3"/>
|
||||
<field name="prefix">%(year)s/</field>
|
||||
</record>
|
||||
<record model="ir.sequence" id="seq_contra_voucher">
|
||||
<field name="name">Account Contra Voucher</field>
|
||||
<field name="code">account.voucher.cont_voucher</field>
|
||||
<field name="padding" eval="3"/>
|
||||
<field name="prefix">%(year)s/</field>
|
||||
</record>
|
||||
<record model="ir.sequence" id="seq_jou_sale_voucher">
|
||||
<field name="name">Account Journal Voucher</field>
|
||||
<field name="code">account.voucher.journal_sale_vou</field>
|
||||
<field name="padding" eval="3"/>
|
||||
<field name="prefix">%(year)s/</field>
|
||||
</record>
|
||||
<record model="ir.sequence" id="seq_jou_pur_voucher">
|
||||
<field name="name">Account Journal Voucher</field>
|
||||
<field name="code">account.voucher.journal_pur_vou</field>
|
||||
<field name="padding" eval="3"/>
|
||||
<field name="prefix">%(year)s/</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Sequences types for analytic account
|
||||
|
||||
<record model="ir.sequence.type" id="seq_type_analytic_account">
|
||||
<field name="name">Analytic account</field>
|
||||
<field name="code">account.analytic.account</field>
|
||||
</record>
|
||||
|
||||
|
||||
Sequence for analytic account
|
||||
|
||||
<record model="ir.sequence" id="seq_analytic_account">
|
||||
<field name="name">Analytic account sequence</field>
|
||||
<field name="code">account.analytic.account</field>
|
||||
<field name="padding" eval="3" />
|
||||
<field name="number_next" eval="2708" />
|
||||
</record>
|
||||
-->
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terp>
|
||||
<data>
|
||||
|
||||
<wizard
|
||||
id="wizard_account_voucher_open"
|
||||
menu="False"
|
||||
model="account.voucher"
|
||||
name="account.voucher.open"
|
||||
string="Open a Voucher Entry"
|
||||
/>
|
||||
<menuitem
|
||||
action="wizard_account_voucher_open"
|
||||
id="menu_wizard_account_voucher_open"
|
||||
name="Financial Management/Voucher Entries/Open Vouchers"
|
||||
sequence="0"
|
||||
type="wizard"
|
||||
/>
|
||||
</data>
|
||||
</terp>
|
|
@ -0,0 +1,75 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terp>
|
||||
<data>
|
||||
|
||||
<record id="wkf_voucher" model="workflow">
|
||||
<field name="name">account.voucher.basic</field>
|
||||
<field name="osv">account.voucher</field>
|
||||
<field name="on_create">True</field>
|
||||
</record>
|
||||
|
||||
<record id="act_draft" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_voucher"/>
|
||||
<field name="flow_start">True</field>
|
||||
<field name="name">draft</field>
|
||||
</record>
|
||||
|
||||
<record id="act_performa" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_voucher"/>
|
||||
<field name="name">performa</field>
|
||||
<field name="action">open_voucher()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<record id="act_posted" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_voucher"/>
|
||||
<field name="name">posted</field>
|
||||
<field name="action">proforma_voucher()</field>
|
||||
<field name="flow_stop">True</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<record id="act_cancel" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_voucher"/>
|
||||
<field name="name">cancel</field>
|
||||
<field name="action">cancel_voucher()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<record id="t1" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_performa"/>
|
||||
<field name="signal">open_voucher</field>
|
||||
</record>
|
||||
|
||||
<record id="t2" model="workflow.transition">
|
||||
<field name="act_from" ref="act_performa"/>
|
||||
<field name="act_to" ref="act_posted"/>
|
||||
<field name="signal">proforma_voucher</field>
|
||||
</record>
|
||||
|
||||
<record id="t3" model="workflow.transition">
|
||||
<field name="act_from" ref="act_performa"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">cancel_voucher</field>
|
||||
</record>
|
||||
|
||||
<record id="t5" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">cancel_voucher</field>
|
||||
</record>
|
||||
|
||||
<record id="t6" model="workflow.transition">
|
||||
<field name="act_from" ref="act_posted"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">cancel_voucher</field>
|
||||
</record>
|
||||
|
||||
<record id="t7" model="workflow.transition">
|
||||
<field name="act_from" ref="act_cancel"/>
|
||||
<field name="act_to" ref="act_performa"/>
|
||||
<field name="signal">open_voucher</field>
|
||||
</record>
|
||||
</data>
|
||||
</terp>
|
|
@ -0,0 +1,2 @@
|
|||
import report_voucher
|
||||
import report_voucher_amount
|
|
@ -0,0 +1,72 @@
|
|||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from report import report_sxw
|
||||
from tools import amount_to_text_en
|
||||
|
||||
|
||||
class report_voucher(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(report_voucher, self).__init__(cr, uid, name, context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'convert':self.convert,
|
||||
'debit':self.debit,
|
||||
'credit':self.credit,
|
||||
'get_ref' : self._get_ref
|
||||
})
|
||||
|
||||
def convert(self,amount, cur):
|
||||
amt_en = amount_to_text_en.amount_to_text(amount,'en',cur);
|
||||
return amt_en
|
||||
|
||||
def debit(self, move_ids):
|
||||
debit = 0.0
|
||||
for move in move_ids:#self.pool.get('account.move.line').browse(self.cr, self.uid, move_ids):
|
||||
debit +=move.debit
|
||||
return debit
|
||||
|
||||
def credit(self, move_ids):
|
||||
credit = 0.0
|
||||
for move in move_ids:#self.pool.get('account.move.line').browse(self.cr, self.uid, move_ids):
|
||||
credit +=move.credit
|
||||
return credit
|
||||
|
||||
def _get_ref(self, voucher_id, move_ids):
|
||||
voucher_line = self.pool.get('account.voucher.line').search(self.cr, self.uid, [('partner_id','=',move_ids.partner_id.id), ('voucher_id','=',voucher_id)])
|
||||
if voucher_line:
|
||||
voucher = self.pool.get('account.voucher.line').browse(self.cr, self.uid, voucher_line)[0]
|
||||
return voucher.ref
|
||||
else:
|
||||
return
|
||||
report_sxw.report_sxw(
|
||||
'report.voucher.cash_receipt',
|
||||
'account.voucher',
|
||||
'addons/account_voucher/report/report_voucher.rml',
|
||||
parser=report_voucher,header=False
|
||||
)
|
|
@ -0,0 +1,381 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Heading1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="voucher_lines">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="last_info">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,7" stop="0,7"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,7" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,7" stop="1,7"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,7" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,7" stop="2,7"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="22.0" leading="27" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P14" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P15" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P16" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P18" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P19" fontName="Helvetica" fontSize="5.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P20" fontName="Helvetica" fontSize="5.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P21" fontName="Helvetica" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P22" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P23" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P24" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P25" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P26" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P27" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P28" rightIndent="0.0" leftIndent="15.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P30" rightIndent="0.0" leftIndent="20.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P31" rightIndent="0.0" leftIndent="25.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Times-Italic" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="P26">[[ repeatIn(objects,'voucher') ]]</para>
|
||||
<para style="P4">[[ company.name ]]</para>
|
||||
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].street ]]</para>
|
||||
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].zip ]] [[ company.partner_id.address and company.partner_id.address[0].city ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name ]]</para>
|
||||
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].phone ]]</para>
|
||||
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].email ]]</para>
|
||||
<para style="P5">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P24">Cash Receipt Voucher [[ (voucher.type == 'rec_voucher' or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P2">Cash Payment Voucher [[ (voucher.type == 'pay_voucher' or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P24">Bank Receipt Voucher [[ (voucher.type == 'bank_rec_voucher' or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P2">Bank Payment Voucher [[ (voucher.type == 'bank_pay_voucher' or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P23">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="49.0,143.0,116.0,69.0,106.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P10">No.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P27">[[ voucher.number ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">Dated :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P27">[[ time.strftime('%d %B,%Y', time.strptime(voucher.date , '%Y-%m-%d')) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P10">State :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P25">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P25">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P25">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P25">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">Ref. :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P27">[[ voucher.reference ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="255.0,114.0,114.0" style="Heading1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P14">Particulars</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P15">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P15">Credit</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P19"/>
|
||||
<blockTable colWidths="482.0" style="voucher_lines">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P20">[[ repeatIn(voucher.move_ids,'move_ids') ]] </para>
|
||||
<blockTable colWidths="251.0,110.0,115.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11">[[ (move_ids.partner_id and move_ids.partner_id.name) or '']] :</para>
|
||||
<para style="P28">[[ move_ids.account_id.name ]] </para>
|
||||
<para style="P31">[[ get_ref(voucher.id,move_ids) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P21">[[ move_ids.debit ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P21">[[ move_ids.credit ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P22">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="253.0,114.0,114.0" style="last_info">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P13">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P13">Through : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P30">[[ voucher.narration or '']]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P13">On Account of : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P30">[[ voucher.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P13">Amount (in words) : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P13">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P13">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P30">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P16">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P17">[[ debit(voucher.move_ids)]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P17">[[ credit(voucher.move_ids) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P18">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="142.0,99.0,105.0,136.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P23">Receiver's Signature</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P23">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P23">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P23">Authorised Signatory</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P1">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
|
@ -0,0 +1,51 @@
|
|||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from report import report_sxw
|
||||
from tools import amount_to_text_en
|
||||
|
||||
|
||||
class report_voucher_amount(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(report_voucher_amount, self).__init__(cr, uid, name, context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'convert':self.convert
|
||||
})
|
||||
|
||||
def convert(self,amount, cur):
|
||||
amt_en = amount_to_text_en.amount_to_text(amount,'en',cur);
|
||||
return amt_en
|
||||
|
||||
|
||||
report_sxw.report_sxw(
|
||||
'report.voucher.cash_amount',
|
||||
'account.voucher',
|
||||
'addons/account_voucher/report/report_voucher_amount.rml',
|
||||
parser=report_voucher_amount,header=False
|
||||
)
|
|
@ -0,0 +1,353 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Heading1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="voucher_lines">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="last_info">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,7" stop="0,7"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,7" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,7" stop="1,7"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="22.0" leading="27" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P14" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P15" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P16" fontName="Helvetica" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P17" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P18" fontName="Helvetica" fontSize="5.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P19" fontName="Helvetica" fontSize="5.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P20" fontName="Helvetica" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P21" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P22" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P23" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P24" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P25" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P26" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P27" rightIndent="0.0" leftIndent="15.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P29" rightIndent="0.0" leftIndent="20.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P30" rightIndent="0.0" leftIndent="25.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Times-Italic" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="P25">[[ repeatIn(objects,'voucher') ]]</para>
|
||||
<para style="P4">[[ company.name ]]</para>
|
||||
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].street ]]</para>
|
||||
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].zip ]] [[ company.partner_id.address and company.partner_id.address[0].city ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name ]]</para>
|
||||
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].phone ]]</para>
|
||||
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].email ]]</para>
|
||||
<para style="P5">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P23">Cash Receipt Voucher [[ (voucher.type == 'rec_voucher' or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P2">Cash Payment Voucher [[ (voucher.type == 'pay_voucher' or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P23">Bank Receipt Voucher [[ (voucher.type == 'bank_rec_voucher' or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P2">Bank Payment Voucher [[ (voucher.type == 'bank_pay_voucher' or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P22">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="68.0,124.0,122.0,62.0,106.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P10">No.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P26">[[ voucher.number ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">Dated :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P26">[[ time.strftime('%d %B,%Y', time.strptime(voucher.date , '%Y-%m-%d')) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P10">State :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P24">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P24">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P24">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P24">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">Ref. :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P26">[[ voucher.reference ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P10">Account :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P24">[[ voucher.account_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P26">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P12"/>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="333.0,149.0" style="Heading1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P14">Particulars</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P15">Amount</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P18">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="482.0" style="voucher_lines">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P19">[[ repeatIn(voucher.payment_ids,'payment_ids') ]] </para>
|
||||
<blockTable colWidths="324.0,152.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11">[[ payment_ids.partner_id.name ]] :</para>
|
||||
<para style="P27">[[ payment_ids.account_id.name ]] </para>
|
||||
<para style="P30">[[ payment_ids.ref ]] [[ payment_ids.amount ]] [[ payment_ids.type ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P20">[[ payment_ids.amount ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P21">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="344.0,138.0" style="last_info">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P13">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P13">Through : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P29">[[ voucher.narration or '' ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P26">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P13">On Account of : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P29">[[ voucher.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P26">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P13">Amount (in words) : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P13">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P29">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ voucher.amount ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P17">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="142.0,99.0,105.0,136.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P22">Receiver's Signature</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P22">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P22">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P22">Authorised Signatory</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P1">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
|
@ -0,0 +1,537 @@
|
|||
import time
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
import ir
|
||||
import pooler
|
||||
import mx.DateTime
|
||||
from mx.DateTime import RelativeDateTime
|
||||
|
||||
from tools import config
|
||||
|
||||
|
||||
class account_voucher(osv.osv):
|
||||
def _get_period(self, cr, uid, context):
|
||||
periods = self.pool.get('account.period').find(cr, uid)
|
||||
if periods:
|
||||
return periods[0]
|
||||
else:
|
||||
return False
|
||||
|
||||
def _get_type(self, cr, uid, context={}):
|
||||
type = context.get('type', 'rec_voucher')
|
||||
return type
|
||||
|
||||
def _get_reference_type(self, cursor, user, context=None):
|
||||
return [('none', 'Free Reference')]
|
||||
|
||||
|
||||
|
||||
def _get_journal(self, cr, uid, context):
|
||||
type_inv = context.get('type', 'rec_voucher')
|
||||
type2journal = {'rec_voucher': 'cash', 'bank_rec_voucher': 'cash','pay_voucher': 'cash','bank_pay_voucher': 'cash', 'cont_voucher': 'cash','journal_sale_voucher': 'sale','journal_pur_voucher': 'purchase' }
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'cash'))], limit=1)
|
||||
if res:
|
||||
return res[0]
|
||||
else:
|
||||
return False
|
||||
|
||||
def _get_currency(self, cr, uid, context):
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid])[0]
|
||||
if user.company_id:
|
||||
return user.company_id.currency_id.id
|
||||
else:
|
||||
return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
|
||||
|
||||
_name = 'account.voucher'
|
||||
_description = 'Accounting Voucher'
|
||||
_order = "number"
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=256, required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'type': fields.selection([
|
||||
('pay_voucher','Cash Payment Voucher'),
|
||||
('bank_pay_voucher','Bank Payment Voucher'),
|
||||
('rec_voucher','Cash Receipt Voucher'),
|
||||
('bank_rec_voucher','Bank Receipt Voucher'),
|
||||
('cont_voucher','Contra Voucher'),
|
||||
('journal_sale_vou','Journal Sale Voucher'),
|
||||
('journal_pur_voucher','Journal Purchase Voucher'),
|
||||
],'Type', readonly=True, select=True),
|
||||
'date':fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'payment_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=False, states={'proforma':[('readonly',True)]}),
|
||||
'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}),
|
||||
'narration':fields.text('Narration', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'state':fields.selection(
|
||||
[('draft','Draft'),
|
||||
('proforma','Pro-forma'),
|
||||
('posted','Posted'),
|
||||
('cancel','Cancel')
|
||||
], 'State',
|
||||
readonly=True),
|
||||
'amount':fields.float('Amount', readonly=True),
|
||||
# , states={'draft':[('readonly',False)]}
|
||||
'number':fields.char('Number', size=32, readonly=True),
|
||||
'reference': fields.char('Voucher Reference', size=64),
|
||||
'reference_type': fields.selection(_get_reference_type, 'Reference Type',
|
||||
required=True),
|
||||
'move_id':fields.many2one('account.move', 'Account Entry'),
|
||||
'move_ids':fields.many2many('account.move.line', 'voucher_id', 'account_id', 'rel_account_move', 'Real Entry'),
|
||||
}
|
||||
|
||||
# def get_bank(self, cr, uid, context={}):
|
||||
# type = context.get('type', 'bank_payment')
|
||||
# journal = self.pool.get('account.journal')
|
||||
# if type == 'bank_payment':
|
||||
# id = journal.search(cr, uid, [('name','ilike','Bank')])
|
||||
# return id
|
||||
# elif type == 'cash_payment':
|
||||
# id = journal.search(cr, uid, [('name','ilike','Cash')])
|
||||
# return id
|
||||
#
|
||||
# return 3
|
||||
|
||||
_defaults = {
|
||||
#'journal_id':get_bank,
|
||||
'state': lambda *a: 'draft',
|
||||
'date' : lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'period_id': _get_period,
|
||||
'type': _get_type,
|
||||
'reference_type': lambda *a: 'none',
|
||||
'journal_id':_get_journal,
|
||||
'company_id': lambda self, cr, uid, context: \
|
||||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
'currency_id': _get_currency,
|
||||
|
||||
|
||||
}
|
||||
|
||||
def _get_analityc_lines(self, cr, uid, id):
|
||||
inv = self.browse(cr, uid, [id])[0]
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
|
||||
def onchange_account(self, cr, uid, ids, account_id):
|
||||
if not account_id:
|
||||
return {'value':{'amount':False}}
|
||||
account = self.pool.get('account.account').browse(cr,uid,account_id)
|
||||
balance=account.balance
|
||||
return {'value':{'amount':balance}}
|
||||
|
||||
|
||||
def onchange_journal(self, cr, uid, ids, journal_id,type):
|
||||
if not journal_id:
|
||||
return {'value':{'account_id':False}}
|
||||
journal = self.pool.get('account.journal')
|
||||
if journal_id and (type in ('rec_voucher','bank_rec_voucher','journal_pur_voucher')):
|
||||
account_id = journal.browse(cr, uid, journal_id).default_debit_account_id
|
||||
return {'value':{'account_id':account_id.id}}
|
||||
elif journal_id and (type in ('pay_voucher','bank_pay_voucher','journal_sale_vou')) :
|
||||
account_id = journal.browse(cr, uid, journal_id).default_credit_account_id
|
||||
return {'value':{'account_id':account_id.id}}
|
||||
else:
|
||||
account_id = journal.browse(cr, uid, journal_id).default_credit_account_id
|
||||
return {'value':{'account_id':account_id.id}}
|
||||
|
||||
|
||||
|
||||
|
||||
def open_voucher(self, cr, uid, ids, context={}):
|
||||
obj=self.pool.get('account.voucher').browse(cr,uid,ids)
|
||||
total=0
|
||||
for i in obj[0].payment_ids:
|
||||
total+=i.amount
|
||||
self.write(cr,uid,ids,{'amount':total})
|
||||
self.write(cr, uid, ids, {'state':'proforma'})
|
||||
return True
|
||||
def proforma_voucher(self, cr, uid, ids, context={}):
|
||||
self.action_move_line_create(cr, uid, ids)
|
||||
self.action_number(cr, uid, ids)
|
||||
self.write(cr, uid, ids, {'state':'posted'})
|
||||
return True
|
||||
def cancel_voucher(self,cr,uid,ids,context={}):
|
||||
self.action_cancel(cr, uid, ids)
|
||||
self.write(cr, uid, ids, {'state':'cancel'})
|
||||
return True
|
||||
|
||||
def action_cancel_draft(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
return True
|
||||
|
||||
|
||||
def unlink(self, cr, uid, ids):
|
||||
vouchers = self.read(cr, uid, ids, ['state'])
|
||||
unlink_ids = []
|
||||
for t in vouchers:
|
||||
if t['state'] in ('draft', 'cancel'):
|
||||
unlink_ids.append(t['id'])
|
||||
else:
|
||||
raise osv.except_osv('Invalid action !', 'Cannot delete invoice(s) which are already opened or paid !')
|
||||
osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||
return True
|
||||
|
||||
|
||||
def _get_analityc_lines(self, cr, uid, id):
|
||||
inv = self.browse(cr, uid, [id])[0]
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
|
||||
company_currency = inv.company_id.currency_id.id
|
||||
if inv.type in ('rec_voucher'):
|
||||
sign = 1
|
||||
else:
|
||||
sign = -1
|
||||
|
||||
iml = self.pool.get('account.voucher.line').move_line_get(cr, uid, inv.id)
|
||||
|
||||
for il in iml:
|
||||
if il['account_analytic_id']:
|
||||
if inv.type in ('pay_voucher', 'rec_voucher','cont_voucher','bank_pay_voucher','bank_rec_voucher','journal_sale_vou','journal_pur_voucher'):
|
||||
ref = inv.reference
|
||||
else:
|
||||
ref = self._convert_ref(cr, uid, inv.number)
|
||||
il['analytic_lines'] = [(0,0, {
|
||||
'name': il['name'],
|
||||
'date': inv['date'],
|
||||
'account_id': il['account_analytic_id'],
|
||||
'amount': inv['amount'] * sign,
|
||||
'partner_id': il['partner_id'] or False,
|
||||
'general_account_id': il['account_id'] or False,
|
||||
'journal_id': self._get_journal(cr, uid, inv.type),
|
||||
'ref': ref,
|
||||
})]
|
||||
|
||||
return iml
|
||||
|
||||
def action_move_line_create(self, cr, uid, ids, *args):
|
||||
for inv in self.browse(cr, uid, ids):
|
||||
if inv.move_id:
|
||||
continue
|
||||
company_currency = inv.company_id.currency_id.id
|
||||
# create the analytical lines
|
||||
line_ids = self.read(cr, uid, [inv.id], ['payment_ids'])[0]['payment_ids']
|
||||
ils = self.pool.get('account.voucher.line').read(cr, uid, line_ids)
|
||||
# one move line per invoice line
|
||||
iml = self._get_analityc_lines(cr, uid, inv.id)
|
||||
# check if taxes are all computed
|
||||
diff_currency_p = inv.currency_id.id <> company_currency
|
||||
# create one move line for the total and possibly adjust the other lines amount
|
||||
total = 0
|
||||
if inv.type in ('pay_voucher', 'rec_voucher','cont_voucher','bank_pay_voucher','bank_rec_voucher','journal_sale_vou','journal_pur_voucher'):
|
||||
ref = inv.reference
|
||||
else:
|
||||
ref = self._convert_ref(cr, uid, inv.number)
|
||||
date = inv.date
|
||||
total_currency = 0
|
||||
for i in iml:
|
||||
if inv.currency_id.id != company_currency:
|
||||
i['currency_id'] = inv.currency_id.id
|
||||
i['amount_currency'] = i['amount']
|
||||
|
||||
else:
|
||||
i['amount_currency'] = False
|
||||
i['currency_id'] = False
|
||||
i['ref'] = ref
|
||||
if inv.type in ('rec_voucher','bank_rec_voucher','journal_pur_voucher'):
|
||||
total += i['amount']
|
||||
total_currency += i['amount_currency'] or i['amount']
|
||||
i['amount'] = - i['amount']
|
||||
else:
|
||||
total -= i['amount']
|
||||
total_currency -= i['amount_currency'] or i['amount']
|
||||
acc_id = inv.account_id.id
|
||||
|
||||
name = inv['name'] or '/'
|
||||
totlines = False
|
||||
|
||||
iml.append({
|
||||
'type': 'dest',
|
||||
'name': name,
|
||||
'amount': total,
|
||||
'account_id': acc_id,
|
||||
'amount_currency': diff_currency_p \
|
||||
and total_currency or False,
|
||||
'currency_id': diff_currency_p \
|
||||
and inv.currency_id.id or False,
|
||||
'ref': ref
|
||||
})
|
||||
|
||||
date = inv.date
|
||||
inv.amount=total
|
||||
|
||||
|
||||
line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x,date, context={})) ,iml)
|
||||
|
||||
journal_id = inv.journal_id.id #self._get_journal(cr, uid, {'type': inv['type']})
|
||||
journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
|
||||
if journal.sequence_id:
|
||||
name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
|
||||
|
||||
move = {'name': name, 'line_id': line, 'journal_id': journal_id}
|
||||
if inv.period_id:
|
||||
move['period_id'] = inv.period_id.id
|
||||
for i in line:
|
||||
i[2]['period_id'] = inv.period_id.id
|
||||
move_id = self.pool.get('account.move').create(cr, uid, move)
|
||||
# make the invoice point to that move
|
||||
self.write(cr, uid, [inv.id], {'move_id': move_id})
|
||||
obj=self.pool.get('account.move').browse(cr,uid,move_id)
|
||||
for line in obj.line_id :
|
||||
cr.execute('insert into voucher_id (account_id,rel_account_move) values (%d, %d)',(int(ids[0]),int(line.id)))
|
||||
# self.pool.get('account.move').post(cr, uid, [move_id])
|
||||
# self._log_event(cr, uid, ids)
|
||||
return True
|
||||
|
||||
|
||||
|
||||
def line_get_convert(self, cr, uid, x, date, context={}):
|
||||
return {
|
||||
'date':date,
|
||||
'date_maturity': x.get('date_maturity', False),
|
||||
'partner_id':x.get('partner_id',False),
|
||||
'name':x['name'][:64],
|
||||
'debit':x['amount']>0 and x['amount'],
|
||||
'credit':x['amount']<0 and -x['amount'],
|
||||
'account_id':x['account_id'],
|
||||
'analytic_lines':x.get('analytic_lines', []),
|
||||
'amount_currency':x.get('amount_currency', False),
|
||||
'currency_id':x.get('currency_id', False),
|
||||
'tax_code_id': x.get('tax_code_id', False),
|
||||
'tax_amount': x.get('tax_amount', False),
|
||||
'ref':x.get('ref',False)
|
||||
}
|
||||
def _convert_ref(self, cr, uid, ref):
|
||||
return (ref or '').replace('/','')
|
||||
|
||||
|
||||
def action_number(self, cr, uid, ids, *args):
|
||||
cr.execute('SELECT id, type, number, move_id, reference ' \
|
||||
'FROM account_voucher ' \
|
||||
'WHERE id IN ('+','.join(map(str,ids))+')')
|
||||
for (id, invtype, number, move_id, reference) in cr.fetchall():
|
||||
if not number:
|
||||
number = self.pool.get('ir.sequence').get(cr, uid,
|
||||
'account.voucher.' + invtype)
|
||||
|
||||
if type in ('pay_voucher', 'rec_voucher','cont_voucher','bank_pay_voucher','bank_rec_voucher','journal_sale_vou','journal_pur_voucher'):
|
||||
ref = reference
|
||||
else:
|
||||
ref = self._convert_ref(cr, uid, number)
|
||||
cr.execute('UPDATE account_voucher SET number=%s ' \
|
||||
'WHERE id=%d', (number, id))
|
||||
cr.execute('UPDATE account_move_line SET ref=%s ' \
|
||||
'WHERE move_id=%d AND (ref is null OR ref = \'\')',
|
||||
(ref, move_id))
|
||||
cr.execute('UPDATE account_analytic_line SET ref=%s ' \
|
||||
'FROM account_move_line ' \
|
||||
'WHERE account_move_line.move_id = %d ' \
|
||||
'AND account_analytic_line.move_id = account_move_line.id',
|
||||
(ref, move_id))
|
||||
return True
|
||||
|
||||
|
||||
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
if not len(ids):
|
||||
return []
|
||||
types = {
|
||||
'pay_voucher': 'CPV: ',
|
||||
'rec_voucher': 'CRV: ',
|
||||
'cont_voucher': 'CV: ',
|
||||
'bank_pay_voucher': 'BPV: ',
|
||||
'bank_rec_voucher': 'BRV: ',
|
||||
'journal_sale_vou': 'JSV: ',
|
||||
'journal_pur_voucher': 'JPV: ',
|
||||
|
||||
}
|
||||
return [(r['id'], types[r['type']]+(r['number'] or '')+' '+(r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
|
||||
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
|
||||
if not args:
|
||||
args=[]
|
||||
if not context:
|
||||
context={}
|
||||
ids = []
|
||||
if name:
|
||||
ids = self.search(cr, user, [('number','=',name)]+ args, limit=limit, context=context)
|
||||
if not ids:
|
||||
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context)
|
||||
return self.name_get(cr, user, ids, context)
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if default is None:
|
||||
default = {}
|
||||
default = default.copy()
|
||||
default.update({'state':'draft', 'number':False, 'move_id':False, 'move_ids':False})
|
||||
if 'date' not in default:
|
||||
default['date'] = time.strftime('%Y-%m-%d')
|
||||
return super(account_voucher, self).copy(cr, uid, id, default, context)
|
||||
|
||||
def action_cancel(self, cr, uid, ids, *args):
|
||||
account_move_obj = self.pool.get('account.move')
|
||||
voucher = self.read(cr, uid, ids, ['move_id'])
|
||||
for i in voucher:
|
||||
if i['move_id']:
|
||||
account_move_obj.button_cancel(cr, uid, [i['move_id'][0]])
|
||||
# delete the move this invoice was pointing to
|
||||
# Note that the corresponding move_lines and move_reconciles
|
||||
# will be automatically deleted too
|
||||
account_move_obj.unlink(cr, uid, [i['move_id'][0]])
|
||||
self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})
|
||||
# self._log_event(cr, uid, ids,-1.0, 'Cancel Invoice')
|
||||
return True
|
||||
|
||||
account_voucher()
|
||||
|
||||
class VoucherLine(osv.osv):
|
||||
_name = 'account.voucher.line'
|
||||
_description = 'Voucher Line'
|
||||
_columns = {
|
||||
'voucher_id':fields.many2one('account.voucher', 'Voucher'),
|
||||
'name':fields.char('Description', size=256, required=True),
|
||||
'account_id':fields.many2one('account.account','Account', required=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, required=True, ),
|
||||
'amount':fields.float('Amount'),
|
||||
'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Type'),
|
||||
'ref':fields.char('Ref.', size=32),
|
||||
'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account')
|
||||
}
|
||||
_defaults = {
|
||||
'type': lambda *a: 'cr'
|
||||
}
|
||||
def move_line_get(self, cr, uid, voucher_id, context={}):
|
||||
res = []
|
||||
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
inv = self.pool.get('account.voucher').browse(cr, uid, voucher_id)
|
||||
company_currency = inv.company_id.currency_id.id
|
||||
cur = inv.currency_id
|
||||
|
||||
for line in inv.payment_ids:
|
||||
res.append(self.move_line_get_item(cr, uid, line, context))
|
||||
return res
|
||||
|
||||
def onchange_partner(self, cr, uid, ids, partner_id, type,type1):
|
||||
if not partner_id:
|
||||
return {'value' : {'account_id' : False, 'type' : False ,'amount':False}}
|
||||
obj = self.pool.get('res.partner')
|
||||
account_id = False
|
||||
|
||||
if type1 in ('rec_voucher','bank_rec_voucher'):
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
|
||||
balance=obj.browse(cr,uid,partner_id).credit
|
||||
type = 'cr'
|
||||
elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_payable
|
||||
balance=obj.browse(cr,uid,partner_id).debit
|
||||
type = 'dr'
|
||||
elif type1 in ('journal_sale_vou') :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
|
||||
balance=obj.browse(cr,uid,partner_id).credit
|
||||
type = 'dr'
|
||||
|
||||
elif type1 in ('journal_pur_vou') :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_payable
|
||||
balance=obj.browse(cr,uid,partner_id).debit
|
||||
type = 'cr'
|
||||
|
||||
return {
|
||||
'value' : {'account_id' : account_id.id, 'type' : type, 'amount':balance}
|
||||
}
|
||||
|
||||
def onchange_amount(self, cr, uid, ids,partner_id,amount, type,type1):
|
||||
if not amount:
|
||||
return {'value' : {'type' : False}}
|
||||
obj = self.pool.get('res.partner')
|
||||
if type1 in ('rec_voucher','bank_rec_voucher'):
|
||||
if amount < 0 :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_payable
|
||||
type = 'dr'
|
||||
else:
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
|
||||
type = 'cr'
|
||||
|
||||
elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
|
||||
if amount < 0 :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
|
||||
type = 'cr'
|
||||
else:
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_payable
|
||||
type = 'dr'
|
||||
|
||||
elif type1 in ('journal_sale_vou') :
|
||||
if amount < 0 :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_payable
|
||||
type = 'cr'
|
||||
else:
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
|
||||
type = 'dr'
|
||||
|
||||
elif type1 in ('journal_pur_vou') :
|
||||
if amount< 0 :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
|
||||
type = 'dr'
|
||||
else:
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_payable
|
||||
type = 'cr'
|
||||
|
||||
return {
|
||||
'value' : { 'type' : type , 'amount':amount}
|
||||
}
|
||||
|
||||
|
||||
def onchange_type(self, cr, uid, ids,partner_id,amount,type,type1):
|
||||
if not partner_id:
|
||||
return {'value' : {'type' : False}}
|
||||
obj = self.pool.get('res.partner')
|
||||
|
||||
if type1 in ('rec_voucher','bank_rec_voucher'):
|
||||
if type == 'dr' :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_payable
|
||||
total=amount*(-1)
|
||||
else:
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
|
||||
total=amount*1
|
||||
|
||||
elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
|
||||
if type == 'cr' :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
|
||||
amount*=-1
|
||||
else:
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_payable
|
||||
amount*=1
|
||||
|
||||
elif type1 in ('journal_sale_vou') :
|
||||
if type == 'cr' :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_payable
|
||||
amount*=-1
|
||||
else:
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
|
||||
amount*=1
|
||||
|
||||
elif type1 in ('journal_pur_vou') :
|
||||
if type == 'dr' :
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
|
||||
amount*=-1
|
||||
else:
|
||||
account_id = obj.browse(cr, uid, partner_id).property_account_payable
|
||||
amount*=1
|
||||
|
||||
return {
|
||||
'value' : {'type' : type , 'amount':total}
|
||||
}
|
||||
|
||||
|
||||
def move_line_get_item(self, cr, uid, line, context={}):
|
||||
return {
|
||||
'type':'src',
|
||||
'name': line.name[:64],
|
||||
'amount':line.amount,
|
||||
'account_id':line.account_id.id,
|
||||
'partner_id':line.partner_id.id or False ,
|
||||
'account_analytic_id':line.account_analytic_id.id or False,
|
||||
}
|
||||
VoucherLine()
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
import time
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
import ir
|
||||
import pooler
|
||||
import mx.DateTime
|
||||
from mx.DateTime import RelativeDateTime
|
||||
|
||||
from tools import config
|
||||
|
||||
class Account(osv.osv):
|
||||
_inherit = "account.account"
|
||||
|
||||
def __compute(self, cr, uid, ids, field_names, arg, context={}, query=''):
|
||||
#compute the balance/debit/credit accordingly to the value of field_name for the given account ids
|
||||
mapping = {
|
||||
'balance': "COALESCE(SUM(l.debit) - SUM(l.credit) , 0) as balance ",
|
||||
'debit': "COALESCE(SUM(l.debit), 0) as debit ",
|
||||
'credit': "COALESCE(SUM(l.credit), 0) as credit "
|
||||
}
|
||||
#get all the necessary accounts
|
||||
ids2 = self._get_children_and_consol(cr, uid, ids, context)
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
#compute for each account the balance/debit/credit from the move lines
|
||||
accounts = {}
|
||||
if ids2:
|
||||
query = self.pool.get('account.move.line')._query_get(cr, uid,
|
||||
context=context)
|
||||
cr.execute(("SELECT l.account_id as id, " +\
|
||||
' , '.join(map(lambda x: mapping[x], field_names)) +
|
||||
"FROM " \
|
||||
"account_move_line l " \
|
||||
"WHERE " \
|
||||
"l.account_id IN (%s) " \
|
||||
"AND " + query + " " \
|
||||
"GROUP BY l.account_id") % (acc_set, ))
|
||||
|
||||
for res in cr.dictfetchall():
|
||||
accounts[res['id']] = res
|
||||
|
||||
#for the asked accounts, get from the dictionnary 'accounts' the value of it
|
||||
res = {}
|
||||
for id in ids:
|
||||
res[id] = self._get_account_values(cr, uid, id, accounts, field_names, context)
|
||||
for id in ids:
|
||||
open=self.browse(cr, uid, id, context)
|
||||
type_id=open.user_type
|
||||
obj=self.pool.get('account.account.type').browse(cr,uid,type_id.id)
|
||||
open_balance=open.open_bal
|
||||
if obj.code in ('cash','asset','expense'):
|
||||
res[id]['balance']+=open_balance
|
||||
elif obj.code in ('equity','income','liability'):
|
||||
total=open_balance*(-1)
|
||||
res[id]['balance']+=total
|
||||
else:
|
||||
res[id]=res[id]
|
||||
return res
|
||||
|
||||
def _get_account_values(self, cr, uid, id, accounts, field_names, context={}):
|
||||
res = {}.fromkeys(field_names, 0.0)
|
||||
browse_rec = self.browse(cr, uid, id)
|
||||
if browse_rec.type == 'consolidation':
|
||||
ids2 = self.read(cr, uid, [browse_rec.id], ['child_consol_ids'], context)[0]['child_consol_ids']
|
||||
for t in self.search(cr, uid, [('parent_id', 'child_of', [browse_rec.id])]):
|
||||
if t not in ids2 and t != browse_rec.id:
|
||||
ids2.append(t)
|
||||
for i in ids2:
|
||||
tmp = self._get_account_values(cr, uid, i, accounts, field_names, context)
|
||||
for a in field_names:
|
||||
res[a] += tmp[a]
|
||||
else:
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', [browse_rec.id])])
|
||||
for i in ids2:
|
||||
for a in field_names:
|
||||
res[a] += accounts.get(i, {}).get(a, 0.0)
|
||||
return res
|
||||
|
||||
def _diff(self, cr, uid, ids, field_name, arg, context={}):
|
||||
|
||||
res={}
|
||||
dr_total=0.0
|
||||
cr_total=0.0
|
||||
difference=0.0
|
||||
for id in ids:
|
||||
open=self.browse(cr, uid, id, context)
|
||||
if open.type1 == 'dr':
|
||||
dr_total+=open.open_bal
|
||||
elif open.type1 == 'cr':
|
||||
cr_total+=open.open_bal
|
||||
else:
|
||||
difference=0.0
|
||||
difference=dr_total-cr_total
|
||||
for id in ids:
|
||||
res[id]=difference
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'open_bal' : fields.float('Opening Balance',digits=(16,2)),
|
||||
'diff' : fields.function(_diff, digits=(16,2),method=True,string='Difference of Opening Bal.'),
|
||||
'type1':fields.selection([('dr','Debit'),('cr','Credit'),('none','None')], 'Dr/Cr',store=True),
|
||||
'balance': fields.function(__compute, digits=(16,2), method=True, string='Closing Balance', multi='balance'),
|
||||
'credit': fields.function(__compute, digits=(16,2), method=True, string='Credit', multi='balance'),
|
||||
'debit': fields.function(__compute, digits=(16,2), method=True, string='Debit', multi='balance'),
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
def onchange_type(self, cr, uid, ids,user_type,type1):
|
||||
obj=self.pool.get('account.account.type').browse(cr,uid,user_type)
|
||||
account_type=obj.code
|
||||
if not account_type:
|
||||
return {'value' : {}}
|
||||
if account_type in ('cash','asset','expense'):
|
||||
type1 = 'dr'
|
||||
elif account_type in ('equity','income','liability') :
|
||||
type1 = 'cr'
|
||||
else:
|
||||
type1 = 'none'
|
||||
|
||||
return {
|
||||
'value' : {'type1' : type1}
|
||||
}
|
||||
|
||||
Account()
|
|
@ -0,0 +1,295 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_voucher_tree">
|
||||
<field name="name">account.voucher.tree</field>
|
||||
<field name="model">account.voucher</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Vouchers">
|
||||
<field name="name"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="account_id" />
|
||||
<field name="amount"/>
|
||||
<field name="date"/>
|
||||
<field name="period_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_voucher_form">
|
||||
<field name="name">account.voucher.form</field>
|
||||
<field name="model">account.voucher</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Voucher">
|
||||
<notebook>
|
||||
<page string="Entry">
|
||||
<field name="number"/>
|
||||
<field name="type" select="2" on_change="onchange_journal(journal_id,type)"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="journal_id" select="1" on_change="onchange_journal(journal_id,type)"/>
|
||||
<field name="account_id" select="2" on_change="onchange_account(account_id)"/>
|
||||
<field name="amount" select="1" required="1"/>
|
||||
<newline/>
|
||||
<field name="payment_ids" colspan="4" nolabel="1">
|
||||
<tree string="Voucher Lines" editable="top">
|
||||
<field name="partner_id" on_change="onchange_partner(partner_id,type,parent.type)"/>
|
||||
<field name="account_id" groups="base.group_system"/>
|
||||
<field name="name" groups="base.group_system"/>
|
||||
<field name="ref"/>
|
||||
<field name="amount"/>
|
||||
<field name="type"/>
|
||||
</tree>
|
||||
</field>
|
||||
<separator string="Narration" colspan="4"/>
|
||||
<field name="narration" colspan="4" nolabel="1"/>
|
||||
<group col="6" colspan="6">
|
||||
<field name="state"/>
|
||||
<button name="open_voucher" string="Pro-forma" states="draft" type="object"/>
|
||||
<button name="proforma_voucher" string="Create" states="proforma" type="object"/>
|
||||
<button name="cancel_voucher" string="Cancel" states="draft,proforma,posted" type="object"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Other Info">
|
||||
<field name="company_id" select="1"/>
|
||||
<field name="reference_type" select="2" nolabel="1" size="0"/>
|
||||
<field name="reference" select="1" nolabel="1"/>
|
||||
<field name="currency_id" select="1" />
|
||||
<field name="period_id"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_voucher_list">
|
||||
<field name="name">Vouchers</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries"
|
||||
id="menu_action_voucher_list" action="action_voucher_list"/>
|
||||
|
||||
<!-- Receipt Vouchers -->
|
||||
<record model="ir.actions.act_window" id="action_receipt_vou_voucher_list">
|
||||
<field name="name">Receipt Vouchers</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
<field name="domain">[('type','like','rec_voucher')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Receipt Vouchers"
|
||||
id="menu_action_receipt_vou_voucher_list" action="action_receipt_vou_voucher_list"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_receipt_cashreceipt_voucher_list">
|
||||
<field name="name">Cash Receipt</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
<field name="domain">[('type','=','rec_voucher')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Receipt Vouchers/Cash Receipts"
|
||||
id="menu_action_receipt_cashreceipt_voucher_list" action="action_receipt_cashreceipt_voucher_list"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_draft_cash_rec_voucher_form">
|
||||
<field name="name">Cash Receipt Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
<field name="domain">[('type','=','rec_voucher'),('state','=','draft')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Receipt Vouchers/Cash Receipts/Draf Cash Receipt"
|
||||
id="menu_action_draft_cash_rec_voucher_form" action="action_draft_cash_rec_voucher_form"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_performa_cash_rec_voucher_form">
|
||||
<field name="name">Cash Receipt Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
<field name="domain">[('type','=','rec_voucher'),('state','=','proforma')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Receipt Vouchers/Cash Receipts/Pro-forma Cash Receipt"
|
||||
id="menu_action_performa_cash_rec_voucher_form" action="action_performa_cash_rec_voucher_form"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_posted_cash_rec_voucher_form">
|
||||
<field name="name">Cash Receipt Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
<field name="domain">[('type','=','rec_voucher'),('state','=','posted')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Receipt Vouchers/Cash Receipts/Posted Cash Receipt"
|
||||
id="menu_action_posted_cash_rec_voucher_form" action="action_posted_cash_rec_voucher_form"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_cancel_cash_rec_voucher_form">
|
||||
<field name="name">Cash Receipt Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
<field name="domain">[('type','=','rec_voucher'),('state','=','cancel')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Receipt Vouchers/Cash Receipts/Cancel Cash Receipt"
|
||||
id="menu_action_cancel_cash_rec_voucher_form" action="action_cancel_cash_rec_voucher_form"/>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_view_cash_rec_voucher_form">
|
||||
<field name="name">Cash Receipt Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_id" eval="view_voucher_form"/>
|
||||
<field name="domain">[('type','=','rec_voucher')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Receipt Vouchers/Cash Receipts/New Cash Receipt" id="menu_action_view_cash_rec_voucher_form" action="action_view_cash_rec_voucher_form"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_receipt_bakreceipt_voucher_list">
|
||||
<field name="name">Bank Receipt</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
<field name="domain">[('type','=','bank_rec_voucher')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Receipt Vouchers/Bank Receipts"
|
||||
id="menu_action_receipt_bakreceipt_voucher_list" action="action_receipt_bakreceipt_voucher_list"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_view_bank_rec_voucher_form">
|
||||
<field name="name">Bank Receipt Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_id" eval="view_voucher_form"/>
|
||||
<field name="domain">[('type','=','bank_rec_voucher')]</field>
|
||||
<field name="context">{'type':'bank_rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Receipt Vouchers/Bank Receipts/New Bank Receipt" id="menu_action_view_bank_rec_voucher_form" action="action_view_bank_rec_voucher_form"/>
|
||||
|
||||
|
||||
<!-- End Receipt Vouchers -->
|
||||
|
||||
|
||||
<!-- Payment Vouchers -->
|
||||
<record model="ir.actions.act_window" id="action_payments_voucher_list">
|
||||
<field name="name">Payment Vouchers</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
<field name="domain">[('type','like','pay_voucher')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Payment Vouchers"
|
||||
id="menu_action_payments_voucher_list" action="action_payments_voucher_list"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_payments_cashpay_voucher_list">
|
||||
<field name="name">Payment Vouchers</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
<field name="domain">[('type','=','pay_voucher')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Payment Vouchers/Cash Payments"
|
||||
id="menu_action_payments_cashpay_voucher_list" action="action_payments_cashpay_voucher_list"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_view_cash_pay_voucher_form">
|
||||
<field name="name">Cash Payment Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_id" eval="view_voucher_form"/>
|
||||
<field name="domain">[('type','=','pay_voucher')]</field>
|
||||
<field name="context">{'type':'pay_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Payment Vouchers/Cash Payments/New Cash Payment" id="menu_action_view_cash_pay_voucher_form" action="action_view_cash_pay_voucher_form"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_payments_bankpay_voucher_list">
|
||||
<field name="name">Payment Vouchers</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
<field name="domain">[('type','=','bank_pay_voucher')]</field>
|
||||
<field name="context">{'type':'rec_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Payment Vouchers/Bank Payments"
|
||||
id="menu_action_payments_bankpay_voucher_list" action="action_payments_bankpay_voucher_list"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_view_bank_pay_voucher_form">
|
||||
<field name="name">Bank Payment Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_id" eval="view_voucher_form"/>
|
||||
<field name="domain">[('type','=','bank_pay_voucher')]</field>
|
||||
<field name="context">{'type':'bank_pay_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Payment Vouchers/Bank Payments/New Bank Payment" id="menu_action_view_bank_pay_voucher_form" action="action_view_bank_pay_voucher_form"/>
|
||||
|
||||
<!-- End Payment Vouchers -->
|
||||
|
||||
<!-- Other Voucher Enries -->
|
||||
<record model="ir.actions.act_window" id="action_other_voucher_list">
|
||||
<field name="name">Other Vouchers</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_voucher_tree"/>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Other Vouchers"
|
||||
id="menu_action_other_voucher_list" action="action_other_voucher_list"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_view_cont_voucher_form">
|
||||
<field name="name">Contra Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_id" eval="view_voucher_form"/>
|
||||
<field name="domain">[('type','=','cont_voucher')]</field>
|
||||
<field name="context">{'type':'cont_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Other Vouchers/Contra Voucher" id="menu_action_view_cont_voucher_form" action="action_view_cont_voucher_form"/>
|
||||
<record model="ir.actions.act_window" id="action_view_jour_sale_voucher_form">
|
||||
<field name="name">Journal Sale Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_id" eval="view_voucher_form"/>
|
||||
<field name="domain">[('type','=','journal_sale_voucher')]</field>
|
||||
<field name="context">{'type':'journal_sale_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Other Vouchers/Journal Sale Voucher" id="menu_action_view_jour_sale_voucher_form" action="action_view_jour_sale_voucher_form"/>
|
||||
<record model="ir.actions.act_window" id="action_view_jour_pur_voucher_form">
|
||||
<field name="name">Journal Purchase Voucher</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_id" eval="view_voucher_form"/>
|
||||
<field name="domain">[('type','=','journal_pur_voucher')]</field>
|
||||
<field name="context">{'type':'journal_pur_voucher'}</field>
|
||||
</record>
|
||||
<menuitem name="Financial Management/Voucher Entries/Other Vouchers/Journal Purchase Voucher" id="menu_action_view_jour_pur_voucher_form" action="action_view_jour_pur_voucher_form"/>
|
||||
|
||||
</data>
|
||||
</terp>
|
|
@ -0,0 +1 @@
|
|||
import open_voucher
|
|
@ -0,0 +1,113 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
from tools.translate import _
|
||||
import pooler
|
||||
|
||||
_voucher_form = '''<?xml version="1.0"?>
|
||||
<form string="Open Vouchers">
|
||||
<field name="type"/>
|
||||
<field name="state"/>
|
||||
<field name="period_ids" colspan="4"/>
|
||||
</form>'''
|
||||
|
||||
_types = {
|
||||
'pay_voucher':'Cash Payment Voucher',
|
||||
'bank_pay_voucher':'Bank Payment Voucher',
|
||||
'rec_voucher':'Cash Receipt Voucher',
|
||||
'bank_rec_voucher':'Bank Receipt Voucher',
|
||||
'cont_voucher':'Contra Voucher',
|
||||
'journal_sale_voucher':'Journal Sale Voucher',
|
||||
'journal_pur_voucher':'Journal Purchase Voucher'
|
||||
}
|
||||
_states = {
|
||||
'draft':'Draft',
|
||||
'proforma':'Pro-forma',
|
||||
'posted':'Posted',
|
||||
'cancel':'Cancel'
|
||||
}
|
||||
|
||||
_voucher_fields = {
|
||||
'type': {'string':'Voucher Type', 'type':'selection', 'selection':[
|
||||
('pay_voucher','Cash Payment Voucher'),
|
||||
('bank_pay_voucher','Bank Payment Voucher'),
|
||||
('rec_voucher','Cash Receipt Voucher'),
|
||||
('bank_rec_voucher','Bank Receipt Voucher'),
|
||||
('cont_voucher','Contra Voucher'),
|
||||
('journal_sale_voucher','Journal Sale Voucher'),
|
||||
('journal_pur_voucher','Journal Purchase Voucher')], 'required':True},
|
||||
'state': {'string':'State', 'type':'selection', 'selection':[
|
||||
('draft','Draft'),
|
||||
('proforma','Pro-forma'),
|
||||
('posted','Posted'),
|
||||
('cancel','Cancel')], 'required':True},
|
||||
'period_ids': {'string':'Periods', 'type':'many2many', 'relation':'account.period'},
|
||||
}
|
||||
|
||||
def _action_open_window(self, cr, uid, data, context):
|
||||
form = data['form']
|
||||
periods = []
|
||||
|
||||
if not form['period_ids'][0][2]:
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
period = pool.get('account.period')
|
||||
year = pool.get('account.fiscalyear')
|
||||
|
||||
year = year.find(cr, uid)
|
||||
periods = period.search(cr, uid, [('fiscalyear_id','=',year)])
|
||||
else:
|
||||
periods = form['period_ids'][0][2]
|
||||
|
||||
return {
|
||||
'domain': "[('type','=','%s'), ('state','=','%s'), ('period_id','in',%s)]" % (form['type'], form['state'], periods),
|
||||
'name': "%s - %s" % (_types[form['type']], _states[form['state']]),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.voucher',
|
||||
'view_id': False,
|
||||
'context': "{'type':'%s', 'state':'%s', 'period_id':%s}" % (form['type'], form['state'], periods),
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
class OpenVoucherEntries(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':_voucher_form, 'fields':_voucher_fields, 'state':[('end','Cancel'),('open','Open Voucher Entries')]}
|
||||
},
|
||||
'open': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
|
||||
}
|
||||
}
|
||||
OpenVoucherEntries('account.voucher.open')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -17,6 +17,7 @@
|
|||
"demo_xml" : [],
|
||||
"update_xml" : [
|
||||
"analytic_journal_billing_rate_view.xml",
|
||||
"security/ir.model.access.csv",
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_analytic_journal_rate_user","analytic journal rate user","model_analytic_journal_rate_grid","project.group_project_user",1,0,0,0
|
||||
"access_analytic_journal_rate_manager","analytic journal rate manager","model_analytic_journal_rate_grid","project.group_project_manager",1,1,1,1
|
||||
"access_analytic_journal_rate_account_manager","analytic journal rateaccount manager","model_analytic_journal_rate_grid","account.group_account_manager",1,1,1,1
|
|
|
@ -17,6 +17,7 @@
|
|||
"demo_xml" : [],
|
||||
"update_xml" : [
|
||||
"analytic_user_function_view.xml",
|
||||
"security/ir.model.access.csv",
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_analytic_user_funct_user","analytic user funct user","model_analytic_user_funct_grid","project.group_project_user",1,0,0,0
|
||||
"access_analytic_user_funct_manager","analytic user funct manager","model_analytic_user_funct_grid","project.group_project_manager",1,1,1,1
|
||||
"access_analytic_user_funct_account_manager","analytic user funct account manager","model_analytic_user_funct_grid","account.group_account_manager",1,1,1,1
|
|
|
@ -6,15 +6,15 @@
|
|||
<field eval=""terp-calendar"" name="icon"/>
|
||||
<field eval="False" name="parent_id"/>
|
||||
</record>
|
||||
<record id="association_vertical.menu_crm_case_fund_raise" model="ir.ui.menu">
|
||||
<!--<record id="association_vertical.menu_crm_case_fund_raise" model="ir.ui.menu">
|
||||
<field eval=""Fund Raising"" name="name"/>
|
||||
<field eval=""terp-account"" name="icon"/>
|
||||
<field eval="False" name="parent_id"/>
|
||||
</record>
|
||||
</record>-->
|
||||
<record id="product.menu_main_product" model="ir.ui.menu">
|
||||
<field model="ir.ui.menu" name="parent_id" search="[('name','=','Configuration'),('parent_id.name','=','Financial Management')]"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- For Shortcuts menu
|
||||
-->
|
||||
<!--
|
||||
|
@ -25,8 +25,8 @@
|
|||
<field name="sequence">4</field>
|
||||
<field name="res_id" ref="crm_configuration.menu_crm_case_categ_meet_my"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<record model="ir.ui.view_sc" id="ir_ui_view_sc_myopenprojects1">
|
||||
<field name="name">"My Open Projects"</field>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<field name="sequence">4</field>
|
||||
<field name="res_id" ref="project.menu_open_view_my_project_open"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="ir_ui_view_sc_myopenprojects1" model="ir.ui.view_sc">
|
||||
<field ref="project.menu_open_view_my_project_open" name="res_id"/>
|
||||
<field eval=""ir.ui.menu"" name="resource"/>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<field eval=""Products"" name="name"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="ir_ui_view_sc_events0" model="ir.ui.view_sc">
|
||||
<field ref="event.menu_event_event" name="res_id"/>
|
||||
<field eval=""ir.ui.menu"" name="resource"/>
|
||||
|
|
|
@ -4,8 +4,11 @@
|
|||
"version" : "1.0",
|
||||
"depends" : ["base","account","l10n_be","hr_attendance"],
|
||||
"update_xml" : [
|
||||
# FIXME: review security rules...
|
||||
"security/ir.model.access.csv",
|
||||
"auction_view.xml", "auction_report.xml", "auction_wizard.xml"
|
||||
"auction_view.xml",
|
||||
"auction_report.xml",
|
||||
"auction_wizard.xml",
|
||||
],
|
||||
"demo_xml" : [
|
||||
"auction_demo.xml"
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_auction_artists,auction.artists,model_auction_artists,base.group_user,1,1,1,1
|
||||
access_auction_dates,auction.dates,model_auction_dates,base.group_user,1,1,1,1
|
||||
access_auction_deposit,auction.deposit,model_auction_deposit,base.group_user,1,1,1,1
|
||||
access_auction_deposit_cost,auction.deposit.cost,model_auction_deposit_cost,base.group_user,1,1,1,1
|
||||
access_auction_lot_category,auction.lot.category,model_auction_lot_category,base.group_user,1,1,1,1
|
||||
access_auction_lots,auction.lots,model_auction_lots,base.group_user,1,1,1,1
|
||||
access_auction_bid,auction.bid,model_auction_bid,base.group_user,1,1,1,1
|
||||
access_auction_lot_history,auction.lot.history,model_auction_lot_history,base.group_user,1,1,1,1
|
||||
access_report_buyer_auction,report.buyer.auction,model_report_buyer_auction,base.group_user,1,1,1,1
|
||||
access_report_seller_auction,report.seller.auction,model_report_seller_auction,base.group_user,1,1,1,1
|
||||
access_report_auction_view,report.auction.view,model_report_auction_view,base.group_user,1,1,1,1
|
||||
access_report_auction_object_date,report.auction.object.date,model_report_auction_object_date,base.group_user,1,1,1,1
|
||||
access_report_auction_estimation_adj_category,report.auction.estimation.adj.category,model_report_auction_estimation_adj_category,base.group_user,1,1,1,1
|
||||
access_report_auction_adjudication,report.auction.adjudication,model_report_auction_adjudication,base.group_user,1,1,1,1
|
||||
access_report_attendance,report.attendance,model_report_attendance,base.group_user,1,1,1,1
|
||||
access_report_deposit_border,report.deposit.border,model_report_deposit_border,base.group_user,1,1,1,1
|
||||
access_report_object_encoded,report.object.encoded,model_report_object_encoded,base.group_user,1,1,1,1
|
||||
access_report_object_encoded_manager,report.object.encoded.manager,model_report_object_encoded_manager,base.group_user,1,1,1,1
|
||||
access_report_unclassified_objects,report.unclassified.objects,model_report_unclassified_objects,base.group_user,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_auction_artists","auction.artists","model_auction_artists","base.group_user",1,1,1,1
|
||||
"access_auction_dates","auction.dates","model_auction_dates","base.group_user",1,1,1,1
|
||||
"access_auction_deposit","auction.deposit","model_auction_deposit","base.group_user",1,1,1,1
|
||||
"access_auction_deposit_cost","auction.deposit.cost","model_auction_deposit_cost","base.group_user",1,1,1,1
|
||||
"access_auction_lot_category","auction.lot.category","model_auction_lot_category","base.group_user",1,1,1,1
|
||||
"access_auction_lots","auction.lots","model_auction_lots","base.group_user",1,1,1,1
|
||||
"access_auction_bid","auction.bid","model_auction_bid","base.group_user",1,1,1,1
|
||||
"access_auction_bid_line","auction.bid.line","model_auction_bid_line","base.group_user",1,1,1,1
|
||||
"access_auction_lot_history","auction.lot.history","model_auction_lot_history","base.group_user",1,1,1,1
|
||||
"access_report_buyer_auction","report.buyer.auction","model_report_buyer_auction","base.group_user",1,0,0,0
|
||||
"access_report_buyer_auction2","report.buyer.auction2","model_report_buyer_auction2","base.group_user",1,0,0,0
|
||||
"access_report_seller_auction","report.seller.auction","model_report_seller_auction","base.group_user",1,0,0,0
|
||||
"access_report_seller_auction2","report.seller.auction2","model_report_seller_auction2","base.group_user",1,0,0,0
|
||||
"access_report_auction_view","report.auction.view","model_report_auction_view","base.group_user",1,0,0,0
|
||||
"access_report_auction_view2","report.auction.view2","model_report_auction_view2","base.group_user",1,0,0,0
|
||||
"access_report_auction_object_date","report.auction.object.date","model_report_auction_object_date","base.group_user",1,0,0,0
|
||||
"access_report_auction_estimation_adj_category","report.auction.estimation.adj.category","model_report_auction_estimation_adj_category","base.group_user",1,0,0,0
|
||||
"access_report_auction_adjudication","report.auction.adjudication","model_report_auction_adjudication","base.group_user",1,0,0,0
|
||||
"access_report_attendance","report.attendance","model_report_attendance","base.group_user",1,0,0,0
|
||||
"access_report_deposit_border","report.deposit.border","model_report_deposit_border","base.group_user",1,0,0,0
|
||||
"access_report_object_encoded","report.object.encoded","model_report_object_encoded","base.group_user",1,0,0,0
|
||||
"access_report_object_encoded_manager","report.object.encoded.manager","model_report_object_encoded_manager","base.group_user",1,0,0,0
|
||||
"access_report_unclassified_objects","report.unclassified.objects","model_report_unclassified_objects","base.group_user",1,0,0,0
|
||||
|
|
|
|
@ -133,10 +133,14 @@ class res_partner_job(osv.osv):
|
|||
'sequence_partner':fields.integer('Sequence (Partner)',help='order of importance of this function in the list of functions of the linked partner'),
|
||||
'email': fields.char('E-Mail', size=240),
|
||||
'phone': fields.char('Phone', size=64),
|
||||
'date_start' : fields.date('Date Start'),
|
||||
'date_stop' : fields.date('Date Stop'),
|
||||
'state' : fields.selection([('past', 'Past'),('current', 'Current')], 'State', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'sequence_contact' : lambda *a: 0,
|
||||
'state' : lambda *a: 'current',
|
||||
}
|
||||
res_partner_job()
|
||||
|
||||
|
|
|
@ -23,40 +23,44 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Partner Contact">
|
||||
<notebook>
|
||||
<field name="name" select="1"/>
|
||||
<field name="first_name" select="1"/>
|
||||
<notebook colspan="4" >
|
||||
<page string="General">
|
||||
<field name="name" select="1"/>
|
||||
<field name="first_name" select="1"/>
|
||||
<newline/>
|
||||
<separator string="General Information" colspan="4"/>
|
||||
<field name="mobile" select="2"/>
|
||||
<field name="title" select="1" />
|
||||
<field name="website"/>
|
||||
<field name="lang_id"/>
|
||||
<field name="active"/>
|
||||
<separator string="Functions" colspan="4"/>
|
||||
<field name="job_ids" colspan="4" nolabel="1" mode="tree, form">
|
||||
<form string="Functions">
|
||||
<field name="sequence_contact"/>
|
||||
<field name="function_id"/>
|
||||
<field name="name"/>
|
||||
<field name="address_id"/>
|
||||
<field name="phone"/>
|
||||
<field name="email"/>
|
||||
</form>
|
||||
<tree string="Functions">
|
||||
<field name="sequence_contact"/>
|
||||
<field name="function_id"/>
|
||||
<field name="name"/>
|
||||
<field name="address_id"/>
|
||||
<field name="phone"/>
|
||||
<field name="email"/>
|
||||
</tree>
|
||||
</field>
|
||||
<newline/>
|
||||
<separator string="General Information" colspan="4"/>
|
||||
<field name="mobile" select="2"/>
|
||||
<field name="title" select="1" />
|
||||
<field name="website"/>
|
||||
<field name="lang_id"/>
|
||||
<field name="active"/>
|
||||
<separator string="Functions" colspan="4"/>
|
||||
<field name="job_ids" colspan="4" nolabel="1" mode="tree, form">
|
||||
<form string="Functions">
|
||||
<field name="function_id"/>
|
||||
<field name="address_id"/>
|
||||
<field name="name"/>
|
||||
<field name="sequence_contact"/>
|
||||
<field name="phone"/>
|
||||
<field name="email"/>
|
||||
<field name="date_start" />
|
||||
<field name="date_stop" />
|
||||
<field name="state" />
|
||||
</form>
|
||||
<tree string="Functions">
|
||||
<field name="sequence_contact" string="Seq."/>
|
||||
<field name="function_id"/>
|
||||
<field name="name"/>
|
||||
<field name="address_id"/>
|
||||
<field name="phone"/>
|
||||
<field name="email"/>
|
||||
<field name="state" />
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Extra Information">
|
||||
<field name="country_id"/>
|
||||
<field name="birthdate" select="1" />
|
||||
<field name="country_id"/>
|
||||
<field name="birthdate" select="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
|
@ -101,14 +105,14 @@
|
|||
<newline/>
|
||||
<field name="job_ids" mode="tree, form" colspan="4">
|
||||
<tree string="Contacts" editable="top">
|
||||
<field name="sequence_partner"/>
|
||||
<field name="sequence_partner"/>
|
||||
<field name="contact_id"/>
|
||||
<field name="function_id"/>
|
||||
<field name="phone"/>
|
||||
<field name="email"/>
|
||||
</tree>
|
||||
<form string="Contacts">
|
||||
<field name="sequence_partner"/>
|
||||
<field name="sequence_partner"/>
|
||||
<field name="contact_id"/>
|
||||
<field name="function_id"/>
|
||||
<field name="phone"/>
|
||||
|
@ -236,7 +240,7 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Views for res.partner.job -->
|
||||
<!-- Views for res.partner.job -->
|
||||
<record model="ir.ui.view" id="view_partner_job_tree">
|
||||
<field name="name">res.partner.job.tree</field>
|
||||
<field name="model">res.partner.job</field>
|
||||
|
@ -249,6 +253,7 @@
|
|||
<field name="function_id"/>
|
||||
<field name="email"/>
|
||||
<field name="phone"/>
|
||||
<field name="state" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -269,26 +274,29 @@
|
|||
<field name="phone" select="2"/>
|
||||
<field name="sequence_contact" select="2"/>
|
||||
<field name="sequence_partner" select="2"/>
|
||||
<field name="date_start" />
|
||||
<field name="date_stop" />
|
||||
<field name="state" select="2" />
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Menuitem for res.partner.job -->
|
||||
<record model="ir.actions.act_window" id="action_res_partner_job">
|
||||
<field name="name">Functions</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.partner.job</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
<menuitem name="Partners/Functions" action="action_res_partner_job" id="menu_action_res_partner_job"/>
|
||||
<!-- Act window defining a shorcut on partners to open all his contacts -->
|
||||
<act_window name="Open all Partner's Function"
|
||||
domain="[('name', '=', active_id)]"
|
||||
res_model="res.partner.job"
|
||||
src_model="res.partner"
|
||||
view_mode='tree,form'
|
||||
id="act_res_partner_jobs"/>
|
||||
<!-- Menuitem for res.partner.job -->
|
||||
<record model="ir.actions.act_window" id="action_res_partner_job">
|
||||
<field name="name">Functions</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.partner.job</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
<menuitem name="Partners/Functions" action="action_res_partner_job" id="menu_action_res_partner_job"/>
|
||||
<!-- Act window defining a shorcut on partners to open all his contacts -->
|
||||
<act_window name="Open all Partner's Function"
|
||||
domain="[('name', '=', active_id)]"
|
||||
res_model="res.partner.job"
|
||||
src_model="res.partner"
|
||||
view_mode='tree,form'
|
||||
id="act_res_partner_jobs"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_res_partner_contact,res.partner.contact,model_res_partner_contact,base.group_user,1,1,1,1
|
||||
access_res_partner_job,res.partner.job,model_res_partner_job,base.group_user,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_res_partner_contact","res.partner.contact","model_res_partner_contact","base.group_partner_manager",1,1,1,1
|
||||
"access_res_partner_job","res.partner.job","model_res_partner_job","base.group_partner_manager",1,1,1,1
|
||||
"access_res_partner_contact_all","res.partner.contact all","model_res_partner_contact",,1,0,0,0
|
||||
"access_res_partner_job_all","res.partner.job all","model_res_partner_job",,1,0,0,0
|
||||
|
|
|
|
@ -51,7 +51,10 @@ class base_module_record(osv.osv):
|
|||
def _create_id(self, cr, uid, model, data):
|
||||
i = 0
|
||||
while True:
|
||||
name = filter(lambda x: x in string.letters, (data.get('name','') or '').lower())
|
||||
try:
|
||||
name = filter(lambda x: x in string.letters, (data.get('name','') or '').lower())
|
||||
except:
|
||||
name=''
|
||||
val = model.replace('.','_')+'_'+name+ str(i)
|
||||
i+=1
|
||||
if val not in self.ids.values():
|
||||
|
@ -79,11 +82,7 @@ class base_module_record(osv.osv):
|
|||
self.depends[res[0]['module']]=True
|
||||
record_list = [record]
|
||||
fields = self.pool.get(model).fields_get(cr, uid)
|
||||
# print "before>>>>",fields
|
||||
# fields = self.pool.get(model).fields_view_get(cr, uid, context={})['fields']
|
||||
# print "after>>>>",fields
|
||||
for key,val in data.items():
|
||||
print key,val
|
||||
if not (val or (fields[key]['type']=='boolean')):
|
||||
continue
|
||||
if fields[key]['type'] in ('integer','float'):
|
||||
|
@ -107,7 +106,8 @@ class base_module_record(osv.osv):
|
|||
if not id:
|
||||
field.setAttribute("model", fields[key]['relation'])
|
||||
name = self.pool.get(fields[key]['relation']).browse(cr, uid, val).name
|
||||
print name
|
||||
if isinstance(name, basestring):
|
||||
name = name.decode('utf8')
|
||||
field.setAttribute("search", "[('name','=','"+name+"')]")
|
||||
else:
|
||||
field.setAttribute("ref", id)
|
||||
|
@ -115,7 +115,10 @@ class base_module_record(osv.osv):
|
|||
elif fields[key]['type'] in ('one2many',):
|
||||
for valitem in (val or []):
|
||||
if valitem[0]==0:
|
||||
fname = self.pool.get(model)._columns[key]._fields_id
|
||||
if key in self.pool.get(model)._columns:
|
||||
fname = self.pool.get(model)._columns[key]._fields_id
|
||||
else:
|
||||
fname = self.pool.get(model)._inherit_fields[key][2]._fields_id
|
||||
valitem[2][fname] = record_id
|
||||
newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
|
||||
childrecord, update = self._create_record(cr, uid, doc, fields[key]['relation'],valitem[2], newid)
|
||||
|
@ -153,7 +156,6 @@ class base_module_record(osv.osv):
|
|||
return record_list, noupdate
|
||||
|
||||
def _generate_object_xml(self, cr, uid, rec, recv, doc, result=None):
|
||||
print "_generate_object_xml>>>",rec,recv,doc
|
||||
record_list = []
|
||||
noupdate = False
|
||||
if rec[4]=='write':
|
||||
|
|
|
@ -52,6 +52,8 @@ view_form_profit = """<?xml version="1.0"?>
|
|||
|
||||
view_form_company = """<?xml version="1.0"?>
|
||||
<form string="Setup">
|
||||
<notebook colspan="4">
|
||||
<page string="General Information">
|
||||
<image name="gtk-dialog-info" colspan="2"/>
|
||||
<group>
|
||||
<separator string="Define Main Company" colspan="4"/>
|
||||
|
@ -67,12 +69,18 @@ view_form_company = """<?xml version="1.0"?>
|
|||
<field name="email" align="0.0"/>
|
||||
<field name="phone" align="0.0"/>
|
||||
<field name="currency" align="0.0"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Report Information">
|
||||
<separator string="Report header" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="rml_header1" align="0.0" colspan="4"/>
|
||||
<field name="rml_footer1" align="0.0" colspan="4"/>
|
||||
<field name="rml_footer2" align="0.0" colspan="4"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Your Logo - Use a size of about 450x150 pixels."/>
|
||||
<field colspan="4" name="logo" widget="image"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>"""
|
||||
|
||||
view_form_update = """<?xml version="1.0"?>
|
||||
|
@ -110,8 +118,6 @@ class wizard_base_setup(wizard.interface):
|
|||
res.sort()
|
||||
return res
|
||||
|
||||
|
||||
|
||||
def _get_company(self, cr, uid, data, context):
|
||||
pool=pooler.get_pool(cr.dbname)
|
||||
company_obj=pool.get('res.company')
|
||||
|
@ -121,28 +127,10 @@ class wizard_base_setup(wizard.interface):
|
|||
company=company_obj.browse(cr, uid, ids)[0]
|
||||
self.fields['name']['default']=company.name
|
||||
self.fields['currency']['default']=company.currency_id.id
|
||||
serv_pro_id = pooler.get_pool(cr.dbname).get('ir.module.module').search(cr, uid, [('name','=','profile_service')]) or False
|
||||
if serv_pro_id:
|
||||
return {'profile':serv_pro_id[0]}
|
||||
return {}
|
||||
#self.fields['rml_header1']['default']=company.rml_header1
|
||||
#self.fields['rml_footer1']['default']=company.rml_footer1
|
||||
#self.fields['rml_footer2']['default']=company.rml_footer2
|
||||
#if not company.partner_id.address:
|
||||
# return {}
|
||||
#address=company.partner_id.address[0]
|
||||
#self.fields['street']['default']=address.street
|
||||
#self.fields['street2']['default']=address.street2
|
||||
#self.fields['zip']['default']=address.zip
|
||||
#self.fields['city']['default']=address.city
|
||||
#self.fields['email']['default']=address.email
|
||||
#self.fields['phone']['default']=address.phone
|
||||
#if address.state_id:
|
||||
# self.fields['state_id']['default']=address.state_id.id
|
||||
#else:
|
||||
# self.fields['state_id']['default']=-1
|
||||
#if address.country_id:
|
||||
# self.fields['country_id']['default']=address.country_id.id
|
||||
#else:
|
||||
# self.fields['country_id']['default']=-1
|
||||
#return {}
|
||||
|
||||
def _get_states(self, cr, uid, context):
|
||||
pool=pooler.get_pool(cr.dbname)
|
||||
|
@ -161,6 +149,14 @@ class wizard_base_setup(wizard.interface):
|
|||
res.sort(lambda x,y: cmp(x[1],y[1]))
|
||||
return res
|
||||
|
||||
def _get_currency(self, cr, uid, context):
|
||||
pool=pooler.get_pool(cr.dbname)
|
||||
currency_obj=pool.get('res.currency')
|
||||
ids=currency_obj.search(cr, uid, [])
|
||||
res=[(currency.id, currency.name) for currency in currency_obj.browse(cr, uid, ids)]
|
||||
res.sort(lambda x,y: cmp(x[1],y[1]))
|
||||
return res
|
||||
|
||||
def _update(self, cr, uid, data, context):
|
||||
pool=pooler.get_pool(cr.dbname)
|
||||
form=data['form']
|
||||
|
@ -168,7 +164,6 @@ class wizard_base_setup(wizard.interface):
|
|||
module_obj=pool.get('ir.module.module')
|
||||
module_obj.state_update(cr, uid, [data['form']['profile']], 'to install', ['uninstalled'], context)
|
||||
|
||||
|
||||
company_obj=pool.get('res.company')
|
||||
partner_obj=pool.get('res.partner')
|
||||
address_obj=pool.get('res.partner.address')
|
||||
|
@ -180,6 +175,7 @@ class wizard_base_setup(wizard.interface):
|
|||
'rml_footer1': form['rml_footer1'],
|
||||
'rml_footer2': form['rml_footer2'],
|
||||
'currency_id': form['currency'],
|
||||
'logo': form['logo'],
|
||||
})
|
||||
partner_obj.write(cr, uid, [company.partner_id.id], {
|
||||
'name': form['name'],
|
||||
|
@ -275,7 +271,7 @@ class wizard_base_setup(wizard.interface):
|
|||
'string':'Profile',
|
||||
'type':'selection',
|
||||
'selection':_get_profiles,
|
||||
'default': -1,
|
||||
# 'default': _get_service_profile,
|
||||
'required': True,
|
||||
},
|
||||
|
||||
|
@ -326,8 +322,8 @@ class wizard_base_setup(wizard.interface):
|
|||
},
|
||||
'currency': {
|
||||
'string': 'Currency',
|
||||
'type': 'many2one',
|
||||
'relation': 'res.currency',
|
||||
'type': 'selection',
|
||||
'selection':_get_currency,
|
||||
'required': True,
|
||||
},
|
||||
'rml_header1':{
|
||||
|
@ -354,6 +350,10 @@ IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701""",
|
|||
'type': 'char',
|
||||
'size': 200,
|
||||
},
|
||||
'logo':{
|
||||
'string': 'Logo',
|
||||
'type': 'binary',
|
||||
},
|
||||
}
|
||||
states={
|
||||
'init':{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="property_account_tax" position="after">
|
||||
<field name="property_account_position" position="after">
|
||||
<field name="vat" nolabel="1" on_change="vat_change(vat)" select="2"/>
|
||||
<group colspan="1" col="2">
|
||||
<label string="VAT :" align="1.0"/>
|
||||
|
|
|
@ -18,6 +18,7 @@ msgstr ""
|
|||
|
||||
#. module: board
|
||||
#: constraint:ir.model:0
|
||||
|
||||
msgid "The Object name must start with x_ and not contain any special character !"
|
||||
msgstr "Le nom de l'objet doit commencer avec x_ et ne pas contenir de charactères spéciaux !"
|
||||
|
||||
|
|
|
@ -53,11 +53,11 @@ between mails and Tiny ERP.""",
|
|||
"init_xml" : ["crm_data.xml"],
|
||||
"demo_xml" : ["crm_demo.xml"],
|
||||
"update_xml" : [
|
||||
"security/crm_security.xml",
|
||||
"security/ir.model.access.csv",
|
||||
"crm_view.xml",
|
||||
"crm_report.xml",
|
||||
"crm_wizard.xml",
|
||||
"security/crm_security.xml",
|
||||
"security/ir.model.access.csv",
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<data noupdate="0">
|
||||
|
||||
<record id="group_crm_manager" model="res.groups">
|
||||
<field name="name">CRM / Manager</field>
|
||||
|
@ -10,5 +10,13 @@
|
|||
<field name="name">CRM / User</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.menu' id='menu_crm'>
|
||||
<field name="groups_id" eval="[(6,0,[ref('group_crm_manager'),ref('group_crm_user')])]"/>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.menu' id='menu_crm_configuration'>
|
||||
<field name="groups_id" eval="[(6,0,[ref('group_crm_manager')])]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_crm_segmentation,crm.segmentation,model_crm_segmentation,crm.group_crm_manager,1,1,1,1
|
||||
access_crm_segmentation_line,crm.segmentation.line,model_crm_segmentation_line,crm.group_crm_manager,1,1,1,1
|
||||
access_crm_case_section,crm.case.section,model_crm_case_section,crm.group_crm_user,1,0,0,0
|
||||
access_crm_case_categ,crm.case.categ,model_crm_case_categ,crm.group_crm_user,1,0,0,0
|
||||
access_crm_case_rule,crm.case.rule,model_crm_case_rule,crm.group_crm_user,1,0,0,0
|
||||
access_crm_case,crm.case,model_crm_case,crm.group_crm_user,1,1,1,1
|
||||
access_crm_case_log,crm.case.log,model_crm_case_log,crm.group_crm_user,1,1,1,1
|
||||
access_crm_case_history,crm.case.history,model_crm_case_history,crm.group_crm_user,1,1,1,1
|
||||
access_crm_case_section_manager,crm.case.section.manager,model_crm_case_section,crm.group_crm_manager,1,1,1,1
|
||||
access_crm_case_categ_manager,crm.case.categ.manager,model_crm_case_categ,crm.group_crm_manager,1,1,1,1
|
||||
access_crm_case_rule_manager,crm.case.rule.manager,model_crm_case_rule,crm.group_crm_manager,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_crm_segmentation","crm.segmentation","model_crm_segmentation","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_segmentation_line","crm.segmentation.line","model_crm_segmentation_line","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_section","crm.case.section","model_crm_case_section","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_categ","crm.case.categ","model_crm_case_categ","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_rule","crm.case.rule","model_crm_case_rule","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_manger","crm.case manager","model_crm_case","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_case","crm.case","model_crm_case","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_log","crm.case.log","model_crm_case_log","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_case_history","crm.case.history","model_crm_case_history","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_case_section_manager","crm.case.section.manager","model_crm_case_section","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_categ_manager","crm.case.categ.manager","model_crm_case_categ","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_rule_manager","crm.case.rule.manager","model_crm_case_rule","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_log_manager","crm.case.log manager","model_crm_case_log","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_history_manager","crm.case.history manager","model_crm_case_history","crm.group_crm_manager",1,1,1,1
|
||||
|
|
|
|
@ -9,7 +9,7 @@
|
|||
people to intelligently and efficiently manage tasks, issues,
|
||||
and requests. It manages key tasks such as communication,
|
||||
identification, prioritization, assignment, resolution and notification.""",
|
||||
"depends" : ["crm","report_crm", "process"],
|
||||
"depends" : ["crm","report_crm", "process", "account"],
|
||||
"init_xml" : [
|
||||
"crm_config_view.xml",
|
||||
"crm_bugs_view.xml",
|
||||
|
@ -39,7 +39,8 @@
|
|||
"crm_jobs_menu.xml", "crm_opportunity_menu.xml",
|
||||
"crm_helpdesk_menu.xml", "crm_lead_menu.xml",
|
||||
"crm_meeting_menu.xml",
|
||||
# "process/crm_configuration_process.xml",
|
||||
"security/ir.model.access.csv",
|
||||
"process/crm_configuration_process.xml",
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
|
|
|
@ -1,144 +1,143 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
# ------------------------------------------------------
|
||||
# Meetings
|
||||
# ------------------------------------------------------
|
||||
<data>
|
||||
# ------------------------------------------------------
|
||||
# Meetings
|
||||
# ------------------------------------------------------
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_form_view_meet">
|
||||
<field name="name">CRM - Meetings Form</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Meetings Form">
|
||||
<notebook>
|
||||
<page string="Meeting">
|
||||
<field name="name" select="1" string="Title"/>
|
||||
<field name="section_id"/>
|
||||
<newline/>
|
||||
<field name="date" string="Next Meeting"/>
|
||||
<field name="duration" colspan="1" string="Meeting Duration"/>
|
||||
<newline/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" />
|
||||
<field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>
|
||||
<newline/>
|
||||
<field name="user_id" select="2" string="Responsible"/>
|
||||
<field name="email_from"/>
|
||||
<newline/>
|
||||
<field name="categ_id" select="2" on_change="onchange_categ_id(categ_id)"/>
|
||||
<field name="priority" select="2"/>
|
||||
<newline/>
|
||||
<field name="stage_id" select="1"/>
|
||||
<field name="category2_id" select="1" string="Location"/>
|
||||
<newline/>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="note" nolabel="1" colspan="4" />
|
||||
|
||||
<separator colspan="4"/>
|
||||
<group col="8" colspan="4">
|
||||
<field name="state" select="2"/>
|
||||
<button name="case_close" string="Done" states="open,draft,pending" type="object"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object"/>
|
||||
<button name="case_cancel" string="Cancel Meeting" states="draft,open,pending" type="object"/>
|
||||
<button name="case_pending" string="Pending" states="draft,open" type="object"/>
|
||||
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object"/>
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Extra Info">
|
||||
<group colspan="4">
|
||||
<field name="id"/>
|
||||
<field name="active" select="2"/>
|
||||
<newline/>
|
||||
<field name="email_cc" colspan="1"/>
|
||||
<field name="date_deadline" select="2" string="Deadlines"/>
|
||||
<newline/>
|
||||
<separator colspan="4" string="Dates"/>
|
||||
<field name="create_date"/>
|
||||
<field name="date_closed"/>
|
||||
<field name="date_action_last"/>
|
||||
<field name="date_action_next"/>
|
||||
</group>
|
||||
<separator colspan="4"/>
|
||||
<field name="history_line" colspan="2" nolabel="1" mode="tree,form">
|
||||
<form string="Communication history">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email"/>
|
||||
<field name="canal_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group col="2" colspan="2" expand="1">
|
||||
<field name="canal_id"/>
|
||||
<field name="som"/>
|
||||
<button name="add_reply" string="Add Last Mail for Replying"
|
||||
states="open" type="object" colspan="2"/>
|
||||
<field name="description" colspan="2" nolabel="1"/>
|
||||
<button name="case_log_reply"
|
||||
string="Send Partner & Historize" states="open"
|
||||
type="object"/>
|
||||
<button name="case_log" string="Historize" states="open"
|
||||
type="object"/>
|
||||
</group>
|
||||
|
||||
<separator colspan="4" string="References"/>
|
||||
<field name="ref" colspan="4"/>
|
||||
<field name="ref2" colspan="4"/>
|
||||
</page>
|
||||
<page string="History">
|
||||
<field name="log_ids" nolabel="1" colspan="4">
|
||||
<form string="Actions">
|
||||
<separator string="Action Information" colspan="4"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
<field name="som"/>
|
||||
<field name="canal_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="crm_case_tree_view_meet">
|
||||
<field name="name">CRM - Meetings Tree</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Meetings Tree" colors="red:state=='open'">
|
||||
<field name="id"/>
|
||||
<field name="name" string="Title"/>
|
||||
<field name="date" string="Next Meeting"/>
|
||||
<field name="section_id"/>
|
||||
<field name="priority"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="category2_id" string="Type"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="crm_case_calendar_view_meet">
|
||||
<field name="name">CRM - Meetings Calendar</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="type">calendar</field>
|
||||
<field name="priority" eval="2"/>
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Meetings" date_start="date" color="user_id" date_delay="duration">
|
||||
<field name="name"/>
|
||||
<field name="section_id"/>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
<record model="ir.ui.view" id="crm_case_form_view_meet">
|
||||
<field name="name">CRM - Meetings Form</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Meetings Form">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1" string="Title"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" />
|
||||
<field name="section_id"/>
|
||||
<newline/>
|
||||
<field name="date" string="Next Meeting"/>
|
||||
<field name="duration" colspan="1" string="Meeting Duration"/>
|
||||
<field name="categ_id" select="2" on_change="onchange_categ_id(categ_id)"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Meeting">
|
||||
<field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>
|
||||
<field name="priority" select="2"/>
|
||||
<newline/>
|
||||
<field name="user_id" select="2" string="Responsible"/>
|
||||
<field name="email_from"/>
|
||||
<newline/>
|
||||
<field name="stage_id" select="1"/>
|
||||
<field name="category2_id" select="1" string="Location"/>
|
||||
<newline/>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="note" nolabel="1" colspan="4" />
|
||||
<separator colspan="4"/>
|
||||
<group col="8" colspan="4">
|
||||
<field name="state" select="2"/>
|
||||
<button name="case_close" string="Done" states="open,draft,pending" type="object"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object"/>
|
||||
<button name="case_cancel" string="Cancel Meeting" states="draft,open,pending" type="object"/>
|
||||
<button name="case_pending" string="Pending" states="draft,open" type="object"/>
|
||||
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object"/>
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Extra Info">
|
||||
<group colspan="4">
|
||||
<field name="id"/>
|
||||
<field name="active" select="2"/>
|
||||
<newline/>
|
||||
<field name="email_cc" colspan="1"/>
|
||||
<field name="date_deadline" select="2" string="Deadlines"/>
|
||||
<newline/>
|
||||
<separator colspan="4" string="Dates"/>
|
||||
<field name="create_date"/>
|
||||
<field name="date_closed"/>
|
||||
<field name="date_action_last"/>
|
||||
<field name="date_action_next"/>
|
||||
</group>
|
||||
<separator colspan="4"/>
|
||||
<field name="history_line" colspan="2" nolabel="1" mode="tree,form">
|
||||
<form string="Communication history">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email"/>
|
||||
<field name="canal_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group col="2" colspan="2" expand="1">
|
||||
<field name="canal_id"/>
|
||||
<field name="som"/>
|
||||
<button name="add_reply" string="Add Last Mail for Replying"
|
||||
states="open" type="object" colspan="2"/>
|
||||
<field name="description" colspan="2" nolabel="1"/>
|
||||
<button name="case_log_reply"
|
||||
string="Send Partner & Historize" states="open"
|
||||
type="object"/>
|
||||
<button name="case_log" string="Historize" states="open"
|
||||
type="object"/>
|
||||
</group>
|
||||
|
||||
<separator colspan="4" string="References"/>
|
||||
<field name="ref" colspan="4"/>
|
||||
<field name="ref2" colspan="4"/>
|
||||
</page>
|
||||
<page string="History">
|
||||
<field name="log_ids" nolabel="1" colspan="4">
|
||||
<form string="Actions">
|
||||
<separator string="Action Information" colspan="4"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
<field name="som"/>
|
||||
<field name="canal_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="crm_case_tree_view_meet">
|
||||
<field name="name">CRM - Meetings Tree</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Meetings Tree" colors="red:state=='open'">
|
||||
<field name="id"/>
|
||||
<field name="name" string="Title"/>
|
||||
<field name="date" string="Next Meeting"/>
|
||||
<field name="section_id"/>
|
||||
<field name="priority"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="category2_id" string="Type"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="crm_case_calendar_view_meet">
|
||||
<field name="name">CRM - Meetings Calendar</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="type">calendar</field>
|
||||
<field name="priority" eval="2"/>
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Meetings" date_start="date" color="user_id" date_delay="duration">
|
||||
<field name="name"/>
|
||||
<field name="section_id"/>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!--
|
||||
Process
|
||||
-->
|
||||
|
||||
<record id="process_process_contractworkflow0" model="process.process">
|
||||
<field eval=""""Contracts flow for services companies."""" name="note"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field eval=""""Contract Workflow"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Node
|
||||
-->
|
||||
|
||||
<record id="process_node_leads0" model="process.node">
|
||||
<field name="menu_id" ref="crm_configuration.menu_crm_case_categ0_act_leads_all"/>
|
||||
<field name="model_id" ref="crm.model_crm_case"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Leads"""" name="name"/>
|
||||
<field eval=""""Premier Contact Leads"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_contractworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'open', 'pending', 'done', 'cancel')"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_opportunities0" model="process.node">
|
||||
<field name="menu_id" ref="crm_configuration.menu_crm_case_categ0_act_oppor11"/>
|
||||
<field name="model_id" ref="crm.model_crm_case"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Opportunities"""" name="name"/>
|
||||
<field eval=""""Business Opportunities"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_contractworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'open', 'pending', 'done', 'cancel')"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_accord0" model="process.node">
|
||||
<field name="menu_id" ref="crm_configuration.menu_crm_case_categ0_act_leads_all"/>
|
||||
<field name="model_id" ref="crm.model_crm_case"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Accord"""" name="name"/>
|
||||
<field eval=""""Accord Client Contract"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_contractworkflow0"/>
|
||||
<field eval=""""object.state=='done'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_contractanalytic0" model="process.node">
|
||||
<field name="menu_id" ref="account.account_analytic_def_account"/>
|
||||
<field name="model_id" ref="account.model_account_analytic_account"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Contract Analytic"""" name="name"/>
|
||||
<field eval=""""Analytic accounts"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_contractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_contractpricelist0" model="process.node">
|
||||
<field name="menu_id" ref="product.menu_product_pricelist_action2"/>
|
||||
<field name="model_id" ref="product.model_product_pricelist"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Contract Pricelist"""" name="name"/>
|
||||
<field eval=""""Contract Volume (pricelist)"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_contractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="process_transition_leadopportunity0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Lead Opportunity"""" name="name"/>
|
||||
<field eval=""""Creating business opportunities from leads"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_opportunities0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_leads0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_opportunitiesaccord0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Opportunities Accord"""" name="name"/>
|
||||
<field eval=""""When leads are confirmed"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_accord0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_opportunities0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_accordanalytic0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Accord Analytic"""" name="name"/>
|
||||
<field eval=""""Goes into the Analytic"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_contractanalytic0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_accord0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_accordpricelist0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Accord Pricelist"""" name="name"/>
|
||||
<field eval=""""Goes into the Pricelist"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_contractpricelist0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_accord0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,5 +1,11 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_crm_case_stage,crm.case.stage,model_crm_case_stage,crm.group_crm_user,1,0,0,0
|
||||
access_report_crm_case_section_stage,report.crm.case.section.stage,model_report_crm_case_section_stage,crm.group_crm_manager,1,0,0,0
|
||||
access_report_crm_case_section_categ_stage,report.crm.case.section.categ.stage,model_report_crm_case_section_categ_stage,crm.group_crm_manager,1,0,0,0
|
||||
access_crm_case_stage_manager,crm.case.stage,model_crm_case_stage,crm.group_crm_manager,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_crm_case_stage","crm.case.stage","model_crm_case_stage","crm.group_crm_user",1,0,0,0
|
||||
"access_report_crm_case_section_stage","report.crm.case.section.stage","model_report_crm_case_section_stage","crm.group_crm_manager",1,0,0,0
|
||||
"access_report_crm_case_section_categ_stage","report.crm.case.section.categ.stage","model_report_crm_case_section_categ_stage","crm.group_crm_manager",1,0,0,0
|
||||
"access_report_crm_case_section_categ_categ2","report.crm.case.section.categ.categ2","model_report_crm_case_section_categ_categ2","crm.group_crm_manager",1,0,0,
|
||||
"access_report_crm_case_section_categ2","report.crm.case.section.categ2","model_report_crm_case_section_categ2","crm.group_crm_manager",1,0,0,
|
||||
"access_crm_case_stage_manager","crm.case.stage","model_crm_case_stage","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_menu_config_wizard","crm config wizard manager","model_crm_menu_config_wizard","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_menu_config_wizard system","crm config wizard manager system","model_crm_menu_config_wizard","base.group_system",1,1,1,1
|
||||
"access_crm_case_category2_user","crm_case_category2 user","model_crm_case_category2","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_category2_manager","crm_case_category2 manager","model_crm_case_category2","crm.group_crm_manager",1,1,1,1
|
||||
|
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue