[MERGE]: Merge with lp:openobject-addons

bzr revid: mma@tinyerp.com-20111129054033-105jrfgu7ac6xd2p
This commit is contained in:
Mayur Maheshwari (OpenERP) 2011-11-29 11:10:33 +05:30
commit 5e618c6478
655 changed files with 17132 additions and 6635 deletions

View File

@ -35,5 +35,5 @@ import product
import ir_sequence
import company
import res_currency
import edi
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -53,7 +53,7 @@ module named account_voucher.
'website': 'http://www.openerp.com',
'images' : ['images/accounts.jpeg','images/bank_statement.jpeg','images/cash_register.jpeg','images/chart_of_accounts.jpeg','images/customer_invoice.jpeg','images/journal_entries.jpeg'],
'init_xml': [],
"depends" : ["base_setup", "product", "analytic", "process","board"],
"depends" : ["base_setup", "product", "analytic", "process", "board", "edi"],
'update_xml': [
'security/account_security.xml',
'security/ir.model.access.csv',
@ -123,7 +123,9 @@ module named account_voucher.
'board_account_view.xml',
"wizard/account_report_profit_loss_view.xml",
"wizard/account_report_balance_sheet_view.xml",
"account_bank_view.xml"
"edi/invoice_action_data.xml",
"account_bank_view.xml",
"account_pre_install.yml"
],
'demo_xml': [
'demo/account_demo.xml',
@ -139,16 +141,15 @@ module named account_voucher.
'test/account_change_currency.yml',
'test/chart_of_account.yml',
'test/account_period_close.yml',
'test/account_fiscalyear_close_state.yml',
'test/account_use_model.yml',
'test/account_validate_account_move.yml',
'test/account_fiscalyear_close.yml',
'test/account_bank_statement.yml',
'test/account_cash_statement.yml',
'test/test_edi_invoice.yml',
'test/account_report.yml',
],
'test/account_fiscalyear_close_state.yml', #last test, as it will definitively close the demo fiscalyear
],
'installable': True,
'active': False,
'certificate': '0080331923549',

View File

