[MERGE]:merged with main addons

bzr revid: ssu@tinyerp.com-20121008061925-puy5tlpntcmdrxr9
This commit is contained in:
Saurang Suthar 2012-10-08 11:49:25 +05:30
commit ae5c833184
1253 changed files with 13414 additions and 113664 deletions

View File

@ -159,6 +159,5 @@ for a particular financial year and for preparation of vouchers there is a modul
],
'installable': True,
'auto_install': False,
'certificate': '0080331923549',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -31,7 +31,7 @@ import decimal_precision as dp
from tools.translate import _
from tools.float_utils import float_round
from openerp import SUPERUSER_ID
import tools
_logger = logging.getLogger(__name__)
@ -227,7 +227,7 @@ class account_account(osv.osv):
while pos < len(args):
if args[pos][0] == 'code' and args[pos][1] in ('like', 'ilike') and args[pos][2]:
args[pos] = ('code', '=like', str(args[pos][2].replace('%', ''))+'%')
args[pos] = ('code', '=like', tools.ustr(args[pos][2].replace('%', ''))+'%')
if args[pos][0] == 'journal_id':
if not args[pos][2]:
del args[pos]
@ -595,12 +595,15 @@ class account_account(osv.osv):
res.append((record['id'], name))
return res
def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False):
def copy(self, cr, uid, id, default=None, context=None, done_list=None, local=False):
if default is None:
default = {}
else:
default = default.copy()
if done_list is None:
done_list = []
account = self.browse(cr, uid, id, context=context)
new_child_ids = []
if not default:
default = {}
default = default.copy()
default.update(code=_("%s (copy)") % (account['code'] or ''))
if not local:
done_list = []
@ -682,7 +685,7 @@ class account_journal_view(osv.osv):
_name = "account.journal.view"
_description = "Journal View"
_columns = {
'name': fields.char('Journal View', size=64, required=True),
'name': fields.char('Journal View', size=64, required=True, translate=True),
'columns_id': fields.one2many('account.journal.column', 'view_id', 'Columns')
}
_order = "name"
@ -777,11 +780,14 @@ class account_journal(osv.osv):
(_check_currency, 'Configuration error!\nThe currency chosen should be shared by the default accounts too.', ['currency','default_debit_account_id','default_credit_account_id']),
]
def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False):
journal = self.browse(cr, uid, id, context=context)
if not default:
def copy(self, cr, uid, id, default=None, context=None, done_list=None, local=False):
if default is None:
default = {}
default = default.copy()
else:
default = default.copy()
if done_list is None:
done_list = []
journal = self.browse(cr, uid, id, context=context)
default.update(
code=_("%s (copy)") % (journal['code'] or ''),
name=_("%s (copy)") % (journal['name'] or ''),
@ -1178,7 +1184,7 @@ class account_fiscalyear(osv.osv):
'end_journal_period_id':fields.many2one('account.journal.period','End of Year Entries Journal', readonly=True),
}
def copy(self, cr, uid, id, default={}, context=None):
def copy(self, cr, uid, id, default=None, context=None):
default.update({
'period_ids': [],
'end_journal_period_id': False
@ -1437,9 +1443,15 @@ class account_move(osv.osv):
result = super(account_move, self).create(cr, uid, vals, context)
return result
def copy(self, cr, uid, id, default={}, context=None):
def copy(self, cr, uid, id, default=None, context=None):
if context is None:
default = {}
else:
default = default.copy()
if context is None:
context = {}
else:
context = context.copy()
default.update({
'state':'draft',
'name':'/',
@ -1908,7 +1920,7 @@ class account_tax(osv.osv):
'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."),
'include_base_amount': fields.boolean('Included in base amount', help="Indicates if the amount of tax must be included in the base amount for the computation of the next taxes"),
'company_id': fields.many2one('res.company', 'Company', required=True),
'description': fields.char('Tax Code',size=32),
'description': fields.char('Tax Code'),
'price_include': fields.boolean('Tax Included in Price', help="Check this if the price you use on the product and invoices includes this tax."),
'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Application', required=True)
@ -2269,7 +2281,10 @@ class account_model(osv.osv):
_defaults = {
'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s: To Specify Year \n%(month)s: To Specify Month \n%(date)s: Current Date\n\ne.g. My model on %(date)s'),
}
def generate(self, cr, uid, ids, datas={}, context=None):
def generate(self, cr, uid, ids, data=None, context=None):
if data is None:
data = {}
move_ids = []
entry = {}
account_move_obj = self.pool.get('account.move')
@ -2280,8 +2295,8 @@ class account_model(osv.osv):
if context is None:
context = {}
if datas.get('date', False):
context.update({'date': datas['date']})
if data.get('date', False):
context.update({'date': data['date']})
move_date = context.get('date', time.strftime('%Y-%m-%d'))
move_date = datetime.strptime(move_date,"%Y-%m-%d")
@ -2467,10 +2482,10 @@ class account_subscription_line(osv.osv):
all_moves = []
obj_model = self.pool.get('account.model')
for line in self.browse(cr, uid, ids, context=context):
datas = {
data = {
'date': line.date,
}
move_ids = obj_model.generate(cr, uid, [line.subscription_id.model_id.id], datas, context)
move_ids = obj_model.generate(cr, uid, [line.subscription_id.model_id.id], data, context)
tocheck[line.subscription_id.id] = True
self.write(cr, uid, [line.id], {'move_id':move_ids[0]})
all_moves.extend(move_ids)
@ -2518,7 +2533,7 @@ class account_account_template(osv.osv):
'reconcile': fields.boolean('Allow Reconciliation', help="Check this option if you want the user to reconcile entries in this account."),
'shortcut': fields.char('Shortcut', size=12),
'note': fields.text('Note'),
'parent_id': fields.many2one('account.account.template', 'Parent Account Template', ondelete='cascade'),
'parent_id': fields.many2one('account.account.template', 'Parent Account Template', ondelete='cascade', domain=[('type','=','view')]),
'child_parent_ids':fields.one2many('account.account.template', 'parent_id', 'Children'),
'tax_ids': fields.many2many('account.tax.template', 'account_account_template_tax_rel', 'account_id', 'tax_id', 'Default Taxes'),
'nocreate': fields.boolean('Optional create', help="If checked, the new chart of accounts will not contain this by default."),
@ -2536,20 +2551,6 @@ class account_account_template(osv.osv):
(_check_recursion, 'Error!\nYou cannot create recursive account templates.', ['parent_id']),
]
def create(self, cr, uid, vals, context=None):
if 'parent_id' in vals:
parent = self.read(cr, uid, [vals['parent_id']], ['type'])
if parent and parent[0]['type'] != 'view':
raise osv.except_osv(_('Warning!'), _("You may only select a parent account of type 'View'."))
return super(account_account_template, self).create(cr, uid, vals, context=context)
def write(self, cr, uid, ids, vals, context=None):
if 'parent_id' in vals:
parent = self.read(cr, uid, [vals['parent_id']], ['type'])
if parent and parent[0]['type'] != 'view':
raise osv.except_osv(_('Warning!'), _("You may only select a parent account of type 'View'."))
return super(account_account_template, self).write(cr, uid, ids, vals, context=context)
def name_get(self, cr, uid, ids, context=None):
if not ids:
return []
@ -2828,7 +2829,7 @@ class account_tax_template(osv.osv):
'ref_base_sign': fields.float('Base Code Sign', help="Usually 1 or -1."),
'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."),
'include_base_amount': fields.boolean('Include in Base Amount', help="Set if the amount of tax must be included in the base amount before computing the next taxes."),
'description': fields.char('Internal Name', size=32),
'description': fields.char('Internal Name'),
'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Use In', required=True,),
'price_include': fields.boolean('Tax Included in Price', help="Check this if the price you use on the product and invoices includes this tax."),
}
@ -3250,7 +3251,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
property_obj.create(cr, uid, vals, context=context)
return True
def _install_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, acc_ref={}, taxes_ref={}, tax_code_ref={}, context=None):
def _install_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, acc_ref=None, taxes_ref=None, tax_code_ref=None, context=None):
'''
This function recursively loads the template objects and create the real objects from them.
@ -3268,6 +3269,12 @@ class wizard_multi_charts_accounts(osv.osv_memory):
* a last identical containing the mapping of tax code templates and tax codes
:rtype: tuple(dict, dict, dict)
'''
if acc_ref is None:
acc_ref = {}
if taxes_ref is None:
taxes_ref = {}
if tax_code_ref is None:
tax_code_ref = {}
template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context)
if template.parent_id:
tmp1, tmp2, tmp3 = self._install_template(cr, uid, template.parent_id.id, company_id, code_digits=code_digits, acc_ref=acc_ref, taxes_ref=taxes_ref, tax_code_ref=tax_code_ref, context=context)
@ -3280,7 +3287,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
tax_code_ref.update(tmp3)
return acc_ref, taxes_ref, tax_code_ref
def _load_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, account_ref={}, taxes_ref={}, tax_code_ref={}, context=None):
def _load_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, account_ref=None, taxes_ref=None, tax_code_ref=None, context=None):
'''
This function generates all the objects from the templates
@ -3298,6 +3305,12 @@ class wizard_multi_charts_accounts(osv.osv_memory):
* a last identical containing the mapping of tax code templates and tax codes
:rtype: tuple(dict, dict, dict)
'''
if account_ref is None:
account_ref = {}
if taxes_ref is None:
taxes_ref = {}
if tax_code_ref is None:
tax_code_ref = {}
template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context)
obj_tax_code_template = self.pool.get('account.tax.code.template')
obj_acc_tax = self.pool.get('account.tax')

