@@ -157,8 +157,6 @@ class account_account_type(osv.osv):
|
||||
('asset','Balance Sheet (Assets Accounts)'),
|
||||
('liability','Balance Sheet (Liability Accounts)')
|
||||
],'Type Heads', select=True, readonly=False, help="According value related accounts will be display on respective reports (Balance Sheet Profit & Loss Account)"),
|
||||
'parent_id':fields.many2one('account.account.type', 'Parent Type', required=False),
|
||||
'child_ids':fields.one2many('account.account.type', 'parent_id', 'Child Types', required=False),
|
||||
'note': fields.text('Description'),
|
||||
}
|
||||
_defaults = {
|
||||
@@ -167,14 +165,6 @@ class account_account_type(osv.osv):
|
||||
}
|
||||
_order = "code"
|
||||
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
#TODO: Need to check for recusrion
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_recursion, 'Error ! You can not create recursive types.', ['parent_id'])
|
||||
]
|
||||
|
||||
account_account_type()
|
||||
|
||||
def _code_get(self, cr, uid, context={}):
|
||||
@@ -690,23 +680,23 @@ class account_journal(osv.osv):
|
||||
"""
|
||||
Returns a list of tupples containing id, name.
|
||||
result format : {[(id, name), (id, name), ...]}
|
||||
|
||||
|
||||
@param cr: A database cursor
|
||||
@param user: ID of the user currently logged in
|
||||
@param ids: list of ids for which name should be read
|
||||
@param context: context arguments, like lang, time zone
|
||||
|
||||
|
||||
@return: Returns a list of tupples containing id, name
|
||||
"""
|
||||
result = self.browse(cr, user, ids, context)
|
||||
res = []
|
||||
for rs in result:
|
||||
name = rs.name
|
||||
name = rs.name
|
||||
if rs.currency:
|
||||
name = "%s (%s)" % (rs.name, rs.currency.name)
|
||||
res += [(rs.id, name)]
|
||||
return res
|
||||
|
||||
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
|
||||
if not args:
|
||||
args = []
|
||||
@@ -2747,7 +2737,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
vals_journal['sequence_id'] = seq_id
|
||||
vals_journal['type'] = 'cash'
|
||||
vals_journal['company_id'] = company_id
|
||||
|
||||
|
||||
if line.currency_id:
|
||||
vals_journal['view_id'] = view_id_cur
|
||||
vals_journal['currency'] = line.currency_id.id
|
||||
|
||||
@@ -215,14 +215,15 @@ class account_bank_statement(osv.osv):
|
||||
return True
|
||||
|
||||
|
||||
def create_move_from_st_line(self, cr, uid, st_line, company_currency_id, next_number, context=None):
|
||||
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None):
|
||||
res_currency_obj = self.pool.get('res.currency')
|
||||
res_users_obj = self.pool.get('res.users')
|
||||
account_move_obj = self.pool.get('account.move')
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
account_analytic_line_obj = self.pool.get('account.analytic.line')
|
||||
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
|
||||
|
||||
|
||||
st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context)
|
||||
st = st_line.statement_id
|
||||
|
||||
context.update({'date': st_line.date})
|
||||
@@ -230,6 +231,7 @@ class account_bank_statement(osv.osv):
|
||||
'journal_id': st.journal_id.id,
|
||||
'period_id': st.period_id.id,
|
||||
'date': st_line.date,
|
||||
'name': st_line_number,
|
||||
}, context=context)
|
||||
account_bank_statement_line_obj.write(cr, uid, [st_line.id], {
|
||||
'move_ids': [(4, move_id, False)]
|
||||
@@ -314,12 +316,13 @@ class account_bank_statement(osv.osv):
|
||||
raise osv.except_osv(_('Error !'),
|
||||
_('Journal Item "%s" is not valid') % line.name)
|
||||
|
||||
move_name = next_number + ' - ' + str(st_line.sequence)
|
||||
account_move_obj.write(cr, uid, [move_id], {'name': move_name})
|
||||
# Bank statements will not consider boolean on journal entry_posted
|
||||
account_move_obj.post(cr, uid, [move_id], context=context)
|
||||
return move_id
|
||||
|
||||
def get_next_st_line_number(self, cr, uid, st_number, st_line, context=None):
|
||||
return st_number + ' - ' + str(st_line.sequence)
|
||||
|
||||
def button_confirm_bank(self, cr, uid, ids, context=None):
|
||||
done = []
|
||||
obj_seq = self.pool.get('ir.sequence')
|
||||
@@ -342,13 +345,13 @@ class account_bank_statement(osv.osv):
|
||||
_('Please verify that an account is defined in the journal.'))
|
||||
|
||||
if not st.name == '/':
|
||||
next_number = st.name
|
||||
st_number = st.name
|
||||
else:
|
||||
if st.journal_id.sequence_id:
|
||||
c = {'fiscalyear_id': st.period_id.fiscalyear_id.id}
|
||||
next_number = obj_seq.get_id(cr, uid, st.journal_id.sequence_id.id, context=c)
|
||||
st_number = obj_seq.get_id(cr, uid, st.journal_id.sequence_id.id, context=c)
|
||||
else:
|
||||
next_number = obj_seq.get(cr, uid, 'account.bank.statement')
|
||||
st_number = obj_seq.get(cr, uid, 'account.bank.statement')
|
||||
|
||||
for line in st.move_line_ids:
|
||||
if line.state <> 'valid':
|
||||
@@ -360,12 +363,12 @@ class account_bank_statement(osv.osv):
|
||||
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (st.journal_id.name,))
|
||||
if not st_line.amount:
|
||||
continue
|
||||
st_line_number = self.get_next_st_line_number(cr, uid, st_number, st_line, context)
|
||||
self.create_move_from_st_line(cr, uid, st_line.id, company_currency_id, st_line_number, context)
|
||||
|
||||
self.create_move_from_st_line(cr, uid, st_line, company_currency_id, next_number, context)
|
||||
|
||||
self.log(cr, uid, st.id, 'Statement %s is confirmed and entries are created.' % st.name)
|
||||
self.write(cr, uid, [st.id], {'name': st_number}, context=context)
|
||||
self.log(cr, uid, st.id, 'Statement %s is confirmed and entries are created.' % st_number)
|
||||
done.append(st.id)
|
||||
self.write(cr, uid, [st.id], {'name': next_number}, context=context)
|
||||
|
||||
self.write(cr, uid, done, {'state':'confirm'}, context=context)
|
||||
return True
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Supplier invoice">
|
||||
<group col="8" colspan="4">
|
||||
<field domain="[('type', '=', 'purchase')]" name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection"/>
|
||||
<field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection"/>
|
||||
<field name="number" readonly="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="currency_id" on_change="onchange_currency_id(currency_id, company_id)" width="50"/>
|
||||
@@ -212,7 +212,7 @@
|
||||
<field name="residual"/>
|
||||
<group col="6" colspan="4">
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
|
||||
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="invoice_open" states="draft,proforma2" string="Approve" icon="terp-camera_test"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
|
||||
<button name="%(action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
|
||||
@@ -431,7 +431,7 @@
|
||||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field eval="False" name="view_id"/>
|
||||
<field name="domain">[('type','=','out_invoice')]</field>
|
||||
<field name="context">{'type':'out_invoice'}</field>
|
||||
<field name="context">{'type':'out_invoice', 'journal_type': 'sale'}</field>
|
||||
<field name="search_view_id" ref="view_account_invoice_filter"/>
|
||||
<field name="help">Most of customer invoices are automatically generated in draft mode by OpenERP flows, following a purchase order for instance. Review, confirm or cancel, pay or refund your customers' invoices here. A manual invoice can be created here.</field>
|
||||
</record>
|
||||
@@ -457,7 +457,7 @@
|
||||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field eval="False" name="view_id"/>
|
||||
<field name="domain">[('type','=','in_invoice')]</field>
|
||||
<field name="context">{'type':'in_invoice'}</field>
|
||||
<field name="context">{'type':'in_invoice', 'journal_type': 'purchase'}</field>
|
||||
<field name="search_view_id" ref="view_account_invoice_filter"/>
|
||||
<field name="help">Proposal for vendor invoices are usually automatically generate by OpenERP, following a procurement order or a production order for instance. To consult and to check for, or to manually create a customer invoice, use this menu. You can review, confirm or cancel, pay or refund an invoice from the view from of the invoices.</field>
|
||||
</record>
|
||||
@@ -470,7 +470,7 @@
|
||||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field eval="False" name="view_id"/>
|
||||
<field name="domain">[('type','=','out_refund')]</field>
|
||||
<field name="context">{'type':'out_refund'}</field>
|
||||
<field name="context">{'type':'out_refund', 'journal_type': 'sale_refund'}</field>
|
||||
<field name="search_view_id" ref="view_account_invoice_filter"/>
|
||||
<field name="help">A customer refund is a credit note to your customer that cancel invoice or a part of it.</field>
|
||||
</record>
|
||||
@@ -496,7 +496,7 @@
|
||||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field eval="False" name="view_id"/>
|
||||
<field name="domain">[('type','=','in_refund')]</field>
|
||||
<field name="context">{'type':'in_refund'}</field>
|
||||
<field name="context">{'type':'in_refund', 'journal_type': 'purchase_refund'}</field>
|
||||
<field name="search_view_id" ref="view_account_invoice_filter"/>
|
||||
<field name="help">A vendor refund is a credit note from your supplier indicating that he refunds part or totality of the invoice sent to you.</field>
|
||||
</record>
|
||||
@@ -504,11 +504,11 @@
|
||||
|
||||
<act_window context="{'search_default_partner_id':[active_id]}" id="act_res_partner_2_account_invoice_opened" name="Invoices" res_model="account.invoice" src_model="res.partner"/>
|
||||
|
||||
<act_window
|
||||
id="act_account_journal_2_account_invoice_opened"
|
||||
<act_window
|
||||
id="act_account_journal_2_account_invoice_opened"
|
||||
name="Unpaid Invoices"
|
||||
context="{'search_default_journal_id':active_id, 'search_default_unpaid':1,}"
|
||||
res_model="account.invoice"
|
||||
res_model="account.invoice"
|
||||
src_model="account.journal"/>
|
||||
|
||||
<act_window
|
||||
|
||||
@@ -160,10 +160,10 @@ class account_move_line(osv.osv):
|
||||
return context
|
||||
|
||||
def _default_get(self, cr, uid, fields, context={}):
|
||||
|
||||
|
||||
if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
|
||||
context['journal_id'] = context.get('search_default_journal_id')
|
||||
|
||||
|
||||
period_obj = self.pool.get('account.period')
|
||||
|
||||
context = self.convert_to_period(cr, uid, context)
|
||||
@@ -946,6 +946,7 @@ class account_move_line(osv.osv):
|
||||
|
||||
if field in ('amount_currency', 'currency_id'):
|
||||
attrs.append('on_change="onchange_currency(account_id, amount_currency,currency_id, date, journal_id)"')
|
||||
attrs.append("attrs='{'readonly':[('state','=','valid')]}'")
|
||||
|
||||
if field in widths:
|
||||
attrs.append('width="'+str(widths[field])+'"')
|
||||
|
||||
@@ -668,6 +668,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_type_form" model="ir.ui.view">
|
||||
<field name="name">account.account.type.form</field>
|
||||
<field name="model">account.account.type</field>
|
||||
@@ -677,7 +678,6 @@
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="parent_id"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Reporting Configuration" colspan="4"/>
|
||||
@@ -942,8 +942,8 @@
|
||||
<field name="credit" sum="Total credit"/>
|
||||
<field name="account_tax_id" groups="base.group_extended"/>
|
||||
<field name="analytic_account_id" groups="base.group_extended" domain="[('parent_id','!=',False)]"/>
|
||||
<field name="amount_currency" groups="base.group_extended"/>
|
||||
<field name="currency_id" groups="base.group_extended"/>
|
||||
<field name="amount_currency" groups="base.group_extended" attrs="{'readonly':[('state','=','valid')]}"/>
|
||||
<field name="currency_id" groups="base.group_extended" attrs="{'readonly':[('state','=','valid')]}"/>
|
||||
<field name="reconcile_partial_id" groups="base.group_extended"/>
|
||||
<field name="reconcile_id"/>
|
||||
<field name="state"/>
|
||||
@@ -998,7 +998,7 @@
|
||||
<field name="account_tax_id" domain="[('parent_id','=',False)]"/>
|
||||
</group>
|
||||
|
||||
<group col="2" colspan="2">
|
||||
<group col="2" colspan="2" attrs="{'readonly':[('state','=','valid')]}" >
|
||||
<separator colspan="2" string="Currency"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="amount_currency"/>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
import time
|
||||
from operator import itemgetter
|
||||
import decimal_precision as dp
|
||||
from lxml import etree
|
||||
|
||||
import netsvc
|
||||
from osv import fields, osv, orm
|
||||
@@ -341,7 +342,13 @@ class account_invoice(osv.osv):
|
||||
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.supplier.form')])[0]
|
||||
else:
|
||||
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.form')])[0]
|
||||
return super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
res = super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
for field in res['fields']:
|
||||
type = context.get('journal_type', 'sale')
|
||||
if field == 'journal_id':
|
||||
journal_select = self.pool.get('account.journal')._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
|
||||
res['fields'][field]['selection'] = journal_select
|
||||
return res
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
try:
|
||||
|
||||
@@ -81,7 +81,6 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
|
||||
result_pl = self.obj_pl.get_data(data)
|
||||
self.res_bl = self.obj_pl.final_result()
|
||||
|
||||
type_pool = db_pool.get('account.account.type')
|
||||
account_pool = db_pool.get('account.account')
|
||||
year_pool = db_pool.get('account.fiscalyear')
|
||||
|
||||
|
||||
@@ -55,13 +55,13 @@
|
||||
<search string="Entries Analysis">
|
||||
<group colspan="10" col="12">
|
||||
<filter icon="terp-go-year" string="This F.Year"
|
||||
name="year"
|
||||
name="thisyear"
|
||||
domain="[('period_id','in','current_year')]"
|
||||
help="Entries with period in current year"/>
|
||||
help="Journal Entries with period in current year"/>
|
||||
<filter icon="terp-go-month" string="This Period"
|
||||
name="period"
|
||||
domain="[('period_id','in','current_period')]"
|
||||
help="Entries with period in current period"/>
|
||||
help="Journal Entries with period in current period"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Unposted" icon="terp-document-new" domain="[('move_state','=','draft')]" help = "entries"/>
|
||||
<filter string="Posted" icon="terp-camera_test" domain="[('move_state','=','posted')]" help = "Posted entries"/>
|
||||
@@ -70,7 +70,7 @@
|
||||
<filter string="Reconciled" icon="terp-dolar" domain="[('reconcile_id','!=',False)]" help = "Reconciled entries"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="account_id"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="period_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
@@ -83,7 +83,7 @@
|
||||
<filter string="Journal" name="group_journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Account" name="group_account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Acc.Type" icon="terp-folder-blue" context="{'group_by':'user_type'}"/>
|
||||
<filter string="Acc.Type" icon="terp-folder-blue" context="{'group_by':'user_type'}" name="usertype"/>
|
||||
<filter string="Int.Type" icon="terp-folder-yellow" context="{'group_by':'type'}"/>
|
||||
<separator orientation="vertical" groups="base.group_multi_company"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
@@ -94,13 +94,11 @@
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended Filters..." groups="base.group_extended">
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="period_id"/>
|
||||
<field name="fiscalyear_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="product_id"/>
|
||||
<field name="partner_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<separator orientation="vertical" groups="base.group_multi_company"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<newline/>
|
||||
<field name="date_created"/>
|
||||
@@ -115,7 +113,7 @@
|
||||
<field name="res_model">account.entries.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_profit': 1,'search_default_group_account':1,'search_default_group_journal':1,'search_default_group_month': 1, 'group_by_no_leaf':1,'group_by':[], 'search_default_year':1, 'search_default_period':1}</field>
|
||||
<field name="context">{'group_by':[],'search_default_usertype':1, 'search_default_thisyear':1, 'group_by_no_leaf':1,}</field>
|
||||
<field name="help">A tool search lets you know statistics on your different financial accounts that match your needs.</field>
|
||||
</record>
|
||||
<menuitem action="action_account_entries_report_all" id="menu_action_account_entries_report_all" parent="account.menu_finance_statistic_report_statement" sequence="2"/>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<field name="address_contact_id" invisible="1"/>
|
||||
<field name="address_invoice_id" invisible="1"/>
|
||||
<field name="partner_bank_id" invisible="1"/>
|
||||
<field name="date_due" invisible="1"/>
|
||||
<field name="account_id" invisible="1"/>
|
||||
<field name="nbr" sum="# of Lines"/>
|
||||
<field name="product_qty" sum="Qty"/>
|
||||
@@ -57,19 +58,6 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Invoices Analysis">
|
||||
<group col="10" colspan="12">
|
||||
<filter icon="terp-go-year" string=" 365 Days "
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Validated invoices of last 365 days"/>
|
||||
<filter icon="terp-go-month" string=" 30 Days "
|
||||
name="month"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Validated invoices of last 30 days"/>
|
||||
<filter icon="terp-go-week"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Validated invoices during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Draft"
|
||||
icon="terp-document-new"
|
||||
domain="[('state','=','draft')]"
|
||||
@@ -78,19 +66,25 @@
|
||||
icon="terp-gtk-media-pause"
|
||||
domain="['|', ('state','=','proforma'),('state','=','proforma2')]"
|
||||
help = "Pro-forma Invoices"/>
|
||||
<filter string="Invoiced"
|
||||
name="current"
|
||||
icon="terp-check"
|
||||
domain="[('state','not in', ('draft','cancel'))]"
|
||||
help = "Open and Paid Invoices"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-sale" string="Customer"
|
||||
name="customer"
|
||||
domain="['|', ('type','=','out_invoice'),('type','=','out_refund')]"
|
||||
help="Customer Invoices And Refunds"/>
|
||||
<filter icon="terp-purchase"
|
||||
string="Supplier"
|
||||
string="Vendor"
|
||||
separator="1"
|
||||
domain="['|', ('type','=','in_invoice'),('type','=','in_refund')]"
|
||||
help="Supplier Invoices And Refunds"/>
|
||||
help="Vendor Invoices And Refunds"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-dolar" string="Invoice"
|
||||
domain="['|', ('type','=','out_invoice'),('type','=','in_invoice')]"
|
||||
help="Customer And Supplier Invoices"/>
|
||||
help="Customer And Vendor Invoices"/>
|
||||
<filter icon="terp-dolar_ok!"
|
||||
string="Refund"
|
||||
separator="1"
|
||||
@@ -99,6 +93,7 @@
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id" />
|
||||
<field name="date" string="Date Invoiced"/>
|
||||
<field name="categ_id" />
|
||||
</group>
|
||||
<newline/>
|
||||
@@ -113,30 +108,26 @@
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'type'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Due Date" icon="terp-go-today" context="{'group_by':'date_due'}"/>
|
||||
<filter string="Period" icon="terp-go-month" context="{'group_by':'period_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<separator orientation="vertical" groups="base.group_multi_company"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" name="day" icon="terp-go-today" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year'}"/>
|
||||
<filter string="Day" name="day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by Invoice Date"/>
|
||||
<filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of Invoice Date"/>
|
||||
<filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of Invoice Date"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended Filters..." groups="base.group_extended">
|
||||
<field name="product_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="account_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="type"/>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="state"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<newline/>
|
||||
<field name="date" string="Date Invoiced"/>
|
||||
<field name="date_due"/>
|
||||
<separator orientation="vertical" groups="base.group_multi_company"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -147,7 +138,7 @@
|
||||
<field name="res_model">account.invoice.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_month':1,'search_default_partner':1,'group_by_no_leaf':1,'group_by':[],'search_default_user_id':1}</field>
|
||||
<field name="context">{'search_default_current':1,'search_default_customer':1, 'search_default_date': time.strftime('%Y-01-01'), 'group_by':[], 'group_by_no_leaf':1,}</field>
|
||||
<field name="search_view_id" ref="view_account_invoice_report_search"/>
|
||||
<field name="help">A tool search lets you know statistics on invoices that match your needs.</field>
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
|
||||
cr, uid = self.cr, self.uid
|
||||
db_pool = pooler.get_pool(self.cr.dbname)
|
||||
|
||||
type_pool = db_pool.get('account.account.type')
|
||||
account_pool = db_pool.get('account.account')
|
||||
year_pool = db_pool.get('account.fiscalyear')
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class report_voucher_move(report_sxw.rml_parse):
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'convert':self.convert,
|
||||
'get_title': self.get_title,
|
||||
'debit':self.debit,
|
||||
'credit':self.credit,
|
||||
#'get_ref' : self._get_ref
|
||||
@@ -41,6 +42,13 @@ class report_voucher_move(report_sxw.rml_parse):
|
||||
cur = user_id.company_id.currency_id.name
|
||||
amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur);
|
||||
return amt_en
|
||||
|
||||
def get_title(self, voucher):
|
||||
title = ''
|
||||
if voucher.journal_id:
|
||||
type = voucher.journal_id.type
|
||||
title = type[0].swapcase() + type[1:] + " Voucher"
|
||||
return title
|
||||
|
||||
def debit(self, move_ids):
|
||||
debit = 0.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Voucher" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="42.0" width="525" height="772"/>
|
||||
</pageTemplate>
|
||||
@@ -10,6 +10,10 @@
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
@@ -94,15 +98,12 @@
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica-Bold" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="10.0" leading="13" 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" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica-Bold" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P7" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
@@ -116,19 +117,19 @@
|
||||
<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_tblheader_General" 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="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_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Footer" fontName="Helvetica"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Helvetica" 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_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.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_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.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"/>
|
||||
@@ -161,45 +162,55 @@
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P11">[[ repeatIn(objects,'voucher') ]]</para>
|
||||
<para style="P8">[[ repeatIn(objects,'voucher') ]]</para>
|
||||
<blockTable colWidths="524.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">[[ get_title(voucher) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="63.0,200.0,52.0,210.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Journal:</para>
|
||||
<para style="terp_tblheader_General">Journal:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ voucher.journal_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Number:</para>
|
||||
<para style="terp_tblheader_General">Number:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ voucher.name ]]</para>
|
||||
<para style="terp_default_9">[[ voucher.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="63.0,72.0,44.0,84.0,52.0,210.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">State:</para>
|
||||
<para style="terp_tblheader_General">State:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P7">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P7">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P7">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="terp_default_9">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="terp_default_9">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="terp_default_9">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="terp_default_9">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Ref. :</para>
|
||||
<para style="terp_tblheader_General">Ref. :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">[[ voucher.ref]]</para>
|
||||
<para style="terp_default_9">[[ voucher.ref]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Date:</para>
|
||||
<para style="terp_tblheader_General">Date:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ formatLang(voucher.date , date=True) or '' ]]</para>
|
||||
<para style="terp_default_9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -280,7 +291,7 @@
|
||||
<blockTable colWidths="313.0,106.0,105.0" style="last_info">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P5">Through : </para>
|
||||
<para style="P4">Through : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">
|
||||
@@ -310,7 +321,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P5">On Account of : </para>
|
||||
<para style="P4">On Account of : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">
|
||||
@@ -325,7 +336,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9">[[ voucher.line_id and voucher.line_id[0].name or removeParentNode('para') ]]</para>
|
||||
<para style="P7">[[ voucher.line_id and voucher.line_id[0].name or removeParentNode('para') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">
|
||||
@@ -340,22 +351,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P5">Amount (in words) : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9">[[ convert(voucher.amount) ]]</para>
|
||||
<para style="P4">Amount (in words) : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">
|
||||
@@ -368,6 +364,21 @@
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P7">[[ convert(voucher.amount) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_1">
|
||||
<font color="white"> </font>
|
||||
@@ -375,7 +386,7 @@
|
||||
<blockTable colWidths="313.0,106.0,105.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P6">
|
||||
<para style="P5">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
@@ -399,12 +410,6 @@
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -424,15 +429,15 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P8">Receiver's Signature</para>
|
||||
<para style="P6">Receiver's Signature</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">
|
||||
<para style="P6">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">
|
||||
<para style="P6">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
|
||||
@@ -67,8 +67,9 @@ class account_partner_reconcile_process(osv.osv_memory):
|
||||
return res
|
||||
|
||||
def next_partner(self, cr, uid, ids, context=None):
|
||||
partner_id = self.pool.get('account.move.line').read(cr, uid, context['active_id'], ['partner_id'])['partner_id'][0]
|
||||
self.pool.get('res.partner').write(cr, uid, partner_id, {'last_reconciliation_date': time.strftime('%Y-%m-%d')}, context)
|
||||
partner_id = self.pool.get('account.move.line').read(cr, uid, context['active_id'], ['partner_id'])['partner_id']
|
||||
if partner_id:
|
||||
self.pool.get('res.partner').write(cr, uid, partner_id[0], {'last_reconciliation_date': time.strftime('%Y-%m-%d')}, context)
|
||||
#TODO: we have to find a way to update the context of the current tab (we could open a new tab with the context but it's not really handy)
|
||||
#TODO: remove that comments when the client side dev is done
|
||||
return {}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<field name="display_account"/>
|
||||
<field name="target_move"/>
|
||||
<field name="display_type"/>
|
||||
<field name="reserve_account_id"/>
|
||||
<field name="reserve_account_id" required="0" invisible="1"/>
|
||||
<newline/>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
##############################################################################
|
||||
|
||||
import report_voucher
|
||||
import report_voucher_amount
|
||||
import report_voucher_print
|
||||
|
||||
@@ -29,6 +29,7 @@ class report_voucher(report_sxw.rml_parse):
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'convert':self.convert,
|
||||
'get_title': self.get_title,
|
||||
'debit':self.debit,
|
||||
'credit':self.credit,
|
||||
'get_ref' : self._get_ref
|
||||
@@ -38,6 +39,12 @@ class report_voucher(report_sxw.rml_parse):
|
||||
amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur);
|
||||
return amt_en
|
||||
|
||||
def get_title(self, type):
|
||||
title = ''
|
||||
if type:
|
||||
title = type[0].swapcase() + type[1:] + " Voucher"
|
||||
return title
|
||||
|
||||
def debit(self, move_ids):
|
||||
debit = 0.0
|
||||
for move in move_ids:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Voucher" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="42.0" width="525" height="772"/>
|
||||
</pageTemplate>
|
||||
@@ -10,6 +10,10 @@
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
@@ -89,14 +93,11 @@
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P1" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica" 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="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
@@ -110,14 +111,14 @@
|
||||
<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_tblheader_General" 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="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_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Footer" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" 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_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
@@ -154,23 +155,27 @@
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P8">[[ repeatIn(objects,'voucher') ]]</para>ref
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">
|
||||
<para style="P5">[[ repeatIn(objects,'voucher') ]]</para>
|
||||
<blockTable colWidths="524.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">[[ get_title(voucher.type) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="63.0,200.0,52.0,210.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Journal:</para>
|
||||
<para style="terp_tblheader_General">Journal:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ voucher.journal_id.name ]]</para>
|
||||
<para style="terp_default_9">[[ voucher.type ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Number:</para>
|
||||
<para style="terp_tblheader_General">Number:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ voucher.number ]]</para>
|
||||
@@ -180,22 +185,22 @@
|
||||
<blockTable colWidths="63.0,72.0,44.0,84.0,52.0,210.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">State:</para>
|
||||
<para style="terp_tblheader_General">State:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P3">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P3">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P3">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P2">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P2">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P2">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P2">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Ref. :</para>
|
||||
<para style="terp_tblheader_General">Ref. :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">[[ voucher.reference or '' ]]</para>
|
||||
<para style="terp_default_9">[[ voucher.reference or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Date:</para>
|
||||
<para style="terp_tblheader_General">Date:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
|
||||
@@ -226,7 +231,7 @@
|
||||
<blockTable colWidths="276.0,126.0,123.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">[[ (move_ids.partner_id and move_ids.partner_id.name) or 'Account']] </para>
|
||||
<para style="P3">[[ (move_ids.partner_id and move_ids.partner_id.name) or 'Account']] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(move_ids.debit) ]]</para>
|
||||
@@ -237,7 +242,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P5">[[ move_ids.account_id.name ]] </para>
|
||||
<para style="P4">[[ move_ids.account_id.name ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">
|
||||
@@ -252,7 +257,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8_Italic">[[ move_ids.name ]] - [[ voucher.reference or '' ]]</para>
|
||||
<para style="terp_default_8_Italic">[[ move_ids.name ]] - [[ get_ref(voucher.id,move_ids) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9_50">
|
||||
@@ -371,7 +376,7 @@
|
||||
<blockTable colWidths="276.0,127.0,122.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P2">
|
||||
<para style="P1">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
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="external"
|
||||
)
|
||||
@@ -0,0 +1,94 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from report import report_sxw
|
||||
from tools import amount_to_text_en
|
||||
|
||||
class report_voucher_print(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(report_voucher_print, self).__init__(cr, uid, name, context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_title': self.get_title,
|
||||
'get_lines':self.get_lines,
|
||||
'get_on_account':self.get_on_account,
|
||||
'convert':self.convert
|
||||
})
|
||||
|
||||
def convert(self, amount, cur):
|
||||
amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur);
|
||||
return amt_en
|
||||
|
||||
def get_lines(self,voucher):
|
||||
result = []
|
||||
if voucher.type in ('payment','receipt'):
|
||||
type = voucher.line_ids and voucher.line_ids[0].type or False
|
||||
for move in voucher.move_ids:
|
||||
res = {}
|
||||
amount = move.credit
|
||||
if type == 'dr':
|
||||
amount = move.debit
|
||||
if amount > 0.0:
|
||||
res['pname'] = move.partner_id.name
|
||||
res['ref'] = 'Agst Ref'+" "+str(move.name)
|
||||
res['aname'] = move.account_id.name
|
||||
res['amount'] = amount
|
||||
result.append(res)
|
||||
else:
|
||||
type = voucher.line_ids and voucher.line_ids[0].type or False
|
||||
for move in voucher.move_ids:
|
||||
res = {}
|
||||
amount = move.credit
|
||||
if type == 'dr':
|
||||
amount = move.debit
|
||||
if amount > 0.0:
|
||||
res['pname'] = move.partner_id.name
|
||||
res['ref'] = move.name
|
||||
res['aname'] = move.account_id.name
|
||||
res['amount'] = amount
|
||||
result.append(res)
|
||||
return result
|
||||
|
||||
def get_title(self, type):
|
||||
title = ''
|
||||
if type:
|
||||
title = type[0].swapcase() + type[1:] + " Voucher"
|
||||
return title
|
||||
|
||||
def get_on_account(self, voucher):
|
||||
name = ""
|
||||
if voucher.type == 'receipt':
|
||||
name = "Received cash from "+str(voucher.partner_id.name)
|
||||
elif voucher.type == 'payment':
|
||||
name = "Payment from "+str(voucher.partner_id.name)
|
||||
elif voucher.type == 'sale':
|
||||
name = "Sale to "+str(voucher.partner_id.name)
|
||||
elif voucher.type == 'purchase':
|
||||
name = "Purchase from "+str(voucher.partner_id.name)
|
||||
return name
|
||||
|
||||
report_sxw.report_sxw(
|
||||
'report.voucher.print',
|
||||
'account.voucher',
|
||||
'addons/account_voucher/report/report_voucher_print.rml',
|
||||
parser=report_voucher_print,header="external"
|
||||
)
|
||||
+95
-117
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Voucher Amount" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="42.0" width="525" height="772"/>
|
||||
</pageTemplate>
|
||||
@@ -10,51 +10,17 @@
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="5,-1" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="5,-1" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Heading1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
@@ -65,7 +31,7 @@
|
||||
<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="Table1">
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
@@ -92,9 +58,8 @@
|
||||
<paraStyle name="P1" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica" 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="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
@@ -108,16 +73,16 @@
|
||||
<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_tblheader_General" 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="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_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-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Footer" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" 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_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.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="12.0" leading="15" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
@@ -149,71 +114,87 @@
|
||||
<paraStyle name="Marginalia" rightIndent="0.0" leftIndent="113.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_9_30" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9_50" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9_50_italic" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9_50_italic" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9_30cm" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P6">[[ repeatIn(objects,'voucher') ]]</para>
|
||||
<blockTable colWidths="52.0,123.0,50.0,92.0,63.0,144.0" style="Table2">
|
||||
<para style="P5">[[ repeatIn(objects,'voucher') ]]</para>
|
||||
<blockTable colWidths="524.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Type:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ voucher.journal_id.nme ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Number:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ voucher.number ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Date:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="52.0,123.0,50.0,92.0,63.0,144.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">State:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P5">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P5">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P5">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Ref:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">[[ voucher.reference ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Account:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ voucher.account_id.name ]]</para>
|
||||
<para style="terp_header_Centre">[[ get_title(voucher.type) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="52.0,123.0,50.0,198.0,42.0,59.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General">Number:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ voucher.number ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General">Date:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="52.0,123.0,50.0,198.0,42.0,59.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">State:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P4">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P4">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
|
||||
<para style="P4">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General">Currency:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ voucher.currency_id.code ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="381.0,144.0" style="Heading1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header">Particulars</para>
|
||||
<para style="terp_tblheader_Details">Particulars</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_header_Right">Amount</para>
|
||||
<para style="terp_tblheader_Details_Right">Amount</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -221,29 +202,29 @@
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(voucher.payment_ids,'payment_ids') ]] </para>
|
||||
<blockTable colWidths="380.0,144.0" style="Table1">
|
||||
<para style="terp_default_8">[[ repeatIn(get_lines(voucher),'p') ]] </para>
|
||||
<blockTable colWidths="380.0,144.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ payment_ids.partner_id and payment_ids.partner_id.name or '' ]] </para>
|
||||
<para style="terp_default_Bold_9">Account :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ payment_ids.amount ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9_30">[[ payment_ids.account_id.name ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">
|
||||
<para style="terp_default_Right_9_Bold">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9_50_italic">[[ payment_ids.ref ]] [[ payment_ids.amount ]] </para>
|
||||
<para style="terp_default_9_30cm">[[ p['pname'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ p['amount'] ]] [[ voucher.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9_30cm">[[ p['ref'] ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9_50">
|
||||
@@ -253,7 +234,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9_50_italic">[[ payment_ids.type ]]</para>
|
||||
<para style="terp_default_9_30cm">Account : [[ p['aname'] ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9_50">
|
||||
@@ -282,7 +263,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9_50_italic">[[ voucher.narration or '' ]] </para>
|
||||
<para style="terp_default_9_30">[[ voucher.journal_id.name or '' ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9_50_italic">
|
||||
@@ -302,7 +283,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ voucher.name ]]</para>
|
||||
<para style="terp_default_9_30">[[ get_on_account(voucher) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9_30">
|
||||
@@ -322,7 +303,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
|
||||
<para style="terp_default_9_30">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
@@ -337,12 +318,12 @@
|
||||
<blockTable colWidths="380.0,144.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3">
|
||||
<para style="terp_default_Right_9_Bold">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_header_Right">[[ voucher.amount ]]</para>
|
||||
<para style="terp_default_Right_9_Bold">[[ voucher.amount ]] [[ voucher.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -358,9 +339,6 @@
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -15,15 +15,6 @@
|
||||
name: Voucher Axelor
|
||||
period_id: account.period_6
|
||||
|
||||
-
|
||||
In order to test the PDF reports defined on a account_voucher, we will print account voucher amount Report
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('report.voucher.cash_amount').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_voucher-amount.'+format), 'wb+').write(data)
|
||||
|
||||
-
|
||||
In order to test the PDF reports defined on a account_voucher, we will print account voucher Report
|
||||
-
|
||||
|
||||
@@ -143,7 +143,7 @@ class account_voucher(osv.osv):
|
||||
'reference': fields.char('Ref #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Transaction reference number."),
|
||||
'number': fields.related('move_id', 'name', type="char", readonly=True, string='Number'),
|
||||
'move_id':fields.many2one('account.move', 'Account Entry'),
|
||||
'move_ids': fields.related('move_id','line_id', type='many2many', relation='account.move.line', string='Journal Items', readonly=True),
|
||||
'move_ids': fields.related('move_id','line_id', type='one2many', relation='account.move.line', string='Journal Items', readonly=True),
|
||||
'partner_id':fields.many2one('res.partner', 'Partner', change_default=1, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'audit': fields.related('move_id','to_check', type='boolean', relation='account.move', string='Audit Complete ?'),
|
||||
'pay_now':fields.selection([
|
||||
@@ -375,7 +375,6 @@ class account_voucher(osv.osv):
|
||||
else:
|
||||
total_credit = price or 0.0
|
||||
account_type = 'receivable'
|
||||
|
||||
ids = move_line_pool.search(cr, uid, [('account_id.type','=', account_type), ('reconcile_id','=', False), ('partner_id','=',partner_id)], context=context)
|
||||
ids.reverse()
|
||||
moves = move_line_pool.browse(cr, uid, ids)
|
||||
@@ -467,8 +466,8 @@ class account_voucher(osv.osv):
|
||||
vals['value'].update({'currency_id':currency_id})
|
||||
return vals
|
||||
|
||||
def proforma_voucher(self, cr, uid, ids):
|
||||
self.action_move_line_create(cr, uid, ids)
|
||||
def proforma_voucher(self, cr, uid, ids, context=None):
|
||||
self.action_move_line_create(cr, uid, ids, context=context)
|
||||
return True
|
||||
|
||||
def action_cancel_draft(self, cr, uid, ids, context={}):
|
||||
@@ -529,7 +528,7 @@ class account_voucher(osv.osv):
|
||||
res['account_id'] = account_id
|
||||
return {'value':res}
|
||||
|
||||
def action_move_line_create(self, cr, uid, ids, *args):
|
||||
def action_move_line_create(self, cr, uid, ids, context=None):
|
||||
|
||||
def _get_payment_term_lines(term_id, amount):
|
||||
term_pool = self.pool.get('account.payment.term')
|
||||
@@ -537,18 +536,20 @@ class account_voucher(osv.osv):
|
||||
terms = term_pool.compute(cr, uid, term_id, amount)
|
||||
return terms
|
||||
return False
|
||||
|
||||
if not context:
|
||||
context = {}
|
||||
move_pool = self.pool.get('account.move')
|
||||
move_line_pool = self.pool.get('account.move.line')
|
||||
analytic_pool = self.pool.get('account.analytic.line')
|
||||
currency_pool = self.pool.get('res.currency')
|
||||
invoice_pool = self.pool.get('account.invoice')
|
||||
|
||||
for inv in self.browse(cr, uid, ids):
|
||||
if inv.move_id:
|
||||
continue
|
||||
|
||||
if inv.journal_id.sequence_id:
|
||||
if 'force_name' in context and context['force_name']:
|
||||
name = context['force_name']
|
||||
elif inv.journal_id.sequence_id:
|
||||
name = self.pool.get('ir.sequence').get_id(cr, uid, inv.journal_id.sequence_id.id)
|
||||
else:
|
||||
raise osv.except_osv(_('Error !'), _('Please define a sequence on the journal !'))
|
||||
@@ -815,9 +816,14 @@ account_voucher_line()
|
||||
class account_bank_statement(osv.osv):
|
||||
_inherit = 'account.bank.statement'
|
||||
|
||||
def create_move_from_st_line(self, cr, uid, st_line, company_currency_id, next_number, context=None):
|
||||
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, next_number, context=None):
|
||||
st_line = self.pool.get('account.bank.statement.line').browse(cr, uid, st_line_id, context=context)
|
||||
if st_line.voucher_id:
|
||||
return self.pool.get('account.voucher').proforma_voucher(cr, uid, [st_line.voucher_id.id])
|
||||
res = self.pool.get('account.voucher').proforma_voucher(cr, uid, [st_line.voucher_id.id], context={'force_name': next_number})
|
||||
#force refresh of the cache
|
||||
#st_line = self.pool.get('account.bank.statement.line').browse(cr, uid, st_line.id, context=context)
|
||||
|
||||
return self.pool.get('account.move.line').write(cr, uid, [x.id for x in st_line.voucher_id.move_ids], {'statement_id': st_line.statement_id.id}, context=context)
|
||||
return super(account_bank_statement, self).create_move_from_st_line(cr, uid, st_line, company_currency_id, next_number, context=context)
|
||||
|
||||
account_bank_statement()
|
||||
|
||||
@@ -105,8 +105,8 @@
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Payment Information">
|
||||
<field name="line_dr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
|
||||
<tree string="Vendor Invoices and Outstanding transactions" editable="bottom">
|
||||
<field name="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
|
||||
<tree string="Open Vendor Journal Entries" editable="bottom">
|
||||
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
|
||||
on_change="onchange_move_line_id(move_line_id)"
|
||||
domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
|
||||
@@ -118,12 +118,9 @@
|
||||
<field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
|
||||
<field name="amount" sum="Payment"/>
|
||||
</tree>
|
||||
<form string="Payment Information">
|
||||
<label string="Form view not available for Payment Lines"/>
|
||||
</form>
|
||||
</field>
|
||||
<field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
|
||||
<tree string="Credits" editable="bottom">
|
||||
<field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('type', '=', 'payment')]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
|
||||
<tree string="Open Customer Journal Entries" editable="bottom">
|
||||
<field name="move_line_id"/>
|
||||
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
|
||||
<field name="date_original"/>
|
||||
|
||||
@@ -6,8 +6,19 @@
|
||||
model="account.voucher"
|
||||
name="voucher.cash_receipt.drcr"
|
||||
rml="account_voucher/report/report_voucher.rml"
|
||||
groups="base.group_extended"
|
||||
auto="False"
|
||||
header = "False"
|
||||
menu="True"/>
|
||||
|
||||
<report id="report_account_voucher_print"
|
||||
string="Voucher Print"
|
||||
model="account.voucher"
|
||||
name="voucher.print"
|
||||
rml="account_voucher/report/report_voucher_print.rml"
|
||||
auto="False"
|
||||
header = "False"
|
||||
menu="True"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from tools import cache
|
||||
import pooler
|
||||
|
||||
|
||||
class decimal_precision(osv.osv):
|
||||
_name = 'decimal.precision'
|
||||
@@ -30,23 +33,32 @@ class decimal_precision(osv.osv):
|
||||
_defaults = {
|
||||
'digits': lambda *a : 2,
|
||||
}
|
||||
|
||||
_sql_constraints = [
|
||||
('name_uniq', 'unique (name)', """The Usage of the decimal precision must be unique!"""),
|
||||
]
|
||||
|
||||
@cache(skiparg=3)
|
||||
def precision_get(self, cr, uid, application):
|
||||
cr.execute('select digits from decimal_precision where name=%s', (application,))
|
||||
res = cr.fetchone()
|
||||
return res and res[0] or 2
|
||||
|
||||
def write(self, cr, uid, ids, data, *args, **argv):
|
||||
self.precision_get.clear_cache(cr.dbname)
|
||||
res = super(decimal_precision, self).write(cr, uid, ids, data, *args, **argv)
|
||||
for obj in self.pool.obj_list():
|
||||
for colname,col in self.pool.get(obj)._columns.items():
|
||||
if isinstance(col, fields.float):
|
||||
col.digits_change(cr)
|
||||
return res
|
||||
|
||||
decimal_precision()
|
||||
|
||||
|
||||
def get_precision(application):
|
||||
def change_digit(cr):
|
||||
cr.execute('select digits from decimal_precision where name=%s', (application,))
|
||||
res = cr.fetchone()
|
||||
return (16,res and res[0] or 2)
|
||||
return pooler.get_pool(cr.dbname).get('decimal.precision').precision_get(cr, 1, application)
|
||||
return change_digit
|
||||
|
||||
|
||||
|
||||
@@ -27,28 +27,39 @@ from mx import DateTime
|
||||
from tools.translate import _
|
||||
|
||||
class one2many_mod2(fields.one2many):
|
||||
def get(self, cr, obj, ids, name, user=None, offset=0, context={}, values={}):
|
||||
res = {}
|
||||
for id in ids:
|
||||
res[id] = []
|
||||
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
res5 = obj.read(cr, user, ids, ['date_current', 'user_id'], context=context)
|
||||
res6 = {}
|
||||
for r in res5:
|
||||
res6[r['id']] = (r['date_current'], r['user_id'][0])
|
||||
if values is None:
|
||||
values = {}
|
||||
|
||||
ids2 = []
|
||||
for id in ids:
|
||||
dom = []
|
||||
res = {}.fromkeys(ids, [])
|
||||
|
||||
# dict:
|
||||
# {idn: (date_current, user_id), ...
|
||||
# 1: ('2010-08-15', 1)}
|
||||
res6 = dict([(rec['id'], (rec['date_current'], rec['user_id'][0]))
|
||||
for rec
|
||||
in obj.read(cr, user, ids, ['date_current', 'user_id'], context=context)])
|
||||
|
||||
# eg: ['|', '|',
|
||||
# '&', '&', ('name', '>=', '2011-03-01'), ('name', '<=', '2011-03-01'), ('employee_id.user_id', '=', 1),
|
||||
# '&', '&', ('name', '>=', '2011-02-01'), ('name', '<=', '2011-02-01'), ('employee_id.user_id', '=', 1)]
|
||||
dom = []
|
||||
for c, id in enumerate(ids):
|
||||
if id in res6:
|
||||
dom = [('name', '>=', res6[id][0] + ' 00:00:00'),
|
||||
('name', '<=', res6[id][0] + ' 23:59:59'),
|
||||
('employee_id.user_id', '=', res6[id][1])]
|
||||
ids2.extend(obj.pool.get(self._obj).search(cr, user,
|
||||
dom, limit=self._limit))
|
||||
if c: # skip first
|
||||
dom.insert(0 ,'|')
|
||||
dom.append('&')
|
||||
dom.append('&')
|
||||
dom.append(('name', '>=', res6[id][0]))
|
||||
dom.append(('name', '<=', res6[id][0]))
|
||||
dom.append(('employee_id.user_id', '=', res6[id][1]))
|
||||
|
||||
for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2,
|
||||
[self._fields_id], context=context, load='_classic_write'):
|
||||
ids2 = obj.pool.get(self._obj).search(cr, user, dom, limit=self._limit)
|
||||
|
||||
for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
|
||||
if r[self._fields_id]:
|
||||
res.setdefault(r[self._fields_id][0], []).append(r['id'])
|
||||
|
||||
@@ -57,17 +68,21 @@ class one2many_mod2(fields.one2many):
|
||||
def set(self, cr, obj, id, field, values, user=None, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
context = context.copy()
|
||||
context['sheet_id'] = id
|
||||
return super(one2many_mod2, self).set(cr, obj, id, field, values, user=user,
|
||||
context=context)
|
||||
return super(one2many_mod2, self).set(cr, obj, id, field, values, user=user, context=context)
|
||||
|
||||
|
||||
class one2many_mod(fields.one2many):
|
||||
def get(self, cr, obj, ids, name, user=None, offset=0, context={}, values={}):
|
||||
res = {}
|
||||
for id in ids:
|
||||
res[id] = []
|
||||
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
if values is None:
|
||||
values = {}
|
||||
|
||||
res = {}.fromkeys(ids, [])
|
||||
|
||||
res5 = obj.read(cr, user, ids, ['date_current', 'user_id'], context=context)
|
||||
res6 = {}
|
||||
|
||||
@@ -378,7 +378,6 @@ class one2many_domain(fields.one2many):
|
||||
|
||||
move_obj = obj.pool.get('stock.move')
|
||||
res = {}.fromkeys(ids, [])
|
||||
key = operator.itemgetter(0)
|
||||
move_ids = move_obj.search(cr, user, self._domain+[('production_id', 'in', tuple(ids))], context=context)
|
||||
related_move_dict = dict([(o.production_id.id, [o.id]) for o in move_obj.browse(cr, user, move_ids, context=context)])
|
||||
res.update(related_move_dict)
|
||||
|
||||
@@ -463,18 +463,17 @@
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="name">Restaurant Expenses</field>
|
||||
<field eval="1" name="hr_expense_ok"/>
|
||||
<field name="categ_id" ref="product_category_otherproducts0"/>
|
||||
</record>
|
||||
|
||||
<record id="product_product_worker0" model="product.product">
|
||||
<field name="default_code">WORK</field>
|
||||
<field name="supply_method">produce</field>
|
||||
<field name="type">service</field>
|
||||
<field eval="'make_to_order'" name="procure_method"/>
|
||||
<field name="default_code">WORK</field>
|
||||
<field name="supply_method">produce</field>
|
||||
<field name="type">service</field>
|
||||
<field eval="'make_to_order'" name="procure_method"/>
|
||||
<field eval="0" name="sale_ok"/>
|
||||
<field eval="1" name="purchase_ok"/>
|
||||
<field name="standard_price">20.0</field>
|
||||
<field name="standard_price">20.0</field>
|
||||
<field name="uom_id" ref="uom_hour"/>
|
||||
<field name="uom_po_id" ref="uom_hour"/>
|
||||
<field name="name">Worker</field>
|
||||
@@ -486,15 +485,12 @@
|
||||
<field name="supply_method">buy</field>
|
||||
<field name="standard_price">10.0</field>
|
||||
<field eval="0" name="sale_ok"/>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="name">Rear Panel SHE100</field>
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="name">Rear Panel SHE100</field>
|
||||
<field eval="5" name="seller_delay"/>
|
||||
<field name="categ_id" ref="product_category_misc0"/>
|
||||
</record>
|
||||
<field name="categ_id" ref="product_category_misc0"/>
|
||||
</record>
|
||||
|
||||
<record id="product_product_rearpanelarm1" model="product.product">
|
||||
<field name="default_code">RPAN200</field>
|
||||
@@ -504,9 +500,6 @@ Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="name">Rear Panel SHE200</field>
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field eval="5" name="seller_delay"/>
|
||||
<field name="categ_id" ref="product_category_misc0"/>
|
||||
</record>
|
||||
@@ -519,9 +512,6 @@ Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="name">Side Panel</field>
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field eval="5" name="seller_delay"/>
|
||||
<field name="categ_id" ref="product_category_misc0"/>
|
||||
</record>
|
||||
@@ -534,9 +524,6 @@ Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="name">Rack 100cm</field>
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field eval="8" name="seller_delay"/>
|
||||
<field name="categ_id" ref="product_category_misc0"/>
|
||||
</record>
|
||||
@@ -549,9 +536,6 @@ Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="name">Rack 200cm</field>
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field eval="8" name="seller_delay"/>
|
||||
<field name="categ_id" ref="product_category_misc0"/>
|
||||
</record>
|
||||
@@ -576,9 +560,6 @@ Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="name">Wood Lintel 4m</field>
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field eval="10" name="seller_delay"/>
|
||||
<field name="categ_id" ref="product_category_misc0"/>
|
||||
</record>
|
||||
@@ -590,9 +571,6 @@ Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="name">Metal Cleats</field>
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field eval="20" name="seller_delay"/>
|
||||
<field name="categ_id" ref="product_category_misc0"/>
|
||||
</record>
|
||||
@@ -607,7 +585,6 @@ Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="name">Hotel Expenses</field>
|
||||
<field eval="1" name="hr_expense_ok"/>
|
||||
<field name="categ_id" ref="product_category_otherproducts0"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
-
|
||||
!python {model: product.product}: |
|
||||
import netsvc, tools, os
|
||||
data_dict = {'model': 'product.price_list'}
|
||||
data_dict = {'model': 'product.product'}
|
||||
data_dict['form'] = {
|
||||
'qty1': 1,
|
||||
'qty2': 5,
|
||||
|
||||
@@ -193,6 +193,48 @@
|
||||
<field name="uom_id" ref="product.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product.product_uom_unit"/>
|
||||
</record>
|
||||
|
||||
<record id="product.product_product_rearpanelarm0" model="product.product">
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
</record>
|
||||
|
||||
<record id="product.product_product_rearpanelarm1" model="product.product">
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
</record>
|
||||
|
||||
<record id="product.product_product_sidepanel0" model="product.product">
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
</record>
|
||||
|
||||
<record id="product.product_product_shelf0" model="product.product">
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
</record>
|
||||
|
||||
<record id="product.product_product_shelf1" model="product.product">
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
</record>
|
||||
|
||||
<record id="product.product_product_woodlintelm0" model="product.product">
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
</record>
|
||||
|
||||
<record id="product.product_product_metalcleats0" model="product.product">
|
||||
<field eval="'Public Pricelist (0.00) : 1.00
|
||||
One-shot customers (0.00) : 1.00
|
||||
Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1450,7 +1450,7 @@ class stock_move(osv.osv):
|
||||
'date': fields.datetime('Creation Date', select=True),
|
||||
'date_planned': fields.datetime('Date', required=True, help="Scheduled date for the movement of the products or real date if the move is done."),
|
||||
'date_expected': fields.datetime('Date Expected', readonly=True,required=True, help="Scheduled date for the movement of the products"),
|
||||
'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', required=True, select=True, domain=[('type','<>','service')]),
|
||||
|
||||
'product_qty': fields.float('Quantity', required=True),
|
||||
'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True),
|
||||
|
||||
Reference in New Issue
Block a user