@ -404,7 +404,7 @@ class account_account(osv.osv):
return True
_columns = {
'name': fields.char('Name', size=128, required=True, select=True),
'name': fields.char('Name', size=256, required=True, select=True),
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."),
'code': fields.char('Code', size=64, required=True, select=1),
'type': fields.selection([
@ -431,9 +431,9 @@ class account_account(osv.osv):
'debit': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Debit', multi='balance'),
'foreign_balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Foreign Balance', multi='balance',
help="Total amount (in Secondary currency) for transactions held in secondary currency for this account."),
'adjusted_balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Adjusted Balance', multi='balance',
'adjusted_balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Adjusted Balance', multi='balance',
help="Total amount (in Company currency) for transactions held in secondary currency for this account."),
'unrealized_gain_loss': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Unrealized Gain or Loss', multi='balance',
'unrealized_gain_loss': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Unrealized Gain or Loss', multi='balance',
help="Value of Loss or Gain due to changes in exchange rate when doing multi-currency transactions."),
'reconcile': fields.boolean('Allow Reconciliation', help="Check this box if this account allows reconciliation of journal items."),
'exchange_rate': fields.related('currency_id', 'rate', type='float', string='Exchange Rate', digits=(12,6)),
@ -461,7 +461,7 @@ class account_account(osv.osv):
}
_defaults = {
'type': 'view',
'type': 'other',
'reconcile': False,
'active': True,
'currency_mode': 'current',
@ -716,6 +716,19 @@ class account_journal(osv.osv):
_order = 'code'
def _check_currency(self, cr, uid, ids, context=None):
for journal in self.browse(cr, uid, ids, context=context):
if journal.currency:
if journal.default_credit_account_id and not journal.default_credit_account_id.currency_id.id == journal.currency.id:
return False
if journal.default_debit_account_id and not journal.default_debit_account_id.currency_id.id == journal.currency.id:
return False
return True
_constraints = [
(_check_currency, 'Configuration error! The 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:
@ -846,21 +859,8 @@ class account_fiscalyear(osv.osv):
'state': 'draft',
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
_order = "date_start"
_order = "date_start, id"
def _check_fiscal_year(self, cr, uid, ids, context=None):
current_fiscal_yr = self.browse(cr, uid, ids, context=context)[0]
obj_fiscal_ids = self.search(cr, uid, [('company_id', '=', current_fiscal_yr.company_id.id)], context=context)
obj_fiscal_ids.remove(ids[0])
data_fiscal_yr = self.browse(cr, uid, obj_fiscal_ids, context=context)
for old_fy in data_fiscal_yr:
if old_fy.company_id.id == current_fiscal_yr['company_id'].id:
# Condition to check if the current fiscal year falls in between any previously defined fiscal year
if old_fy.date_start <= current_fiscal_yr['date_start'] <= old_fy.date_stop or \
old_fy.date_start <= current_fiscal_yr['date_stop'] <= old_fy.date_stop:
return False
return True
def _check_duration(self, cr, uid, ids, context=None):
obj_fy = self.browse(cr, uid, ids[0], context=context)
@ -869,8 +869,7 @@ class account_fiscalyear(osv.osv):
return True
_constraints = [
(_check_duration, 'Error! The start date of the fiscal year must be before his end date.', ['date_start','date_stop']),
(_check_fiscal_year, 'Error! You can not define overlapping fiscal years for the same company.',['date_start', 'date_stop'])
(_check_duration, 'Error! The start date of the fiscal year must be before his end date.', ['date_start','date_stop'])
]
def create_period3(self, cr, uid, ids, context=None):
@ -905,6 +904,10 @@ class account_fiscalyear(osv.osv):
return True
def find(self, cr, uid, dt=None, exception=True, context=None):
res = self.finds(cr, uid, dt, exception, context=context)
return res and res[0] or False
def finds(self, cr, uid, dt=None, exception=True, context=None):
if context is None: context = {}
if not dt:
dt = time.strftime('%Y-%m-%d')
@ -919,8 +922,8 @@ class account_fiscalyear(osv.osv):
if exception:
raise osv.except_osv(_('Error !'), _('No fiscal year defined for this date !\nPlease create one.'))
else:
return False
return ids[0]
return []
return ids
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
if args is None:
@ -1683,13 +1686,15 @@ class account_tax_code(osv.osv):
if context.get('state', 'all') == 'all':
move_state = ('draft', 'posted', )
if context.get('fiscalyear_id', False):
fiscalyear_id = context['fiscalyear_id']
fiscalyear_id = [context['fiscalyear_id']]
else:
fiscalyear_id = self.pool.get('account.fiscalyear').find(cr, uid, exception=False)
fiscalyear_id = self.pool.get('account.fiscalyear').finds(cr, uid, exception=False)
where = ''
where_params = ()
if fiscalyear_id:
pids = map(lambda x: str(x.id), self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_id).period_ids)
pids = []
for fy in fiscalyear_id:
pids += map(lambda x: str(x.id), self.pool.get('account.fiscalyear').browse(cr, uid, fy).period_ids)
if pids:
where = ' AND line.period_id IN %s AND move.state IN %s '
where_params = (tuple(pids), move_state)
@ -2001,8 +2006,11 @@ class account_tax(osv.osv):
cur_price_unit+=amount2
return res
def compute_all(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None):
def compute_all(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, force_excluded=False):
"""
:param force_excluded: boolean used to say that we don't want to consider the value of field price_include of
tax. It's used in encoding by line where you don't matter if you encoded a tax with that boolean to True or
False
RETURN: {
'total': 0.0, # Total without taxes
'total_included: 0.0, # Total with taxes
@ -2014,10 +2022,10 @@ class account_tax(osv.osv):
tin = []
tex = []
for tax in taxes:
if tax.price_include:
tin.append(tax)
else:
if not tax.price_include or force_excluded:
tex.append(tax)
else:
tin.append(tax)
tin = self.compute_inv(cr, uid, tin, price_unit, quantity, address_id=address_id, product=product, partner=partner)
for r in tin:
totalex -= r.get('amount', 0.0)
@ -2183,6 +2191,7 @@ class account_model(osv.osv):
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
pt_obj = self.pool.get('account.payment.term')
period_obj = self.pool.get('account.period')
if context is None:
context = {}
@ -2190,14 +2199,14 @@ class account_model(osv.osv):
if datas.get('date', False):
context.update({'date': datas['date']})
period_id = self.pool.get('account.period').find(cr, uid, dt=context.get('date', False))
if not period_id:
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
move_date = context.get('date', time.strftime('%Y-%m-%d'))
move_date = datetime.strptime(move_date,"%Y-%m-%d")
for model in self.browse(cr, uid, ids, context=context):
ctx = context.copy()
ctx.update({'company_id': model.company_id.id})
period_ids = period_obj.find(cr, uid, dt=context.get('date', False), context=ctx)
period_id = period_ids and period_ids[0] or False
ctx.update({'journal_id': model.journal_id.id,'period_id': period_id})
try:
entry['name'] = model.name%{'year': move_date.strftime('%Y'), 'month': move_date.strftime('%m'), 'date': move_date.strftime('%Y-%m')}
except:
@ -2246,9 +2255,7 @@ class account_model(osv.osv):
'date': context.get('date',time.strftime('%Y-%m-%d')),
'date_maturity': date_maturity
})
c = context.copy()
c.update({'journal_id': model.journal_id.id,'period_id': period_id})
account_move_line_obj.create(cr, uid, val, context=c)
account_move_line_obj.create(cr, uid, val, context=ctx)
return move_ids
@ -2395,7 +2402,7 @@ class account_account_template(osv.osv):
_description ='Templates for Accounts'
_columns = {
'name': fields.char('Name', size=128, required=True, select=True),
'name': fields.char('Name', size=256, required=True, select=True),
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."),
'code': fields.char('Code', size=64, select=1),
'type': fields.selection([

View File

@ -42,8 +42,12 @@ class bank(osv.osv):
return (bank.bank_name or '') + ' ' + bank.acc_number
def post_write(self, cr, uid, ids, context={}):
if isinstance(ids, (int, long)):
ids = [ids]
obj_acc = self.pool.get('account.account')
obj_data = self.pool.get('ir.model.data')
for bank in self.browse(cr, uid, ids, context):
if bank.company_id and not bank.journal_id:
# Find the code and parent of the bank account to create
@ -104,3 +108,5 @@ class bank(osv.osv):
self.write(cr, uid, [bank.id], {'journal_id': journal_id}, context=context)
return True
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -57,7 +57,7 @@
<record id="category_accounting_configuration" model="ir.actions.todo.category">
<field name="name">Accounting</field>
<field name="sequence">5</field>
</record>
</record>
<record id="account_configuration_installer_todo" model="ir.actions.todo">
<field name="action_id" ref="action_account_configuration_installer"/>

View File

@ -251,7 +251,7 @@ class account_invoice(osv.osv):
'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'journal_id': fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'company_id': fields.many2one('res.company', 'Company', required=True, change_default=True, readonly=True, states={'draft':[('readonly',False)]}),
'check_total': fields.float('Total', digits_compute=dp.get_precision('Account'), states={'open':[('readonly',True)],'close':[('readonly',True)]}),
'check_total': fields.float('Verification Total', digits_compute=dp.get_precision('Account'), states={'open':[('readonly',True)],'close':[('readonly',True)]}),
'reconciled': fields.function(_reconciled, string='Paid/Reconciled', type='boolean',
store={
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 50), # Check if we can remove ?
@ -286,6 +286,9 @@ class account_invoice(osv.osv):
'internal_number': False,
'user_id': lambda s, cr, u, c: u,
}
_sql_constraints = [
('number_uniq', 'unique(number, company_id)', 'Invoice Number must be unique per Company!'),
]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
journal_obj = self.pool.get('account.journal')
@ -795,6 +798,7 @@ class account_invoice(osv.osv):
"""Creates invoice related analytics and financial move lines"""
ait_obj = self.pool.get('account.invoice.tax')
cur_obj = self.pool.get('res.currency')
period_obj = self.pool.get('account.period')
context = {}
for inv in self.browse(cr, uid, ids):
if not inv.journal_id.sequence_id:
@ -923,10 +927,10 @@ class account_invoice(osv.osv):
'narration':inv.comment
}
period_id = inv.period_id and inv.period_id.id or False
ctx.update({'company_id': inv.company_id.id})
if not period_id:
period_ids = self.pool.get('account.period').search(cr, uid, [('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d')), ('company_id', '=', inv.company_id.id)])
if period_ids:
period_id = period_ids[0]
period_ids = period_obj.find(cr, uid, inv.date_invoice, context=ctx)
period_id = period_ids and period_ids[0] or False
if period_id:
move['period_id'] = period_id
for i in line:
@ -1323,9 +1327,9 @@ class account_invoice_line(osv.osv):
raise osv.except_osv(_('No Partner Defined !'),_("You must first select a partner !") )
if not product:
if type in ('in_invoice', 'in_refund'):
return {'value': {'categ_id': False}, 'domain':{'product_uom':[]}}
return {'value': {}, 'domain':{'product_uom':[]}}
else:
return {'value': {'price_unit': 0.0, 'categ_id': False}, 'domain':{'product_uom':[]}}
return {'value': {'price_unit': 0.0}, 'domain':{'product_uom':[]}}
part = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
fpos_obj = self.pool.get('account.fiscal.position')
fpos = fposition_id and fpos_obj.browse(cr, uid, fposition_id, context=context) or False
@ -1378,7 +1382,6 @@ class account_invoice_line(osv.osv):
if res2:
domain = {'uos_id':[('category_id','=',res2 )]}
result['categ_id'] = res.categ_id.id
res_final = {'value':result, 'domain':domain}
if not company_id or not currency_id:

View File

@ -153,7 +153,7 @@
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/>
<newline/>
<field string="Supplier" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id" context="{'default_partner_id': partner_id}"/>
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
<newline/>
<field name="date_invoice"/>
@ -264,7 +264,7 @@
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/>
<newline/>
<field string="Customer" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" groups="base.group_user" context="{'search_default_customer': 1}"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id" context="{'default_partner_id': partner_id}"/>
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
<newline/>
<field name="date_invoice"/>
@ -432,7 +432,7 @@
<field name="view_mode">tree,form,calendar,graph</field>
<field eval="False" name="view_id"/>
<field name="domain">[('type','=','out_invoice')]</field>
<field name="context">{'type':'out_invoice', 'journal_type': 'sale'}</field>
<field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
<field name="help">With Customer Invoices you can create and manage sales invoices issued to your customers. OpenERP can also generate draft invoices automatically from sales orders or deliveries. You should only confirm them before sending them to your customers.</field>
</record>
@ -460,7 +460,7 @@
<field name="view_mode">tree,form,calendar,graph</field>
<field eval="False" name="view_id"/>
<field name="domain">[('type','=','in_invoice')]</field>
<field name="context">{'type':'in_invoice', 'journal_type': 'purchase'}</field>
<field name="context">{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
<field name="help">With Supplier Invoices you can enter and manage invoices issued by your suppliers. OpenERP can also generate draft invoices automatically from purchase orders or receipts. This way, you can control the invoice from your supplier according to what you purchased or received.</field>
</record>
@ -473,7 +473,7 @@
<field name="view_mode">tree,form,calendar,graph</field>
<field eval="False" name="view_id"/>
<field name="domain">[('type','=','out_refund')]</field>
<field name="context">{'type':'out_refund', 'journal_type': 'sale_refund'}</field>
<field name="context">{'default_type':'out_refund', 'type':'out_refund', 'journal_type': 'sale_refund'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
<field name="help">With Customer Refunds you can manage the credit notes for your customers. A refund is a document that credits an invoice completely or partially. You can easily generate refunds and reconcile them directly from the invoice form.</field>
</record>
@ -499,7 +499,7 @@
<field name="view_mode">tree,form,calendar,graph</field>
<field eval="False" name="view_id"/>
<field name="domain">[('type','=','in_refund')]</field>
<field name="context">{'type':'in_refund', 'journal_type': 'purchase_refund'}</field>
<field name="context">{'default_type': 'in_refund', 'type': 'in_refund', 'journal_type': 'purchase_refund'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
<field name="help">With Supplier Refunds you can manage the credit notes you receive from your suppliers. A refund is a document that credits an invoice completely or partially. You can easily generate refunds and reconcile them directly from the invoice form.</field>
</record>

View File

@ -1084,8 +1084,6 @@ class account_move_line(osv.osv):
f.set("invisible", "context.get('journal_id', False)")
elif field in ('period_id',):
f.set("invisible", "context.get('period_id', False)")
else:
f.set('invisible', "context.get('visible_id') not in %s" % (fields.get(field)))
orm.setup_modifiers(f, fields_get[field], context=context,
in_tree_view=True)
@ -1245,6 +1243,12 @@ class account_move_line(osv.osv):
m = move_obj.browse(cr, uid, vals['move_id'])
context['journal_id'] = m.journal_id.id
context['period_id'] = m.period_id.id
#we need to treat the case where a value is given in the context for period_id as a string
if 'period_id' not in context or not isinstance(context.get('period_id', ''), (int, long)):
period_candidate_ids = self.pool.get('account.period').name_search(cr, uid, name=context.get('period_id',''))
if len(period_candidate_ids) != 1:
raise osv.except_osv(_('Encoding error'), _('No period found or period given is ambigous.'))
context['period_id'] = period_candidate_ids[0][0]
self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
move_id = vals.get('move_id', False)
journal = journal_obj.browse(cr, uid, context['journal_id'], context=context)
@ -1326,7 +1330,7 @@ class account_move_line(osv.osv):
base_sign = 'base_sign'
tax_sign = 'tax_sign'
tmp_cnt = 0
for tax in tax_obj.compute_all(cr, uid, [tax_id], total, 1.00).get('taxes'):
for tax in tax_obj.compute_all(cr, uid, [tax_id], total, 1.00, force_excluded=True).get('taxes'):
#create the base movement
if tmp_cnt == 0:
if tax[base_code]:
@ -1338,8 +1342,6 @@ class account_move_line(osv.osv):
else:
data = {
'move_id': vals['move_id'],
'journal_id': vals['journal_id'],
'period_id': vals['period_id'],
'name': tools.ustr(vals['name'] or '') + ' ' + tools.ustr(tax['name'] or ''),
'date': vals['date'],
'partner_id': vals.get('partner_id',False),
@ -1356,8 +1358,6 @@ class account_move_line(osv.osv):
#create the VAT movement
data = {
'move_id': vals['move_id'],
'journal_id': vals['journal_id'],
'period_id': vals['period_id'],
'name': tools.ustr(vals['name'] or '') + ' ' + tools.ustr(tax['name'] or ''),
'date': vals['date'],
'partner_id': vals.get('partner_id',False),

View File

@ -0,0 +1,22 @@
-
I configure automatically if the country is set on the company, mainly for online offers.
-
!python {model: account.installer}: |
modules = self.pool.get('ir.module.module')
wizards = self.pool.get('ir.actions.todo')
wiz = wizards.browse(cr, uid, ref('account.account_configuration_installer_todo'))
part = self.pool.get('res.partner').browse(cr, uid, ref('base.main_partner'))
# if we know the country and the wizard has not yet been executed, we do it
if (part.country.id) and (wiz.state=='open'):
mod = 'l10n_'+part.country.code.lower()
ids = modules.search(cr, uid, [ ('name','=',mod) ], context=context)
if ids:
wizards.write(cr, uid, [ref('account.account_configuration_installer_todo')], {
'state': 'done'
})
wiz_id = self.create(cr, uid, {
'charts': mod
})
self.execute_simple(cr, uid, [wiz_id])
modules.state_update(cr, uid, ids,
'to install', ['uninstalled'], context=context)

View File

@ -19,6 +19,7 @@
rml="account/report/account_print_invoice.rml"
string="Invoices"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/',''))"
usage="default"
multi="True"/>
<report id="account_transfers" model="account.transfer" name="account.transfer" string="Transfers" xml="account/report/transfer.xml" xsl="account/report/transfer.xsl"/>
<report auto="False" id="account_intracom" menu="False" model="account.move.line" name="account.intracom" string="IntraCom"/>

View File

@ -1235,8 +1235,8 @@
</group>
<newline/>
<group>
<field name="journal_id" widget="selection" context="{'journal_id':self, 'visible_id':self, 'normal_view':False}"/>
<field name="period_id" context="{'period_id':self, 'search_default_period_id':self}"/>
<field name="journal_id" widget="selection" context="{'journal_id':self}"/>
<field name="period_id" context="{'period_id':self}"/>
</group>
<newline/>
<group expand="0" string="Group By...">
@ -1306,7 +1306,6 @@
<field name="model">account.account</field>
<field name="name">Open Journal Items</field>
<field eval="'ir.actions.act_window,%d'%action_move_line_select" name="value"/>
<field eval="True" name="object"/>
</record>
<!--
Account.Entry Edition
@ -1584,7 +1583,12 @@
context="{'search_default_account_id':[active_id], 'search_default_unreconciled':1, 'default_account_id': active_id}"
src_model="account.account"/>
<act_window domain="[('reconcile_id', '=', active_id)]" id="act_account_acount_move_line_reconcile_open" name="Reconciled entries" res_model="account.move.line" src_model="account.move.reconcile"/>
<act_window
domain="[('reconcile_id', '=', active_id)]"
id="act_account_acount_move_line_reconcile_open"
name="Reconciled entries"
res_model="account.move.line"
src_model="account.move.reconcile"/>
<!--
@ -1626,7 +1630,7 @@
<tree string="Journal Entry Model Line" editable="bottom">
<field name="sequence"/>
<field name="name"/>
<field name="account_id"/>
<field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation'), ('company_id', '=', parent.company_id)]"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="partner_id"/>
<field name="debit"/>
@ -1645,12 +1649,12 @@
<form string="Journal Entry Model Line">
<field colspan="4" name="name" select="1"/>
<field name="sequence"/>
<field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="account_id" domain="[('type','&lt;&gt;','view'), ('type','&lt;&gt;','consolidation'), ('company_id', '=', parent.company_id)]"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="partner_id"/>
<field name="debit" select="1"/>
<field name="credit" select="1"/>
<field name="quantity"/>
<field name="quantity"/>
<field name="date_maturity"/>
</form>
</field>
@ -2017,7 +2021,6 @@
<field name="model">account.tax.code</field>
<field name="name">Tax Details</field>
<field eval="'ir.actions.act_window,%d'%action_tax_code_line_open" name="value"/>
<field eval="True" name="object"/>
</record>
@ -2039,7 +2042,14 @@
res_model="account.move.line"
src_model="account.journal"/>
<act_window context="{'search_default_reconcile_id':False, '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" res_model="account.move.line" src_model="res.partner" groups="base.group_extended"/>
<act_window
context="{'search_default_reconcile_id':False, '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"
res_model="account.move.line"
src_model="res.partner"
groups="base.group_extended"/>
<act_window context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}" id="act_account_partner_account_move" name="Journal Items" res_model="account.move.line" src_model="res.partner" groups="account.group_account_user"/>

View File

@ -30,6 +30,7 @@
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('type','=','liquidity')]</field>
<field name="context">{'default_type': 'liquidity'}</field>
<field name="view_id" ref="account.view_treasory_graph"/>
</record>
<record id="board_account_form" model="ir.ui.view">
@ -38,17 +39,16 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Account Board">
<hpaned>
<child1>
<action colspan="4" height="160" width="400" name="%(account.action_invoice_tree1)d" string="Customer Invoices to Approve" domain="[('state','in',('draft','proforma2')), ('type','=','out_invoice')]"/>
<action colspan="4" height="160" width="400" name="%(action_company_analysis_tree)d" string="Company Analysis" groups="account.group_account_manager"/>
</child1>
<child2>
<action colspan="4" height="220" name="%(action_treasory_graph)d" string="Treasury" groups="account.group_account_manager,account.group_account_user"/>
<action colspan="4" height="220" name="%(action_aged_receivable)d" string="Aged Receivables" groups="account.group_account_manager,account.group_account_user"/>
<!-- <action colspan="4" height="220" name="%(action_aged_income)d" string="Aged income"/> -->
</child2>
</hpaned>
<board style="2-1">
<column>
<action name="%(account.action_invoice_tree1)d" string="Customer Invoices to Approve" domain="[('state','in',('draft','proforma2')), ('type','=','out_invoice')]"/>
<action name="%(action_company_analysis_tree)d" string="Company Analysis"/>
</column>
<column>
<action name="%(action_treasory_graph)d" string="Treasury"/> <!--groups="account.group_account_manager,account.group_account_user"-->
<action name="%(action_aged_receivable)d" string="Aged Receivables"/> <!--groups="account.group_account_manager,account.group_account_user"-->
</column>
</board>
</form>
</field>
</record>

View File

@ -24,6 +24,7 @@ from osv import fields, osv
class res_company(osv.osv):
_inherit = "res.company"
_columns = {
'paypal_account': fields.char("Paypal Account", size=128, help="Paypal username (usually email) for receiving online payments."),
'overdue_msg': fields.text('Overdue Payments Message', translate=True),
'property_reserve_and_surplus_account': fields.property(
'account.account',

View File

@ -24,6 +24,7 @@
<field name="arch" type="xml">
<field name="currency_id" position="after">
<field name="property_reserve_and_surplus_account" colspan="2"/>
<field name="paypal_account" />
</field>
</field>
</record>

View File

@ -7,7 +7,7 @@
-->
<record id="data_fiscalyear" model="account.fiscalyear">
<field eval="'Fiscal Year '+time.strftime('%Y')" name="name"/>
<field eval="'Fiscal Year X '+time.strftime('%Y')" name="name"/>
<field eval="'FY'+time.strftime('%Y')" name="code"/>
<field eval="time.strftime('%Y')+'-01-01'" name="date_start"/>
<field eval="time.strftime('%Y')+'-12-31'" name="date_stop"/>
@ -20,7 +20,7 @@
<record id="period_1" model="account.period">
<field eval="'01/'+time.strftime('%Y')" name="code"/>
<field eval="'01/'+time.strftime('%Y')" name="name"/>
<field eval="'X 01/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-01-01'" name="date_start"/>
@ -29,7 +29,7 @@
</record>
<record id="period_2" model="account.period">
<field eval="'02/'+time.strftime('%Y')" name="code"/>
<field eval="'02/'+time.strftime('%Y')" name="name"/>
<field eval="'X 02/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-02-01'" name="date_start"/>
@ -38,7 +38,7 @@
</record>
<record id="period_3" model="account.period">
<field eval="'03/'+time.strftime('%Y')" name="code"/>
<field eval="'03/'+time.strftime('%Y')" name="name"/>
<field eval="'X 03/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-03-01'" name="date_start"/>
@ -47,7 +47,7 @@
</record>
<record id="period_4" model="account.period">
<field eval="'04/'+time.strftime('%Y')" name="code"/>
<field eval="'04/'+time.strftime('%Y')" name="name"/>
<field eval="'X 04/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-04-01'" name="date_start"/>
@ -56,7 +56,7 @@
</record>
<record id="period_5" model="account.period">
<field eval="'05/'+time.strftime('%Y')" name="code"/>
<field eval="'05/'+time.strftime('%Y')" name="name"/>
<field eval="'X 05/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-05-01'" name="date_start"/>
@ -65,7 +65,7 @@
</record>
<record id="period_6" model="account.period">
<field eval="'06/'+time.strftime('%Y')" name="code"/>
<field eval="'06/'+time.strftime('%Y')" name="name"/>
<field eval="'X 06/'+time.strftime('%Y')" name="name"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="True" name="special"/>
<field eval="time.strftime('%Y')+'-06-01'" name="date_start"/>
@ -74,7 +74,7 @@
</record>
<record id="period_7" model="account.period">
<field eval="'07/'+time.strftime('%Y')" name="code"/>
<field eval="'07/'+time.strftime('%Y')" name="name"/>
<field eval="'X 07/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-07-01'" name="date_start"/>
@ -83,7 +83,7 @@
</record>
<record id="period_8" model="account.period">
<field eval="'08/'+time.strftime('%Y')" name="code"/>
<field eval="'08/'+time.strftime('%Y')" name="name"/>
<field eval="'X 08/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-08-01'" name="date_start"/>
@ -92,7 +92,7 @@
</record>
<record id="period_9" model="account.period">
<field eval="'09/'+time.strftime('%Y')" name="code"/>
<field eval="'09/'+time.strftime('%Y')" name="name"/>
<field eval="'X 09/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-09-01'" name="date_start"/>
@ -101,7 +101,7 @@
</record>
<record id="period_10" model="account.period">
<field eval="'10/'+time.strftime('%Y')" name="code"/>
<field eval="'10/'+time.strftime('%Y')" name="name"/>
<field eval="'X 10/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-10-01'" name="date_start"/>
@ -110,7 +110,7 @@
</record>
<record id="period_11" model="account.period">
<field eval="'11/'+time.strftime('%Y')" name="code"/>
<field eval="'11/'+time.strftime('%Y')" name="name"/>
<field eval="'X 11/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-11-01'" name="date_start"/>
@ -119,7 +119,7 @@
</record>
<record id="period_12" model="account.period">
<field eval="'12/'+time.strftime('%Y')" name="code"/>
<field eval="'12/'+time.strftime('%Y')" name="name"/>
<field eval="'X 12/'+time.strftime('%Y')" name="name"/>
<field eval="True" name="special"/>
<field name="fiscalyear_id" ref="data_fiscalyear"/>
<field eval="time.strftime('%Y')+'-12-01'" name="date_start"/>
@ -129,6 +129,6 @@
<record id="base.user_demo" model="res.users">
<field name="groups_id" eval="[(4,ref('account.group_account_user'))]"/>
</record>
</record>
</data>
</openerp>

View File

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import invoice
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,275 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# 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, orm
from edi import EDIMixin
INVOICE_LINE_EDI_STRUCT = {
'name': True,
'origin': True,
'uos_id': True,
'product_id': True,
'price_unit': True,
'quantity': True,
'discount': True,
'note': True,
# fields used for web preview only - discarded on import
'price_subtotal': True,
}
INVOICE_TAX_LINE_EDI_STRUCT = {
'name': True,
'base': True,
'amount': True,
'manual': True,
'sequence': True,
'base_amount': True,
'tax_amount': True,
}
INVOICE_EDI_STRUCT = {
'name': True,
'origin': True,
'company_id': True, # -> to be changed into partner
'type': True, # -> reversed at import
'internal_number': True, # -> reference at import
'comment': True,
'date_invoice': True,
'date_due': True,
'partner_id': True,
'payment_term': True,
#custom: currency_id
'invoice_line': INVOICE_LINE_EDI_STRUCT,
'tax_line': INVOICE_TAX_LINE_EDI_STRUCT,
# fields used for web preview only - discarded on import
#custom: 'partner_ref'
'amount_total': True,
'amount_untaxed': True,
'amount_tax': True,
}
class account_invoice(osv.osv, EDIMixin):
_inherit = 'account.invoice'
def edi_export(self, cr, uid, records, edi_struct=None, context=None):
"""Exports a supplier or customer invoice"""
edi_struct = dict(edi_struct or INVOICE_EDI_STRUCT)
res_company = self.pool.get('res.company')
res_partner_address = self.pool.get('res.partner.address')
edi_doc_list = []
for invoice in records:
# generate the main report
self._edi_generate_report_attachment(cr, uid, invoice, context=context)
edi_doc = super(account_invoice,self).edi_export(cr, uid, [invoice], edi_struct, context)[0]
edi_doc.update({
'company_address': res_company.edi_export_address(cr, uid, invoice.company_id, context=context),
'company_paypal_account': invoice.company_id.paypal_account,
'partner_address': res_partner_address.edi_export(cr, uid, [invoice.address_invoice_id], context=context)[0],
'currency': self.pool.get('res.currency').edi_export(cr, uid, [invoice.currency_id], context=context)[0],
'partner_ref': invoice.reference or False,
})
edi_doc_list.append(edi_doc)
return edi_doc_list
def _edi_tax_account(self, cr, uid, invoice_type='out_invoice', context=None):
#TODO/FIXME: should select proper Tax Account
account_pool = self.pool.get('account.account')
account_ids = account_pool.search(cr, uid, [('type','<>','view'),('type','<>','income'), ('type', '<>', 'closed')])
tax_account = False
if account_ids:
tax_account = account_pool.browse(cr, uid, account_ids[0])
return tax_account
def _edi_invoice_account(self, cr, uid, partner_id, invoice_type, context=None):
partner_pool = self.pool.get('res.partner')
partner = partner_pool.browse(cr, uid, partner_id, context=context)
if invoice_type in ('out_invoice', 'out_refund'):
invoice_account = partner.property_account_receivable
else:
invoice_account = partner.property_account_payable
return invoice_account
def _edi_product_account(self, cr, uid, product_id, invoice_type, context=None):
product_pool = self.pool.get('product.product')
product = product_pool.browse(cr, uid, product_id, context=context)
if invoice_type in ('out_invoice','out_refund'):
account = product.property_account_income or product.categ_id.property_account_income_categ
else:
account = product.property_account_expense or product.categ_id.property_account_expense_categ
return account
def _edi_import_company(self, cr, uid, edi_document, context=None):
# TODO: for multi-company setups, we currently import the document in the
# user's current company, but we should perhaps foresee a way to select
# the desired company among the user's allowed companies
self._edi_requires_attributes(('company_id','company_address','type'), edi_document)
res_partner_address = self.pool.get('res.partner.address')
res_partner = self.pool.get('res.partner')
# imported company = new partner
src_company_id, src_company_name = edi_document.pop('company_id')
partner_id = self.edi_import_relation(cr, uid, 'res.partner', src_company_name,
src_company_id, context=context)
invoice_type = edi_document['type']
partner_value = {}
if invoice_type in ('out_invoice', 'out_refund'):
partner_value.update({'customer': True})
if invoice_type in ('in_invoice', 'in_refund'):
partner_value.update({'supplier': True})
res_partner.write(cr, uid, [partner_id], partner_value, context=context)
# imported company_address = new partner address
address_info = edi_document.pop('company_address')
address_info['partner_id'] = (src_company_id, src_company_name)
address_info['type'] = 'invoice'
address_id = res_partner_address.edi_import(cr, uid, address_info, context=context)
# modify edi_document to refer to new partner
partner_address = res_partner_address.browse(cr, uid, address_id, context=context)
edi_document['partner_id'] = (src_company_id, src_company_name)
edi_document.pop('partner_address', False) # ignored
edi_document['address_invoice_id'] = self.edi_m2o(cr, uid, partner_address, context=context)
return partner_id
def edi_import(self, cr, uid, edi_document, context=None):
""" During import, invoices will import the company that is provided in the invoice as
a new partner (e.g. supplier company for a customer invoice will be come a supplier
record for the new invoice.
Summary of tasks that need to be done:
- import company as a new partner, if type==in then supplier=1, else customer=1
- partner_id field is modified to point to the new partner
- company_address data used to add address to new partner
- change type: out_invoice'<->'in_invoice','out_refund'<->'in_refund'
- reference: should contain the value of the 'internal_number'
- reference_type: 'none'
- internal number: reset to False, auto-generated
- journal_id: should be selected based on type: simply put the 'type'
in the context when calling create(), will be selected correctly
- payment_term: if set, create a default one based on name...
- for invoice lines, the account_id value should be taken from the
product's default, i.e. from the default category, as it will not
be provided.
- for tax lines, we disconnect from the invoice.line, so all tax lines
will be of type 'manual', and default accounts should be picked based
on the tax config of the DB where it is imported.
"""
if context is None:
context = {}
self._edi_requires_attributes(('company_id','company_address','type','invoice_line','currency'), edi_document)
# extract currency info
res_currency = self.pool.get('res.currency')
currency_info = edi_document.pop('currency')
currency_id = res_currency.edi_import(cr, uid, currency_info, context=context)
currency = res_currency.browse(cr, uid, currency_id)
edi_document['currency_id'] = self.edi_m2o(cr, uid, currency, context=context)
# change type: out_invoice'<->'in_invoice','out_refund'<->'in_refund'
invoice_type = edi_document['type']
invoice_type = invoice_type.startswith('in_') and invoice_type.replace('in_','out_') or invoice_type.replace('out_','in_')
edi_document['type'] = invoice_type
#import company as a new partner
partner_id = self._edi_import_company(cr, uid, edi_document, context=context)
# Set Account
invoice_account = self._edi_invoice_account(cr, uid, partner_id, invoice_type, context=context)
edi_document['account_id'] = invoice_account and self.edi_m2o(cr, uid, invoice_account, context=context) or False
# reference: should contain the value of the 'internal_number'
edi_document['reference'] = edi_document.get('internal_number', False)
# reference_type: 'none'
edi_document['reference_type'] = 'none'
# internal number: reset to False, auto-generated
edi_document['internal_number'] = False
# discard web preview fields, if present
edi_document.pop('partner_ref', None)
# journal_id: should be selected based on type: simply put the 'type' in the context when calling create(), will be selected correctly
context.update(type=invoice_type)
# for invoice lines, the account_id value should be taken from the product's default, i.e. from the default category, as it will not be provided.
for edi_invoice_line in edi_document['invoice_line']:
product_info = edi_invoice_line['product_id']
product_id = self.edi_import_relation(cr, uid, 'product.product', product_info[1],
product_info[0], context=context)
account = self._edi_product_account(cr, uid, product_id, invoice_type, context=context)
# TODO: could be improved with fiscal positions perhaps
# account = fpos_obj.map_account(cr, uid, fiscal_position_id, account.id)
edi_invoice_line['account_id'] = self.edi_m2o(cr, uid, account, context=context) if account else False
# discard web preview fields, if present
edi_invoice_line.pop('price_subtotal', None)
# for tax lines, we disconnect from the invoice.line, so all tax lines will be of type 'manual', and default accounts should be picked based
# on the tax config of the DB where it is imported.
tax_account = self._edi_tax_account(cr, uid, context=context)
tax_account_info = self.edi_m2o(cr, uid, tax_account, context=context)
for edi_tax_line in edi_document.get('tax_line', []):
edi_tax_line['account_id'] = tax_account_info
edi_tax_line['manual'] = True
return super(account_invoice,self).edi_import(cr, uid, edi_document, context=context)
def _edi_record_display_action(self, cr, uid, id, context=None):
"""Returns an appropriate action definition dict for displaying
the record with ID ``rec_id``.
:param int id: database ID of record to display
:return: action definition dict
"""
action = super(account_invoice,self)._edi_record_display_action(cr, uid, id, context=context)
try:
invoice = self.browse(cr, uid, id, context=context)
if 'out_' in invoice.type:
view_ext_id = 'invoice_form'
journal_type = 'sale'
else:
view_ext_id = 'invoice_supplier_form'
journal_type = 'purchase'
ctx = "{'type': '%s', 'journal_type': '%s'}" % (invoice.type, journal_type)
action.update(context=ctx)
view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', view_ext_id)[1]
action.update(views=[(view_id,'form'), (False, 'tree')])
except ValueError:
# ignore if views are missing
pass
return action
class account_invoice_line(osv.osv, EDIMixin):
_inherit='account.invoice.line'
class account_invoice_tax(osv.osv, EDIMixin):
_inherit = "account.invoice.tax"
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,186 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!-- EDI Export + Send email Action -->
<record id="ir_actions_server_edi_invoice" model="ir.actions.server">
<field name="code">if (object.type in ('out_invoice', 'out_refund')) and not object.partner_id.opt_out: object.edi_export_and_email(template_ext_id='account.email_template_edi_invoice', context=context)</field>
<field eval="6" name="sequence"/>
<field name="state">code</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="condition">True</field>
<field name="name">Auto-email confirmed invoices</field>
</record>
<!-- EDI related Email Templates menu -->
<record model="ir.actions.act_window" id="action_email_templates">
<field name="name">Email Templates</field>
<field name="res_model">email.template</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="view_id" ref="email_template.email_template_tree" />
<field name="search_view_id" ref="email_template.view_email_template_search"/>
<field name="context">{'search_default_model_id':'account.invoice'}</field>
<field name="context" eval="{'search_default_model_id': ref('account.model_account_invoice')}"/>
</record>
<menuitem id="menu_email_templates" parent="menu_configuration_misc" action="action_email_templates" sequence="30"/>
</data>
<!-- Mail template and workflow bindings are done in a NOUPDATE block
so users can freely customize/delete them -->
<data noupdate="1">
<!-- bind the mailing server action to invoice open activity -->
<record id="account.act_open" model="workflow.activity">
<field name="action_id" ref="ir_actions_server_edi_invoice"/>
</record>
<!--Email template -->
<record id="email_template_edi_invoice" model="email.template">
<field name="name">Automated Invoice Notification Mail</field>
<field name="email_from">${object.user_id.user_email or object.company_id.email or 'noreply@localhost'}</field>
<field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })</field>
<field name="email_to">${object.address_invoice_id.email or ''}</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
<p>Hello${object.address_invoice_id.name and ' ' or ''}${object.address_invoice_id.name or ''},</p>
<p>A new invoice is available for ${object.partner_id.name}: </p>
<p style="border-left: 1px solid #8e0000; margin-left: 30px;">
&nbsp;&nbsp;<strong>REFERENCES</strong><br />
&nbsp;&nbsp;Invoice number: <strong>${object.number}</strong><br />
&nbsp;&nbsp;Invoice total: <strong>${object.amount_total} ${object.currency_id.name}</strong><br />
&nbsp;&nbsp;Invoice date: ${object.date_invoice}<br />
% if object.origin:
&nbsp;&nbsp;Order reference: ${object.origin}<br />
% endif
&nbsp;&nbsp;Your contact: <a href="mailto:${object.user_id.user_email or ''}?subject=Invoice%20${object.number}">${object.user_id.name}</a>
</p>
<p>
You can view the invoice document, download it and pay online using the following link:
</p>
<a style="display:block; width: 150px; height:20px; margin-left: 120px; color: #FFF; font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 13px; font-weight: bold; text-align: center; text-decoration: none !important; line-height: 1; padding: 5px 0px 0px 0px; background-color: #8E0000; border-radius: 5px 5px; background-repeat: repeat no-repeat;"
href="${ctx.get('edi_web_url_view') or ''}">View Invoice</a>
% if object.company_id.paypal_account and object.type in ('out_invoice', 'in_refund'):
<%
comp_name = quote(object.company_id.name)
inv_number = quote(object.number)
paypal_account = quote(object.company_id.paypal_account)
inv_amount = quote(str(object.amount_total))
cur_name = quote(object.currency_id.name)
paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=%s&amp;item_name=%s%%20Invoice%%20%s&amp;" \
"invoice=%s&amp;amount=%s&amp;currency_code=%s&amp;button_subtype=services&amp;no_note=1&amp;bn=OpenERP_Invoice_PayNow_%s" % \
(paypal_account,comp_name,inv_number,inv_number,inv_amount,cur_name,cur_name)
%>
<br/>
<p>It is also possible to directly pay with Paypal:</p>
<a style="margin-left: 120px;" href="${paypal_url}">
<img class="oe_edi_paypal_button" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif"/>
</a>
% endif
<br/>
<p>If you have any question, do not hesitate to contact us.</p>
<p>Thank you for choosing ${object.company_id.name or 'us'}!</p>
<br/>
<br/>
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;">
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
</div>
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
<span style="color: #222; margin-bottom: 5px; display: block; ">
% if object.company_id.street:
${object.company_id.street}<br/>
% endif
% if object.company_id.street2:
${object.company_id.street2}<br/>
% endif
% if object.company_id.city or object.company_id.zip:
${object.company_id.zip} ${object.company_id.city}<br/>
% endif
% if object.company_id.country_id:
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>
% endif
</span>
% if object.company_id.phone:
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">
Phone:&nbsp; ${object.company_id.phone}
</div>
% endif
% if object.company_id.website:
<div>
Web :&nbsp;<a href="${object.company_id.website}">${object.company_id.website}</a>
</div>
%endif
<p></p>
</div>
</div>
]]></field>
<field name="body_text"><![CDATA[
Hello${object.address_invoice_id.name and ' ' or ''}${object.address_invoice_id.name or ''},
A new invoice is available for ${object.partner_id.name}:
| Invoice number: *${object.number}*
| Invoice total: *${object.amount_total} ${object.currency_id.name}*
| Invoice date: ${object.date_invoice}
% if object.origin:
| Order reference: ${object.origin}
% endif
| Your contact: ${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''}
You can view the invoice document, download it and pay online using the following link:
${ctx.get('edi_web_url_view') or 'n/a'}
% if object.company_id.paypal_account and object.type in ('out_invoice', 'in_refund'):
<%
comp_name = quote(object.company_id.name)
inv_number = quote(object.number)
paypal_account = quote(object.company_id.paypal_account)
inv_amount = quote(str(object.amount_total))
cur_name = quote(object.currency_id.name)
paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=%s&item_name=%s%%20Invoice%%20%s"\
"&invoice=%s&amount=%s&currency_code=%s&button_subtype=services&no_note=1&bn=OpenERP_Invoice_PayNow_%s" % \
(paypal_account,comp_name,inv_number,inv_number,inv_amount,cur_name,cur_name)
%>
It is also possible to directly pay with Paypal:
${paypal_url}
% endif
If you have any question, do not hesitate to contact us.
Thank you for choosing ${object.company_id.name}!
--
${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''}
${object.company_id.name}
% if object.company_id.street:
${object.company_id.street or ''}
% endif
% if object.company_id.street2:
${object.company_id.street2}
% endif
% if object.company_id.city or object.company_id.zip:
${object.company_id.zip or ''} ${object.company_id.city or ''}
% endif
% if object.company_id.country_id:
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}
% endif
% if object.company_id.phone:
Phone: ${object.company_id.phone}
% endif
% if object.company_id.website:
${object.company_id.website or ''}
% endif
]]></field>
</record>
</data>
</openerp>

File diff suppressed because it is too large Load Diff

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-11-07 12:53+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"PO-Revision-Date: 2011-11-25 15:24+0000\n"
"Last-Translator: Numérigraphe <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-08 05:42+0000\n"
"X-Generator: Launchpad (build 14231)\n"
"X-Launchpad-Export-Date: 2011-11-26 05:50+0000\n"
"X-Generator: Launchpad (build 14381)\n"
#. module: account
#: code:addons/account/account.py:1291
@ -584,8 +584,6 @@ msgstr ""
#: field:account.move.bank.reconcile,journal_id:0
#: view:account.move.line:0
#: field:account.move.line,journal_id:0
#: report:account.third_party_ledger:0
#: report:account.third_party_ledger_other:0
#: code:addons/account/account_move_line.py:983
#: view:analytic.entries.report:0
#: field:analytic.entries.report,journal_id:0
@ -968,7 +966,6 @@ msgstr "Créer des périodes trimestrielles"
#. module: account
#: report:account.overdue:0
#: report:account.aged_trial_balance:0
msgid "Due"
msgstr "Due"
@ -1063,10 +1060,6 @@ msgstr "Modèle d'écritures"
#: field:account.journal,code:0
#: report:account.partner.balance:0
#: field:account.period,code:0
#: report:account.balancesheet.horizontal:0
#: report:account.balancesheet:0
#: report:pl.account.horizontal:0
#: report:pl.account:0
msgid "Code"
msgstr "Code"
@ -1396,7 +1389,6 @@ msgstr "Analyse des écritures comptables"
#. module: account
#: model:ir.actions.act_window,name:account.action_partner_all
#: model:ir.ui.menu,name:account.next_id_22
#: report:account.aged_trial_balance:0
msgid "Partners"
msgstr "Partenaires"
@ -2196,7 +2188,7 @@ msgstr ""
#. module: account
#: view:account.chart.template:0
msgid "Search Chart of Accounts Templates"
msgid "Search Chart of Account Templates"
msgstr "Chercher un modèle de plan comptable"
#. module: account
@ -2305,11 +2297,6 @@ msgstr "Modèle de produit"
#: report:account.third_party_ledger_other:0
#: report:account.vat.declaration:0
#: model:ir.model,name:account.model_account_fiscalyear
#: report:account.balancesheet.horizontal:0
#: report:account.balancesheet:0
#: report:pl.account.horizontal:0
#: report:pl.account:0
#: report:account.aged_trial_balance:0
msgid "Fiscal Year"
msgstr "Exercice comptable"
@ -3187,9 +3174,7 @@ msgstr "Laisser vide pour utiliser le compte de dépense"
#: field:account.common.report,journal_ids:0
#: report:account.general.journal:0
#: field:account.general.journal,journal_ids:0
#: report:account.general.ledger_landscape:0
#: view:account.journal.period:0
#: report:account.partner.balance:0
#: field:account.partner.balance,journal_ids:0
#: field:account.partner.ledger,journal_ids:0
#: field:account.pl.report,journal_ids:0
@ -3550,7 +3535,6 @@ msgstr ""
#: field:account.entries.report,date:0
#: selection:account.general.journal,filter:0
#: report:account.general.ledger:0
#: report:account.general.ledger_landscape:0
#: field:account.invoice.report,date:0
#: report:account.journal.period.print:0
#: view:account.move:0
@ -4852,7 +4836,6 @@ msgstr "Balance Analytique -"
#: report:account.general.ledger_landscape:0
#: report:pl.account:0
#: report:pl.account.horizontal:0
#: report:account.aged_trial_balance:0
msgid "Target Moves"
msgstr "Mouvements Cibles"
@ -5521,7 +5504,7 @@ msgstr "Ajustement"
#. module: account
#: field:res.partner,debit:0
msgid "Total Payable"
msgstr "Montant à payer"
msgstr "Total à payer"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_analytic_account_line_extended_form
@ -5687,16 +5670,6 @@ msgstr "La nouvelle devise n'est pas correctement paramétrée !"
#: field:account.print.journal,filter:0
#: field:account.report.general.ledger,filter:0
#: field:account.vat.declaration,filter:0
#: field:account.account.balance,filter:0
#: field:account.central.journal,filter:0
#: field:account.general.journal,filter:0
#: field:account.partner.balance,filter:0
#: field:account.balancesheet,filter:0
#: field:account.balancesheet.horizontal,filter:0
#: field:account.general.ledger,filter:0
#: field:account.general.ledger_landscape,filter:0
#: field:pl.account,filter:0
#: field:pl.account.horizontal,filter:0
msgid "Filter by"
msgstr "Filtrer par"
@ -6569,7 +6542,6 @@ msgstr " valorisation : pourcentage"
#: code:addons/account/invoice.py:1008
#: code:addons/account/wizard/account_invoice_refund.py:100
#: code:addons/account/wizard/account_invoice_refund.py:102
#: code:addons/account/wizard/account_open_closed_fiscalyear.py:40
#: code:addons/account/wizard/account_use_model.py:44
#, python-format
msgid "Error !"
@ -6712,7 +6684,6 @@ msgstr "Position fiscale des taxes"
#: view:account.report.general.ledger:0
#: model:ir.actions.act_window,name:account.action_account_general_ledger_menu
#: model:ir.actions.report.xml,name:account.account_general_ledger
#: model:ir.actions.report.xml,name:account.account_general_ledger_landscape
#: model:ir.ui.menu,name:account.menu_general_ledger
msgid "General Ledger"
msgstr "Grand livre"
@ -6748,8 +6719,8 @@ msgid ""
"Account Voucher module includes all the basic requirements of Voucher "
"Entries for Bank, Cash, Sales, Purchase, Expenses, Contra, etc... "
msgstr ""
"Le module Chèques comprend toutes les fonctionnalités de base pour la "
"Banque, la trésorerie, les ventes, les achats, les frais, etc. "
"Le module \"Justificatifs\" comprend toutes les fonctionnalités de base pour "
"la Banque, la trésorerie, les ventes, les achats, les frais, etc. "
#. module: account
#: view:account.chart.template:0
@ -6768,8 +6739,6 @@ msgstr "Plan de taxes comptables"
#: report:account.general.journal:0
#: report:account.invoice:0
#: report:account.partner.balance:0
#: report:pl.account.horizontal:0
#: report:pl.account:0
msgid "Total:"
msgstr "Total :"
@ -6979,7 +6948,7 @@ msgstr "Lignes analytiques"
#: model:ir.actions.act_window,help:account.action_account_analytic_account_tree2
msgid ""
"The normal chart of accounts has a structure defined by the legal "
"requirement of the country. The analytic chart of accounts structure should "
"requirement of the country. The analytic chart of account structure should "
"reflect your own business needs in term of costs/revenues reporting. They "
"are usually structured by contracts, projects, products or departements. "
"Most of the OpenERP operations (invoices, timesheets, expenses, etc) "
@ -7384,7 +7353,6 @@ msgstr "Information optionnelle"
#. module: account
#: view:account.analytic.line:0
#: field:account.bank.statement,user_id:0
#: view:account.journal:0
#: field:account.journal,user_id:0
#: view:analytic.entries.report:0
@ -7981,7 +7949,6 @@ msgstr "Gestion de la comptabilité et des finances"
#: view:account.entries.report:0
#: field:account.entries.report,period_id:0
#: view:account.fiscalyear:0
#: report:account.general.ledger_landscape:0
#: view:account.invoice:0
#: view:account.invoice.report:0
#: field:account.journal.period,period_id:0
@ -8102,21 +8069,6 @@ msgstr "Tél. :"
msgid "Company Currency"
msgstr "Devise société"
#. module: account
#: report:account.account.balance:0
#: report:account.partner.balance:0
#: report:account.third_party_ledger:0
#: report:account.third_party_ledger_other:0
#: report:account.balancesheet:0
#: report:account.balancesheet.horizontal:0
#: report:account.general.ledger:0
#: report:account.general.ledger_landscape:0
#: report:pl.account:0
#: report:pl.account.horizontal:0
#: report:account.aged_trial_balance:0
msgid "Chart of Accounts"
msgstr "Plan comptable"
#. module: account
#: model:process.node,name:account.process_node_paymententries0
#: model:process.transition,name:account.process_transition_reconcilepaid0
@ -8233,7 +8185,6 @@ msgstr "Journal d'avoirs"
#: report:account.account.balance:0
#: report:account.central.journal:0
#: report:account.general.journal:0
#: report:account.general.ledger_landscape:0
#: report:account.partner.balance:0
#: report:account.balancesheet:0
#: report:account.balancesheet.horizontal:0
@ -8298,7 +8249,7 @@ msgstr ""
#. module: account
#: field:account.invoice.line,price_subtotal:0
msgid "Subtotal"
msgstr "Sous total"
msgstr "Sous-total"
#. module: account
#: view:account.vat.declaration:0
@ -8319,12 +8270,6 @@ msgstr "Modèle de pièce comptable"
msgid "Due Date"
msgstr "Date d'échéance"
#. module: account
#: view:account.print.invoice:0
#: field:account.print.invoice,date_due:0
msgid "Due Date"
msgstr "Echéance"
#. module: account
#: model:ir.ui.menu,name:account.menu_account_supplier
#: model:ir.ui.menu,name:account.menu_finance_payables
@ -8461,8 +8406,6 @@ msgid ""
"The amount of the voucher must be the same amount as the one on the "
"statement line"
msgstr ""
"Le montant du justificatif doit être identique à celui de la ligne le "
"concernant"
#. module: account
#: code:addons/account/account_move_line.py:1131
@ -8838,7 +8781,6 @@ msgstr "Impossible de trouver le code parent pour le compte modèle !"
#. module: account
#: field:account.aged.trial.balance,direction_selection:0
#: report:account.aged_trial_balance:0
msgid "Analysis Direction"
msgstr "Direction d'Analyse"
@ -8969,10 +8911,6 @@ msgstr "Laisser vide pour utiliser le compte de revenu"
#: report:account.third_party_ledger_other:0
#: field:report.account.receivable,balance:0
#: field:report.aged.receivable,balance:0
#: report:account.balancesheet.horizontal:0
#: report:account.balancesheet:0
#: report:pl.account.horizontal:0
#: report:pl.account:0
msgid "Balance"
msgstr "Balance"
@ -9024,7 +8962,7 @@ msgstr ""
#: selection:account.account.template,type:0
#: selection:account.entries.report,type:0
msgid "Payable"
msgstr "Débiteurs"
msgstr "Payable"
#. module: account
#: view:report.account.sales:0
@ -9123,7 +9061,6 @@ msgstr "Saisie manuelle"
#. module: account
#: report:account.general.ledger:0
#: report:account.general.ledger_landscape:0
#: report:account.journal.period.print:0
#: field:account.move.line,move_id:0
#: field:analytic.entries.report,move_id:0
@ -9203,7 +9140,7 @@ msgstr "Juillet"
#. module: account
#: view:account.account:0
msgid "Chart of Accounts"
msgid "Chart of accounts"
msgstr "Plan comptable"
#. module: account
@ -9250,7 +9187,7 @@ msgstr "Période de fin"
#: field:account.print.journal,chart_account_id:0
#: field:account.report.general.ledger,chart_account_id:0
#: field:account.vat.declaration,chart_account_id:0
msgid "Chart of Accounts"
msgid "Chart of account"
msgstr "Plan comptable"
#. module: account
@ -9298,7 +9235,6 @@ msgstr "Écriture d'abonnement"
#: report:account.general.journal:0
#: field:account.general.journal,date_from:0
#: report:account.general.ledger:0
#: report:account.general.ledger_landscape:0
#: field:account.installer,date_start:0
#: report:account.journal.period.print:0
#: report:account.partner.balance:0
@ -9311,7 +9247,6 @@ msgstr "Écriture d'abonnement"
#: report:account.third_party_ledger:0
#: report:account.third_party_ledger_other:0
#: field:account.vat.declaration,date_from:0
#: report:account.aged_trial_balance:0
msgid "Start Date"
msgstr "Date de début"
@ -9508,7 +9443,7 @@ msgstr ""
#: field:account.invoice,number:0
#: field:account.move,name:0
msgid "Number"
msgstr "Nombre"
msgstr "Numéro"
#. module: account
#: report:account.analytic.account.journal:0
@ -9736,7 +9671,6 @@ msgstr "Validé"
#: report:account.general.journal:0
#: field:account.general.journal,date_to:0
#: report:account.general.ledger:0
#: report:account.general.ledger_landscape:0
#: field:account.installer,date_stop:0
#: report:account.journal.period.print:0
#: report:account.partner.balance:0
@ -9824,7 +9758,6 @@ msgstr "États"
#: field:report.account.sales,amount_total:0
#: field:report.account_type.sales,amount_total:0
#: field:report.invoice.created,amount_total:0
#: report:account.aged_trial_balance:0
msgid "Total"
msgstr "Total"
@ -10259,7 +10192,7 @@ msgstr "La date de la pièce comptable n'est pas dans la période définie."
#. module: account
#: field:account.subscription,period_total:0
msgid "Number of Periods"
msgstr "Nombre de Périodes"
msgstr "Nombre de périodes"
#. module: account
#: report:account.general.journal:0
@ -10355,7 +10288,6 @@ msgstr "account.addtmpl.wizard"
#: field:account.partner.ledger,result_selection:0
#: report:account.third_party_ledger:0
#: report:account.third_party_ledger_other:0
#: report:account.aged_trial_balance:0
msgid "Partner's"
msgstr "Du partenaire"
@ -10507,18 +10439,6 @@ msgstr "Actif"
msgid "Liabilities"
msgstr "Passif"
#. module: account
#: report:pl.account:0
#: report:pl.account.horizontal:0
msgid "Expenses"
msgstr "Charges"
#. module: account
#: report:pl.account:0
#: report:pl.account.horizontal:0
msgid "Income"
msgstr "Produits"
#~ msgid "Aged Trial Balance"
#~ msgstr "Balance Agée"
@ -10757,6 +10677,9 @@ msgstr "Produits"
#~ msgid "Close states"
#~ msgstr "Clôturer l'état"
#~ msgid "Income"
#~ msgstr "Produits"
#~ msgid "Print General Journal"
#~ msgstr "Imprimer le journal général"
@ -11822,7 +11745,7 @@ msgstr "Produits"
#~ msgid "Balance Sheet (Assets Accounts)"
#~ msgstr "Bilan (comptes d'actif)"
#~ msgid "Chart of Accounts"
#~ msgid "Chart of Account"
#~ msgstr "Plan comptable"
#~ msgid "Balance:"

View File

@ -111,6 +111,10 @@ class account_installer(osv.osv_memory):
return {}
def execute(self, cr, uid, ids, context=None):
self.execute_simple(cr, uid, ids, context)
super(account_installer, self).execute(cr, uid, ids, context=context)
def execute_simple(self, cr, uid, ids, context=None):
if context is None:
context = {}
fy_obj = self.pool.get('account.fiscalyear')
@ -219,7 +223,6 @@ class account_installer(osv.osv_memory):
fy_obj.create_period(cr, uid, [fiscal_id])
elif res['period'] == '3months':
fy_obj.create_period3(cr, uid, [fiscal_id])
super(account_installer, self).execute(cr, uid, ids, context=context)
def modules_to_install(self, cr, uid, ids, context=None):
modules = super(account_installer, self).modules_to_install(

View File

@ -91,15 +91,18 @@
</group>
<notebook colspan="4">
<page string="Account Data">
<field name="partner_id"/>
<field name="contact_id"/>
<field name="currency_id"/>
<newline/>
<field name="date_start"/>
<field name="date"/>
<newline/>
<field name="quantity_max"/>
<field name="user_id"/>
<group colspan="2" col="2">
<separator colspan="2" string="Contacts"/>
<field name="partner_id" on_change="on_change_partner_id(partner_id)"/>
<field name="contact_id"/>
<field name="user_id"/>
</group>
<group colspan="2" col="2" name="contract">
<separator colspan="2" string="Contract Data"/>
<field name="date_start"/>
<field name="date"/>
<field name="quantity_max"/>
</group>
</page>
<page string="Description">
<field colspan="4" name="description" nolabel="1"/>
@ -255,7 +258,6 @@
<field eval="'account.analytic.account'" name="model"/>
<field name="name">Open Account Tree</field>
<field eval="'ir.actions.act_window,%d'%action_account_tree1" name="value"/>
<field eval="True" name="object"/>
</record>
<record id="account_analytic_line_extended_form" model="ir.ui.view">

View File

@ -35,7 +35,6 @@
<record model="ir.values" id="account_analytic_balance_values">
<field name="model_id" ref="analytic.model_account_analytic_account" />
<field name="object" eval="1" />
<field name="name">Account Analytic Balance</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_balance'))" />

View File

@ -34,7 +34,6 @@
<record model="ir.values" id="account_analytic_cost_ledger_journal_values">
<field name="model_id" ref="analytic.model_account_analytic_account" />
<field name="object" eval="1" />
<field name="name">Account Analytic Cost Ledger Journal</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_cost_ledger_journal'))" />
@ -43,4 +42,4 @@
</record>
</data>
</openerp>
</openerp>

View File

@ -33,7 +33,6 @@
<record model="ir.values" id="account_analytic_cost_values">
<field name="model_id" ref="analytic.model_account_analytic_account" />
<field name="object" eval="1" />
<field name="name">Account Analytic Cost</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_cost'))" />
@ -42,4 +41,4 @@
</record>
</data>
</openerp>
</openerp>

View File

@ -33,7 +33,6 @@
<record model="ir.values" id="account_analytic_invert_balance_values">
<field name="model_id" ref="analytic.model_account_analytic_account" />
<field name="object" eval="1" />
<field name="name">Account Analytic Inverted Balance</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_invert_balance'))" />

View File

@ -33,7 +33,6 @@
<record model="ir.values" id="account_analytic_journal_values">
<field name="model_id" ref="account.model_account_analytic_journal" />
<field name="object" eval="1" />
<field name="name">Account Analytic Journal</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_journal'))" />

View File

@ -55,10 +55,10 @@ class analytic_entries_report(osv.osv):
select
min(a.id) as id,
count(distinct a.id) as nbr,
a.create_date as date,
to_char(a.create_date, 'YYYY') as year,
to_char(a.create_date, 'MM') as month,
to_char(a.create_date, 'YYYY-MM-DD') as day,
a.date as date,
to_char(a.date, 'YYYY') as year,
to_char(a.date, 'MM') as month,
to_char(a.date, 'YYYY-MM-DD') as day,
a.user_id as user_id,
a.name as name,
analytic.partner_id as partner_id,
@ -76,9 +76,11 @@ class analytic_entries_report(osv.osv):
account_analytic_line a, account_analytic_account analytic
where analytic.id = a.account_id
group by
a.create_date, a.user_id,a.name,analytic.partner_id,a.company_id,a.currency_id,
a.date, a.user_id,a.name,analytic.partner_id,a.company_id,a.currency_id,
a.account_id,a.general_account_id,a.journal_id,
a.move_id,a.product_id,a.product_uom_id
)
""")
analytic_entries_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -153,3 +153,5 @@ class account_entries_report(osv.osv):
)
""")
account_entries_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -92,3 +92,5 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
report_sxw.report_sxw('report.account.financial.report', 'account.financial.report',
'addons/account/report/account_financial_report.rml', parser=report_account_common, header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -79,3 +79,5 @@ class account_treasury_report(osv.osv):
)
""")
account_treasury_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -141,3 +141,5 @@ class common_report_header(object):
return ''
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -5,19 +5,9 @@
-
!python {model: account.bank.statement}: |
import time
period = self._get_period(cr, uid, {'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu',
'journal_type': 'bank', 'period_id':time.strftime('%m'), 'active_ids': [ref('menu_bank_statement_tree')], 'active_id': ref('menu_bank_statement_tree')})
assert period, _('Period has not been selected')
journal = self._default_journal_id(cr, uid, {'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu',
'journal_type': 'bank', 'period_id': time.strftime('%m'), 'active_ids': [ref('menu_bank_statement_tree')], 'active_id': ref('menu_bank_statement_tree')})
assert journal, _('Journal has not been selected')
-
I select the date
-
!python {model: account.bank.statement}: |
import time
date = self.onchange_date(cr, uid, [], time.strftime('%Y-%m-%d'), context=None)
assert date, _('Date has not been selected')
-
I create a bank statement with Opening and Closing balance 0.
-

