[MERGE] merged with main addons

bzr revid: jap@tinyerp.com-20111124070743-nfwrdkapzf1kitnr
This commit is contained in:
Jagdish Panchal (Open ERP) 2011-11-24 12:37:43 +05:30
commit f1a170a479
321 changed files with 13105 additions and 3244 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',
@ -145,10 +147,9 @@ module named account_voucher.
'test/account_fiscalyear_close.yml',
'test/account_bank_statement.yml',
'test/account_cash_statement.yml',
'test/test_edi_invoice.yml',
'test/account_report.yml',
],
],
'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:
@ -848,19 +861,6 @@ class account_fiscalyear(osv.osv):
}
_order = "date_start"
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):
@ -2001,8 +2000,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 +2016,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 +2185,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 +2193,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 +2249,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 +2396,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

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"/>

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
@ -1626,7 +1625,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 +1644,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 +2016,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>

View File

@ -38,17 +38,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,22 @@
# -*- 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

View File

@ -0,0 +1,273 @@
# -*- 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"

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

@ -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,7 +76,7 @@ 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
)

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

@ -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
-
!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), "'Period Sum' and 'Year sum' has not been binded with the correct values"

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

@ -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

@ -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

@ -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

@ -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

@ -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,15 @@ 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()

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

@ -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

@ -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

@ -374,7 +374,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)
@ -396,8 +396,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"/>

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

@ -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 {}

View File

@ -7,26 +7,20 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Auction manager ">
<hpaned position="100">
<child1>
<action
string="Latest objects"
name="%(auction.action_report_latest_objects_manager_tree)d"
height="200"
width="510" />
<board style="2-1">
<column>
<action string="Latest objects"
name="%(auction.action_report_latest_objects_manager_tree)d"/>
<action string="Latest deposits"
name="%(auction.action_report_latest_doposit_manager_tree)d"/>
<action
string="Summary pointing by user"
<action string="Summary pointing by user"
name="%(auction.action_report_auction_sign_in_out_manager_tree1)d"
view_mode="tree,graph"
/>
view_mode="tree,graph"/>
<action string="Objects statistics"
name="%(auction.action_report_object_encoded_manager_tree)d"
/>
</child1>
name="%(auction.action_report_object_encoded_manager_tree)d"/>
</column>
<child2>
<column>
<button
string="My board"
name="%(open_board_auction)d"
@ -34,22 +28,18 @@
type="action"
colspan="4"
/>
<action
string="Total Adjudications"
<action string="Total Adjudications"
name="%(auction.action_report_auction_adjudication_tree)d"
view_mode="graph,tree"
colspan="4"/>
<action
string="Min/Adj/Max"
view_mode="graph,tree"/>
<action string="Min/Adj/Max"
name="%(auction.action_report_auction_estimation_adj_category_manager_tree)d"
view_mode="graph,tree" colspan="4" />
view_mode="graph,tree"/>
<action
string="Objects by day"
<action string="Objects by day"
name="%(auction.action_report_auction_object_date_tree)d"
view_mode="graph,tree" colspan="4" />
</child2>
</hpaned>
view_mode="graph,tree"/>
</column>
</board>
</form>
</field>
</record>

View File

@ -58,36 +58,28 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Auction manager ">
<hpaned position="100">
<child1>
<action
string="Latest objects"
name="%(auction.action_report_latest_objects_tree)d"
height="200"
width="510" />
<board style="2-1">
<column>
<action string="Latest objects"
name="%(auction.action_report_latest_objects_tree)d"/>
<action string="Latest deposits"
name="%(auction.action_report_latest_doposit_tree)d"/>
<action string="Objects statistics"
name="%(auction.action_report_object_encoded_tree)d"
/>
</child1>
name="%(auction.action_report_object_encoded_tree)d"/>
</column>
<child2>
<action
string="Total Adjudications"
<column>
<action string="Total Adjudications"
name="%(auction.action_report_auction_adjudication_tree)d"
view_mode="graph,tree"
colspan="4"/>
<action
string="Min/Adj/Max"
view_mode="graph,tree"/>
<action string="Min/Adj/Max"
name="%(auction.action_report_auction_lots_estimation_adj_category_tree)d"
view_mode="graph,tree" colspan="4" />
<action
string="Objects by day"
view_mode="graph,tree"/>
<action string="Objects by day"
name="%(auction.action_report_auction_object_date_tree)d"
view_mode="graph,tree" colspan="4" />
</child2>
</hpaned>
view_mode="graph,tree"/>
</column>
</board>
</form>
</field>
</record>

View File

@ -27,7 +27,7 @@ def convert(from_file, to_file):
__convert(from_file, to_file, size=95)
def __convert(from_file, to_file, size=95):
import Image, ImageDraw, ImageFilter
from PIL import Image, ImageDraw, ImageFilter
im = Image.open(from_file)
if float(im.size[1]/im.size[0])>2:
im = im.resize((im.size[0]*size/im.size[1], size))

View File

@ -34,21 +34,8 @@
-
!record {model: account.journal, id: account.sales_journal}:
analytic_journal_id: account.cose_journal_sale
-
I'm creating new Seller "Mr. Pinakin" with him email "info@mycustomer.com".
-
!record {model: res.partner, id: res_partner_mrpinakin0}:
address:
- city: Namur
country_id: base.be
phone: (+32).10.45.18.77
street: 23, street ways
type: default
zip: '2324324'
email: 'info@mycustomer.com'
name: Mr. Pinakin
-
-
I'm creating new Buyer "Mr. Patel" with his email "info@myinfobid.com".
-
!record {model: res.partner, id: res_partner_mrpatel0}:
@ -61,21 +48,7 @@
email: 'info@myinfobid.com'
name: Mr. Patel
-
I'm creating new Buyer "Mr. Johnson" with his email "info@mrkjohnson.com".
-
!record {model: res.partner, id: res_partner_mrkjohnson0}:
address:
- city: paris
country_id: base.fr
name: Mark Johnson
street: 1 rue Rockfeller
type: invoice
zip: '75016'
email: 'info@mrkjohnson.com'
name: Mr. Mark Johnson
-
-
I'm creating new Buyer "Mr. Rahi" with his email "info@poalrahi.com".
-
!record {model: res.partner, id: res_partner_poalrahi0}:
@ -140,7 +113,7 @@
date_dep: !eval "'%s-08-01' %(datetime.now().year)"
method: keep
name: AD/006
partner_id: res_partner_mrpinakin0
partner_id: base.res_partner_maxtor
specific_cost_ids:
- account: auction.auction_expense
amount: 200.0
@ -149,7 +122,7 @@
I create a new object wooden-chair which is to be auctioned.
-
!record {model: auction.lots, id: auction_lots_woodenchair0}:
ach_uid: res_partner_mrkjohnson0
ach_uid: base.res_partner_seagate
artist_id: auction_artists_vincentvangogh0
auction_id: auction_dates_antiquefurnitureexhibition0
bord_vnd_id: auction_deposit_ad0
@ -199,12 +172,12 @@
price: 3200.0
-
I create another bid for an object "wooden-chair" bid by a Mr.Johnson
I create another bid for an object "wooden-chair" bid by a Mr.Seagate
-
!record {model: auction.bid, id: auction_bid_bid2}:
auction_id: auction_dates_antiquefurnitureexhibition0
name: bid/003
partner_id: res_partner_mrkjohnson0
partner_id: base.res_partner_seagate
-
I create a bid line.
-
@ -215,7 +188,7 @@
lot_id: auction.auction_lots_woodenchair0
price: 4000.0
-
Mr. MarkJohnson bid are selected as the Finalist Bid with 4000 Euro
Mr. Seagate bids are selected as the Finalist Bid with 4000 Euro
-
I check that buyer price and seller price gets bound with the value
-
@ -250,7 +223,7 @@
-
!record {model: auction.lots.make.invoice.buyer, id: auction_lots_make_invoice_buyer_0}:
amount: 3090.0
buyer_id: res_partner_mrkjohnson0
buyer_id: base.res_partner_seagate
number: !eval "'%s/003' %(datetime.now().year)"
objects: 1
-