View File

@ -29,12 +29,12 @@ class bank(osv.osv):
'currency_id': fields.related('journal_id', 'currency', type="many2one", relation='res.currency', readonly=True,
string="Currency", help="Currency of the related account journal."),
}
def create(self, cr, uid, data, context={}):
def create(self, cr, uid, data, context=None):
result = super(bank, self).create(cr, uid, data, context=context)
self.post_write(cr, uid, [result], context=context)
return result
def write(self, cr, uid, ids, data, context={}):
def write(self, cr, uid, ids, data, context=None):
result = super(bank, self).write(cr, uid, ids, data, context=context)
self.post_write(cr, uid, ids, context=context)
return result
@ -53,7 +53,7 @@ class bank(osv.osv):
data['currency_name'] = data['currency_id'] and currency_name[data['currency_id'][0]] or ''
return super(bank, self)._prepare_name_get(cr, uid, bank_dicts, context=context)
def post_write(self, cr, uid, ids, context={}):
def post_write(self, cr, uid, ids, context=None):
if isinstance(ids, (int, long)):
ids = [ids]

View File

@ -457,12 +457,13 @@ class account_bank_statement(osv.osv):
return res and res[0] or 0.0
def onchange_journal_id(self, cr, uid, statement_id, journal_id, context=None):
if not journal_id:
return {}
balance_start = self._compute_balance_end_real(cr, uid, journal_id, context=context)
journal_data = self.pool.get('account.journal').read(cr, uid, journal_id, ['default_debit_account_id', 'company_id'], context=context)
account_id = journal_data['default_debit_account_id']
journal_data = self.pool.get('account.journal').read(cr, uid, journal_id, ['company_id'], context=context)
company_id = journal_data['company_id']
return {'value': {'balance_start': balance_start, 'account_id': account_id, 'company_id': company_id}}
return {'value': {'balance_start': balance_start, 'company_id': company_id}}
def unlink(self, cr, uid, ids, context=None):
stat = self.read(cr, uid, ids, ['state'], context=context)

View File

@ -508,8 +508,10 @@ class account_invoice(osv.osv):
if journal_id:
journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
currency_id = journal.currency and journal.currency.id or journal.company_id.currency_id.id
company_id = journal.company_id.id
result = {'value': {
'currency_id': currency_id,
'company_id': company_id,
}
}
return result
@ -1306,17 +1308,19 @@ class account_invoice(osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
self.message_post(cr, uid, [obj.id], body=_("%s <b>created</b>.") % (_(self._get_document_type(obj.type))), context=context)
self.message_post(cr, uid, [obj.id], body=_("%s <b>created</b>.") % (self._get_document_type(obj.type)),
subtype="account.mt_invoice_new", context=context)
def confirm_paid_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
self.message_post(cr, uid, [obj.id], body=_("%s <b>paid</b>.") % (_(self._get_document_type(obj.type))), context=context)
for obj in self.browse(cr, uid, ids, context=context):
self.message_post(cr, uid, [obj.id], body=_("%s <b>paid</b>.") % (self._get_document_type(obj.type)),
subtype="account.mt_invoice_paid", context=context)
def invoice_cancel_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
self.message_post(cr, uid, [obj.id], body=_("%s <b>cancelled</b>.") % (_(self._get_document_type(obj.type))), context=context)
self.message_post(cr, uid, [obj.id], body=_("%s <b>cancelled</b>.") % (self._get_document_type(obj.type)),
context=context)
account_invoice()
class account_invoice_line(osv.osv):
@ -1371,7 +1375,10 @@ class account_invoice_line(osv.osv):
'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True)
}
def _default_account_id(self, cr, uid, ids, context=None):
def _default_account_id(self, cr, uid, context=None):
# XXX this gets the default account for the user's company,
# it should get the default account for the invoice's company
# however, the invoice's company does not reach this point
prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context)
return prop and prop.id or False
@ -1401,7 +1408,7 @@ class account_invoice_line(osv.osv):
context = {}
company_id = company_id if company_id != None else context.get('company_id',False)
context = dict(context)
context.update({'company_id': company_id})
context.update({'company_id': company_id, 'force_company': company_id})
if not partner_id:
raise osv.except_osv(_('No Partner Defined !'),_("You must first select a partner !") )
if not product:
@ -1556,16 +1563,19 @@ class account_invoice_line(osv.osv):
def onchange_account_id(self, cr, uid, ids, product_id, partner_id, inv_type, fposition_id, account_id):
if not account_id:
return {}
taxes = self.pool.get('account.account').browse(cr, uid, account_id).tax_ids
unique_tax_ids = []
fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id) or False
tax_ids = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
product_change_result = self.product_id_change(cr, uid, ids, product_id, False, type=inv_type,
partner_id=partner_id, fposition_id=fposition_id)
unique_tax_ids = set(tax_ids)
if product_change_result and 'value' in product_change_result and 'invoice_line_tax_id' in product_change_result['value']:
unique_tax_ids |= set(product_change_result['value']['invoice_line_tax_id'])
return {'value':{'invoice_line_tax_id': list(unique_tax_ids)}}
account = self.pool.get('account.account').browse(cr, uid, account_id)
if not product_id:
taxes = account.tax_ids
unique_tax_ids = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
else:
product_change_result = self.product_id_change(cr, uid, ids, product_id, False, type=inv_type,
partner_id=partner_id, fposition_id=fposition_id,
company_id=account.company_id.id)
if product_change_result and 'value' in product_change_result and 'invoice_line_tax_id' in product_change_result['value']:
unique_tax_ids = product_change_result['value']['invoice_line_tax_id']
return {'value':{'invoice_line_tax_id': unique_tax_ids}}
account_invoice_line()
@ -1650,14 +1660,13 @@ class account_invoice_tax(osv.osv):
for line in inv.invoice_line:
for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, (line.price_unit* (1-(line.discount or 0.0)/100.0)), line.quantity, line.product_id, inv.partner_id)['taxes']:
tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit'])
val={}
val['invoice_id'] = inv.id
val['name'] = tax['name']
val['amount'] = tax['amount']
val['manual'] = False
val['sequence'] = tax['sequence']
val['base'] = tax['price_unit'] * line['quantity']
val['base'] = cur_obj.round(cr, uid, cur, tax['price_unit'] * line['quantity'])
if inv.type in ('out_invoice','in_invoice'):
val['base_code_id'] = tax['base_code_id']

View File

@ -189,7 +189,7 @@
</group>
<notebook>
<page string="Invoice">
<field context="{'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line">
<field context="{'partner_id': partner_id, 'price_type': context.get('price_type') or False, 'type': type}" name="invoice_line">
<tree string="Invoice lines" editable="bottom">
<field name="product_id"
on_change="product_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)"/>
@ -299,8 +299,8 @@
<button name="invoice_open" states="draft" string="Validate" class="oe_highlight"/>
<button name="invoice_open" states="proforma2" string="Validate"/>
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
<button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='paid'/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
<button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='open,proforma2,paid'/>
<button name="invoice_cancel" states="draft,proforma2,open" string="Cancel" groups="base.group_no_one"/>
<button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object"/>
<button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
<!--button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/-->

View File