View File

@ -11,66 +11,19 @@
footer: True
bank: base.res_bank_1
bank_name: Reserve
-
I select the journal for customer invoice
-
!python {model: account.invoice}: |
journal = self.onchange_journal_id(cr, uid, [], journal_id=ref('account.sales_journal'))
-
I select the partner for customer invoice
-
!python {model: account.invoice}: |
partner = self.onchange_partner_id(cr, uid, [], 'out_invoice', ref('base.res_partner_3'), date_invoice=False,
payment_term=ref('account.account_payment_term_advance'), partner_bank_id=ref('res_partner_bank_0'), company_id=ref('base.main_company'))
-
I select the company for invoice
-
!python {model: account.invoice}: |
company = self.onchange_company_id(cr, uid, [], ref('base.main_company'), False, 'out_invoice', [], ref('base.EUR'))
-
I create a customer invoice
-
!record {model: account.invoice, id: account_invoice_customer0}:
account_id: account.a_recv
address_contact_id: base.res_partner_address_zen
address_invoice_id: base.res_partner_address_zen
company_id: base.main_company
currency_id: base.EUR
date_invoice: !eval time.strftime('%Y-%m-%d')
!record {model: account.invoice, id: account_invoice_customer0, view: invoice_form}:
payment_term: account.account_payment_term_advance
partner_bank_id: res_partner_bank_0
journal_id: account.sales_journal
partner_id: base.res_partner_3
reference_type: none
name: 'Test Customer Invoice'
-
I select a product for invoice
-
!python {model: account.invoice.line}: |
product = self.product_id_change(cr, uid, [], ref("product.product_product_pc3"), False, qty=10.0, name='[PC3] Medium PC',
type='out_invoice', partner_id=ref('base.res_partner_3'), fposition_id=False, price_unit= 900.0, address_invoice_id=ref('base.res_partner_address_zen'),
currency_id=ref('base.EUR'), context={'lang': u'en_US', 'tz': False, 'type': 'out_invoice'}, company_id=ref('base.main_company'))
line = {}
line.update(product.get('value', {}))
line.update({
'quantity': 10.0,
'invoice_id': ref("account_invoice_customer0"),
})
invoice_line = self.create(cr, uid, line)
-
I select product Uos
-
!python {model: account.invoice.line}: |
inv_line_id = self.search(cr, uid, [('invoice_id','=',ref('account_invoice_customer0'))])
uos = self.uos_id_change(cr, uid, inv_line_id, ref("product.product_product_pc3"), ref('product.product_uom_unit'), qty=0, name='[PC3] Medium PC', type='out_invoice',
partner_id=ref('base.res_partner_3'), fposition_id=False, price_unit=False, address_invoice_id=ref('base.res_partner_address_zen'),
currency_id=ref('base.EUR'), context={'lang': u'en_US', 'tz': False, 'type': 'out_invoice'}, company_id=ref('base.main_company'))
-
I select the account for invoice line
-
!python {model: account.invoice.line}: |
inv_line_id = self.search(cr, uid, [('invoice_id','=',ref('account_invoice_customer0'))])
account = self.onchange_account_id(cr, uid, inv_line_id, False, ref('account.a_sale'))
invoice_line:
- product_id: product.product_product_pc3
quantity: 10.0
-
I manually assign tax on invoice
-

