Merge branch 'master' into master-pos-new-payment-screen-fva
Conflicts: addons/point_of_sale/point_of_sale.py addons/point_of_sale/point_of_sale_view.xml
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[](http://runbot.odoo.com/runbot)
|
||||
[](http://runbot.odoo.com/runbot)
|
||||
|
||||
Odoo
|
||||
----
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
import partner
|
||||
import account
|
||||
import installer
|
||||
import project
|
||||
import account_invoice
|
||||
import account_bank_statement
|
||||
import account_bank
|
||||
|
||||
@@ -97,24 +97,16 @@ for a particular financial year and for preparation of vouchers there is a modul
|
||||
'wizard/account_automatic_reconcile_view.xml',
|
||||
'wizard/account_financial_report_view.xml',
|
||||
'wizard/pos_box.xml',
|
||||
'project/wizard/project_account_analytic_line_view.xml',
|
||||
'account_end_fy.xml',
|
||||
'account_invoice_view.xml',
|
||||
'data/account_data.xml',
|
||||
'data/data_account_type.xml',
|
||||
'data/configurable_account_chart.xml',
|
||||
'account_invoice_workflow.xml',
|
||||
'project/project_view.xml',
|
||||
'project/project_report.xml',
|
||||
'project/wizard/account_analytic_balance_report_view.xml',
|
||||
'project/wizard/account_analytic_cost_ledger_view.xml',
|
||||
'project/wizard/account_analytic_inverted_balance_report.xml',
|
||||
'project/wizard/account_analytic_journal_report_view.xml',
|
||||
'project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml',
|
||||
'project/wizard/account_analytic_chart_view.xml',
|
||||
'partner_view.xml',
|
||||
'product_view.xml',
|
||||
'account_assert_test.xml',
|
||||
'account_analytic_view.xml',
|
||||
'ir_sequence_view.xml',
|
||||
'company_view.xml',
|
||||
'edi/invoice_action_data.xml',
|
||||
@@ -135,11 +127,6 @@ for a particular financial year and for preparation of vouchers there is a modul
|
||||
'views/report_partnerledgerother.xml',
|
||||
'views/report_financial.xml',
|
||||
'views/report_generalledger.xml',
|
||||
'project/views/report_analyticbalance.xml',
|
||||
'project/views/report_analyticjournal.xml',
|
||||
'project/views/report_analyticcostledgerquantity.xml',
|
||||
'project/views/report_analyticcostledger.xml',
|
||||
'project/views/report_invertedanalyticbalance.xml',
|
||||
'views/account.xml',
|
||||
],
|
||||
'qweb' : [
|
||||
@@ -149,8 +136,6 @@ for a particular financial year and for preparation of vouchers there is a modul
|
||||
],
|
||||
'demo': [
|
||||
'demo/account_demo.xml',
|
||||
'project/project_demo.xml',
|
||||
'project/analytic_account_demo.xml',
|
||||
'demo/account_minimal.xml',
|
||||
'demo/account_invoice_demo.xml',
|
||||
'demo/account_bank_statement.xml',
|
||||
|
||||
@@ -669,7 +669,7 @@ class account_account(osv.osv):
|
||||
|
||||
# For legal reason (forbiden to modify journal entries which belongs to a closed fy or period), Forbid to modify
|
||||
# the code of an account if journal entries have been already posted on this account. This cannot be simply
|
||||
# 'configurable' since it can lead to a lack of confidence in OpenERP and this is what we want to change.
|
||||
# 'configurable' since it can lead to a lack of confidence in Odoo and this is what we want to change.
|
||||
def _check_allow_code_change(self, cr, uid, ids, context=None):
|
||||
line_obj = self.pool.get('account.move.line')
|
||||
for account in self.browse(cr, uid, ids, context=context):
|
||||
@@ -738,6 +738,7 @@ class account_journal(osv.osv):
|
||||
'loss_account_id' : fields.many2one('account.account', 'Loss Account'),
|
||||
'internal_account_id' : fields.many2one('account.account', 'Internal Transfers Account', select=1),
|
||||
'cash_control' : fields.boolean('Cash Control', help='If you want the journal should be control at opening/closing, check this option'),
|
||||
'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal', help="Journal for analytic entries"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -2488,7 +2489,7 @@ class account_account_template(osv.osv):
|
||||
('other','Regular'),
|
||||
('closed','Closed'),
|
||||
], 'Internal Type', required=True,help="This type is used to differentiate types with "\
|
||||
"special effects in OpenERP: view can not have entries, consolidation are accounts that "\
|
||||
"special effects in Odoo: view can not have entries, consolidation are accounts that "\
|
||||
"can have children accounts for multi-company consolidations, payable/receivable are for "\
|
||||
"partners accounts (for debit/credit computations), closed for depreciated accounts."),
|
||||
'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
|
||||
|
||||
@@ -29,13 +29,14 @@ class account_analytic_line(osv.osv):
|
||||
_columns = {
|
||||
'product_uom_id': fields.many2one('product.uom', 'Unit of Measure'),
|
||||
'product_id': fields.many2one('product.product', 'Product'),
|
||||
'general_account_id': fields.many2one('account.account', 'General Account', required=True, ondelete='restrict'),
|
||||
'general_account_id': fields.many2one('account.account', 'Financial Account', required=True, ondelete='restrict'),
|
||||
'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True),
|
||||
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='restrict', select=True),
|
||||
'code': fields.char('Code', size=8),
|
||||
'ref': fields.char('Ref.'),
|
||||
'currency_id': fields.related('move_id', 'currency_id', type='many2one', relation='res.currency', string='Account Currency', store=True, help="The related account currency if not equal to the company one.", readonly=True),
|
||||
'amount_currency': fields.related('move_id', 'amount_currency', type='float', string='Amount Currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True),
|
||||
'partner_id': fields.related('account_id', 'partner_id', type='many2one', relation='res.partner', string='Partner', store=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -74,13 +75,19 @@ class account_analytic_line(osv.osv):
|
||||
product_obj = self.pool.get('product.product')
|
||||
analytic_journal_obj =self.pool.get('account.analytic.journal')
|
||||
product_price_type_obj = self.pool.get('product.price.type')
|
||||
product_uom_obj = self.pool.get('product.uom')
|
||||
j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
|
||||
prod = product_obj.browse(cr, uid, prod_id, context=context)
|
||||
result = 0.0
|
||||
if prod_id:
|
||||
unit = prod.uom_id.id
|
||||
unit_obj = False
|
||||
if unit:
|
||||
unit_obj = product_uom_obj.browse(cr, uid, unit, context=context)
|
||||
if not unit_obj or prod.uom_id.category_id.id != unit_obj.category_id.id:
|
||||
unit = prod.uom_id.id
|
||||
if j_id.type == 'purchase':
|
||||
unit = prod.uom_po_id.id
|
||||
if not unit_obj or prod.uom_po_id.category_id.id != unit_obj.category_id.id:
|
||||
unit = prod.uom_po_id.id
|
||||
if j_id.type <> 'sale':
|
||||
a = prod.property_account_expense.id
|
||||
if not a:
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_account_analytic_line_form_inherit_account" model="ir.ui.view">
|
||||
<field name="name">account.analytic.line.form.inherit.account</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='account_id']" position="after">
|
||||
<field name="journal_id"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='date']" position="after">
|
||||
<field name="ref"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="after">
|
||||
<field name="partner_id"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='amount']" position="after">
|
||||
<label for="amount_currency" groups="base.group_multi_currency"/>
|
||||
<div groups="base.group_multi_currency">
|
||||
<field name="amount_currency" class="oe_inline"/>
|
||||
<field name="currency_id" class="oe_inline"/>
|
||||
</div>
|
||||
<field invisible="1" name="general_account_id"/>
|
||||
</xpath>
|
||||
<xpath expr="//label[@for='unit_amount']" position="before">
|
||||
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='unit_amount']" position="after">
|
||||
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='product_info']" position="after">
|
||||
<group string="General Accounting">
|
||||
<field name="general_account_id"/>
|
||||
<field name="move_id" readonly="1"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_analytic_line_tree_inherit_account" model="ir.ui.view">
|
||||
<field name="name">account.analytic.line.tree.inherit.account</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='date']" position="after">
|
||||
<field name="ref" invisible="context.get('to_invoice', False)"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='user_id']" position="after">
|
||||
<field name="partner_id"/>
|
||||
<field name="journal_id" invisible="context.get('to_invoice', False)"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='amount']" position="after">
|
||||
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" invisible="not context.get('to_invoice', False)"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='unit_amount']" position="after">
|
||||
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" invisible="not context.get('to_invoice', False)"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='account_id']" position="after">
|
||||
<field name="general_account_id" invisible="context.get('to_invoice', False)"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_analytic_line_filter_inherit_account" model="ir.ui.view">
|
||||
<field name="name">account.analytic.line.select.inherit.account</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_line_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='date']" position="after">
|
||||
<field name="product_id"/>
|
||||
<filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" help="Analytic Journal Items related to a sale journal."/>
|
||||
<filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" help="Analytic Journal Items related to a purchase journal."/>
|
||||
<filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='account_id']" position="after">
|
||||
<field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
|
||||
</xpath>
|
||||
<xpath expr="//filter[@name='user_id']" position="after">
|
||||
<filter string="Financial Account" context="{'group_by':'general_account_id'}"/>
|
||||
<filter string="Journal" context="{'group_by':'journal_id'}" name="group_journal"/>
|
||||
<filter string="Product" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Partner" context="{'group_by':'partner_id'}"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem groups="analytic.group_analytic_accounting"
|
||||
action="analytic.action_account_analytic_journal_open_form"
|
||||
id="account_analytic_journal_entries"
|
||||
parent="menu_finance_entries"/>
|
||||
|
||||
<record id="view_account_journal_1" model="ir.ui.view">
|
||||
<field name="name">account.journal.form.1</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="type" position="after">
|
||||
<field name="analytic_journal_id" groups="analytic.group_analytic_accounting"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem groups="analytic.group_analytic_accounting" id="next_id_40"
|
||||
name="Analytic" parent="account.menu_finance_generic_reporting"
|
||||
sequence="4"/>
|
||||
<menuitem groups="analytic.group_analytic_accounting"
|
||||
action="analytic.action_account_analytic_journal"
|
||||
id="account_analytic_journal_print" parent="account.next_id_40"/>
|
||||
<menuitem
|
||||
name="Chart of Analytic Accounts"
|
||||
parent="account.menu_finance_charts"
|
||||
action="analytic.action_account_analytic_chart"
|
||||
id="menu_action_analytic_account_tree2"
|
||||
icon="STOCK_INDENT"
|
||||
groups="analytic.group_analytic_accounting"/>
|
||||
<menuitem action="analytic.action_account_analytic_account_form" id="account_analytic_def_account"
|
||||
parent="menu_analytic_accounting"
|
||||
groups="analytic.group_analytic_accounting"/>
|
||||
|
||||
<menuitem groups="analytic.group_analytic_accounting" action="analytic.action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" sequence="5"/>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -326,16 +326,26 @@ class account_bank_statement(osv.osv):
|
||||
or (not st.journal_id.default_debit_account_id):
|
||||
raise osv.except_osv(_('Configuration Error!'), _('Please verify that an account is defined in the journal.'))
|
||||
for line in st.move_line_ids:
|
||||
if line.state <> 'valid':
|
||||
if line.state != 'valid':
|
||||
raise osv.except_osv(_('Error!'), _('The account entries lines are not in valid state.'))
|
||||
move_ids = []
|
||||
for st_line in st.line_ids:
|
||||
if not st_line.amount:
|
||||
continue
|
||||
if not st_line.journal_entry_id.id:
|
||||
if st_line.account_id and not st_line.journal_entry_id.id:
|
||||
#make an account move as before
|
||||
vals = {
|
||||
'debit': st_line.amount < 0 and -st_line.amount or 0.0,
|
||||
'credit': st_line.amount > 0 and st_line.amount or 0.0,
|
||||
'account_id': st_line.account_id.id,
|
||||
'name': st_line.name
|
||||
}
|
||||
self.pool.get('account.bank.statement.line').process_reconciliation(cr, uid, st_line.id, [vals], context=context)
|
||||
elif not st_line.journal_entry_id.id:
|
||||
raise osv.except_osv(_('Error!'), _('All the account entries lines must be processed in order to close the statement.'))
|
||||
move_ids.append(st_line.journal_entry_id.id)
|
||||
self.pool.get('account.move').post(cr, uid, move_ids, context=context)
|
||||
if move_ids:
|
||||
self.pool.get('account.move').post(cr, uid, move_ids, context=context)
|
||||
self.message_post(cr, uid, [st.id], body=_('Statement %s confirmed, journal items were created.') % (st.name,), context=context)
|
||||
self.link_bank_to_partner(cr, uid, ids, context=context)
|
||||
return self.write(cr, uid, ids, {'state': 'confirm'}, context=context)
|
||||
@@ -728,7 +738,12 @@ class account_bank_statement_line(osv.osv):
|
||||
move_id = am_obj.create(cr, uid, move_vals, context=context)
|
||||
|
||||
# Create the move line for the statement line
|
||||
amount = currency_obj.compute(cr, uid, st_line.statement_id.currency.id, company_currency.id, st_line.amount, context=context)
|
||||
if st_line.statement_id.currency.id != company_currency.id:
|
||||
ctx = context.copy()
|
||||
ctx['date'] = st_line.date
|
||||
amount = currency_obj.compute(cr, uid, st_line.statement_id.currency.id, company_currency.id, st_line.amount_currency, context=ctx)
|
||||
else:
|
||||
amount = st_line.amount
|
||||
bank_st_move_vals = bs_obj._prepare_bank_move_line(cr, uid, st_line, move_id, amount, company_currency.id, context=context)
|
||||
aml_obj.create(cr, uid, bank_st_move_vals, context=context)
|
||||
# Complete the dicts
|
||||
@@ -805,18 +820,19 @@ class account_bank_statement_line(osv.osv):
|
||||
_description = "Bank Statement Line"
|
||||
_inherit = ['ir.needaction_mixin']
|
||||
_columns = {
|
||||
'name': fields.char('Description', required=True, copy=False),
|
||||
'date': fields.date('Date', required=True, copy=False),
|
||||
'name': fields.char('Description', required=True),
|
||||
'date': fields.date('Date', required=True),
|
||||
'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||
'bank_account_id': fields.many2one('res.partner.bank','Bank Account'),
|
||||
'account_id': fields.many2one('account.account', 'Account', help="This technical field can be used at the statement line creation/import time in order to avoid the reconciliation process on it later on. The statement line will simply create a counterpart on this account"),
|
||||
'statement_id': fields.many2one('account.bank.statement', 'Statement', select=True, required=True, ondelete='cascade'),
|
||||
'journal_id': fields.related('statement_id', 'journal_id', type='many2one', relation='account.journal', string='Journal', store=True, readonly=True),
|
||||
'ref': fields.char('Structured Communication'),
|
||||
'note': fields.text('Notes'),
|
||||
'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of bank statement lines."),
|
||||
'company_id': fields.related('statement_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
|
||||
'journal_entry_id': fields.many2one('account.move', 'Journal Entry'),
|
||||
'journal_entry_id': fields.many2one('account.move', 'Journal Entry', copy=False),
|
||||
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', help="The optional other currency if it is a multi-currency entry."),
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
Configure your company's bank account and select those that must
|
||||
appear on the report footer.
|
||||
</p><p>
|
||||
If you use the accounting application of OpenERP, journals and
|
||||
If you use the accounting application of Odoo, journals and
|
||||
accounts will be created automatically based on these data.
|
||||
</p>
|
||||
</field>
|
||||
|
||||
@@ -379,7 +379,7 @@ class account_invoice(models.Model):
|
||||
assert len(self) == 1, 'This option should only be used for a single id at a time.'
|
||||
template = self.env.ref('account.email_template_edi_invoice', False)
|
||||
compose_form = self.env.ref('mail.email_compose_message_wizard_form', False)
|
||||
ctx = dict(self._context,
|
||||
ctx = dict(
|
||||
default_model='account.invoice',
|
||||
default_res_id=self.id,
|
||||
default_use_template=bool(template),
|
||||
@@ -793,7 +793,10 @@ class account_invoice(models.Model):
|
||||
continue
|
||||
|
||||
ctx = dict(self._context, lang=inv.partner_id.lang)
|
||||
date_invoice = inv.date_invoice or fields.Date.context_today(self)
|
||||
|
||||
if not inv.date_invoice:
|
||||
inv.with_context(ctx).write({'date_invoice': fields.Date.context_today(self)})
|
||||
date_invoice = inv.date_invoice
|
||||
|
||||
company_currency = inv.company_id.currency_id
|
||||
# create the analytical lines, one move line per invoice line
|
||||
@@ -906,7 +909,6 @@ class account_invoice(models.Model):
|
||||
move = account_move.with_context(ctx).create(move_vals)
|
||||
# make the invoice point to that move
|
||||
vals = {
|
||||
'date_invoice': date_invoice,
|
||||
'move_id': move.id,
|
||||
'period_id': period.id,
|
||||
'move_name': move.name,
|
||||
@@ -1005,15 +1007,18 @@ class account_invoice(models.Model):
|
||||
#TODO: implement messages system
|
||||
return True
|
||||
|
||||
@api.one
|
||||
def _compute_display_name(self):
|
||||
@api.multi
|
||||
def name_get(self):
|
||||
TYPES = {
|
||||
'out_invoice': _('Invoice'),
|
||||
'in_invoice': _('Supplier Invoice'),
|
||||
'out_refund': _('Refund'),
|
||||
'in_refund': _('Supplier Refund'),
|
||||
}
|
||||
self.display_name = "%s %s" % (self.number or TYPES[self.type], self.name or '')
|
||||
result = []
|
||||
for inv in self:
|
||||
result.append((inv.id, "%s %s" % (inv.number or TYPES[inv.type], inv.name or '')))
|
||||
return result
|
||||
|
||||
@api.model
|
||||
def name_search(self, name, args=None, operator='ilike', limit=100):
|
||||
@@ -1627,8 +1632,8 @@ class mail_compose_message(models.Model):
|
||||
context.get('default_res_id') and context.get('mark_invoice_as_sent'):
|
||||
invoice = self.env['account.invoice'].browse(context['default_res_id'])
|
||||
invoice = invoice.with_context(mail_post_autofollow=True)
|
||||
self.write({'sent': True})
|
||||
self.message_post(body=_("Invoice sent"))
|
||||
invoice.write({'sent': True})
|
||||
invoice.message_post(body=_("Invoice sent"))
|
||||
return super(mail_compose_message, self).send_mail()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<group>
|
||||
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id" on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)" groups="account.group_account_user"/>
|
||||
<field name="invoice_line_tax_id" context="{'type':parent.get('type')}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]" widget="many2many_tags"/>
|
||||
<field domain="[('type','<>','view'), ('company_id', '=', parent.company_id)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field domain="[('type','<>','view'), ('company_id', '=', parent.company_id)], ('state','not in',('close','cancelled'))]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -95,7 +95,7 @@
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="account_id" groups="account.group_account_user"/>
|
||||
<field name="account_analytic_id" domain="[('type','<>','view'), ('company_id', '=', parent.company_id)]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="account_analytic_id" domain="[('type','<>','view'), ('company_id', '=', parent.company_id), ('state','not in',('close','cancelled')]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="manual"/>
|
||||
<field name="amount"/>
|
||||
<field name="base" readonly="0"/>
|
||||
@@ -201,7 +201,7 @@
|
||||
domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '=', 'other')]"
|
||||
on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
|
||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id)]"/>
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('state','not in',('close','cancelled'))]"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uos_id" groups="product.group_uom"
|
||||
on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
|
||||
@@ -358,7 +358,7 @@
|
||||
domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '=', 'other')]"
|
||||
on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
|
||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id)]"/>
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('state','not in',('close','cancelled'))]"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uos_id" groups="product.group_uom"
|
||||
on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
|
||||
@@ -523,7 +523,7 @@
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a customer invoice.
|
||||
</p><p>
|
||||
OpenERP's electronic invoicing allows to ease and fasten the
|
||||
Odoo's electronic invoicing allows to ease and fasten the
|
||||
collection of customer payments. Your customer receives the
|
||||
invoice by email and he can pay online and/or import it
|
||||
in his own system.
|
||||
@@ -564,7 +564,7 @@
|
||||
Click to record a new supplier invoice.
|
||||
</p><p>
|
||||
You can control the invoice from your supplier according to
|
||||
what you purchased or received. OpenERP can also generate
|
||||
what you purchased or received. Odoo can also generate
|
||||
draft invoices automatically from purchase orders or receipts.
|
||||
</p>
|
||||
</field>
|
||||
|
||||
@@ -583,7 +583,7 @@ class account_move_line(osv.osv):
|
||||
def _check_no_view(self, cr, uid, ids, context=None):
|
||||
lines = self.browse(cr, uid, ids, context=context)
|
||||
for l in lines:
|
||||
if l.account_id.type == 'view':
|
||||
if l.account_id.type in ('view', 'consolidation'):
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -635,7 +635,7 @@ class account_move_line(osv.osv):
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_no_view, 'You cannot create journal items on an account of type view.', ['account_id']),
|
||||
(_check_no_view, 'You cannot create journal items on an account of type view or consolidation.', ['account_id']),
|
||||
(_check_no_closed, 'You cannot create journal items on closed account.', ['account_id']),
|
||||
(_check_company_id, 'Account and Period must belong to the same company.', ['company_id']),
|
||||
(_check_date, 'The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal.', ['date']),
|
||||
@@ -1038,6 +1038,8 @@ class account_move_line(osv.osv):
|
||||
all_moves = list(set(all_moves) - set(move_ids))
|
||||
if unlink_ids:
|
||||
if opening_reconciliation:
|
||||
raise osv.except_osv(_('Warning!'),
|
||||
_('Opening Entries have already been generated. Please run "Cancel Closing Entries" wizard to cancel those entries and then run this wizard.'))
|
||||
obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False})
|
||||
obj_move_rec.unlink(cr, uid, unlink_ids)
|
||||
if len(all_moves) >= 2:
|
||||
|
||||
@@ -100,24 +100,22 @@
|
||||
<button name="action_draft" states="done" string="Re-Open Period" type="object" groups="account.group_account_manager"/>
|
||||
<field name="state" widget="statusbar" nolabel="1"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="fiscalyear_id" widget="selection"/>
|
||||
<label for="date_start" string="Duration"/>
|
||||
<div>
|
||||
<field name="date_start" class="oe_inline" nolabel="1"/> -
|
||||
<field name="date_stop" nolabel="1" class="oe_inline"/>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="special"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<field name="name"/>
|
||||
<field name="fiscalyear_id" widget="selection"/>
|
||||
<label for="date_start" string="Duration"/>
|
||||
<div>
|
||||
<field name="date_start" class="oe_inline" nolabel="1"/> -
|
||||
<field name="date_stop" nolabel="1" class="oe_inline"/>
|
||||
</div>
|
||||
</group>
|
||||
</sheet>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="special"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -650,7 +648,7 @@
|
||||
occurring over a given period of time on a bank account. You
|
||||
should receive this periodicaly from your bank.
|
||||
</p><p>
|
||||
OpenERP allows you to reconcile a statement line directly with
|
||||
Odoo allows you to reconcile a statement line directly with
|
||||
the related sale or puchase invoices.
|
||||
</p>
|
||||
</field>
|
||||
@@ -920,7 +918,7 @@
|
||||
Click to define a new tax code.
|
||||
</p><p>
|
||||
Depending on the country, a tax code is usually a cell to fill
|
||||
in your legal tax statement. OpenERP allows you to define the
|
||||
in your legal tax statement. Odoo allows you to define the
|
||||
tax structure and each tax computation will be registered in
|
||||
one or several tax code.
|
||||
</p>
|
||||
@@ -1269,8 +1267,8 @@
|
||||
Select the period and the journal you want to fill.
|
||||
</p><p>
|
||||
This view can be used by accountants in order to quickly record
|
||||
entries in OpenERP. If you want to record a supplier invoice,
|
||||
start by recording the line of the expense account. OpenERP
|
||||
entries in Odoo. If you want to record a supplier invoice,
|
||||
start by recording the line of the expense account. Odoo
|
||||
will propose to you automatically the Tax related to this
|
||||
account and the counterpart "Account Payable".
|
||||
</p>
|
||||
@@ -1506,7 +1504,7 @@
|
||||
A journal entry consists of several journal items, each of
|
||||
which is either a debit or a credit transaction.
|
||||
</p><p>
|
||||
OpenERP automatically creates one journal entry per accounting
|
||||
Odoo automatically creates one journal entry per accounting
|
||||
document: invoice, refund, supplier payment, bank statements,
|
||||
etc. So, you should record journal entries manually only/mainly
|
||||
for miscellaneous operations.
|
||||
@@ -1677,7 +1675,7 @@
|
||||
<form string="Payment Term">
|
||||
<group>
|
||||
<group string="Amount Computation">
|
||||
<field name="value"/>
|
||||
<field name="value" widget="radio" nolabel="1" colspan="4"/>
|
||||
<label for="value_amount" string="Amount To Pay" attrs="{'invisible':[('value','=','balance')]}"/>
|
||||
<div attrs="{'invisible':[('value','=','balance')]}">
|
||||
<field name="value_amount" class="oe_inline"/>
|
||||
@@ -1925,7 +1923,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Account Templates">
|
||||
<field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Account Template"/>
|
||||
<filter icon="terp-sale" string="Receivale Accounts" domain="[('type','=','receivable')]"/>
|
||||
<filter icon="terp-sale" string="Receivable Accounts" domain="[('type','=','receivable')]"/>
|
||||
<filter icon="terp-purchase" string="Payable Accounts" domain="[('type','=','payable')]"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="user_type"/>
|
||||
|
||||
@@ -315,7 +315,7 @@
|
||||
<field name="sequence_id" ref="sequence_sale_journal"/>
|
||||
<field name="default_credit_account_id" ref="a_sale"/>
|
||||
<field name="default_debit_account_id" ref="a_sale"/>
|
||||
<field name="analytic_journal_id" ref="cose_journal_sale"/>
|
||||
<field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
<record id="refund_sales_journal" model="account.journal">
|
||||
@@ -325,7 +325,7 @@
|
||||
<field name="sequence_id" ref="sequence_refund_sales_journal"/>
|
||||
<field name="default_credit_account_id" ref="a_sale"/>
|
||||
<field name="default_debit_account_id" ref="a_sale"/>
|
||||
<field name="analytic_journal_id" ref="cose_journal_sale"/>
|
||||
<field name="analytic_journal_id" ref="analytic.cose_journal_sale"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
@@ -357,7 +357,7 @@
|
||||
<field name="sequence_id" ref="sequence_bank_journal"/>
|
||||
<field name="default_debit_account_id" ref="bnk"/>
|
||||
<field name="default_credit_account_id" ref="bnk"/>
|
||||
<field name="analytic_journal_id" ref="sit"/>
|
||||
<field name="analytic_journal_id" ref="analytic.sit"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
<record id="check_journal" model="account.journal">
|
||||
@@ -367,7 +367,7 @@
|
||||
<field name="sequence_id" ref="sequence_check_journal"/>
|
||||
<field name="default_debit_account_id" ref="cash"/>
|
||||
<field name="default_credit_account_id" ref="cash"/>
|
||||
<field name="analytic_journal_id" ref="sit"/>
|
||||
<field name="analytic_journal_id" ref="analytic.sit"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
<record id="cash_journal" model="account.journal">
|
||||
@@ -381,13 +381,13 @@
|
||||
<!--
|
||||
Usually, cash payment methods requires a control at opening and closing.
|
||||
Bot for demo data, it's better to avoid the control step so that people
|
||||
that test OpenERP arrive directly in the touchscreen UI.
|
||||
that test Odoo arrive directly in the touchscreen UI.
|
||||
-->
|
||||
<field name="cash_control" eval="False"/>
|
||||
<field name="sequence_id" ref="sequence_cash_journal"/>
|
||||
<field name="default_debit_account_id" ref="cash"/>
|
||||
<field name="default_credit_account_id" ref="cash"/>
|
||||
<field name="analytic_journal_id" ref="sit"/>
|
||||
<field name="analytic_journal_id" ref="analytic.sit"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
<record id="miscellaneous_journal" model="account.journal">
|
||||
@@ -395,7 +395,7 @@
|
||||
<field name="code">TMIS</field>
|
||||
<field name="type">general</field>
|
||||
<field name="sequence_id" ref="sequence_miscellaneous_journal"/>
|
||||
<field name="analytic_journal_id" ref="sit"/>
|
||||
<field name="analytic_journal_id" ref="analytic.sit"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
<record id="opening_journal" model="account.journal">
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
from operator import itemgetter
|
||||
import time
|
||||
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import api
|
||||
|
||||
@@ -222,8 +223,9 @@ class res_partner(osv.osv):
|
||||
result = {}
|
||||
account_invoice_report = self.pool.get('account.invoice.report')
|
||||
for partner in self.browse(cr, uid, ids, context=context):
|
||||
invoice_ids = account_invoice_report.search(cr, uid, [('partner_id','child_of',partner.id)], context=context)
|
||||
invoices = account_invoice_report.browse(cr, uid, invoice_ids, context=context)
|
||||
domain = [('partner_id', 'child_of', partner.id)]
|
||||
invoice_ids = account_invoice_report.search(cr, SUPERUSER_ID, domain, context=context)
|
||||
invoices = account_invoice_report.browse(cr, SUPERUSER_ID, invoice_ids, context=context)
|
||||
result[partner.id] = sum(inv.user_currency_price_total for inv in invoices)
|
||||
return result
|
||||
|
||||
@@ -267,7 +269,8 @@ class res_partner(osv.osv):
|
||||
fnct_search=_credit_search, string='Total Receivable', multi='dc', help="Total amount this customer owes you."),
|
||||
'debit': fields.function(_credit_debit_get, fnct_search=_debit_search, string='Total Payable', multi='dc', help="Total amount you have to pay to this supplier."),
|
||||
'debit_limit': fields.float('Payable Limit'),
|
||||
'total_invoiced': fields.function(_invoice_total, string="Total Invoiced", type='float'),
|
||||
'total_invoiced': fields.function(_invoice_total, string="Total Invoiced", type='float', groups='account.group_account_invoice'),
|
||||
|
||||
'contracts_count': fields.function(_journal_item_count, string="Contracts", type='integer', multi="invoice_journal"),
|
||||
'journal_item_count': fields.function(_journal_item_count, string="Journal Items", type="integer", multi="invoice_journal"),
|
||||
'property_account_payable': fields.property(
|
||||
|
||||
@@ -62,8 +62,8 @@
|
||||
<field name="context">{'search_default_partner_id': [active_id], 'default_partner_id': active_id}</field>
|
||||
<field name="name">Contracts/Analytic Accounts</field>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
<field name="view_id" ref="view_account_analytic_account_tree"/>
|
||||
<field name="search_view_id" ref="view_account_analytic_account_search"/>
|
||||
<field name="view_id" ref="analytic.view_account_analytic_account_tree"/>
|
||||
<field name="search_view_id" ref="analytic.view_account_analytic_account_search"/>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="partner_view_buttons">
|
||||
<field name="name">partner.view.buttons</field>
|
||||
@@ -74,6 +74,7 @@
|
||||
<xpath expr="//div[@name='buttons']" position="inside">
|
||||
<button type="action"
|
||||
class="oe_stat_button"
|
||||
id="invoice_button"
|
||||
icon="fa-pencil-square-o"
|
||||
name="%(account.action_invoice_tree)d"
|
||||
attrs="{'invisible': [('customer', '=', False)]}"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<field name="property_account_income" domain="[('type','=','other')]" groups="account.group_account_user"
|
||||
attrs="{'readonly': [('is_product_variant', '=', True)]}"/>
|
||||
<field name="taxes_id" colspan="2" widget="many2many_tags"
|
||||
attrs="{'readonly':[ '|', ('sale_ok','=',0), ('is_product_variant', '=', True)]}"/>
|
||||
attrs="{'readonly':[('sale_ok','=',0)]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="property_account_expense" domain="[('type','=','other')]" groups="account.group_account_user"
|
||||
|
||||
@@ -1,28 +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 project
|
||||
import report
|
||||
import wizard
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
|
||||
class account_analytic_journal(osv.osv):
|
||||
_name = 'account.analytic.journal'
|
||||
_description = 'Analytic Journal'
|
||||
_columns = {
|
||||
'name': fields.char('Journal Name', required=True),
|
||||
'code': fields.char('Journal Code', size=8),
|
||||
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the analytic journal without removing it."),
|
||||
'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
|
||||
'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
}
|
||||
_defaults = {
|
||||
'active': True,
|
||||
'type': 'general',
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
|
||||
}
|
||||
|
||||
|
||||
class account_journal(osv.osv):
|
||||
_inherit="account.journal"
|
||||
|
||||
_columns = {
|
||||
'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal', help="Journal for analytic entries"),
|
||||
}
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,57 +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/>.
|
||||
#
|
||||
##############################################################################
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
class project_account_analytic_line(osv.osv_memory):
|
||||
_name = "project.account.analytic.line"
|
||||
_description = "Analytic Entries by line"
|
||||
_columns = {
|
||||
'from_date': fields.date('From'),
|
||||
'to_date': fields.date('To'),
|
||||
}
|
||||
|
||||
def action_open_window(self, cr, uid, ids, context=None):
|
||||
mod_obj =self.pool.get('ir.model.data')
|
||||
domain = []
|
||||
data = self.read(cr, uid, ids, [])[0]
|
||||
from_date = data['from_date']
|
||||
to_date = data['to_date']
|
||||
if from_date and to_date:
|
||||
domain = [('date','>=',from_date), ('date','<=',to_date)]
|
||||
elif from_date:
|
||||
domain = [('date','>=',from_date)]
|
||||
elif to_date:
|
||||
domain = [('date','<=',to_date)]
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account', 'view_account_analytic_line_filter')
|
||||
id = result and result[1] or False
|
||||
return {
|
||||
'name': _('Analytic Entries by line'),
|
||||
'view_type': 'form',
|
||||
"view_mode": 'tree,form',
|
||||
'res_model': 'account.analytic.line',
|
||||
'type': 'ir.actions.act_window',
|
||||
'domain': domain,
|
||||
'search_view_id': id['res_id'],
|
||||
}
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_project_account_analytic_line_form" model="ir.ui.view">
|
||||
<field name="name">project.account.analytic.line.form</field>
|
||||
<field name="model">project.account.analytic.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="View Account Analytic Lines">
|
||||
<header>
|
||||
<button string="Open Entries" name="action_open_window" type="object" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel"/>
|
||||
</header>
|
||||
<group col="4">
|
||||
<field name="from_date"/>
|
||||
<field name="to_date"/>
|
||||
</group>
|
||||
<label string ="(Keep empty to open the current situation)" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_project_account_analytic_line_form" model="ir.actions.act_window">
|
||||
<field name="name">Entries By Line</field>
|
||||
<field name="res_model">project.account.analytic.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_project_account_analytic_line_form"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -33,8 +33,8 @@ class analytic_entries_report(osv.osv):
|
||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
|
||||
'account_id': fields.many2one('account.analytic.account', 'Account', required=False),
|
||||
'general_account_id': fields.many2one('account.account', 'General Account', required=True),
|
||||
'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=False),
|
||||
'general_account_id': fields.many2one('account.account', 'Financial Account', required=True),
|
||||
'journal_id': fields.many2one('account.analytic.journal', 'Journal', required=True),
|
||||
'move_id': fields.many2one('account.move.line', 'Move', required=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', required=True),
|
||||
|
||||
@@ -14,15 +14,13 @@
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/>
|
||||
<filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/>
|
||||
<filter string="Analytic Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/>
|
||||
<filter string="Financial Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Product Unit of Measure" icon="terp-mrp" context="{'group_by':'product_uom_id'}"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Date (day)" icon="terp-go-today" context="{'group_by':'date:day'}"/>
|
||||
<filter string="Date (month)" name="Month" icon="terp-go-month" context="{'group_by':'date:month'}"/>
|
||||
<filter string="Date (year)" icon="terp-go-year" context="{'group_by':'date:year'}"/>
|
||||
<filter string="Date" name="Month" icon="terp-go-month" context="{'group_by':'date:month'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -37,14 +37,8 @@ class account_entries_report(osv.osv):
|
||||
'debit': fields.float('Debit', readonly=True),
|
||||
'credit': fields.float('Credit', readonly=True),
|
||||
'balance': fields.float('Balance', readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'date': fields.date('Date', size=128, readonly=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
|
||||
'amount_currency': fields.float('Amount Currency', digits_compute=dp.get_precision('Account'), readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
|
||||
'period_id': fields.many2one('account.period', 'Period', readonly=True),
|
||||
'account_id': fields.many2one('account.account', 'Account', readonly=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
|
||||
@@ -53,7 +47,7 @@ class account_entries_report(osv.osv):
|
||||
'product_uom_id': fields.many2one('product.uom', 'Product Unit of Measure', readonly=True),
|
||||
'move_state': fields.selection([('draft','Unposted'), ('posted','Posted')], 'Status', readonly=True),
|
||||
'move_line_state': fields.selection([('draft','Unbalanced'), ('valid','Valid')], 'State of Move Line', readonly=True),
|
||||
'reconcile_id': fields.many2one('account.move.reconcile', readonly=True),
|
||||
'reconcile_id': fields.many2one('account.move.reconcile', 'Reconciliation number', readonly=True),
|
||||
'partner_id': fields.many2one('res.partner','Partner', readonly=True),
|
||||
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
|
||||
'quantity': fields.float('Products Quantity', digits=(16,2), readonly=True),
|
||||
@@ -67,7 +61,7 @@ class account_entries_report(osv.osv):
|
||||
('other', 'Regular'),
|
||||
('closed', 'Closed'),
|
||||
], 'Internal Type', readonly=True, help="This type is used to differentiate types with "\
|
||||
"special effects in OpenERP: view can not have entries, consolidation are accounts that "\
|
||||
"special effects in Odoo: view can not have entries, consolidation are accounts that "\
|
||||
"can have children accounts for multi-company consolidations, payable/receivable are for "\
|
||||
"partners accounts (for debit/credit computations), closed for depreciated accounts."),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
@@ -123,9 +117,6 @@ class account_entries_report(osv.osv):
|
||||
am.state as move_state,
|
||||
l.state as move_line_state,
|
||||
l.reconcile_id as reconcile_id,
|
||||
to_char(am.date, 'YYYY') as year,
|
||||
to_char(am.date, 'MM') as month,
|
||||
to_char(am.date, 'YYYY-MM-DD') as day,
|
||||
l.partner_id as partner_id,
|
||||
l.product_id as product_id,
|
||||
l.product_uom_id as product_uom_id,
|
||||
|
||||
@@ -18,9 +18,6 @@
|
||||
<field name="credit"/>
|
||||
<field name="balance"/>
|
||||
<field name="move_state" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="product_uom_id" invisible="1"/>
|
||||
|
||||
@@ -86,9 +86,7 @@
|
||||
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Account" icon="terp-folder-orange" context="{'group_by':'account_line_id'}"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Invoice Date (day)" name="day" icon="terp-go-today" context="{'group_by':'date:day'}" help="Group by Invoice Date"/>
|
||||
<filter string="Invoice Date (month)" name="month" icon="terp-go-month" context="{'group_by':'date:month'}" help="Group by month of Invoice Date"/>
|
||||
<filter string="Invoice Date (year)" name="group_year" icon="terp-go-year" context="{'group_by':'date:year'}" help="Group by year of Invoice Date"/>
|
||||
<filter string="Invoice Date" name="month" icon="terp-go-month" context="{'group_by':'date'}" help="Group by month of Invoice Date"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -42,7 +42,7 @@ class account_config_settings(osv.osv_memory):
|
||||
'currency_id': fields.related('company_id', 'currency_id', type='many2one', relation='res.currency', required=True,
|
||||
string='Default company currency', help="Main currency of the company."),
|
||||
'paypal_account': fields.related('company_id', 'paypal_account', type='char', size=128,
|
||||
string='Paypal account', help="Paypal account (email) for receiving online payments (credit card, etc.) If you set a paypal account, the customer will be able to pay your invoices or quotations with a button \"Pay with Paypal\" in automated emails or through the OpenERP portal."),
|
||||
string='Paypal account', help="Paypal account (email) for receiving online payments (credit card, etc.) If you set a paypal account, the customer will be able to pay your invoices or quotations with a button \"Pay with Paypal\" in automated emails or through the Odoo portal."),
|
||||
'company_footer': fields.related('company_id', 'rml_footer', type='text', readonly=True,
|
||||
string='Bank accounts footer preview', help="Bank accounts as printed in the footer of each printed document"),
|
||||
|
||||
@@ -51,8 +51,8 @@ class account_config_settings(osv.osv_memory):
|
||||
'code_digits': fields.integer('# of Digits', help="No. of digits to use for account code"),
|
||||
'tax_calculation_rounding_method': fields.related('company_id',
|
||||
'tax_calculation_rounding_method', type='selection', selection=[
|
||||
('round_per_line', 'Round per line'),
|
||||
('round_globally', 'Round globally'),
|
||||
('round_per_line', 'Round calculation of taxes per line'),
|
||||
('round_globally', 'Round globally calculation of taxes '),
|
||||
], string='Tax calculation rounding method',
|
||||
help="If you select 'Round per line' : for each tax, the tax amount will first be computed and rounded for each PO/SO/invoice line and then these rounded amounts will be summed, leading to the total amount for that tax. If you select 'Round globally': for each tax, the tax amount will be computed for each PO/SO/invoice line, then these amounts will be summed and eventually this total tax amount will be rounded. If you sell with tax included, you should choose 'Round per line' because you certainly want the sum of your tax-included line subtotals to be equal to the total amount with taxes."),
|
||||
'sale_tax': fields.many2one("account.tax.template", "Default sale tax"),
|
||||
@@ -108,6 +108,12 @@ class account_config_settings(osv.osv_memory):
|
||||
'module_product_email_template': fields.boolean('Send products tools and information at the invoice confirmation',
|
||||
help='With this module, link your products to a template to send complete information and tools to your customer.\n'
|
||||
'For instance when invoicing a training, the training agenda and materials will automatically be send to your customers.'),
|
||||
'module_account_bank_statement_import_ofx': fields.boolean('Import of Bank Statements in .OFX Format',
|
||||
help='Get your bank statements from you bank and import them in Odoo in .OFX format.\n'
|
||||
'-that installs the module account_bank_statement_import.'),
|
||||
'module_account_bank_statement_import_qif': fields.boolean('Import of Bank Statements in .QIF Format.',
|
||||
help='Get your bank statements from you bank and import them in Odoo in .QIF format.\n'
|
||||
'-that installs the module account_bank_statement_import_qif.'),
|
||||
'group_proforma_invoices': fields.boolean('Allow pro-forma invoices',
|
||||
implied_group='account.group_proforma_invoices',
|
||||
help="Allows you to put invoices in pro-forma state."),
|
||||
|
||||
@@ -115,8 +115,7 @@
|
||||
<field name="decimal_precision" class="oe_inline"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="tax_calculation_rounding_method"/>
|
||||
<field name="tax_calculation_rounding_method" class="oe_inline"/>
|
||||
<field name="tax_calculation_rounding_method" widget="radio" class="oe_inline" />
|
||||
</div>
|
||||
</div>
|
||||
<label for="id" string="Features"/>
|
||||
@@ -243,7 +242,18 @@
|
||||
</div>
|
||||
<div name='payment_acquirer'>
|
||||
<label for="paypal_account"/>
|
||||
<field name="paypal_account" placeholder="e.g. sales@openerp.com" class="oe_inline"/>
|
||||
<field name="paypal_account" placeholder="e.g. sales@odoo.com" class="oe_inline"/>
|
||||
</div>
|
||||
</div>
|
||||
<label for="id" string="Bank Statements"/>
|
||||
<div>
|
||||
<div>
|
||||
<field name="module_account_bank_statement_import_ofx" class="oe_inline"/>
|
||||
<label for="module_account_bank_statement_import_ofx"/>
|
||||
</div>
|
||||
<div>
|
||||
<field name="module_account_bank_statement_import_qif" class="oe_inline"/>
|
||||
<label for="module_account_bank_statement_import_qif"/>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
|
||||
@@ -62,13 +62,6 @@
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="analytic_journal_comp_rule" model="ir.rule">
|
||||
<field name="name">Analytic journal multi-company</field>
|
||||
<field name="model_id" ref="model_account_analytic_journal"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="period_comp_rule" model="ir.rule">
|
||||
<field name="name">Period multi-company</field>
|
||||
<field name="model_id" ref="model_account_period"/>
|
||||
|
||||
@@ -24,8 +24,8 @@ access_account_bank_statement,account.bank.statement,model_account_bank_statemen
|
||||
access_account_bank_statement_line,account.bank.statement.line,model_account_bank_statement_line,account.group_account_user,1,1,1,1
|
||||
access_account_analytic_line_manager,account.analytic.line manager,model_account_analytic_line,account.group_account_manager,1,0,0,0
|
||||
access_account_analytic_account,account.analytic.account,analytic.model_account_analytic_account,base.group_user,1,0,0,0
|
||||
access_account_analytic_journal,account.analytic.journal,model_account_analytic_journal,account.group_account_user,1,0,0,0
|
||||
access_account_analytic_journal_user,account.analytic.journal,model_account_analytic_journal,base.group_user,1,1,1,0
|
||||
access_account_analytic_journal,account.analytic.journal,analytic.model_account_analytic_journal,account.group_account_user,1,0,0,0
|
||||
access_account_analytic_journal_user,account.analytic.journal,analytic.model_account_analytic_journal,base.group_user,1,1,1,0
|
||||
access_account_invoice_uinvoice,account.invoice,model_account_invoice,account.group_account_invoice,1,1,1,1
|
||||
access_account_invoice_line_uinvoice,account.invoice.line,model_account_invoice_line,account.group_account_invoice,1,1,1,1
|
||||
access_account_invoice_tax_uinvoice,account.invoice.tax,model_account_invoice_tax,account.group_account_invoice,1,1,1,1
|
||||
@@ -41,7 +41,7 @@ access_account_journal_invoice,account.journal invoice,model_account_journal,acc
|
||||
access_account_period_manager,account.period,model_account_period,account.group_account_manager,1,1,1,1
|
||||
access_account_period_invoice,account.period invoice,model_account_period,account.group_account_invoice,1,0,0,0
|
||||
access_account_invoice_group_invoice,account.invoice group invoice,model_account_invoice,account.group_account_invoice,1,1,1,1
|
||||
access_account_analytic_journal_manager,account.analytic.journal,model_account_analytic_journal,account.group_account_manager,1,1,1,1
|
||||
access_account_analytic_journal_manager,account.analytic.journal,analytic.model_account_analytic_journal,account.group_account_manager,1,1,1,1
|
||||
access_account_fiscalyear,account.fiscalyear,model_account_fiscalyear,account.group_account_manager,1,1,1,1
|
||||
access_account_fiscalyear_invoice,account.fiscalyear.invoice,model_account_fiscalyear,account.group_account_invoice,1,0,0,0
|
||||
access_account_fiscalyear_partner_manager,account.fiscalyear.partnermanager,model_account_fiscalyear,base.group_partner_manager,1,0,0,0
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
By far the most beautiful and full featured accounting software. OpenERP Accounting allows a better way to collaborate with your accountants, your customers and control your suppliers.</p>
|
||||
By far the most beautiful and full featured accounting software. Odoo Accounting allows a better way to collaborate with your accountants, your customers and control your suppliers.</p>
|
||||
<p>
|
||||
Activate features on demand, from integrated analytic accounting to budget, assets and multiple companies consolidation.
|
||||
</p>
|
||||
@@ -29,7 +29,7 @@ Activate features on demand, from integrated analytic accounting to budget, asse
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
Record transactions in a few clicks and easily manage all financial activities
|
||||
in one place. OpenERP's user interface is designed with productivity in mind.
|
||||
in one place. Odoo's user interface is designed with productivity in mind.
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
@@ -135,7 +135,7 @@ Integrate your analytic accounting operations with timesheets, projects, invoice
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
Manage your assets, track expenses, control budgets, multi-level analytic accounting; OpenERP has all the features you need to sustain all your business activities.
|
||||
Manage your assets, track expenses, control budgets, multi-level analytic accounting; Odoo has all the features you need to sustain all your business activities.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -148,7 +148,7 @@ Manage your assets, track expenses, control budgets, multi-level analytic accoun
|
||||
<h3 class="oe_slogan">Used by very small to very large organizations</h3>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
OpenERP supports multiple currencies, multiple users with different access rights, multiple companies with real time consolidation and unlimited analytic plans.
|
||||
Odoo supports multiple currencies, multiple users with different access rights, multiple companies with real time consolidation and unlimited analytic plans.
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
@@ -166,7 +166,7 @@ OpenERP supports multiple currencies, multiple users with different access right
|
||||
<div class="oe_span6">
|
||||
<div class="oe_quote">
|
||||
<q>
|
||||
OpenERP Accounting is a great way to record all business transactions
|
||||
Odoo Accounting is a great way to record all business transactions
|
||||
right when they happen. Awesome and cost-effective!
|
||||
</q>
|
||||
<cite class="oe_cite oe_clearfix oe_ml64">
|
||||
@@ -178,7 +178,7 @@ OpenERP supports multiple currencies, multiple users with different access right
|
||||
<div class="oe_span6">
|
||||
<div class="oe_quote">
|
||||
<q>
|
||||
We have found accounting module of OpenERP to be user
|
||||
We have found accounting module of Odoo to be user
|
||||
friendly and highly customizable. It proved to be an accounting gem.
|
||||
</q>
|
||||
<cite class="oe_cite oe_clearfix">
|
||||
|
||||
@@ -139,7 +139,7 @@ openerp.account = function (instance) {
|
||||
}
|
||||
|
||||
// Retreive statement infos and reconciliation data from the model
|
||||
var lines_filter = [['journal_entry_id', '=', false]];
|
||||
var lines_filter = [['journal_entry_id', '=', false], ['account_id', '=', false]];
|
||||
var deferred_promises = [];
|
||||
|
||||
if (self.statement_id) {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
name: End of Year
|
||||
code: NEW
|
||||
type: situation
|
||||
analytic_journal_id: sit
|
||||
analytic_journal_id: analytic.sit
|
||||
default_debit_account_id: cash
|
||||
default_credit_account_id: cash
|
||||
company_id: base.main_company
|
||||
|
||||
@@ -135,47 +135,47 @@
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]})
|
||||
data_dict = {}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Cost Ledger Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root'),ref('analytic.analytic_absences'),ref('analytic.analytic_internal'),ref('analytic.analytic_our_super_product')]})
|
||||
data_dict = {}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Cost Ledger(Only Quantities) Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root'),ref('analytic.analytic_absences'),ref('analytic.analytic_internal'),ref('analytic.analytic_our_super_product')]})
|
||||
data_dict = {}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Analytic Journal Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.journal}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]})
|
||||
ctx.update({'model': 'account.analytic.journal','active_ids': [ref('analytic.cose_journal_sale'), ref('account.exp'), ref('analytic.sit')]})
|
||||
data_dict = {}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Inverted Analytic Balance Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]})
|
||||
data_dict = {}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
test_reports.try_report_action(cr, uid, 'analytic.action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
@@ -8,7 +8,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Reconciliation">
|
||||
<separator string="Reconciliation"/>
|
||||
<label string="For an invoice to be considered as paid, the invoice entries must be reconciled with counterparts, usually payments. With the automatic reconciliation functionality, OpenERP makes its own search for entries to reconcile in a series of accounts. It finds entries for each partner where the amounts correspond."/>
|
||||
<label string="For an invoice to be considered as paid, the invoice entries must be reconciled with counterparts, usually payments. With the automatic reconciliation functionality, Odoo makes its own search for entries to reconcile in a series of accounts. It finds entries for each partner where the amounts correspond."/>
|
||||
<field name="account_ids" domain="[('reconcile','=',1)]"/>
|
||||
<group col="4">
|
||||
<field name="power"/>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<xpath expr="//notebook/page[@string='Journals']" position="replace">
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="display_account"/>
|
||||
<field name="display_account" widget="radio"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Report Options">
|
||||
<separator string="Aged Partner Balance"/>
|
||||
<label string="Aged Partner Balance is a more detailed report of your receivables by intervals. When opening that report, OpenERP asks for the name of the company, the fiscal period and the size of the interval to be analyzed (in days). OpenERP then calculates a table of credit balance by period. So if you request an interval of 30 days OpenERP generates an analysis of creditors for the past month, past two months, and so on. "/>
|
||||
<label string="Aged Partner Balance is a more detailed report of your receivables by intervals. When opening that report, Odoo asks for the name of the company, the fiscal period and the size of the interval to be analyzed (in days). Odoo then calculates a table of credit balance by period. So if you request an interval of 30 days Odoo generates an analysis of creditors for the past month, past two months, and so on. "/>
|
||||
<group col="4">
|
||||
<field name="chart_account_id" widget='selection' on_change="onchange_chart_id(chart_account_id, context)"/>
|
||||
<field name="fiscalyear_id" invisible="1"/>
|
||||
@@ -19,7 +19,7 @@
|
||||
<newline/>
|
||||
<field name="result_selection"/>
|
||||
<field name="direction_selection"/>
|
||||
<field name="target_move"/>
|
||||
<field name="target_move" widget="radio"/>
|
||||
</group>
|
||||
<field name="journal_ids" required="0" invisible="1"/>
|
||||
<footer>
|
||||
|
||||
@@ -44,7 +44,7 @@ class account_common_report(osv.osv_memory):
|
||||
'chart_account_id': fields.many2one('account.account', 'Chart of Account', help='Select Charts of Accounts', required=True, domain = [('parent_id','=',False)]),
|
||||
'company_id': fields.related('chart_account_id', 'company_id', type='many2one', relation='res.company', string='Company', readonly=True),
|
||||
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', help='Keep empty for all open fiscal year'),
|
||||
'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by", required=True),
|
||||
'filter': fields.selection([('filter_no', 'Do not apply filter'), ('filter_date', 'Filter by date'), ('filter_period', 'Filter by period')], "Filter by", required=True),
|
||||
'period_from': fields.many2one('account.period', 'Start Period'),
|
||||
'period_to': fields.many2one('account.period', 'End Period'),
|
||||
'journal_ids': fields.many2many('account.journal', string='Journals', required=True),
|
||||
|
||||
@@ -26,8 +26,8 @@ class account_common_account_report(osv.osv_memory):
|
||||
_description = 'Account Common Account Report'
|
||||
_inherit = "account.common.report"
|
||||
_columns = {
|
||||
'display_account': fields.selection([('all','All'), ('movement','With movements'),
|
||||
('not_zero','With balance is not equal to 0'),
|
||||
'display_account': fields.selection([('all','Display all Accounts'), ('movement','Display Accounts with movements'),
|
||||
('not_zero','Display Account where balance is not equal to 0'),
|
||||
],'Display Accounts', required=True),
|
||||
|
||||
}
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
<field name="chart_account_id" widget='selection' on_change="onchange_chart_id(chart_account_id, context)"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="fiscalyear_id" domain="[('company_id','=',company_id)]"/>
|
||||
<field name="target_move"/>
|
||||
<field name="target_move" widget="radio" nolable="1"/>
|
||||
</group>
|
||||
<notebook tabpos="up" colspan="4">
|
||||
<page string="Filters" name="filters">
|
||||
<group>
|
||||
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)"/>
|
||||
<group col="4">
|
||||
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)" widget="radio" nolabel="1"/>
|
||||
</group>
|
||||
<group string="Dates" attrs="{'invisible':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}">
|
||||
<field name="date_from" />
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="display_account"/>
|
||||
<field name="sortby"/>
|
||||
<field name="display_account" widget="radio"/>
|
||||
<field name="sortby" widget="radio"/>
|
||||
<field name="landscape"/>
|
||||
<field name="amount_currency"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='filter']" position="after">
|
||||
<field name="initial_balance" attrs="{'readonly':[('filter', 'in', ('filter_no'))]}" />
|
||||
<field name="initial_balance" attrs="{'readonly':[('filter', 'in', ('filter_no'))]}"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
|
||||
@@ -30,7 +30,7 @@ class account_partner_balance(osv.osv_memory):
|
||||
_name = 'account.partner.balance'
|
||||
_description = 'Print Account Partner Balance'
|
||||
_columns = {
|
||||
'display_partner': fields.selection([('non-zero_balance', 'With balance is not equal to 0'), ('all', 'All Partners')]
|
||||
'display_partner': fields.selection([('non-zero_balance', 'Display partners with balance is not equal to 0'), ('all', 'Display all partners')]
|
||||
,'Display Partners'),
|
||||
'journal_ids': fields.many2many('account.journal', 'account_partner_balance_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<data>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="result_selection"/>
|
||||
<field name="display_partner"/>
|
||||
<field name="display_partner" widget="radio"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="sort_selection"/>
|
||||
<field name="sort_selection" widget="radio"/>
|
||||
<field name="amount_currency"/>
|
||||
<newline/>
|
||||
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)" colspan="4" invisible="1"/>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="model">account.vat.declaration</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Taxes Report">
|
||||
<label colspan="4" string="This menu prints a tax declaration based on invoices or payments. Select one or several periods of the fiscal year. The information required for a tax declaration is automatically generated by OpenERP from invoices (or payments, in some countries). This data is updated in real time. That’s very useful because it enables you to preview at any time the tax that you owe at the start and end of the month or quarter."/>
|
||||
<label colspan="4" string="This menu prints a tax declaration based on invoices or payments. Select one or several periods of the fiscal year. The information required for a tax declaration is automatically generated by Odoo from invoices (or payments, in some countries). This data is updated in real time. That’s very useful because it enables you to preview at any time the tax that you owe at the start and end of the month or quarter."/>
|
||||
<group string="Taxes Report" col="4">
|
||||
<field name="chart_tax_id" widget='selection'/>
|
||||
<field name="fiscalyear_id"/>
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
<field name="type">notification</field>
|
||||
<field name="subtype_id" ref="mail.mt_comment"/>
|
||||
<field name="subject">Accounting and Finance application installed!</field>
|
||||
<field name="body"><![CDATA[<p>With OpenERP's accounting, you get instant access to your financial data, and can setup analytic accounting, forecast taxes, control budgets, easily create and send invoices, record bank statements, etc.</p>
|
||||
<p>The accounting features are fully integrated with other OpenERP applications to automate all your processes: creation of customer invoices, control of supplier invoices, point-of-sale integration, automated follow-ups, etc.</p>]]></field>
|
||||
<field name="body"><![CDATA[<p>With Odoo's accounting, you get instant access to your financial data, and can setup analytic accounting, forecast taxes, control budgets, easily create and send invoices, record bank statements, etc.</p>
|
||||
<p>The accounting features are fully integrated with other Odoo applications to automate all your processes: creation of customer invoices, control of supplier invoices, point-of-sale integration, automated follow-ups, etc.</p>]]></field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -67,7 +67,7 @@ Hello ${object.name},
|
||||
|
||||
<pre>
|
||||
--
|
||||
OpenERP Automatic Email
|
||||
Odoo Automatic Email
|
||||
</pre>
|
||||
|
||||
]]></field>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
</table>
|
||||
<group name='invoice_on_timesheets'>
|
||||
<p name='invoice_on_timesheets_label' class="oe_grey oe_edit_only" colspan="2" attrs="{'invisible': [('invoice_on_timesheets','=',False)]}">
|
||||
When reinvoicing costs, OpenERP uses the
|
||||
When reinvoicing costs, Odoo uses the
|
||||
pricelist of the contract which uses the price
|
||||
defined on the product related (e.g timesheet
|
||||
products are defined on each employee).
|
||||
@@ -197,7 +197,7 @@
|
||||
<record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
|
||||
<field name="name">account.analytic.account.list.contract</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="inherit_id" ref="account.view_account_analytic_account_list"/>
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_account_list"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date_start" position="before">
|
||||
<field name="last_invoice_date"/>
|
||||
@@ -264,7 +264,7 @@
|
||||
Click to create a new contract.
|
||||
</p><p>
|
||||
Use contracts to follow tasks, issues, timesheets or invoicing based on
|
||||
work done, expenses and/or sales orders. OpenERP will automatically manage
|
||||
work done, expenses and/or sales orders. Odoo will automatically manage
|
||||
the alerts for the renewal of the contracts to the right salesperson.
|
||||
</p>
|
||||
</field>
|
||||
@@ -280,7 +280,7 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('invoice_id','=',False)]</field>
|
||||
<field name="context">{'search_default_to_invoice': 1}</field>
|
||||
<field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
|
||||
<field name="search_view_id" ref="analytic.view_account_analytic_line_filter"/>
|
||||
<field name="help" type="html">
|
||||
<p>
|
||||
You will find here timesheets and purchases you did for
|
||||
@@ -310,7 +310,7 @@
|
||||
end date is passed or the working effort is higher than the
|
||||
maximum authorized one.
|
||||
</p><p>
|
||||
OpenERP automatically sets contracts to be renewed in a pending
|
||||
Odoo automatically sets contracts to be renewed in a pending
|
||||
state. After the negociation, the salesman should close or renew
|
||||
pending contracts.
|
||||
</p>
|
||||
@@ -338,6 +338,21 @@
|
||||
</field>
|
||||
</record>
|
||||
<menuitem action="template_of_contract_action" id="menu_template_of_contract_action" parent="base.menu_base_config"/>
|
||||
|
||||
<record id="account_analytic_analysis_form_form" model="ir.ui.view">
|
||||
<field name="name">account.analytic.account.invoice.form.inherit</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
|
||||
<field eval="20" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr='//div[@name="buttons"]' position='inside'>
|
||||
<button class="oe_inline oe_stat_button" string="Time & Materials to Invoice"
|
||||
name="%(action_hr_tree_invoiced_all)d"
|
||||
type="action"
|
||||
context="{'search_default_account_id': [active_id], 'default_account_id': active_id}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record id="account.analytic_consultancy" model="account.analytic.account">
|
||||
<record id="analytic.analytic_consultancy" model="account.analytic.account">
|
||||
<field name="partner_id" ref="base.res_partner_15"/>
|
||||
<field name="invoice_on_timesheets">True</field>
|
||||
<field name="hours_qtt_est">1200</field>
|
||||
@@ -12,16 +12,16 @@
|
||||
</record>
|
||||
|
||||
<record id="sale.sale_order_4" model="sale.order">
|
||||
<field name="project_id" ref="account.analytic_consultancy"/>
|
||||
<field name="project_id" ref="analytic.analytic_consultancy"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_timesheet.working_hours_maintenance" model="hr.analytic.timesheet">
|
||||
<field name="account_id" ref="account.analytic_consultancy"/>
|
||||
<field name="account_id" ref="analytic.analytic_consultancy"/>
|
||||
<field name="to_invoice" ref="hr_timesheet_invoice.timesheet_invoice_factor1"/>
|
||||
<field name="unit_amount">100</field>
|
||||
</record>
|
||||
|
||||
<record id="account.analytic_super_product_trainings" model="account.analytic.account">
|
||||
<record id="analytic.analytic_super_product_trainings" model="account.analytic.account">
|
||||
<field name="partner_id" ref="base.res_partner_18"/>
|
||||
<field name="invoice_on_timesheets">True</field>
|
||||
<field name="hours_qtt_est">500</field>
|
||||
@@ -32,11 +32,11 @@
|
||||
</record>
|
||||
|
||||
<record id="sale.sale_order_6" model="sale.order">
|
||||
<field name="project_id" ref="account.analytic_super_product_trainings"/>
|
||||
<field name="project_id" ref="analytic.analytic_super_product_trainings"/>
|
||||
<field name="partner_id" ref="base.res_partner_1"/>
|
||||
</record>
|
||||
|
||||
<record id="account.analytic_support_internal" model="account.analytic.account">
|
||||
<record id="analytic.analytic_support_internal" model="account.analytic.account">
|
||||
<field name="partner_id" ref="base.res_partner_1"/>
|
||||
<field name="use_timesheets">True</field>
|
||||
<field name="invoice_on_timesheets">True</field>
|
||||
|
||||
@@ -130,4 +130,27 @@ class product_product(osv.Model):
|
||||
'rules_count': fields.function(_rules_count, string='# Analytic Rules', type='integer'),
|
||||
}
|
||||
|
||||
class product_template(osv.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
def _rules_count(self, cr, uid, ids, field_name, arg, context=None):
|
||||
Analytic = self.pool['account.analytic.default']
|
||||
res = {}
|
||||
for product_tmpl_id in self.browse(cr, uid, ids, context=context):
|
||||
res[product_tmpl_id.id] = sum([p.rules_count for p in product_tmpl_id.product_variant_ids])
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'rules_count': fields.function(_rules_count, string='# Analytic Rules', type='integer'),
|
||||
}
|
||||
|
||||
|
||||
def action_view_rules(self, cr, uid, ids, context=None):
|
||||
products = self._get_products(cr, uid, ids, context=context)
|
||||
result = self._get_act_window_dict(cr, uid, 'account_analytic_default.action_product_default_list', context=context)
|
||||
result['domain'] = "[('product_id','in',[" + ','.join(map(str, products)) + "])]"
|
||||
# Remove context so it is not going to filter on product_id with active_id of template
|
||||
result['context'] = "{}"
|
||||
return result
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -87,6 +87,20 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="product_template_view_default_analytic_button">
|
||||
<field name="name">product.template.stock.move</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='buttons']" position="inside">
|
||||
<button class="oe_inline oe_stat_button" name= "action_view_rules" type="object"
|
||||
groups="analytic.group_analytic_accounting" icon="fa-xing">
|
||||
<field string="Analytic Rules" name="rules_count" widget="statinfo" />
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window
|
||||
name="Entries"
|
||||
|
||||
@@ -392,7 +392,7 @@ class account_invoice(osv.osv):
|
||||
if inv.type in ('in_invoice', 'in_refund'):
|
||||
ref = inv.reference
|
||||
else:
|
||||
ref = self._convert_ref(cr, uid, inv.number)
|
||||
ref = self._convert_ref(inv.number)
|
||||
obj_move_line = acct_ins_obj.browse(cr, uid, il['analytics_id'], context=context)
|
||||
ctx = context.copy()
|
||||
ctx.update({'date': inv.date_invoice})
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import os, time
|
||||
import openerp.report
|
||||
from openerp import tools
|
||||
data_dict = {'model': 'account.analytic.account', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'journal_ids':[6,0,(ref('account.cose_journal_sale'))],'ref':ref('account.analytic_root'),'empty_line':True,'id':ref('account.analytic_root'),'context':{}}}
|
||||
data, format = openerp.report.render_report(cr, uid, [ref('account.analytic_root')], 'account_analytic_plans.report_crossoveredanalyticplans', data_dict, {})
|
||||
data_dict = {'model': 'account.analytic.account', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'journal_ids':[6,0,(ref('analytic.cose_journal_sale'))],'ref':ref('analytic.analytic_root'),'empty_line':True,'id':ref('analytic.analytic_root'),'context':{}}}
|
||||
data, format = openerp.report.render_report(cr, uid, [ref('analytic.analytic_root')], 'account_analytic_plans.report_crossoveredanalyticplans', data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_analytic_plans-crossovered_analyitic.'+format), 'wb+').write(data)
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
-
|
||||
!workflow {model: purchase.order, ref: purchase_order_001, action: purchase_confirm}
|
||||
-
|
||||
Reception is ready for process so now done the reception.
|
||||
Receipt is ready for process so now we do it.
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_id = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_001"), context=context).picking_ids[0]
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
-
|
||||
!workflow {model: purchase.order, ref: purchase_order_001_fifo, action: purchase_confirm}
|
||||
-
|
||||
Reception is ready for process so now done the reception.
|
||||
Receipt is ready for process so now we do it.
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_id = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_001_fifo"), context=context).picking_ids[0]
|
||||
|
||||
@@ -40,7 +40,7 @@ class account_asset_category(osv.osv):
|
||||
'account_expense_depreciation_id': fields.many2one('account.account', 'Depr. Expense Account', required=True, domain=[('type','=','other')]),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, help="Choose the method to use to compute the amount of depreciation lines.\n"\
|
||||
'method': fields.selection([('linear','Linear: Computed on basis of Gross Value / Number of Depreciations'),('degressive','Degressive: Computed on basis of Residual Value * Degressive Factor')], 'Computation Method', required=True, help="Choose the method to use to compute the amount of depreciation lines.\n"\
|
||||
" * Linear: Calculated on basis of: Gross Value / Number of Depreciations\n" \
|
||||
" * Degressive: Calculated on basis of: Residual Value * Degressive Factor"),
|
||||
'method_number': fields.integer('Number of Depreciations', help="The number of depreciations needed to depreciate your asset"),
|
||||
@@ -262,7 +262,7 @@ class account_asset_asset(osv.osv):
|
||||
"You can manually close an asset when the depreciation is over. If the last line of depreciation is posted, the asset automatically goes in that status."),
|
||||
'active': fields.boolean('Active'),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose the method to use to compute the amount of depreciation lines.\n"\
|
||||
'method': fields.selection([('linear','Linear: Computed on basis of Gross Value / Number of Depreciations'),('degressive','Degressive: Computed on basis of Residual Value * Degressive Factor')], 'Computation Method', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose the method to use to compute the amount of depreciation lines.\n"\
|
||||
" * Linear: Calculated on basis of: Gross Value / Number of Depreciations\n" \
|
||||
" * Degressive: Calculated on basis of: Residual Value * Degressive Factor"),
|
||||
'method_number': fields.integer('Number of Depreciations', readonly=True, states={'draft':[('readonly',False)]}, help="The number of depreciations needed to depreciate your asset"),
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<field name="method_end" attrs="{'required': [('method_time','=','end')], 'invisible':[('method_time','=','number')]}"/>
|
||||
</group>
|
||||
<group string="Depreciation Method">
|
||||
<field name="method"/>
|
||||
<field name="method" widget="radio"/>
|
||||
<field name="method_progress_factor" attrs="{'invisible':[('method','=','linear')], 'required':[('method','=','degressive')]}"/>
|
||||
<field name="prorata"/>
|
||||
<field name="open_asset"/>
|
||||
@@ -116,7 +116,7 @@
|
||||
<field name="partner_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="method"/>
|
||||
<field name="method" widget="radio"/>
|
||||
<field name="method_progress_factor" attrs="{'invisible':[('method','=','linear')], 'required':[('method','=','degressive')]}"/>
|
||||
<label for="method_time"/>
|
||||
<div>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
import account_bank_statement_import
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,20 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
{
|
||||
'name': 'Account Bank Statement Import',
|
||||
'version': '1.0',
|
||||
'author': 'OpenERP SA',
|
||||
'depends': ['account'],
|
||||
'demo': [],
|
||||
'description' : """Generic Wizard to Import Bank Statements. Includes the import of files in .OFX format""",
|
||||
'data' : [
|
||||
'account_bank_statement_import_view.xml',
|
||||
],
|
||||
'demo': [
|
||||
'demo/fiscalyear_period.xml',
|
||||
'demo/partner_bank.xml',
|
||||
],
|
||||
'auto_install': False,
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,96 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
import logging
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
_IMPORT_FILE_TYPE = [('none', _('No Import Format Available'))]
|
||||
|
||||
def add_file_type(selection_value):
|
||||
global _IMPORT_FILE_TYPE
|
||||
if _IMPORT_FILE_TYPE[0][0] == 'none':
|
||||
_IMPORT_FILE_TYPE = [selection_value]
|
||||
else:
|
||||
_IMPORT_FILE_TYPE.append(selection_value)
|
||||
|
||||
class account_bank_statement_import(osv.TransientModel):
|
||||
_name = 'account.bank.statement.import'
|
||||
_description = 'Import Bank Statement'
|
||||
|
||||
def _get_import_file_type(self, cr, uid, context=None):
|
||||
return _IMPORT_FILE_TYPE
|
||||
|
||||
_columns = {
|
||||
'data_file': fields.binary('Bank Statement File', required=True, help='Get you bank statements in electronic format from your bank and select them here.'),
|
||||
'file_type': fields.selection(_get_import_file_type, 'File Type', required=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True, help="The journal for which the bank statements will be created"),
|
||||
}
|
||||
|
||||
def _get_first_file_type(self, cr, uid, context=None):
|
||||
return self._get_import_file_type(cr, uid, context=context)[0][0]
|
||||
|
||||
def _get_default_journal(self, cr, uid, context=None):
|
||||
company_id = self.pool.get('res.company')._company_default_get(cr, uid, 'account.bank.statement', context=context)
|
||||
journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'bank'), ('company_id', '=', company_id)], context=context)
|
||||
return journal_ids and journal_ids[0] or False
|
||||
|
||||
_defaults = {
|
||||
'file_type': _get_first_file_type,
|
||||
'journal_id': _get_default_journal,
|
||||
}
|
||||
|
||||
def _detect_partner(self, cr, uid, identifying_string, identifying_field='acc_number', context=None):
|
||||
"""Try to find a bank account and its related partner for the given 'identifying_string', looking on the field 'identifying_field'.
|
||||
|
||||
:param identifying_string: varchar
|
||||
:param identifying_field: varchar corresponding to the name of a field of res.partner.bank
|
||||
:returns: tuple(ID of the bank account found or False, ID of the partner for the bank account found or False)
|
||||
"""
|
||||
partner_id = False
|
||||
bank_account_id = False
|
||||
if identifying_string:
|
||||
ids = self.pool.get('res.partner.bank').search(cr, uid, [(identifying_field, '=', identifying_string)], context=context)
|
||||
if ids:
|
||||
bank_account_id = ids[0]
|
||||
partner_id = self.pool.get('res.partner.bank').browse(cr, uid, bank_account_id, context=context).partner_id.id
|
||||
else:
|
||||
#create the bank account, not linked to any partner. The reconciliation will link the partner manually
|
||||
#chosen at the bank statement final confirmation time.
|
||||
try:
|
||||
type_model, type_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'bank_normal')
|
||||
type_id = self.pool.get('res.partner.bank.type').browse(cr, uid, type_id, context=context)
|
||||
bank_code = type_id.code
|
||||
except ValueError:
|
||||
bank_code = 'bank'
|
||||
acc_number = identifying_field == 'acc_number' and identifying_string or _('Undefined')
|
||||
bank_account_vals = {
|
||||
'acc_number': acc_number,
|
||||
'state': bank_code,
|
||||
}
|
||||
bank_account_vals[identifying_field] = identifying_string
|
||||
bank_account_id = self.pool.get('res.partner.bank').create(cr, uid, bank_account_vals, context=context)
|
||||
return bank_account_id, partner_id
|
||||
|
||||
def import_bank_statement(self, cr, uid, bank_statement_vals=False, context=None):
|
||||
""" Get a list of values to pass to the create() of account.bank.statement object, and returns a list of ID created using those values"""
|
||||
statement_ids = []
|
||||
for vals in bank_statement_vals:
|
||||
statement_ids.append(self.pool.get('account.bank.statement').create(cr, uid, vals, context=context))
|
||||
return statement_ids
|
||||
|
||||
def process_none(self, cr, uid, data_file, journal_id=False, context=None):
|
||||
raise osv.except_osv(_('Error'), _('No available format for importing bank statement. You can install one of the file format available through the module installation.'))
|
||||
|
||||
def parse_file(self, cr, uid, ids, context=None):
|
||||
""" Process the file chosen in the wizard and returns a list view of the imported bank statements"""
|
||||
data = self.browse(cr, uid, ids[0], context=context)
|
||||
vals = getattr(self, "process_%s" % data.file_type)(cr, uid, data.data_file, data.journal_id.id, context=context)
|
||||
statement_ids = self.import_bank_statement(cr, uid, vals, context=context)
|
||||
model, action_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'action_bank_statement_tree')
|
||||
action = self.pool[model].read(cr, uid, action_id, context=context)
|
||||
action['domain'] = "[('id', 'in', [" + ', '.join(map(str, statement_ids)) + "])]"
|
||||
return action
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="account_bank_statement_import_view" model="ir.ui.view">
|
||||
<field name="name">Import Bank Statements</field>
|
||||
<field name="model">account.bank.statement.import</field>
|
||||
<field name="priority">1</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Import Bank Statements" version="7.0">
|
||||
<group>
|
||||
<group>
|
||||
<field name="data_file"/>
|
||||
<field name="file_type"/>
|
||||
<field name="journal_id" domain="[('type', '=', 'bank')]" context="{'default_type':'bank'}"/>
|
||||
</group>
|
||||
<group>
|
||||
<b colspan="2"> How to import your bank statement in OpenERP.</b>
|
||||
<label string= "1. Go to your bank account website." colspan="2"/>
|
||||
<label string= "2. Download your bank statements in the right format. (.OFX, .QIF or CODA are accepted)" colspan="2"/>
|
||||
<label string= "3. Upload right here the bank statements file into OpenERP. Click Import." colspan="2"/>
|
||||
</group>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="parse_file" string="_Import" type="object" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_bank_statement_import" model="ir.actions.act_window">
|
||||
<field name="name">Import Bank Statements</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.bank.statement.import</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="view_id" ref="account_bank_statement_import_view"/>
|
||||
</record>
|
||||
|
||||
<menuitem parent="account.menu_finance_bank_and_cash" id="menu_account_bank_statement_import" action="action_account_bank_statement_import" sequence="11"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!--
|
||||
Fiscal year
|
||||
-->
|
||||
|
||||
<record id="data_fiscalyear_2013" model="account.fiscalyear">
|
||||
<field eval="'Fiscal Year X 2013'" name="name"/>
|
||||
<field eval="'FY2013'" name="code"/>
|
||||
<field eval="'2013-01-01'" name="date_start"/>
|
||||
<field eval="'2013-12-31'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Fiscal Periods 2013
|
||||
-->
|
||||
|
||||
<record id="period_1_2013" model="account.period">
|
||||
<field eval="'01/2013'" name="code"/>
|
||||
<field eval="'X 01/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-01-01'" name="date_start"/>
|
||||
<field eval="'2013-01-31'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record id="period_2_2013" model="account.period">
|
||||
<field eval="'02/2013'" name="code"/>
|
||||
<field eval="'X 02/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-02-01'" name="date_start"/>
|
||||
<field eval="'2013-02-28'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="period_3_2013" model="account.period">
|
||||
<field eval="'03/2013'" name="code"/>
|
||||
<field eval="'X 03/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-03-01'" name="date_start"/>
|
||||
<field eval="'2013-03-31'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="period_4_2013" model="account.period">
|
||||
<field eval="'04/2013'" name="code"/>
|
||||
<field eval="'X 04/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-04-01'" name="date_start"/>
|
||||
<field eval="'2013-04-30'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="period_5_2013" model="account.period">
|
||||
<field eval="'05/2013'" name="code"/>
|
||||
<field eval="'X 05/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-05-01'" name="date_start"/>
|
||||
<field eval="'2013-05-31'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="period_6_2013" model="account.period">
|
||||
<field eval="'06/2013'" name="code"/>
|
||||
<field eval="'X 06/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-06-01'" name="date_start"/>
|
||||
<field eval="'2013-06-30'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="period_7_2013" model="account.period">
|
||||
<field eval="'07/2013'" name="code"/>
|
||||
<field eval="'X 07/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-07-01'" name="date_start"/>
|
||||
<field eval="'2013-07-31'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="period_8_2013" model="account.period">
|
||||
<field eval="'08/2013'" name="code"/>
|
||||
<field eval="'X 08/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-08-01'" name="date_start"/>
|
||||
<field eval="'2013-08-31'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="period_9_2013" model="account.period">
|
||||
<field eval="'09/2013'" name="code"/>
|
||||
<field eval="'X 09/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-09-01'" name="date_start"/>
|
||||
<field eval="'2013-09-30'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="period_10_2013" model="account.period">
|
||||
<field eval="'10/2013'" name="code"/>
|
||||
<field eval="'X 10/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-10-01'" name="date_start"/>
|
||||
<field eval="'2013-10-31'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="period_11_2013" model="account.period">
|
||||
<field eval="'11/2013'" name="code"/>
|
||||
<field eval="'X 11/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-11-01'" name="date_start"/>
|
||||
<field eval="'2013-11-30'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
<record id="period_12_2013" model="account.period">
|
||||
<field eval="'12/2013'" name="code"/>
|
||||
<field eval="'X 12/2013'" name="name"/>
|
||||
<field name="fiscalyear_id" ref="data_fiscalyear_2013"/>
|
||||
<field eval="'2013-12-01'" name="date_start"/>
|
||||
<field eval="'2013-12-31'" name="date_stop"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="ofx_partner_bank_1" model="res.partner.bank">
|
||||
<field name="owner_name">Agrolait</field>
|
||||
<field name="acc_number">00987654321</field>
|
||||
<field name="partner_id" ref="base.res_partner_2"></field>
|
||||
<field name="state">bank</field>
|
||||
<field name="bank" ref="base.res_bank_1"/>
|
||||
</record>
|
||||
|
||||
<record id="ofx_partner_bank_2" model="res.partner.bank">
|
||||
<field name="owner_name">China Export</field>
|
||||
<field name="acc_number">00987654322</field>
|
||||
<field name="partner_id" ref="base.res_partner_3"></field>
|
||||
<field name="state">bank</field>
|
||||
<field name="bank" ref="base.res_bank_1"/>
|
||||
</record>
|
||||
|
||||
<record id="qif_partner_bank_1" model="res.partner.bank">
|
||||
<field name="owner_name">Delta PC</field>
|
||||
<field name="acc_number">10987654320</field>
|
||||
<field name="partner_id" ref="base.res_partner_4"></field>
|
||||
<field name="state">bank</field>
|
||||
<field name="bank" ref="base.res_bank_1"/>
|
||||
</record>
|
||||
|
||||
<record id="qif_partner_bank_2" model="res.partner.bank">
|
||||
<field name="owner_name">Epic Technologies</field>
|
||||
<field name="acc_number">10987654322</field>
|
||||
<field name="partner_id" ref="base.res_partner_5"></field>
|
||||
<field name="state">bank</field>
|
||||
<field name="bank" ref="base.res_bank_1"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
import account_bank_statement_import_ofx
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,25 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
{
|
||||
'name': 'Import OFX Bank Statement',
|
||||
'version': '1.0',
|
||||
'author': 'OpenERP SA',
|
||||
'depends': ['account_bank_statement_import'],
|
||||
'demo': [],
|
||||
'description' : """
|
||||
Module to import OFX bank statements.
|
||||
======================================
|
||||
|
||||
This module allows you to import the machine readable OFX Files in Odoo: they are parsed and stored in human readable format in
|
||||
Accounting \ Bank and Cash \ Bank Statements.
|
||||
|
||||
Bank Statements may be generated containing a subset of the OFX information (only those transaction lines that are required for the
|
||||
creation of the Financial Accounting records).
|
||||
|
||||
""",
|
||||
'data' : [],
|
||||
'demo': [],
|
||||
'auto_install': False,
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,74 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import logging
|
||||
import base64
|
||||
import os
|
||||
|
||||
from openerp.osv import osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
from openerp.addons.account_bank_statement_import import account_bank_statement_import as ibs
|
||||
ibs.add_file_type(('ofx', 'OFX'))
|
||||
|
||||
try:
|
||||
from ofxparse import OfxParser as ofxparser
|
||||
except ImportError:
|
||||
_logger.warning("OFX parser unavailable because the `ofxparse` Python library cannot be found."
|
||||
"It can be downloaded and installed from `https://pypi.python.org/pypi/ofxparse`.")
|
||||
ofxparser = None
|
||||
|
||||
class account_bank_statement_import(osv.TransientModel):
|
||||
_inherit = 'account.bank.statement.import'
|
||||
|
||||
def process_ofx(self, cr, uid, data_file, journal_id=False, context=None):
|
||||
""" Import a file in the .OFX format"""
|
||||
if ofxparser is None:
|
||||
raise osv.except_osv(_("Error"), _("OFX parser unavailable because the `ofxparse` Python library cannot be found."
|
||||
"It can be downloaded and installed from `https://pypi.python.org/pypi/ofxparse`."))
|
||||
try:
|
||||
tempfile = open("temp.ofx", "w+")
|
||||
tempfile.write(base64.decodestring(data_file))
|
||||
tempfile.read()
|
||||
pathname = os.path.dirname('temp.ofx')
|
||||
path = os.path.join(os.path.abspath(pathname), 'temp.ofx')
|
||||
ofx = ofxparser.parse(file(path))
|
||||
except:
|
||||
raise osv.except_osv(_('Import Error!'), _('Please check OFX file format is proper or not.'))
|
||||
line_ids = []
|
||||
total_amt = 0.00
|
||||
try:
|
||||
for transaction in ofx.account.statement.transactions:
|
||||
bank_account_id, partner_id = self._detect_partner(cr, uid, transaction.payee, identifying_field='owner_name', context=context)
|
||||
vals_line = {
|
||||
'date': transaction.date,
|
||||
'name': transaction.payee + ': ' + transaction.memo,
|
||||
'ref': transaction.id,
|
||||
'amount': transaction.amount,
|
||||
'partner_id': partner_id,
|
||||
'bank_account_id': bank_account_id,
|
||||
}
|
||||
total_amt += float(transaction.amount)
|
||||
line_ids.append((0, 0, vals_line))
|
||||
except Exception, e:
|
||||
raise osv.except_osv(_('Error!'), _("Following problem has been occurred while importing your file, Please verify the file is proper or not.\n\n %s" % e.message))
|
||||
st_start_date = ofx.account.statement.start_date or False
|
||||
st_end_date = ofx.account.statement.end_date or False
|
||||
period_obj = self.pool.get('account.period')
|
||||
if st_end_date:
|
||||
period_ids = period_obj.find(cr, uid, st_end_date, context=context)
|
||||
else:
|
||||
period_ids = period_obj.find(cr, uid, st_start_date, context=context)
|
||||
vals_bank_statement = {
|
||||
'name': ofx.account.routing_number,
|
||||
'balance_start': ofx.account.statement.balance,
|
||||
'balance_end_real': float(ofx.account.statement.balance) + total_amt,
|
||||
'period_id': period_ids and period_ids[0] or False,
|
||||
'journal_id': journal_id
|
||||
}
|
||||
vals_bank_statement.update({'line_ids': line_ids})
|
||||
os.remove(path)
|
||||
return [vals_bank_statement]
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="ASCII"?>
|
||||
<?OFX OFXHEADER="200" VERSION="211" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?>
|
||||
<OFX>
|
||||
<SIGNONMSGSRSV1>
|
||||
<SONRS>
|
||||
<STATUS>
|
||||
<CODE>0</CODE>
|
||||
<SEVERITY>INFO</SEVERITY>
|
||||
</STATUS>
|
||||
<DTSERVER>20130831165153.000[-8:PST]</DTSERVER>
|
||||
<LANGUAGE>ENG</LANGUAGE>
|
||||
</SONRS>
|
||||
</SIGNONMSGSRSV1>
|
||||
<BANKMSGSRSV1>
|
||||
<STMTTRNRS>
|
||||
<TRNUID>0</TRNUID>
|
||||
<STATUS>
|
||||
<CODE>0</CODE>
|
||||
<SEVERITY>INFO</SEVERITY>
|
||||
</STATUS>
|
||||
<STMTRS>
|
||||
<CURDEF>USD</CURDEF>
|
||||
<BANKACCTFROM>
|
||||
<BANKID>000000123</BANKID>
|
||||
<ACCTID>123456</ACCTID>
|
||||
<ACCTTYPE>CHECKING</ACCTTYPE>
|
||||
</BANKACCTFROM>
|
||||
<BANKTRANLIST>
|
||||
<DTSTART>20130801</DTSTART>
|
||||
<DTEND>20130831165153.000[-8:PST]</DTEND>
|
||||
<STMTTRN>
|
||||
<TRNTYPE>POS</TRNTYPE>
|
||||
<DTPOSTED>20130824080000</DTPOSTED>
|
||||
<TRNAMT>-80</TRNAMT>
|
||||
<FITID>219378</FITID>
|
||||
<NAME>Agrolait</NAME>
|
||||
</STMTTRN>
|
||||
</BANKTRANLIST>
|
||||
<BANKTRANLIST>
|
||||
<DTSTART>20130801</DTSTART>
|
||||
<DTEND>20130831165153.000[-8:PST]</DTEND>
|
||||
<STMTTRN>
|
||||
<TRNTYPE>POS</TRNTYPE>
|
||||
<DTPOSTED>20130824080000</DTPOSTED>
|
||||
<TRNAMT>-90</TRNAMT>
|
||||
<FITID>219379</FITID>
|
||||
<NAME>China Export</NAME>
|
||||
</STMTTRN>
|
||||
</BANKTRANLIST>
|
||||
<BANKTRANLIST>
|
||||
<DTSTART>20130801</DTSTART>
|
||||
<DTEND>20130831165153.000[-8:PST]</DTEND>
|
||||
<STMTTRN>
|
||||
<TRNTYPE>POS</TRNTYPE>
|
||||
<DTPOSTED>20130824080000</DTPOSTED>
|
||||
<TRNAMT>-100</TRNAMT>
|
||||
<FITID>219380</FITID>
|
||||
<NAME>Axelor Scuba</NAME>
|
||||
</STMTTRN>
|
||||
</BANKTRANLIST>
|
||||
<BANKTRANLIST>
|
||||
<DTSTART>20130801</DTSTART>
|
||||
<DTEND>20130831165153.000[-8:PST]</DTEND>
|
||||
<STMTTRN>
|
||||
<TRNTYPE>POS</TRNTYPE>
|
||||
<DTPOSTED>20130824080000</DTPOSTED>
|
||||
<TRNAMT>-90</TRNAMT>
|
||||
<FITID>219381</FITID>
|
||||
<NAME>China Scuba</NAME>
|
||||
</STMTTRN>
|
||||
</BANKTRANLIST>
|
||||
<LEDGERBAL>
|
||||
<BALAMT>2156.56</BALAMT>
|
||||
<DTASOF>20130831165153</DTASOF>
|
||||
</LEDGERBAL>
|
||||
</STMTRS>
|
||||
</STMTTRNRS>
|
||||
</BANKMSGSRSV1>
|
||||
<CREDITCARDMSGSRSV1>
|
||||
<CCSTMTTRNRS>
|
||||
<TRNUID>0</TRNUID>
|
||||
<STATUS>
|
||||
<CODE>0</CODE>
|
||||
<SEVERITY>INFO</SEVERITY>
|
||||
</STATUS>
|
||||
<CCSTMTRS>
|
||||
<CURDEF>USD</CURDEF>
|
||||
<CCACCTFROM>
|
||||
<ACCTID>123412341234</ACCTID>
|
||||
</CCACCTFROM>
|
||||
<BANKTRANLIST>
|
||||
</BANKTRANLIST>
|
||||
<LEDGERBAL>
|
||||
<BALAMT>-562.00</BALAMT>
|
||||
<DTASOF>20130831165153</DTASOF>
|
||||
</LEDGERBAL>
|
||||
</CCSTMTRS>
|
||||
</CCSTMTTRNRS>
|
||||
</CREDITCARDMSGSRSV1>
|
||||
</OFX>
|
||||
@@ -0,0 +1,5 @@
|
||||
from . import test_import_bank_statement
|
||||
|
||||
checks = [
|
||||
test_import_bank_statement
|
||||
]
|
||||
@@ -0,0 +1,30 @@
|
||||
from openerp.tests.common import TransactionCase
|
||||
from openerp.modules.module import get_module_resource
|
||||
|
||||
class TestOfxFile(TransactionCase):
|
||||
"""Tests for import bank statement ofx file format (account.bank.statement.import)
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
super(TestOfxFile, self).setUp()
|
||||
self.statement_import_model = self.registry('account.bank.statement.import')
|
||||
self.bank_statement_model = self.registry('account.bank.statement')
|
||||
|
||||
def test_ofx_file_import(self):
|
||||
try:
|
||||
from ofxparse import OfxParser as ofxparser
|
||||
except ImportError:
|
||||
#the Python library isn't installed on the server, the OFX import is unavailable and the test cannot be run
|
||||
return True
|
||||
cr, uid = self.cr, self.uid
|
||||
ofx_file_path = get_module_resource('account_bank_statement_import_ofx', 'test_ofx_file', 'test_ofx.ofx')
|
||||
ofx_file = open(ofx_file_path, 'rb').read().encode('base64')
|
||||
bank_statement_id = self.statement_import_model.create(cr, uid, dict(
|
||||
file_type='ofx',
|
||||
data_file=ofx_file,
|
||||
))
|
||||
self.statement_import_model.parse_file(cr, uid, [bank_statement_id])
|
||||
statement_id = self.bank_statement_model.search(cr, uid, [('name', '=', '000000123')])[0]
|
||||
bank_st_record = self.bank_statement_model.browse(cr, uid, statement_id)
|
||||
self.assertEquals(bank_st_record.balance_start, 2156.56)
|
||||
self.assertEquals(bank_st_record.balance_end_real, 1796.56)
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import account_bank_statement_import_qif
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
{
|
||||
'name': 'Import QIF Bank Statement',
|
||||
'version': '1.0',
|
||||
'author': 'OpenERP SA',
|
||||
'description': '''
|
||||
Module to import QIF bank statements.
|
||||
======================================
|
||||
|
||||
This module allows you to import the machine readable QIF Files in Odoo: they are parsed and stored in human readable format in
|
||||
Accounting \ Bank and Cash \ Bank Statements.
|
||||
|
||||
Bank Statements may be generated containing a subset of the QIF information (only those transaction lines that are required for the
|
||||
creation of the Financial Accounting records).
|
||||
''',
|
||||
'images' : [],
|
||||
'depends': ['account_bank_statement_import'],
|
||||
'demo': [],
|
||||
'data': [],
|
||||
'auto_install': False,
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,75 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import dateutil.parser
|
||||
import base64
|
||||
from tempfile import TemporaryFile
|
||||
|
||||
from openerp.tools.translate import _
|
||||
from openerp.osv import osv
|
||||
|
||||
from openerp.addons.account_bank_statement_import import account_bank_statement_import as ibs
|
||||
|
||||
ibs.add_file_type(('qif', 'QIF'))
|
||||
|
||||
class account_bank_statement_import(osv.TransientModel):
|
||||
_inherit = "account.bank.statement.import"
|
||||
|
||||
def process_qif(self, cr, uid, data_file, journal_id=False, context=None):
|
||||
""" Import a file in the .QIF format"""
|
||||
try:
|
||||
fileobj = TemporaryFile('wb+')
|
||||
fileobj.write(base64.b64decode(data_file))
|
||||
fileobj.seek(0)
|
||||
file_data = ""
|
||||
for line in fileobj.readlines():
|
||||
file_data += line
|
||||
fileobj.close()
|
||||
if '\r' in file_data:
|
||||
data_list = file_data.split('\r')
|
||||
else:
|
||||
data_list = file_data.split('\n')
|
||||
header = data_list[0].strip()
|
||||
header = header.split(":")[1]
|
||||
except:
|
||||
raise osv.except_osv(_('Import Error!'), _('Please check QIF file format is proper or not.'))
|
||||
line_ids = []
|
||||
vals_line = {}
|
||||
total = 0
|
||||
if header == "Bank":
|
||||
vals_bank_statement = {}
|
||||
for line in data_list:
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
if line[0] == 'D': # date of transaction
|
||||
vals_line['date'] = dateutil.parser.parse(line[1:], fuzzy=True).date()
|
||||
if vals_line.get('date') and not vals_bank_statement.get('period_id'):
|
||||
period_ids = self.pool.get('account.period').find(cr, uid, vals_line['date'], context=context)
|
||||
vals_bank_statement.update({'period_id': period_ids and period_ids[0] or False})
|
||||
elif line[0] == 'T': # Total amount
|
||||
total += float(line[1:].replace(',', ''))
|
||||
vals_line['amount'] = float(line[1:].replace(',', ''))
|
||||
elif line[0] == 'N': # Check number
|
||||
vals_line['ref'] = line[1:]
|
||||
elif line[0] == 'P': # Payee
|
||||
bank_account_id, partner_id = self._detect_partner(cr, uid, line[1:], identifying_field='owner_name', context=context)
|
||||
vals_line['partner_id'] = partner_id
|
||||
vals_line['bank_account_id'] = bank_account_id
|
||||
vals_line['name'] = 'name' in vals_line and line[1:] + ': ' + vals_line['name'] or line[1:]
|
||||
elif line[0] == 'M': # Memo
|
||||
vals_line['name'] = 'name' in vals_line and vals_line['name'] + ': ' + line[1:] or line[1:]
|
||||
elif line[0] == '^': # end of item
|
||||
line_ids.append((0, 0, vals_line))
|
||||
vals_line = {}
|
||||
elif line[0] == '\n':
|
||||
line_ids = []
|
||||
else:
|
||||
pass
|
||||
else:
|
||||
raise osv.except_osv(_('Error!'), _('Cannot support this Format !Type:%s.') % (header,))
|
||||
vals_bank_statement.update({'balance_end_real': total,
|
||||
'line_ids': line_ids,
|
||||
'journal_id': journal_id})
|
||||
return [vals_bank_statement]
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,21 @@
|
||||
!Type:Bank
|
||||
D8/12/13
|
||||
T-1,000.00
|
||||
PDelta PC
|
||||
^
|
||||
D8/15/13
|
||||
T-75.46
|
||||
PWalts Drugs
|
||||
^
|
||||
D3/3/13
|
||||
T-379.00
|
||||
PEpic Technologies
|
||||
^
|
||||
D3/4/13
|
||||
T-20.28
|
||||
PYOUR LOCAL SUPERMARKET
|
||||
^
|
||||
D3/3/13
|
||||
T-421.35
|
||||
PSPRINGFIELD WATER UTILITY
|
||||
^
|
||||
@@ -0,0 +1,5 @@
|
||||
from . import test_import_bank_statement
|
||||
checks = [
|
||||
test_import_bank_statement
|
||||
]
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
from openerp.tests.common import TransactionCase
|
||||
from openerp.modules.module import get_module_resource
|
||||
|
||||
class TestQifFile(TransactionCase):
|
||||
"""Tests for import bank statement qif file format (account.bank.statement.import)
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
super(TestQifFile, self).setUp()
|
||||
self.statement_import_model = self.registry('account.bank.statement.import')
|
||||
self.bank_statement_model = self.registry('account.bank.statement')
|
||||
self.bank_statement_line_model = self.registry('account.bank.statement.line')
|
||||
|
||||
def test_qif_file_import(self):
|
||||
from openerp.tools import float_compare
|
||||
cr, uid = self.cr, self.uid
|
||||
qif_file_path = get_module_resource('account_bank_statement_import_qif', 'test_qif_file', 'test_qif.qif')
|
||||
qif_file = open(qif_file_path, 'rb').read().encode('base64')
|
||||
bank_statement_id = self.statement_import_model.create(cr, uid, dict(
|
||||
file_type='qif',
|
||||
data_file=qif_file,
|
||||
))
|
||||
self.statement_import_model.parse_file(cr, uid, [bank_statement_id])
|
||||
line_id = self.bank_statement_line_model.search(cr, uid, [('name', '=', 'YOUR LOCAL SUPERMARKET')])[0]
|
||||
statement_id = self.bank_statement_line_model.browse(cr, uid, line_id).statement_id.id
|
||||
bank_st_record = self.bank_statement_model.browse(cr, uid, statement_id)
|
||||
assert float_compare(bank_st_record.balance_end_real, -1896.09, 2) == 0
|
||||
@@ -42,7 +42,7 @@
|
||||
<!-- Budget lines -->
|
||||
<data noupdate="1">
|
||||
<record id="crossovered_budget_lines_0" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_consultancy"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_consultancy"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-01-01'" name="date_from"/>
|
||||
<field eval="-500.0" name="planned_amount"/>
|
||||
@@ -50,7 +50,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-01-31'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_1" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_consultancy"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_consultancy"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-02-01'" name="date_from"/>
|
||||
<field eval="-250.0" name="planned_amount"/>
|
||||
@@ -58,7 +58,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-02-28'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_2" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_consultancy"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_consultancy"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_sales0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-01-01'" name="date_from"/>
|
||||
<field eval="500.0" name="planned_amount"/>
|
||||
@@ -66,7 +66,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-01-31'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_3" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_consultancy"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_consultancy"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_sales0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-02-07'" name="date_from"/>
|
||||
<field eval="900.0" name="planned_amount"/>
|
||||
@@ -74,7 +74,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-02-28'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_4" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_consultancy"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_consultancy"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_sales0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-03-01'" name="date_from"/>
|
||||
<field eval="300.0" name="planned_amount"/>
|
||||
@@ -84,7 +84,7 @@
|
||||
</data>
|
||||
<data noupdate="1">
|
||||
<record id="crossovered_budget_lines_5" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_super_product_trainings"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_super_product_trainings"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_sales0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-03-16'" name="date_from"/>
|
||||
<field eval="375.0" name="planned_amount"/>
|
||||
@@ -93,7 +93,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-03-31'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_6" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_super_product_trainings"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_super_product_trainings"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-04-01'" name="date_from"/>
|
||||
<field eval="-150.0" name="planned_amount"/>
|
||||
@@ -101,7 +101,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-04-30'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_7" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_super_product_trainings"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_super_product_trainings"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_sales0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-05-01'" name="date_from"/>
|
||||
<field eval="375.0" name="planned_amount"/>
|
||||
@@ -112,7 +112,7 @@
|
||||
</data>
|
||||
<data noupdate="1">
|
||||
<record id="crossovered_budget_lines_8" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_seagate_p1"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-06-01'" name="date_from"/>
|
||||
<field eval="-7500.0" name="planned_amount"/>
|
||||
@@ -120,7 +120,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-06-15'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_9" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_seagate_p1"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-06-16'" name="date_from"/>
|
||||
<field eval="-5000.0" name="planned_amount"/>
|
||||
@@ -128,7 +128,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-06-30'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_10" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_seagate_p1"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-07-01'" name="date_from"/>
|
||||
<field eval="-2000.0" name="planned_amount"/>
|
||||
@@ -136,7 +136,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-07-15'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_11" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_seagate_p1"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_sales0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-07-16'" name="date_from"/>
|
||||
<field eval="20000.0" name="planned_amount"/>
|
||||
@@ -144,7 +144,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-07-31'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_12" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_seagate_p1"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_seagate_p1"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_sales0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-08-01'" name="date_from"/>
|
||||
<field eval="20000.0" name="planned_amount"/>
|
||||
@@ -154,7 +154,7 @@
|
||||
</data>
|
||||
<data noupdate="1">
|
||||
<record id="crossovered_budget_lines_13" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_seagate_p2"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-08-16'" name="date_from"/>
|
||||
<field eval="-3000.0" name="planned_amount"/>
|
||||
@@ -162,7 +162,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-08-31'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_14" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_seagate_p2"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_purchase0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-09-01'" name="date_from"/>
|
||||
<field eval="-1000.0" name="planned_amount"/>
|
||||
@@ -170,7 +170,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-09-15'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_15" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_seagate_p2"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_sales0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-09-16'" name="date_from"/>
|
||||
<field eval="10000.0" name="planned_amount"/>
|
||||
@@ -178,7 +178,7 @@
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-09-30'" name="date_to"/>
|
||||
</record>
|
||||
<record id="crossovered_budget_lines_16" model="crossovered.budget.lines">
|
||||
<field name="analytic_account_id" ref="account.analytic_seagate_p2"/>
|
||||
<field name="analytic_account_id" ref="analytic.analytic_seagate_p2"/>
|
||||
<field name="general_budget_id" ref="account_budget_post_sales0"/>
|
||||
<field eval="str(time.localtime(time.time())[0]+1)+'-10-01'" name="date_from"/>
|
||||
<field eval="10000.0" name="planned_amount"/>
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
-
|
||||
!record {model: crossovered.budget, id: crossovered_budget_budget0}:
|
||||
crossovered_budget_line:
|
||||
- analytic_account_id: account.analytic_consultancy
|
||||
- analytic_account_id: analytic.analytic_consultancy
|
||||
date_from: !eval "'%s-01-01' %(datetime.now().year+1)"
|
||||
date_to: !eval "'%s-12-31' %(datetime.now().year+1)"
|
||||
general_budget_id: account_budget.account_budget_post_purchase0
|
||||
planned_amount: 10000.0
|
||||
- analytic_account_id: account.analytic_super_product_trainings
|
||||
- analytic_account_id: analytic.analytic_super_product_trainings
|
||||
date_from: !eval "'%s-09-01' %(datetime.now().year+1)"
|
||||
date_to: !eval "'%s-09-30' %(datetime.now().year+1)"
|
||||
general_budget_id: account_budget.account_budget_post_sales0
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Print the Analytic Budget Report through wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx = {'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}
|
||||
ctx = {'model': 'account.analytic.account','active_ids': [ref('analytic.analytic_root')]}
|
||||
from openerp.tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data={}, context=ctx, our_module='account_budget')
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</p><p>
|
||||
The check payment form allows you to track the payment you do
|
||||
to your suppliers using checks. When you select a supplier, the
|
||||
payment method and an amount for the payment, OpenERP will
|
||||
payment method and an amount for the payment, Odoo will
|
||||
propose to reconcile your payment with the open supplier
|
||||
invoices or bills.
|
||||
</p>
|
||||
|
||||
@@ -31,7 +31,7 @@ class account_sequence_installer(osv.osv_memory):
|
||||
'suffix': fields.char('Suffix', size=64, help="Suffix value of the record for the sequence"),
|
||||
'number_next': fields.integer('Next Number', required=True, help="Next number of this sequence"),
|
||||
'number_increment': fields.integer('Increment Number', required=True, help="The next number of the sequence will be incremented by this number"),
|
||||
'padding' : fields.integer('Number padding', required=True, help="OpenERP will automatically adds some '0' on the left of the 'Next Number' to get the required padding size."),
|
||||
'padding' : fields.integer('Number padding', required=True, help="Odoo will automatically adds some '0' on the left of the 'Next Number' to get the required padding size."),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
}
|
||||
_defaults = {
|
||||
|
||||
@@ -378,8 +378,8 @@ class account_voucher(osv.osv):
|
||||
'pre_line':fields.boolean('Previous Payments ?', required=False),
|
||||
'date_due': fields.date('Due Date', readonly=True, select=True, states={'draft':[('readonly',False)]}),
|
||||
'payment_option':fields.selection([
|
||||
('without_writeoff', 'Keep Open'),
|
||||
('with_writeoff', 'Reconcile Payment Balance'),
|
||||
('without_writeoff', 'Keep it open'),
|
||||
('with_writeoff', 'Reconcile payment balance'),
|
||||
], 'Payment Difference', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="This field helps you to choose what you want to do with the eventual difference between the paid amount and the sum of allocated amounts. You can either choose to keep open this difference on the partner's account, or reconcile it with the payment(s)"),
|
||||
'writeoff_acc_id': fields.many2one('account.account', 'Counterpart Account', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'comment': fields.char('Counterpart Comment', required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
@@ -946,6 +946,8 @@ class account_voucher(osv.osv):
|
||||
# refresh to make sure you don't unlink an already removed move
|
||||
voucher.refresh()
|
||||
for line in voucher.move_ids:
|
||||
# refresh to make sure you don't unreconcile an already unreconciled entry
|
||||
line.refresh()
|
||||
if line.reconcile_id:
|
||||
move_lines = [move_line.id for move_line in line.reconcile_id.line_id]
|
||||
move_lines.remove(line.id)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="type">notification</field>
|
||||
<field name="subtype_id" ref="mail.mt_comment"/>
|
||||
<field name="subject">eInvoicing & Payments application installed!</field>
|
||||
<field name="body"><![CDATA[<p>OpenERP's electronic invoicing accelerates the creation of invoices and collection of customer payments. Invoices are created in a few clicks and your customers receive them by email. They can pay online and/or import them in their own system.</p>
|
||||
<field name="body"><![CDATA[<p>Odoo's electronic invoicing accelerates the creation of invoices and collection of customer payments. Invoices are created in a few clicks and your customers receive them by email. They can pay online and/or import them in their own system.</p>
|
||||
<p>You can track customer payments easily and automate follow-ups. You get an overview of the discussion with your customers on each invoice for easier traceability. For advanced accounting features, you should install the "Accounting and Finance" module.</p>]]></field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -28,11 +28,6 @@ class sale_receipt_report(osv.osv):
|
||||
_rec_name = 'date'
|
||||
_columns = {
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'month': fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
|
||||
@@ -69,9 +64,6 @@ class sale_receipt_report(osv.osv):
|
||||
create or replace view sale_receipt_report as (
|
||||
select min(avl.id) as id,
|
||||
av.date as date,
|
||||
to_char(av.date, 'YYYY') as year,
|
||||
to_char(av.date, 'MM') as month,
|
||||
to_char(av.date, 'YYYY-MM-DD') as day,
|
||||
av.partner_id as partner_id,
|
||||
aj.currency as currency_id,
|
||||
av.journal_id as journal_id,
|
||||
@@ -107,9 +99,6 @@ class sale_receipt_report(osv.osv):
|
||||
group by
|
||||
av.date,
|
||||
av.id,
|
||||
to_char(av.date, 'YYYY'),
|
||||
to_char(av.date, 'MM'),
|
||||
to_char(av.date, 'YYYY-MM-DD'),
|
||||
av.partner_id,
|
||||
aj.currency,
|
||||
av.journal_id,
|
||||
|
||||
@@ -1,34 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- <record id="view_sale_receipt_report_tree" model="ir.ui.view">
|
||||
<field name="name">sale.receipt.report.tree</field>
|
||||
<field name="model">sale.receipt.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state == 'draft';gray:state in ('cancel','paid');black:state in ('proforma','proforma2')" create="false" string="Sales Receipts Analysis">
|
||||
<field name="date" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="date_due" invisible="1"/>
|
||||
<field name="account_id" invisible="1"/>
|
||||
<field name="nbr" sum="# of Voucher Lines"/>
|
||||
<field name="price_total" sum="Total Without Tax"/>
|
||||
<field name="price_total_tax" sum="Total With Tax"/>
|
||||
<field name="due_delay" sum="Avg. Due Delay"/>
|
||||
<field name="delay_to_pay" sum="Avg. Delay To Pay"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
-->
|
||||
|
||||
<record id="view_sale_receipt_report_graph" model="ir.ui.view">
|
||||
<field name="name">sale.receipt.report.graph</field>
|
||||
<field name="model">sale.receipt.report</field>
|
||||
@@ -65,9 +38,7 @@
|
||||
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Due Month" icon="terp-go-today" context="{'group_by':'date_due'}"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<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"/>
|
||||
<filter string="Invoice Date" name="month" icon="terp-go-month" context="{'group_by':'date'}" help="Group by month of Invoice Date"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -112,7 +112,7 @@ material. Define recurrencies to produce recurring invoice automatically.
|
||||
<div class="oe_span6">
|
||||
<div class="oe_quote">
|
||||
<q>
|
||||
OpenERP allowed us to automate sending 10.000 invoices per month.
|
||||
Odoo allowed us to automate sending 10.000 invoices per month.
|
||||
</q>
|
||||
<cite class="oe_cite oe_clearfix">
|
||||
<img class="oe_photo" src="bazile.png">
|
||||
@@ -124,7 +124,7 @@ material. Define recurrencies to produce recurring invoice automatically.
|
||||
<div class="oe_span6">
|
||||
<div class="oe_quote">
|
||||
<q>
|
||||
We have found invoicing module of OpenERP to be user
|
||||
We have found invoicing module of Odoo to be user
|
||||
friendly and highly customizable.
|
||||
</q>
|
||||
<cite class="oe_cite oe_clearfix">
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
name: Bank Journal(USD)
|
||||
code: BUSD
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account_cash_usd_id
|
||||
default_credit_account_id: account_cash_usd_id
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
name: Bank Journal(USD)
|
||||
code: BUSD
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account_cash_usd_id
|
||||
default_credit_account_id: account_cash_usd_id
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
name: Bank Journal(EUR)
|
||||
code: BEUR
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account.cash
|
||||
default_credit_account_id: account.cash
|
||||
@@ -66,7 +66,7 @@
|
||||
name: Bank Journal(USD)
|
||||
code: BUSD
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account_cash_usd_id
|
||||
default_credit_account_id: account_cash_usd_id
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
name: Bank Journal(EUR)
|
||||
code: BEUR
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account.cash
|
||||
default_credit_account_id: account.cash
|
||||
@@ -66,7 +66,7 @@
|
||||
name: Bank Journal(USD)
|
||||
code: BUSD
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account_cash_usd_id
|
||||
default_credit_account_id: account_cash_usd_id
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
name: Bank Journal(EUR)
|
||||
code: BEUR
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account.cash
|
||||
default_credit_account_id: account.cash
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
name: Bank Journal(CHF)
|
||||
code: BCHF
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account_cash_chf_id
|
||||
default_credit_account_id: account_cash_chf_id
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
name: Bank Journal(EUR)
|
||||
code: BEUR
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account.cash
|
||||
default_credit_account_id: account.cash
|
||||
@@ -53,7 +53,7 @@
|
||||
name: Bank Journal(USD)
|
||||
code: BUSD
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account_cash_usd_id2
|
||||
default_credit_account_id: account_cash_usd_id2
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
name: Bank Journal Test(USD)
|
||||
code: BEUSD
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
analytic_journal_id: analytic.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
default_debit_account_id: account_eur_usd_id
|
||||
default_credit_account_id: account_eur_usd_id
|
||||
|
||||
@@ -211,13 +211,15 @@
|
||||
<group col="2">
|
||||
<separator string="Payment Options" colspan="2"/>
|
||||
<field name="writeoff_amount" widget='monetary' options='{"currency_field": "currency_id"}'/>
|
||||
<field name="payment_option" required="1"/>
|
||||
<label for="payment_option" string="Difference of payment amount" class="oe_inline"/>
|
||||
<field name="payment_option" widget="radio" required="1" nolabel="1"/>
|
||||
<field name="writeoff_acc_id"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
|
||||
domain="[('type','=','other')]"/>
|
||||
<field name="comment"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
|
||||
<field name="analytic_id"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"
|
||||
groups="analytic.group_analytic_accounting"/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -270,7 +272,7 @@
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new supplier payment.
|
||||
</p><p>
|
||||
OpenERP helps you easily track payments you make and the remaining balances you need to pay your suppliers.
|
||||
Odoo helps you easily track payments you make and the remaining balances you need to pay your suppliers.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -495,7 +497,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="writeoff_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="payment_option" required="1" attrs="{'invisible':[('writeoff_amount','=',0)]}"/>
|
||||
<field name="payment_option" required="1" widget="radio" attrs="{'invisible':[('writeoff_amount','=',0)]}"/>
|
||||
<field name="writeoff_acc_id"
|
||||
attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)], 'required':[('payment_option','=','with_writeoff')]}"
|
||||
domain="[('type','=','other')]"/>
|
||||
@@ -554,7 +556,7 @@
|
||||
Click to register a new payment.
|
||||
</p><p>
|
||||
Enter the customer and the payment method and then, either
|
||||
create manually a payment record or OpenERP will propose to you
|
||||
create manually a payment record or Odoo will propose to you
|
||||
automatically the reconciliation of this payment with the open
|
||||
invoices or sales receipts.
|
||||
</p>
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import analytic
|
||||
import models
|
||||
import report
|
||||
import wizard
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -37,11 +37,26 @@ that have no counterpart in the general financial accounts.
|
||||
'data': [
|
||||
'security/analytic_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'analytic_sequence.xml',
|
||||
'analytic_view.xml',
|
||||
'analytic_data.xml',
|
||||
'data/analytic_sequence.xml',
|
||||
'views/analytic_view.xml',
|
||||
'data/analytic_data.xml',
|
||||
'analytic_report.xml',
|
||||
'wizard/account_analytic_balance_report_view.xml',
|
||||
'wizard/account_analytic_cost_ledger_view.xml',
|
||||
'wizard/account_analytic_inverted_balance_report.xml',
|
||||
'wizard/account_analytic_journal_report_view.xml',
|
||||
'wizard/account_analytic_cost_ledger_for_journal_report_view.xml',
|
||||
'wizard/account_analytic_chart_view.xml',
|
||||
'views/report_analyticbalance.xml',
|
||||
'views/report_analyticjournal.xml',
|
||||
'views/report_analyticcostledgerquantity.xml',
|
||||
'views/report_analyticcostledger.xml',
|
||||
'views/report_invertedanalyticbalance.xml',
|
||||
],
|
||||
'demo': [
|
||||
'data/analytic_demo.xml',
|
||||
'data/analytic_account_demo.xml',
|
||||
],
|
||||
'demo': [],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_account_analytic_account_form" model="ir.ui.view">
|
||||
<field name="name">analytic.analytic.account.form</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Analytic Account">
|
||||
<sheet string="Analytic Account">
|
||||
<div class="oe_right oe_button_box" name="buttons">
|
||||
</div>
|
||||
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1>
|
||||
<field name="name" class="oe_inline"/>
|
||||
</h1>
|
||||
<div name="project"/>
|
||||
</div>
|
||||
|
||||
<group name="main">
|
||||
<group>
|
||||
<field name="partner_id" on_change="on_change_partner_id(partner_id, name)"/>
|
||||
<field name="manager_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_manager']}"/>
|
||||
<field name="currency_id" attrs="{'invisible': ['|',('type', '<>', 'view'), ('company_id', '<>', False)]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="type" invisible="context.get('default_type', False)"/>
|
||||
<field name="template_id" on_change="on_change_template(template_id, date_start)" domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}"/>
|
||||
<field name="code"/>
|
||||
<field name="parent_id" on_change="on_change_parent(parent_id)" attrs="{'invisible': [('type','in',['contract'])]}"/>
|
||||
<field name="company_id" on_change="on_change_company(company_id)" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','<>','view')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Contract Information" name="contract_page" attrs="{'invisible':[('type','not in',['contract', 'template'])]}">
|
||||
<group string="Renewal" name="contract">
|
||||
<p colspan="2" class="oe_grey oe_edit_only">
|
||||
Once the end date of the contract is
|
||||
passed or the maximum number of service
|
||||
units (e.g. support contract) is
|
||||
reached, the account manager is notified
|
||||
by email to renew the contract with the
|
||||
customer.
|
||||
</p>
|
||||
<field name="date_start"/>
|
||||
<label for="date" string="End Date"/>
|
||||
<div name="duration">
|
||||
<field name="date" class="oe_inline"/>
|
||||
</div>
|
||||
</group>
|
||||
<separator string="Terms and Conditions" name="description"/>
|
||||
<field name="description"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user