@ -562,6 +562,7 @@ class account_move_line(osv.osv):
'journal_id': lambda self, cr, uid, c: c.get('journal_id', False),
'credit': 0.0,
'debit': 0.0,
'amount_currency': 0.0,
'account_id': lambda self, cr, uid, c: c.get('account_id', False),
'period_id': lambda self, cr, uid, c: c.get('period_id', False),
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.move.line', context=c)
@ -1104,7 +1105,7 @@ class account_move_line(osv.osv):
'has been confirmed.') % res[2])
return res
def _remove_move_reconcile(self, cr, uid, move_ids=[], context=None):
def _remove_move_reconcile(self, cr, uid, move_ids=None, context=None):
# Function remove move rencocile ids related with moves
obj_move_line = self.pool.get('account.move.line')
obj_move_rec = self.pool.get('account.move.reconcile')
@ -1193,12 +1194,12 @@ class account_move_line(osv.osv):
jour_period_obj = self.pool.get('account.journal.period')
cr.execute('SELECT state FROM account_journal_period WHERE journal_id = %s AND period_id = %s', (journal_id, period_id))
result = cr.fetchall()
journal = journal_obj.browse(cr, uid, journal_id, context=context)
period = period_obj.browse(cr, uid, period_id, context=context)
for (state,) in result:
if state == 'done':
raise osv.except_osv(_('Error!'), _('You cannot add/modify entries in a closed journal.'))
raise osv.except_osv(_('Error !'), _('You can not add/modify entries in a closed period %s of journal %s.' % (period.name,journal.name)))
if not result:
journal = journal_obj.browse(cr, uid, journal_id, context=context)
period = period_obj.browse(cr, uid, period_id, context=context)
jour_period_obj.create(cr, uid, {
'name': (journal.code or journal.name)+':'+(period.name or ''),
'journal_id': journal.id,

View File

@ -1305,16 +1305,6 @@
Account.Entry Edition
-->
<record id="account_move_graph" model="ir.ui.view">
<field name="name">account.move.graph</field>
<field name="model">account.move</field>
<field name="arch" type="xml">
<graph string="Account Statistics" type="bar">
<field name="period_id"/>
<field name="amount" operator="+"/>
</graph>
</field>
</record>
<record id="view_move_tree" model="ir.ui.view">
<field name="name">account.move.tree</field>
<field name="model">account.move</field>
@ -1338,8 +1328,8 @@
<field name="arch" type="xml">
<form string="Account Entry" version="7.0">
<header>
<button name="button_validate" states="draft" string="Post" type="object" class="oe_highlight"/>
<button name="button_cancel" states="posted" string="Cancel" type="object"/>
<button name="button_validate" states="draft" string="Post" type="object" class="oe_highlight" groups="account.group_account_invoice"/>
<button name="button_cancel" states="posted" string="Cancel" type="object" groups="account.group_account_invoice"/>
<field name="state" widget="statusbar"/>
</header>
<sheet string="Journal Entries" >
@ -1488,7 +1478,7 @@
<field name="name">Journal Entries</field>
<field name="res_model">account.move</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_move_tree"/>
<field name="search_view_id" ref="view_account_move_filter"/>
<field name="help" type="html">
@ -1559,10 +1549,7 @@
<field name="view_mode">account_reconciliation_list</field>
<field name="help" type="html">
<p>
Good job!
</p><p>
There is nothing to reconcile. All invoices and payments
have been reconciled, your partner balance is clean.
No journal items found.
</p>
</field>
</record>
@ -2037,7 +2024,7 @@
src_model="account.journal"/>
<act_window
context="{'search_default_reconcile_id':False, 'search_default_partner_id':[active_id], 'default_partner_id': active_id}"
context="{'search_default_unreconciled':True, 'search_default_partner_id':[active_id], 'default_partner_id': active_id}"
domain="[('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]"
id="act_account_partner_account_move_all"
name="Receivables &amp; Payables"
@ -2073,7 +2060,7 @@
id="account_template_folder"
name="Templates"
parent="menu_finance_accounting"
groups="base.group_multi_company"/>
groups="account.group_account_manager"/>
<menuitem
id="account_template_taxes"
name="Taxes"

View File

@ -518,7 +518,6 @@
<!--
Account Statement Sequences
-->
<record id="sequence_reconcile" model="ir.sequence.type">
<field name="name">Account Reconcile</field>
<field name="code">account.reconcile</field>
@ -554,8 +553,6 @@
<field eval="1" name="number_next"/>
<field eval="1" name="number_increment"/>
</record>
<!--
Invoice requests (deprecated)
-->
@ -564,7 +561,14 @@
<field name="object">account.invoice</field>
</record>
<!-- mail: subtypes -->
<record id="mt_invoice_new" model="mail.message.subtype">
<field name="name">created</field>
<field name="res_model">account.invoice</field>
</record>
<record id="mt_invoice_paid" model="mail.message.subtype">
<field name="name">paid</field>
<field name="res_model">account.invoice</field>
</record>
</data>
</openerp>

View File

@ -44,17 +44,17 @@ class account_fiscal_position(osv.osv):
return []
if not fposition_id:
return map(lambda x: x.id, taxes)
result = []
result = set()
for t in taxes:
ok = False
for tax in fposition_id.tax_ids:
if tax.tax_src_id.id == t.id:
if tax.tax_dest_id:
result.append(tax.tax_dest_id.id)
result.add(tax.tax_dest_id.id)
ok=True
if not ok:
result.append(t.id)
return result
result.add(t.id)
return list(result)
def map_account(self, cr, uid, fposition_id, account_id, context=None):
if not fposition_id:
@ -77,6 +77,12 @@ class account_fiscal_position_tax(osv.osv):
'tax_dest_id': fields.many2one('account.tax', 'Replacement Tax')
}
_sql_constraints = [
('tax_src_dest_uniq',
'unique (position_id,tax_src_id,tax_dest_id)',
'A tax fiscal position could be defined only once time on same taxes.')
]
account_fiscal_position_tax()
class account_fiscal_position_account(osv.osv):
@ -89,6 +95,12 @@ class account_fiscal_position_account(osv.osv):
'account_dest_id': fields.many2one('account.account', 'Account Destination', domain=[('type','<>','view')], required=True)
}
_sql_constraints = [
('account_src_dest_uniq',
'unique (position_id,account_src_id,account_dest_id)',
'An account fiscal position could be defined only once time on same accounts.')
]
account_fiscal_position_account()
class res_partner(osv.osv):

View File

@ -92,34 +92,7 @@
<field name="debit"/>
</group>
</group>
<field name="bank_ids">
<form string="Bank account" version="7.0">
<group col="4">
<field name="state"/>
<field name="acc_number"/>
</group>
<group>
<group name="owner" string="Bank Account Owner">
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
<field name="owner_name"/>
<label for="street" string="Address"/>
<div>
<field name="street" placeholder="Street..."/>
<div>
<field name="zip" class="oe_inline" placeholder="ZIP"/>
<field name="city" class="oe_inline" placeholder="City"/>
</div>
<field name="state_id" placeholder="State" options='{"no_open": true}'/>
<field name="country_id" placeholder="Country" options='{"no_open": true}'/>
</div>
</group>
<group name="bank" string="Information About the Bank">
<field name="bank" on_change="onchange_bank_id(bank)"/>
<field name="bank_name"/>
<field name="bank_bic" placeholder="e.g. GEBABEBB"/>
</group>
</group>
</form>
<field name="bank_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'base.view_partner_bank_form'}">
<tree string="Bank Details">
<field name="sequence" invisible="1"/>
<field name="acc_number"/>
@ -141,7 +114,7 @@
context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}"
src_model="res.partner"
view_type="form"
view_mode="tree,form,graph,calendar"/>
view_mode="tree,form,calendar"/>
</data>
</openerp>

View File

@ -73,7 +73,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph,form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_analytic_account_tree"/>
<field name="search_view_id" ref="account.view_account_analytic_account_search"/>
</record>
@ -114,9 +114,6 @@
</field>
</record>
<menuitem groups="analytic.group_analytic_accounting" id="next_id_40"
name="Analytic" parent="account.menu_finance_generic_reporting"
sequence="4"/>
<record id="view_account_analytic_line_form" model="ir.ui.view">
<field name="name">account.analytic.line.form</field>
@ -351,15 +348,6 @@
# Reporting
#
<record id="action_account_analytic_journal_tree" model="ir.actions.act_window">
<field name="name">Print Analytic Journals</field>
<field name="res_model">account.analytic.journal</field>
<field name="view_type">tree</field>
<field name="help">To print an analytics (or costs) journal for a given period. The report give code, move name, account number, general amount and analytic amount.</field>
</record>
<menuitem groups="analytic.group_analytic_accounting"
action="action_account_analytic_journal_tree"
id="account_analytic_journal_print" parent="account.next_id_40"/>
<record id="view_account_journal_1" model="ir.ui.view">
<field name="name">account.journal.form.1</field>
@ -372,16 +360,5 @@
</field>
</record>
<record id="analytic_accounts_graph" model="ir.ui.view">
<field name="name">analytic.accounts.graph</field>
<field name="model">account.analytic.account</field>
<field name="arch" type="xml">
<graph string="Analytic Account Statistics" type="bar">
<field name="complete_name"/>
<field name="balance" operator="+"/>
</graph>
</field>
</record>
</data>
</openerp>

View File

@ -47,4 +47,4 @@ class account_analytic_chart(osv.osv_memory):
return result
account_analytic_chart()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -52,4 +52,4 @@ class account_analytic_inverted_balance(osv.osv_memory):
}
account_analytic_inverted_balance()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -29,6 +29,7 @@ class account_analytic_journal_report(osv.osv_memory):
_columns = {
'date1': fields.date('Start of period', required=True),
'date2': fields.date('End of period', required=True),
'analytic_account_journal_id': fields.many2many('account.analytic.journal', 'account_analytic_journal_name', 'journal_line_id', 'journal_print_id', 'Analytic Journals', required=True),
}
_defaults = {
@ -40,8 +41,15 @@ class account_analytic_journal_report(osv.osv_memory):
if context is None:
context = {}
data = self.read(cr, uid, ids)[0]
ids_list = []
if context.get('active_id',False):
ids_list.append(context.get('active_id',False))
else:
record = self.browse(cr,uid,ids[0],context=context)
for analytic_record in record.analytic_account_journal_id:
ids_list.append(analytic_record.id)
datas = {
'ids': context.get('active_ids',[]),
'ids': ids_list,
'model': 'account.analytic.journal',
'form': data
}
@ -50,6 +58,14 @@ class account_analytic_journal_report(osv.osv_memory):
'report_name': 'account.analytic.journal',
'datas': datas,
}
def default_get(self, cr, uid, fields, context=None):
if context is None:
context = {}
res = super(account_analytic_journal_report, self).default_get(cr, uid, fields, context=context)
if 'analytic_account_journal_id' in fields:
res.update({'analytic_account_journal_id': context.get('active_ids',[])})
return res
account_analytic_journal_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -7,15 +7,16 @@
<field name="model">account.analytic.journal.report</field>
<field name="arch" type="xml">
<form string="Select Period" version="7.0">
<header>
<button name="check_report" string="Print" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</header>
<group col="4">
<field name="date1"/>
<field name="date2"/>
<field name="analytic_account_journal_id" widget="many2many_tags" class="oe_inline" required="1"/>
</group>
<footer>
<button name="check_report" string="Print" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
@ -38,6 +39,13 @@
<field name="key">action</field>
<field name="model">account.analytic.journal</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="account.action_account_analytic_journal"
id="account_analytic_journal_print" parent="account.next_id_40"/>
</data>
</openerp>