View File

@ -1,31 +1,8 @@
-
In order to check the Close a Fiscal Year wizard in OpenERP I first create a Fiscalyear
-
!record {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0}:
code: !eval "'FY%s'% (datetime.now().year+1)"
company_id: base.main_company
date_start: !eval "'%s-01-01' %(datetime.now().year+1)"
date_stop: !eval "'%s-12-31' %(datetime.now().year+1)"
name: !eval "'Fiscal Year %s' %(datetime.now().year+1)"
-
I create monthly Periods for this fiscalyear
-
!python {model: account.fiscalyear}: |
self.create_period(cr, uid, [ref("account_fiscalyear_fiscalyear0")], {"lang":
'en_US', "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_account_fiscalyear_form")],
"tz": False, "active_id": ref("account.menu_action_account_fiscalyear_form"),
})
-
I check that the fiscalyear state is "Draft"
-
!assert {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0, string: Fiscal Year is in Draft state}:
- state == 'draft'
-
I run the Close a Fiscalyear wizard to close this fiscalyear
I run the Close a Fiscalyear wizard to close the demo fiscalyear
-
!record {model: account.fiscalyear.close.state, id: account_fiscalyear_close_state_0}:
fy_id: account_fiscalyear_fiscalyear0
fy_id: data_fiscalyear
-
I clicked on Close States Button to close fiscalyear
@ -37,9 +14,6 @@
-
I check that the fiscalyear state is now "Done"
-
!assert {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0, string: Fiscal Year is in Done state}:
!assert {model: account.fiscalyear, id: data_fiscalyear, string: Fiscal Year is in Done state}:
- state == 'done'

View File

@ -82,10 +82,10 @@
'active_model': 'ir.ui.menu', 'journal_type': 'purchase', 'active_ids': [ref('menu_action_invoice_tree2')],
'type': 'in_invoice', 'active_id': ref('menu_action_invoice_tree2')})
except Exception, e:
assert e, _('Warning message has not been raised')
assert e, 'Warning message has not been raised'
-
I verify that 'Period Sum' and 'Year sum' of account tax codes gets bind with the values
I verify that 'Period Sum' and 'Year sum' of the tax code are the expected values
-
!python {model: account.tax.code}: |
tax_code = self.browse(cr, uid, ref('tax_case'))
assert(tax_code.sum_period == 100.0 and tax_code.sum == 100.0), _("'Period Sum' and 'Year sum' has not been binded with the correct values")
assert(tax_code.sum_period == 100.0 and tax_code.sum == 100.0), "Incorrect 'Period Sum' / 'Year sum' expected twice 100.0, got period=%r and year=%r)" % (tax_code.sum_period,tax_code.sum)

View File

@ -38,7 +38,7 @@
Then I click on the 'Post' button of Journal Entries
-
!python {model: account.move}: |
ids = [ref('account_model_mymodelonyears0')]
ids = self.search(cr, uid, [('ref', '=', 'My Test Model')])
self.button_validate(cr, uid, ids, {})
moves = self.browse(cr, uid, ids)[0]
assert(moves.state == 'posted'), _('Journal Entries are not in posted state')
@ -48,9 +48,6 @@
!record {model: account.subscription, id: test_recurring_lines }:
name: Test Recurring Lines
model_id: account_model_mymodelonyears0
date_start: !eval time.strftime('%Y-%m-%d')
period_nbr: 1
period_total: 12
period_type: 'day'
-
Then I click on the 'Compute' button of Recurring lines

View File

@ -0,0 +1,152 @@
-
In order to test the EDI export features of Invoices
-
First I create a draft customer invoice
-
!record {model: account.invoice, id: invoice_edi_1}:
journal_id: 1
partner_id: base.res_partner_agrolait
currency_id: base.EUR
address_invoice_id: base.res_partner_address_8invoice
company_id: 1
account_id: account.a_pay
date_invoice: '2011-06-22'
name: selling product
type: 'out_invoice'
invoice_line:
- product_id: product.product_product_pc1
uos_id: 1
quantity: 1.0
price_unit: 10.0
name: 'basic pc'
account_id: account.a_pay
invoice_line:
- product_id: product.product_product_pc3
uos_id: 1
quantity: 5.0
price_unit: 100.0
name: 'Medium PC'
account_id: account.a_pay
tax_line:
- name: sale tax
account_id: account.a_pay
manual: True
amount: 1000.00
-
I confirm and open the invoice
-
!workflow {model: account.invoice, ref: invoice_edi_1, action: invoice_open}
-
Then I export the customer invoice
-
!python {model: edi.document}: |
invoice_pool = self.pool.get('account.invoice')
invoice = invoice_pool.browse(cr, uid, ref("invoice_edi_1"))
token = self.export_edi(cr, uid, [invoice])
assert token, 'Invalid EDI Token'
-
Then I import a sample EDI document of another customer invoice
-
!python {model: account.invoice}: |
edi_document = {
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.random_invoice_763jsms",
"__module": "account",
"__model": "account.invoice",
"__version": [6,1,0],
"internal_number": "SAJ/2011/002",
"company_address": {
"__id": "base:b22acf7a-ddcd-11e0-a4db-701a04e25543.main_address",
"__module": "base",
"__model": "res.partner.address",
"city": "Gerompont",
"zip": "1367",
"country_id": ["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.be", "Belgium"],
"phone": "(+32).81.81.37.00",
"street": "Chaussee de Namur 40",
"bank_ids": [
["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_partner_bank-ZrTWzesfsdDJzGbp","Sample bank: 123465789-156113"]
],
},
"company_id": ["account:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_company_test11", "Thomson pvt. ltd."],
"currency": {
"__id": "base:b22acf7a-ddcd-11e0-a4db-701a04e25543.EUR",
"__module": "base",
"__model": "res.currency",
"code": "EUR",
"symbol": "€",
},
"partner_id": ["account:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_partner_test20", "Junjun wala"],
"partner_address": {
"__id": "base:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_address_7wdsjasdjh",
"__module": "base",
"__model": "res.partner.address",
"phone": "(+32).81.81.37.00",
"street": "Chaussee de Namur 40",
"city": "Gerompont",
"zip": "1367",
"country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
},
"date_invoice": "2011-06-22",
"name": "sample invoice",
"tax_line": [{
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_tax-4g4EutbiEMVl",
"__module": "account",
"__model": "account.invoice.tax",
"amount": 1000.0,
"manual": True,
"name": "sale tax",
}],
"type": "out_invoice",
"invoice_line": [{
"__module": "account",
"__model": "account.invoice.line",
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_line-1RP3so",
"uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "PCE"],
"name": "Basic PC",
"price_unit": 10.0,
"product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc1", "[PC1] Basic PC"],
"quantity": 1.0
},
{
"__module": "account",
"__model": "account.invoice.line",
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_line-u2XV5",
"uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "PCE"],
"name": "Medium PC",
"price_unit": 100.0,
"product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc3", "[PC3] Medium PC"],
"quantity": 5.0
}]
}
invoice_id = self.edi_import(cr, uid, edi_document, context=context)
assert invoice_id, 'EDI import failed'
invoice_new = self.browse(cr, uid, invoice_id)
# check bank info on partner
assert len(invoice_new.partner_id.bank_ids) == 1, "Expected 1 bank entry related to partner"
bank_info = invoice_new.partner_id.bank_ids[0]
assert bank_info.acc_number == "Sample bank: 123465789-156113", 'Expected "Sample bank: 123465789-156113", got %s' % bank_info.acc_number
assert invoice_new.partner_id.supplier, 'Imported Partner is not marked as supplier'
assert invoice_new.reference == "SAJ/2011/002", "internal number is not stored in reference"
assert invoice_new.reference_type == 'none', "reference type is not set to 'none'"
assert invoice_new.internal_number == False, "internal number is not reset"
assert invoice_new.journal_id.id, "journal id is not selected"
assert invoice_new.type == 'in_invoice', "Invoice type was not set properly"
assert len(invoice_new.invoice_line) == 2, "invoice lines are not same"
for inv_line in invoice_new.invoice_line:
if inv_line.name == 'Basic PC':
assert inv_line.uos_id.name == "PCE" , "uom is not same"
assert inv_line.price_unit == 10 , "price unit is not same"
assert inv_line.quantity == 1 , "product qty is not same"
assert inv_line.price_subtotal == 10, "price sub total is not same"
elif inv_line.name == 'Medium PC':
assert inv_line.uos_id.name == "PCE" , "uom is not same"
assert inv_line.price_unit == 100 , "price unit is not same"
assert inv_line.quantity == 5 , "product qty is not same"
assert inv_line.price_subtotal == 500, "price sub total is not same"
else:
raise AssertionError('unknown invoice line: %s' % inv_line)
for inv_tax in invoice_new.tax_line:
assert inv_tax.manual, "tax line not set to manual"
assert inv_tax.account_id, "missing tax line account"

View File

@ -47,3 +47,5 @@ for a in account_lists:
(a2['parent_right']<a['parent_right']))
if a2['parent_id']==a['id']:
assert (a2['parent_left']>a['parent_left']) and (a2['parent_right']<a['parent_right'])
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -66,6 +66,7 @@ import account_change_currency
import account_report_balance_sheet
import account_report_profit_loss
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -32,7 +32,6 @@
<field name="model">account.journal.period</field>
<field name="name">Open Journal</field>
<field eval="'ir.actions.act_window,%d'%action_open_journal_button" name="value"/>
<field eval="True" name="object"/>
</record>
</data>
</openerp>

View File

@ -188,7 +188,7 @@ class account_move_journal(osv.osv_memory):
'view_mode': 'tree,graph,form',
'res_model': 'account.move.line',
'view_id': False,
'context': "{'search_default_posted': %d, 'visible_id':%s, 'search_default_journal_id':%d, 'search_default_period_id':%d}" % (move, journal_id, journal_id, period_id),
'context': "{'search_default_posted': %d, 'search_default_journal_id':%d, 'search_default_period_id':%d}" % (move, journal_id, period_id),
'type': 'ir.actions.act_window',
'search_view_id': res_id
}

View File

@ -33,7 +33,6 @@
<record id="action_idea_post_vote_values" model="ir.values">
<field name="model_id" ref="model_account_period" />
<field name="object" eval="1" />
<field name="name">Close a Period</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_period_close'))"/>

View File

@ -33,7 +33,6 @@
</record>
<record model="ir.values" id="action_partner_reconcile_actino">
<field name="model_id" ref="account.model_account_move_line" />
<field name="object" eval="1" />
<field name="name">Partner reconciliation</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_partner_reconcile'))" />

View File

@ -37,7 +37,6 @@
<record model="ir.values" id="action_account_move_line_reconcile_prompt_values">
<field name="model_id" ref="account.model_account_move_line" />
<field name="object" eval="1" />
<field name="name">Reconcile Entries</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_view_account_move_line_reconcile'))" />

View File

@ -45,7 +45,6 @@
<record model="ir.values" id="action_account_balance_report_values1">
<field name="model_id" ref="account.model_account_account" />
<field name="object" eval="1" />
<field name="name">Trial Balance</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_balance_menu'))" />

View File

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

View File

@ -44,3 +44,5 @@ class account_common_account_report(osv.osv_memory):
account_common_account_report()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

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

View File

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

View File

@ -37,3 +37,5 @@ class account_general_journal(osv.osv_memory):
account_general_journal()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -51,7 +51,6 @@
<record model="ir.values" id="action_account_general_ledger_values">
<field name="model_id" ref="account.model_account_account" />
<field name="object" eval="1" />
<field name="name">General Ledger</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_general_ledger_menu'))" />

View File

@ -46,3 +46,5 @@ class account_print_journal(osv.osv_memory):
account_print_journal()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -31,7 +31,6 @@
<record model="ir.values" id="account_unreconcile_values">
<field name="model_id" ref="account.model_account_move_line" />
<field name="object" eval="1" />
<field name="name">Unreconcile Entries</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_unreconcile'))" />
@ -70,7 +69,6 @@
<record model="ir.values" id="account_unreconcile_reconcile_values">
<field name="model_id" ref="account.model_account_move_reconcile" />
<field name="object" eval="1" />
<field name="name">Unreconcile Entries</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_unreconcile_reconcile'))" />

View File

@ -47,67 +47,16 @@ class account_use_model(osv.osv_memory):
def create_entries(self, cr, uid, ids, context=None):
account_model_obj = self.pool.get('account.model')
account_period_obj = self.pool.get('account.period')
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
pt_obj = self.pool.get('account.payment.term')
mod_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
move_ids = []
entry = {}
data = self.read(cr, uid, ids, context=context)[0]
record_id = context and context.get('model_line', False) or False
if record_id:
data_model = account_model_obj.browse(cr, uid, data['model'], context=context)
model_ids = data['model']
else:
data_model = account_model_obj.browse(cr, uid, context['active_ids'], context=context)
for model in data_model:
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%d')}
period_id = account_period_obj.find(cr, uid, context=context)
if not period_id:
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
move_id = account_move_obj.create(cr, uid, {
'ref': entry['name'],
'period_id': period_id,
'journal_id': model.journal_id.id,
})
move_ids.append(move_id)
for line in model.lines_id:
analytic_account_id = False
if line.analytic_account_id:
if not model.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (model.journal_id.name,))
analytic_account_id = line.analytic_account_id.id
val = {
'move_id': move_id,
'journal_id': model.journal_id.id,
'period_id': period_id,
'analytic_account_id': analytic_account_id
}
date_maturity = time.strftime('%Y-%m-%d')
if line.date_maturity == 'partner' and line.partner_id and line.partner_id.property_payment_term:
payment_term_id = line.partner_id.property_payment_term.id
pterm_list = pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_maturity)
if pterm_list:
pterm_list = [l[0] for l in pterm_list]
pterm_list.sort()
date_maturity = pterm_list[-1]
val.update({
'name': line.name,
'quantity': line.quantity,
'debit': line.debit,
'credit': line.credit,
'account_id': line.account_id.id,
'move_id': move_id,
'partner_id': line.partner_id.id,
'date': time.strftime('%Y-%m-%d'),
'date_maturity': date_maturity
})
c = context.copy()
c.update({'journal_id': model.journal_id.id,'period_id': period_id})
account_move_line_obj.create(cr, uid, val, context=c)
model_ids = context['active_ids']
move_ids = account_model_obj.generate(cr, uid, model_ids, context=context)
context.update({'move_ids':move_ids})
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_move_form')], context=context)

View File

@ -73,7 +73,6 @@
<record model="ir.values" id="validate_account_move_line_values">
<field name="model_id" ref="account.model_account_move_line" />
<field name="object" eval="1" />
<field name="name">Post Journal Entries</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_validate_account_move_line'))" />

View File

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

View File

@ -0,0 +1,36 @@
# Bengali translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-11-21 12:33+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Bengali <bn@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-22 05:00+0000\n"
"X-Generator: Launchpad (build 14299)\n"
#. module: account_accountant
#: model:ir.module.module,description:account_accountant.module_meta_information
msgid ""
"\n"
"This module gives the admin user the access to all the accounting features "
"like the journal\n"
"items and the chart of accounts.\n"
" "
msgstr ""
"\n"
"এই মডিউল admin ব্যবহারকারীকে সকল হিসাবরক্ষন এর সুবিধা দিবে\n"
" "
#. module: account_accountant
#: model:ir.module.module,shortdesc:account_accountant.module_meta_information
msgid "Accountant"
msgstr "হিসাবরক্ষনকারী"

View File

@ -0,0 +1,33 @@
# Hebrew translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-11-18 17:39+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Hebrew <he@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-19 05:13+0000\n"
"X-Generator: Launchpad (build 14299)\n"
#. module: account_accountant
#: model:ir.module.module,description:account_accountant.module_meta_information
msgid ""
"\n"
"This module gives the admin user the access to all the accounting features "
"like the journal\n"
"items and the chart of accounts.\n"
" "
msgstr ""
#. module: account_accountant
#: model:ir.module.module,shortdesc:account_accountant.module_meta_information
msgid "Accountant"
msgstr ""

View File

@ -0,0 +1,38 @@
# Occitan (post 1500) translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-11-20 09:14+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Occitan (post 1500) <oc@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-21 05:22+0000\n"
"X-Generator: Launchpad (build 14299)\n"
#. module: account_accountant
#: model:ir.module.module,description:account_accountant.module_meta_information
msgid ""
"\n"
"This module gives the admin user the access to all the accounting features "
"like the journal\n"
"items and the chart of accounts.\n"
" "
msgstr ""
"\n"
"Aqueste modul balha a l'administrator los accèsses a totas las "
"foncionalitats comptablas talas coma las linhas\n"
"d'escritura e lo plan comptable.\n"
" "
#. module: account_accountant
#: model:ir.module.module,shortdesc:account_accountant.module_meta_information
msgid "Accountant"
msgstr "Comptable"

View File