View File

@ -43,22 +43,17 @@ class audittrail_rule(osv.osv):
"log_create": fields.boolean("Log Creates",help="Select this if you want to keep track of creation on any record of the object of this rule"),
"log_action": fields.boolean("Log Action",help="Select this if you want to keep track of actions on the object of this rule"),
"log_workflow": fields.boolean("Log Workflow",help="Select this if you want to keep track of workflow on any record of the object of this rule"),
"state": fields.selection((("draft", "Draft"),
("subscribed", "Subscribed")),
"State", required=True),
"state": fields.selection((("draft", "Draft"), ("subscribed", "Subscribed")), "State", required=True),
"action_id": fields.many2one('ir.actions.act_window', "Action ID"),
}
_defaults = {
'state': lambda *a: 'draft',
'log_create': lambda *a: 1,
'log_unlink': lambda *a: 1,
'log_write': lambda *a: 1,
'state': 'draft',
'log_create': 1,
'log_unlink': 1,
'log_write': 1,
}
_sql_constraints = [
('model_uniq', 'unique (object_id)', """There is a rule defined on this object\n You cannot define another one the same object!""")
('model_uniq', 'unique (object_id)', """There is already a rule defined on this object\n You cannot define another: please edit the existing one.""")
]
__functions = {}
@ -178,54 +173,33 @@ class audittrail_log_line(osv.osv):
class audittrail_objects_proxy(object_proxy):
""" Uses Object proxy for auditing changes on object of subscribed Rules"""
def get_value_text(self, cr, uid, field_name, values, model, context=None):
def get_value_text(self, cr, uid, pool, resource_pool, method, field, value):
"""
Gets textual values for the fields.
If the field is a many2one, it returns the name.
If it's a one2many or a many2many, it returns a list of name.
In other cases, it just returns the value.
:param cr: the current row, from the database cursor,
:param uid: the current users ID for security checks,
:param pool: current db's pooler object.
:param resource_pool: pooler object of the model which values are being changed.
:param field: for which the text value is to be returned.
:param value: value of the field.
:param recursive: True or False, True will repeat the process recursively
:return: string value or a list of values(for O2M/M2M)
"""
Gets textual values for the fields
e.g.: For field of type many2one it gives its name value instead of id
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param field_name: List of fields for text values
@param values: Values for field to be converted into textual values
@return: values: List of textual values for given fields
"""
if not context:
context = {}
if field_name in('__last_update','id'):
return values
pool = pooler.get_pool(cr.dbname)
field_pool = pool.get('ir.model.fields')
model_pool = pool.get('ir.model')
obj_pool = pool.get(model.model)
if obj_pool._inherits:
inherits_ids = model_pool.search(cr, uid, [('model', '=', obj_pool._inherits.keys()[0])])
field_ids = field_pool.search(cr, uid, [('name', '=', field_name), ('model_id', 'in', (model.id, inherits_ids[0]))])
field_obj = (resource_pool._all_columns.get(field)).column
if field_obj._type in ('one2many','many2many'):
data = pool.get(field_obj._obj).name_get(cr, uid, value)
#return the modifications on x2many fields as a list of names
res = map(lambda x:x[1], data)
elif field_obj._type == 'many2one':
#return the modifications on a many2one field as its value returned by name_get()
res = value and value[1] or value
else:
field_ids = field_pool.search(cr, uid, [('name', '=', field_name), ('model_id', '=', model.id)])
field_id = field_ids and field_ids[0] or False
assert field_id, _("'%s' field does not exist in '%s' model" %(field_name, model.model))
field = field_pool.read(cr, uid, field_id)
relation_model = field['relation']
relation_model_pool = relation_model and pool.get(relation_model) or False
if field['ttype'] == 'many2one':
res = False
relation_id = False
if values and type(values) == tuple:
relation_id = values[0]
if relation_id and relation_model_pool:
relation_model_object = relation_model_pool.read(cr, uid, relation_id, [relation_model_pool._rec_name])
res = relation_model_object[relation_model_pool._rec_name]
return res
elif field['ttype'] in ('many2many','one2many'):
res = []
for relation_model_object in relation_model_pool.read(cr, uid, values, [relation_model_pool._rec_name]):
res.append(relation_model_object[relation_model_pool._rec_name])
return res
return values
res = value
return res
def create_log_line(self, cr, uid, log_id, model, lines=[]):
"""
@ -233,7 +207,7 @@ class audittrail_objects_proxy(object_proxy):
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param model: Object who's values are being changed
@param model: Object which values are being changed
@param lines: List of values for line is to be created
"""
pool = pooler.get_pool(cr.dbname)
@ -241,216 +215,273 @@ class audittrail_objects_proxy(object_proxy):
model_pool = pool.get('ir.model')
field_pool = pool.get('ir.model.fields')
log_line_pool = pool.get('audittrail.log.line')
#start Loop
for line in lines:
if line['name'] in('__last_update','id'):
continue
field_obj = obj_pool._all_columns.get(line['name'])
assert field_obj, _("'%s' field does not exist in '%s' model" %(line['name'], model.model))
field_obj = field_obj.column
old_value = line.get('old_value', '')
new_value = line.get('new_value', '')
search_models = [model.id]
if obj_pool._inherits:
inherits_ids = model_pool.search(cr, uid, [('model', '=', obj_pool._inherits.keys()[0])])
field_ids = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', (model.id, inherits_ids[0]))])
else:
field_ids = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', '=', model.id)])
field_id = field_ids and field_ids[0] or False
assert field_id, _("'%s' field does not exist in '%s' model" %(line['name'], model.model))
field = field_pool.read(cr, uid, field_id)
old_value = 'old_value' in line and line['old_value'] or ''
new_value = 'new_value' in line and line['new_value'] or ''
old_value_text = 'old_value_text' in line and line['old_value_text'] or ''
new_value_text = 'new_value_text' in line and line['new_value_text'] or ''
if old_value_text == new_value_text:
continue
if field['ttype'] == 'many2one':
if type(old_value) == tuple:
old_value = old_value[0]
if type(new_value) == tuple:
new_value = new_value[0]
search_models += model_pool.search(cr, uid, [('model', 'in', obj_pool._inherits.keys())])
field_id = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', search_models)])
if field_obj._type == 'many2one':
old_value = old_value and old_value[0] or old_value
new_value = new_value and new_value[0] or new_value
vals = {
"log_id": log_id,
"field_id": field_id,
"field_id": field_id and field_id[0] or False,
"old_value": old_value,
"new_value": new_value,
"old_value_text": old_value_text,
"new_value_text": new_value_text,
"field_description": field['field_description']
"old_value_text": line.get('old_value_text', ''),
"new_value_text": line.get('new_value_text', ''),
"field_description": field_obj.string
}
line_id = log_line_pool.create(cr, uid, vals)
cr.commit()
#End Loop
return True
def log_fct(self, cr, uid, model, method, fct_src, *args):
def log_fct(self, cr, uid_orig, model, method, fct_src, *args):
"""
Logging function: This function is performs logging oprations according to method
@param db: the current database
@param uid: the current users ID for security checks,
@param object: Object who's values are being changed
@param method: method to log: create, read, write, unlink
Logging function: This function is performing the logging operation
@param model: Object whose values are being changed
@param method: method to log: create, read, write, unlink, action or workflow action
@param fct_src: execute method of Object proxy
@return: Returns result as per method of Object proxy
"""
uid_orig = uid
uid = 1
res2 = args
pool = pooler.get_pool(cr.dbname)
resource_pool = pool.get(model)
log_pool = pool.get('audittrail.log')
model_pool = pool.get('ir.model')
model_ids = model_pool.search(cr, uid, [('model', '=', model)])
model_ids = model_pool.search(cr, 1, [('model', '=', model)])
model_id = model_ids and model_ids[0] or False
assert model_id, _("'%s' Model does not exist..." %(model))
model = model_pool.browse(cr, uid, model_id)
model = model_pool.browse(cr, 1, model_id)
if method in ('create'):
res_id = fct_src(cr, uid_orig, model.model, method, *args)
resource = resource_pool.read(cr, uid, res_id, args[0].keys())
vals = {
"method": method,
"object_id": model.id,
"user_id": uid_orig,
"res_id": resource['id'],
}
if 'id' in resource:
del resource['id']
log_id = log_pool.create(cr, uid, vals)
lines = []
for field in resource:
line = {
'name': field,
'new_value': resource[field],
'new_value_text': self.get_value_text(cr, uid, field, resource[field], model)
}
lines.append(line)
self.create_log_line(cr, uid, log_id, model, lines)
# fields to log. currently only used by log on read()
field_list = []
old_values = new_values = {}
return res_id
elif method in ('read'):
res_ids = args[0]
old_values = {}
if method == 'create':
res = fct_src(cr, uid_orig, model.model, method, *args)
if type(res) == list:
for v in res:
old_values[v['id']] = v
else:
old_values[res['id']] = res
for res_id in old_values:
vals = {
"method": method,
"object_id": model.id,
"user_id": uid_orig,
"res_id": res_id,
}
log_id = log_pool.create(cr, uid, vals)
lines = []
for field in old_values[res_id]:
line = {
'name': field,
'old_value': old_values[res_id][field],
'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model)
}
lines.append(line)
self.create_log_line(cr, uid, log_id, model, lines)
return res
elif method in ('unlink'):
res_ids = args[0]
old_values = {}
for res_id in res_ids:
old_values[res_id] = resource_pool.read(cr, uid, res_id)
for res_id in res_ids:
vals = {
"method": method,
"object_id": model.id,
"user_id": uid_orig,
"res_id": res_id,
}
log_id = log_pool.create(cr, uid, vals)
lines = []
for field in old_values[res_id]:
if field in ('id'):
continue
line = {
'name': field,
'old_value': old_values[res_id][field],
'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model)
}
lines.append(line)
self.create_log_line(cr, uid, log_id, model, lines)
if res:
res_ids = [res]
new_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
elif method == 'read':
res = fct_src(cr, uid_orig, model.model, method, *args)
return res
else:
# build the res_ids and the old_values dict. Here we don't use get_data() to
# avoid performing an additional read()
res_ids = []
for record in res:
res_ids.append(record['id'])
old_values[(model.id, record['id'])] = {'value': record, 'text': record}
# log only the fields read
field_list = args[1]
elif method == 'unlink':
res_ids = args[0]
old_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
res = fct_src(cr, uid_orig, model.model, method, *args)
else: # method is write, action or workflow action
res_ids = []
res = True
if args:
res_ids = args[0]
old_values = {}
fields = []
if len(args)>1 and type(args[1]) == dict:
fields = args[1].keys()
if type(res_ids) in (long, int):
if isinstance(res_ids, (long, int)):
res_ids = [res_ids]
if res_ids:
for resource in resource_pool.read(cr, uid, res_ids):
resource_id = resource['id']
if 'id' in resource:
del resource['id']
old_values_text = {}
old_value = {}
for field in resource.keys():
old_value[field] = resource[field]
old_values_text[field] = self.get_value_text(cr, uid, field, resource[field], model)
old_values[resource_id] = {'text':old_values_text, 'value': old_value}
# store the old values into a dictionary
old_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
# process the original function, workflow trigger...
res = fct_src(cr, uid_orig, model.model, method, *args)
if method == 'copy':
res_ids = [res]
if res_ids:
for resource in resource_pool.read(cr, uid, res_ids):
resource_id = resource['id']
if 'id' in resource:
del resource['id']
vals = {
"method": method,
"object_id": model.id,
"user_id": uid_orig,
"res_id": resource_id,
}
# check the new values and store them into a dictionary
new_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
# compare the old and new values and create audittrail log if needed
self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
return res
def get_data(self, cr, uid, pool, res_ids, model, method):
"""
This function simply read all the fields of the given res_ids, and also recurisvely on
all records of a x2m fields read that need to be logged. Then it returns the result in
convenient structure that will be used as comparison basis.
log_id = log_pool.create(cr, uid, vals)
lines = []
for field in resource.keys():
line = {
'name': field,
'new_value': resource[field],
'old_value': old_values[resource_id]['value'][field],
'new_value_text': self.get_value_text(cr, uid, field, resource[field], model),
'old_value_text': old_values[resource_id]['text'][field]
}
lines.append(line)
:param cr: the current row, from the database cursor,
:param uid: the current users ID. This parameter is currently not used as every
operation to get data is made as super admin. Though, it could be usefull later.
:param pool: current db's pooler object.
:param res_ids: Id's of resource to be logged/compared.
:param model: Object whose values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:return: dict mapping a tuple (model_id, resource_id) with its value and textual value
{ (model_id, resource_id): { 'value': ...
'textual_value': ...
},
}
"""
data = {}
resource_pool = pool.get(model.model)
# read all the fields of the given resources in super admin mode
for resource in resource_pool.read(cr, 1, res_ids):
values = {}
values_text = {}
resource_id = resource['id']
# loop on each field on the res_ids we just have read
for field in resource:
if field in ('__last_update', 'id'):
continue
values[field] = resource[field]
# get the textual value of that field for this record
values_text[field] = self.get_value_text(cr, 1, pool, resource_pool, method, field, resource[field])
self.create_log_line(cr, uid, log_id, model, lines)
return res
field_obj = resource_pool._all_columns.get(field).column
if field_obj._type in ('one2many','many2many'):
# check if an audittrail rule apply in super admin mode
if self.check_rules(cr, 1, field_obj._obj, method):
# check if the model associated to a *2m field exists, in super admin mode
x2m_model_ids = pool.get('ir.model').search(cr, 1, [('model', '=', field_obj._obj)])
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
x2m_model = pool.get('ir.model').browse(cr, 1, x2m_model_id)
#recursive call on x2m fields that need to be checked too
data.update(self.get_data(cr, 1, pool, resource[field], x2m_model, method))
data[(model.id, resource_id)] = {'text':values_text, 'value': values}
return data
def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=[]):
"""
This function compares the old data (i.e before the method was executed) and the new data
(after the method was executed) and returns a structure with all the needed information to
log those differences.
:param cr: the current row, from the database cursor,
:param uid: the current users ID. This parameter is currently not used as every
operation to get data is made as super admin. Though, it could be usefull later.
:param pool: current db's pooler object.
:param model: model object which values are being changed
:param resource_id: ID of record to which values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:param old_values: dict of values read before execution of the method
:param new_values: dict of values read after execution of the method
:param field_list: optional argument containing the list of fields to log. Currently only
used when performing a read, it could be usefull later on if we want to log the write
on specific fields only.
:return: dictionary with
* keys: tuples build as ID of model object to log and ID of resource to log
* values: list of all the changes in field values for this couple (model, resource)
return {
(model.id, resource_id): []
}
The reason why the structure returned is build as above is because when modifying an existing
record (res.partner, for example), we may have to log a change done in a x2many field (on
res.partner.address, for example)
"""
key = (model.id, resource_id)
lines = {
key: []
}
# loop on all the fields
for field_name, field_definition in pool.get(model.model)._all_columns.items():
#if the field_list param is given, skip all the fields not in that list
if field_list and field_name not in field_list:
continue
field_obj = field_definition.column
if field_obj._type in ('one2many','many2many'):
# checking if an audittrail rule apply in super admin mode
if self.check_rules(cr, 1, field_obj._obj, method):
# checking if the model associated to a *2m field exists, in super admin mode
x2m_model_ids = pool.get('ir.model').search(cr, 1, [('model', '=', field_obj._obj)])
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
x2m_model = pool.get('ir.model').browse(cr, 1, x2m_model_id)
# the resource_ids that need to be checked are the sum of both old and previous values (because we
# need to log also creation or deletion in those lists).
x2m_old_values_ids = old_values.get(key, {'value': {}})['value'].get(field_name, [])
x2m_new_values_ids = new_values.get(key, {'value': {}})['value'].get(field_name, [])
# We use list(set(...)) to remove duplicates.
res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids))
for res_id in res_ids:
lines.update(self.prepare_audittrail_log_line(cr, 1, pool, x2m_model, res_id, method, old_values, new_values, field_list))
# if the value value is different than the old value: record the change
if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:
data = {
'name': field_name,
'new_value': key in new_values and new_values[key]['value'].get(field_name),
'old_value': key in old_values and old_values[key]['value'].get(field_name),
'new_value_text': key in new_values and new_values[key]['text'].get(field_name),
'old_value_text': key in old_values and old_values[key]['text'].get(field_name)
}
lines[key].append(data)
return lines
def process_data(self, cr, uid, pool, res_ids, model, method, old_values={}, new_values={}, field_list=[]):
"""
This function processes and iterates recursively to log the difference between the old
data (i.e before the method was executed) and the new data and creates audittrail log
accordingly.
:param cr: the current row, from the database cursor,
:param uid: the current users ID,
:param pool: current db's pooler object.
:param res_ids: Id's of resource to be logged/compared.
:param model: model object which values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:param old_values: dict of values read before execution of the method
:param new_values: dict of values read after execution of the method
:param field_list: optional argument containing the list of fields to log. Currently only
used when performing a read, it could be usefull later on if we want to log the write
on specific fields only.
:return: True
"""
# loop on all the given ids
for res_id in res_ids:
# compare old and new values and get audittrail log lines accordingly
lines = self.prepare_audittrail_log_line(cr, uid, pool, model, res_id, method, old_values, new_values, field_list)
# if at least one modification has been found
for model_id, resource_id in lines:
vals = {
'method': method,
'object_id': model_id,
'user_id': uid,
'res_id': resource_id,
}
if (model_id, resource_id) not in old_values and method not in ('copy', 'read'):
# the resource was not existing so we are forcing the method to 'create'
# (because it could also come with the value 'write' if we are creating
# new record through a one2many field)
vals.update({'method': 'create'})
if (model_id, resource_id) not in new_values and method not in ('copy', 'read'):
# the resource is not existing anymore so we are forcing the method to 'unlink'
# (because it could also come with the value 'write' if we are deleting the
# record through a one2many field)
vals.update({'method': 'unlink'})
# create the audittrail log in super admin mode, only if a change has been detected
if lines[(model_id, resource_id)]:
log_id = pool.get('audittrail.log').create(cr, 1, vals)
model = pool.get('ir.model').browse(cr, uid, model_id)
self.create_log_line(cr, 1, log_id, model, lines[(model_id, resource_id)])
return True
def check_rules(self, cr, uid, model, method):
"""
Checks if auditrails is installed for that db and then if one rule match
@param cr: the current row, from the database cursor,
@param uid: the current users ID,
@param model: value of _name of the object which values are being changed
@param method: method to log: create, read, unlink,write,actions,workflow actions
@return: True or False
"""
pool = pooler.get_pool(cr.dbname)
# Check if auditrails is installed for that db and then if one rule match
if 'audittrail.rule' in pool.models:
model_ids = pool.get('ir.model').search(cr, 1, [('model', '=', model)])
model_id = model_ids and model_ids[0] or False
if model_id:
rule_ids = pool.get('audittrail.rule').search(cr, 1, [('object_id', '=', model_id), ('state', '=', 'subscribed')])
for rule in pool.get('audittrail.rule').read(cr, 1, rule_ids, ['user_id','log_read','log_write','log_create','log_unlink','log_action','log_workflow']):
if len(rule['user_id'])==0 or uid in rule['user_id']:
if len(rule['user_id']) == 0 or uid in rule['user_id']:
if rule.get('log_'+method,0):
return True
elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create'):
@ -460,18 +491,14 @@ class audittrail_objects_proxy(object_proxy):
def execute_cr(self, cr, uid, model, method, *args, **kw):
fct_src = super(audittrail_objects_proxy, self).execute_cr
if self.check_rules(cr,uid,model,method):
res = self.log_fct(cr, uid, model, method, fct_src, *args)
else:
res = fct_src(cr, uid, model, method, *args)
return res
return self.log_fct(cr, uid, model, method, fct_src, *args)
return fct_src(cr, uid, model, method, *args)
def exec_workflow_cr(self, cr, uid, model, method, *args, **argv):
fct_src = super(audittrail_objects_proxy, self).exec_workflow_cr
if self.check_rules(cr,uid,model,'workflow'):
res = self.log_fct(cr, uid, model, method, fct_src, *args)
else:
res = fct_src(cr, uid, model, method, *args)
return res
return self.log_fct(cr, uid, model, method, fct_src, *args)
return fct_src(cr, uid, model, method, *args)
audittrail_objects_proxy()

View File

@ -147,7 +147,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
res['value'] = {'filter_id':False}
return res
def pre_action(self, cr, uid, ids, model, context=None):
def post_action(self, cr, uid, ids, model, context=None):
# Searching for action rules
cr.execute("SELECT model.model, rule.id FROM base_action_rule rule \
LEFT JOIN ir_model model on (model.id = rule.model_id) \
@ -156,7 +156,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
# Check if any rule matching with current object
for obj_name, rule_id in res:
if not (model == obj_name):
continue
continue # TODO add this condition in the WHERE clause above.
else:
obj = self.pool.get(obj_name)
# If the rule doesn't involve a time condition, run it immediately
@ -166,31 +166,36 @@ the rule to mark CC(mail to any other person defined in actions)."),
return True
def _create(self, old_create, model, context=None):
if context is None:
context = {}
def make_call_old(cr, uid, vals, context=context):
"""
Return a wrapper around `old_create` calling both `old_create` and
`post_action`, in that order.
"""
def wrapper(cr, uid, vals, context=context):
new_id = old_create(cr, uid, vals, context=context)
if not context.get('action'):
self.pre_action(cr, uid, [new_id], model, context=context)
self.post_action(cr, uid, [new_id], model, context=context)
return new_id
return make_call_old
return wrapper
def _write(self, old_write, model, context=None):
if context is None:
context = {}
def make_call_old(cr, uid, ids, vals, context=context):
if context is None:
context = {}
"""
Return a wrapper around `old_write` calling both `old_write` and
`post_action`, in that order.
"""
def wrapper(cr, uid, ids, vals, context=context):
if isinstance(ids, (str, int, long)):
ids = [ids]
old_write(cr, uid, ids, vals, context=context)
if not context.get('action'):
self.pre_action(cr, uid, ids, model, context=context)
return old_write(cr, uid, ids, vals, context=context)
return make_call_old
self.post_action(cr, uid, ids, model, context=context)
return True
return wrapper
def _register_hook(self, cr, uid, ids, context=None):
if context is None:
context = {}
"""
Wrap every `create` and `write` methods of the models specified by
the rules (given by `ids`).
"""
for action_rule in self.browse(cr, uid, ids, context=context):
model = action_rule.model_id.model
obj_pool = self.pool.get(model)
@ -200,15 +205,16 @@ the rule to mark CC(mail to any other person defined in actions)."),
obj_pool.base_action_ruled = True
return True
def create(self, cr, uid, vals, context=None):
res_id = super(base_action_rule, self).create(cr, uid, vals, context=context)
self._register_hook(cr, uid, [res_id], context=context)
return res_id
def write(self, cr, uid, ids, vals, context=None):
res = super(base_action_rule, self).write(cr, uid, ids, vals, context=context)
super(base_action_rule, self).write(cr, uid, ids, vals, context=context)
self._register_hook(cr, uid, ids, context=context)
return res
return True
def _check(self, cr, uid, automatic=False, use_new_cursor=False, \
context=None):

View File

@ -8,25 +8,26 @@ 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-15 20:31+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"PO-Revision-Date: 2011-11-23 12:16+0000\n"
"Last-Translator: Paulino Ascenção <Unknown>\n"
"Language-Team: Portuguese <pt@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:51+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: base_action_rule
#: help:base.action.rule,act_mail_to_user:0
msgid ""
"Check this if you want the rule to send an email to the responsible person."
msgstr ""
"Assinale aqui se pretender que a regra envie um e-mail à pessoa responsável."
#. module: base_action_rule
#: field:base.action.rule,act_remind_partner:0
msgid "Remind Partner"
msgstr "Alertar parceiro"
msgstr "Relembrar parceiro"
#. module: base_action_rule
#: field:base.action.rule,trg_partner_categ_id:0
@ -259,7 +260,7 @@ msgstr "Chamar o método do objeto"
#. module: base_action_rule
#: field:base.action.rule,act_email_to:0
msgid "Email To"
msgstr ""
msgstr "E-mail para"
#. module: base_action_rule
#: help:base.action.rule,act_mail_to_watchers:0
@ -369,12 +370,12 @@ msgstr "Erro: A mensagem não está bem formatada"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Email Actions"
msgstr ""
msgstr "Ações do e-mail"
#. module: base_action_rule
#: view:base.action.rule:0
msgid "Email Information"
msgstr ""
msgstr "Informação sobre o e-mail"
#. module: base_action_rule
#: model:ir.model,name:base_action_rule.model_base_action_rule
@ -432,7 +433,7 @@ msgstr ""
#. module: base_action_rule
#: field:base.action.rule,act_email_cc:0
msgid "Add Watchers (Cc)"
msgstr ""
msgstr "Acdicionar observadores (CC)"
#. module: base_action_rule
#: view:base.action.rule:0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,73 @@
# 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:17+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: base_crypt
#: sql_constraint:res.users:0
msgid "You can not have two users with the same login !"
msgstr "Podètz pas aver dos utilizaires amb lo meteis identificant !"
#. module: base_crypt
#: model:ir.model,name:base_crypt.model_res_users
msgid "res.users"
msgstr "res.users"
#. module: base_crypt
#: constraint:res.users:0
msgid "The chosen company is not in the allowed companies for this user"
msgstr ""
"La societat causida fa pas partida de las societats autorizadas per aqueste "
"utilizaire"
#. module: base_crypt
#: code:addons/base_crypt/crypt.py:132
#, python-format
msgid "Please specify the password !"
msgstr "Entratz un senhal"
#. module: base_crypt
#: model:ir.module.module,shortdesc:base_crypt.module_meta_information
msgid "Base - Password Encryption"
msgstr "Basa - Chifratge del senhal"
#. module: base_crypt
#: code:addons/base_crypt/crypt.py:132
#, python-format
msgid "Error"
msgstr "Error"
#. module: base_crypt
#: model:ir.module.module,description:base_crypt.module_meta_information
msgid ""
"This module replaces the cleartext password in the database with a password "
"hash,\n"
"preventing anyone from reading the original password.\n"
"For your existing user base, the removal of the cleartext passwords occurs "
"the first time\n"
"a user logs into the database, after installing base_crypt.\n"
"After installing this module it won't be possible to recover a forgotten "
"password for your\n"
"users, the only solution is for an admin to set a new password.\n"
"\n"
"Note: installing this module does not mean you can ignore basic security "
"measures,\n"
"as the password is still transmitted unencrypted on the network (by the "
"client),\n"
"unless you are using a secure protocol such as XML-RPCS.\n"
" "
msgstr ""

View File

@ -310,10 +310,7 @@ class base_setup_installer(osv.osv_memory):
cr.commit()
self.pool = pooler.restart_pool(cr.dbname, update_module=True)[1]
if 'html' in context:
return {'type' : 'ir.actions.reload'}
else:
return {'type' : 'ir.actions.act_window_close'}
return self.pool.get('res.config').next(cr, uid, [], context=context)
#Migrate data from another application Conf wiz

View File

@ -7,24 +7,24 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\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:48+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"PO-Revision-Date: 2011-11-14 11:20+0000\n"
"Last-Translator: kifcaliph <kifcaliph@hotmail.com>\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:40+0000\n"
"X-Generator: Launchpad (build 14231)\n"
"X-Launchpad-Export-Date: 2011-11-15 05:06+0000\n"
"X-Generator: Launchpad (build 14291)\n"
#. module: base_setup
#: field:base.setup.company,city:0
msgid "City"
msgstr ""
msgstr "المدينة"
#. module: base_setup
#: view:base.setup.installer:0
msgid "Install"
msgstr ""
msgstr "تثبيت"
#. module: base_setup
#: field:base.setup.installer,account_voucher:0
@ -34,12 +34,12 @@ msgstr "الفواتير"
#. module: base_setup
#: field:base.setup.installer,hr:0
msgid "Human Resources"
msgstr ""
msgstr "الموارد البشرية"
#. module: base_setup
#: field:base.setup.company,email:0
msgid "E-mail"
msgstr ""
msgstr "البريد الإلكتروني"
#. module: base_setup
#: field:base.setup.company,account_no:0
@ -54,19 +54,19 @@ msgstr "أدوات إضافية"
#. module: base_setup
#: field:base.setup.company,rml_footer1:0
msgid "Report Footer 1"
msgstr ""
msgstr "تذييل تقرير 1"
#. module: base_setup
#: help:base.setup.installer,mrp:0
msgid ""
"Helps you manage your manufacturing processes and generate reports on those "
"processes."
msgstr ""
msgstr "يساعدك على إدارة عمليات التصنيع وإصدار تقارير عن هذه العمليات."
#. module: base_setup
#: help:base.setup.installer,marketing:0
msgid "Helps you manage your marketing campaigns step by step."
msgstr ""
msgstr "يساعدك على إدارة حملاتك التسويقية خطوة بخطوة."
#. module: base_setup
#: view:base.setup.config:0
@ -81,7 +81,7 @@ msgstr "نقاط البيع"
#. module: base_setup
#: field:base.setup.installer,association:0
msgid "Associations"
msgstr ""
msgstr "الجمعيات"
#. module: base_setup
#: help:base.setup.installer,account_accountant:0
@ -89,6 +89,8 @@ msgid ""
"Helps you handle your accounting needs, if you are not an accountant, we "
"suggest you to install only the Invoicing "
msgstr ""
"يساعدك على التعامل مع احتياجاتك المحاسبية. إذا لم تكن محاسباً، نقترح تثبيت "
"\"الفواتير\" فقط "
#. module: base_setup
#: code:addons/base_setup/__init__.py:50
@ -100,33 +102,33 @@ msgstr "تمت إضافة المستخدمين التالين: \n"
#: field:base.setup.company,progress:0
#: field:base.setup.installer,progress:0
msgid "Configuration Progress"
msgstr ""
msgstr "تقدم الإعدادات"
#. module: base_setup
#: field:base.setup.company,rml_footer2:0
msgid "Report Footer 2"
msgstr ""
msgstr "تذييل تقرير 2"
#. module: base_setup
#: field:base.setup.company,currency:0
#: model:ir.model,name:base_setup.model_res_currency
msgid "Currency"
msgstr ""
msgstr "العملة"
#. module: base_setup
#: field:base.setup.company,state_id:0
msgid "Fed. State"
msgstr ""
msgstr "المحافظة / الولاية"
#. module: base_setup
#: field:base.setup.installer,marketing:0
msgid "Marketing"
msgstr ""
msgstr "التسويق"
#. module: base_setup
#: field:base.setup.company,company_id:0
msgid "Company"
msgstr ""
msgstr "الشركة"
#. module: base_setup
#: field:base.setup.installer,sale:0
@ -139,13 +141,15 @@ msgid ""
"Lets you install various interesting but non-essential tools like Survey, "
"Lunch and Ideas box."
msgstr ""
"يمكّنك من تثبيت عدد من الأدوات المفيدة ولكن غير الضرورية، مثل الاستبانات "
"والوجبات وصندوق الأفكار."
#. module: base_setup
#: view:base.setup.config:0
msgid ""
"You can start configuring the system or connect directly to the database as "
"an administrator."
msgstr ""
msgstr "يمكنك الشروع في إعداد النظام أو استخدام النظام مباشرة كمدير."
#. module: base_setup
#: field:base.setup.installer,report_designer:0
@ -155,12 +159,12 @@ msgstr "تقارير متقدمة"
#. module: base_setup
#: field:base.setup.company,phone:0
msgid "Phone"
msgstr ""
msgstr "هاتف"
#. module: base_setup
#: view:base.setup.company:0
msgid "res_config_contents"
msgstr ""
msgstr "res_config_contents"
#. module: base_setup
#: view:base.setup.company:0
@ -168,16 +172,18 @@ msgid ""
"Your company information will be used to personalize documents issued with "
"OpenERP such as invoices, sales orders and much more."
msgstr ""
"سيتمّ استخدام معلومات شركتك لتخصيص المستندات التي يصدرها OpenERP مثل "
"الفواتير وأوامر المبيعات وغير ذلك الكثير."
#. module: base_setup
#: view:base.setup.installer:0
msgid "title"
msgstr ""
msgstr "العنوان"
#. module: base_setup
#: field:base.setup.installer,knowledge:0
msgid "Knowledge Management"
msgstr ""
msgstr "إدارة المعارف"
#. module: base_setup
#: model:ir.module.module,description:base_setup.module_meta_information
@ -197,6 +203,19 @@ msgid ""
" footer, the account chart to install and the language.\n"
" "
msgstr ""
"\n"
" هذا البرنامج يشمل إعدادات النظام ليساعد المستخدم\n"
" لإعداد النظام أثناء إنشاءه قاعدة بيانات جديدة.\n"
"\n"
" سيسمح لك بإختيار من قائمة معرفة لتنصيب:\n"
" * الحد الأدني للنظام\n"
" * برامج المحاسبة فقط\n"
" * برامج القطاع الخدمي\n"
" * برامج القطاع التصنيعي\n"
"\n"
" بالإضافة إلي مساعدتك علي تحديد نوع شركتك، اسمها\n"
" و تعريف نوع الدليل المحاسبي و اللغة.\n"
" "
#. module: base_setup
#: help:base.setup.installer,product_expiry:0
@ -204,6 +223,8 @@ msgid ""
"Installs a preselected set of OpenERP applications which will help you "
"manage your industry."
msgstr ""
"يقوم بتثبيت مجموعة من تطبيقات OpenERP مختارة مسبقاً تساعدك على إدارة نوع "
"الصناعة الخاص بك."
#. module: base_setup
#: help:base.setup.installer,project:0
@ -211,16 +232,17 @@ msgid ""
"Helps you manage your projects and tasks by tracking them, generating "
"plannings, etc..."
msgstr ""
"يساعدك على إدارة مشاريعك ومهامك عن طريق متابعتهم وإصدار الخطط وما إلى ذلك."
#. module: base_setup
#: field:base.setup.company,name:0
msgid "Company Name"
msgstr ""
msgstr "اسم الشركة"
#. module: base_setup
#: view:base.setup.config:0
msgid "Skip Configuration Wizards"
msgstr ""
msgstr "تجاوز معالجات الإعدادات"
#. module: base_setup
#: help:base.setup.installer,hr:0
@ -228,6 +250,8 @@ msgid ""
"Helps you manage your human resources by encoding your employees structure, "
"generating work sheets, tracking attendance and more."
msgstr ""
"يساعدك على إدارة مواردك البشرية عن طريق فهم هيكل الموظفين وإصدار أوراق العمل "
"ومتابعة الحضور وغير ذلك."
#. module: base_setup
#: help:base.setup.installer,account_voucher:0
@ -235,11 +259,13 @@ msgid ""
"Allows you to create your invoices and track the payments. It is an easier "
"version of the accounting module for managers who are not accountants."
msgstr ""
"يمكّنك من إصدار الفواتير و متابعة المدفوعات. يعدّ نسخة مبسطة من "
"\"المحاسبة\" مناسبة للمدراء غير المحاسِبين."
#. module: base_setup
#: model:ir.model,name:base_setup.model_base_setup_company
msgid "base.setup.company"
msgstr ""
msgstr "base.setup.company"
#. module: base_setup
#: help:base.setup.installer,purchase:0
@ -247,6 +273,8 @@ msgid ""
"Helps you manage your purchase-related processes such as requests for "
"quotations, supplier invoices, etc..."
msgstr ""
"يساعدك على إدارة العمليات المتعلقة بالشراء مثل طلبات التسعير وفواتير "
"الموردين وما إلى ذلك."
#. module: base_setup
#: help:base.setup.company,rml_footer2:0
@ -255,26 +283,29 @@ msgid ""
"We suggest you to put bank information here:\n"
"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
msgstr ""
"ستظهر هذه الجملة أسفل التقارير.\n"
"نقترح عليك وضع معلوماتك المصرفية هنا:\n"
"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
#. module: base_setup
#: field:base.setup.company,street2:0
msgid "Street 2"
msgstr ""
msgstr "العنوان 2"
#. module: base_setup
#: model:ir.model,name:base_setup.model_base_setup_installer
msgid "base.setup.installer"
msgstr ""
msgstr "base.setup.installer"
#. module: base_setup
#: field:base.setup.company,country_id:0
msgid "Country"
msgstr ""
msgstr "الدولة"
#. module: base_setup
#: model:ir.actions.act_window,name:base_setup.action_base_setup
msgid "Setup"
msgstr ""
msgstr "إعداد"
#. module: base_setup
#: field:base.setup.installer,account_accountant:0
@ -289,7 +320,7 @@ msgstr ""
#. module: base_setup
#: field:base.setup.company,zip:0
msgid "Zip Code"
msgstr ""
msgstr "الرمز البريدي"
#. module: base_setup
#: view:base.setup.config:0
@ -301,7 +332,7 @@ msgstr "بدء الإعداد"
msgid ""
"Lets you install addons geared towards sharing knowledge with and between "
"your employees."
msgstr ""
msgstr "يمكّنك من تثبيت إضافات غرضها نشر ومشاركة المعارف بين موظفيك."
#. module: base_setup
#: view:base.setup.installer:0
@ -309,6 +340,8 @@ msgid ""
"Select the Applications you want your system to cover. If you are not sure "
"about your exact needs at this stage, you can easily install them later."
msgstr ""
"اختر التطبيقات الي تريد أن يتضمنها النظام. إذا لم تكن متأكداً من احتياجاتك "
"بدقة في هذه المرحلة، يمكنك تثبيت أي من التطبيقات بسهولة لاحقاً."
#. module: base_setup
#: view:base.setup.company:0
@ -319,7 +352,7 @@ msgstr "إعدادات الشركة"
#. module: base_setup
#: field:base.setup.company,logo:0
msgid "Logo"
msgstr ""
msgstr "الشعار"
#. module: base_setup
#: help:base.setup.installer,point_of_sale:0
@ -328,6 +361,8 @@ msgid ""
"simplified payment mode encoding, automatic picking lists generation and "
"more."
msgstr ""
"يساعدك على تشغيل نقاط البيع بكفاءة عن طريق تسجيل عمليات البيع بسرعة وتوفير "
"وضع مبسط للدفع وإصدار تلقائي لقوائم الالتقاط وغير ذلك."
#. module: base_setup
#: field:base.setup.installer,purchase:0
@ -337,7 +372,7 @@ msgstr "إدارة المشتريات"
#. module: base_setup
#: help:base.setup.installer,sale:0
msgid "Helps you handle your quotations, sale orders and invoicing."
msgstr ""
msgstr "يساعدك على التعامل مع التسعيرات وأوامر المبيعات والفواتير."
#. module: base_setup
#: field:base.setup.installer,stock:0
@ -347,7 +382,7 @@ msgstr "إدارة المخازن و المستودعات"
#. module: base_setup
#: field:base.setup.installer,project:0
msgid "Project Management"
msgstr "إدارة المشروعات"
msgstr "إدارة المشاريع"
#. module: base_setup
#: field:base.setup.config,installed_users:0
@ -357,7 +392,7 @@ msgstr "المستخدمون المعرّفون"
#. module: base_setup
#: view:base.setup.config:0
msgid "New Database"
msgstr ""
msgstr "قاعدة بيانات جديدة"
#. module: base_setup
#: field:base.setup.installer,crm:0
@ -370,6 +405,8 @@ msgid ""
"Installs a preselected set of OpenERP applications selected to help you "
"manage your auctions as well as the business processes around them."
msgstr ""
"يقوم بتثبيت مجموعة من تطبيقات OpenERP مختارة مسبقاً لتساعدك على إدارة "
"المزادات والعمليات المتعلقة بها."
#. module: base_setup
#: help:base.setup.company,rml_header1:0
@ -378,18 +415,21 @@ msgid ""
"We suggest you to put a slogan here:\n"
"\"Open Source Business Solutions\"."
msgstr ""
"ستظهر هذه الجملة في الزاوية اليمنى في رأس كل تقرير.\n"
"نقترح عليك وضع شعار هنا:\n"
"\"حلول أعمال مفتوحة المصدر\"."
#. module: base_setup
#: help:base.setup.installer,report_designer:0
msgid ""
"Lets you install various tools to simplify and enhance OpenERP's report "
"creation."
msgstr ""
msgstr "يمكّنك من تثبيت عدة أدوات تسهل وتحسن إنشاء التقارير."
#. module: base_setup
#: field:base.setup.company,rml_header1:0
msgid "Report Header"
msgstr ""
msgstr "رأس التقرير"
#. module: base_setup
#: view:base.setup.config:0
@ -401,7 +441,7 @@ msgstr "معلومات عن قاعدة البيانات الجديدة"
#: field:base.setup.config,config_logo:0
#: field:base.setup.installer,config_logo:0
msgid "Image"
msgstr ""
msgstr "صورة"
#. module: base_setup
#: field:base.setup.installer,product_expiry:0
@ -411,7 +451,7 @@ msgstr "الصناعات الغذائية"
#. module: base_setup
#: field:base.setup.installer,mrp:0
msgid "Manufacturing"
msgstr ""
msgstr "التصنيع"
#. module: base_setup
#: view:base.setup.company:0
@ -425,6 +465,9 @@ msgid ""
"We suggest you to write legal sentences here:\n"
"Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07"
msgstr ""
"ستظهر هذه الجملة في أسفل التقارير.\n"
"نقترح عليك كتابة معلومات قانونية هنا:\n"
"موقع: http://openerp.com - فاكس: +32.81.73.35.01 - بنك فوتيس: 126-2013269-07"
#. module: base_setup
#: field:base.setup.company,website:0
@ -434,12 +477,12 @@ msgstr "الموقع الإلكتروني للشركة"
#. module: base_setup
#: view:base.setup.installer:0
msgid "Install Specific Industry Applications"
msgstr "نصّب تطبيقات صناعات معينة"
msgstr "ثبّت تطبيقات صناعات معينة"
#. module: base_setup
#: field:base.setup.company,street:0
msgid "Street"
msgstr ""
msgstr "العنوان"
#. module: base_setup
#: view:base.setup.company:0
@ -455,7 +498,7 @@ msgstr "مثال: http://openerp.com"
#: view:base.setup.installer:0
#: model:ir.actions.act_window,name:base_setup.action_base_setup_installer
msgid "Install Applications"
msgstr "تنصيب التطبيقات"
msgstr "تثبيت تطبيقات"
#. module: base_setup
#: help:base.setup.installer,crm:0
@ -464,6 +507,9 @@ msgid ""
"or issues. Can automatically send reminders, escalate requests or trigger "
"business-specific actions based on standard events."
msgstr ""
"يساعدك على متابعة وإدارة علاقات العملاء مثل الفرص والطلبات والشكاوى. يوفر "
"إمكانيات تلقائية لإرسال رسائل تذكير، وتصعيد طلبات، وابتداء إجراءات مخصصة "
"بناء على أحداث قياسية."
#. module: base_setup
#: help:base.setup.installer,stock:0
@ -471,6 +517,8 @@ msgid ""
"Helps you manage your inventory and main stock operations: delivery orders, "
"receptions, etc."
msgstr ""
"يساعدك على إدارة العمليات المتعلقة بكميات المخزون مثل أوامر التسليم "
"والاستلام وما إلى ذلك."
#. module: base_setup
#: model:ir.module.module,shortdesc:base_setup.module_meta_information
@ -483,11 +531,13 @@ msgid ""
"Installs a preselected set of OpenERP applications which will help you "
"manage your association more efficiently."
msgstr ""
"يقوم بتثبيت مجموعة من تطبيقات OpenERP مختارة مسبقاً لتساعدك على إدارة جمعيتك "
"بكفاءة أعلى."
#. module: base_setup
#: model:ir.model,name:base_setup.model_base_setup_config
msgid "base.setup.config"
msgstr ""
msgstr "base.setup.config"
#~ msgid "Point of Sales"
#~ msgstr "نقاط البيع"

View File

@ -0,0 +1,32 @@
# 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:19+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: base_tools
#: model:ir.module.module,shortdesc:base_tools.module_meta_information
msgid "Common base for tools modules"
msgstr "Basa comuna pels moduls utilitaris"
#. module: base_tools
#: model:ir.module.module,description:base_tools.module_meta_information
msgid ""
"\n"
" "
msgstr ""
"\n"
" "

View File

@ -56,14 +56,14 @@ class board_board(osv.osv):
#End Loop
arch = """<?xml version="1.0"?>
<form string="My Board">
<hpaned>
<child1>
<board style="1-1">
<column>
%s
</child1>
<child2>
</column>
<column>
%s
</child2>
</hpaned>
</column>
</board>
</form>""" % ('\n'.join(left), '\n'.join(right))
return arch
@ -134,10 +134,10 @@ class board_board(osv.osv):
res['arch'] = self._arch_preprocessing(cr, user, res['arch'], context=context)
res['toolbar'] = {'print': [], 'action': [], 'relate': []}
return res
def _arch_preprocessing(self, cr, user, arch, context=None):
from lxml import etree
def _arch_preprocessing(self, cr, user, arch, context=None):
from lxml import etree
def remove_unauthorized_children(node):
for child in node.iterchildren():
if child.tag=='action' and child.get('invisible'):
@ -145,17 +145,17 @@ class board_board(osv.osv):
else:
child=remove_unauthorized_children(child)
return node
def encode(s):
if isinstance(s, unicode):
return s.encode('utf8')
return s
archnode = etree.fromstring(encode(arch))
archnode = etree.fromstring(encode(arch))
return etree.tostring(remove_unauthorized_children(archnode),pretty_print=True)
_columns = {
'name': fields.char('Dashboard', size=64, required=True),

View File

@ -158,7 +158,7 @@
</record>
<!-- bind adminitration dashboard to the root administration -->
<menuitem id="base.menu_administration" icon="terp-administration" name="Administration" sequence="50" action="open_board_administration_form"/>
<menuitem id="base.menu_administration" icon="terp-administration" name="Settings" sequence="50" action="open_board_administration_form"/>
<!-- add a menu item in adminitration/reporting/dashboards -->
<menuitem id="base.menu_reporting" name="Reporting" parent="base.menu_administration" sequence="11" groups="base.group_extended"/>

View File

@ -44,14 +44,10 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="">
<board style="2-1">
<board style="1">
<column>
<action name="%(action_application_tiles)d"/>
</column>
<column>
<action name="%(action_res_widgets_tweets)d"/>
<action name="%(action_res_widgets_events)d"/>
</column>
</board>
</form>
</field>

View File

@ -1,6 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_board_board","board.board","model_board_board","base.group_user",1,1,1,1
"access_board_board_line","board.board.line","model_board_board_line","base.group_user",1,1,1,1
"access_res_log_report","res.log.report","model_res_log_report","base.group_user",1,1,1,1
"access_res_log_report_system","res.log.report system","model_res_log_report",base.group_system,1,0,0,0
"access_res_log_report_erp_manager","res.log.report erp_manager","model_res_log_report",base.group_erp_manager,1,0,0,0
"access_board_board all","board.board","model_board_board",,1,0,0,0
"access_board_board_line all","board.board.line","model_board_board_line",,1,0,0,0
"access_board_board system","board.board system","model_board_board",base.group_system,1,1,1,1
"access_board_board_line system","board.board.line system","model_board_board_line",base.group_system,1,1,1,1
"access_res_log_report all","res.log.report","model_res_log_report",,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_board_board access_board_board all board.board model_board_board base.group_user 1 1 0 1 0 1 0
3 access_board_board_line access_board_board_line all board.board.line model_board_board_line base.group_user 1 1 0 1 0 1 0
4 access_res_log_report access_board_board system res.log.report board.board system model_res_log_report model_board_board base.group_user base.group_system 1 1 1 1
5 access_res_log_report_system access_board_board_line system res.log.report system board.board.line system model_res_log_report model_board_board_line base.group_system 1 0 1 0 1 0 1
6 access_res_log_report_erp_manager access_res_log_report all res.log.report erp_manager res.log.report model_res_log_report base.group_erp_manager 1 0 0 0

View File

@ -0,0 +1,33 @@
# 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:19+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: claim_from_delivery
#: model:ir.actions.act_window,name:claim_from_delivery.action_claim_from_delivery
msgid "Claim"
msgstr "Reclamacion"
#. module: claim_from_delivery
#: model:ir.module.module,description:claim_from_delivery.module_meta_information
msgid "Create Claim from delivery order:\n"
msgstr "Crear una reclamacion sus un bon de liurason :\n"
#. module: claim_from_delivery
#: model:ir.module.module,shortdesc:claim_from_delivery.module_meta_information
msgid "Claim from delivery"
msgstr "Reclamacion sus la liurason"

View File

@ -78,31 +78,22 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Statistics Dashboard">
<hpaned>
<child1>
<action
string="Opportunities by Categories"
name="%(act_oppor_categ)d"
colspan="4"
height="200"
width="250"/>
<board style="1-1">
<column>
<action string="Opportunities by Categories"
name="%(act_oppor_categ)d"/>
<action
string="Opportunities by Stage"
name="%(act_opportunity_stage)d"
height="200"
colspan="4"/>
<action string="Opportunities by Stage"
name="%(act_opportunity_stage)d"/>
</child1>
<child2>
</column>
<column>
<action
string="Planned Revenue by Stage and User"
name="%(act_oppor_stage_user)d"
colspan="4"/>
<action string="Planned Revenue by Stage and User"
name="%(act_oppor_stage_user)d"/>
</child2>
</hpaned>
</column>
</board>
</form>
</field>
</record>

View File

@ -116,34 +116,21 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales Dashboard">
<hpaned>
<child1>
<action
string="My Open Opportunities"
name="%(act_my_oppor)d"
colspan="4"
height="150"
groups="base.group_sale_salesman,base.group_sale_manager"
width="510"/>
<board style="1-1">
<column>
<action string="My Open Opportunities"
name="%(act_my_oppor)d"/>
<action
string="My Meetings"
name="%(act_my_meetings)d"
height="150"
colspan="4"/>
</child1>
<child2>
<action
string="My Planned Revenues by Stage"
name="%(act_my_oppor_stage)d"
groups="base.group_sale_salesman,base.group_sale_manager"
colspan="4"/>
<action
string="My Win/Lost Ratio"
name="%(act_sales_pipeline)d"
groups="base.group_sale_salesman,base.group_sale_manager"
colspan="4"/>
</child2>
</hpaned>
name="%(act_my_meetings)d"/>
</column>
<column>
<action string="My Planned Revenues by Stage"
name="%(act_my_oppor_stage)d"/>
<action string="My Win/Lost Ratio"
name="%(act_sales_pipeline)d"/>
</column>
</board>
</form>
</field>
</record>

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