View File

@ -55,4 +55,4 @@ class project_account_analytic_line(osv.osv_memory):
project_account_analytic_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -68,7 +68,7 @@ class account_balance(report_sxw.rml_parse, common_report_header):
return self.pool.get('account.account').browse(self.cr, self.uid, data['form']['id']).company_id.name
return super(account_balance ,self)._get_account(data)
def lines(self, form, ids=[], done=None):#, level=1):
def lines(self, form, ids=None, done=None):
def _process_child(accounts, disp_acc, parent):
account_rec = [acct for acct in accounts if acct['id']==parent][0]
currency_obj = self.pool.get('res.currency')

View File

@ -105,4 +105,4 @@ class journal_print(report_sxw.rml_parse, common_report_header):
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/account_central_journal.rml', parser=journal_print, header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -158,4 +158,4 @@ class journal_print(report_sxw.rml_parse, common_report_header):
report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print, header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -284,4 +284,4 @@ class report_account_sales(osv.osv):
)""")
report_account_sales()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -160,7 +160,7 @@ class tax_report(report_sxw.rml_parse, common_report_header):
i+=1
return res
def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=[], context=None):
def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=None, context=None):
obj_tc = self.pool.get('account.tax.code')
ids = obj_tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)], order='sequence', context=context)
@ -171,7 +171,11 @@ class tax_report(report_sxw.rml_parse, common_report_header):
res += self._get_codes(based_on, company_id, code.id, level+1, context=context)
return res
def _add_codes(self, based_on, account_list=[], period_list=[], context=None):
def _add_codes(self, based_on, account_list=None, period_list=None, context=None):
if account_list is None:
account_list = []
if period_list is None:
period_list = []
res = []
obj_tc = self.pool.get('account.tax.code')
for account in account_list:

View File

@ -117,6 +117,9 @@ class account_config_settings(osv.osv_memory):
'group_multi_currency': fields.boolean('Allow multi currencies',
implied_group='base.group_multi_currency',
help="Allows you multi currency environment"),
'group_analytic_accounting': fields.boolean('Analytic accounting',
implied_group='analytic.group_analytic_accounting',
help="Allows you to use the analytic accounting."),
}
def _default_company(self, cr, uid, context=None):

View File

@ -129,6 +129,10 @@
<field name="module_account_accountant" class="oe_inline"/>
<label for="module_account_accountant"/>
</div>
<div>
<field name="group_analytic_accounting" class="oe_inline"/>
<label for="group_analytic_accounting"/>
</div>
<div>
<field name="module_account_asset" class="oe_inline"/>
<label for="module_account_asset"/>

View File

@ -45,4 +45,3 @@ class res_currency_account(osv.osv):
res_currency_account()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -16,7 +16,7 @@
</record>
<record id="group_account_manager" model="res.groups">
<field name="name">Manager</field>
<field name="name">Financial Manager</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
<field name="implied_ids" eval="[(4, ref('group_account_user'))]"/>
</record>

View File

@ -3,10 +3,17 @@
<templates id="template" xml:space="preserve">
<t t-name="AccountReconciliation">
<t t-if="widget.current_partner === null">
<div class="oe_view_nocontent">
<p>
Good job!
</p><p>
There is nothing to reconcile. All invoices and payments
have been reconciled, your partner balance is clean.
</p>
</div>
</t>
<div class="oe_account_reconciliation">
<t t-if="widget.current_partner === null">
There is no pending reconciliation.
</t>
<t t-if="widget.current_partner !== null">
<div>
<div>

View File

@ -21,7 +21,7 @@
-
I create a supplier invoice
-
!record {model: account.invoice, id: account_invoice_supplier0}:
!record {model: account.invoice, id: account_invoice_supplier0, view: invoice_supplier_form}:
account_id: account.a_pay
check_total: 3000.0
company_id: base.main_company

View File

@ -32,11 +32,11 @@ class account_invoice_refund(osv.osv_memory):
_name = "account.invoice.refund"
_description = "Invoice Refund"
_columns = {
'date': fields.date('Operation Date', help='This date will be used as the invoice date for credit note and period will be chosen accordingly!'),
'date': fields.date('Date', help='This date will be used as the invoice date for credit note and period will be chosen accordingly!'),
'period': fields.many2one('account.period', 'Force period'),
'journal_id': fields.many2one('account.journal', 'Refund Journal', help='You can select here the journal to use for the credit note that will be created. If you leave that field empty, it will use the same journal as the current invoice.'),
'description': fields.char('Description', size=128, required=True),
'filter_refund': fields.selection([('refund', 'Create a draft refund'), ('cancel', 'Cancel: create credit note and reconcile'),('modify', 'Modify: create credit note, reconcile and create a new draft invoice')], "Refund Method", required=True, help='Credit note base on this type. You can not Modify and Cancel if the invoice is already reconciled'),
'description': fields.char('Reason', size=128, required=True),
'filter_refund': fields.selection([('refund', 'Create a draft credit note'), ('cancel', 'Cancel: create credit note and reconcile'),('modify', 'Modify: create credit note, reconcile and create a new draft invoice')], "Refund Method", required=True, help='Credit note base on this type. You can not Modify and Cancel if the invoice is already reconciled'),
}
def _get_journal(self, cr, uid, context=None):

View File

@ -7,19 +7,40 @@
<field name="model">account.invoice.refund</field>
<field name="arch" type="xml">
<form string="Credit Note" version="7.0">
<separator string="Credit Note Options"/>
<group col="4">
<field name="description"/>
<field name="journal_id" widget='selection'/>
<field name="date"/>
<field name="period"/>
<field name="filter_refund"/>
<group>
<group colspan="2">
<label for="filter_refund"/>
<div>
<field name="filter_refund" class="oe_inline"/>
<p attrs="{'invisible':[('filter_refund','&lt;&gt;','refund')]}" class="oe_grey">
You will be able to edit and validate this
credit note directly or keep it draft,
waiting for the document to be issued by
your supplier/customer.
</p>
<p attrs="{'invisible':[('filter_refund','&lt;&gt;','cancel')]}" class="oe_grey">
Use this option if you want to cancel an invoice you should not
have issued. The credit note will be created, validated and reconciled
with the invoice. You will not be able to modify the credit note.
</p>
<p attrs="{'invisible':[('filter_refund','&lt;&gt;','modify')]}" class="oe_grey">
Use this option if you want to cancel an invoice and create a new
one. The credit note will be created, validated and reconciled
with the current invoice. A new, draft, invoice will be created
so that you can edit it.
</p>
</div>
</group>
<group>
<field name="description"/>
<field name="journal_id" widget='selection'/>
</group><group>
<field name="date"/>
<field name="period"/>
</group>
</group>
<label string="Modify Invoice: Cancels the current invoice and creates a new copy of it ready for editing."/>
<label string="Credit Note: Creates the credit note, ready for editing."/>
<label string="Cancel Invoice: Creates the credit note, validate and reconcile it to cancel the current invoice."/>
<footer>
<button string='Refund' name="invoice_refund" type="object" class="oe_highlight"/>
<button string='Create Credit Note' name="invoice_refund" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
@ -28,7 +49,7 @@
</record>
<record id="action_account_invoice_refund" model="ir.actions.act_window">
<field name="name">Refund</field>
<field name="name">Refund Invoice</field>
<field name="res_model">account.invoice.refund</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>

View File

@ -71,4 +71,4 @@ class account_invoice_cancel(osv.osv_memory):
account_invoice_cancel()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -47,4 +47,4 @@ class account_journal_select(osv.osv_memory):
account_journal_select()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -61,4 +61,4 @@ the bank account\nin the journal definition for reconciliation.'))
account_move_bank_reconcile()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -38,7 +38,7 @@ class account_move_journal(osv.osv_memory):
_defaults = {
'target_move': 'all'
}
def _get_period(self, cr, uid, context={}):
def _get_period(self, cr, uid, context=None):
"""
Return default account period value
"""

View File

@ -52,4 +52,4 @@ class account_move_line_reconcile_select(osv.osv_memory):
account_move_line_reconcile_select()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -69,4 +69,4 @@ class account_move_line_select(osv.osv_memory):
account_move_line_select()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -41,4 +41,4 @@ class account_move_line_unreconcile_select(osv.osv_memory):
account_move_line_unreconcile_select()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -23,6 +23,7 @@ import time
from osv import fields, osv
from tools.translate import _
import decimal_precision as dp
class account_move_line_reconcile(osv.osv_memory):
"""
@ -32,9 +33,9 @@ class account_move_line_reconcile(osv.osv_memory):
_description = 'Account move line reconcile'
_columns = {
'trans_nbr': fields.integer('# of Transaction', readonly=True),
'credit': fields.float('Credit amount', readonly=True),
'debit': fields.float('Debit amount', readonly=True),
'writeoff': fields.float('Write-Off amount', readonly=True),
'credit': fields.float('Credit amount', readonly=True, digits_compute=dp.get_precision('Account')),
'debit': fields.float('Debit amount', readonly=True, digits_compute=dp.get_precision('Account')),
'writeoff': fields.float('Write-Off amount', readonly=True, digits_compute=dp.get_precision('Account')),
}
def default_get(self, cr, uid, fields, context=None):
@ -159,4 +160,4 @@ class account_move_line_reconcile_writeoff(osv.osv_memory):
account_move_line_reconcile_writeoff()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -41,4 +41,4 @@ class account_state_open(osv.osv_memory):
account_state_open()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -50,4 +50,4 @@ class account_subscription_generate(osv.osv_memory):
account_subscription_generate()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -50,4 +50,4 @@ class account_unreconcile_reconcile(osv.osv_memory):
account_unreconcile_reconcile()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -43,6 +43,5 @@ It assigns manager and user access rights to the Administrator and only user rig
'installable': True,
'auto_install': False,
'application': True,
'certificate': '00395091383933390541',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -26,9 +26,11 @@
<field name="res_id" ref="mail.group_all_employees"/>
<field name="type">notification</field>
<field name="subject">Accounting and Finance application installed!</field>
<field name="body">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.
<field name="body"><![CDATA[
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.
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.</field>
<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>
</record>
</data>
</openerp>

View File

@ -47,7 +47,6 @@ Adds menu to show relevant information to each manager.You can also view the rep
'demo': [],
'installable': True,
'auto_install': False,
'certificate': '0042927202589',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -48,7 +48,7 @@
<field name="name">Contracts to Renew</field>
<field name="res_model">account.analytic.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_user_id':uid, 'search_default_draft':1, 'search_default_pending':1, 'search_default_open':1, 'search_default_renew':1}</field>
<field name="domain">[('type','=','contract')]</field>
<field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>
@ -72,7 +72,7 @@
<field name="name">Contracts</field>
<field name="res_model">account.analytic.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_mode">tree,form</field>
<field name="context">{'default_type':'contract', 'search_default_open':1, 'search_default_pending':1}</field>
<field name="domain">[('type','=','contract')]</field>
<field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>

View File

@ -47,7 +47,6 @@ Allows to automatically select analytic accounts based on criterions:
'demo': [],
'installable': True,
'auto_install': False,
'certificate': '0074229833581',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -79,7 +79,6 @@ The analytic plan validates the minimum and maximum percentage at the time of cr
'test': ['test/acount_analytic_plans_report.yml'],
'installable': True,
'auto_install': False,
'certificate': '0036417675373',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -262,6 +262,7 @@ account_analytic_plan_instance()
class account_analytic_plan_instance_line(osv.osv):
_name = "account.analytic.plan.instance.line"
_description = "Analytic Instance Line"
_rec_name = "analytic_account_id"
_columns = {
'plan_id': fields.many2one('account.analytic.plan.instance', 'Plan Id'),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, domain=[('type','<>','view')]),

View File

@ -34,7 +34,7 @@ class crossovered_analytic(report_sxw.rml_parse):
})
self.base_amount = 0.00
def find_children(self,ref_ids):
def find_children(self, ref_ids):
to_return_ids = []
final_list = []
parent_list = []
@ -53,7 +53,7 @@ class crossovered_analytic(report_sxw.rml_parse):
final_list.extend(set_list)
return final_list #to_return_ids[0]
def set_account(self,cats):
def set_account(self, cats):
lst = []
category = self.pool.get('account.analytic.account').read(self.cr, self.uid, cats)
for cat in category:
@ -62,7 +62,7 @@ class crossovered_analytic(report_sxw.rml_parse):
lst.extend(self.set_account(cat['child_ids']))
return lst
def _ref_lines(self,form):
def _ref_lines(self, form):
result = []
res = {}
acc_pool = self.pool.get('account.analytic.account')
@ -112,7 +112,9 @@ class crossovered_analytic(report_sxw.rml_parse):
result.append(res)
return result
def _lines(self, form, ids={}):
def _lines(self, form, ids=None):
if ids is None:
ids = {}
if not ids:
ids = self.ids