@ -61,7 +61,7 @@ class account_analytic_account(osv.osv):
res[id][f] = [int(id * 1000000 + int(x[0])) for x in result]
elif f == 'last_worked_invoiced_date':
for id in ids:
res[id][f] = 0.0
res[id][f] = False
if parent_ids:
cr.execute("SELECT account_analytic_line.account_id, MAX(date) \
FROM account_analytic_line \
@ -74,8 +74,8 @@ class account_analytic_account(osv.osv):
res[account_id][f] = sum
for account in accounts:
for child in account.child_ids:
if res[account.id].get(f, '') < res.get(child.id, {}).get(f, ''):
res[account.id][f] = res.get(child.id, {}).get(f, '')
if res[account.id][f] < res.get(child.id, {}).get(f):
res[account.id][f] = res.get(child.id, {}).get(f, False)
elif f == 'ca_to_invoice':
for id in ids:
res[id][f] = 0.0
@ -123,7 +123,7 @@ class account_analytic_account(osv.osv):
res[id][f] = round(res.get(id, {}).get(f, 0.0), dp) + round(res2.get(id, 0.0), 2)
elif f == 'last_invoice_date':
for id in ids:
res[id][f] = ''
res[id][f] = False
if parent_ids:
cr.execute ("SELECT account_analytic_line.account_id, \
DATE(MAX(account_invoice.date_invoice)) \
@ -137,11 +137,11 @@ class account_analytic_account(osv.osv):
res[account_id][f] = lid
for account in accounts:
for child in account.child_ids:
if res[account.id][f] < res.get(child.id, {}).get(f, ''):
res[account.id][f] = res.get(child.id, {}).get(f, '')
if res[account.id][f] < res.get(child.id, {}).get(f):
res[account.id][f] = res.get(child.id, {}).get(f, False)
elif f == 'last_worked_date':
for id in ids:
res[id][f] = ''
res[id][f] = False
if parent_ids:
cr.execute("SELECT account_analytic_line.account_id, MAX(date) \
FROM account_analytic_line \
@ -154,8 +154,8 @@ class account_analytic_account(osv.osv):
res[account_id][f] = lwd
for account in accounts:
for child in account.child_ids:
if res[account.id][f] < res.get(child.id, {}).get(f, ''):
res[account.id][f] = res.get(child.id, {}).get(f, '')
if res[account.id][f] < res.get(child.id, {}).get(f):
res[account.id][f] = res.get(child.id, {}).get(f, False)
elif f == 'hours_qtt_non_invoiced':
for id in ids:
res[id][f] = 0.0
@ -376,13 +376,11 @@ class account_analytic_account(osv.osv):
def _is_overdue_quantity(self, cr, uid, ids, fieldnames, args, context=None):
result = dict.fromkeys(ids, 0)
for record in self.browse(cr, uid, ids, context=context):
if record.quantity == 0.0 and record.quantity_max == 0.0:
result[record.id] = 0
else:
if record.quantity_max > 0.0:
result[record.id] = int(record.quantity >= record.quantity_max)
else:
result[record.id] = 0
return result
def _get_analytic_account(self, cr, uid, ids, context=None):

View File

@ -1,7 +1,6 @@
<openerp>
<data>
<menuitem icon="terp-project" id="base.menu_main_pm" name="Project" sequence="10"/>
<menuitem id="menu_invoicing" name="Billing" parent="base.menu_main_pm" sequence="4" groups="base.group_extended"/>
<menuitem id="base.menu_invoiced" name="Invoicing" parent="base.menu_base_partner" sequence="5"/>
<record id="action_hr_tree_invoiced_all" model="ir.actions.act_window">
<field name="name">All Uninvoiced Entries</field>
@ -11,16 +10,7 @@
<field name="domain">[('invoice_id','=',False)]</field>
<field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
</record>
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="menu_invoicing" groups="analytic.group_analytic_accounting"/>
<record id="action_account_analytic_managed_overpassed" model="ir.actions.act_window">
<field name="name">Overpassed Accounts</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="domain">[('date','&lt;=',time.strftime('%Y-%m-%d')),('state','=','open')]</field>
</record>
<menuitem action="action_account_analytic_managed_overpassed" id="menu_action_account_analytic_managed_overpassed" sequence="50" parent="menu_invoicing" groups="base.group_extended"/>
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="base.menu_invoiced"/>
<record id="view_account_analytic_account_overdue_search" model="ir.ui.view">
<field name="name">account.analytic.account.search</field>
@ -29,11 +19,10 @@
<field name="arch" type="xml">
<search string="Analytic Account">
<group col="8" colspan="4">
<filter icon="terp-check" name="draft" string="Draft" domain="[('state','=','draft')]" help="Contracts not signed yet"/>
<filter icon="terp-camera_test" name="open" string="Open" domain="[('state','=','open')]" help="Contracts in progress"/>
<filter icon="terp-camera_test" name="open" string="Open" domain="[('state','in',('open','draft'))]" help="Contracts in progress"/>
<filter icon="terp-gtk-media-pause" name="pending" string="Pending" domain="[('state','=','pending')]" help="Pending contracts to renew with your customer"/>
<separator orientation="vertical"/>
<filter icon="terp-go-today" string="To Renew" domain="['|', '&amp;', ('date', '!=', False), ('date', '&lt;', time.strftime('%%Y-%%m-%%d')), ('is_overdue_quantity', '=', True)]"
<filter icon="terp-go-today" string="To Renew" domain="['|', '&amp;', ('date', '!=', False), ('date', '&lt;=', time.strftime('%%Y-%%m-%%d')), ('is_overdue_quantity', '=', True)]"
name="renew"
help="The contracts to be renewed because the deadline is passed or the working hours are higher than the allocated hours" />
<filter icon="terp-go-month"
@ -45,8 +34,7 @@
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="partner_id" select="1">
<filter string="Has Partner" name="has_partner" domain="[('partner_id', '!=', False)]" icon="terp-partner" />
<filter string="Has No Partner" name="has_no_partner" domain="[('partner_id', '=', False)]" icon="terp-partner" />
<filter string="A contract in OpenERP is an analytic account having a partner set on it." name="has_partner" domain="[('partner_id', '!=', False)]" icon="terp-partner" />
</field>
<field name="user_id">
<filter string="My Accounts" domain="[('user_id','=',uid)]" icon="terp-personal" name="my_accounts" />
@ -71,7 +59,7 @@
<record id="action_account_analytic_overdue" model="ir.actions.act_window">
<field name="name">Overdue Accounts</field>
<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>
@ -80,7 +68,34 @@
<field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>
<field name="help">You will find here the contracts to be renewed because the deadline is passed or the working hours are higher than the allocated hours. OpenERP automatically sets these analytic accounts to the pending state, in order to raise a warning during the timesheets recording. Salesmen should review all pending accounts and reopen or close the according to the negotiation with the customer.</field>
</record>
<menuitem action="action_account_analytic_overdue" id="menu_action_account_analytic_overdue" sequence="50" parent="sale.menu_invoiced" groups="base.group_extended"/>
<menuitem action="action_account_analytic_overdue" id="menu_action_account_analytic_overdue" sequence="50" parent="base.menu_invoiced"/>
<record id="action_account_analytic_overdue" model="ir.actions.act_window">
<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="context">{'search_default_has_partner':1, 'search_default_my_accounts':1, 'search_default_draft':1, 'search_default_pending':1, 'search_default_open':1, 'search_default_renew':1}</field>
<field name="domain">[('type','=','normal')]</field>
<field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>
<field name="help">You will find here the contracts to be renewed because the deadline is passed or the working hours are higher than the allocated hours. OpenERP automatically sets these analytic accounts to the pending state, in order to raise a warning during the timesheets recording. Salesmen should review all pending accounts and reopen or close the according to the negotiation with the customer.</field>
</record>
<menuitem action="action_account_analytic_overdue" id="menu_action_account_analytic_overdue" sequence="50" parent="base.menu_invoiced"/>
<record id="action_account_analytic_overdue_all" model="ir.actions.act_window">
<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="context">{'search_default_has_partner':1, 'search_default_my_accounts':1, 'search_default_draft':1, 'search_default_pending':1, 'search_default_open':1}</field>
<field name="domain">[('type','=','normal')]</field>
<field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>
</record>
<menuitem id="base.menu_sales" name="Sales"
parent="base.menu_base_partner"
sequence="1"/>
<menuitem action="action_account_analytic_overdue_all" id="menu_action_account_analytic_overdue_all" sequence="50" parent="base.menu_sales"/>
</data>
</openerp>

View File

@ -8,6 +8,27 @@
Remove information on Account data => because they move on analysis sheet
create a page with invoicing informations
-->
<record id="account_analytic_account_invoice_stat_form" model="ir.ui.view">
<field name="name">account.analytic.account.invoice.stat.form.inherit</field>
<field name="model">account.analytic.account</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr_timesheet_invoice.account_analytic_account_form_form"/>
<field eval="18" name="priority"/>
<field name="arch" type="xml">
<group name="invoice_stats" position="inside">
<field name="hours_qtt_non_invoiced"/>
<field name="ca_to_invoice"/>
<label string="" colspan="1"/>
<button
name="%(hr_timesheet_invoice.action_hr_timesheet_invoice_create_final)d"
string="Create Invoice"
type="action"
attrs="{'readonly':[('ca_to_invoice','=',0.0)]}"
icon="gtk-go-forward"/>
</group>
</field>
</record>
<record id="hr_timesheet.account_analytic_account_form_form" model="ir.ui.view">
<field name="name">account.analytic.account.invoice.form.inherit</field>
<field name="model">account.analytic.account</field>
@ -16,7 +37,7 @@
<field eval="18" name="priority"/>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Analysis summary">
<page string="Invoice Analysis">
<separator colspan="4" string="Work done stats"/>
<field name="total_cost"/>
@ -39,10 +60,6 @@
<field name="last_invoice_date"/>
<field name="last_worked_invoiced_date"/>
<field name="last_worked_date"/>
<separator colspan="4" string="To be invoiced"/>
<field name="hours_qtt_non_invoiced"/>
<field name="ca_to_invoice"/>
</page>
<page string="Stats by month">
<field colspan="4" name="month_ids" nolabel="1">

View File

@ -77,3 +77,5 @@ class analytic_account(osv.osv):
return True
analytic_account()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -36,7 +36,6 @@
<record model="ir.values" id="account_crossovered_analytic_values">
<field name="model_id" ref="analytic.model_account_analytic_account" />
<field name="object" eval="1" />
<field name="name">Crossovered Analytic</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_crossovered_analytic'))" />
@ -45,4 +44,4 @@
</record>
</data>
</openerp>
</openerp>

View File

@ -26,15 +26,17 @@ class purchase_order(osv.osv):
_inherit = "purchase.order"
_description = "Purchase Order"
def inv_line_create(self, cr, uid, a, ol):
line = super(purchase_order, self).inv_line_create(cr, uid, a, ol)
if ol.product_id and not ol.product_id.type == 'service':
oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id
if not oa:
oa = ol.product_id.categ_id.property_stock_account_input_categ and ol.product_id.categ_id.property_stock_account_input_categ.id
if oa:
fpos = ol.order_id.fiscal_position or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
line[2].update({'account_id': a})
def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
line = super(purchase_order, self)._prepare_inv_line(cr, uid, account_id, order_line, context=context)
if order_line.product_id and not order_line.product_id.type == 'service':
acc_id = order_line.product_id.property_stock_account_input and order_line.product_id.property_stock_account_input.id
if not acc_id:
acc_id = order_line.product_id.categ_id.property_stock_account_input_categ and order_line.product_id.categ_id.property_stock_account_input_categ.id
if acc_id:
fpos = order_line.order_id.fiscal_position or False
new_account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, acc_id)
line.update({'account_id': new_account_id})
return line
purchase_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -47,11 +47,11 @@
<filter string="Year" icon="terp-go-year" name="year"
domain="[('purchase_date','&lt;=', time.strftime('%%Y-%%m-%%d')),('purchase_date','&gt;=',time.strftime('%%Y-01-01'))]"
help="Assets purchased in current year"/>
<separator orientation="vertical"/>
<filter string="This Month" icon="terp-go-month" name="this_month"
<separator orientation="vertical"/>
<filter string="Month" icon="terp-go-month" name="this_month"
domain="[('purchase_date','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('purchase_date','&gt;=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
help="Assets purchased in current month"/>
<filter icon="terp-go-month" string="Previous Month" separator="1"
<filter icon="terp-go-month" string="Month-1" separator="1"
domain="[('purchase_date','&lt;=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('purchase_date','&gt;=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"
help="Assets purchased in last month"/>
<separator orientation="vertical"/>

View File

@ -32,7 +32,6 @@
<record model="ir.values" id="account_budget_analytic_values">
<field name="model_id" ref="analytic.model_account_analytic_account" />
<field name="object" eval="1" />
<field name="name">Print Budgets</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_analytic'))" />

View File

@ -31,7 +31,6 @@
</record>
<record model="ir.values" id="account_budget_crossvered_report_values">
<field name="model_id" ref="account_budget.model_crossovered_budget" />
<field name="object" eval="1" />
<field name="name">Print Budgets</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_crossvered_report'))" />

View File

@ -32,7 +32,6 @@
<record model="ir.values" id="account_budget_crossvered_summary_report_values">
<field name="model_id" ref="account_budget.model_crossovered_budget" />
<field name="object" eval="1" />
<field name="name">Print Summary</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_crossvered_summary_report'))" />

View File

@ -32,7 +32,6 @@
<record model="ir.values" id="account_budget_report_values">
<field name="model_id" ref="account_budget.model_account_budget_post" />
<field name="object" eval="1" />
<field name="name">Budgets</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_report'))" />

View File

@ -0,0 +1,36 @@
# Bengali translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-11-21 12:37+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Bengali <bn@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-22 05:00+0000\n"
"X-Generator: Launchpad (build 14299)\n"
#. module: account_cancel
#: model:ir.module.module,description:account_cancel.module_meta_information
msgid ""
"\n"
" Module adds 'Allow cancelling entries' field on form view of account "
"journal. If set to true it allows user to cancel entries & invoices.\n"
" "
msgstr ""
"\n"
" মডিউলটি 'Allow cancelling entries' ফিল্ড যুক্ত করবে যা দিয়ে জাবেদা "
"অন্তর্ভুক্তি বাতিল করা যাবে।\n"
" "
#. module: account_cancel
#: model:ir.module.module,shortdesc:account_cancel.module_meta_information
msgid "Account Cancel"
msgstr "হিসাব বাতিল"

View File

@ -0,0 +1,37 @@
# Occitan (post 1500) translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-11-20 09:15+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Occitan (post 1500) <oc@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-21 05:22+0000\n"
"X-Generator: Launchpad (build 14299)\n"
#. module: account_cancel
#: model:ir.module.module,description:account_cancel.module_meta_information
msgid ""
"\n"
" Module adds 'Allow cancelling entries' field on form view of account "
"journal. If set to true it allows user to cancel entries & invoices.\n"
" "
msgstr ""
"\n"
" Lo modul apond lo camp 'Permetre l'anullacion de las entradas' dins la "
"vista formulari del jornal. S'es egal a Verai, aquò permet a l'utilizaire "
"d'anullar l'entrada e la factura.\n"
" "
#. module: account_cancel
#: model:ir.module.module,shortdesc:account_cancel.module_meta_information
msgid "Account Cancel"
msgstr "Anullacion comptabla"

View File

@ -28,7 +28,7 @@ class followup(osv.osv):
'name': fields.char('Name', size=64, required=True),
'description': fields.text('Description'),
'followup_line': fields.one2many('account_followup.followup.line', 'followup_id', 'Follow-Up'),
'company_id': fields.many2one('res.company', 'Company'),
'company_id': fields.many2one('res.company', 'Company', required=True),
}
_defaults = {
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account_followup.followup', context=c),

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-11-11 15:22+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2011-11-25 14:47+0000\n"
"Last-Translator: Numérigraphe <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-12 04:52+0000\n"
"X-Generator: Launchpad (build 14277)\n"
"X-Launchpad-Export-Date: 2011-11-26 05:49+0000\n"
"X-Generator: Launchpad (build 14381)\n"
#. module: account_followup
#: code:addons/account_followup/wizard/account_followup_print.py:295
@ -89,6 +89,11 @@ msgid ""
"\n"
"%s"
msgstr ""
"\n"
"\n"
"Courriel envoyé vers les Partenaires suivants :\n"
"\n"
"%s"
#. module: account_followup
#: view:account_followup.followup:0
@ -538,6 +543,9 @@ msgid ""
"\n"
"%s"
msgstr ""
"Tous les courriels ont été envoyés correctement vers les Partenaires :\n"
"\n"
"%s"
#. module: account_followup
#: constraint:res.company:0
@ -728,6 +736,9 @@ msgid ""
"\n"
"%s"
msgstr ""
"Courriel non envoyé vers les Partenaires suivants (courriel indisponible) !\n"
"\n"
"%s"
#. module: account_followup
#: view:account.followup.print:0

View File

@ -8,25 +8,25 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-11-11 15:21+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2011-11-22 19:07+0000\n"
"Last-Translator: Milan Milosevic <Unknown>\n"
"Language-Team: Serbian latin <sr@latin@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-12 04:52+0000\n"
"X-Generator: Launchpad (build 14277)\n"
"X-Launchpad-Export-Date: 2011-11-23 05:20+0000\n"
"X-Generator: Launchpad (build 14336)\n"
#. module: account_followup
#: code:addons/account_followup/wizard/account_followup_print.py:295
#, python-format
msgid "Followup Summary"
msgstr "Sumarno Pracenje"
msgstr "Sumarno praćenje"
#. module: account_followup
#: view:account_followup.followup:0
msgid "Search Followup"
msgstr "Pretrazi Pracenja"
msgstr "Pretraži praćenja"
#. module: account_followup
#: model:ir.module.module,description:account_followup.module_meta_information
@ -52,11 +52,31 @@ msgid ""
"Sent\n"
"\n"
msgstr ""
"\n"
" Moduli za automatizovana pisma za neplaćenbe fakture, sa podsećanjem na "
"više nivoa.\n"
"\n"
" Možete definisati višestruke nivoe podsećanja kroz meni:\n"
" Accounting/Configuration/Miscellaneous/Follow-Ups\n"
"\n"
" Jednom kad budu definisani, možete štampati podsećanja svakodnevno\n"
" prostim klikom na meni:\n"
" Accounting/Periodical Processing/Billing/Send followups\n"
"\n"
" Generisaće se PDF datoteka sa svim pismima shodno\n"
" različitim nivoima podsećanja. Možete definisati različite načine\n"
" za različita preduzeća. Možete takođe poslati el.poštu stranci.\n"
"\n"
" Zapazite da ako želite da izmenite nivo praćenja za datog "
"partnera/stavku naloga, možete to uraditi iz menija:\n"
" Accounting/Reporting/Generic Reporting/Partner Accounts/Follow-ups "
"Sent\n"
"\n"
#. module: account_followup
#: view:account_followup.stat:0
msgid "Group By..."
msgstr "Grupirano po"
msgstr "Grupiši po..."
#. module: account_followup
#: code:addons/account_followup/wizard/account_followup_print.py:290
@ -68,12 +88,17 @@ msgid ""
"\n"
"%s"
msgstr ""
"\n"
"\n"
"El.pošta uspešno poslata sledećim partnerim. !\n"
"\n"
"%s"
#. module: account_followup
#: view:account_followup.followup:0
#: field:account_followup.followup,followup_line:0
msgid "Follow-Up"
msgstr "Следи"
msgstr "Sledi"
#. module: account_followup
#: field:account_followup.followup,company_id:0
@ -86,7 +111,7 @@ msgstr "Preduzeće"
#. module: account_followup
#: report:account_followup.followup.print:0
msgid "Invoice Date"
msgstr "Datum računa"
msgstr "Datum fakture"
#. module: account_followup
#: field:account.followup.print.all,email_subject:0
@ -108,27 +133,27 @@ msgstr "Legenda"
#. module: account_followup
#: view:account.followup.print.all:0
msgid "Ok"
msgstr "U redu"
msgstr "OK"
#. module: account_followup
#: view:account.followup.print.all:0
msgid "Select Partners to Remind"
msgstr ""
msgstr "Izaberite partnere koje biste hteli podsetiti"
#. module: account_followup
#: constraint:account.move.line:0
msgid "You can not create move line on closed account."
msgstr ""
msgstr "Ne možete da napravite poteznu liniju na zatvorenim računima."
#. module: account_followup
#: field:account.followup.print,date:0
msgid "Follow-up Sending Date"
msgstr "Datum Slanja Pracenja"
msgstr "Datum slanja praćenja"
#. module: account_followup
#: sql_constraint:account.move.line:0
msgid "Wrong credit or debit value in accounting entry !"
msgstr ""
msgstr "Pogrešna vrednost kredita ili debita u ulazu računa !"
#. module: account_followup
#: selection:account_followup.followup.line,start:0
@ -139,12 +164,12 @@ msgstr "Neto dana"
#: model:ir.actions.act_window,name:account_followup.action_account_followup_definition_form
#: model:ir.ui.menu,name:account_followup.account_followup_menu
msgid "Follow-Ups"
msgstr "Pracenja"
msgstr "Praćenja"
#. module: account_followup
#: view:account_followup.stat.by.partner:0
msgid "Balance > 0"
msgstr ""
msgstr "Balans > 0"
#. module: account_followup
#: view:account.move.line:0
@ -154,18 +179,18 @@ msgstr "Ukupno duguje"
#. module: account_followup
#: view:account.followup.print.all:0
msgid "%(heading)s: Move line header"
msgstr "%(heading): Zaglavlje reda prijenosa"
msgstr "%(heading): Zaglavlje reda prenosa"
#. module: account_followup
#: view:res.company:0
#: field:res.company,follow_up_msg:0
msgid "Follow-up Message"
msgstr "Poruka Pracenja"
msgstr "Poruka praćenja"
#. module: account_followup
#: field:account.followup.print,followup_id:0
msgid "Follow-up"
msgstr "Pracenje"
msgstr "Praćenje"
#. module: account_followup
#: report:account_followup.followup.print:0
@ -198,17 +223,17 @@ msgstr ""
#. module: account_followup
#: model:ir.model,name:account_followup.model_account_followup_followup
msgid "Account Follow Up"
msgstr "Nalog Pracenja"
msgstr "Nalog praćenja"
#. module: account_followup
#: selection:account_followup.followup.line,start:0
msgid "End of Month"
msgstr "Kraj Meseca"
msgstr "Kraj meseca"
#. module: account_followup
#: view:account_followup.stat:0
msgid "Not Litigation"
msgstr "Nije Sporno"
msgstr "Nije sporno"
#. module: account_followup
#: view:account.followup.print.all:0
@ -227,22 +252,26 @@ msgid ""
"You can send them the default message for unpaid invoices or manually enter "
"a message should you need to remind them of a specific information."
msgstr ""
"Ova funkcija omogućava Vam slanje podsetnika partnerima sa fakturama na "
"čekanju. Možete im poslati podrazumevanu poruku za neplaćene fakture ili "
"ručno uneti poruku, u slučaju da Vam treba da ih podsetite na neku "
"specifičnu informaciju."
#. module: account_followup
#: report:account_followup.followup.print:0
msgid "Ref"
msgstr "Referenca"
msgstr "Ref"
#. module: account_followup
#: help:account_followup.followup.line,sequence:0
msgid "Gives the sequence order when displaying a list of follow-up lines."
msgstr "Daje redosled sekvenci pri prikazivanju linija pracenja"
msgstr "Daje redosled sekvenci pri prikazivanju linija praćenja"
#. module: account_followup
#: view:account.followup.print.all:0
#: field:account.followup.print.all,email_body:0
msgid "Email body"
msgstr "Sadrzaj Email-a"
msgstr "Sadržaj E-mail-a"
#. module: account_followup
#: field:account.move.line,followup_line_id:0
@ -279,44 +308,46 @@ msgid ""
"Best Regards,\n"
msgstr ""
"\n"
"Postovani %(partner_name)\n"
"Razocarani smo sto vam se moramo obracati ovako, saljuci vam opomenu, ali "
"vas nalog je u ozbiljnom prekoracenju.\n"
"Poštovani %(partner_name)\n"
"Razočarani smo što je Vaš nalog u ozbiljnom prekoracenju, uprkos poslatom "
"podsetniku.\n"
"\n"
"Vrlo je vazno da ispunite vase obaveze ka nama, inace ce mo biti prisiljeni "
"da obustavimo vas nalog, sto u stvari znaci da necemo vise biti\n"
"u mogucnosti da vase preduzece nadalje snabdevamo ( robom / servisiranjem).\n"
"Molimo vas da preduzmete mere kako bi regulisali vasa dugovanja u sledecih 8 "
"dana.\n"
" Vrlo je važno da ispunite svoje obaveze ka nama, inače ćemo biti prisiljeni "
"da obustavimo Vaš nalog, što u stvari znači da nećemo više biti\n"
" u mogućnosti da Vaše preduzeće nadalje snabdevamo ( robom / "
"servisiranjem).\n"
" Molimo vas da preduzmete mere kako biste regulisali svoja dugovanja u "
"sledećih 8 dana.\n"
"\n"
"Ukoliko postoji problem, vezan za fakturu, sa kojim nismo upoznati, ne "
"ustrucavajte se da kontaktirate nase racunovodstvo na broj (+32) 20 555 666 "
"kako bi smo razmotrili problem sto je hitnije moguce.\n"
" Ukoliko postoji problem, vezan za fakturu, sa kojim nismo upoznati, ne "
"ustručavajte se da kontaktirate naše računovodstvo na broj (+32) 20 555 666 "
"kako bismo razmotrili problem što je hitnije moguće.\n"
"\n"
"Detalji vase fakture su prikazani ispod.\n"
" Detalji Vaše fakture su prikazani ispod.\n"
"\n"
"Uz svo postovanje.\n"
" Uz svo poštovanje.\n"
#. module: account_followup
#: field:account.followup.print.all,partner_lang:0
msgid "Send Email in Partner Language"
msgstr "Posalji Email na jeziku Partnera"
msgstr "Pošalji E-mail na jeziku partnera"
#. module: account_followup
#: constraint:account.move.line:0
msgid ""
"You can not create move line on receivable/payable account without partner"
msgstr ""
"Ne možete napraviti poteznu liniju na primaćem/platežnom računu bez partnera"
#. module: account_followup
#: view:account.followup.print.all:0
msgid "Partner Selection"
msgstr "Selekcija Partnera"
msgstr "Izbor partnera"
#. module: account_followup
#: field:account_followup.followup.line,description:0
msgid "Printed Message"
msgstr "Ispisana Poruka"
msgstr "Ištampana poruka"
#. module: account_followup
#: view:account.followup.print:0
@ -330,7 +361,7 @@ msgstr "Pošalji praćenja"
#. module: account_followup
#: view:account_followup.stat.by.partner:0
msgid "Partner to Remind"
msgstr ""
msgstr "Partner za podsećanje"
#. module: account_followup
#: field:account_followup.followup.line,followup_id:0
@ -355,17 +386,17 @@ msgid ""
"Best Regards,\n"
msgstr ""
"\n"
"postovani %(partner_name)\n"
"Poštovani %(partner_name)\n"
"\n"
"Nacinjen je izuzetak ukoliko je ovo nasa greska, ali , cini se da je sledeci "
"iznos ostao neplacen. Molimo vas da preduzmete odgovarajuce mere kako bi se "
"ovo resilo u sledecih 8 dana.\n"
"Načinjen je izuzetak ukoliko je ovo naša greška, ali , čini se da je sledeći "
"iznos ostao neplaćen. Molimo Vas da preduzmete odgovarajuće mere kako bi se "
"ovo rešilo u sledećih 8 dana.\n"
"\n"
"Ukoliko ste izvrsili uplatu u medjuvremenu, pre ovog Emaila, molimo "
"smatrajte ga nebitnim. Ne ustrucavajte se da kontaktirate nase racunovodstvo "
" Ukoliko ste izvršili uplatu u međuvremenu, pre ove el.pošte, molimo "
"smatrajte ga nebitnim. Ne ustručavajte se da kontaktirate naše računovodstvo "
"na broj (+32) 555 666.\n"
"\n"
"Svo Postovanje.\n"
" Svo poštovanje.\n"
#. module: account_followup
#: model:account_followup.followup.line,description:account_followup.demo_followup_line3
@ -405,7 +436,7 @@ msgstr ""
#. module: account_followup
#: view:account.followup.print.all:0
msgid "Send Mails"
msgstr "Slanje Emailova"
msgstr "Pošalji el.poštu"
#. module: account_followup
#: report:account_followup.followup.print:0
@ -415,25 +446,24 @@ msgstr "Valuta"
#. module: account_followup
#: model:ir.model,name:account_followup.model_account_followup_stat_by_partner
msgid "Followup Statistics by Partner"
msgstr ""
msgstr "Statistike praćenja po partneru"
#. module: account_followup
#: model:ir.module.module,shortdesc:account_followup.module_meta_information
msgid "Accounting follow-ups management"
msgstr "Menadzment naloga Praćenja"
msgstr "Uređivanje naloga praćenja"
#. module: account_followup
#: field:account_followup.stat,blocked:0
msgid "Blocked"
msgstr "Blokiran"
msgstr "Blokirano"
#. module: account_followup
#: help:account.followup.print,date:0
msgid ""
"This field allow you to select a forecast date to plan your follow-ups"
msgstr ""
"Ovo polje vam omogucava da selektujete udaljeni datum za planiranje vaseg "
"pracenja"
"Ovo polje Vam omogućava izbor udaljenog datuma za planiranje Vaših praćenja"
#. module: account_followup
#: report:account_followup.followup.print:0
@ -444,17 +474,17 @@ msgstr "Dospeće"
#: code:addons/account_followup/wizard/account_followup_print.py:56
#, python-format
msgid "Select Partners"
msgstr "Selektuj Partnere"
msgstr "Izaberi partnere"
#. module: account_followup
#: view:account.followup.print.all:0
msgid "Email Settings"
msgstr "Email Postavke"
msgstr "Postavke el.pošte"
#. module: account_followup
#: view:account.followup.print.all:0
msgid "Print Follow Ups"
msgstr "Stampaj Pracenja"
msgstr "Odštampaj praćenja"
#. module: account_followup
#: field:account.move.line,followup_date:0
@ -464,17 +494,17 @@ msgstr "Poslednje praćenje"
#. module: account_followup
#: report:account_followup.followup.print:0
msgid "Sub-Total:"
msgstr "Subtotal"
msgstr "Pod-total"
#. module: account_followup
#: report:account_followup.followup.print:0
msgid "Balance:"
msgstr "Saldo"
msgstr "Balans:"
#. module: account_followup
#: model:ir.model,name:account_followup.model_account_followup_stat
msgid "Followup Statistics"
msgstr "Statistika Pracenja"
msgstr "Statistika praćenja"
#. module: account_followup
#: report:account_followup.followup.print:0
@ -484,22 +514,22 @@ msgstr "Plaćeno"
#. module: account_followup
#: view:account_followup.followup.line:0
msgid "%(user_signature)s: User Name"
msgstr "%(user_signature): Korisnicko Ime"
msgstr "%(user_signature): Korisničko Ime"
#. module: account_followup
#: model:ir.model,name:account_followup.model_account_move_line
msgid "Journal Items"
msgstr "Sadrzaj Dnevnika"
msgstr "Stavke dnevnika"
#. module: account_followup
#: constraint:account.move.line:0
msgid "Company must be same for its related account and period."
msgstr ""
msgstr "Preduzeće mora biti isto za sve vezane račune i periode."
#. module: account_followup
#: field:account.followup.print.all,email_conf:0
msgid "Send email confirmation"
msgstr "Pošalji Email potvrdu"
msgstr "Pošalji E-mail potvrdu"
#. module: account_followup
#: code:addons/account_followup/wizard/account_followup_print.py:287
@ -509,26 +539,29 @@ msgid ""
"\n"
"%s"
msgstr ""
"Sva el-pošta uspešno poslata partnerima:.\n"
"\n"
" %s"
#. module: account_followup
#: constraint:res.company:0
msgid "Error! You can not create recursive companies."
msgstr ""
msgstr "Greška! Ne možete da napravite rekurzivna preduzeća."
#. module: account_followup
#: view:account.followup.print.all:0
msgid "%(company_name)s: User's Company name"
msgstr "%(company_name)s: Ime preduzeca Korisnika"
msgstr "%(company_name)s: Ime preduzeća korisnika"
#. module: account_followup
#: model:ir.model,name:account_followup.model_res_company
msgid "Companies"
msgstr "Kompanije"
msgstr "Preduzeća"
#. module: account_followup
#: view:account_followup.followup:0
msgid "Followup Lines"
msgstr "Linije Pracenja"
msgstr "Linije praćenja"
#. module: account_followup
#: field:account_followup.stat,credit:0
@ -538,7 +571,7 @@ msgstr "Kredit"
#. module: account_followup
#: report:account_followup.followup.print:0
msgid "Maturity Date"
msgstr "Datum Dospeća"
msgstr "Datum dospeća"
#. module: account_followup
#: view:account_followup.followup.line:0
@ -548,30 +581,30 @@ msgstr "%(partner_name): Partnerovo Ime"
#. module: account_followup
#: view:account_followup.stat:0
msgid "Follow-Up lines"
msgstr "Redovi Praćenja"
msgstr "Linije praćenja"
#. module: account_followup
#: view:account.followup.print.all:0
msgid "%(company_currency)s: User's Company Currency"
msgstr "%(company_currency)s: Valuta Preduzeca Korisnika"
msgstr "%(company_currency)s: Valuta preduzeća korisnika"
#. module: account_followup
#: view:account_followup.stat:0
#: field:account_followup.stat,balance:0
#: field:account_followup.stat.by.partner,balance:0
msgid "Balance"
msgstr "Saldo"
msgstr "Balans"
#. module: account_followup
#: field:account_followup.followup.line,start:0
msgid "Type of Term"
msgstr "Tip Uslova"
msgstr "Tip uslova"
#. module: account_followup
#: model:ir.model,name:account_followup.model_account_followup_print
#: model:ir.model,name:account_followup.model_account_followup_print_all
msgid "Print Followup & Send Mail to Customers"
msgstr "Stampaj Pracenje & Posalji Emailove Strankama"
msgstr "Ištampaj praćenje & pošalji E-mailove strankama"
#. module: account_followup
#: field:account_followup.stat,date_move_last:0
@ -582,12 +615,12 @@ msgstr "Poslednji potez"
#. module: account_followup
#: model:ir.actions.report.xml,name:account_followup.account_followup_followup_report
msgid "Followup Report"
msgstr "Izvestaj Pracenja"
msgstr "Izveštaj praćenja"
#. module: account_followup
#: field:account_followup.stat,period_id:0
msgid "Period"
msgstr "Razdoblje"
msgstr "Period"
#. module: account_followup
#: view:account.followup.print:0
@ -598,7 +631,7 @@ msgstr "Otkaži"
#. module: account_followup
#: view:account_followup.followup.line:0
msgid "Follow-Up Lines"
msgstr "Redovi Praćenja"
msgstr "Linije praćenja"
#. module: account_followup
#: view:account_followup.stat:0
@ -608,12 +641,12 @@ msgstr "Sporno"
#. module: account_followup
#: field:account_followup.stat.by.partner,max_followup_id:0
msgid "Max Follow Up Level"
msgstr ""
msgstr "Maksimalan nivo praćenja"
#. module: account_followup
#: model:ir.actions.act_window,name:account_followup.act_account_partner_account_move_payable_all
msgid "Payable Items"
msgstr "Stavke Placanja"
msgstr "Plative stavke"
#. module: account_followup
#: view:account.followup.print.all:0
@ -629,7 +662,7 @@ msgstr "%(datum)i: Trenutni Datum"
#. module: account_followup
#: view:account_followup.stat:0
msgid "Followup Level"
msgstr "Nivo Pracenja"
msgstr "Nivo praćenja"
#. module: account_followup
#: view:account_followup.followup:0
@ -641,12 +674,12 @@ msgstr "Opis"
#. module: account_followup
#: view:account_followup.stat:0
msgid "This Fiscal year"
msgstr "Fiskalna Godina"
msgstr "Ova fiskalna godina"
#. module: account_followup
#: view:account.move.line:0
msgid "Partner entries"
msgstr "Stavke Partnera"
msgstr "Stavke partnera"
#. module: account_followup
#: help:account.followup.print.all,partner_lang:0
@ -654,26 +687,26 @@ msgid ""
"Do not change message text, if you want to send email in partner language, "
"or configure from company"
msgstr ""
"Ne menjajte ovaj text ukoliko zelite da posaljete Email na jeziku Partnera, "
"ili ga konfigurisete po Preduzecu."
"Ne menjajte ovaj tekst, ukoliko želite da posaljete el-poštu na jeziku "
"partnera, ili ga konfigurišete po preduzecu."
#. module: account_followup
#: model:ir.actions.act_window,name:account_followup.act_account_partner_account_move_all
msgid "Receivable Items"
msgstr "Prijemne Stavke"
msgstr "Prijemljive stavke"
#. module: account_followup
#: view:account_followup.stat:0
#: model:ir.actions.act_window,name:account_followup.action_followup_stat
#: model:ir.ui.menu,name:account_followup.menu_action_followup_stat_follow
msgid "Follow-ups Sent"
msgstr "Pracenja Poslata"
msgstr "Praćenja poslata"
#. module: account_followup
#: field:account_followup.followup,name:0
#: field:account_followup.followup.line,name:0
msgid "Name"
msgstr "Ime"
msgstr "Naziv"
#. module: account_followup
#: field:account_followup.stat,date_move:0
@ -699,6 +732,9 @@ msgid ""
"\n"
"%s"
msgstr ""
"El.pošta nije poslata sledećim partnerima, el.pošta nije dostupna !\n"
"\n"
" %s"
#. module: account_followup
#: view:account.followup.print:0
@ -713,13 +749,13 @@ msgstr "Dana kašnjenja"
#. module: account_followup
#: report:account_followup.followup.print:0
msgid "Document : Customer account statement"
msgstr "Dokument:Korisnicka stavka naloga"
msgstr "Dokument: Izjava korisničkog naloga"
#. module: account_followup
#: view:account.followup.print.all:0
#: field:account.followup.print.all,summary:0
msgid "Summary"
msgstr "Sumarno"
msgstr "Sažetak"
#. module: account_followup
#: view:account.move.line:0
@ -729,7 +765,7 @@ msgstr "Ukupno potražuje"
#. module: account_followup
#: view:account.followup.print.all:0
msgid "%(line)s: Ledger Posting lines"
msgstr "%(line): Ledger Posting lines"
msgstr "%(linija)e: poslate iz glavnine"
#. module: account_followup
#: field:account_followup.followup.line,sequence:0
@ -739,7 +775,7 @@ msgstr "Sekvenca"
#. module: account_followup
#: view:account_followup.followup.line:0
msgid "%(company_name)s: User's Company Name"
msgstr "%(company_name): Strankino Ime Preduzeca"
msgstr "%(company_name): Naziv preduzeća korisnika"
#. module: account_followup
#: report:account_followup.followup.print:0
@ -754,17 +790,17 @@ msgstr "%(partner_name)s: Partnerovo Ime"
#. module: account_followup
#: view:account_followup.stat:0
msgid "Latest Followup Date"
msgstr "Datum poslednjeg Pracenja"
msgstr "Datum poslednjeg praćenja"
#. module: account_followup
#: model:ir.model,name:account_followup.model_account_followup_followup_line
msgid "Follow-Up Criteria"
msgstr "Kriterijum Pracenja"
msgstr "Kriterijum praćenja"
#. module: account_followup
#: constraint:account.move.line:0
msgid "You can not create move line on view account."
msgstr ""
msgstr "Ne možete napraviti poteznu liniju na računu po viđenju"
#, python-format
#~ msgid "Follwoup Summary"

View File

@ -35,45 +35,44 @@ class report_rappel(report_sxw.rml_parse):
'get_text': self._get_text
})
def _ids_to_objects(self, partner_ids):
def _ids_to_objects(self, ids):
pool = pooler.get_pool(self.cr.dbname)
all_partners = []
for partner in pool.get('res.partner').browse(self.cr, self.uid, partner_ids):
if partner not in all_partners:
all_partners.append(partner)
return all_partners
all_lines = []
for line in pool.get('account_followup.stat.by.partner').browse(self.cr, self.uid, ids):
if line not in all_lines:
all_lines.append(line)
return all_lines
def _adr_get(self, partner, type):
def _adr_get(self, stat_line, type):
res_partner = pooler.get_pool(self.cr.dbname).get('res.partner')
res_partner_address = pooler.get_pool(self.cr.dbname).get('res.partner.address')
adr = res_partner.address_get(self.cr, self.uid, [partner.id], [type])[type]
adr = res_partner.address_get(self.cr, self.uid, [stat_line.partner_id.id], [type])[type]
return adr and res_partner_address.read(self.cr, self.uid, [adr]) or [{}]
def _lines_get(self, partner):
def _lines_get(self, stat_by_partner_line):
pool = pooler.get_pool(self.cr.dbname)
moveline_obj = pool.get('account.move.line')
company_obj = pool.get('res.company')
obj_currency = pool.get('res.currency')
#FIXME: search on company accounting entries only
movelines = moveline_obj.search(self.cr, self.uid,
[('partner_id', '=', partner.id),
[('partner_id', '=', stat_by_partner_line.partner_id.id),
('account_id.type', '=', 'receivable'),
('reconcile_id', '=', False), ('state', '<>', 'draft')])
('reconcile_id', '=', False), ('state', '<>', 'draft'),('company_id','=', stat_by_partner_line.company_id.id)])
movelines = moveline_obj.browse(self.cr, self.uid, movelines)
base_currency = movelines[0].company_id.currency_id
final_res = []
line_cur = {base_currency.id: {'line': []}}
for line in movelines:
if line.currency_id and (not line.currency_id.id in line_cur):
line_cur[line.currency_id.id] = {'line': []}
currency = line.currency_id or line.company_id.currency_id
if line.account_id.currency_id and (not line.account_id.currency_id.id in line_cur):
line_cur[line.account_id.currency_id.id] = {'line': []}
currency = line.account_id.currency_id or line.company_id.currency_id
line_data = {
'name': line.move_id.name,
'ref': line.ref,
'date':line.date,
'date_maturity': line.date_maturity,
'balance': line.currency_id and line.amount_currency or (line.debit - line.credit),
'balance': currency.id <> line.company_id.currency_id.id and line.amount_currency or (line.debit - line.credit),
'blocked': line.blocked,
'currency_id': currency.symbol or currency.name,
}
@ -85,7 +84,7 @@ class report_rappel(report_sxw.rml_parse):
return final_res
def _get_text(self, partner, followup_id, context=None):
def _get_text(self, stat_line, followup_id, context=None):
if context is None:
context = {}
fp_obj = pooler.get_pool(self.cr.dbname).get('account_followup.followup')
@ -96,10 +95,10 @@ class report_rappel(report_sxw.rml_parse):
li_delay.sort(reverse=True)
text = ""
a = {}
partner_line = pooler.get_pool(self.cr.dbname).get('account.move.line').search(self.cr, self.uid, [('partner_id','=',partner.id),('reconcile_id','=',False)])
partner_line_ids = pooler.get_pool(self.cr.dbname).get('account.move.line').search(self.cr, self.uid, [('partner_id','=',stat_line.partner_id.id),('reconcile_id','=',False),('company_id','=',stat_line.company_id.id)])
partner_delay = []
context.update({'lang': partner.lang})
for i in pooler.get_pool(self.cr.dbname).get('account.move.line').browse(self.cr, self.uid, partner_line, context):
context.update({'lang': stat_line.partner_id.lang})
for i in pooler.get_pool(self.cr.dbname).get('account.move.line').browse(self.cr, self.uid, partner_line_ids, context):
for delay in li_delay:
if i.followup_line_id and str(i.followup_line_id.delay)==str(delay):
text = i.followup_line_id.description
@ -108,16 +107,16 @@ class report_rappel(report_sxw.rml_parse):
text = partner_delay and a[max(partner_delay)] or ''
if text:
text = text % {
'partner_name': partner.name,
'partner_name': stat_line.partner_id.name,
'date': time.strftime('%Y-%m-%d'),
'company_name': fp_obj.browse(self.cr, self.uid, followup_id).company_id.name,
'company_name': stat_line.company_id.name,
'user_signature': pooler.get_pool(self.cr.dbname).get('res.users').browse(self.cr, self.uid, self.uid, context).signature or '',
}
return text
report_sxw.report_sxw('report.account_followup.followup.print',
'res.partner', 'addons/account_followup/report/account_followup_print.rml',
'account_followup.stat.by.partner', 'addons/account_followup/report/account_followup_print.rml',
parser=report_rappel)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -124,7 +124,7 @@
</stylesheet>
<story>
<para style="terp_default_8">[[ repeatIn(ids_to_objects(data['form']['partner_ids']),'o') ]] </para>
<para style="terp_default_8">[[ setLang(o.lang) ]]</para>
<para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
<blockTable colWidths="298.0,234.0" style="Tableau2">
<tr>
@ -132,7 +132,7 @@
<para style="terp_default_9">[[ repeatIn(adr_get(o,'invoice'),'a' )]]</para>
</td>
<td>
<para style="terp_default_9">[[ o.name or '' ]]</para>
<para style="terp_default_9">[[ o.partner_id.name or '' ]]</para>
<para style="terp_default_9">[[ a['street'] or '']]</para>
<para style="terp_default_9">[[ a['street2'] or removeParentNode('para') ]]</para>
<para style="terp_default_9">[[ a['zip'] or '' ]] [[ a['city'] or '' ]]</para>
@ -141,7 +141,7 @@
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_9">VAT: [[ o.vat or removeParentNode('para') ]]</para>
<para style="terp_default_9">VAT: [[ o.partner_id.vat or removeParentNode('para') ]]</para>
</td>
</tr>
</blockTable>
@ -150,7 +150,7 @@
</para>
<para style="terp_default_9">Document : Customer account statement</para>
<para style="terp_default_9">Date : [[ formatLang(data['form']['date'],date=True) ]]</para>
<para style="terp_default_9">Customer Ref : [[ o.ref or '' ]]</para>
<para style="terp_default_9">Customer Ref : [[ o.partner_id.ref or '' ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>

View File

@ -68,7 +68,7 @@ class account_followup_stat(osv.osv):
cr.execute("""
create or replace view account_followup_stat as (
SELECT
l.partner_id as id,
l.id as id,
l.partner_id AS partner_id,
min(l.date) AS date_move,
max(l.date) AS date_move_last,

View File

@ -105,4 +105,5 @@
self.do_print(cr, uid, [ref("account_followup_print_all_0")], {"lang": 'en_US',
"active_model": "ir.ui.menu", "active_ids": [ref("account_followup.account_followup_print_menu")],
"tz": False, "date": time.strftime('%Y-%m-%d'), "followup_id": ref("account_followup_followup_testfollowups0"), "active_id": ref("account_followup.account_followup_print_menu"),
"company_id": ref('base.main_company'),
})

View File

@ -31,7 +31,7 @@ class account_followup_print(osv.osv_memory):
_description = 'Print Followup & Send Mail to Customers'
_columns = {
'date': fields.date('Follow-up Sending Date', required=True, help="This field allow you to select a forecast date to plan your follow-ups"),
'followup_id': fields.many2one('account_followup.followup', 'Follow-up', required=True)
'followup_id': fields.many2one('account_followup.followup', 'Follow-up', required=True),
}
def _get_followup(self, cr, uid, context=None):
@ -51,7 +51,7 @@ class account_followup_print(osv.osv_memory):
data = self.browse(cr, uid, ids, context=context)[0]
model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
context.update({'followup_id': data.followup_id.id, 'date':data.date})
context.update({'followup_id': data.followup_id.id, 'date': data.date, 'company_id': data.followup_id.company_id.id})
return {
'name': _('Select Partners'),
'view_type': 'form',
@ -87,10 +87,13 @@ class account_followup_stat_by_partner(osv.osv):
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_followup_stat_by_partner')
# Here we don't have other choice but to create a virtual ID based on the concatenation
# of the partner_id and the company_id. An assumption that the number of companies will
# not reach 10 000 records is made, what should be enough for a time.
cr.execute("""
create or replace view account_followup_stat_by_partner as (
SELECT
l.partner_id AS id,
l.partner_id * 10000 + l.company_id as id,
l.partner_id AS partner_id,
min(l.date) AS date_move,
max(l.date) AS date_move_last,
@ -148,6 +151,8 @@ class account_followup_print_all(osv.osv_memory):
context = {}
if ids:
data = self.browse(cr, uid, ids, context=context)[0]
company_id = 'company_id' in context and context['company_id'] or data.company_id.id
cr.execute(
"SELECT l.partner_id, l.followup_line_id,l.date_maturity, l.date, l.id "\
"FROM account_move_line AS l "\
@ -159,7 +164,8 @@ class account_followup_print_all(osv.osv_memory):
"AND (l.partner_id is NOT NULL) "\
"AND (a.active) "\
"AND (l.debit > 0) "\
"ORDER BY l.date")
"AND (l.company_id = %s) "\
"ORDER BY l.date", (company_id,))
move_lines = cr.fetchall()
old = None
fups = {}
@ -189,16 +195,16 @@ class account_followup_print_all(osv.osv_memory):
continue
if followup_line_id not in fups:
continue
stat_line_id = partner_id * 10000 + company_id
if date_maturity:
if date_maturity <= fups[followup_line_id][0].strftime('%Y-%m-%d'):
if partner_id not in partner_list:
partner_list.append(partner_id)
partner_list.append(stat_line_id)
to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id}
elif date and date <= fups[followup_line_id][0].strftime('%Y-%m-%d'):
if partner_id not in partner_list:
partner_list.append(partner_id)
to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id}
partner_list.append(stat_line_id)
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):
@ -225,7 +231,7 @@ class account_followup_print_all(osv.osv_memory):
partners.append(line.partner_id)
dict_lines[line.partner_id.id] =line
for partner in partners:
ids_lines = move_obj.search(cr,uid,[('partner_id','=',partner.id),('reconcile_id','=',False),('account_id.type','in',['receivable'])])
ids_lines = move_obj.search(cr,uid,[('partner_id','=',partner.id),('reconcile_id','=',False),('account_id.type','in',['receivable']),('company_id','=',context.get('company_id', False))])
data_lines = move_obj.browse(cr, uid, ids_lines, context=context)
followup_data = dict_lines[partner.id]
dest = False

View File

@ -13,7 +13,6 @@
<group col="4" colspan="6">
<field name="followup_id"/>
<field name="date"/>
<newline/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
@ -81,7 +80,7 @@
<notebook>
<page string="Partner Selection">
<separator string="Select Partners to Remind" colspan="4"/>
<field name="partner_ids" colspan="4" nolabel="1" context="{'search_default_balance_positive': 1}"/>
<field name="partner_ids" colspan="4" nolabel="1" context="{'search_default_balance_positive': 1}" domain="[('company_id','=',context.get('company_id',False))]"/>
</page>
<page string="Email Settings">
<field name="email_conf" colspan="4"/>
@ -137,7 +136,5 @@
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2010-12-09 11:41+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"PO-Revision-Date: 2011-11-23 12:19+0000\n"
"Last-Translator: Paulino Ascenção <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-05 05:22+0000\n"
"X-Generator: Launchpad (build 14231)\n"
"X-Launchpad-Export-Date: 2011-11-24 05:00+0000\n"
"X-Generator: Launchpad (build 14336)\n"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
@ -92,6 +92,20 @@ msgid ""
"\n"
" "
msgstr ""
"\n"
" Este módulo disponibiliza algumas melhorias na apresentação das faturas\n"
"\n"
" Dá a possibilidade de\n"
" * pedir todas as linhas de uma fatura\n"
" * adicionar títulos, linhas de comentário, linhas de sub-total\n"
" * desenhar linhas horizontais e colocar quebras de página\n"
"\n"
" Além do mais, existe uma opção que permite imprimir todas as facturas "
"seleccionadas com uma mensagem especial em baixo. Esta capacidade pode ser "
"muito útil para imprimir facturas com desejos feliz ano novo, condições "
"pontuais especiais, etc...\n"
"\n"
" "
#. module: account_invoice_layout
#: report:account.invoice.layout:0