View File

@ -23,4 +23,4 @@ import stock
import purchase
import invoice
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -46,7 +46,6 @@ account.""",
'data': ['product_view.xml',],
'auto_install': False,
'installable': True,
'certificate':'00557423080410733581',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,43 +0,0 @@
# -*- encoding: 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 osv import fields, osv
#class sale_order_line(osv.osv):
# _name = 'sale.order.line'
# _description = 'Sale Order line'
# _inherit = 'sale.order.line'
#
# def invoice_line_create(self, cr, uid, ids, context={}):
# line_ids = super('sale_order_line',self).invoice_line_create(cr, uid, ids, context)
# invoice_line_obj = self.pool.get('account.invoice.line')
# for line in invoice_line_obj.browse(cr, uid, line_ids):
# if line.product_id:
# a = line.product_id.product_tmpl_id.property_stock_account_output and line.product_id.product_tmpl_id.property_stock_account_output.id
# if not a:
# a = line.product_id.categ_id.property_stock_account_output_categ and line.product_id.categ_id.property_stock_account_output_categ.id
# if a:
# a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a)
# invoice_line_obj.write(cr, uid, line.id, {'account_id':a})
#
#sale_order_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -75,7 +75,7 @@ class account_asset_asset(osv.osv):
_name = 'account.asset.asset'
_description = 'Asset'
def _get_period(self, cr, uid, context={}):
def _get_period(self, cr, uid, context=None):
periods = self.pool.get('account.period').find(cr, uid)
if periods:
return periods[0]
@ -176,7 +176,9 @@ class account_asset_asset(osv.osv):
year = depreciation_date.year
return True
def validate(self, cr, uid, ids, context={}):
def validate(self, cr, uid, ids, context=None):
if context is None:
context = {}
return self.write(cr, uid, ids, {
'state':'open'
}, context)
@ -304,7 +306,7 @@ class account_asset_asset(osv.osv):
default.update({'depreciation_line_ids': [], 'state': 'draft'})
return super(account_asset_asset, self).copy(cr, uid, id, default, context=context)
def _compute_entries(self, cr, uid, ids, period_id, context={}):
def _compute_entries(self, cr, uid, ids, period_id, context=None):
result = []
period_obj = self.pool.get('account.period')
depreciation_obj = self.pool.get('account.asset.depreciation.line')
@ -350,7 +352,7 @@ class account_asset_depreciation_line(osv.osv):
'amount': fields.float('Depreciation Amount', required=True),
'remaining_value': fields.float('Amount to Depreciate', required=True),
'depreciated_value': fields.float('Amount Already Depreciated', required=True),
'depreciation_date': fields.char('Depreciation Date', size=64, select=1),
'depreciation_date': fields.date('Depreciation Date', select=1),
'move_id': fields.many2one('account.move', 'Depreciation Entry'),
'move_check': fields.function(_get_move_check, method=True, type='boolean', string='Posted', store=True)
}
@ -368,7 +370,7 @@ class account_asset_depreciation_line(osv.osv):
for line in self.browse(cr, uid, ids, context=context):
if currency_obj.is_zero(cr, uid, line.asset_id.currency_id, line.remaining_value):
can_close = True
depreciation_date = line.asset_id.prorata and line.asset_id.purchase_date or time.strftime('%Y-%m-%d')
depreciation_date = time.strftime('%Y-%m-%d')
period_ids = period_obj.find(cr, uid, depreciation_date, context=context)
company_currency = line.asset_id.company_id.currency_id.id
current_currency = line.asset_id.currency_id.id

View File

@ -57,6 +57,7 @@ class account_invoice_line(osv.osv):
'partner_id': line.invoice_id.partner_id.id,
'company_id': line.invoice_id.company_id.id,
'currency_id': line.invoice_id.currency_id.id,
'purchase_date' : line.invoice_id.date_invoice,
}
changed_vals = asset_obj.onchange_category_id(cr, uid, [], vals['category_id'], context=context)
vals.update(changed_vals['value'])

View File

@ -50,7 +50,7 @@ class asset_asset_report(osv.osv):
select
min(dl.id) as id,
dl.name as name,
to_date(dl.depreciation_date, 'YYYY-MM-DD') as depreciation_date,
dl.depreciation_date as depreciation_date,
a.purchase_date as purchase_date,
(CASE WHEN (select min(d.id) from account_asset_depreciation_line as d
left join account_asset_asset as ac ON (ac.id=d.asset_id)
@ -77,7 +77,7 @@ class asset_asset_report(osv.osv):
from account_asset_depreciation_line dl
left join account_asset_asset a on (dl.asset_id=a.id)
group by
dl.amount,dl.asset_id,to_date(dl.depreciation_date, 'YYYY-MM-DD'),dl.name,
dl.amount,dl.asset_id,dl.depreciation_date,dl.name,
a.purchase_date, dl.move_check, a.state, a.category_id, a.partner_id, a.company_id,
a.purchase_value, a.id, a.salvage_value
)""")

View File

@ -76,7 +76,7 @@
<field name="ref" readonly="1"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
<field name="type" on_change="onchange_type(partner_id, type)"/>
<field name="account_id" domain="[('journal_id','=',parent.journal_id)]"/>
<field name="account_id" domain="[('journal_id','=',journal_id)]"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '&lt;&gt;', 'view')]"/>
<field name="amount" readonly="1" sum="Total Amount"/>
<field name="globalisation_id" string="Glob. Id"/>
@ -100,7 +100,7 @@
<field name="ref" readonly="0"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
<field name="type" on_change="onchange_type(partner_id, type)"/>
<field domain="[('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id"/>
<field domain="[('journal_id', '=', journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '&lt;&gt;', 'view')]"/>
<field name="amount"/>
<field name="globalisation_id"/>