View File

@ -8,19 +8,19 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2010-12-23 15:39+0000\n"
"Last-Translator: Olivier Dony (OpenERP) <Unknown>\n"
"PO-Revision-Date: 2011-11-24 20:33+0000\n"
"Last-Translator: Milan Milosevic <Unknown>\n"
"Language-Team: Serbian latin <sr@latin@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-05 05:22+0000\n"
"X-Generator: Launchpad (build 14231)\n"
"X-Launchpad-Export-Date: 2011-11-25 05:22+0000\n"
"X-Generator: Launchpad (build 14376)\n"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
msgid "Sub Total"
msgstr "Subtotal"
msgstr "Podtotal"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
@ -32,7 +32,7 @@ msgstr "Napomena:"
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Cancelled Invoice"
msgstr "Otkazane Fakture"
msgstr "Otkazana faktura"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
@ -44,7 +44,7 @@ msgstr "Naslov"
#: model:ir.actions.act_window,name:account_invoice_layout.action_account_invoice_special_msg
#: model:ir.actions.report.xml,name:account_invoice_layout.account_invoices_layout_message
msgid "Invoices with Layout and Message"
msgstr "Formatirana Faktura sa Porukom"
msgstr "Formatirana faktura sa porukom"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
@ -60,19 +60,19 @@ msgstr "Napomena"
#. module: account_invoice_layout
#: model:ir.model,name:account_invoice_layout.model_notify_message
msgid "Notify By Messages"
msgstr "Napomena po porukama"
msgstr "Obaveštenje putem poruke"
#. module: account_invoice_layout
#: help:notify.message,msg:0
msgid ""
"This notification will appear at the bottom of the Invoices when printed."
msgstr "Ova napomena ce se pojaviti na dnu fakture pri stampi"
msgstr "Ova napomena će se pojaviti na dnu faktura kad se odštampa"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Unit Price"
msgstr "Jedinična cijena"
msgstr "Pojedinačna cena"
#. module: account_invoice_layout
#: model:ir.module.module,description:account_invoice_layout.module_meta_information
@ -93,6 +93,20 @@ msgid ""
"\n"
" "
msgstr ""
"\n"
" Ovaj modul dodaje funkcije za poboljšanje prikaza faktura.\n"
"\n"
" Daje Vam mogućnost da\n"
" *poređate sve linije jedne fakture\n"
" *dodajete naslove, linije komentara, linije podtotala\n"
" *dodajete vodoravne linije i odvajate stranice\n"
"\n"
" Povrh toga, postoji opcija koja Vam omogućava štampu svih faktura sa "
"datom specijalnom porukom\n"
"na dnu. Ova funkcija je veoma korisna za štampu faktura sa čestitkama za "
"Novu godinu, specijalnim uslovima...\n"
"\n"
" "
#. module: account_invoice_layout
#: report:account.invoice.layout:0
@ -115,7 +129,7 @@ msgstr "Predračun"
#. module: account_invoice_layout
#: field:account.invoice,abstract_line_ids:0
msgid "Invoice Lines"
msgstr "Stavke računa"
msgstr "Linije računa"
#. module: account_invoice_layout
#: view:account.invoice.line:0
@ -125,7 +139,7 @@ msgstr "Sekv."
#. module: account_invoice_layout
#: model:ir.ui.menu,name:account_invoice_layout.menu_finan_config_notify_message
msgid "Notification Message"
msgstr "Poruka Napomene"
msgstr "Poruka obaveštenja"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
@ -136,12 +150,12 @@ msgstr "Proizvod"
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Description"
msgstr ""
msgstr "Opis"
#. module: account_invoice_layout
#: help:account.invoice.line,sequence:0
msgid "Gives the sequence order when displaying a list of invoice lines."
msgstr "poredja sekvence pri prikazu liste faktura."
msgstr "Daje redosled sekvenci pri prikazu spiska linija fakture"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
@ -153,7 +167,7 @@ msgstr "Cena"
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Invoice Date"
msgstr "Datum Fakture"
msgstr "Datum fakture"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
@ -163,12 +177,12 @@ msgstr "Porezi:"
#. module: account_invoice_layout
#: field:account.invoice.line,functional_field:0
msgid "Source Account"
msgstr "Изворни налог"
msgstr "Izvorni nalog"
#. module: account_invoice_layout
#: model:ir.actions.act_window,name:account_invoice_layout.notify_mesage_tree_form
msgid "Write Messages"
msgstr "Napisi Poruke"
msgstr "Napiši poruke"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
@ -179,18 +193,18 @@ msgstr "Osnova"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
msgid "Page Break"
msgstr "Прелом стране"
msgstr "Kraj stranice"
#. module: account_invoice_layout
#: view:notify.message:0
#: field:notify.message,msg:0
msgid "Special Message"
msgstr "Specijalna Poruka"
msgstr "Specijalna poruka"
#. module: account_invoice_layout
#: help:account.invoice.special.msg,message:0
msgid "Message to Print at the bottom of report"
msgstr "Poruka koja se stampa pri dnu izvestaja"
msgstr "Poruka za štampu pri dnu izveštaja"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
@ -202,7 +216,7 @@ msgstr "Količina"
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Refund"
msgstr "Refundiraj"
msgstr "Refundiranje"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
@ -228,7 +242,7 @@ msgstr "Poruke"
#. module: account_invoice_layout
#: model:ir.actions.report.xml,name:account_invoice_layout.account_invoices_1
msgid "Invoices with Layout"
msgstr "Formatirana Faktura"
msgstr "Formatirane Fakture"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
@ -240,33 +254,33 @@ msgstr "Opis / Porezi"
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Amount"
msgstr "Iznos"
msgstr "Količina"
#. module: account_invoice_layout
#: model:notify.message,msg:account_invoice_layout.demo_message1
msgid "ERP & CRM Solutions..."
msgstr ""
msgstr "ERP & CRM Rešenja..."
#. module: account_invoice_layout
#: report:notify_account.invoice:0
msgid "Net Total :"
msgstr ""
msgstr "Ukupno neto :"
#. module: account_invoice_layout
#: report:notify_account.invoice:0
msgid "Total :"
msgstr ""
msgstr "Ukupno :"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Draft Invoice"
msgstr "Neodobreni računi"
msgstr "Fakture u pripremi"
#. module: account_invoice_layout
#: field:account.invoice.line,sequence:0
msgid "Sequence Number"
msgstr "Broj Sekvence"
msgstr "Broj sekvence"
#. module: account_invoice_layout
#: model:ir.model,name:account_invoice_layout.model_account_invoice_special_msg
@ -277,7 +291,7 @@ msgstr "Specijalna poruka naloga fakture"
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Origin"
msgstr ""
msgstr "Poreklo"
#. module: account_invoice_layout
#: field:account.invoice.line,state:0
@ -293,18 +307,18 @@ msgstr "Linija za odvajanje"
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Your Reference"
msgstr ""
msgstr "Vaš poziv na broj"
#. module: account_invoice_layout
#: model:ir.module.module,shortdesc:account_invoice_layout.module_meta_information
msgid "Invoices Layout Improvement"
msgstr "Unapredjenje izgleda fakture"
msgstr "Unapređenje izgleda fakture"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Supplier Invoice"
msgstr "Račun dobavljača"
msgstr "Faktura dobavljača"
#. module: account_invoice_layout
#: view:account.invoice.special.msg:0
@ -320,7 +334,7 @@ msgstr "Porez"
#. module: account_invoice_layout
#: model:ir.model,name:account_invoice_layout.model_account_invoice_line
msgid "Invoice Line"
msgstr "Redak računa"
msgstr "Red fakture"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
@ -330,14 +344,14 @@ msgstr "Neto Ukupno"
#. module: account_invoice_layout
#: view:notify.message:0
msgid "Write a notification or a wishful message."
msgstr "Napisi napomenu ili celu poruku"
msgstr "Napiši obaveštenje ili neku lepu želju"
#. module: account_invoice_layout
#: report:account.invoice.layout:0
#: model:ir.model,name:account_invoice_layout.model_account_invoice
#: report:notify_account.invoice:0
msgid "Invoice"
msgstr "Račun"
msgstr "Faktura"
#. module: account_invoice_layout
#: view:account.invoice.special.msg:0
@ -348,7 +362,7 @@ msgstr "Otkaži"
#: report:account.invoice.layout:0
#: report:notify_account.invoice:0
msgid "Supplier Refund"
msgstr "Povrat Dobavljaču"
msgstr "Povraćaj dobavljača"
#. module: account_invoice_layout
#: field:account.invoice.special.msg,message:0
@ -358,12 +372,12 @@ msgstr "Poruka"
#. module: account_invoice_layout
#: report:notify_account.invoice:0
msgid "Taxes :"
msgstr ""
msgstr "Porezi :"
#. module: account_invoice_layout
#: model:ir.ui.menu,name:account_invoice_layout.menu_notify_mesage_tree_form
msgid "All Notification Messages"
msgstr "Sve Napomene"
msgstr "Sve poruke obaveštenja"
#~ msgid ""
#~ "The Object name must start with x_ and not contain any special character !"

View File

@ -32,7 +32,6 @@
<record model="ir.values" id="account_invoice_special_msg_values">
<field name="model_id" ref="account.model_account_invoice" />
<field name="object" eval="1" />
<field name="name">Account Invioce Special Message</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_invoice_special_msg'))" />

View File

@ -376,7 +376,7 @@ class payment_line(osv.osv):
data = {}
move_line_obj = self.pool.get('account.move.line')
data['amount_currency'] = data['communication'] = data['partner_id'] = data['reference'] = data['date_created'] = data['bank_id'] = data['amount'] = False
data['amount_currency'] = data['communication'] = data['partner_id'] = data['bank_id'] = data['amount'] = False
if move_line_id:
line = move_line_obj.browse(cr, uid, move_line_id, context=context)
@ -398,8 +398,6 @@ class payment_line(osv.osv):
temp_dict = self.onchange_partner(cr, uid, ids, line.partner_id.id, payment_type)
data.update(temp_dict['value'])
data['reference'] = line.ref
data['date_created'] = line.date_created
data['communication'] = line.ref
if date_prefered == 'now':

View File

@ -251,7 +251,7 @@
<separator colspan="4" string="Transaction Information"/>
<field name="date"/>
<group colspan="2">
<field name="amount_currency" on_change="onchange_amount(amount_currency,currency,comapny_currency)"/>
<field name="amount_currency" on_change="onchange_amount(amount_currency,currency,company_currency)"/>
<field name="currency" nolabel="1"/>
</group>
<field name="partner_id" on_change="onchange_partner(partner_id, False)" select="1"/>
@ -322,7 +322,5 @@
</field>
</record>
<act_window domain="[('move_line_id.move_id.id', '=', move_id)]" id="act_account_invoice_2_payment_line" name="Payment Lines" res_model="payment.line" src_model="account.invoice"/>
</data>
</openerp>

View File

@ -0,0 +1,233 @@
# Serbian Latin translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-11-24 21:01+0000\n"
"Last-Translator: Milan Milosevic <Unknown>\n"
"Language-Team: Serbian Latin <sr@latin@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-25 05:22+0000\n"
"X-Generator: Launchpad (build 14376)\n"
#. module: account_sequence
#: view:account.sequence.installer:0
#: model:ir.actions.act_window,name:account_sequence.action_account_seq_installer
msgid "Account Sequence Application Configuration"
msgstr "Podešavanje aplikacije nizova naloga"
#. module: account_sequence
#: constraint:account.move:0
msgid ""
"You cannot create entries on different periods/journals in the same move"
msgstr ""
"Ne možete napraviti ulaze za različite periode/dnevnike u jednom potezu"
#. module: account_sequence
#: help:account.move,internal_sequence_number:0
#: help:account.move.line,internal_sequence_number:0
msgid "Internal Sequence Number"
msgstr "Broj unutrašnjeg niza"
#. module: account_sequence
#: help:account.sequence.installer,number_next:0
msgid "Next number of this sequence"
msgstr "Sledeći broj ovog niza"
#. module: account_sequence
#: field:account.sequence.installer,number_next:0
msgid "Next Number"
msgstr "Sledeći broj"
#. module: account_sequence
#: field:account.sequence.installer,number_increment:0
msgid "Increment Number"
msgstr "Inkrementalni broj"
#. module: account_sequence
#: model:ir.module.module,description:account_sequence.module_meta_information
msgid ""
"\n"
" This module maintains internal sequence number for accounting entries.\n"
" "
msgstr ""
"\n"
" Ovaj modul održava unutrašnji niz brojeva za odgovarajuće naloge.\n"
" "
#. module: account_sequence
#: model:ir.module.module,shortdesc:account_sequence.module_meta_information
msgid "Entries Sequence Numbering"
msgstr "Dodeljivanje brojeva nizovima ulaza"
#. module: account_sequence
#: help:account.sequence.installer,number_increment:0
msgid "The next number of the sequence will be incremented by this number"
msgstr "Sledeći broj ovog niza biće povećan ovim brojem"
#. module: account_sequence
#: view:account.sequence.installer:0
msgid "Configure Your Account Sequence Application"
msgstr "Podesi svoju aplikaciju za niz brojeva"
#. module: account_sequence
#: field:account.sequence.installer,progress:0
msgid "Configuration Progress"
msgstr "Napredak podešavanja"
#. module: account_sequence
#: help:account.sequence.installer,suffix:0
msgid "Suffix value of the record for the sequence"
msgstr "Sufiksalna vrednost zapisa za niz"
#. module: account_sequence
#: field:account.sequence.installer,company_id:0
msgid "Company"
msgstr "Preduzeće"
#. module: account_sequence
#: help:account.journal,internal_sequence_id:0
msgid ""
"This sequence will be used to maintain the internal number for the journal "
"entries related to this journal."
msgstr ""
"Ovaj niz će biti iskorišćen za održavanje unutrašnjeg broja za ulaze "
"dnevnika vezane za dnevnik."
#. module: account_sequence
#: field:account.sequence.installer,padding:0
msgid "Number padding"
msgstr "Ispunjavanje brojeva"
#. module: account_sequence
#: model:ir.model,name:account_sequence.model_account_move_line
msgid "Journal Items"
msgstr "Stavke dnevnika"
#. module: account_sequence
#: field:account.move,internal_sequence_number:0
#: field:account.move.line,internal_sequence_number:0
msgid "Internal Number"
msgstr "Unutrašnji broj"
#. module: account_sequence
#: constraint:account.move.line:0
msgid "Company must be same for its related account and period."
msgstr "Preduzeće mora biti isto za sve vezane račune i periode."
#. module: account_sequence
#: help:account.sequence.installer,padding:0
msgid ""
"OpenERP will automatically adds some '0' on the left of the 'Next Number' to "
"get the required padding size."
msgstr ""
"OpenERP će automatski dodati nekoliko '0' levo od 'Sledećeg broja' za "
"dobijanje tražene veličine ispunjavanja."
#. module: account_sequence
#: field:account.sequence.installer,name:0
msgid "Name"
msgstr "Naziv"
#. module: account_sequence
#: constraint:account.move.line:0
msgid "You can not create move line on closed account."
msgstr "Ne možete da napravite poteznu liniju na zatvorenim računima."
#. module: account_sequence
#: constraint:account.move:0
msgid ""
"You cannot create more than one move per period on centralized journal"
msgstr ""
"Ne možete napraviti više od jednog pomeranja po periodu u centralizovanom "
"dnevniku"
#. module: account_sequence
#: sql_constraint:account.move.line:0
msgid "Wrong credit or debit value in accounting entry !"
msgstr "Pogrešna vrednost kredita ili debita u ulazu računa !"
#. module: account_sequence
#: field:account.journal,internal_sequence_id:0
msgid "Internal Sequence"
msgstr "Unutrašnji niz"
#. module: account_sequence
#: model:ir.model,name:account_sequence.model_account_sequence_installer
msgid "account.sequence.installer"
msgstr "account.sequence.installer"
#. module: account_sequence
#: view:account.sequence.installer:0
msgid "Configure"
msgstr "Podešavanje"
#. module: account_sequence
#: help:account.sequence.installer,prefix:0
msgid "Prefix value of the record for the sequence"
msgstr "Prefiksalna vrednost zapisa za niz"
#. module: account_sequence
#: model:ir.model,name:account_sequence.model_account_move
msgid "Account Entry"
msgstr "Ulaz naloga"
#. module: account_sequence
#: field:account.sequence.installer,suffix:0
msgid "Suffix"
msgstr "Sufiks"
#. module: account_sequence
#: field:account.sequence.installer,config_logo:0
msgid "Image"
msgstr "Slika"
#. module: account_sequence
#: view:account.sequence.installer:0
msgid "title"
msgstr "naslov"
#. module: account_sequence
#: sql_constraint:account.journal:0
msgid "The name of the journal must be unique per company !"
msgstr "Naziv dnevnika mora biti jedinstven po preduzeću"
#. module: account_sequence
#: field:account.sequence.installer,prefix:0
msgid "Prefix"
msgstr "Prefiks"
#. module: account_sequence
#: sql_constraint:account.journal:0
msgid "The code of the journal must be unique per company !"
msgstr "Kod dnevnika mora biti jedinstven po preduzeću !"
#. module: account_sequence
#: constraint:account.move.line:0
msgid ""
"You can not create move line on receivable/payable account without partner"
msgstr ""
"Ne možete napraviti poteznu liniju na primaćem/platežnom računu bez partnera"
#. module: account_sequence
#: model:ir.model,name:account_sequence.model_account_journal
msgid "Journal"
msgstr "Dnevnik"
#. module: account_sequence
#: view:account.sequence.installer:0
msgid "You can enhance the Account Sequence Application by installing ."
msgstr ""
"Ne možete poboljšati Aplikaciju za nizanje naloga instaliranjem iste."
#. module: account_sequence
#: constraint:account.move.line:0
msgid "You can not create move line on view account."
msgstr "Ne možete napraviti poteznu liniju na računu po viđenju"

View File