View File

@ -69,6 +69,5 @@ Three reports are available:
],
'installable': True,
'auto_install': False,
'certificate': '0043819694157',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -35,7 +35,9 @@ class analytic_account_budget_report(report_sxw.rml_parse):
})
self.context = context
def funct(self, object, form, ids={}, done=None, level=1):
def funct(self, object, form, ids=None, done=None, level=1):
if ids is None:
ids = {}
if not ids:
ids = self.ids
if not done:
@ -153,7 +155,7 @@ class analytic_account_budget_report(report_sxw.rml_parse):
tot['perc'] = float(tot['prac'] / tot['theo']) * 100
return result
def funct_total(self,form):
def funct_total(self, form):
result = []
res = {}
res = {
@ -167,4 +169,4 @@ class analytic_account_budget_report(report_sxw.rml_parse):
report_sxw.report_sxw('report.account.analytic.account.budget', 'account.analytic.account', 'addons/account_budget/report/analytic_account_budget_report.rml',parser=analytic_account_budget_report,header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -34,7 +34,9 @@ class budget_report(report_sxw.rml_parse):
})
self.context = context
def funct(self, object, form, ids={}, done=None, level=1):
def funct(self, object, form, ids=None, done=None, level=1):
if ids is None:
ids = {}
if not ids:
ids = self.ids
if not done:

View File

@ -37,7 +37,9 @@ class budget_report(report_sxw.rml_parse):
})
self.context = context
def funct(self, object, form, ids={}, done=None, level=1):
def funct(self, object, form, ids=None, done=None, level=1):
if ids is None:
ids = {}
if not ids:
ids = self.ids
if not done:

View File

@ -52,4 +52,4 @@ class account_budget_analytic(osv.osv_memory):
account_budget_analytic()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -53,4 +53,4 @@ class account_budget_crossvered_report(osv.osv_memory):
account_budget_crossvered_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -54,4 +54,4 @@ class account_budget_report(osv.osv_memory):
account_budget_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -38,9 +38,6 @@ If set to true it allows user to cancel entries & invoices.
'demo': [],
'installable': True,
'auto_install': False,
'certificate': '001101250473177981989',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -36,6 +36,5 @@ Deactivates minimal chart of accounts.
'data': [],
'demo': [],
'installable': True,
'certificate': '0073332443901',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

File diff suppressed because it is too large Load Diff

View File

@ -23,4 +23,4 @@ import account_followup
import wizard
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -64,7 +64,6 @@ Note that if you want to check the follow-up level for a given partner/account e
],
'installable': True,
'auto_install': False,
'certificate': '0072481076453',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -21,4 +21,4 @@
import account_followup_print
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -209,7 +209,7 @@ class account_followup_print_all(osv.osv_memory):
to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': stat_line_id}
return {'partner_ids': partner_list, 'to_update': to_update}
def do_mail(self ,cr, uid, ids, context=None):
def do_mail(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
move_obj = self.pool.get('account.move.line')
user_obj = self.pool.get('res.users')

View File

@ -29,4 +29,4 @@ import account_move_line
import account_invoice
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -65,6 +65,5 @@ have a new option to import payment orders as bank statement lines.
],
'installable': True,
'auto_install': False,
'certificate': '0061703998541',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -50,4 +50,4 @@ class Invoice(osv.osv):
Invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -26,7 +26,7 @@ from tools.translate import _
class account_move_line(osv.osv):
_inherit = "account.move.line"
def amount_to_pay(self, cr, uid, ids, name, arg={}, context=None):
def amount_to_pay(self, cr, uid, ids, name, arg=None, context=None):
""" Return the amount still to pay regarding all the payemnt orders
(excepting cancelled orders)"""
if not ids:
@ -117,4 +117,4 @@ class account_move_line(osv.osv):
account_move_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -139,7 +139,9 @@ class payment_order(osv.osv):
wf_service.trg_validate(uid, 'payment.order', ids[0], 'done', cr)
return True
def copy(self, cr, uid, id, default={}, context=None):
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
default.update({
'state': 'draft',
'line_ids': [],

View File

@ -20,4 +20,4 @@
##############################################################################
import payment_order
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -77,7 +77,7 @@ class payment_order(report_sxw.rml_parse):
user = pool.get('res.users').browse(self.cr, self.uid, self.uid)
return user.company_id and user.company_id.currency_id and user.company_id.currency_id.symbol or False
def _get_account_name(self,bank_id):
def _get_account_name(self, bank_id):
if bank_id:
pool = pooler.get_pool(self.cr.dbname)
value_name = pool.get('res.partner.bank').name_get(self.cr, self.uid, [bank_id])
@ -87,4 +87,4 @@ class payment_order(report_sxw.rml_parse):
report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order, header="external")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -23,4 +23,4 @@ import account_payment_order
import account_payment_populate_statement
import account_payment_pay
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -88,7 +88,7 @@ class payment_order_create(osv.osv_memory):
'partner_id': line.partner_id and line.partner_id.id or False,
'communication': line.ref or '/',
'date': date_to_pay,
'currency': line.invoice and line.invoice.currency_id.id or False,
'currency': (line.invoice and line.invoice.currency_id.id) or line.journal_id.currency.id or line.journal_id.company_id.currency_id.id,
}, context=context)
return {'type': 'ir.actions.act_window_close'}
@ -120,4 +120,4 @@ class payment_order_create(osv.osv_memory):
payment_order_create()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -56,4 +56,4 @@ class account_payment_make_payment(osv.osv_memory):
account_payment_make_payment()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -86,24 +86,24 @@ class account_payment_populate_statement(osv.osv_memory):
'name': line.name,
'partner_id': line.partner_id.id,
'journal_id': statement.journal_id.id,
'account_id': result.get('account_id', statement.journal_id.default_credit_account_id.id),
'account_id': result['value'].get('account_id', statement.journal_id.default_credit_account_id.id),
'company_id': statement.company_id.id,
'currency_id': statement.currency.id,
'date': line.date or time.strftime('%Y-%m-%d'),
'amount': abs(amount),
'period_id': statement.period_id.id
'period_id': statement.period_id.id,
}
voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context)
voucher_line_dict = False
if result['value']['line_ids']:
for line_dict in result['value']['line_ids']:
move_line = move_line_obj.browse(cr, uid, line_dict['move_line_id'], context)
if line.move_line_id.move_id.id == move_line.move_id.id:
voucher_line_dict = line_dict
voucher_line_dict = {}
for line_dict in result['value']['line_cr_ids'] + result['value']['line_dr_ids']:
move_line = move_line_obj.browse(cr, uid, line_dict['move_line_id'], context)
if line.move_line_id.move_id.id == move_line.move_id.id:
voucher_line_dict = line_dict
if voucher_line_dict:
voucher_line_dict.update({'voucher_id': voucher_id})
voucher_line_obj.create(cr, uid, voucher_line_dict, context=context)
st_line_id = statement_line_obj.create(cr, uid, {
'name': line.order_id.reference or '?',
'amount': - amount,
@ -120,4 +120,4 @@ class account_payment_populate_statement(osv.osv_memory):
account_payment_populate_statement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -22,4 +22,4 @@
import account_sequence
import account_sequence_installer
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -49,7 +49,6 @@ You can customize the following attributes of the sequence:
'demo': [],
'installable': True,
'auto_install': False,
'certificate': '00475376442024623469',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -24,4 +24,4 @@ import invoice
import report
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -72,7 +72,6 @@ This module manages:
'test/case4_cad_chf.yml',
'test/case_eur_usd.yml',
],
'certificate': '0037580727101',
'auto_install': False,
'application': True,
'installable': True,

View File

@ -32,11 +32,11 @@ class res_company(osv.osv):
_columns = {
'income_currency_exchange_account_id': fields.many2one(
'account.account',
string="Income Currency Rate",
string="Gain Exchange Rate Account",
domain="[('type', '=', 'other')]",),
'expense_currency_exchange_account_id': fields.many2one(
'account.account',
string="Expense Currency Rate",
string="Loss Exchange Rate Account",
domain="[('type', '=', 'other')]",),
}
@ -547,6 +547,19 @@ class account_voucher(osv.osv):
vals = self.recompute_payment_rate(cr, uid, ids, res, currency_id, date, ttype, journal_id, amount, context=context)
for key in vals.keys():
res[key].update(vals[key])
#TODO: onchange_partner_id() should not returns [pre_line, line_dr_ids, payment_rate...] for type sale, and not
# [pre_line, line_cr_ids, payment_rate...] for type purchase.
# We should definitively split account.voucher object in two and make distinct on_change functions. In the
# meanwhile, bellow lines must be there because the fields aren't present in the view, what crashes if the
# onchange returns a value for them
if ttype == 'sale':
del(res['value']['line_dr_ids'])
del(res['value']['pre_line'])
del(res['value']['payment_rate'])
elif ttype == 'purchase':
del(res['value']['line_cr_ids'])
del(res['value']['pre_line'])
del(res['value']['payment_rate'])
return res
def recompute_voucher_lines(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
@ -588,7 +601,7 @@ class account_voucher(osv.osv):
#set default values
default = {
'value': {'line_ids': [] ,'line_dr_ids': [] ,'line_cr_ids': [] ,'pre_line': False,},
'value': {'line_dr_ids': [] ,'line_cr_ids': [] ,'pre_line': False,},
}
#drop existing lines
@ -667,6 +680,7 @@ class account_voucher(osv.osv):
#voucher line creation
for line in account_move_lines:
if _remove_noise_in_o2m():
continue
@ -771,8 +785,10 @@ class account_voucher(osv.osv):
if account_id and account_id.tax_ids:
tax_id = account_id.tax_ids[0].id
vals = self.onchange_price(cr, uid, ids, line_ids, tax_id, partner_id, context)
vals['value'].update({'tax_id':tax_id,'amount': amount})
vals = {'value':{} }
if ttype in ('sale', 'purchase'):
vals = self.onchange_price(cr, uid, ids, line_ids, tax_id, partner_id, context)
vals['value'].update({'tax_id':tax_id,'amount': amount})
currency_id = False
if journal.currency:
currency_id = journal.currency.id
@ -782,9 +798,16 @@ class account_voucher(osv.osv):
vals[key].update(res[key])
return vals
def button_proforma_voucher(self, cr, uid, ids, context=None):
context = context or {}
wf_service = netsvc.LocalService("workflow")
for vid in ids:
wf_service.trg_validate(uid, 'account.voucher', vid, 'proforma_voucher', cr)
return {'type': 'ir.actions.act_window_close'}
def proforma_voucher(self, cr, uid, ids, context=None):
self.action_move_line_create(cr, uid, ids, context=context)
return {'type': 'ir.actions.act_window_close'}
return True
def action_cancel_draft(self, cr, uid, ids, context=None):
wf_service = netsvc.LocalService("workflow")
@ -842,7 +865,7 @@ class account_voucher(osv.osv):
res['account_id'] = account_id
return {'value':res}
def _sel_context(self, cr, uid, voucher_id,context=None):
def _sel_context(self, cr, uid, voucher_id, context=None):
"""
Select the context to use accordingly if it needs to be multicurrency or not.
@ -950,11 +973,11 @@ class account_voucher(osv.osv):
if amount_residual > 0:
account_id = line.voucher_id.company_id.expense_currency_exchange_account_id
if not account_id:
raise osv.except_osv(_('Warning!'),_("First you have to configure the 'Income Currency Rate' on the company, then create accounting entry for currency rate difference."))
raise osv.except_osv(_('Warning!'),_("First you have to configure the 'Expense Currency Rate' on the company, then create accounting entry for currency rate difference."))
else:
account_id = line.voucher_id.company_id.income_currency_exchange_account_id
if not account_id:
raise osv.except_osv(_('Warning!'),_("First you have to configure the 'Expense Currency Rate' on the company, then create accounting entry for currency rate difference."))
raise osv.except_osv(_('Warning!'),_("First you have to configure the 'Income Currency Rate' on the company, then create accounting entry for currency rate difference."))
# Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise
# the receivable/payable account may have a secondary currency, which render this field mandatory
account_currency_id = company_currency <> current_currency and current_currency or False
@ -1176,6 +1199,7 @@ class account_voucher(osv.osv):
account_id = voucher_brw.partner_id.property_account_receivable.id
else:
account_id = voucher_brw.partner_id.property_account_payable.id
sign = voucher_brw.type == 'payment' and -1 or 1
move_line = {
'name': write_off_name or name,
'account_id': account_id,
@ -1184,7 +1208,7 @@ class account_voucher(osv.osv):
'date': voucher_brw.date,
'credit': diff > 0 and diff or 0.0,
'debit': diff < 0 and -diff or 0.0,
'amount_currency': company_currency <> current_currency and voucher_brw.writeoff_amount or False,
'amount_currency': company_currency <> current_currency and (sign * -1 * voucher_brw.writeoff_amount) or False,
'currency_id': company_currency <> current_currency and current_currency or False,
'analytic_account_id': voucher_brw.analytic_id and voucher_brw.analytic_id.id or False,
}
@ -1268,7 +1292,9 @@ class account_voucher(osv.osv):
self.reconcile_send_note(cr, uid, [voucher.id], context=context)
return True
def copy(self, cr, uid, id, default={}, context=None):
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
default.update({
'state': 'draft',
'number': False,
@ -1295,17 +1321,17 @@ class account_voucher(osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
message = "%s <b>created</b>." % self._document_type[obj.type or False]
self.message_post(cr, uid, [obj.id], body=message, context=context)
self.message_post(cr, uid, [obj.id], body=message, subtype="account_voucher.mt_voucher", context=context)
def post_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
message = "%s '%s' is <b>posted</b>." % (self._document_type[obj.type or False], obj.move_id.name)
self.message_post(cr, uid, [obj.id], body=message, context=context)
self.message_post(cr, uid, [obj.id], body=message, subtype="account_voucher.mt_voucher", context=context)
def reconcile_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
message = "%s <b>reconciled</b>." % self._document_type[obj.type or False]
self.message_post(cr, uid, [obj.id], body=message, context=context)
self.message_post(cr, uid, [obj.id], body=message, subtype="account_voucher.mt_voucher", context=context)
account_voucher()

View File

@ -1,17 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data noupdate="1">
<!-- notify all employees of module installation -->
<record model="mail.message" id="module_install_notification">
<field name="model">mail.group</field>
<field name="res_id" ref="mail.group_all_employees"/>
<field name="type">notification</field>
<field name="subject">eInvoicing &amp; Payments application installed!</field>
<field name="body">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.
<field name="body"><![CDATA[
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.
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.</field>
<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>
<!-- mail: subtypes -->
<record id="mt_voucher" model="mail.message.subtype">
<field name="name">Status Change</field>
<field name="res_model">account.voucher</field>
</record>
</data>
</openerp>

View File

@ -34,6 +34,7 @@
</field>
</record>
<!-- where and when is this view used?? -->
<record model="ir.ui.view" id="view_voucher_form">
<field name="name">account.voucher.form</field>
<field name="model">account.voucher</field>

View File

@ -27,11 +27,12 @@ class invoice(osv.osv):
def invoice_pay_customer(self, cr, uid, ids, context=None):
if not ids: return []
mod,modid = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_dialog_form')
inv = self.browse(cr, uid, ids[0], context=context)
return {
'name':_("Pay Invoice"),
'view_mode': 'form',
'view_id': False,
'view_id': modid,
'view_type': 'form',
'res_model': 'account.voucher',
'type': 'ir.actions.act_window',
@ -41,13 +42,13 @@ class invoice(osv.osv):
'context': {
'default_partner_id': inv.partner_id.id,
'default_amount': inv.type in ('out_refund', 'in_refund') and -inv.residual or inv.residual,
'default_name':inv.name,
'default_number':inv.name,
'close_after_process': True,
'invoice_type':inv.type,
'invoice_id':inv.id,
'invoice_type': inv.type,
'invoice_id': inv.id,
'default_type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment',
'type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment'
}
}
}
invoice()

View File

@ -23,4 +23,4 @@ import account_voucher
import account_voucher_print
import account_voucher_sales_receipt
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,7 +1,8 @@
-
In order to check account voucher module in OpenERP I create a customer voucher
-
!record {model: account.voucher, id: account_voucher_voucherforaxelor0}:
!record {model: account.voucher, id: account_voucher_voucherforaxelor0, view: view_sale_receipt_form}:
type: sale
account_id: account.cash
amount: 1000.0
company_id: base.main_company
@ -47,7 +48,8 @@
-
Now I create a Vendor Voucher
-
!record {model: account.voucher, id: account_voucher_voucheraxelor0, view: False}:
!record {model: account.voucher, id: account_voucher_voucheraxelor0, view: view_voucher_filter_vendor}:
type: purchase
account_id: account.cash
amount: 1000.0
company_id: base.main_company

View File

@ -1,7 +1,8 @@
-
Demo for Account Voucher
-
!record {model: account.voucher, id: account_voucher_voucheraxelor0again}:
!record {model: account.voucher, id: account_voucher_voucheraxelor0again, view: view_sale_receipt_form}:
type: sale
account_id: account.cash
company_id: base.main_company
journal_id: account.bank_journal

View File

@ -216,6 +216,10 @@
assert move_line.credit == 63.00, "Debtor account has wrong entry."
elif move_line.amount_currency == 10.00:
assert move_line.debit == 9.00, "Writeoff amount is wrong."
elif move_line.amount_currency == 240.00:
assert move_line.debit == 216.00, "Bank entry is wrong."
else:
assert False, "Unrecognized journal entry"
-
I check the residual amount of Invoice1, should be 20 in amount_currency
-
@ -237,7 +241,7 @@
-
On the first April, I create the second voucher of payment with values 45 USD, journal USD,
-
!record {model: account.voucher, id: account_voucher_2_case1}:
!record {model: account.voucher, id: account_voucher_2_case1, view: view_vendor_receipt_form}:
account_id: account.cash
amount: 45.0
company_id: base.main_company
@ -323,8 +327,16 @@
assert move_line.debit == 4.75, "Writeoff amount is wrong."
elif move_line.debit == 11.5 and move_line.account_id.reconcile:
assert move_line.amount_currency == 0.0 and move_line.reconcile_id.id == reconcile_a, "Exchange difference entry for the invoice of 100$ is wrong"
elif move_line.credit == 11.5:
assert move_line.amount_currency == 0.0
elif move_line.debit == 31.0 and move_line.account_id.reconcile:
assert move_line.amount_currency == 0.0 and move_line.reconcile_id.id == reconcile_b, "Exchange difference entry for the invoice of 200$ is wrong"
elif move_line.credit == 31.0:
assert move_line.amount_currency == 0.0
elif move_line.amount_currency == 45.00:
assert move_line.debit == 42.75, "Bank entry is wrong."
else:
assert False, "Unrecognized journal entry"
-
I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual and paid
-

View File

@ -164,7 +164,7 @@
-
I check that my currency rate difference is correct. 0 in debit with no amount_currency
-
I check that my writeoff is correct. 11.05 credit and 13.26 amount_currency
I check that my writeoff is correct. 11.05 credit and -13.26 amount_currency
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_19'))])
@ -179,7 +179,7 @@
elif move_line.debit == 0.00 and move_line.credit == 0.00:
assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
elif move_line.credit == 10.61:
assert move_line.amount_currency == 13.26, "Writeoff amount is wrong."
assert move_line.amount_currency == -13.26, "Writeoff amount is wrong."
else:
assert False, "Wrong entry"
-

View File

@ -1,7 +1,7 @@
-
Creating a Voucher Receipt for partner Seagate with amount 30000.0
-
!record {model: account.voucher, id: account_voucher_seagate_0}:
!record {model: account.voucher, id: account_voucher_seagate_0, view: view_sale_receipt_form}:
account_id: account.a_recv
amount: 30000.0
company_id: base.main_company

View File

@ -71,6 +71,7 @@
</group>
<notebook>
<page string="Payment Information">
<label for="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}"/>
<field name="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
<tree string="Open Supplier Journal Entries" editable="bottom" colors="gray:amount==0">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
@ -84,6 +85,7 @@
<field name="amount" sum="Total Allocation"/>
</tree>
</field>
<label for="line_cr_ids" attrs="{'invisible': [('type', '=', 'payment')]}"/>
<field name="line_cr_ids" attrs="{'invisible': [('type', '=', 'payment')]}" context="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
<tree string="Open Customer Journal Entries" editable="bottom" colors="gray:amount==0">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
@ -155,6 +157,7 @@
</group>
<notebook>
<page string="Payment Information">
<label for="line_dr_ids"/>
<field name="line_dr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}">
<tree string="Supplier Invoices and Outstanding transactions" editable="bottom" colors="gray:amount==0">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
@ -170,6 +173,7 @@
<field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)"/>
</tree>
</field>
<label for="line_cr_ids" attrs="{'invisible': [('pre_line','=',False)]}"/>
<field name="line_cr_ids" attrs="{'invisible': [('pre_line','=',False)]}" context="{'journal_id':journal_id, 'partner_id':partner_id}">
<tree string="Credits" editable="bottom" colors="gray:amount==0">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
@ -280,6 +284,111 @@
<menuitem action="action_vendor_payment" icon="STOCK_JUSTIFY_FILL" sequence="12"
id="menu_action_vendor_payment" parent="account.menu_finance_payables"/>
<record model="ir.ui.view" id="view_vendor_receipt_dialog_form">
<field name="name">account.voucher.receipt.dialog.form</field>
<field name="model">account.voucher</field>
<field name="priority">30</field>
<field name="arch" type="xml">
<form string="Payment" version="7.0">
<group>
<group>
<field name="state" invisible="1"/>
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
<label for="amount" string="Paid Amount"/>
<div>
<field name="amount" class="oe_inline"
invisible="context.get('line_type', False)"
on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
<field name="currency_id" class="oe_inline"/>
</div>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
invisible="context.get('line_type', False)"
widget="selection"
on_change="onchange_journal(journal_id, line_cr_ids, False, partner_id, date, amount, type, company_id, context)"
string="Payment Method"/>
</group>
<group>
<field name="date" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
<field name="reference" invisible="context.get('line_type', False)" string="Payment Ref" placeholder="e.g. 003/10"/>
<field name="name" colspan="2" invisible="context.get('line_type', False)" placeholder="e.g. Invoice SAJ/0042"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="account_id"
widget="selection"
invisible="True"/>
<field name="pre_line" invisible="1"/>
<field name="type" invisible="True"/>
</group>
</group>
<notebook invisible="1">
<page string="Payment Information" groups="base.group_user">
<label for="line_cr_ids"/>
<field name="line_cr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
<tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
required="1"
groups="account.group_account_user"/>
<field name="account_id" groups="base.group_no_one" domain="[('type','=','receivable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="amount_original" readonly="1"/>
<field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
<field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
<field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
</tree>
</field>
<label for="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}"/>
<field name="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}" context="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
<tree string="Credits" editable="bottom" colors="gray:amount==0">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
required="1"/>
<field name="account_id" groups="base.group_no_one" domain="[('type','=','receivable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="amount_original" readonly="1"/>
<field name="amount_unreconciled" readonly="1"/>
<field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)"/>
<field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
</tree>
</field>
<group col="3">
<group>
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="4" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
<field name="is_multi_currency" invisible="1"/>
<field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
<field name="payment_rate_currency_id" colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
<field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
</group>
<group>
<field name="writeoff_amount"/>
<field name="payment_option" required="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"
groups="analytic.group_analytic_accounting"/>
</group>
</group>
</page>
</notebook>
<footer>
<button name="button_proforma_voucher" string="Pay" class="oe_highlight" type="object"/> or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_vendor_receipt_form">
<field name="name">account.voucher.receipt.form</field>
<field name="model">account.voucher</field>
@ -293,7 +402,7 @@
<field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
</header>
<sheet>
<h1><field name="number"/></h1>
<h1 attrs="{'invisible': [('number','=',False)]}"><field name="number"/></h1>
<group>
<group>
<field name="partner_id" domain="[('customer','=',True)]" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
@ -325,9 +434,9 @@
<field name="type" invisible="True"/>
</group>
</group>
<notebook>
<page string="Payment Information" groups="base.group_user">
<label for="line_cr_ids"/>
<field name="line_cr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
<tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
@ -344,6 +453,7 @@
<field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
</tree>
</field>
<label for="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}"/>
<field name="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}" context="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
<tree string="Credits" editable="bottom" colors="gray:amount==0">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"

View File

@ -72,6 +72,7 @@
<h1><label for="number" string="Sale Receipt"/> <field name="number" class="oe_inline" readonly="1"/></h1>
<group>
<group>
<field name="type" invisible="True"/>
<field name="partner_id" domain="[('customer','=',True)]" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": true}'/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
@ -80,9 +81,9 @@
<field name="date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
<field name="name"/>
<field name="paid" invisible="1"/>
<field name="paid_amount_in_company_currency" invisible="1"/>
<field name="currency_id" invisible="1"/>
</group>
<field name="type" invisible="True"/>
</group>
<notebook>
<page string="Sales Information">
@ -235,6 +236,7 @@
widget="selection"
on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id, date, amount, type, company_id, context)"
groups="account.group_account_user"/>
<field name="paid_amount_in_company_currency" invisible="1"/>
</group>
</group>
<notebook>

View File

@ -38,11 +38,11 @@ that have no counterpart in the general financial accounts.
'security/analytic_security.xml',
'security/ir.model.access.csv',
'analytic_sequence.xml',
'analytic_view.xml'
'analytic_view.xml',
'analytic_data.xml'
],
'demo': [],
'installable': True,
'auto_install': False,
'certificate' : '00462253285027988541',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -125,7 +125,8 @@ class account_analytic_account(osv.osv):
if account.company_id:
if account.company_id.currency_id.id != value:
raise osv.except_osv(_('Error!'), _("If you set a company, the currency selected has to be the same as it's currency. \nYou can remove the company belonging, and thus change the currency, only on analytic account of type 'view'. This can be really usefull for consolidation purposes of several companies charts with different currencies, for example."))
return cr.execute("""update account_analytic_account set currency_id=%s where id=%s""", (value, account.id, ))
if value:
return cr.execute("""update account_analytic_account set currency_id=%s where id=%s""", (value, account.id, ))
def _currency(self, cr, uid, ids, field_name, arg, context=None):
result = {}
@ -163,7 +164,7 @@ class account_analytic_account(osv.osv):
'date': fields.date('Date End', select=True),
'company_id': fields.many2one('res.company', 'Company', required=False), #not required because we want to allow different companies to use the same chart of account, except for leaf accounts.
'state': fields.selection([('template', 'Template'),('draft','New'),('open','In Progress'), ('cancelled', 'Cancelled'),('pending','To Renew'),('close','Closed')], 'Status', required=True,),
'currency_id': fields.function(_currency, fnct_inv=_set_company_currency,
'currency_id': fields.function(_currency, fnct_inv=_set_company_currency, #the currency_id field is readonly except if it's a view account and if there is no company
store = {
'res.company': (_get_analytic_account, ['currency_id'], 10),
}, string='Currency', type='many2one', relation='res.currency'),
@ -284,7 +285,8 @@ class account_analytic_account(osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
self.message_post(cr, uid, [obj.id], body=_("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name), context=context)
self.message_post(cr, uid, [obj.id], body=_("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name),
subtype="analytic.mt_account_status", context=context)
account_analytic_account()

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!-- mail: subtypes -->
<record id="mt_account_status" model="mail.message.subtype">
<field name="name">Status Change</field>
<field name="res_model">account.analytic.account</field>
</record>
</data>
</openerp>

Some files were not shown because too many files have changed in this diff Show More