@ -235,7 +235,7 @@ class account_voucher(osv.osv):
('pay_now','Pay Directly'),
('pay_later','Pay Later or Group Funds'),
],'Payment', select=True, readonly=True, states={'draft':[('readonly',False)]}),
'tax_id':fields.many2one('account.tax', 'Tax', readonly=True, states={'draft':[('readonly',False)]}),
'tax_id': fields.many2one('account.tax', 'Tax', readonly=True, states={'draft':[('readonly',False)]}, domain=[('price_include','=', False)], help="Only for tax excluded from price"),
'pre_line':fields.boolean('Previous Payments ?', required=False),
'date_due': fields.date('Due Date', readonly=True, select=True, states={'draft':[('readonly',False)]}),
'payment_option':fields.selection([
@ -518,7 +518,7 @@ class account_voucher(osv.osv):
elif currency_id == company_currency:
#otherwise treatments is the same but with other field names
if line.amount_residual == price:
#if the amount residual is equal the amount voucher, we assign it to that voucher
#if the amount residual is equal the amount voucher, we assign it to that voucher
#line, whatever the other voucher lines
move_line_found = line.id
break
@ -696,8 +696,8 @@ class account_voucher(osv.osv):
Select the context to use accordingly if it needs to be multicurrency or not.
:param voucher_id: Id of the actual voucher
:return: The returned context will be the same as given in parameter if the voucher currency is the same
than the company currency, otherwise it's a copy of the parameter with an extra key 'date' containing
:return: The returned context will be the same as given in parameter if the voucher currency is the same
than the company currency, otherwise it's a copy of the parameter with an extra key 'date' containing
the date of the voucher.
:rtype: dict
"""
@ -726,7 +726,7 @@ class account_voucher(osv.osv):
voucher_brw = self.pool.get('account.voucher').browse(cr,uid,voucher_id,context)
debit = credit = 0.0
# TODO: is there any other alternative then the voucher type ??
# ANSWER: We can have payment and receipt "In Advance".
# ANSWER: We can have payment and receipt "In Advance".
# TODO: Make this logic available.
# -for sale, purchase we have but for the payment and receipt we do not have as based on the bank/cash journal we can not know its payment or receipt
if voucher_brw.type in ('purchase', 'payment'):
@ -769,7 +769,7 @@ class account_voucher(osv.osv):
elif voucher_brw.journal_id.sequence_id:
name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id)
else:
raise osv.except_osv(_('Error !'),
raise osv.except_osv(_('Error !'),
_('Please define a sequence on the journal !'))
if not voucher_brw.reference:
ref = name.replace('/','')
@ -834,7 +834,7 @@ class account_voucher(osv.osv):
def voucher_move_line_create(self, cr, uid, voucher_id, line_total, move_id, company_currency, current_currency, context=None):
'''
Create one account move line, on the given account move, per voucher line where amount is not 0.0.
It returns Tuple with tot_line what is total of difference between debit and credit and
It returns Tuple with tot_line what is total of difference between debit and credit and
a list of lists with ids to be reconciled with this format (total_deb_cred,list_of_lists).
:param voucher_id: Voucher id what we are working with
@ -905,7 +905,7 @@ class account_voucher(osv.osv):
voucher_line = move_line_obj.create(cr, uid, move_line)
rec_ids = [voucher_line, line.move_line_id.id]
if amount_residual:
if amount_residual:
# Change difference entry
exch_lines = self._get_exchange_lines(cr, uid, line, move_id, amount_residual, company_currency, current_currency, context=context)
new_id = move_line_obj.create(cr, uid, exch_lines[0],context)

View File

@ -48,7 +48,7 @@
-
Now I create a Vendor Voucher
-
!record {model: account.voucher, id: account_voucher_voucheraxelor0}:
!record {model: account.voucher, id: account_voucher_voucheraxelor0, view: False}:
account_id: account.cash
amount: 1000.0
company_id: base.main_company

View File

@ -4,7 +4,6 @@
!record {model: account.voucher, id: account_voucher_voucheraxelor0}:
account_id: account.cash
company_id: base.main_company
currency_id: base.EUR
journal_id: account.bank_journal
name: Voucher Axelor
narration: Basic PC

View File

@ -34,6 +34,16 @@
name: !eval "'%s-04-01' %(datetime.now().year)"
rate: 1.052632
-
I create a cash account with currency USD
-
!record {model: account.account, id: account_cash_usd_id}:
currency_id: base.USD
name: "cash account in usd"
code: "Xcash usd"
type: 'liquidity'
user_type: "account.account_type_cash_moves"
-
I create a bank journal with USD as currency
-
@ -43,24 +53,12 @@
type: bank
analytic_journal_id: account.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
currency: base.USD
company_id: base.main_company
view_id: account.account_journal_bank_view
-
I create new partner Mark Strauss.
-
!record {model: res.partner, id: res_partner_strauss0}:
address:
- city: paris
country_id: base.fr
name: Mark Strauss
street: 1 rue Rockfeller
type: invoice
zip: '75016'
name: Mr. Mark Strauss
-
I create the first invoice on 1st January for 200 USD
-
@ -80,7 +78,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_strauss0
partner_id: base.res_partner_seagate
reference_type: none
-
I Validate invoice by clicking on Validate button
@ -115,7 +113,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_strauss0
partner_id: base.res_partner_seagate
reference_type: none
-
I Validate invoice by clicking on Validate button
@ -139,21 +137,21 @@
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_strauss0"), ref('bank_journal_USD'), 240.00, 2, ttype='receipt', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_USD'), 240.00, 2, ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 240.00,
'company_id': ref('base.main_company'),
'currency_id': ref('base.USD'),
'journal_id': ref('bank_journal_USD'),
'partner_id': ref('res_partner_strauss0'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'receipt',
'date': time.strftime("%Y-%m-%d"),
'payment_option': 'with_writeoff',
'writeoff_acc_id': ref('account.a_expense'),
'comment': 'Write Off',
'name': 'First payment',
'name': 'First payment: Case 1 USD/USD',
}
vals.update(self.onchange_date(cr, uid, [], time.strftime('%Y-03-01'), ref('base.USD'), 240)['value'])
if not res['value']['line_cr_ids']:
@ -171,7 +169,7 @@
I check that writeoff amount computed is 10.0
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.writeoff_amount == 10.0), "Writeoff amount is not 10.0"
-
@ -179,14 +177,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that the move of my first voucher is valid
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -200,7 +198,7 @@
I check that my write-off is correct. 9 debit and 10 amount_currency
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -237,7 +235,7 @@
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_strauss0"), ref('bank_journal_USD'), 45.00, 2, ttype='receipt', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_USD'), 45.00, 2, ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 45.00,
@ -245,14 +243,14 @@
'company_id': ref('base.main_company'),
'currency_id': ref('base.USD'),
'journal_id': ref('bank_journal_USD'),
'partner_id': ref('res_partner_strauss0'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'receipt',
'date': time.strftime("%Y-%m-%d"),
'payment_option': 'with_writeoff',
'writeoff_acc_id': ref('account.a_expense'),
'comment': 'Write Off',
'name': 'Second payment',
'name': 'Second payment: Case 1',
}
vals.update(self.onchange_date(cr, uid, [], time.strftime('%Y-04-01'), ref('base.USD'), 45.0)['value'])
if not res['value']['line_cr_ids']:
@ -270,7 +268,7 @@
I check that writeoff amount computed is 5.0
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 1'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.writeoff_amount == 5.0), "Writeoff amount is not 5.0"
-
@ -278,14 +276,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 1'), ('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that the move of my second voucher is valid
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 1'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -303,7 +301,7 @@
I check that my writeoff is correct. 4.75 debit and 5 amount_currency
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 1'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])

View File

@ -29,18 +29,6 @@
currency: base.USD
company_id: base.main_company
view_id: account.account_journal_bank_view
-
I create a new partner Robert Clements
-
!record {model: res.partner, id: res_partner_clements0}:
address:
- city: marseille
country_id: base.fr
name: Robert
street: 1 rue Rockfeller
type: invoice
zip: '13016'
name: Mr.Robert Clements
-
I create the first invoice on 1st January for 200 USD
-
@ -61,7 +49,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_clements0
partner_id: base.res_partner_seagate
reference_type: none
check_total : 200
-
@ -98,7 +86,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_clements0
partner_id: base.res_partner_seagate
reference_type: none
check_total : 100.0
-
@ -122,21 +110,21 @@
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_clements0"), ref('bank_journal_EUR'), 240.0, 2, ttype='payment', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_EUR'), 240.0, 2, ttype='payment', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 240.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.EUR'),
'journal_id': ref('bank_journal_EUR'),
'partner_id': ref('res_partner_clements0'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'payment',
'date': time.strftime("%Y-03-01"),
'payment_option': 'with_writeoff',
'writeoff_acc_id': ref('account.a_expense'),
'comment': 'Write Off',
'name': 'First payment',
'name': 'First payment: Case 2 SUPPL USD/EUR',
}
if not res['value']['line_dr_ids']:
res['value']['line_dr_ids'] = [{'type': 'dr', 'account_id': ref('account.a_pay'),}]
@ -153,14 +141,14 @@
I check that writeoff amount computed is -15.0
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.writeoff_amount == -15.0), "Writeoff amount is not -15.0"
-
I check that currency rate difference is 34.0
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.currency_rate_difference == 34.0), "Currency rate difference is not 34.0"
-
@ -168,14 +156,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that the move of my voucher is valid
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -191,7 +179,7 @@
I check that my writeoff is correct. -15 in credit with no amount_currency
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -229,21 +217,21 @@
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_clements0"), ref('bank_journal_EUR'), 45.0, 2, ttype='payment', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_EUR'), 45.0, 2, ttype='payment', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 45.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.USD'),
'journal_id': ref('bank_journal_USD'),
'partner_id': ref('res_partner_clements0'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'payment',
'date': time.strftime("%Y-%m-%d"),
'payment_option': 'with_writeoff',
'writeoff_acc_id': ref('account.a_expense'),
'comment': 'Write Off',
'name': 'Second payment',
'name': 'Second payment: Case 2 SUPPL USD/EUR',
}
vals.update(self.onchange_date(cr, uid, [], time.strftime('%Y-04-01'), ref('base.USD'), 45.0)['value'])
if not res['value']['line_dr_ids']:
@ -261,14 +249,14 @@
I check that writeoff amount computed is -5.0
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.writeoff_amount == 5.0), "Writeoff amount is not 5.0"
-
I check that currency rate difference is 8.50
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.currency_rate_difference == 8.50), "Currency rate difference is not 8.50"
-
@ -276,14 +264,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that my voucher state is posted
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert voucher_id.state == 'posted', "Voucher state is not posted"
-
@ -296,7 +284,7 @@
I check that my writeoff is correct. 4.75 in credit and 5 in amount_currency
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])

View File

@ -49,7 +49,6 @@
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
currency: base.EUR
company_id: base.main_company
view_id: account.account_journal_bank_view
-
@ -61,23 +60,11 @@
type: bank
analytic_journal_id: account.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
currency: base.USD
company_id: base.main_company
view_id: account.account_journal_bank_view
-
I create a new partner Michael Geller
-
!record {model: res.partner, id: res_partner_michael0}:
address:
- city: paris
country_id: base.fr
name: Michael
street: 1 rue Rockfeller
type: invoice
zip: '75016'
name: Mr.Michael Geller
-
I create the first invoice on 1st January for 200 USD
-
@ -97,7 +84,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_michael0
partner_id: base.res_partner_seagate
reference_type: none
-
I Validate invoice by clicking on Validate button
@ -132,7 +119,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_michael0
partner_id: base.res_partner_seagate
reference_type: none
-
I Validate invoice by clicking on Validate button
@ -150,26 +137,26 @@
assert (move_line.debit - move_line.credit == 80), "Invoice move is incorrect for debtors account"
-
I create the first voucher of payment
<create with values 200 EUR (€), journal EUR, and fills amount 130€ for the invoice of 200$ and 70€ for the invoice of 100$>
<create with values 200 EUR, journal EUR, and fills amount 130 EUR for the invoice of 200 USD and 70 EUR for the invoice of 100 USD>
-
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_michael0"), ref('bank_journal_EUR'), 240.0, False, ttype='receipt', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_EUR'), 240.0, False, ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 200.0,
'company_id': ref('base.main_company'),
'currency_id': False,
'journal_id': ref('bank_journal_EUR'),
'partner_id': ref('res_partner_michael0'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'receipt',
'date': time.strftime("%Y-03-01"),
'payment_option': 'with_writeoff',
'writeoff_acc_id': ref('account.a_expense'),
'comment': 'Write Off',
'name': 'First payment',
'name': 'First payment: Case 2 USD/EUR DR EUR',
}
if not res['value']['line_cr_ids']:
res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
@ -187,14 +174,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that the move of my voucher is valid
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -206,7 +193,7 @@
I check that the debtor account has 2 new lines with 0 in amount_currency columns and their credit columns are 130 and 70
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -220,7 +207,6 @@
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
move_line = move_line_obj.browse(cr, uid, move_lines[0])
print move_line.amount_residual, move_line.amount_residual_currency
assert (move_line.amount_residual_currency == 55.56 and move_line.amount_residual == 20) , "Residual amount is not correct for first Invoice"
-
I check the residual amuont of Invoice2, should be 22.22 in residual currency and 10 in amount_residual
@ -238,14 +224,14 @@
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_michael0"), ref('bank_journal_USD'), 80.0, 2, ttype='receipt', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_USD'), 80.0, 2, ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 80.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.USD'),
'journal_id': ref('bank_journal_USD'),
'partner_id': ref('res_partner_michael0'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'receipt',
'date': time.strftime("%Y-%m-%d"),
@ -253,7 +239,7 @@
'writeoff_acc_id': ref('account.a_expense'),
'exchange_acc_id': ref('account.o_expense'),
'comment': 'Write Off',
'name': 'Second payment',
'name': 'Second payment: Case 2 SUPPL USD/EUR DR EUR',
}
vals.update(self.onchange_date(cr, uid, [], time.strftime('%Y-04-01'), ref('base.USD'), 80.0)['value'])
if not res['value']['line_cr_ids']:
@ -271,7 +257,7 @@
I check that writeoff amount computed is 2.22
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (round(voucher_id.writeoff_amount, 2) == 2.22), "Writeoff amount is not 2.22$"
-
@ -279,14 +265,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that my voucher state is posted
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert voucher_id.state == 'posted', "Voucher state is not posted"
-
@ -299,7 +285,7 @@
I check that my writeoff is correct. 2.11 in credit and 2.22 in amount_currency
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])

View File

@ -49,7 +49,6 @@
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
currency: base.EUR
company_id: base.main_company
view_id: account.account_journal_bank_view
-
@ -61,23 +60,11 @@
type: bank
analytic_journal_id: account.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
currency: base.USD
company_id: base.main_company
view_id: account.account_journal_bank_view
-
I create a new partner Michal Gallette
-
!record {model: res.partner, id: res_partner_michal1}:
address:
- city: paris
country_id: base.fr
name: Michal
street: 1 rue Rockfeller
type: invoice
zip: '75016'
name: Mr.Michal Gallette
-
I create the first invoice on 1st January for 200 USD
-
@ -97,7 +84,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_michal1
partner_id: base.res_partner_seagate
reference_type: none
-
I Validate invoice by clicking on Validate button
@ -132,7 +119,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_michal1
partner_id: base.res_partner_seagate
reference_type: none
-
I Validate invoice by clicking on Validate button
@ -155,21 +142,21 @@
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_michal1"), ref('bank_journal_EUR'), 200.0, False, ttype='receipt', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_EUR'), 200.0, False, ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 200.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.EUR'),
'journal_id': ref('bank_journal_EUR'),
'partner_id': ref('res_partner_michal1'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'receipt',
'date': time.strftime("%Y-03-01"),
'payment_option': 'with_writeoff',
'writeoff_acc_id': ref('account.a_expense'),
'comment': 'Write Off',
'name': 'First payment',
'name': 'First payment: Case 2 USD/EUR DR USD',
}
if not res['value']['line_cr_ids']:
res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
@ -187,14 +174,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michal1'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that the move of my voucher is valid
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michal1'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -206,7 +193,7 @@
I check that the debtor account has 2 new lines with 144.44 and 77.78 in amount_currency columns and their credit columns are 130 and 70
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michal1'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -240,14 +227,14 @@
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_michal1"), ref('bank_journal_USD'), 80.0, ref('base.USD'), ttype='receipt', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_USD'), 80.0, ref('base.USD'), ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 80.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.USD'),
'journal_id': ref('bank_journal_USD'),
'partner_id': ref('res_partner_michal1'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'receipt',
'date': time.strftime("%Y-%m-%d"),
@ -255,7 +242,7 @@
'writeoff_acc_id': ref('account.a_expense'),
'exchange_acc_id': ref('account.o_expense'),
'comment': 'Write Off',
'name': 'Second payment',
'name': 'Second payment: Case 2 SUPPL USD/EUR DR USD',
}
vals.update(self.onchange_date(cr, uid, [], time.strftime('%Y-04-01'), ref('base.USD'), 80.0)['value'])
if not res['value']['line_cr_ids']:
@ -273,7 +260,7 @@
I check that writeoff amount computed is 2.22
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michal1'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (round(voucher_id.writeoff_amount, 2) == 2.22), "Writeoff amount is not 2.22$"
-
@ -281,14 +268,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michal1'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that my voucher state is posted
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michal1'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert voucher_id.state == 'posted', "Voucher state is not posted"
-
@ -301,7 +288,7 @@
I check that my writeoff is correct. 2.11 in credit and 2.22 in amount_currency
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michal1'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])

View File

@ -26,21 +26,8 @@
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
currency: base.EUR
company_id: base.main_company
view_id: account.account_journal_bank_view
-
I create a new partner Peter Lawson.
-
!record {model: res.partner, id: res_partner_peter0}:
address:
- city: paris
country_id: base.fr
name: Peter
street: 1 rue Rockfeller
type: invoice
zip: '75016'
name: Mr.Peter Lawson
-
I create the first invoice on 1st January for 150 EUR
-
@ -60,7 +47,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_peter0
partner_id: base.res_partner_seagate
reference_type: none
-
I Validate invoice by clicking on Validate button
@ -95,7 +82,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_peter0
partner_id: base.res_partner_seagate
reference_type: none
-
I Validate invoice by clicking on Validate button
@ -118,21 +105,21 @@
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_peter0"), ref('bank_journal_EUR'), 120.00, False, ttype='receipt', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_EUR'), 120.00, False, ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 120.00,
'company_id': ref('base.main_company'),
'currency_id': ref('base.EUR'),
'journal_id': ref('bank_journal_EUR'),
'partner_id': ref('res_partner_peter0'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'receipt',
'date': time.strftime("%Y-03-01"),
'payment_option': 'with_writeoff',
'writeoff_acc_id': ref('account.a_expense'),
'comment': 'Write Off',
'name': 'First payment',
'name': 'First payment: Case 3',
}
if not res['value']['line_cr_ids']:
res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
@ -149,7 +136,7 @@
I check that writeoff amount computed is 0.00
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 3'),('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.writeoff_amount == 0.00), "Writeoff amount is not 0.00"
-
@ -157,14 +144,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 3'),('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that the move of my first voucher is valid
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 3'),('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -176,7 +163,7 @@
I check that the debtor account has 2 new lines with 0.00 and 0.00 in amount_currency columns and their credit are 20 and 100 respectively
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 3'),('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -210,21 +197,21 @@
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_peter0"), ref('bank_journal_EUR'), 120.00, False, ttype='receipt', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_EUR'), 120.00, False, ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 120.00,
'company_id': ref('base.main_company'),
'currency_id': ref('base.EUR'),
'journal_id': ref('bank_journal_EUR'),
'partner_id': ref('res_partner_peter0'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'receipt',
'date': time.strftime("%Y-04-01"),
'payment_option': 'with_writeoff',
'writeoff_acc_id': ref('account.a_expense'),
'comment': 'Write Off',
'name': 'Second payment',
'name': 'Second payment: Case 3',
}
if not res['value']['line_cr_ids']:
res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
@ -241,7 +228,7 @@
I check that writeoff amount computed is 0.00
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'),('partner_id', '=', ref('res_partner_peter0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 3'),('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (voucher_id.writeoff_amount == 0.00), "Writeoff amount is not 0"
-
@ -249,14 +236,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 3'), ('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that the move of my second voucher is valid
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 3'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -268,7 +255,7 @@
I check that the debtor account has 2 new lines with 0.00 and 0.00 in amount_currency columns and their credit are 70 and 50
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))])
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 3'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])

View File

@ -29,6 +29,16 @@
currency_id: base.CHF
name: !eval "'%s-03-01' %(datetime.now().year)"
rate: 1.25000
-
I create a cash account with currency CHF
-
!record {model: account.account, id: account_cash_chf_id}:
currency_id: base.CHF
name: "cash account in chf"
code: "Xcash chf"
type: 'liquidity'
user_type: "account.account_type_cash_moves"
-
I create a bank journal with CHF as currency
-
@ -38,23 +48,11 @@
type: bank
analytic_journal_id: account.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
default_debit_account_id: account_cash_chf_id
default_credit_account_id: account_cash_chf_id
currency: base.CHF
company_id: base.main_company
view_id: account.account_journal_bank_view
-
I create a new partner John Armani.
-
!record {model: res.partner, id: res_partner_john0}:
address:
- city: paris
country_id: base.fr
name: John
street: 1 rue Rockfeller
type: invoice
zip: '75016'
name: Mr.John Armani
-
I create the first invoice on 1st January for 200 CAD
-
@ -74,7 +72,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_john0
partner_id: base.res_partner_seagate
reference_type: none
-
I Validate invoice by clicking on Validate button
@ -97,14 +95,14 @@
!python {model: account.voucher}: |
import netsvc, time
vals = {}
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_john0"), ref('bank_journal_CHF'), 200.00, ref('base.CHF'), ttype='receipt', date=False)
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), ref('bank_journal_CHF'), 200.00, ref('base.CHF'), ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 200.00,
'company_id': ref('base.main_company'),
'currency_id': ref('base.CHF'),
'journal_id': ref('bank_journal_CHF'),
'partner_id': ref('res_partner_john0'),
'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_3'),
'type': 'receipt',
'date': time.strftime("%Y-%m-%d"),
@ -112,7 +110,7 @@
'writeoff_acc_id': ref('account.a_expense'),
'exchange_acc_id': ref('account.o_expense'),
'comment': 'Write Off',
'name': 'First payment',
'name': 'First payment: Case 4',
}
vals.update(self.onchange_date(cr, uid, [], time.strftime('%Y-03-01'), ref('base.CHF'), 200.0)['value'])
if not res['value']['line_cr_ids']:
@ -128,7 +126,7 @@
I check that writeoff amount computed is 13.26
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
assert (round(voucher_id.writeoff_amount,2) == 13.26), "Writeoff amount is not 13.26 CHF"
-
@ -136,14 +134,14 @@
-
!python {model: account.voucher}: |
import netsvc
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_seagate'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
I check that the move of my voucher is valid
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
@ -160,7 +158,7 @@
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'), ('partner_id', '=', ref('res_partner_john0'))])
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_seagate'))])
voucher_id = self.browse(cr, uid, voucher[0])
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])

View File

@ -93,7 +93,7 @@
<notebook colspan="4">
<page string="Payment Information">
<field name="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, context)">
<tree string="Open Supplier Journal Entries" editable="bottom">
<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}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
@ -107,7 +107,7 @@
</tree>
</field>
<field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('type', '=', 'payment')]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, context)">
<tree string="Open Customer Journal Entries" editable="bottom">
<tree string="Open Customer Journal Entries" editable="bottom" colors="gray:amount==0">
<field name="move_line_id"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
<field name="date_original"/>
@ -160,7 +160,7 @@
<notebook colspan="4">
<page string="Payment Information">
<field name="line_dr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
<tree string="Supplier Invoices and Outstanding transactions" editable="bottom">
<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}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
@ -175,7 +175,7 @@
</tree>
</field>
<field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
<tree string="Credits" editable="bottom">
<tree string="Credits" editable="bottom" colors="gray:amount==0">
<field name="move_line_id"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
<field name="date_original"/>
@ -309,7 +309,7 @@
<notebook colspan="4">
<page string="Payment Information">
<field name="line_cr_ids" default_get="{'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, context)">
<tree string="Invoices and outstanding transactions" editable="bottom">
<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)]"
@ -324,7 +324,7 @@
</tree>
</field>
<field name="line_dr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, context)">
<tree string="Credits" editable="bottom">
<tree string="Credits" editable="bottom" colors="gray:amount==0">
<field name="move_line_id"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
<field name="date_original"/>

View File

@ -168,7 +168,7 @@
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type','in',['sale','sale_refund']), ('type','=','sale')]</field>
<field name="context">{'type':'sale'}</field>
<field name="context">{'default_type': 'sale', 'type': 'sale'}</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_voucher_filter_sale"/>
<field name="target">current</field>
@ -198,7 +198,7 @@
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment'), ('partner_id','=',partner_id)]</field>
<field name="context">{'type':'payment', 'partner_id': partner_id, 'default_reference':reference}</field>
<field name="context">{'default_type':'payment', 'type':'payment', 'default_partner_id': partner_id, 'partner_id': partner_id, 'default_reference':reference}</field>
<field name="view_id" ref="view_vendor_payment_form"/>
<field name="target">current</field>
</record>
@ -287,7 +287,7 @@
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type','in',['purchase','purchase_refund']), ('type','=','purchase')]</field>
<field name="context">{'type':'purchase'}</field>
<field name="context">{'default_type': 'purchase', 'type': 'purchase'}</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" eval="view_voucher_filter_vendor"/>
<field name="target">current</field>

View File

@ -150,7 +150,7 @@ class account_analytic_account(osv.osv):
_columns = {
'name': fields.char('Account Name', size=128, required=True),
'complete_name': fields.function(_complete_name_calc, type='char', string='Full Account Name'),
'code': fields.char('Account Code', size=24, select=True),
'code': fields.char('Code/Reference', size=24, select=True),
'type': fields.selection([('view','View'), ('normal','Normal')], 'Account Type', help='If you select the View Type, it means you won\'t allow to create journal entries using that account.'),
'description': fields.text('Description'),
'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', select=2),
@ -168,7 +168,7 @@ class account_analytic_account(osv.osv):
'date_start': fields.date('Date Start'),
'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([('draft','New'),('open','Started'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Closed'),('template', 'Template')], 'State', required=True,
'state': fields.selection([('template', 'Template'),('draft','New'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Closed')], 'State', required=True,
help='* When an account is created its in \'Draft\' state.\
\n* If any associated partner is there, it can be in \'Open\' state.\
\n* If any pending balance is there it can be in \'Pending\'. \
@ -217,6 +217,12 @@ class account_analytic_account(osv.osv):
default['line_ids'] = []
return super(account_analytic_account, self).copy(cr, uid, id, default, context=context)
def on_change_partner_id(self, cr, uid, id, partner_id, context={}):
if not partner_id:
return {'value': {'contact_id': False}}
addr = self.pool.get('res.partner').address_get(cr, uid, [partner_id], ['invoice'])
return {'value': {'contact_id': addr.get('invoice', False)}}
def on_change_company(self, cr, uid, id, company_id):
if not company_id:
return {}

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