[MERGE]merge with latest addons trunk
bzr revid: csn@openerp.com-20121119125613-211aykfipa9l59q3
This commit is contained in:
commit
e298cdfa82
|
@ -541,10 +541,18 @@ class account_account(osv.osv):
|
|||
return False
|
||||
return True
|
||||
|
||||
def _check_company_account(self, cr, uid, ids, context=None):
|
||||
for account in self.browse(cr, uid, ids, context=context):
|
||||
if account.parent_id:
|
||||
if account.company_id != account.parent_id.company_id:
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_recursion, 'Error!\nYou cannot create recursive accounts.', ['parent_id']),
|
||||
(_check_type, 'Configuration Error!\nYou cannot define children to an account with internal type different of "View".', ['type']),
|
||||
(_check_account_type, 'Configuration Error!\nYou cannot select an account type with a deferral method different of "Unreconciled" for accounts with internal type "Payable/Receivable".', ['user_type','type']),
|
||||
(_check_company_account, 'Error!\nYou cannot create an account which has parent account of different company.', ['parent_id']),
|
||||
]
|
||||
_sql_constraints = [
|
||||
('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !')
|
||||
|
|
|
@ -107,7 +107,7 @@ class account_analytic_line(osv.osv):
|
|||
if journal_id:
|
||||
journal = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
|
||||
if journal.type == 'sale':
|
||||
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
|
||||
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context=context)
|
||||
if product_price_type_ids:
|
||||
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
|
||||
# Take the company currency as the reference one
|
||||
|
|
|
@ -61,7 +61,7 @@ class account_bank_statement(osv.osv):
|
|||
return res
|
||||
|
||||
def _get_period(self, cr, uid, context=None):
|
||||
periods = self.pool.get('account.period').find(cr, uid)
|
||||
periods = self.pool.get('account.period').find(cr, uid,context=context)
|
||||
if periods:
|
||||
return periods[0]
|
||||
return False
|
||||
|
@ -486,6 +486,19 @@ class account_bank_statement(osv.osv):
|
|||
default['move_line_ids'] = []
|
||||
return super(account_bank_statement, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def button_journal_entries(self, cr, uid, ids, context=None):
|
||||
ctx = (context or {}).copy()
|
||||
ctx['journal_id'] = self.browse(cr, uid, ids[0], context=context).journal_id.id
|
||||
return {
|
||||
'view_type':'form',
|
||||
'view_mode':'tree',
|
||||
'res_model':'account.move.line',
|
||||
'view_id':False,
|
||||
'type':'ir.actions.act_window',
|
||||
'domain':[('statement_id','in',ids)],
|
||||
'context':ctx,
|
||||
}
|
||||
|
||||
account_bank_statement()
|
||||
|
||||
class account_bank_statement_line(osv.osv):
|
||||
|
|
|
@ -78,7 +78,7 @@ class account_cash_statement(osv.osv):
|
|||
"""
|
||||
res = {}
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
if statement.journal_id.type not in ('cash',):
|
||||
if (statement.journal_id.type not in ('cash',)) or (not statement.journal_id.cash_control):
|
||||
continue
|
||||
start = end = 0
|
||||
for line in statement.details_ids:
|
||||
|
@ -289,13 +289,13 @@ class account_cash_statement(osv.osv):
|
|||
super(account_cash_statement, self).button_confirm_bank(cr, uid, ids, context=context)
|
||||
absl_proxy = self.pool.get('account.bank.statement.line')
|
||||
|
||||
TABLES = (('Profit', 'profit_account_id'), ('Loss', 'loss_account_id'),)
|
||||
TABLES = ((_('Profit'), 'profit_account_id'), (_('Loss'), 'loss_account_id'),)
|
||||
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
if obj.difference == 0.0:
|
||||
continue
|
||||
|
||||
for item_label, item_account in TALBES:
|
||||
for item_label, item_account in TABLES:
|
||||
if getattr(obj.journal_id, item_account):
|
||||
raise osv.except_osv(_('Error!'),
|
||||
_('There is no %s Account on the journal %s.') % (item_label, obj.journal_id.name,))
|
||||
|
|
|
@ -402,6 +402,7 @@ class account_invoice(osv.osv):
|
|||
'default_res_id': ids[0],
|
||||
'default_use_template': True,
|
||||
'default_template_id': template_id,
|
||||
'default_composition_mode': 'comment',
|
||||
})
|
||||
return {
|
||||
'view_type': 'form',
|
||||
|
@ -431,7 +432,7 @@ class account_invoice(osv.osv):
|
|||
if t['state'] in ('draft', 'cancel') and t['internal_number']== False:
|
||||
unlink_ids.append(t['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid Action!'), _('You cannot delete an invoice which is open or paid. You should refund it instead.'))
|
||||
raise osv.except_osv(_('Invalid Action!'), _('You can not delete an invoice which is not cancelled. You should refund it instead.'))
|
||||
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
|
||||
return True
|
||||
|
||||
|
@ -983,13 +984,13 @@ class account_invoice(osv.osv):
|
|||
for i in line:
|
||||
i[2]['period_id'] = period_id
|
||||
|
||||
ctx.update(invoice=inv)
|
||||
move_id = move_obj.create(cr, uid, move, context=ctx)
|
||||
new_move_name = move_obj.browse(cr, uid, move_id, context=ctx).name
|
||||
# make the invoice point to that move
|
||||
self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name}, context=ctx)
|
||||
# Pass invoice in context in method post: used if you want to get the same
|
||||
# account move reference when creating the same invoice after a cancelled one:
|
||||
ctx.update({'invoice':inv})
|
||||
move_obj.post(cr, uid, [move_id], context=ctx)
|
||||
self._log_event(cr, uid, ids)
|
||||
return True
|
||||
|
|
|
@ -168,10 +168,8 @@
|
|||
context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
|
||||
domain="[('supplier', '=', True)]"/>
|
||||
<field name="fiscal_position" widget="selection"/>
|
||||
<group>
|
||||
<field name="origin"/>
|
||||
<field name="supplier_invoice_number"/>
|
||||
</group>
|
||||
<label for="reference_type"/>
|
||||
<div>
|
||||
<field name="reference_type" class="oe_inline oe_edit_only"/>
|
||||
|
@ -438,7 +436,7 @@
|
|||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
|
||||
<field name="message_ids" widget="mail_thread" placeholder="Share a note..."/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -208,7 +208,7 @@ class account_move_line(osv.osv):
|
|||
if type(period_id) == str:
|
||||
ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)])
|
||||
context.update({
|
||||
'period_id': ids[0]
|
||||
'period_id': ids and ids[0] or False
|
||||
})
|
||||
return context
|
||||
|
||||
|
@ -582,7 +582,7 @@ class account_move_line(osv.osv):
|
|||
lines = self.browse(cr, uid, ids, context=context)
|
||||
for l in lines:
|
||||
if l.account_id.type == 'view':
|
||||
raise osv.except_osv(_('Error!'), _('You cannot create journal items on “View” type account %s %s.') % (l.account_id.code, l.account_id.name))
|
||||
return False
|
||||
return True
|
||||
|
||||
def _check_no_closed(self, cr, uid, ids, context=None):
|
||||
|
@ -917,7 +917,7 @@ class account_move_line(osv.osv):
|
|||
|
||||
if lines and lines[0]:
|
||||
partner_id = lines[0].partner_id and lines[0].partner_id.id or False
|
||||
if not partner_obj.has_something_to_reconcile(cr, uid, partner_id, context=context):
|
||||
if partner_id and not partner_obj.has_something_to_reconcile(cr, uid, partner_id, context=context):
|
||||
partner_obj.mark_as_reconciled(cr, uid, [partner_id], context=context)
|
||||
return r_id
|
||||
|
||||
|
@ -975,7 +975,7 @@ class account_move_line(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
if view_type != 'tree':
|
||||
if (view_type != 'tree') or view_id:
|
||||
#Remove the toolbar from the form view
|
||||
if view_type == 'form':
|
||||
if result.get('toolbar', False):
|
||||
|
|
|
@ -41,13 +41,5 @@
|
|||
groups="group_account_user,group_account_manager"
|
||||
parent="account.menu_finance_generic_reporting" sequence="3"/>
|
||||
|
||||
<report id="account_account_balance_landscape"
|
||||
string="Account balance"
|
||||
model="account.account"
|
||||
name="account.account.balance.landscape"
|
||||
rml="account/report/account_balance_landscape.rml"
|
||||
auto="False"
|
||||
menu="False"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -306,7 +306,7 @@
|
|||
<field name="name">Unrealized Gain or Loss</field>
|
||||
<field name="model">account.account</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Unrealized Gains and losses">
|
||||
<tree string="Unrealized Gains and losses" create="false">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
|
@ -509,8 +509,8 @@
|
|||
<page string="Cash Registers">
|
||||
<group>
|
||||
<group string="Accounts">
|
||||
<field name="profit_account_id"/>
|
||||
<field name="loss_account_id"/>
|
||||
<field name="profit_account_id" domain="[('type','!=','view')]"/>
|
||||
<field name="loss_account_id" domain="[('type','!=','view')]"/>
|
||||
<field name="internal_account_id"/>
|
||||
</group>
|
||||
<group string="Miscellaneous">
|
||||
|
@ -650,7 +650,7 @@
|
|||
<field name="ref"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id','=',parent.journal_id), ('company_id', '=', parent.company_id)]" name="account_id"/>
|
||||
<field name="account_id" options='{"no_open":True}' domain="[('journal_id','=',parent.journal_id), ('company_id', '=', parent.company_id)]"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/>
|
||||
<field name="amount"/>
|
||||
</tree>
|
||||
|
@ -661,7 +661,7 @@
|
|||
<field name="ref"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id', '=', parent.journal_id), ('type', '<>', 'view'), ('company_id', '=', parent.company_id)]" name="account_id"/>
|
||||
<field name="account_id" domain="[('journal_id', '=', parent.journal_id), ('type', '<>', 'view'), ('company_id', '=', parent.company_id)]"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/>
|
||||
<field name="amount"/>
|
||||
<field name="sequence" readonly="0"/>
|
||||
|
@ -671,15 +671,24 @@
|
|||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Journal Entries" name="move_live_ids">
|
||||
<field name="move_line_ids"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_form_journal_items" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.journal.items.form.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="view_bank_statement_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='import_buttons']" position="inside">
|
||||
<button name="button_journal_entries"
|
||||
string="Journal Items" type="object"
|
||||
attrs="{'invisible':[('state','!=','confirm')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_bank_statement_tree" model="ir.actions.act_window">
|
||||
<field name="name">Bank Statements</field>
|
||||
|
@ -1230,8 +1239,8 @@
|
|||
<field name="move_id" string="Number (Move)"/>
|
||||
<field name="account_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="journal_id" context="{'journal_id':self}"/>
|
||||
<field name="period_id" context="{'period_id':self}"/>
|
||||
<field name="journal_id" context="{'journal_id':self}" widget="selection"/> <!-- it's important to keep widget='selection' in this filter viewbecause without that the value passed in the context is not the ID but the textual value (name) of the selected journal -->
|
||||
<field name="period_id" context="{'period_id':self}" widget="selection"/> <!-- it's important to keep the widget='selection' in this field, for the same reason as explained above -->
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
|
||||
|
@ -1791,7 +1800,7 @@
|
|||
<field name="name"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
<field name="note" placeholder="Note fo the invoice..."/>
|
||||
<field name="note" placeholder="Note for the invoice..."/>
|
||||
<separator string="Computation"/>
|
||||
<field name="line_ids"/>
|
||||
</form>
|
||||
|
@ -2159,7 +2168,8 @@
|
|||
<field name="visible" />
|
||||
<field name="complete_tax_set" />
|
||||
</group>
|
||||
<field name="tax_template_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
<separator string="Default Taxes" colspan="4"/>
|
||||
<field name="tax_template_ids" colspan="4" nolabel="1"/>
|
||||
<separator string="Properties" colspan="4"/>
|
||||
<group col="4">
|
||||
<field name="property_account_receivable" domain="[('id', 'child_of', [account_root_id])]"/>
|
||||
|
|
|
@ -127,7 +127,6 @@
|
|||
<field name="view_id" ref="account_journal_bank_view"/>
|
||||
<field name="name">Status</field>
|
||||
<field name="field">state</field>
|
||||
<field eval="True" name="invisible"/>
|
||||
<field eval="19" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col20" model="account.journal.column">
|
||||
|
@ -215,7 +214,6 @@
|
|||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Status</field>
|
||||
<field name="field">state</field>
|
||||
<field eval="True" name="invisible"/>
|
||||
<field eval="19" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col20_multi" model="account.journal.column">
|
||||
|
@ -291,7 +289,6 @@
|
|||
<field name="view_id" ref="account_journal_view"/>
|
||||
<field name="name">Status</field>
|
||||
<field name="field">state</field>
|
||||
<field eval="True" name="invisible"/>
|
||||
<field eval="19" name="sequence"/>
|
||||
</record>
|
||||
|
||||
|
@ -373,7 +370,6 @@
|
|||
<field name="view_id" ref="account_sp_journal_view"/>
|
||||
<field name="name">Status</field>
|
||||
<field name="field">state</field>
|
||||
<field eval="True" name="invisible"/>
|
||||
<field eval="19" name="sequence"/>
|
||||
</record>
|
||||
<record id="sp_journal_col20" model="account.journal.column">
|
||||
|
@ -460,7 +456,6 @@
|
|||
<field name="view_id" ref="account_sp_refund_journal_view"/>
|
||||
<field name="name">Status</field>
|
||||
<field name="field">state</field>
|
||||
<field eval="True" name="invisible"/>
|
||||
<field eval="19" name="sequence"/>
|
||||
</record>
|
||||
<record id="sp_refund_journal_col20" model="account.journal.column">
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<field name="name">Automated Invoice Notification Mail</field>
|
||||
<field name="email_from">${object.user_id.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.partner_id.email or ''}</field>
|
||||
<field name="email_recipients">${object.partner_id.id}</field>
|
||||
<field name="model_id" ref="account.model_account_invoice"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html"><![CDATA[
|
||||
|
|
|
@ -7,20 +7,20 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 5.0.0\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2011-03-17 20:16+0000\n"
|
||||
"PO-Revision-Date: 2012-11-13 15:01+0000\n"
|
||||
"Last-Translator: jpdborgna <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: 2012-10-30 05:06+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-14 04:40+0000\n"
|
||||
"X-Generator: Launchpad (build 16251)\n"
|
||||
|
||||
#. module: account
|
||||
#: view:account.invoice.report:0
|
||||
#: view:analytic.entries.report:0
|
||||
msgid "last month"
|
||||
msgstr ""
|
||||
msgstr "Ultimo mes"
|
||||
|
||||
#. module: account
|
||||
#: model:process.transition,name:account.process_transition_supplierreconcilepaid0
|
||||
|
@ -146,7 +146,7 @@ msgstr "Referencia"
|
|||
#. module: account
|
||||
#: view:account.open.closed.fiscalyear:0
|
||||
msgid "Choose Fiscal Year "
|
||||
msgstr ""
|
||||
msgstr "Seleccione el año fiscal "
|
||||
|
||||
#. module: account
|
||||
#: help:account.payment.term,active:0
|
||||
|
@ -159,7 +159,7 @@ msgstr ""
|
|||
#: code:addons/account/account_invoice.py:1430
|
||||
#, python-format
|
||||
msgid "Warning!"
|
||||
msgstr ""
|
||||
msgstr "¡Advertencia!"
|
||||
|
||||
#. module: account
|
||||
#: code:addons/account/account.py:3129
|
||||
|
@ -187,7 +187,7 @@ msgstr ""
|
|||
#: code:addons/account/wizard/account_move_journal.py:95
|
||||
#, python-format
|
||||
msgid "Journal: %s"
|
||||
msgstr ""
|
||||
msgstr "Diario: %s"
|
||||
|
||||
#. module: account
|
||||
#: help:account.analytic.journal,type:0
|
||||
|
@ -228,6 +228,7 @@ msgstr ""
|
|||
#, python-format
|
||||
msgid "Invoice '%s' is paid partially: %s%s of %s%s (%s%s remaining)"
|
||||
msgstr ""
|
||||
"La factura '%s' está parcialmente pagada: %s%s de %s%s (%s%s pendiente)"
|
||||
|
||||
#. module: account
|
||||
#: model:process.transition,note:account.process_transition_supplierentriesreconcile0
|
||||
|
@ -268,7 +269,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: view:account.fiscalyear.close.state:0
|
||||
msgid "Close Fiscalyear"
|
||||
msgstr ""
|
||||
msgstr "Cerrar ejercicio fiscal"
|
||||
|
||||
#. module: account
|
||||
#: field:account.automatic.reconcile,allow_write_off:0
|
||||
|
@ -335,7 +336,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: view:account.installer:0
|
||||
msgid "Configure"
|
||||
msgstr ""
|
||||
msgstr "Configurar"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.entries.report,month:0
|
||||
|
@ -344,7 +345,7 @@ msgstr ""
|
|||
#: selection:report.account.sales,month:0
|
||||
#: selection:report.account_type.sales,month:0
|
||||
msgid "June"
|
||||
msgstr ""
|
||||
msgstr "Junio"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.act_window,help:account.action_account_moves_bank
|
||||
|
@ -378,12 +379,12 @@ msgstr "Fecha de creación"
|
|||
#. module: account
|
||||
#: selection:account.journal,type:0
|
||||
msgid "Purchase Refund"
|
||||
msgstr ""
|
||||
msgstr "Devolución de compra"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.journal,type:0
|
||||
msgid "Opening/Closing Situation"
|
||||
msgstr ""
|
||||
msgstr "Situación de apertura/cierre"
|
||||
|
||||
#. module: account
|
||||
#: help:account.journal,currency:0
|
||||
|
@ -393,7 +394,7 @@ msgstr "La moneda utilizada para el extracto"
|
|||
#. module: account
|
||||
#: field:account.open.closed.fiscalyear,fyear_id:0
|
||||
msgid "Fiscal Year to Open"
|
||||
msgstr "Año fiscal para abrir"
|
||||
msgstr "Ejercicio fiscal a abrir"
|
||||
|
||||
#. module: account
|
||||
#: help:account.journal,sequence_id:0
|
||||
|
@ -495,7 +496,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: field:account.bank.statement,account_id:0
|
||||
msgid "Account used in this journal"
|
||||
msgstr ""
|
||||
msgstr "Cuenta utilizada en este diario"
|
||||
|
||||
#. module: account
|
||||
#: help:account.aged.trial.balance,chart_account_id:0
|
||||
|
@ -557,7 +558,7 @@ msgstr "Cerrar un año fiscal"
|
|||
#. module: account
|
||||
#: model:process.transition,note:account.process_transition_confirmstatementfromdraft0
|
||||
msgid "The accountant confirms the statement."
|
||||
msgstr ""
|
||||
msgstr "El contador confirma la declaración."
|
||||
|
||||
#. module: account
|
||||
#: report:account.account.balance:0
|
||||
|
@ -8156,7 +8157,7 @@ msgstr ""
|
|||
#: field:account.bank.statement,balance_end_real:0
|
||||
#: field:account.treasury.report,ending_balance:0
|
||||
msgid "Ending Balance"
|
||||
msgstr "Balance final"
|
||||
msgstr "Saldo Final"
|
||||
|
||||
#. module: account
|
||||
#: help:account.move.line,blocked:0
|
||||
|
|
|
@ -7,14 +7,15 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2012-06-20 16:18+0000\n"
|
||||
"Last-Translator: Raphael Collet (OpenERP) <Unknown>\n"
|
||||
"PO-Revision-Date: 2012-10-30 15:48+0000\n"
|
||||
"Last-Translator: Frederic Clementi - Camptocamp.com "
|
||||
"<frederic.clementi@camptocamp.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: 2012-10-30 05:01+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-03 05:03+0000\n"
|
||||
"X-Generator: Launchpad (build 16218)\n"
|
||||
|
||||
#. module: account
|
||||
#: code:addons/account/account_move_line.py:1215
|
||||
|
@ -151,7 +152,7 @@ msgstr "Définition des enfants"
|
|||
#: code:addons/account/account_bank_statement.py:302
|
||||
#, python-format
|
||||
msgid "Journal item \"%s\" is not valid."
|
||||
msgstr "Écriture \"%s\" n'est pas équilibrée"
|
||||
msgstr ""
|
||||
|
||||
#. module: account
|
||||
#: model:ir.model,name:account.model_report_aged_receivable
|
||||
|
@ -1608,10 +1609,9 @@ msgid ""
|
|||
"entry per accounting document: invoice, refund, supplier payment, bank "
|
||||
"statements, etc."
|
||||
msgstr ""
|
||||
"Une pièce comptable est composée de plusieurs écritures comptables, chacune "
|
||||
"étant soit un débit soit un crédit. OpenERP crée automatiquement une pièce "
|
||||
"comptable par document comptable : facture, avoir, paiement de fournisseur, "
|
||||
"relevés bancaires, etc."
|
||||
"Un écriture est composée de plusieurs lignes, chacune étant soit un débit "
|
||||
"soit un crédit. OpenERP crée automatiquement une écriture par document "
|
||||
"comptable : facture, avoir, paiement de fournisseur, relevés bancaires, etc."
|
||||
|
||||
#. module: account
|
||||
#: view:account.entries.report:0
|
||||
|
@ -1703,7 +1703,7 @@ msgstr "Recherche d'un relevé bancaire"
|
|||
#. module: account
|
||||
#: view:account.move.line:0
|
||||
msgid "Unposted Journal Items"
|
||||
msgstr "Pièces non comptabiliisées"
|
||||
msgstr "Ecritures brouillon"
|
||||
|
||||
#. module: account
|
||||
#: view:account.chart.template:0
|
||||
|
@ -2478,8 +2478,6 @@ msgid ""
|
|||
"In order to delete a bank statement, you must first cancel it to delete "
|
||||
"related journal items."
|
||||
msgstr ""
|
||||
"Pour supprimer un relevé bancaire vous devez préalablement supprimer les "
|
||||
"lignes rapprochées."
|
||||
|
||||
#. module: account
|
||||
#: field:account.invoice,payment_term:0
|
||||
|
@ -3629,7 +3627,7 @@ msgstr "État des ventes par type de compte"
|
|||
#. module: account
|
||||
#: view:account.move.line:0
|
||||
msgid "Unreconciled Journal Items"
|
||||
msgstr "Ecritures non lettrées"
|
||||
msgstr "Ecritures non léttrées"
|
||||
|
||||
#. module: account
|
||||
#: sql_constraint:res.currency:0
|
||||
|
@ -3900,7 +3898,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: model:ir.actions.report.xml,name:account.account_account_balance_landscape
|
||||
msgid "Account balance"
|
||||
msgstr "Balance des comptes"
|
||||
msgstr "Balance générale"
|
||||
|
||||
#. module: account
|
||||
#: report:account.invoice:0
|
||||
|
@ -3972,7 +3970,7 @@ msgstr "Nom"
|
|||
#. module: account
|
||||
#: model:ir.model,name:account.model_account_aged_trial_balance
|
||||
msgid "Account Aged Trial balance Report"
|
||||
msgstr "Rapport du solde de la balance agée"
|
||||
msgstr "Balance agée"
|
||||
|
||||
#. module: account
|
||||
#: code:addons/account/account_move_line.py:582
|
||||
|
@ -4181,7 +4179,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: view:account.move.line:0
|
||||
msgid "Posted Journal Items"
|
||||
msgstr "Ecritures saisies"
|
||||
msgstr "Ecritures validées"
|
||||
|
||||
#. module: account
|
||||
#: view:account.tax.template:0
|
||||
|
@ -4244,7 +4242,7 @@ msgstr "Titulaire du compte bancaire"
|
|||
#: model:ir.actions.report.xml,name:account.account_account_balance
|
||||
#: model:ir.ui.menu,name:account.menu_general_Balance_report
|
||||
msgid "Trial Balance"
|
||||
msgstr "Balance des comptes"
|
||||
msgstr "Balance générale"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.model,name:account.model_account_invoice_cancel
|
||||
|
@ -4659,7 +4657,7 @@ msgstr "Sert de compte par défaut pour le crédit"
|
|||
#: view:validate.account.move:0
|
||||
#: view:validate.account.move.lines:0
|
||||
msgid "Post Journal Entries"
|
||||
msgstr "Comptabiliser les pièces comptables dans le journal"
|
||||
msgstr "Valider les écritures"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.invoice,state:0
|
||||
|
@ -4927,7 +4925,7 @@ msgstr ""
|
|||
#: code:addons/account/account.py:923
|
||||
#, python-format
|
||||
msgid "Opening Period"
|
||||
msgstr "Période ouverte"
|
||||
msgstr "Période d'ouverture"
|
||||
|
||||
#. module: account
|
||||
#: view:account.move:0
|
||||
|
@ -5611,7 +5609,7 @@ msgstr "Quantité de produits"
|
|||
#: selection:account.move,state:0
|
||||
#: view:account.move.line:0
|
||||
msgid "Unposted"
|
||||
msgstr "Non comptabilisé"
|
||||
msgstr "Non validée"
|
||||
|
||||
#. module: account
|
||||
#: view:account.change.currency:0
|
||||
|
@ -5823,7 +5821,7 @@ msgstr "Journal d'écriture"
|
|||
#: model:ir.actions.act_window,name:account.action_account_fiscalyear_close
|
||||
#: model:ir.ui.menu,name:account.menu_wizard_fy_close
|
||||
msgid "Generate Opening Entries"
|
||||
msgstr "Générer les écritures d'ouverture"
|
||||
msgstr "Générer l'écriture d'ouverture"
|
||||
|
||||
#. module: account
|
||||
#: code:addons/account/account_move_line.py:775
|
||||
|
@ -7117,7 +7115,7 @@ msgstr "Sélection du journal"
|
|||
#: code:addons/account/account.py:432
|
||||
#, python-format
|
||||
msgid "Opening Balance"
|
||||
msgstr "Solde initial"
|
||||
msgstr ""
|
||||
|
||||
#. module: account
|
||||
#: model:ir.model,name:account.model_account_move_reconcile
|
||||
|
@ -7727,8 +7725,7 @@ msgstr "Signes sur les Rapports"
|
|||
#: code:addons/account/wizard/account_fiscalyear_close.py:88
|
||||
#, python-format
|
||||
msgid "The periods to generate opening entries were not found"
|
||||
msgstr ""
|
||||
"Les périodes pour générer les écritures d'ouverture n'ont pas été trouvées."
|
||||
msgstr "Aucune période d'ouverture trouvée"
|
||||
|
||||
#. module: account
|
||||
#: model:account.account.type,name:account.data_account_type_view
|
||||
|
@ -7822,7 +7819,7 @@ msgstr "Journal des ventes"
|
|||
#: code:addons/account/wizard/account_move_journal.py:104
|
||||
#, python-format
|
||||
msgid "Open Journal Items !"
|
||||
msgstr "Écritures ouvertes !"
|
||||
msgstr ""
|
||||
|
||||
#. module: account
|
||||
#: model:ir.model,name:account.model_account_invoice_tax
|
||||
|
@ -7859,7 +7856,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: view:account.move:0
|
||||
msgid "Unposted Journal Entries"
|
||||
msgstr "Pièces non comptabilisées"
|
||||
msgstr "Ecritures non validées"
|
||||
|
||||
#. module: account
|
||||
#: view:product.product:0
|
||||
|
@ -7976,7 +7973,7 @@ msgstr "Code de la case"
|
|||
#. module: account
|
||||
#: view:validate.account.move:0
|
||||
msgid "Post Journal Entries of a Journal"
|
||||
msgstr "Comptabiliser les pièces comptables d'un journal"
|
||||
msgstr "Valider les écritures"
|
||||
|
||||
#. module: account
|
||||
#: view:product.product:0
|
||||
|
@ -8161,7 +8158,7 @@ msgstr "Ligne de caisse"
|
|||
#: model:ir.actions.report.xml,name:account.account_3rdparty_ledger_other
|
||||
#: model:ir.ui.menu,name:account.menu_account_partner_ledger
|
||||
msgid "Partner Ledger"
|
||||
msgstr "Grand Livre"
|
||||
msgstr "Livre des tiers"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.tax.template,type:0
|
||||
|
@ -8359,7 +8356,7 @@ msgstr ""
|
|||
#: help:account.account,reconcile:0
|
||||
msgid ""
|
||||
"Check this box if this account allows reconciliation of journal items."
|
||||
msgstr "Cochez si le compte autorise le lettrage des pièces."
|
||||
msgstr "Cochez si le compte autorise le lettrage des écritures."
|
||||
|
||||
#. module: account
|
||||
#: help:account.period,state:0
|
||||
|
@ -9220,7 +9217,7 @@ msgstr "inconnu"
|
|||
#: code:addons/account/account.py:3130
|
||||
#, python-format
|
||||
msgid "Opening Entries Journal"
|
||||
msgstr "Journal des écritures d'ouverture"
|
||||
msgstr "Journal d'ouverture"
|
||||
|
||||
#. module: account
|
||||
#: model:process.transition,note:account.process_transition_customerinvoice0
|
||||
|
@ -10006,7 +10003,7 @@ msgstr "Ce compte de tiers remplacera le compte par défaut."
|
|||
#. module: account
|
||||
#: field:account.period,special:0
|
||||
msgid "Opening/Closing Period"
|
||||
msgstr "Ouverture/clôture d'exercice"
|
||||
msgstr "Période d'ouverture/clôture"
|
||||
|
||||
#. module: account
|
||||
#: field:account.account,currency_id:0
|
||||
|
@ -10336,7 +10333,7 @@ msgstr "Date de fin"
|
|||
#: model:ir.actions.act_window,name:account.action_account_open_closed_fiscalyear
|
||||
#: model:ir.ui.menu,name:account.menu_wizard_account_open_closed_fiscalyear
|
||||
msgid "Cancel Opening Entries"
|
||||
msgstr "Annuler les écritures d'ouvertures"
|
||||
msgstr "Annuler l'écriture d'ouverture"
|
||||
|
||||
#. module: account
|
||||
#: field:account.payment.term.line,days2:0
|
||||
|
@ -10505,7 +10502,7 @@ msgstr "Signer pour le parent"
|
|||
#. module: account
|
||||
#: model:ir.model,name:account.model_account_balance_report
|
||||
msgid "Trial Balance Report"
|
||||
msgstr "Rapport sur la balance des comptes"
|
||||
msgstr "Balance générale"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.act_window,name:account.action_bank_statement_draft_tree
|
||||
|
@ -10688,7 +10685,7 @@ msgstr "Intervalle"
|
|||
#. module: account
|
||||
#: view:account.analytic.line:0
|
||||
msgid "Analytic Journal Items related to a purchase journal."
|
||||
msgstr "Imputations analytiques relatives au journal des achats."
|
||||
msgstr "Ecritures analytiques relatives au journal des achats."
|
||||
|
||||
#. module: account
|
||||
#: help:account.account,type:0
|
||||
|
@ -11213,7 +11210,7 @@ msgstr "Future"
|
|||
#. module: account
|
||||
#: view:account.move.line:0
|
||||
msgid "Search Journal Items"
|
||||
msgstr "Rechercher des écritures comptables"
|
||||
msgstr "Recherche par ligne d'écritures"
|
||||
|
||||
#. module: account
|
||||
#: help:account.tax,base_sign:0
|
||||
|
|
|
@ -7,14 +7,14 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2012-10-26 09:03+0000\n"
|
||||
"PO-Revision-Date: 2012-10-31 10:41+0000\n"
|
||||
"Last-Translator: Chertykov Denis <chertykov@gmail.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: 2012-10-30 05:04+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-03 05:03+0000\n"
|
||||
"X-Generator: Launchpad (build 16218)\n"
|
||||
|
||||
#. module: account
|
||||
#: view:account.invoice.report:0
|
||||
|
|
|
@ -7,14 +7,14 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2012-06-20 16:03+0000\n"
|
||||
"Last-Translator: Raphael Collet (OpenERP) <Unknown>\n"
|
||||
"PO-Revision-Date: 2012-11-01 18:30+0000\n"
|
||||
"Last-Translator: Dusan Laznik <laznik@mentis.si>\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: 2012-10-30 05:04+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-03 05:04+0000\n"
|
||||
"X-Generator: Launchpad (build 16218)\n"
|
||||
|
||||
#. module: account
|
||||
#: view:account.invoice.report:0
|
||||
|
@ -1587,7 +1587,7 @@ msgstr "Neobdavčeno"
|
|||
#. module: account
|
||||
#: view:account.partner.reconcile.process:0
|
||||
msgid "Go to Next Partner"
|
||||
msgstr ""
|
||||
msgstr "Naslednji parner"
|
||||
|
||||
#. module: account
|
||||
#: view:account.bank.statement:0
|
||||
|
@ -3150,7 +3150,7 @@ msgstr "Predloge kontnih načrtov"
|
|||
#. module: account
|
||||
#: model:ir.actions.act_window,name:account.action_wizard_multi_chart
|
||||
msgid "Set Your Accounting Options"
|
||||
msgstr ""
|
||||
msgstr "Nastavitve"
|
||||
|
||||
#. module: account
|
||||
#: view:report.account.sales:0
|
||||
|
@ -4358,7 +4358,7 @@ msgstr "res_config_contents"
|
|||
#. module: account
|
||||
#: view:account.unreconcile:0
|
||||
msgid "Unreconciliate Transactions"
|
||||
msgstr ""
|
||||
msgstr "Neusklajene postavke"
|
||||
|
||||
#. module: account
|
||||
#: help:account.chart.template,visible:0
|
||||
|
@ -4558,7 +4558,7 @@ msgstr "Datum dogodka"
|
|||
#. module: account
|
||||
#: view:account.unreconcile.reconcile:0
|
||||
msgid "Unreconciliation Transactions"
|
||||
msgstr ""
|
||||
msgstr "Naknadno odprte postavke"
|
||||
|
||||
#. module: account
|
||||
#: field:account.tax,ref_tax_code_id:0
|
||||
|
@ -6046,7 +6046,7 @@ msgstr "Davek(%)"
|
|||
#. module: account
|
||||
#: view:account.addtmpl.wizard:0
|
||||
msgid "Create an Account Based on this Template"
|
||||
msgstr ""
|
||||
msgstr "Ustvarite konto na osnovi te predloge"
|
||||
|
||||
#. module: account
|
||||
#: view:account.account.type:0
|
||||
|
@ -8827,7 +8827,7 @@ msgstr "Prodaja po vrstah"
|
|||
#. module: account
|
||||
#: view:account.analytic.cost.ledger.journal.report:0
|
||||
msgid "Cost Ledger for Period"
|
||||
msgstr ""
|
||||
msgstr "Stroški za obdobje"
|
||||
|
||||
#. module: account
|
||||
#: help:account.tax,child_depend:0
|
||||
|
@ -10307,7 +10307,7 @@ msgstr "Urejanje vrst dnevnikov."
|
|||
#. module: account
|
||||
#: view:account.payment.term:0
|
||||
msgid "Description on Invoices"
|
||||
msgstr ""
|
||||
msgstr "Opis na računih"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.model,name:account.model_account_analytic_chart
|
||||
|
|
|
@ -7,14 +7,14 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2012-10-25 16:26+0000\n"
|
||||
"Last-Translator: AllanWong <18895563@qq.com>\n"
|
||||
"PO-Revision-Date: 2012-11-01 08:44+0000\n"
|
||||
"Last-Translator: ccdos <ccdos@163.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: 2012-10-30 05:07+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-03 05:04+0000\n"
|
||||
"X-Generator: Launchpad (build 16218)\n"
|
||||
|
||||
#. module: account
|
||||
#: view:account.invoice.report:0
|
||||
|
@ -2330,7 +2330,7 @@ msgstr "筛选"
|
|||
#: selection:report.invoice.created,state:0
|
||||
#, python-format
|
||||
msgid "Open"
|
||||
msgstr "打开"
|
||||
msgstr "待支付"
|
||||
|
||||
#. module: account
|
||||
#: model:process.node,note:account.process_node_draftinvoices0
|
||||
|
@ -4668,7 +4668,7 @@ msgstr "税适用"
|
|||
#: model:ir.ui.menu,name:account.menu_eaction_account_moves_sale
|
||||
#, python-format
|
||||
msgid "Journal Items"
|
||||
msgstr "会计凭证行"
|
||||
msgstr "会计凭证明细"
|
||||
|
||||
#. module: account
|
||||
#: code:addons/account/account.py:1095
|
||||
|
@ -9642,7 +9642,7 @@ msgstr "本报表让您打印或产生一个由所有账簿生成的总账"
|
|||
#: selection:account.account.template,type:0
|
||||
#: selection:account.entries.report,type:0
|
||||
msgid "Regular"
|
||||
msgstr "定期"
|
||||
msgstr "常规科目"
|
||||
|
||||
#. module: account
|
||||
#: view:account.account:0
|
||||
|
@ -10557,7 +10557,7 @@ msgstr "前景"
|
|||
#. module: account
|
||||
#: view:account.move.line:0
|
||||
msgid "Search Journal Items"
|
||||
msgstr "搜索分录"
|
||||
msgstr "搜索会计凭证明细"
|
||||
|
||||
#. module: account
|
||||
#: help:account.tax,base_sign:0
|
||||
|
|
|
@ -209,7 +209,7 @@ class res_partner(osv.osv):
|
|||
relation='account.fiscal.position',
|
||||
string="Fiscal Position",
|
||||
view_load=True,
|
||||
help="The fiscal position will determine taxes and the accounts used for the partner.",
|
||||
help="The fiscal position will determine taxes and accounts used for the partner.",
|
||||
),
|
||||
'property_payment_term': fields.property(
|
||||
'account.payment.term',
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<field name="name">account.fiscal.position.form</field>
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fiscal Position">
|
||||
<form string="Fiscal Position" version="7.0">
|
||||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="active"/>
|
||||
|
@ -114,7 +114,7 @@
|
|||
context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}"
|
||||
src_model="res.partner"
|
||||
view_type="form"
|
||||
view_mode="tree,form,calendar"/>
|
||||
view_mode="tree,form"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -30,14 +30,14 @@ class product_category(osv.osv):
|
|||
relation='account.account',
|
||||
string="Income Account",
|
||||
view_load=True,
|
||||
help="This account will be used for invoices to value sales for the current product category"),
|
||||
help="This account will be used for invoices to value sales."),
|
||||
'property_account_expense_categ': fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Expense Account",
|
||||
view_load=True,
|
||||
help="This account will be used for invoices to value expenses for the current product category"),
|
||||
help="This account will be used for invoices to value expenses."),
|
||||
}
|
||||
product_category()
|
||||
|
||||
|
@ -60,14 +60,14 @@ class product_template(osv.osv):
|
|||
relation='account.account',
|
||||
string="Income Account",
|
||||
view_load=True,
|
||||
help="This account will be used for invoices instead of the default one to value sales for the current product"),
|
||||
help="This account will be used for invoices instead of the default one to value sales for the current product."),
|
||||
'property_account_expense': fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Expense Account",
|
||||
view_load=True,
|
||||
help="This account will be used for invoices instead of the default one to value expenses for the current product"),
|
||||
help="This account will be used for invoices instead of the default one to value expenses for the current product."),
|
||||
}
|
||||
|
||||
product_template()
|
||||
|
|
|
@ -49,9 +49,11 @@
|
|||
<field name="inherit_id" ref="product.product_category_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="/form/sheet//group[@name='account_property']" position="inside">
|
||||
<xpath expr="//group[@name='parent']" position="inside">
|
||||
<group name="account_property" string="Account Properties" colspan="2">
|
||||
<field name="property_account_income_categ" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
<field name="property_account_expense_categ" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
|
|
|
@ -94,8 +94,8 @@
|
|||
<field name="state">open</field>
|
||||
<field name="partner_id" ref="base.res_partner_19"/>
|
||||
</record>
|
||||
<record id="analytic_magasin_bml_1" model="account.analytic.account">
|
||||
<field name="name">Magasin BML 1</field>
|
||||
<record id="analytic_millennium_industries" model="account.analytic.account">
|
||||
<field name="name">Millennium Industries</field>
|
||||
<field name="parent_id" ref="analytic_integration"/>
|
||||
<field name="type">normal</field>
|
||||
<field name="partner_id" ref="base.res_partner_15"/>
|
||||
|
@ -121,8 +121,8 @@
|
|||
<field name="parent_id" ref="analytic_customers"/>
|
||||
<field name="partner_id" ref="base.res_partner_1"/>
|
||||
</record>
|
||||
<record id="analytic_distripc" model="account.analytic.account">
|
||||
<field name="name">DistriPC</field>
|
||||
<record id="analytic_deltapc" model="account.analytic.account">
|
||||
<field name="name">Delta PC</field>
|
||||
<field name="parent_id" ref="analytic_customers"/>
|
||||
<field name="type">normal</field>
|
||||
<field name="partner_id" ref="base.res_partner_4"/>
|
||||
|
@ -145,8 +145,8 @@
|
|||
<field name="partner_id" ref="base.res_partner_17"/>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
<record id="analytic_leclerc" model="account.analytic.account">
|
||||
<field name="name">Leclerc</field>
|
||||
<record id="analytic_luminous_technologies" model="account.analytic.account">
|
||||
<field name="name">Luminous Technologies</field>
|
||||
<field eval="time.strftime('%Y-04-24')" name="date_start"/>
|
||||
<field eval="str(time.localtime()[0] + 1) + '-04-24'" name="date"/>
|
||||
<field name="type">normal</field>
|
||||
|
@ -161,8 +161,8 @@
|
|||
<field name="parent_id" ref="analytic_partners"/>
|
||||
<field name="partner_id" ref="base.res_partner_12"/>
|
||||
</record>
|
||||
<record id="analytic_tiny_at_work" model="account.analytic.account">
|
||||
<field name="name">OpenERP SA AT Work</field>
|
||||
<record id="analytic_think_big_systems" model="account.analytic.account">
|
||||
<field name="name">Think Big Systems</field>
|
||||
<field name="type">normal</field>
|
||||
<field name="parent_id" ref="analytic_partners"/>
|
||||
<field name="partner_id" ref="base.res_partner_18"/>
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
<field name="partner_id"/>
|
||||
<field name="user_id"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Associated Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Parent Account" icon="terp-folder-green" domain="[]" context="{'group_by':'parent_id'}"/>
|
||||
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}" groups="base.group_no_one"/>
|
||||
|
@ -144,8 +143,8 @@
|
|||
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
|
||||
<label for="unit_amount"/>
|
||||
<div>
|
||||
<field name="unit_amount" class="oe_inline"/>
|
||||
<field name="product_uom_id" class="oe_inline"/>
|
||||
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
|
||||
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
|
||||
</div>
|
||||
</group>
|
||||
<group string="General Accounting">
|
||||
|
|
|
@ -170,12 +170,12 @@
|
|||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filters' and get_filter(data) ]]</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filters' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<blockTable colWidths="60.0,60.0" style="Table3">[[ get_filter(data)=='Date' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Start Date</para></td>
|
||||
|
|
|
@ -299,10 +299,10 @@ class general_ledger(report_sxw.rml_parse, common_report_header):
|
|||
|
||||
def _get_sortby(self, data):
|
||||
if self.sortby == 'sort_date':
|
||||
return 'Date'
|
||||
return self._translate('Date')
|
||||
elif self.sortby == 'sort_journal_partner':
|
||||
return 'Journal & Partner'
|
||||
return 'Date'
|
||||
return self._translate('Journal & Partner')
|
||||
return self._translate('Date')
|
||||
|
||||
report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/account_general_ledger.rml', parser=general_ledger, header='internal')
|
||||
report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/account_general_ledger_landscape.rml', parser=general_ledger, header='internal landscape')
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<graph string="Invoices Analysis" type="bar">
|
||||
<field name="product_id"/>
|
||||
<field name="user_currency_price_total"/>
|
||||
<field name="price_total"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -277,7 +277,7 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('section')]]There is nothing due with this customer</para>
|
||||
<para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('section')]]There is nothing due with this customer.</para>
|
||||
</section>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
|
|
|
@ -94,10 +94,10 @@ class common_report_header(object):
|
|||
def _get_filter(self, data):
|
||||
if data.get('form', False) and data['form'].get('filter', False):
|
||||
if data['form']['filter'] == 'filter_date':
|
||||
return 'Date'
|
||||
return self._translate('Date')
|
||||
elif data['form']['filter'] == 'filter_period':
|
||||
return 'Periods'
|
||||
return 'No Filter'
|
||||
return self._translate('Periods')
|
||||
return self._translate('No Filters')
|
||||
|
||||
def _sum_debit_period(self, period_id, journal_id=None):
|
||||
journals = journal_id or self.journal_ids
|
||||
|
|
|
@ -262,6 +262,7 @@ class account_config_settings(osv.osv_memory):
|
|||
'sale_tax_rate': config.sale_tax_rate,
|
||||
'purchase_tax_rate': config.purchase_tax_rate,
|
||||
'complete_tax_set': config.complete_tax_set,
|
||||
'currency_id': config.currency_id.id,
|
||||
}, context)
|
||||
wizard.execute(cr, uid, [wizard_id], context)
|
||||
|
||||
|
|
|
@ -268,7 +268,7 @@
|
|||
<field name="target">inline</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_account_config" name="Accounting" parent="base.menu_config"
|
||||
<menuitem id="menu_account_config" name="Invoicing" parent="base.menu_config"
|
||||
sequence="14" action="action_account_config"/>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -48,7 +48,7 @@ openerp.account = function (instance) {
|
|||
this.last_group_by = group_by;
|
||||
this.old_search = _.bind(this._super, this);
|
||||
var mod = new instance.web.Model("account.move.line", context, domain);
|
||||
return mod.call("list_partners_to_reconcile", []).pipe(function(result) {
|
||||
return mod.call("list_partners_to_reconcile", []).then(function(result) {
|
||||
var current = self.current_partner !== null ? self.partners[self.current_partner][0] : null;
|
||||
self.partners = result;
|
||||
var index = _.find(_.range(self.partners.length), function(el) {
|
||||
|
@ -74,7 +74,7 @@ openerp.account = function (instance) {
|
|||
return fct();
|
||||
} else {
|
||||
return new instance.web.Model("res.partner").call("read",
|
||||
[self.partners[self.current_partner][0], ["last_reconciliation_date"]]).pipe(function(res) {
|
||||
[self.partners[self.current_partner][0], ["last_reconciliation_date"]]).then(function(res) {
|
||||
self.last_reconciliation_date =
|
||||
instance.web.format_value(res.last_reconciliation_date, {"type": "datetime"}, _t("Never"));
|
||||
return fct();
|
||||
|
@ -92,7 +92,7 @@ openerp.account = function (instance) {
|
|||
return false;
|
||||
}
|
||||
|
||||
new instance.web.Model("ir.model.data").call("get_object_reference", ["account", "action_view_account_move_line_reconcile"]).pipe(function(result) {
|
||||
new instance.web.Model("ir.model.data").call("get_object_reference", ["account", "action_view_account_move_line_reconcile"]).then(function(result) {
|
||||
var additional_context = _.extend({
|
||||
active_id: ids[0],
|
||||
active_ids: ids,
|
||||
|
@ -101,7 +101,7 @@ openerp.account = function (instance) {
|
|||
return self.rpc("/web/action/load", {
|
||||
action_id: result[1],
|
||||
context: additional_context
|
||||
}).then(function (result) {
|
||||
}).done(function (result) {
|
||||
result.context = _.extend(result.context || {}, additional_context);
|
||||
result.flags = result.flags || {};
|
||||
result.flags.new_window = true;
|
||||
|
@ -116,7 +116,7 @@ openerp.account = function (instance) {
|
|||
mark_as_reconciled: function() {
|
||||
var self = this;
|
||||
var id = self.partners[self.current_partner][0];
|
||||
new instance.web.Model("res.partner").call("mark_as_reconciled", [[id]]).pipe(function() {
|
||||
new instance.web.Model("res.partner").call("mark_as_reconciled", [[id]]).then(function() {
|
||||
self.do_search(self.last_domain, self.last_context, self.last_group_by);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
@ -40,7 +39,6 @@
|
|||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'), 'account_report_id': ref('account_financial_report_balancesheet0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
@ -49,7 +47,6 @@
|
|||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_balance_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
@ -60,7 +57,6 @@
|
|||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
|
||||
ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_central_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
@ -71,7 +67,6 @@
|
|||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
|
||||
ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_general_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
@ -80,7 +75,6 @@
|
|||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'landscape':False}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
@ -89,7 +83,6 @@
|
|||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
@ -99,7 +92,6 @@
|
|||
!python {model: account.journal.period}: |
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'), 'period_from':ref('period_1'), 'period_to':ref('period_12')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_print_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
@ -109,7 +101,6 @@
|
|||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_partner_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
|
@ -118,7 +109,6 @@
|
|||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'page_split': True}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
|
@ -127,7 +117,6 @@
|
|||
!python {model: res.partner}: |
|
||||
ctx={}
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'page_split': False}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
|
@ -135,7 +124,6 @@
|
|||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
from . import test_tax
|
||||
|
||||
fast_suite = [test_tax,
|
||||
]
|
|
@ -0,0 +1,49 @@
|
|||
from openerp.tests.common import TransactionCase
|
||||
|
||||
class TestTax(TransactionCase):
|
||||
"""Tests for taxes (account.tax)
|
||||
|
||||
We don't really need at this point to link taxes to tax codes
|
||||
(account.tax.code) nor to companies (base.company) to check computation
|
||||
results.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
super(TestTax, self).setUp()
|
||||
self.tax_model = self.registry('account.tax')
|
||||
|
||||
def test_programmatic_tax(self):
|
||||
cr, uid = self.cr, self.uid
|
||||
tax_id = self.tax_model.create(cr, uid, dict(
|
||||
name="Programmatic tax",
|
||||
type='code',
|
||||
python_compute='result = 12.0',
|
||||
python_compute_inv='result = 11.0',
|
||||
))
|
||||
|
||||
tax_records = self.tax_model.browse(cr, uid, [tax_id])
|
||||
res = self.tax_model.compute_all(cr, uid, tax_records, 50.0, 2)
|
||||
|
||||
tax_detail = res['taxes'][0]
|
||||
self.assertEquals(tax_detail['amount'], 24.0)
|
||||
self.assertEquals(res['total_included'], 124.0)
|
||||
|
||||
def test_percent_tax(self):
|
||||
"""Test computations done by a 10 percent tax."""
|
||||
cr, uid = self.cr, self.uid
|
||||
tax_id = self.tax_model.create(cr, uid, dict(
|
||||
name="Percent tax",
|
||||
type='percent',
|
||||
amount='0.1',
|
||||
))
|
||||
|
||||
tax_records = self.tax_model.browse(cr, uid, [tax_id])
|
||||
res = self.tax_model.compute_all(cr, uid, tax_records, 50.0, 2)
|
||||
|
||||
tax_detail = res['taxes'][0]
|
||||
self.assertEquals(tax_detail['amount'], 10.0)
|
||||
self.assertEquals(res['total_included'], 110.0)
|
||||
|
||||
# now the inverse computation
|
||||
res = self.tax_model.compute_inv(cr, uid, tax_records, 55.0, 2)
|
||||
self.assertEquals(res[0]['amount'], 10.0)
|
|
@ -14,15 +14,19 @@
|
|||
</xpath>
|
||||
<xpath expr="//notebook/page[@string='Filters']" position="after">
|
||||
<page string="Comparison" attrs="{'invisible': [('enable_filter','=',False)]}">
|
||||
<group>
|
||||
<field name="label_filter" attrs="{'required': [('enable_filter', '=', True)]}"/>
|
||||
<field name="fiscalyear_id_cmp"/><newline/>
|
||||
<field name="filter_cmp"/>
|
||||
<separator string="Dates" colspan="4"/>
|
||||
<field name="date_from_cmp" attrs="{'readonly':[('filter_cmp', '!=', 'filter_date')], 'required':[('filter_cmp', '=', 'filter_date')]}" colspan="4"/>
|
||||
<field name="date_to_cmp" attrs="{'readonly':[('filter_cmp', '!=', 'filter_date')], 'required':[('filter_cmp', '=', 'filter_date')]}" colspan="4"/>
|
||||
<separator string="Periods" colspan="4"/>
|
||||
<field name="period_from_cmp" domain="[('fiscalyear_id', '=', fiscalyear_id_cmp)]" attrs="{'readonly':[('filter_cmp','!=','filter_period')], 'required':[('filter_cmp', '=', 'filter_period')]}" colspan="4"/>
|
||||
<field name="period_to_cmp" domain="[('fiscalyear_id', '=', fiscalyear_id_cmp)]" attrs="{'readonly':[('filter_cmp','!=','filter_period')], 'required':[('filter_cmp', '=', 'filter_period')]}" colspan="4"/>
|
||||
</group>
|
||||
<group string="Dates" attrs="{'invisible':[('filter_cmp', '!=', 'filter_date')]}">
|
||||
<field name="date_from_cmp" attrs="{'required':[('filter_cmp', '=', 'filter_date')]}"/>
|
||||
<field name="date_to_cmp" attrs="{'required':[('filter_cmp', '=', 'filter_date')]}"/>
|
||||
</group>
|
||||
<group string="Periods" attrs="{'invisible':[('filter_cmp', '!=', 'filter_period')]}">
|
||||
<field name="period_from_cmp" domain="[('fiscalyear_id', '=', fiscalyear_id_cmp)]" attrs="{'required':[('filter_cmp', '=', 'filter_period')]}"/>
|
||||
<field name="period_to_cmp" domain="[('fiscalyear_id', '=', fiscalyear_id_cmp)]" attrs="{'required':[('filter_cmp', '=', 'filter_period')]}"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//notebook/page[@string='Journals']" position="replace">
|
||||
|
|
|
@ -226,7 +226,7 @@ class account_fiscalyear_close(osv.osv_memory):
|
|||
for account in obj_acc_account.browse(cr, uid, account_ids, context={'fiscalyear': fy_id}):
|
||||
balance_in_currency = 0.0
|
||||
if account.currency_id:
|
||||
cr.execute('SELECT sum(amount_currency) as balance_in_currency FROM account_move_line ' \
|
||||
cr.execute('SELECT sum(COALESCE(amount_currency,0.0)) as balance_in_currency FROM account_move_line ' \
|
||||
'WHERE account_id = %s ' \
|
||||
'AND ' + query_line + ' ' \
|
||||
'AND currency_id = %s', (account.id, account.currency_id.id))
|
||||
|
|
|
@ -27,7 +27,7 @@ class account_open_closed_fiscalyear(osv.osv_memory):
|
|||
_description = "Choose Fiscal Year"
|
||||
_columns = {
|
||||
'fyear_id': fields.many2one('account.fiscalyear', \
|
||||
'Fiscal Year to Open', required=True, help='Select Fiscal Year which you want to remove entries for its End of year entries journal'),
|
||||
'Fiscal Year', required=True, help='Select Fiscal Year which you want to remove entries for its End of year entries journal'),
|
||||
}
|
||||
|
||||
def remove_entries(self, cr, uid, ids, context=None):
|
||||
|
@ -36,7 +36,7 @@ class account_open_closed_fiscalyear(osv.osv_memory):
|
|||
data = self.browse(cr, uid, ids, context=context)[0]
|
||||
period_journal = data.fyear_id.end_journal_period_id or False
|
||||
if not period_journal:
|
||||
raise osv.except_osv(_('Error!'), _('You have to set the end of the fiscal year for this journal.'))
|
||||
raise osv.except_osv(_('Error!'), _("You have to set the 'End of Year Entries Journal' for this Fiscal Year which is set after generating opening entries from 'Generate Opening Entries'."))
|
||||
|
||||
ids_move = move_obj.search(cr, uid, [('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
|
||||
if ids_move:
|
||||
|
|
|
@ -5,14 +5,18 @@
|
|||
<field name="name">account.open.closed.fiscalyear.form</field>
|
||||
<field name="model">account.open.closed.fiscalyear</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Choose Fiscal Year " version="7.0">
|
||||
<form string="Cancel Fiscal Year Opening Entries" version="7.0">
|
||||
<separator string="Cancel Fiscal Year Opening Entries"/>
|
||||
<p class="oe_grey">
|
||||
This wizard will remove the end of year journal entries of selected fiscal year. Note that you can run this wizard many times for the same fiscal year.
|
||||
</p>
|
||||
<group>
|
||||
<field name="fyear_id" domain="[('state','=','draft')]"/>
|
||||
<field name="fyear_id" domain="[('state','=','draft'), ('end_journal_period_id', '!=', False)]"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Open" name="remove_entries" type="object" class="oe_highlight"/>
|
||||
<button string="Cancel Opening Entries" name="remove_entries" type="object" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel"/>
|
||||
<button string="Discard" class="oe_link" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
<field name="inherit_id" ref="account_common_report_view" />
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='journal_ids']" position="replace">
|
||||
<field name="journal_ids" colspan="4" nolabel="1" required="0" readonly="1"/>
|
||||
<xpath expr="//notebook/page[@string='Journals']" position="replace">
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="display_account"/>
|
||||
|
|
|
@ -119,7 +119,11 @@ class account_common_report(osv.osv_memory):
|
|||
|
||||
def _get_fiscalyear(self, cr, uid, context=None):
|
||||
now = time.strftime('%Y-%m-%d')
|
||||
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 )
|
||||
company_id = False
|
||||
ids = context.get('active_ids', [])
|
||||
if ids:
|
||||
company_id = self.browse(cr, uid, ids[0], context=context).company_id.id
|
||||
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now), ('company_id', '=', company_id)], limit=1)
|
||||
return fiscalyears and fiscalyears[0] or False
|
||||
|
||||
def _get_all_journal(self, cr, uid, context=None):
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<!-- Top menu item -->
|
||||
<menuitem name="Accounting"
|
||||
id="account.menu_finance"/>
|
||||
<menuitem id="account.menu_account_config" name="Accounting" parent="base.menu_config"/>
|
||||
|
||||
</data>
|
||||
|
||||
|
@ -25,12 +26,10 @@
|
|||
<field name="model">mail.group</field>
|
||||
<field name="res_id" ref="mail.group_all_employees"/>
|
||||
<field name="type">notification</field>
|
||||
<field name="subtype_id" ref="mail.mt_comment"/>
|
||||
<field name="subject">Accounting and Finance application installed!</field>
|
||||
<field name="body"><![CDATA[
|
||||
With OpenERP's accounting, you get instant access to your financial data, and can setup analytic accounting, forecast taxes, control budgets, easily create and send invoices, record bank statements, etc.
|
||||
|
||||
<p>The accounting features are fully integrated with other OpenERP applications to automate all your processes: creation of customer invoices, control of supplier invoices, point-of-sale integration, automated follow-ups, etc.</p>
|
||||
]]></field>
|
||||
<field name="body"><![CDATA[<p>With OpenERP's accounting, you get instant access to your financial data, and can setup analytic accounting, forecast taxes, control budgets, easily create and send invoices, record bank statements, etc.</p>
|
||||
<p>The accounting features are fully integrated with other OpenERP applications to automate all your processes: creation of customer invoices, control of supplier invoices, point-of-sale integration, automated follow-ups, etc.</p>]]></field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -3,13 +3,21 @@
|
|||
<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">Time & Costs to Invoice</field>
|
||||
<field name="name">Time & Materials to Invoice</field>
|
||||
<field name="res_model">account.analytic.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('invoice_id','=',False)]</field>
|
||||
<field name="context">{'search_default_to_invoice': 1}</field>
|
||||
<field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
|
||||
<field name="help" type="html">
|
||||
<p>
|
||||
You will find here timesheets and purchases you did for
|
||||
contracts that can be reinvoiced to the customer. If you want
|
||||
to record new activities to invoice, you should use the timesheet
|
||||
menu instead.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="base.menu_invoiced" sequence="5"/>
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ Allows to automatically select analytic accounts based on criterions:
|
|||
'author': 'OpenERP SA',
|
||||
'website': 'http://www.openerp.com',
|
||||
'images': ['images/analytic_defaults.jpeg'],
|
||||
'depends': ['sale'],
|
||||
'depends': ['sale_stock'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'security/account_analytic_default_security.xml',
|
||||
|
|
|
@ -21,17 +21,17 @@
|
|||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/sheet/notebook/page/field[@name='line_id']/tree/field[@name='analytic_account_id']" position="replace">
|
||||
<field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/sheet/notebook/page/field[@name='line_id']/form/notebook/page/group/group/field[@name='analytic_account_id']" position="replace">
|
||||
<field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="journal_col11" model="account.journal.column">
|
||||
<field eval=""""Analytic Distribution"""" name="name"/>
|
||||
<field eval="11" name="sequence"/>
|
||||
<field eval="15" name="sequence"/>
|
||||
<field name="view_id" ref="account.account_journal_view"/>
|
||||
<field eval="0" name="required"/>
|
||||
<field eval=""""analytics_id"""" name="field"/>
|
||||
|
|
|
@ -40,7 +40,7 @@ class account_invoice_line(osv.osv):
|
|||
|
||||
if inv.type in ('out_invoice','out_refund'):
|
||||
for i_line in inv.invoice_line:
|
||||
if i_line.product_id:
|
||||
if i_line.product_id and i_line.product_id.valuation == 'real_time':
|
||||
if inv.type == 'out_invoice':
|
||||
# debit account dacc will be the output account
|
||||
# first check the product, if empty check the category
|
||||
|
@ -87,7 +87,7 @@ class account_invoice_line(osv.osv):
|
|||
})
|
||||
elif inv.type in ('in_invoice','in_refund'):
|
||||
for i_line in inv.invoice_line:
|
||||
if i_line.product_id:
|
||||
if i_line.product_id and i_line.product_id.valuation == 'real_time':
|
||||
if i_line.product_id.type != 'service':
|
||||
# get the price difference account at the product
|
||||
acc = i_line.product_id.property_account_creditor_price_difference and i_line.product_id.property_account_creditor_price_difference.id
|
||||
|
|
|
@ -38,14 +38,14 @@ class product_category(osv.osv):
|
|||
relation='account.account',
|
||||
string="Income Account",
|
||||
view_load=True,
|
||||
help="This account will be used to value outgoing stock for the current product category using sale price"),
|
||||
help="This account will be used to value outgoing stock using sale price."),
|
||||
'property_account_expense_categ': fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Expense Account",
|
||||
view_load=True,
|
||||
help="This account will be used to value outgoing stock for the current product category using cost price"),
|
||||
help="This account will be used to value outgoing stock using cost price."),
|
||||
|
||||
}
|
||||
product_category()
|
||||
|
@ -68,14 +68,14 @@ class product_template(osv.osv):
|
|||
relation='account.account',
|
||||
string="Income Account",
|
||||
view_load=True,
|
||||
help="This account will be used to value outgoing stock for the current product category using sale price"),
|
||||
help="This account will be used to value outgoing stock using sale price."),
|
||||
'property_account_expense': fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Expense Account",
|
||||
view_load=True,
|
||||
help="This account will be used to value outgoing stock for the current product category using cost price"),
|
||||
help="This account will be used to value outgoing stock using cost price."),
|
||||
|
||||
}
|
||||
product_template()
|
||||
|
|
|
@ -29,10 +29,10 @@
|
|||
<record id="view_category_property_form" model="ir.ui.view">
|
||||
<field name="name">product.category.property.form.inherit.stock</field>
|
||||
<field name="model">product.category</field>
|
||||
<field name="inherit_id" ref="product.product_category_form_view"/>
|
||||
<field name="inherit_id" ref="account.view_category_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="/form/sheet//group[@name='account_property']" position="inside">
|
||||
<xpath expr="//field[@name='property_account_income_categ']" position="before">
|
||||
<field name="property_account_creditor_price_difference_categ" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
|
|
@ -134,10 +134,11 @@ class account_asset_asset(osv.osv):
|
|||
|
||||
def compute_depreciation_board(self, cr, uid, ids, context=None):
|
||||
depreciation_lin_obj = self.pool.get('account.asset.depreciation.line')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
for asset in self.browse(cr, uid, ids, context=context):
|
||||
if asset.value_residual == 0.0:
|
||||
continue
|
||||
posted_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_check', '=', True)])
|
||||
posted_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_check', '=', True)],order='depreciation_date desc')
|
||||
old_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_id', '=', False)])
|
||||
if old_depreciation_line_ids:
|
||||
depreciation_lin_obj.unlink(cr, uid, old_depreciation_line_ids, context=context)
|
||||
|
@ -148,6 +149,11 @@ class account_asset_asset(osv.osv):
|
|||
else:
|
||||
# depreciation_date = 1st January of purchase year
|
||||
purchase_date = datetime.strptime(asset.purchase_date, '%Y-%m-%d')
|
||||
#if we already have some previous validated entries, starting date isn't 1st January but last entry + method period
|
||||
if (len(posted_depreciation_line_ids)>0):
|
||||
last_depreciation_date = datetime.strptime(depreciation_lin_obj.browse(cr,uid,posted_depreciation_line_ids[0],context=context).depreciation_date, '%Y-%m-%d')
|
||||
depreciation_date = (last_depreciation_date+relativedelta(months=+asset.method_period))
|
||||
else:
|
||||
depreciation_date = datetime(purchase_date.year, 1, 1)
|
||||
day = depreciation_date.day
|
||||
month = depreciation_date.month
|
||||
|
@ -158,6 +164,10 @@ class account_asset_asset(osv.osv):
|
|||
for x in range(len(posted_depreciation_line_ids), undone_dotation_number):
|
||||
i = x + 1
|
||||
amount = self._compute_board_amount(cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=context)
|
||||
company_currency = asset.company_id.currency_id.id
|
||||
current_currency = asset.currency_id.id
|
||||
# compute amount into company currency
|
||||
amount = currency_obj.compute(cr, uid, current_currency, company_currency, amount, context=context)
|
||||
residual_amount -= amount
|
||||
vals = {
|
||||
'amount': amount,
|
||||
|
@ -191,7 +201,7 @@ class account_asset_asset(osv.osv):
|
|||
|
||||
def _amount_residual(self, cr, uid, ids, name, args, context=None):
|
||||
cr.execute("""SELECT
|
||||
l.asset_id as id, round(SUM(abs(l.debit-l.credit))) AS amount
|
||||
l.asset_id as id, SUM(abs(l.debit-l.credit)) AS amount
|
||||
FROM
|
||||
account_move_line l
|
||||
WHERE
|
||||
|
@ -349,8 +359,8 @@ class account_asset_depreciation_line(osv.osv):
|
|||
'sequence': fields.integer('Sequence', required=True),
|
||||
'asset_id': fields.many2one('account.asset.asset', 'Asset', required=True),
|
||||
'parent_state': fields.related('asset_id', 'state', type='char', string='State of Asset'),
|
||||
'amount': fields.float('Depreciation Amount', required=True),
|
||||
'remaining_value': fields.float('Amount to Depreciate', required=True),
|
||||
'amount': fields.float('Depreciation Amount', digits_compute=dp.get_precision('Account'), required=True),
|
||||
'remaining_value': fields.float('Amount to Depreciate', digits_compute=dp.get_precision('Account'),required=True),
|
||||
'depreciated_value': fields.float('Amount Already Depreciated', required=True),
|
||||
'depreciation_date': fields.date('Depreciation Date', select=1),
|
||||
'move_id': fields.many2one('account.move', 'Depreciation Entry'),
|
||||
|
@ -367,16 +377,15 @@ class account_asset_depreciation_line(osv.osv):
|
|||
move_line_obj = self.pool.get('account.move.line')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
created_move_ids = []
|
||||
asset_ids = []
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
if currency_obj.is_zero(cr, uid, line.asset_id.currency_id, line.remaining_value):
|
||||
can_close = True
|
||||
depreciation_date = time.strftime('%Y-%m-%d')
|
||||
period_ids = period_obj.find(cr, uid, depreciation_date, context=context)
|
||||
company_currency = line.asset_id.company_id.currency_id.id
|
||||
current_currency = line.asset_id.currency_id.id
|
||||
context.update({'date': depreciation_date})
|
||||
amount = currency_obj.compute(cr, uid, current_currency, company_currency, line.amount, context=context)
|
||||
sign = line.asset_id.category_id.journal_id.type = 'purchase' and 1 or -1
|
||||
sign = (line.asset_id.category_id.journal_id.type == 'purchase' and 1) or -1
|
||||
asset_name = line.asset_id.name
|
||||
reference = line.name
|
||||
move_vals = {
|
||||
|
@ -399,8 +408,8 @@ class account_asset_depreciation_line(osv.osv):
|
|||
'period_id': period_ids and period_ids[0] or False,
|
||||
'journal_id': journal_id,
|
||||
'partner_id': partner_id,
|
||||
'currency_id': company_currency <> current_currency and current_currency or False,
|
||||
'amount_currency': company_currency <> current_currency and - sign * line.amount or 0.0,
|
||||
'currency_id': company_currency != current_currency and current_currency or False,
|
||||
'amount_currency': company_currency != current_currency and - sign * line.amount or 0.0,
|
||||
'date': depreciation_date,
|
||||
})
|
||||
move_line_obj.create(cr, uid, {
|
||||
|
@ -413,16 +422,19 @@ class account_asset_depreciation_line(osv.osv):
|
|||
'period_id': period_ids and period_ids[0] or False,
|
||||
'journal_id': journal_id,
|
||||
'partner_id': partner_id,
|
||||
'currency_id': company_currency <> current_currency and current_currency or False,
|
||||
'amount_currency': company_currency <> current_currency and sign * line.amount or 0.0,
|
||||
'currency_id': company_currency != current_currency and current_currency or False,
|
||||
'amount_currency': company_currency != current_currency and sign * line.amount or 0.0,
|
||||
'analytic_account_id': line.asset_id.category_id.account_analytic_id.id,
|
||||
'date': depreciation_date,
|
||||
'asset_id': line.asset_id.id
|
||||
})
|
||||
self.write(cr, uid, line.id, {'move_id': move_id}, context=context)
|
||||
created_move_ids.append(move_id)
|
||||
if can_close:
|
||||
asset_obj.write(cr, uid, [line.asset_id.id], {'state': 'close'}, context=context)
|
||||
asset_ids.append(line.asset_id.id)
|
||||
# we re-evaluate the assets to determine whether we can close them
|
||||
for asset in asset_obj.browse(cr, uid, list(set(asset_ids)), context=context):
|
||||
if currency_obj.is_zero(cr, uid, asset.currency_id, asset.value_residual):
|
||||
asset.write({'state': 'close'})
|
||||
return created_move_ids
|
||||
|
||||
account_asset_depreciation_line()
|
||||
|
|
|
@ -105,8 +105,7 @@ account_bank_statement_line_global()
|
|||
class account_bank_statement_line(osv.osv):
|
||||
_inherit = 'account.bank.statement.line'
|
||||
_columns = {
|
||||
'date': fields.date('Entry Date', required=True, states={'confirm': [('readonly', True)]}),
|
||||
'val_date': fields.date('Valuta Date', states={'confirm': [('readonly', True)]}),
|
||||
'val_date': fields.date('Value Date', states={'confirm': [('readonly', True)]}),
|
||||
'globalisation_id': fields.many2one('account.bank.statement.line.global', 'Globalisation ID',
|
||||
states={'confirm': [('readonly', True)]},
|
||||
help="Code to identify transactions belonging to the same globalisation level within a batch payment"),
|
||||
|
|
|
@ -72,12 +72,12 @@
|
|||
<field name="date" readonly="1"/>
|
||||
<field name="val_date" readonly="1"/>
|
||||
<field name="name"/>
|
||||
<field name="statement_id" readonly="1"/>
|
||||
<field name="statement_id"/>
|
||||
<field name="ref" readonly="1"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field name="account_id" domain="[('journal_id','=',journal_id)]"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/>
|
||||
<field name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('type', '<>', 'view')]"/>
|
||||
<field name="amount" readonly="1" sum="Total Amount"/>
|
||||
<field name="globalisation_id" string="Glob. Id"/>
|
||||
<field name="globalisation_amount" string="Glob. Am."/>
|
||||
|
@ -100,8 +100,8 @@
|
|||
<field name="ref" readonly="0"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id', '=', journal_id), ('type', '<>', 'view')]" name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/>
|
||||
<field domain="[('type', '<>', 'view')]" name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('type', '<>', 'view')]"/>
|
||||
<field name="amount"/>
|
||||
<field name="globalisation_id"/>
|
||||
<field name="sequence" readonly="0"/>
|
||||
|
@ -148,7 +148,7 @@
|
|||
<field name="name">Bank Statement Lines</field>
|
||||
<field name="res_model">account.bank.statement.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph,form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'block_statement_line_delete' : 1}</field>
|
||||
<field name="search_view_id" ref="view_bank_statement_line_filter"/>
|
||||
<field name="view_id" ref="view_bank_statement_line_list"/>
|
||||
|
|
|
@ -221,6 +221,16 @@
|
|||
id="menu_act_crossovered_budget_view"
|
||||
action="act_crossovered_budget_view" sequence="1" />
|
||||
|
||||
<record id="view_crossovered_budget_line_search" model="ir.ui.view">
|
||||
<field name="name">account.budget.line.search</field>
|
||||
<field name="model">crossovered.budget.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Budget Lines">
|
||||
<field name="analytic_account_id"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_crossovered_budget_line_tree">
|
||||
<field name="name">crossovered.budget.line.tree</field>
|
||||
<field name="model">crossovered.budget.lines</field>
|
||||
|
@ -284,13 +294,13 @@
|
|||
|
||||
|
||||
<record model="ir.ui.view" id="view_account_analytic_account_form_inherit_budget">
|
||||
<field name="name">account.analytic.account.form.inherot.budget</field>
|
||||
<field name="name">account.analytic.account.form.inherit.budget</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="Budget Lines" groups="account.group_account_user">
|
||||
<field name="crossovered_budget_line" widget="one2many_list" colspan="4" nolabel="1" mode="tree,graph">
|
||||
<field name="crossovered_budget_line" widget="one2many_list" colspan="4" nolabel="1" mode="tree">
|
||||
<tree string="Budget Lines" editable="top">
|
||||
<field name="crossovered_budget_id"/>
|
||||
<field name="general_budget_id"/>
|
||||
|
@ -310,11 +320,6 @@
|
|||
<field name="paid_date"/>
|
||||
<field name="planned_amount"/>
|
||||
</form>
|
||||
<graph type="bar" string="Lines">
|
||||
<field name="general_budget_id" />
|
||||
<field name="planned_amount" operator="+"/>
|
||||
<field group="True" name="analytic_account_id"/>
|
||||
</graph>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
|
|
|
@ -8,14 +8,14 @@ msgstr ""
|
|||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2012-02-09 19:28+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"PO-Revision-Date: 2012-11-09 12:09+0000\n"
|
||||
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
|
||||
"Language-Team: Spanish <es@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: 2012-10-30 05:36+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-10 04:59+0000\n"
|
||||
"X-Generator: Launchpad (build 16251)\n"
|
||||
|
||||
#. module: account_check_writing
|
||||
#: selection:res.company,check_layout:0
|
||||
|
@ -154,7 +154,7 @@ msgstr "Compañías"
|
|||
#. module: account_check_writing
|
||||
#: view:res.company:0
|
||||
msgid "Default Check Layout"
|
||||
msgstr ""
|
||||
msgstr "Comprobar formato por defecto"
|
||||
|
||||
#. module: account_check_writing
|
||||
#: constraint:account.journal:0
|
||||
|
|
|
@ -0,0 +1,199 @@
|
|||
# Lithuanian translation for openobject-addons
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2012-11-16 06:33+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Lithuanian <lt@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: 2012-11-17 04:37+0000\n"
|
||||
"X-Generator: Launchpad (build 16278)\n"
|
||||
|
||||
#. module: account_check_writing
|
||||
#: selection:res.company,check_layout:0
|
||||
msgid "Check on Top"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: model:ir.actions.act_window,help:account_check_writing.action_write_check
|
||||
msgid ""
|
||||
"The check payment form allows you to track the payment you do to your "
|
||||
"suppliers specially by check. When you select a supplier, the payment method "
|
||||
"and an amount for the payment, OpenERP will propose to reconcile your "
|
||||
"payment with the open supplier invoices or bills.You can print the check"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: view:account.voucher:0
|
||||
#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_bottom
|
||||
#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_middle
|
||||
#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_top
|
||||
msgid "Print Check"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: selection:res.company,check_layout:0
|
||||
msgid "Check in middle"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: help:res.company,check_layout:0
|
||||
msgid ""
|
||||
"Check on top is compatible with Quicken, QuickBooks and Microsoft Money. "
|
||||
"Check in middle is compatible with Peachtree, ACCPAC and DacEasy. Check on "
|
||||
"bottom is compatible with Peachtree, ACCPAC and DacEasy only"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: selection:res.company,check_layout:0
|
||||
msgid "Check on bottom"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: constraint:res.company:0
|
||||
msgid "Error! You can not create recursive companies."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: help:account.journal,allow_check_writing:0
|
||||
msgid "Check this if the journal is to be used for writing checks."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: field:account.journal,allow_check_writing:0
|
||||
msgid "Allow Check writing"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Description"
|
||||
msgstr "Aprašas"
|
||||
|
||||
#. module: account_check_writing
|
||||
#: model:ir.model,name:account_check_writing.model_account_journal
|
||||
msgid "Journal"
|
||||
msgstr "Žurnalas"
|
||||
|
||||
#. module: account_check_writing
|
||||
#: model:ir.actions.act_window,name:account_check_writing.action_write_check
|
||||
#: model:ir.ui.menu,name:account_check_writing.menu_action_write_check
|
||||
msgid "Write Checks"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Discount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Original Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: view:res.company:0
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: field:account.voucher,allow_check:0
|
||||
msgid "Allow Check Writing"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Payment"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: field:account.journal,use_preprint_check:0
|
||||
msgid "Use Preprinted Check"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: sql_constraint:res.company:0
|
||||
msgid "The company name must be unique !"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Due Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: model:ir.model,name:account_check_writing.model_res_company
|
||||
msgid "Companies"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: view:res.company:0
|
||||
msgid "Default Check Layout"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: constraint:account.journal:0
|
||||
msgid ""
|
||||
"Configuration error! The currency chosen should be shared by the default "
|
||||
"accounts too."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
msgid "Balance Due"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Check Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: model:ir.model,name:account_check_writing.model_account_voucher
|
||||
msgid "Accounting Voucher"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: sql_constraint:account.journal:0
|
||||
msgid "The name of the journal must be unique per company !"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: sql_constraint:account.journal:0
|
||||
msgid "The code of the journal must be unique per company !"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: field:account.voucher,amount_in_word:0
|
||||
msgid "Amount in Word"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Open Balance"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: field:res.company,check_layout:0
|
||||
msgid "Choose Check layout"
|
||||
msgstr ""
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -7,14 +7,14 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2012-02-10 15:03+0000\n"
|
||||
"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n"
|
||||
"PO-Revision-Date: 2012-10-30 15:45+0000\n"
|
||||
"Last-Translator: ccdos <ccdos@163.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: 2012-10-30 05:13+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-03 05:04+0000\n"
|
||||
"X-Generator: Launchpad (build 16218)\n"
|
||||
|
||||
#. module: account_payment
|
||||
#: field:payment.order,date_scheduled:0
|
||||
|
@ -653,7 +653,7 @@ msgstr "公司币别"
|
|||
#: view:payment.line:0
|
||||
#: view:payment.order:0
|
||||
msgid "Payment"
|
||||
msgstr "付款"
|
||||
msgstr "支付"
|
||||
|
||||
#. module: account_payment
|
||||
#: report:payment.order:0
|
||||
|
|
|
@ -43,6 +43,18 @@
|
|||
<field eval="True" name="required"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
</record>
|
||||
<record id="sequence_journal" model="ir.sequence.type">
|
||||
<field name="name">Account Journal</field>
|
||||
<field name="code">account.journal</field>
|
||||
</record>
|
||||
|
||||
<record id="sequence_journal_seq" model="ir.sequence">
|
||||
<field name="name">Account journal sequence</field>
|
||||
<field name="code">account.journal</field>
|
||||
<field name="prefix">AJ</field>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
</openerp>
|
||||
|
|
|
@ -61,6 +61,7 @@ This module manages:
|
|||
'account_voucher_data.xml',
|
||||
],
|
||||
'test' : [
|
||||
'test/case5_suppl_usd_usd.yml',
|
||||
'test/account_voucher.yml',
|
||||
'test/sales_receipt.yml',
|
||||
'test/sales_payment.yml',
|
||||
|
|
|
@ -267,6 +267,7 @@ class account_voucher(osv.osv):
|
|||
_order = "date desc, id desc"
|
||||
# _rec_name = 'number'
|
||||
_columns = {
|
||||
'active': fields.boolean('Active', help="By default, reconciliation vouchers made on draft bank statements are set as inactive, which allow to hide the customer/supplier payment while the bank statement isn't confirmed."),
|
||||
'type':fields.selection([
|
||||
('sale','Sale'),
|
||||
('purchase','Purchase'),
|
||||
|
@ -328,6 +329,7 @@ class account_voucher(osv.osv):
|
|||
'is_multi_currency': fields.boolean('Multi Currency Voucher', help='Fields with internal purpose only that depicts if the voucher is a multi currency one or not'),
|
||||
}
|
||||
_defaults = {
|
||||
'active': True,
|
||||
'period_id': _get_period,
|
||||
'partner_id': _get_partner,
|
||||
'journal_id':_get_journal,
|
||||
|
@ -381,7 +383,8 @@ class account_voucher(osv.osv):
|
|||
total_tax = 0.0
|
||||
|
||||
if not tax[0].price_include:
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_amount, 1).get('taxes', []):
|
||||
for line in voucher.line_ids:
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, line.amount, 1).get('taxes', []):
|
||||
total_tax += tax_line.get('amount', 0.0)
|
||||
total += total_tax
|
||||
else:
|
||||
|
@ -413,13 +416,11 @@ class account_voucher(osv.osv):
|
|||
|
||||
line_ids = resolve_o2m_operations(cr, uid, line_pool, line_ids, ["amount"], context)
|
||||
|
||||
total_tax = 0.0
|
||||
for line in line_ids:
|
||||
line_amount = 0.0
|
||||
line_amount = line.get('amount',0.0)
|
||||
voucher_total += line_amount
|
||||
|
||||
total = voucher_total
|
||||
total_tax = 0.0
|
||||
if tax_id:
|
||||
tax = [tax_pool.browse(cr, uid, tax_id, context=context)]
|
||||
if partner_id:
|
||||
|
@ -428,9 +429,11 @@ class account_voucher(osv.osv):
|
|||
tax = tax_pool.browse(cr, uid, taxes, context=context)
|
||||
|
||||
if not tax[0].price_include:
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_total, 1).get('taxes', []):
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, line_amount, 1).get('taxes', []):
|
||||
total_tax += tax_line.get('amount')
|
||||
total += total_tax
|
||||
|
||||
voucher_total += line_amount
|
||||
total = voucher_total + total_tax
|
||||
|
||||
res.update({
|
||||
'amount': total or voucher_total,
|
||||
|
@ -712,14 +715,14 @@ class account_voucher(osv.osv):
|
|||
'move_line_id':line.id,
|
||||
'account_id':line.account_id.id,
|
||||
'amount_original': amount_original,
|
||||
'amount': (move_line_found == line.id) and min(price, amount_unreconciled) or 0.0,
|
||||
'amount': (move_line_found == line.id) and min(abs(price), amount_unreconciled) or 0.0,
|
||||
'date_original':line.date,
|
||||
'date_due':line.date_maturity,
|
||||
'amount_unreconciled': amount_unreconciled,
|
||||
'currency_id': line_currency_id,
|
||||
}
|
||||
|
||||
#split voucher amount by most old first, but only for lines in the same currency
|
||||
#in case a corresponding move_line hasn't been found, we now try to assign the voucher amount
|
||||
#on existing invoices: we split voucher amount by most old first, but only for lines in the same currency
|
||||
if not move_line_found:
|
||||
if currency_id == line_currency_id:
|
||||
if line.credit:
|
||||
|
@ -953,6 +956,9 @@ class account_voucher(osv.osv):
|
|||
if voucher_brw.number:
|
||||
name = voucher_brw.number
|
||||
elif voucher_brw.journal_id.sequence_id:
|
||||
if not voucher_brw.journal_id.sequence_id.active:
|
||||
raise osv.except_osv(_('Configuration Error !'),
|
||||
_('Please activate the sequence of selected journal !'))
|
||||
name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id, context=context)
|
||||
else:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
|
@ -1504,6 +1510,15 @@ account_voucher_line()
|
|||
class account_bank_statement(osv.osv):
|
||||
_inherit = 'account.bank.statement'
|
||||
|
||||
def button_confirm_bank(self, cr, uid, ids, context=None):
|
||||
voucher_obj = self.pool.get('account.voucher')
|
||||
voucher_ids = []
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
voucher_ids += [line.voucher_id.id for line in statement.line_ids if line.voucher_id]
|
||||
if voucher_ids:
|
||||
voucher_obj.write(cr, uid, voucher_ids, {'active': True}, context=context)
|
||||
return super(account_bank_statement, self).button_confirm_bank(cr, uid, ids, context=context)
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context=None):
|
||||
voucher_obj = self.pool.get('account.voucher')
|
||||
for st in self.browse(cr, uid, ids, context=context):
|
||||
|
@ -1539,6 +1554,16 @@ account_bank_statement()
|
|||
class account_bank_statement_line(osv.osv):
|
||||
_inherit = 'account.bank.statement.line'
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, partner_id, context=None):
|
||||
res = super(account_bank_statement_line, self).onchange_partner_id(cr, uid, ids, partner_id, context=context)
|
||||
if 'value' not in res:
|
||||
res['value'] = {}
|
||||
res['value'].update({'voucher_id' : False})
|
||||
return res
|
||||
|
||||
def onchange_amount(self, cr, uid, ids, amount, context=None):
|
||||
return {'value' : {'voucher_id' : False}}
|
||||
|
||||
def _amount_reconciled(self, cursor, user, ids, name, args, context=None):
|
||||
if not ids:
|
||||
return {}
|
||||
|
@ -1565,7 +1590,7 @@ class account_bank_statement_line(osv.osv):
|
|||
_columns = {
|
||||
'amount_reconciled': fields.function(_amount_reconciled,
|
||||
string='Amount reconciled', type='float'),
|
||||
'voucher_id': fields.many2one('account.voucher', 'Payment'),
|
||||
'voucher_id': fields.many2one('account.voucher', 'Reconciliation'),
|
||||
}
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -7,12 +7,10 @@
|
|||
<field name="model">mail.group</field>
|
||||
<field name="res_id" ref="mail.group_all_employees"/>
|
||||
<field name="type">notification</field>
|
||||
<field name="subtype_id" ref="mail.mt_comment"/>
|
||||
<field name="subject">eInvoicing & Payments application installed!</field>
|
||||
<field name="body"><![CDATA[
|
||||
OpenERP's electronic invoicing accelerates the creation of invoices and collection of customer payments. Invoices are created in a few clicks and your customers receive them by email. They can pay online and/or import them in their own system.
|
||||
|
||||
<p>You can track customer payments easily and automate follow-ups. You get an overview of the discussion with your customers on each invoice for easier traceability. For advanced accounting features, you should install the "Accounting and Finance" module.</p>
|
||||
]]></field>
|
||||
<field name="body"><![CDATA[<p>OpenERP's electronic invoicing accelerates the creation of invoices and collection of customer payments. Invoices are created in a few clicks and your customers receive them by email. They can pay online and/or import them in their own system.</p>
|
||||
<p>You can track customer payments easily and automate follow-ups. You get an overview of the discussion with your customers on each invoice for easier traceability. For advanced accounting features, you should install the "Accounting and Finance" module.</p>]]></field>
|
||||
</record>
|
||||
|
||||
<!-- mail: subtypes -->
|
||||
|
|
|
@ -200,33 +200,29 @@
|
|||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='import_buttons']" position="inside">
|
||||
<button name="%(action_view_account_statement_from_invoice_lines)d"
|
||||
string="Import Invoices" type="action" icon="gtk-execute"
|
||||
string="Import Invoices" type="action"
|
||||
attrs="{'invisible':[('state','=','confirm')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_tree_voucher" model="ir.ui.view">
|
||||
<record id="view_bank_statement_form_voucher" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.voucher.tree.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/tree/field[@name='amount']" position="after">
|
||||
<field name="voucher_id" context="{'line_type': type, 'default_type': amount < 0 and 'payment' or 'receipt', 'type': amount < 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name}"/>
|
||||
<field name="voucher_id" widget="many2onebutton" options="{'label':{'create':'Reconcile','edit':'Edit Reconciliation'}}" context="{'line_type': type, 'default_type': amount < 0 and 'payment' or 'receipt', 'type': amount < 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name, 'default_active': False}"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/form/group/field[@name='sequence']" position="before">
|
||||
<field name="voucher_id" widget="many2onebutton" options="{'label':{'create':'Reconcile','edit':'Edit Reconciliation'}}" context="{'line_type': type, 'default_type': amount < 0 and 'payment' or 'receipt', 'type': amount < 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name, 'default_active': False}"/>
|
||||
</xpath>
|
||||
<field name="amount" position="attributes">
|
||||
<attribute name="on_change">onchange_amount(amount)</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_form_voucher" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.voucher.form.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/form/group/field[@name='sequence']" position="before">
|
||||
<field name="voucher_id" context="{'line_type': type, 'default_type': amount < 0 and 'payment' or 'receipt', 'type': amount < 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_cash_statement_tree_voucher" model="ir.ui.view">
|
||||
<field name="name">account.cash.statement.voucher.tree.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
|
|
|
@ -7,14 +7,15 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 01:37+0100\n"
|
||||
"PO-Revision-Date: 2012-05-10 17:31+0000\n"
|
||||
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
|
||||
"PO-Revision-Date: 2012-11-07 13:27+0000\n"
|
||||
"Last-Translator: Frederic Clementi - Camptocamp.com "
|
||||
"<frederic.clementi@camptocamp.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: 2012-10-30 05:19+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-08 04:47+0000\n"
|
||||
"X-Generator: Launchpad (build 16232)\n"
|
||||
|
||||
#. module: account_voucher
|
||||
#: view:sale.receipt.report:0
|
||||
|
@ -469,7 +470,7 @@ msgstr "Délai moyen de règlement"
|
|||
#. module: account_voucher
|
||||
#: field:res.company,income_currency_exchange_account_id:0
|
||||
msgid "Income Currency Rate"
|
||||
msgstr "Taux de change d'achat"
|
||||
msgstr "Compte de gain de change"
|
||||
|
||||
#. module: account_voucher
|
||||
#: code:addons/account_voucher/account_voucher.py:1063
|
||||
|
@ -625,9 +626,9 @@ msgid ""
|
|||
"Unable to create accounting entry for currency rate difference. You have to "
|
||||
"configure the field 'Income Currency Rate' on the company! "
|
||||
msgstr ""
|
||||
"Impossible de créer une entrée de la comptabilité à cause de la différence "
|
||||
"de taux de change. Vous devez configurer le champ 'Taux de change de vente' "
|
||||
"sur la société! "
|
||||
"Impossible de créer une écriture comptable à cause de la différence de taux "
|
||||
"de change. Vous devez configurer le champ 'Compte de gain de change' au "
|
||||
"niveau du formulaire de la société! "
|
||||
|
||||
#. module: account_voucher
|
||||
#: view:account.voucher:0 view:sale.receipt.report:0
|
||||
|
@ -802,7 +803,7 @@ msgstr "Factures et transactions exceptionnelles"
|
|||
#. module: account_voucher
|
||||
#: field:res.company,expense_currency_exchange_account_id:0
|
||||
msgid "Expense Currency Rate"
|
||||
msgstr "Taux de change de la dépense"
|
||||
msgstr "Compte de perte de change"
|
||||
|
||||
#. module: account_voucher
|
||||
#: sql_constraint:account.invoice:0
|
||||
|
@ -1089,9 +1090,9 @@ msgid ""
|
|||
"Unable to create accounting entry for currency rate difference. You have to "
|
||||
"configure the field 'Expense Currency Rate' on the company! "
|
||||
msgstr ""
|
||||
"Impossible de créer une entrée en comptabilité pour la différence de taux de "
|
||||
"change. Vous devez configurer le champ \"Taux de change d'achat\" de la "
|
||||
"société ! "
|
||||
"Impossible de créer une écriture comptable à cause de la différence de taux "
|
||||
"de change. Vous devez configurer le champ 'Compte de perte de change' au "
|
||||
"niveau du formulaire de la société! "
|
||||
|
||||
#. module: account_voucher
|
||||
#: field:account.voucher,type:0
|
||||
|
@ -1156,7 +1157,7 @@ msgstr "Année"
|
|||
#. module: account_voucher
|
||||
#: field:account.voucher.line,amount_unreconciled:0
|
||||
msgid "Open Balance"
|
||||
msgstr "Solde initial"
|
||||
msgstr "Restant dû"
|
||||
|
||||
#. module: account_voucher
|
||||
#: view:account.voucher:0 field:account.voucher,amount:0
|
||||
|
|
|
@ -7,14 +7,14 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 01:37+0100\n"
|
||||
"PO-Revision-Date: 2012-05-10 18:01+0000\n"
|
||||
"Last-Translator: Raphael Collet (OpenERP) <Unknown>\n"
|
||||
"PO-Revision-Date: 2012-11-17 09:57+0000\n"
|
||||
"Last-Translator: Stefan Rijnhart (Therp) <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: 2012-10-30 05:19+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-18 04:37+0000\n"
|
||||
"X-Generator: Launchpad (build 16278)\n"
|
||||
|
||||
#. module: account_voucher
|
||||
#: view:sale.receipt.report:0
|
||||
|
@ -846,7 +846,7 @@ msgstr ""
|
|||
#: view:account.voucher:0
|
||||
#: model:ir.model,name:account_voucher.model_account_voucher
|
||||
msgid "Accounting Voucher"
|
||||
msgstr "Betalingsintentie"
|
||||
msgstr "Journaalbon"
|
||||
|
||||
#. module: account_voucher
|
||||
#: field:account.voucher,number:0
|
||||
|
|
|
@ -0,0 +1,185 @@
|
|||
-
|
||||
In order to check the Account_voucher module with multi-currency in OpenERP,
|
||||
I create a supplier invoices in USD and make the payment in USD but with another exchange rate and with a write-off
|
||||
-
|
||||
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.data_account_type_cash"
|
||||
|
||||
-
|
||||
I create currency USD in OpenERP for November of 1.8 Rate
|
||||
-
|
||||
!record {model: res.currency.rate, id: nov_usd}:
|
||||
currency_id: base.USD
|
||||
name: !eval "'%s-11-01' %(datetime.now().year)"
|
||||
rate: 1.8
|
||||
-
|
||||
I create currency USD in OpenERP for December of 1.5 Rate
|
||||
-
|
||||
!record {model: res.currency.rate, id: dec_usd}:
|
||||
currency_id: base.USD
|
||||
name: !eval "'%s-12-01' %(datetime.now().year)"
|
||||
rate: 1.5
|
||||
-
|
||||
I set the income and expense currency accounts on the main company
|
||||
-
|
||||
!python {model: res.company}: |
|
||||
from datetime import datetime
|
||||
vals = {
|
||||
'income_currency_exchange_account_id': ref('account.o_expense'),
|
||||
'expense_currency_exchange_account_id': ref('account.o_expense')}
|
||||
self.write(cr, uid, ref('base.main_company'), vals)
|
||||
-
|
||||
I create a bank journal with EUR as currency
|
||||
-
|
||||
!record {model: account.journal, id: bank_journal_EUR}:
|
||||
name: Bank Journal(EUR)
|
||||
code: BEUR
|
||||
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
|
||||
company_id: base.main_company
|
||||
view_id: account.account_journal_bank_view
|
||||
-
|
||||
I create a bank journal with USD as currency
|
||||
-
|
||||
!record {model: account.journal, id: bank_journal_USD}:
|
||||
name: Bank Journal(USD)
|
||||
code: BUSD
|
||||
type: bank
|
||||
analytic_journal_id: account.sit
|
||||
sequence_id: account.sequence_bank_journal
|
||||
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 set the context as would do the action in supplier invoice menuitem
|
||||
-
|
||||
!context
|
||||
'default_type': 'in_invoice'
|
||||
-
|
||||
I create the invoice on 1st november for 1000 USD
|
||||
-
|
||||
!record {model: account.invoice, id: account_supplier_invoice_november, view: account.invoice_supplier_form}:
|
||||
account_id: account.a_pay
|
||||
company_id: base.main_company
|
||||
currency_id: base.USD
|
||||
date_invoice: !eval "'%s-11-01' %(datetime.now().year)"
|
||||
period_id: account.period_1
|
||||
invoice_line:
|
||||
- account_id: account.a_expense
|
||||
name: '[PCSC234] PC Assemble SC234'
|
||||
price_unit: 1000.0
|
||||
quantity: 1.0
|
||||
product_id: product.product_product_3
|
||||
uos_id: product.product_uom_unit
|
||||
journal_id: account.sales_journal
|
||||
partner_id: base.res_partner_19
|
||||
reference_type: none
|
||||
check_total : 1000
|
||||
-
|
||||
I Validate invoice by clicking on Validate button
|
||||
-
|
||||
!workflow {model: account.invoice, action: invoice_open, ref: account_supplier_invoice_november}
|
||||
-
|
||||
I check that first invoice move is correct for creditor account(debit - credit == -555.56)
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
invoice_id = self.browse(cr, uid, ref("account_supplier_invoice_november"))
|
||||
assert invoice_id.move_id, "Move not created for open invoice"
|
||||
move_line_obj = self.pool.get('account.move.line')
|
||||
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
|
||||
move_line = move_line_obj.browse(cr, uid, move_lines[0])
|
||||
assert (move_line.debit - move_line.credit == -555.56), "Invoice move is incorrect for creditor account"
|
||||
assert (move_line.amount_currency == -1000), "Amount currency is incorrect for creditor account"
|
||||
-
|
||||
I set the context that will be used for the encoding of all the vouchers of this file
|
||||
-
|
||||
!context
|
||||
'type': 'payment'
|
||||
-
|
||||
I create the voucher of payment with values $950, journal USD
|
||||
-
|
||||
!record {model: account.voucher, id: account_voucher_case_5_supplier_flow, view: view_vendor_payment_form}:
|
||||
account_id: account.cash
|
||||
amount: 950.0
|
||||
company_id: base.main_company
|
||||
journal_id: bank_journal_USD
|
||||
name: 'Payment: Case Basic SUPPLIER USD/USD'
|
||||
partner_id: base.res_partner_19
|
||||
period_id: account.period_12
|
||||
date: !eval time.strftime("%Y-12-01")
|
||||
payment_option: 'with_writeoff'
|
||||
writeoff_acc_id: account.a_expense
|
||||
comment: 'Write Off'
|
||||
type: 'payment'
|
||||
-
|
||||
I fill $1000 for the previously encoded invoice
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
import netsvc, time
|
||||
vals = {}
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_case_5_supplier_flow'))
|
||||
for item in voucher_id.line_dr_ids:
|
||||
if item.amount_unreconciled == 1000.00:
|
||||
self.pool.get('account.voucher.line').write(cr, uid, [item.id], {'amount': 1000})
|
||||
assert (voucher_id.state=='draft'), "Voucher is not in draft state"
|
||||
-
|
||||
I check that writeoff amount computed is -50.0
|
||||
-
|
||||
!assert {model: account.voucher, id: account_voucher_case_5_supplier_flow}:
|
||||
- writeoff_amount == -50.0
|
||||
-
|
||||
I confirm the voucher
|
||||
-
|
||||
!workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_case_5_supplier_flow}
|
||||
-
|
||||
I check that the move of my voucher is valid and that it is posted
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_case_5_supplier_flow'))
|
||||
assert voucher_id.state == 'posted', "Voucher state is not posted"
|
||||
for move_line in voucher_id.move_id.line_id:
|
||||
assert move_line.state == 'valid', "Voucher move is not valid"
|
||||
-
|
||||
I check that my creditor account is correct
|
||||
-
|
||||
I check that the bank entry is -$950 and 633.33€ as amount_currency and credit, respectively.
|
||||
-
|
||||
I check that the creditor account has 1 new line with $1000 and 666.67€ as amount_currency and debit, respectively.
|
||||
-
|
||||
I check that my currency rate difference is correct (111.11€ in debit/credit with no amount_currency)
|
||||
-
|
||||
I check that my writeoff is correct. 33.34€ in credit with -$50 as amount currency
|
||||
-
|
||||
!python {model: account.voucher}: |
|
||||
voucher_id = self.browse(cr, uid, ref('account_voucher_case_5_supplier_flow'))
|
||||
for move_line in voucher_id.move_id.line_id:
|
||||
if move_line.amount_currency == -950.00:
|
||||
assert move_line.credit == 633.33, "Wrong bank entry."
|
||||
elif move_line.credit == 111.11 or move_line.debit == 111.11:
|
||||
assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
|
||||
elif move_line.credit == 33.34:
|
||||
assert move_line.amount_currency == -50.0, "Writeoff amount is wrong."
|
||||
elif move_line.debit == 666.67:
|
||||
assert move_line.amount_currency == 1000.0, "Wrong supplier entry."
|
||||
else:
|
||||
assert False, "Wrong entry. Unrecognized account move line"
|
||||
-
|
||||
I check the residual amount of invoice, it should be 0 in residual currency and 0 in amount_residual and paid
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
invoice_id = self.browse(cr, uid, ref("account_supplier_invoice_november"))
|
||||
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])
|
||||
assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for supplier invoice"
|
|
@ -54,6 +54,8 @@
|
|||
<form string="Bill Payment" version="7.0">
|
||||
<group col="6">
|
||||
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Supplier" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1, 'invoice_currency': currency_id}"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="amount" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
|
||||
<field name="journal_id"
|
||||
domain="[('type','in',['bank', 'cash'])]"
|
||||
|
@ -290,7 +292,7 @@
|
|||
<group>
|
||||
<group>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
|
||||
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Supplier" context="{'search_default_supplier': 1}"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="amount" class="oe_inline"
|
||||
string="Paid Amount"
|
||||
|
@ -390,35 +392,33 @@
|
|||
<field name="model">account.voucher</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Receipt" version="7.0">
|
||||
<header>
|
||||
<button name="proforma_voucher" string="Validate" states="draft" invisible="context.get('line_type', False)" class="oe_highlight"/>
|
||||
<button name="cancel_voucher" string="Cancel" states="draft,proforma" invisible="context.get('line_type', False)"/>
|
||||
<button name="cancel_voucher" string="Unreconcile" type="object" states="posted" invisible="context.get('line_type', False)" confirm="Are you sure to unreconcile and cancel this record ?"/>
|
||||
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" invisible="context.get('line_type', False)"/>
|
||||
<header invisible="context.get('line_type', False)">
|
||||
<button name="proforma_voucher" string="Validate" states="draft" class="oe_highlight"/>
|
||||
<button name="cancel_voucher" string="Cancel" states="draft,proforma"/>
|
||||
<button name="cancel_voucher" string="Unreconcile" type="object" states="posted" confirm="Are you sure to unreconcile and cancel this record ?"/>
|
||||
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
|
||||
</header>
|
||||
<sheet>
|
||||
<h1 attrs="{'invisible': [('number','=',False)]}"><field name="number"/></h1>
|
||||
<group invisible="context.get('line_type', False)">
|
||||
<group>
|
||||
<group>
|
||||
<field name="partner_id" domain="[('customer','=',True)]" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
|
||||
<field name="partner_id" domain="[('customer','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="amount" class="oe_inline"
|
||||
string="Paid Amount"
|
||||
widget="monetary" options="{'currency_field': 'currency_id'}"
|
||||
invisible="context.get('line_type', False)"
|
||||
on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
|
||||
<field name="journal_id"
|
||||
domain="[('type','in',['bank', 'cash'])]"
|
||||
invisible="context.get('line_type', False)"
|
||||
widget="selection"
|
||||
on_change="onchange_journal(journal_id, line_cr_ids, False, partner_id, date, amount, type, company_id, context)"
|
||||
string="Payment Method"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
|
||||
<field name="reference" invisible="context.get('line_type', False)" string="Payment Ref" placeholder="e.g. 003/10"/>
|
||||
<field name="name" colspan="2" invisible="context.get('line_type', False)" placeholder="e.g. Invoice SAJ/0042"/>
|
||||
<field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
|
||||
<field name="reference" string="Payment Ref" placeholder="e.g. 003/10"/>
|
||||
<field name="name" colspan="2" placeholder="e.g. Invoice SAJ/0042"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
|
||||
<field name="account_id"
|
||||
|
@ -430,7 +430,7 @@
|
|||
</group>
|
||||
<notebook>
|
||||
<page string="Payment Information" groups="base.group_user">
|
||||
<label for="line_cr_ids"/>
|
||||
<label for="line_cr_ids" invisible="context.get('line_type', False)"/>
|
||||
<field name="line_cr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
|
||||
<tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
|
||||
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
|
||||
|
@ -511,7 +511,7 @@
|
|||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<div class="oe_chatter" invisible="context.get('line_type', False)">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>
|
||||
<field name="context">{'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
|
||||
<field name="context">{'default_type':'receipt', 'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
|
||||
<field name="view_id" ref="view_vendor_receipt_form"/>
|
||||
<field name="target">current</field>
|
||||
</record>
|
||||
|
|
|
@ -98,6 +98,10 @@ class account_analytic_account(osv.osv):
|
|||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
res = []
|
||||
if not ids:
|
||||
return res
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
for id in ids:
|
||||
elmt = self.browse(cr, uid, id, context=context)
|
||||
res.append((id, self._get_one_full_name(elmt)))
|
||||
|
@ -180,7 +184,7 @@ class account_analytic_account(osv.osv):
|
|||
'partner_id': fields.many2one('res.partner', 'Customer'),
|
||||
'user_id': fields.many2one('res.users', 'Project Manager'),
|
||||
'manager_id': fields.many2one('res.users', 'Account Manager'),
|
||||
'date_start': fields.date('Date Start'),
|
||||
'date_start': fields.date('Start Date'),
|
||||
'date': fields.date('Date End', select=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=False), #not required because we want to allow different companies to use the same chart of account, except for leaf accounts.
|
||||
'state': fields.selection([('template', 'Template'),('draft','New'),('open','In Progress'), ('cancelled', 'Cancelled'),('pending','To Renew'),('close','Closed')], 'Status', required=True,),
|
||||
|
@ -305,7 +309,10 @@ class account_analytic_account(osv.osv):
|
|||
|
||||
def create_send_note(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
self.message_post(cr, uid, [obj.id], body=_("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name),
|
||||
message = _("Contract <b>created</b>.")
|
||||
if obj.partner_id:
|
||||
message = _("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name,)
|
||||
self.message_post(cr, uid, [obj.id], body=message,
|
||||
subtype="analytic.mt_account_status", context=context)
|
||||
|
||||
account_analytic_account()
|
||||
|
@ -320,7 +327,7 @@ class account_analytic_line(osv.osv):
|
|||
'date': fields.date('Date', required=True, select=True),
|
||||
'amount': fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.', digits_compute=dp.get_precision('Account')),
|
||||
'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.'),
|
||||
'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True, domain=[('type','<>','view')]),
|
||||
'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='restrict', select=True, domain=[('type','<>','view')]),
|
||||
'user_id': fields.many2one('res.users', 'User'),
|
||||
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
<group>
|
||||
<field name="partner_id" on_change="on_change_partner_id(partner_id, name)"/>
|
||||
<field name="manager_id"/>
|
||||
<field name="code"/>
|
||||
<field name="currency_id" attrs="{'invisible': ['|',('type', '<>', 'view'), ('company_id', '<>', False)]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="type"/>
|
||||
<field name="code"/>
|
||||
<field name="type" invisible="context.get('default_type', False)"/>
|
||||
<field name="parent_id" on_change="on_change_parent(parent_id)" attrs="{'invisible': [('type','in',['contract','template'])]}"/>
|
||||
<field name="template_id" on_change="on_change_template(template_id,context)" domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}"/>
|
||||
<field name="company_id" on_change="on_change_company(company_id)" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','<>','view')]}"/>
|
||||
|
@ -40,7 +40,7 @@
|
|||
Once the end date of the contract is
|
||||
passed or the maximum number of service
|
||||
units (e.g. support contract) is
|
||||
reached, the account manager is warned
|
||||
reached, the account manager is notified
|
||||
by email to renew the contract with the
|
||||
customer.
|
||||
</p>
|
||||
|
|
|
@ -3,3 +3,4 @@ access_ir_model_fields_anonymization_group_system,ir_model_fields_anonymization
|
|||
access_ir_model_fields_anonymization_user,ir_model_fields_anonymization user,model_ir_model_fields_anonymization,,1,0,0,0
|
||||
access_ir_model_fields_anonymization_history_group_system,ir_model_fields_anonymization_history group_user,model_ir_model_fields_anonymization_history,base.group_system,1,1,1,1
|
||||
access_ir_model_fields_anonymization_history_user,ir_model_fields_anonymization_history user,model_ir_model_fields_anonymization_history,,1,0,0,0
|
||||
access_ir_model_fields_anonymization_migration_fix,access_ir_model_fields_anonymization_migration_fix,model_ir_model_fields_anonymization_migration_fix,,1,1,1,1
|
||||
|
|
|
|
@ -346,8 +346,13 @@ class audittrail_objects_proxy(object_proxy):
|
|||
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, SUPERUSER_ID, x2m_model_id)
|
||||
#recursive call on x2m fields that need to be checked too
|
||||
data.update(self.get_data(cr, SUPERUSER_ID, pool, resource[field], x2m_model, method))
|
||||
field_resource_ids = list(set(resource[field]))
|
||||
if model.model == x2m_model.model:
|
||||
# we need to remove current resource_id from the many2many to prevent an infinit loop
|
||||
if resource_id in field_resource_ids:
|
||||
field_resource_ids.remove(resource_id)
|
||||
data.update(self.get_data(cr, SUPERUSER_ID, pool, field_resource_ids, x2m_model, method))
|
||||
|
||||
data[(model.id, resource_id)] = {'text':values_text, 'value': values}
|
||||
return data
|
||||
|
||||
|
@ -388,6 +393,8 @@ class audittrail_objects_proxy(object_proxy):
|
|||
}
|
||||
# loop on all the fields
|
||||
for field_name, field_definition in pool.get(model.model)._all_columns.items():
|
||||
if field_name in ('__last_update', 'id'):
|
||||
continue
|
||||
#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
|
||||
|
@ -406,6 +413,10 @@ class audittrail_objects_proxy(object_proxy):
|
|||
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))
|
||||
if model.model == x2m_model.model:
|
||||
# we need to remove current resource_id from the many2many to prevent an infinit loop
|
||||
if resource_id in res_ids:
|
||||
res_ids.remove(resource_id)
|
||||
for res_id in res_ids:
|
||||
lines.update(self.prepare_audittrail_log_line(cr, SUPERUSER_ID, 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
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
<field name="res_id" readonly="1"/>
|
||||
<field name="object_id" readonly="1"/>
|
||||
</group>
|
||||
<field name="line_ids" mode="tree,form"
|
||||
<field name="line_ids" mode="tree"
|
||||
widget="one2many_list" readonly="1">
|
||||
<form string="Log Lines" version="7.0">
|
||||
<group col="4">
|
||||
|
|
|
@ -3,12 +3,12 @@ openerp.auth_anonymous = function(instance) {
|
|||
instance.web.Login.include({
|
||||
start: function() {
|
||||
var self = this;
|
||||
return $.when(this._super()).pipe(function() {
|
||||
var dblist = self._db_list || [];
|
||||
return $.when(this._super()).then(function() {
|
||||
var dblist = self.db_list || [];
|
||||
if (!self.session.session_is_valid() && dblist.length === 1) {
|
||||
self.remember_credentials = false;
|
||||
// XXX get login/pass from server (via a rpc call) ?
|
||||
return self.do_login(dblist[0], 'anonymous', 'anonymous')
|
||||
return self.do_login(dblist[0], 'anonymous', 'anonymous');
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -1,48 +1,101 @@
|
|||
import functools
|
||||
import logging
|
||||
|
||||
import simplejson
|
||||
import werkzeug.urls
|
||||
import werkzeug.utils
|
||||
from werkzeug.exceptions import BadRequest
|
||||
|
||||
import openerp
|
||||
from openerp import SUPERUSER_ID
|
||||
import openerp.addons.web.http as oeweb
|
||||
from openerp.addons.web.controllers.main import db_monodb, set_cookie_and_redirect, login_and_redirect
|
||||
from openerp.modules.registry import RegistryManager
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
class OAuthController(openerp.addons.web.http.Controller):
|
||||
#----------------------------------------------------------
|
||||
# helpers
|
||||
#----------------------------------------------------------
|
||||
def fragment_to_query_string(func):
|
||||
@functools.wraps(func)
|
||||
def wrapper(self, req, **kw):
|
||||
if not kw:
|
||||
return """<html><head><script>
|
||||
var l = window.location;
|
||||
var q = l.hash.substring(1);
|
||||
var r = '/' + l.search;
|
||||
if(q.length !== 0) {
|
||||
var s = l.search ? (l.search === '?' ? '' : '&') : '?';
|
||||
r = l.pathname + l.search + s + q;
|
||||
}
|
||||
window.location = r;
|
||||
</script></head><body></body></html>"""
|
||||
return func(self, req, **kw)
|
||||
return wrapper
|
||||
|
||||
|
||||
#----------------------------------------------------------
|
||||
# Controller
|
||||
#----------------------------------------------------------
|
||||
class OAuthController(oeweb.Controller):
|
||||
_cp_path = '/auth_oauth'
|
||||
|
||||
@openerp.addons.web.http.jsonrequest
|
||||
@oeweb.jsonrequest
|
||||
def list_providers(self, req, dbname):
|
||||
try:
|
||||
registry = openerp.modules.registry.RegistryManager.get(dbname)
|
||||
registry = RegistryManager.get(dbname)
|
||||
with registry.cursor() as cr:
|
||||
providers = registry.get('auth.oauth.provider')
|
||||
l = providers.read(cr, openerp.SUPERUSER_ID, providers.search(cr, openerp.SUPERUSER_ID, [('enabled','=',True)]))
|
||||
l = providers.read(cr, SUPERUSER_ID, providers.search(cr, SUPERUSER_ID, [('enabled', '=', True)]))
|
||||
except Exception:
|
||||
l = []
|
||||
return l
|
||||
|
||||
@openerp.addons.web.http.httprequest
|
||||
@oeweb.httprequest
|
||||
@fragment_to_query_string
|
||||
def signin(self, req, **kw):
|
||||
state = simplejson.loads(kw['state'])
|
||||
dbname = state['d']
|
||||
provider = state['p']
|
||||
registry = openerp.modules.registry.RegistryManager.get(dbname)
|
||||
context = state.get('c', {})
|
||||
registry = RegistryManager.get(dbname)
|
||||
with registry.cursor() as cr:
|
||||
try:
|
||||
u = registry.get('res.users')
|
||||
credentials = u.auth_oauth(cr, openerp.SUPERUSER_ID, provider, kw)
|
||||
credentials = u.auth_oauth(cr, SUPERUSER_ID, provider, kw, context=context)
|
||||
cr.commit()
|
||||
return openerp.addons.web.controllers.main.login_and_redirect(req, *credentials)
|
||||
return login_and_redirect(req, *credentials)
|
||||
except AttributeError:
|
||||
# auth_signup is not installed
|
||||
_logger.error("auth_signup not installed on database %s: oauth sign up cancelled."%dbname)
|
||||
_logger.error("auth_signup not installed on database %s: oauth sign up cancelled." % (dbname,))
|
||||
url = "/#action=login&oauth_error=1"
|
||||
except Exception, e:
|
||||
# signup error
|
||||
_logger.exception("OAuth2: %s" % str(e))
|
||||
url = "/#action=login&oauth_error=2"
|
||||
return openerp.addons.web.controllers.main.set_cookie_and_redirect(req, url)
|
||||
|
||||
return set_cookie_and_redirect(req, url)
|
||||
|
||||
@oeweb.httprequest
|
||||
def oea(self, req, **kw):
|
||||
"""login user via OpenERP Account provider"""
|
||||
dbname = kw.pop('db', None)
|
||||
if not dbname:
|
||||
dbname = db_monodb(req)
|
||||
if not dbname:
|
||||
return BadRequest()
|
||||
|
||||
registry = RegistryManager.get(dbname)
|
||||
with registry.cursor() as cr:
|
||||
IMD = registry['ir.model.data']
|
||||
model, provider_id = IMD.get_object_reference(cr, SUPERUSER_ID, 'auth_oauth', 'provider_openerp')
|
||||
assert model == 'auth.oauth.provider'
|
||||
|
||||
state = {
|
||||
'd': dbname,
|
||||
'p': provider_id,
|
||||
'c': {'no_user_creation': True},
|
||||
}
|
||||
|
||||
kw['state'] = simplejson.dumps(state)
|
||||
return self.signin(req, **kw)
|
||||
|
||||
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -24,7 +24,7 @@ class res_users(osv.Model):
|
|||
('uniq_users_oauth_provider_oauth_uid', 'unique(oauth_provider_id, oauth_uid)', 'OAuth UID must be unique per provider'),
|
||||
]
|
||||
|
||||
def auth_oauth_rpc(self, cr, uid, endpoint, access_token, context=None):
|
||||
def _auth_oauth_rpc(self, cr, uid, endpoint, access_token, context=None):
|
||||
params = urllib.urlencode({'access_token': access_token})
|
||||
if urlparse.urlparse(endpoint)[4]:
|
||||
url = endpoint + '&' + params
|
||||
|
@ -34,6 +34,17 @@ class res_users(osv.Model):
|
|||
response = f.read()
|
||||
return simplejson.loads(response)
|
||||
|
||||
def _auth_oauth_validate(self, cr, uid, provider, access_token, context=None):
|
||||
""" return the validation data corresponding to the access token """
|
||||
p = self.pool.get('auth.oauth.provider').browse(cr, uid, provider, context=context)
|
||||
validation = self._auth_oauth_rpc(cr, uid, p.validation_endpoint, access_token)
|
||||
if validation.get("error"):
|
||||
raise Exception(validation['error'])
|
||||
if p.data_endpoint:
|
||||
data = self._auth_oauth_rpc(cr, uid, p.data_endpoint, access_token)
|
||||
validation.update(data)
|
||||
return validation
|
||||
|
||||
def auth_oauth(self, cr, uid, provider, params, context=None):
|
||||
# Advice by Google (to avoid Confused Deputy Problem)
|
||||
# if validation.audience != OUR_CLIENT_ID:
|
||||
|
@ -41,25 +52,21 @@ class res_users(osv.Model):
|
|||
# else:
|
||||
# continue with the process
|
||||
access_token = params.get('access_token')
|
||||
p = self.pool.get('auth.oauth.provider').browse(cr, uid, provider, context=context)
|
||||
|
||||
validation = self.auth_oauth_rpc(cr, uid, p.validation_endpoint, access_token)
|
||||
if validation.get("error"):
|
||||
raise Exception(validation['error'])
|
||||
if p.data_endpoint:
|
||||
data = self.auth_oauth_rpc(cr, uid, p.data_endpoint, access_token)
|
||||
validation.update(data)
|
||||
validation = self._auth_oauth_validate(cr, uid, provider, access_token)
|
||||
# required
|
||||
oauth_uid = validation['user_id']
|
||||
if not oauth_uid:
|
||||
raise openerp.exceptions.AccessDenied()
|
||||
email = validation.get('email', 'provider_%d_user_%d' % (p.id, oauth_uid))
|
||||
email = validation.get('email', 'provider_%d_user_%d' % (provider, oauth_uid))
|
||||
login = email
|
||||
# optional
|
||||
name = validation.get('name', email)
|
||||
res = self.search(cr, uid, [("oauth_uid", "=", oauth_uid), ('oauth_provider_id', '=', provider)])
|
||||
if res:
|
||||
assert len(res) == 1
|
||||
self.write(cr, uid, res[0], {'oauth_access_token': access_token})
|
||||
user = self.browse(cr, uid, res[0], context=context)
|
||||
login = user.login
|
||||
user.write({'oauth_access_token': access_token})
|
||||
else:
|
||||
# New user if signup module available
|
||||
if not hasattr(self, '_signup_create_user'):
|
||||
|
@ -67,9 +74,9 @@ class res_users(osv.Model):
|
|||
|
||||
new_user = {
|
||||
'name': name,
|
||||
'login': email,
|
||||
'login': login,
|
||||
'user_email': email,
|
||||
'oauth_provider_id': p.id,
|
||||
'oauth_provider_id': provider,
|
||||
'oauth_uid': oauth_uid,
|
||||
'oauth_access_token': access_token,
|
||||
'active': True,
|
||||
|
@ -77,7 +84,7 @@ class res_users(osv.Model):
|
|||
# TODO pass signup token to allow attach new user to right partner
|
||||
self._signup_create_user(cr, uid, new_user)
|
||||
|
||||
credentials = (cr.dbname, email, access_token)
|
||||
credentials = (cr.dbname, login, access_token)
|
||||
return credentials
|
||||
|
||||
def check_credentials(self, cr, uid, password):
|
||||
|
|
|
@ -12,7 +12,7 @@ openerp.auth_oauth = function(instance) {
|
|||
} else if(this.params.oauth_error === 2) {
|
||||
this.do_warn("Authentication error","");
|
||||
}
|
||||
return d.then(this.do_oauth_load).fail(function() {
|
||||
return d.done(this.do_oauth_load).fail(function() {
|
||||
self.do_oauth_load([]);
|
||||
});
|
||||
},
|
||||
|
@ -23,7 +23,7 @@ openerp.auth_oauth = function(instance) {
|
|||
do_oauth_load: function() {
|
||||
var db = this.$("form [name=db]").val();
|
||||
if (db) {
|
||||
this.rpc("/auth_oauth/list_providers", { dbname: db }).then(this.on_oauth_loaded);
|
||||
this.rpc("/auth_oauth/list_providers", { dbname: db }).done(this.on_oauth_loaded);
|
||||
}
|
||||
},
|
||||
on_oauth_loaded: function(result) {
|
||||
|
@ -36,7 +36,10 @@ openerp.auth_oauth = function(instance) {
|
|||
ev.preventDefault();
|
||||
var index = $(ev.target).data('index');
|
||||
var p = this.oauth_providers[index];
|
||||
var ret = location.protocol+"//"+location.host+"/";
|
||||
var ret = _.str.sprintf('%s//%s/auth_oauth/signin', location.protocol, location.host);
|
||||
if (instance.session.debug) {
|
||||
ret += '?debug';
|
||||
}
|
||||
var dbname = self.$("form [name=db]").val();
|
||||
var state_object = {
|
||||
d: dbname,
|
||||
|
@ -55,16 +58,4 @@ openerp.auth_oauth = function(instance) {
|
|||
},
|
||||
});
|
||||
|
||||
instance.web.WebClient = instance.web.WebClient.extend({
|
||||
start: function() {
|
||||
this._super.apply(this, arguments);
|
||||
var params = $.deparam(window.location.hash.substring(1));
|
||||
// alert(JSON.stringify(params));
|
||||
if (params.hasOwnProperty('access_token')) {
|
||||
var url = "/auth_oauth/signin" + '?' + $.param(params);
|
||||
window.location = url;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
};
|
||||
|
|
|
@ -69,7 +69,7 @@ instance.web.Login = instance.web.Login.extend({
|
|||
_check_error: function() {
|
||||
var self = this;
|
||||
if (this.params.loginerror !== undefined) {
|
||||
this.rpc('/auth_openid/login/status', {}).then(function(result) {
|
||||
this.rpc('/auth_openid/login/status', {}).done(function(result) {
|
||||
if (_.contains(['success', 'failure'], result.status) && result.message) {
|
||||
self.do_warn('Invalid OpenID Login', result.message);
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ instance.web.Login = instance.web.Login.extend({
|
|||
|
||||
do_openid_login: function(db, openid_url) {
|
||||
var self = this;
|
||||
this.rpc('/auth_openid/login/verify', {'db': db, 'url': openid_url}).then(function(result) {
|
||||
this.rpc('/auth_openid/login/verify', {'db': db, 'url': openid_url}).done(function(result) {
|
||||
if (result.error) {
|
||||
self.do_warn(result.title, result.error);
|
||||
return;
|
||||
|
|
|
@ -20,11 +20,10 @@
|
|||
##############################################################################
|
||||
import logging
|
||||
|
||||
import werkzeug
|
||||
|
||||
import openerp
|
||||
from openerp.modules.registry import RegistryManager
|
||||
from openerp.addons.web.controllers.main import login_and_redirect
|
||||
|
||||
from ..res_users import SignupError
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -41,22 +40,18 @@ class Controller(openerp.addons.web.http.Controller):
|
|||
user_info = res_partner.signup_retrieve_info(cr, openerp.SUPERUSER_ID, token)
|
||||
return user_info
|
||||
|
||||
@openerp.addons.web.http.httprequest
|
||||
def signup(self, req, dbname, token, name, login, password, state=''):
|
||||
""" sign up a user (new or existing), and log it in """
|
||||
url = '/'
|
||||
@openerp.addons.web.http.jsonrequest
|
||||
def signup(self, req, dbname, token, name, login, password):
|
||||
""" sign up a user (new or existing)"""
|
||||
registry = RegistryManager.get(dbname)
|
||||
with registry.cursor() as cr:
|
||||
try:
|
||||
res_users = registry.get('res.users')
|
||||
values = {'name': name, 'login': login, 'password': password}
|
||||
credentials = res_users.signup(cr, openerp.SUPERUSER_ID, values, token)
|
||||
try:
|
||||
res_users.signup(cr, openerp.SUPERUSER_ID, values, token)
|
||||
except SignupError, e:
|
||||
return {'error': openerp.tools.exception_to_unicode(e)}
|
||||
cr.commit()
|
||||
return login_and_redirect(req, *credentials, redirect_url='/#%s'%state)
|
||||
except Exception as e:
|
||||
# signup error
|
||||
_logger.exception('error when signup')
|
||||
url = "/#action=login&error_message=%s" % werkzeug.urls.url_quote(e.message)
|
||||
return werkzeug.utils.redirect(url)
|
||||
return {}
|
||||
|
||||
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -29,6 +29,9 @@ from openerp import SUPERUSER_ID
|
|||
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
|
||||
from openerp.tools.safe_eval import safe_eval
|
||||
|
||||
class SignupError(Exception):
|
||||
pass
|
||||
|
||||
def random_token():
|
||||
# the token has an entropy of about 120 bits (6 bits/char * 20 chars)
|
||||
chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
||||
|
@ -101,12 +104,12 @@ class res_partner(osv.Model):
|
|||
partner_ids = self.search(cr, uid, [('signup_token', '=', token)], context=context)
|
||||
if not partner_ids:
|
||||
if raise_exception:
|
||||
raise Exception("Signup token '%s' is not valid" % token)
|
||||
raise SignupError("Signup token '%s' is not valid" % token)
|
||||
return False
|
||||
partner = self.browse(cr, uid, partner_ids[0], context)
|
||||
if check_validity and not partner.signup_valid:
|
||||
if raise_exception:
|
||||
raise Exception("Signup token '%s' is no longer valid" % token)
|
||||
raise SignupError("Signup token '%s' is no longer valid" % token)
|
||||
return False
|
||||
return partner
|
||||
|
||||
|
@ -194,7 +197,7 @@ class res_users(osv.Model):
|
|||
# check that uninvited users may sign up
|
||||
if 'partner_id' not in values:
|
||||
if not safe_eval(ir_config_parameter.get_param(cr, uid, 'auth_signup.allow_uninvited', 'False')):
|
||||
raise Exception('Signup is not allowed for uninvited users')
|
||||
raise SignupError('Signup is not allowed for uninvited users')
|
||||
|
||||
# create a copy of the template user (attached to a specific partner_id if given)
|
||||
values['active'] = True
|
||||
|
|
|
@ -8,12 +8,20 @@ openerp.auth_signup = function(instance) {
|
|||
var d = this._super();
|
||||
|
||||
// to switch between the signup and regular login form
|
||||
this.$('a.oe_signup_signup').click(function() {
|
||||
this.$('a.oe_signup_signup').click(function(ev) {
|
||||
if (ev) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
self.$el.addClass("oe_login_signup");
|
||||
return false;
|
||||
});
|
||||
this.$('a.oe_signup_back').click(function() {
|
||||
this.$('a.oe_signup_back').click(function(ev) {
|
||||
if (ev) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
self.$el.removeClass("oe_login_signup");
|
||||
delete self.params.token;
|
||||
return false;
|
||||
});
|
||||
|
||||
// if there is an error message in params, show it then forget it
|
||||
|
@ -33,7 +41,7 @@ openerp.auth_signup = function(instance) {
|
|||
on_token_loaded: function(result) {
|
||||
// select the right the database
|
||||
this.selected_db = result.db;
|
||||
this.on_db_loaded({db_list: [result.db]});
|
||||
this.on_db_loaded([result.db]);
|
||||
if (result.token) {
|
||||
// switch to signup mode, set user name and login
|
||||
this.$el.addClass("oe_login_signup");
|
||||
|
@ -72,16 +80,16 @@ openerp.auth_signup = function(instance) {
|
|||
this.do_warn("Login", "No database selected !");
|
||||
return false;
|
||||
} else if (!name) {
|
||||
this.do_warn("Login", "Please enter a name.")
|
||||
this.do_warn("Login", "Please enter a name.");
|
||||
return false;
|
||||
} else if (!login) {
|
||||
this.do_warn("Login", "Please enter a username.")
|
||||
this.do_warn("Login", "Please enter a username.");
|
||||
return false;
|
||||
} else if (!password || !confirm_password) {
|
||||
this.do_warn("Login", "Please enter a password and confirm it.")
|
||||
this.do_warn("Login", "Please enter a password and confirm it.");
|
||||
return false;
|
||||
} else if (password !== confirm_password) {
|
||||
this.do_warn("Login", "Passwords do not match; please retype them.")
|
||||
this.do_warn("Login", "Passwords do not match; please retype them.");
|
||||
return false;
|
||||
}
|
||||
var params = {
|
||||
|
@ -90,10 +98,19 @@ openerp.auth_signup = function(instance) {
|
|||
name: name,
|
||||
login: login,
|
||||
password: password,
|
||||
state: $.param(this.params)
|
||||
//state: $.param(this.params)
|
||||
};
|
||||
var url = "/auth_signup/signup?" + $.param(params);
|
||||
window.location = url;
|
||||
|
||||
var self = this,
|
||||
super_ = this._super;
|
||||
this.rpc('/auth_signup/signup', params)
|
||||
.done(function(result) {
|
||||
if (result.error) {
|
||||
self.show_error(result.error);
|
||||
} else {
|
||||
super_.apply(self, [ev]);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// regular login
|
||||
this._super(ev);
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="model_id"/>
|
||||
<field name="model" invisible="1"/>
|
||||
<field name="filter_id" domain="[('model_id','=',model)]" context="{'default_model_id': model}"/>
|
||||
<field name="sequence"/>
|
||||
<field name="active"/>
|
||||
<field name="model" invisible="1"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Conditions">
|
||||
|
|
|
@ -8,15 +8,14 @@ msgstr ""
|
|||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-05-10 17:24+0000\n"
|
||||
"Last-Translator: Jordi Esteve (www.zikzakmedia.com) "
|
||||
"<jesteve@zikzakmedia.com>\n"
|
||||
"PO-Revision-Date: 2012-11-09 12:09+0000\n"
|
||||
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
|
||||
"Language-Team: Spanish <es@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: 2012-10-30 05:32+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-10 04:59+0000\n"
|
||||
"X-Generator: Launchpad (build 16251)\n"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_mail_to_user:0
|
||||
|
@ -340,7 +339,7 @@ msgstr "Activo"
|
|||
#: code:addons/base_action_rule/base_action_rule.py:329
|
||||
#, python-format
|
||||
msgid "No Email ID Found for your Company address!"
|
||||
msgstr ""
|
||||
msgstr "¡No se ha encontrado Id del e-mail para la dirección de su compañía!"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_remind_user:0
|
||||
|
|
|
@ -336,7 +336,7 @@ class calendar_attendee(osv.osv):
|
|||
('non-participant', 'For information Purpose')], 'Role', \
|
||||
help='Participation role for the calendar user'),
|
||||
'state': fields.selection([('needs-action', 'Needs Action'),
|
||||
('tentative', 'Tentative'),
|
||||
('tentative', 'Uncertain'),
|
||||
('declined', 'Declined'),
|
||||
('accepted', 'Accepted'),
|
||||
('delegated', 'Delegated')], 'Status', readonly=True, \
|
||||
|
@ -559,7 +559,8 @@ property or property parameter."),
|
|||
for vals in self.browse(cr, uid, ids, context=context):
|
||||
if vals.ref and vals.ref.user_id:
|
||||
mod_obj = self.pool.get(vals.ref._name)
|
||||
defaults = {'user_id': vals.user_id.id, 'organizer_id': vals.ref.user_id.id}
|
||||
res=mod_obj.read(cr,uid,[vals.ref.id],['duration','class'],context)
|
||||
defaults = {'user_id': vals.user_id.id, 'organizer_id': vals.ref.user_id.id,'duration':res[0]['duration'],'class':res[0]['class']}
|
||||
mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context)
|
||||
self.write(cr, uid, vals.id, {'state': 'accepted'}, context)
|
||||
|
||||
|
@ -1012,7 +1013,7 @@ class calendar_event(osv.osv):
|
|||
'Show Time as', states={'done': [('readonly', True)]}),
|
||||
'base_calendar_url': fields.char('Caldav URL', size=264),
|
||||
'state': fields.selection([
|
||||
('tentative', 'Tentative'),
|
||||
('tentative', 'Uncertain'),
|
||||
('cancelled', 'Cancelled'),
|
||||
('confirmed', 'Confirmed'),
|
||||
], 'Status', readonly=True),
|
||||
|
|
|
@ -89,7 +89,8 @@
|
|||
<page string="Meeting Details">
|
||||
<group>
|
||||
<group>
|
||||
<field name="date" string="Starting at"/>
|
||||
<field name="date" string="Starting at"
|
||||
on_change="onchange_dates(date, duration, False, allday)"/>
|
||||
<label for="duration"/>
|
||||
<div>
|
||||
<field name="duration" widget="float_time"
|
||||
|
@ -100,7 +101,7 @@
|
|||
<label for="allday" string="All Day?"/>)
|
||||
</div>
|
||||
<field name="date_deadline" groups="base.group_no_one"
|
||||
attrs="{'invisible': [('allday','=',True)]}"
|
||||
attrs="{'invisible': ['|', ('allday','=',True), ('duration','<', 24)]}"
|
||||
on_change="onchange_dates(date,False,date_deadline)"/>
|
||||
</group>
|
||||
<group>
|
||||
|
@ -220,7 +221,7 @@
|
|||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
<field name="message_ids" widget="mail_thread" placeholder="Share a message..."/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -1146,7 +1146,7 @@ msgstr ""
|
|||
#: selection:calendar.attendee,state:0
|
||||
#: selection:calendar.event,state:0
|
||||
#: selection:calendar.todo,state:0
|
||||
msgid "Tentative"
|
||||
msgid "Uncertain"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_calendar
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
'description': """
|
||||
Automated Translations through Gengo API
|
||||
----------------------------------------
|
||||
|
||||
This module will install passive scheduler job for automated translations
|
||||
using the Gengo API. To activate it, you must
|
||||
1) Configure your Gengo authentication parameters under `Settings > Companies > Gengo Parameters`
|
||||
|
|
|
@ -19,19 +19,24 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
import logging
|
||||
import re
|
||||
import time
|
||||
|
||||
from openerp.osv import osv, fields
|
||||
from openerp import tools
|
||||
from openerp.tools.translate import _
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
from mygengo import MyGengo
|
||||
except ImportError:
|
||||
raise osv.except_osv(_('Gengo ImportError'), _('Please install mygengo lib from http://pypi.python.org/pypi/mygengo'))
|
||||
|
||||
import logging
|
||||
import tools
|
||||
import time
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
_logger.warning('Gengo library not found, Gengo features disabled. If you plan to use it, please install the mygengo library from http://pypi.python.org/pypi/mygengo')
|
||||
class MyGengo(object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
# no context for translations - so don't bother
|
||||
raise ImportError('Gengo library not found, please install mygengo from http://pypi.python.org/pypi/mygengo')
|
||||
|
||||
GENGO_DEFAULT_LIMIT = 20
|
||||
|
||||
|
@ -48,7 +53,7 @@ class base_gengo_translations(osv.osv_memory):
|
|||
_name = 'base.gengo.translations'
|
||||
_columns = {
|
||||
'restart_send_job': fields.boolean("Restart Sending Job"),
|
||||
'lang_id': fields.many2one('res.lang', 'Language', help="Leave empty if you don't want to restrict the request to a single language"),
|
||||
'lang_id': fields.many2one('res.lang', 'Language', required=True),
|
||||
}
|
||||
|
||||
def gengo_authentication(self, cr, uid, context=None):
|
||||
|
@ -62,21 +67,19 @@ class base_gengo_translations(osv.osv_memory):
|
|||
by the cron) or in a dialog box (if requested by the user), thus it's important to return it
|
||||
translated.
|
||||
'''
|
||||
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
if not user.company_id.gengo_public_key or not user.company_id.gengo_private_key:
|
||||
return (False, _("Invalid Gengo configuration. Gengo authentication `Public Key` or `Private Key` is missing. Complete Gengo authentication parameters under `Settings > Companies > Gengo Parameters`."))
|
||||
return (False, _("Gengo `Public Key` or `Private Key` are missing. Enter your Gengo authentication parameters under `Settings > Companies > Gengo Parameters`."))
|
||||
try:
|
||||
gengo = MyGengo(
|
||||
public_key=user.company_id.gengo_public_key.encode('ascii'),
|
||||
private_key=user.company_id.gengo_private_key.encode('ascii'),
|
||||
sandbox=True,
|
||||
)
|
||||
gengo.getAccountStats()
|
||||
|
||||
return (True, gengo)
|
||||
except Exception, e:
|
||||
return (False, _("Gengo Connection Error\n%s") %e)
|
||||
_logger.exception('Gengo connection failed')
|
||||
return (False, _("Gengo connection failed with this message:\n``%s``") % e)
|
||||
|
||||
def do_check_schedular(self, cr, uid, xml_id, name, fn, context=None):
|
||||
"""
|
||||
|
@ -87,7 +90,7 @@ class base_gengo_translations(osv.osv_memory):
|
|||
cron_vals.update({'name': name, "function": fn})
|
||||
try:
|
||||
res = []
|
||||
model, res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base_gengo', xml_id)
|
||||
_, res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base_gengo', xml_id)
|
||||
cron_pool.write(cr, uid, [res], cron_vals, context=context)
|
||||
except:
|
||||
#the cron job was not found, probably deleted previously, so we create it again using default values
|
||||
|
@ -207,8 +210,6 @@ class base_gengo_translations(osv.osv_memory):
|
|||
Send a request to Gengo with all the term_ids in a different job, get the response and update the terms in
|
||||
database accordingly.
|
||||
"""
|
||||
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
flag, gengo = self.gengo_authentication(cr, uid, context=context)
|
||||
if flag:
|
||||
request = self.pack_jobs_request(cr, uid, term_ids, context=context)
|
||||
|
|
|
@ -6,15 +6,10 @@
|
|||
<field name="model">base.gengo.translations</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Gengo Request Form" version="7.0">
|
||||
<group col="4">
|
||||
<group>
|
||||
<field name="lang_id" required="1"/>
|
||||
<field name="lang_id"/>
|
||||
<field name="restart_send_job"/>
|
||||
</group>
|
||||
<group>
|
||||
<label colspan="2" string="Leave empty for requesting all the terms to Gengo that needs it, regardless of their language"/>
|
||||
</group>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="act_update" string="Send" type="object" class="oe_highlight"/>
|
||||
or
|
||||
|
|
|
@ -99,6 +99,8 @@ class res_partner_bank(osv.osv):
|
|||
@param iban: IBAN as string
|
||||
@return: True if IBAN is valid, False otherwise
|
||||
"""
|
||||
if not iban:
|
||||
return False
|
||||
iban = _format_iban(iban).lower()
|
||||
if iban[:2] in _ref_iban and len(iban) != len(_format_iban(_ref_iban[iban[:2]])):
|
||||
return False
|
||||
|
@ -128,9 +130,9 @@ class res_partner_bank(osv.osv):
|
|||
def _construct_constraint_msg(self, cr, uid, ids, context=None):
|
||||
|
||||
def default_iban_check(iban_cn):
|
||||
return iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase
|
||||
return iban_cn and iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase
|
||||
|
||||
iban_country = self.browse(cr, uid, ids)[0].acc_number[:2].lower()
|
||||
iban_country = self.browse(cr, uid, ids)[0].acc_number and self.browse(cr, uid, ids)[0].acc_number[:2].lower()
|
||||
if default_iban_check(iban_country):
|
||||
if iban_country in _ref_iban:
|
||||
return _('The IBAN does not seem to be correct. You should have entered something like this %s'), \
|
||||
|
|
|
@ -24,9 +24,12 @@ Re-implement openerp's file import system:
|
|||
'category': 'Uncategorized',
|
||||
'website': 'http://www.openerp.com',
|
||||
'author': 'OpenERP SA',
|
||||
'depends': ['base'],
|
||||
'depends': ['web'],
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
'auto_install': False,
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'css': [
|
||||
'static/lib/select2/select2.css',
|
||||
'static/src/css/import.css',
|
||||
|
@ -37,4 +40,5 @@ Re-implement openerp's file import system:
|
|||
'static/src/js/import.js',
|
||||
],
|
||||
'qweb': ['static/src/xml/import.xml'],
|
||||
'test': ['static/test/states.js'],
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_base_import_tests_models_char,base.import.tests.models.char,model_base_import_tests_models_char,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_char_required,base.import.tests.models.char.required,model_base_import_tests_models_char_required,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_char_readonly,base.import.tests.models.char.readonly,model_base_import_tests_models_char_readonly,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_char_states,base.import.tests.models.char.states,model_base_import_tests_models_char_states,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_char_noreadonly,base.import.tests.models.char.noreadonly,model_base_import_tests_models_char_noreadonly,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_char_stillreadonly,base.import.tests.models.char.stillreadonly,model_base_import_tests_models_char_stillreadonly,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_m2o,base.import.tests.models.m2o,model_base_import_tests_models_m2o,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_m2o_related,base.import.tests.models.m2o.related,model_base_import_tests_models_m2o_related,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_m2o_required,base.import.tests.models.m2o.required,model_base_import_tests_models_m2o_required,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_m2o_required_related,base.import.tests.models.m2o.required.related,model_base_import_tests_models_m2o_required_related,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_o2m,base.import.tests.models.o2m,model_base_import_tests_models_o2m,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_o2m_child,base.import.tests.models.o2m.child,model_base_import_tests_models_o2m_child,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_preview,base.import.tests.models.preview,model_base_import_tests_models_preview,base.group_user,1,1,1,1
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
External ID,Name,Parent Category/External ID
|
||||
a1,Expenses,product.product_category_all
|
||||
a2,Other Products,product.product_category_all
|
||||
a3,Sellable Products,product.product_category_all
|
||||
a4,Tables,a1
|
||||
a5,Seating furniture,a2
|
|
|
@ -0,0 +1,6 @@
|
|||
External ID,Name,Internal Reference,Category/External ID,Can be Expensed,Can be Purchased,Can be Sold,Sale Price,Cost,Supply Method,Product Type,Procurement Method
|
||||
a6,Aluminum Stool,ALS,a5,False,True,True,49.00,25.00,Buy,Stockable Product,Make to Stock
|
||||
a7,Chair,CHR,a5,False,True,True,89.00,40.00,Buy,Stockable Product,Make to Stock
|
||||
a8,Table,TBL,a4,False,True,True,169.00,100.00,Buy,Stockable Product,Make to Stock
|
||||
a9,Software Book Tutorial,SBT,a2,False,True,False,19.00,8.00,Buy,Consumable,Make to Stock
|
||||
a10,Fuel,FL,a1,True,False,False,0.30,0.25,Buy,Service,Make to Stock
|
|
|
@ -0,0 +1,6 @@
|
|||
Name,Internal Reference,Can be Expensed,Can be Purchased,Can be Sold,Sale Price,Cost,Supply Method,Product Type,Procurement Method
|
||||
Aluminum Stool,ALS,False,True,True,49.00,25.00,Buy,Stockable Product,Make to Stock
|
||||
Chair,CHR,False,True,True,89.00,40.00,Buy,Stockable Product,Make to Stock
|
||||
Table,TBL,False,True,True,169.00,100.00,Buy,Stockable Product,Make to Stock
|
||||
Software Book Tutorial,SBT,False,True,False,19.00,8.00,Buy,Consumable,Make to Stock
|
||||
Fuel,FL,True,False,False,0.30,0.25,Buy,Service,Make to Stock
|
|
|
@ -0,0 +1,155 @@
|
|||
--
|
||||
-- PostgreSQL database dump
|
||||
--
|
||||
|
||||
SET statement_timeout = 0;
|
||||
SET client_encoding = 'UTF8';
|
||||
SET standard_conforming_strings = off;
|
||||
SET check_function_bodies = false;
|
||||
SET client_min_messages = warning;
|
||||
SET escape_string_warning = off;
|
||||
|
||||
SET search_path = public, pg_catalog;
|
||||
|
||||
SET default_tablespace = '';
|
||||
|
||||
SET default_with_oids = false;
|
||||
|
||||
--
|
||||
-- Name: companies; Type: TABLE; Schema: public; Owner: fp; Tablespace:
|
||||
--
|
||||
|
||||
CREATE TABLE companies (
|
||||
id integer NOT NULL,
|
||||
company_name character varying
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE public.companies OWNER TO fp;
|
||||
|
||||
--
|
||||
-- Name: companies_id_seq; Type: SEQUENCE; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
CREATE SEQUENCE companies_id_seq
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
ALTER TABLE public.companies_id_seq OWNER TO fp;
|
||||
|
||||
--
|
||||
-- Name: companies_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
ALTER SEQUENCE companies_id_seq OWNED BY companies.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: companies_id_seq; Type: SEQUENCE SET; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
SELECT pg_catalog.setval('companies_id_seq', 3, true);
|
||||
|
||||
|
||||
--
|
||||
-- Name: persons; Type: TABLE; Schema: public; Owner: fp; Tablespace:
|
||||
--
|
||||
|
||||
CREATE TABLE persons (
|
||||
id integer NOT NULL,
|
||||
company_id integer,
|
||||
person_name character varying
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE public.persons OWNER TO fp;
|
||||
|
||||
--
|
||||
-- Name: persons_id_seq; Type: SEQUENCE; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
CREATE SEQUENCE persons_id_seq
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
ALTER TABLE public.persons_id_seq OWNER TO fp;
|
||||
|
||||
--
|
||||
-- Name: persons_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
ALTER SEQUENCE persons_id_seq OWNED BY persons.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: persons_id_seq; Type: SEQUENCE SET; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
SELECT pg_catalog.setval('persons_id_seq', 4, true);
|
||||
|
||||
|
||||
--
|
||||
-- Name: id; Type: DEFAULT; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY companies ALTER COLUMN id SET DEFAULT nextval('companies_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: id; Type: DEFAULT; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY persons ALTER COLUMN id SET DEFAULT nextval('persons_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Data for Name: companies; Type: TABLE DATA; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
COPY companies (id, company_name) FROM stdin;
|
||||
1 Bigees
|
||||
2 Organi
|
||||
3 Boum
|
||||
\.
|
||||
|
||||
|
||||
--
|
||||
-- Data for Name: persons; Type: TABLE DATA; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
COPY persons (id, company_id, person_name) FROM stdin;
|
||||
1 1 Fabien
|
||||
2 1 Laurence
|
||||
3 2 Eric
|
||||
4 3 Ramsy
|
||||
\.
|
||||
|
||||
|
||||
--
|
||||
-- Name: companies_pkey; Type: CONSTRAINT; Schema: public; Owner: fp; Tablespace:
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY companies
|
||||
ADD CONSTRAINT companies_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: persons_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: fp
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY persons
|
||||
ADD CONSTRAINT persons_company_id_fkey FOREIGN KEY (company_id) REFERENCES companies(id);
|
||||
|
||||
|
||||
--
|
||||
-- PostgreSQL database dump complete
|
||||
--
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
Name,Reference,Tags,Customer,Street,City,Country
|
||||
Credit & Leasing,3,Services,True,Central Avenue 814,Johannesburg,South Africa
|
||||
Services & Finance,5,"Consultancy Services,IT Services",True,Grove Road 5,London,United Kingdom
|
||||
Hydra Supplies,6,"Manufacturer,Retailer",True,Palm Street 9,Los Angeles,United States
|
||||
Bolts & Screws,8,"Wholesaler,Components Buyer",True,Rua Américo 1000,Campinas,Brazil
|
||||
National Parts & Supplies,18,"Manufacturer,Wholesaler",True,Guangdong Way 20,Shenzen,China
|
|
|
@ -0,0 +1,10 @@
|
|||
Order Date,Order Reference,Supplier,Destination,Pricelist,Order Lines / Product,Order Lines / Quantity
|
||||
2012-12-15,PO00008,ASUSTeK,Stock,Default Purchase Pricelist,ADPT,20
|
||||
,,,,,CARD,30
|
||||
,,,,,C-Case,40
|
||||
2012-12-15,PO00009,Axelor,Stock,Default Purchase Pricelist,CD,5
|
||||
,,,,,CPUa8,15
|
||||
2012-12-15,PO000010,China Export,Stock,Default Purchase Pricelist,HDD SH-1,10
|
||||
,,,,,HDD SH-2,20
|
||||
,,,,,LAP-CUS,35
|
||||
,,,,,LAP-E5,40
|
|
|
@ -0,0 +1,8 @@
|
|||
Name,Address type,Street,City,Country,Tags,Supplier,Customer,Is a company,Companies that refers to partner / Parent company
|
||||
Wood y Wood Pecker,,"Snow Street, 25",Kainuu,Finland,Supplier,1,0,1,
|
||||
Roger Pecker,Default,"Snow Street, 27",Kainuu,Finland,Supplier,1,0,0,Wood y Wood Pecker
|
||||
Sharon Pecker,Delivery,"Snow Street, 28",Kainuu,Finland,Supplier,1,0,0,Wood y Wood Pecker
|
||||
Thomas Pecker,Contact,"Snow Street, 27",Kainuu,Finland,Supplier,1,0,0,Wood y Wood Pecker
|
||||
Vicking Direct,,"Atonium Street, 45a",Brussels,Belgium,Supplier,1,0,1,
|
||||
Yvan Holiday,Invoice,"Atonium Street, 45b",Brussels,Belgium,Supplier,1,0,0,Vicking Direct
|
||||
Jack Unsworth,Contact,"Atonium Street, 45a",Brussels,Belgium,Supplier,1,0,0,Vicking Direct
|
|
|
@ -0,0 +1,6 @@
|
|||
"Order Reference","Supplier","Destination","Pricelist","Order Lines / Product","Order Lines / Quantity"
|
||||
"PO000020","ASUSTeK","Stock","Default Purchase Pricelist","ADPT",20
|
||||
,,,,"CARD",30
|
||||
,,,,"C-Case",40
|
||||
"PO000021","Axelor","Stock","Default Purchase Pricelist","CD",5
|
||||
,,,,"CPUa8",15
|
|
|
@ -1,14 +1,17 @@
|
|||
.oe_import{
|
||||
display: inline-block;
|
||||
width: 600px;
|
||||
padding: 16px;
|
||||
}
|
||||
.oe_import > p {
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
text-align: justify
|
||||
}
|
||||
|
||||
.oe_import h2 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.oe_padding {
|
||||
padding: 13px;
|
||||
}
|
||||
/* ----------- IMPORT BOX ----------- */
|
||||
|
||||
.oe_import .oe_import_box{
|
||||
|
@ -17,6 +20,7 @@
|
|||
background: #F0EEEE;
|
||||
border-radius: 3px;
|
||||
border: solid 1px #dddddd;
|
||||
width: 600px;
|
||||
}
|
||||
.oe_import .oe_import_toggle{
|
||||
margin-top: 8px;
|
||||
|
|
|
@ -123,10 +123,10 @@ openerp.base_import = function (instance) {
|
|||
this.exit();
|
||||
}
|
||||
},
|
||||
init: function (parent, params) {
|
||||
init: function (parent, action) {
|
||||
var self = this;
|
||||
this._super.apply(this, arguments);
|
||||
this.res_model = params.model;
|
||||
this.res_model = action.params.model;
|
||||
// import object id
|
||||
this.id = null;
|
||||
this.Import = new instance.web.Model('base_import.import');
|
||||
|
@ -139,7 +139,7 @@ openerp.base_import = function (instance) {
|
|||
this._super(),
|
||||
this.Import.call('create', [{
|
||||
'res_model': this.res_model
|
||||
}]).then(function (id) {
|
||||
}]).done(function (id) {
|
||||
self.id = id;
|
||||
self.$('input[name=import_id]').val(id);
|
||||
})
|
||||
|
@ -179,7 +179,8 @@ openerp.base_import = function (instance) {
|
|||
|
||||
//- File & settings change section
|
||||
onfile_loaded: function () {
|
||||
this.$('.oe_import_button').prop('disabled', true);
|
||||
this.$('.oe_import_button, .oe_import_file_reload')
|
||||
.prop('disabled', true);
|
||||
if (!this.$('input.oe_import_file').val()) { return; }
|
||||
|
||||
this.$el.removeClass('oe_import_preview oe_import_error');
|
||||
|
@ -189,7 +190,8 @@ openerp.base_import = function (instance) {
|
|||
},
|
||||
onpreviewing: function () {
|
||||
var self = this;
|
||||
this.$('.oe_import_button').prop('disabled', true);
|
||||
this.$('.oe_import_button, .oe_import_file_reload')
|
||||
.prop('disabled', true);
|
||||
this.$el.addClass('oe_import_with_file');
|
||||
// TODO: test that write // succeeded?
|
||||
this.$el.removeClass('oe_import_preview_error oe_import_error');
|
||||
|
@ -198,13 +200,14 @@ openerp.base_import = function (instance) {
|
|||
!this.$('input.oe_import_has_header').prop('checked'));
|
||||
this.Import.call(
|
||||
'parse_preview', [this.id, this.import_options()])
|
||||
.then(function (result) {
|
||||
.done(function (result) {
|
||||
var signal = result.error ? 'preview_failed' : 'preview_succeeded';
|
||||
self[signal](result);
|
||||
});
|
||||
},
|
||||
onpreview_error: function (event, from, to, result) {
|
||||
this.$('.oe_import_options').show();
|
||||
this.$('.oe_import_file_reload').prop('disabled', false);
|
||||
this.$el.addClass('oe_import_preview_error oe_import_error');
|
||||
this.$('.oe_import_error_report').html(
|
||||
QWeb.render('ImportView.preview.error', result));
|
||||
|
@ -212,7 +215,8 @@ openerp.base_import = function (instance) {
|
|||
onpreview_success: function (event, from, to, result) {
|
||||
this.$('.oe_import_import').removeClass('oe_highlight');
|
||||
this.$('.oe_import_validate').addClass('oe_highlight');
|
||||
this.$('.oe_import_button').prop('disabled', false);
|
||||
this.$('.oe_import_button, .oe_import_file_reload')
|
||||
.prop('disabled', false);
|
||||
this.$el.addClass('oe_import_preview');
|
||||
this.$('table').html(QWeb.render('ImportView.preview', result));
|
||||
|
||||
|
@ -337,11 +341,11 @@ openerp.base_import = function (instance) {
|
|||
},
|
||||
onvalidate: function () {
|
||||
return this.call_import({ dryrun: true })
|
||||
.then(this.proxy('validated'));
|
||||
.done(this.proxy('validated'));
|
||||
},
|
||||
onimport: function () {
|
||||
var self = this;
|
||||
return this.call_import({ dryrun: false }).then(function (message) {
|
||||
return this.call_import({ dryrun: false }).done(function (message) {
|
||||
if (!_.any(message, function (message) {
|
||||
return message.type === 'error' })) {
|
||||
self['import_succeeded']();
|
||||
|
|
|
@ -2,7 +2,14 @@
|
|||
<t t-name="ImportView">
|
||||
<t t-set="_id" t-value="_.uniqueId('export')"/>
|
||||
<form action="" method="post" enctype="multipart/form-data" class="oe_import">
|
||||
<header>
|
||||
<div class="oe_view_manager oe_view_manager_current">
|
||||
<div class="oe_view_manager_header oe_padding">
|
||||
<h2>
|
||||
Import a CSV File
|
||||
</h2>
|
||||
<input type="hidden" name="session_id"
|
||||
t-att-value="widget.session.session_id"/>
|
||||
<input type="hidden" name="import_id"/>
|
||||
<button type="button" disabled="disabled"
|
||||
class="oe_button oe_import_button oe_import_validate oe_highlight"
|
||||
>Validate</button>
|
||||
|
@ -11,11 +18,9 @@
|
|||
>Import</button>
|
||||
<span class="oe_fade">or</span>
|
||||
<a class="oe_import_cancel" href="#">Cancel</a>
|
||||
</header>
|
||||
<input type="hidden" name="session_id"
|
||||
t-att-value="widget.session.session_id"/>
|
||||
<input type="hidden" name="import_id"/>
|
||||
<h2>Upload your file</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Select the <a
|
||||
href="http://en.wikipedia.org/wiki/Comma-separated_values"
|
||||
class="oe_import_csv" target="_blank">.CSV</a>
|
||||
|
@ -25,7 +30,9 @@
|
|||
<label t-attf-for="file_#{_id}" autofocus="autofocus">CSV File:</label>
|
||||
<input type="file" id-attf-id="file_#{_id}"
|
||||
name="file" class="oe_import_file"/>
|
||||
<button type="button" class="oe_import_file_reload">
|
||||
<button type="button" class="oe_import_file_reload"
|
||||
disabled="disabled"
|
||||
title="Reload data to check changes.">
|
||||
<img src="/web/static/src/img/icons/gtk-refresh.png"/>
|
||||
</button>
|
||||
<div class="oe_import_with_file">
|
||||
|
@ -44,7 +51,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="oe_import_with_file">
|
||||
<div class="oe_import_with_file oe_padding">
|
||||
<h2>Map your data to OpenERP</h2>
|
||||
<input type="checkbox" class="oe_import_has_header"
|
||||
id="oe_import_has_header" checked="checked"/>
|
||||
|
@ -59,6 +66,7 @@
|
|||
<table class="oe_import_grid" />
|
||||
|
||||
<h2>Frequently Asked Questions</h2>
|
||||
|
||||
<dl>
|
||||
<dt><a href="#" class="oe_import_toggle">
|
||||
Need to import data from an other application?</a></dt>
|
||||
|
@ -78,9 +86,259 @@
|
|||
whenever possible</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><a href="#" class="oe_import_toggle">
|
||||
What can I do when the Import preview table isn't
|
||||
displayed correctly?</a></dt>
|
||||
<dd>
|
||||
<p>By default the Import preview is set on commas as
|
||||
field separators and quotation marks as text
|
||||
delimiters. If your csv file does not have these
|
||||
settings, you can modify the File Format Options
|
||||
(displayed under the Browse CSV file bar after you
|
||||
select your file).</p> <p>Note that if your CSV file
|
||||
has a tabulation as separator, OpenERP will not
|
||||
detect the separations. You will need to change the
|
||||
file format options in your spreadsheet application.
|
||||
See the following question.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><a href="#" class="oe_import_toggle">
|
||||
How can I change the CSV file format options when
|
||||
saving in my spreadsheet application?</a></dt>
|
||||
<dd>
|
||||
<p>If you edit and save CSV files in speadsheet
|
||||
applications, your computer's regional settings will
|
||||
be applied for the separator and delimiter.
|
||||
We suggest you use OpenOffice or LibreOffice Calc
|
||||
as they will allow you to modify all three options
|
||||
(in 'Save As' dialog box > Check the box 'Edit filter
|
||||
settings' > Save).</p> <p>Microsoft Excel will allow
|
||||
you to modify only the encoding when saving
|
||||
(in 'Save As' dialog box > click 'Tools' dropdown
|
||||
list > Encoding tab).</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><a href="#" class="oe_import_toggle">
|
||||
What's the difference between Database ID and
|
||||
External ID?</a></dt>
|
||||
<dd>
|
||||
<p>Some fields define a relationship with another
|
||||
object. For example, the country of a contact is a
|
||||
link to a record of the 'Country' object. When you
|
||||
want to import such fields, OpenERP will have to
|
||||
recreate links between the different records.
|
||||
To help you import such fields, OpenERP provides 3
|
||||
mechanisms. You must use one and only one mechanism
|
||||
per field you want to import.</p> <p>For example, to
|
||||
reference the country of a contact, OpenERP proposes
|
||||
you 3 different fields to import: <ul>
|
||||
<li>Country: the name or code of the country</li>
|
||||
<li>Country/Database ID: the unique OpenERP ID for a
|
||||
record, defined by the ID postgresql column</li>
|
||||
<li>Country/External ID: the ID of this record
|
||||
referenced in another application (or the .XML file
|
||||
that imported it)</li> </ul></p> <p>For the country
|
||||
Belgium, you can use one of these 3 ways to import:
|
||||
<ul> <li>Country: Belgium</li> <li>Country/Database
|
||||
ID: 21</li> <li>Country/External ID: base.be</li>
|
||||
</ul></p> <p>According to your need, you should use
|
||||
one of these 3 ways to reference records in relations.
|
||||
Here is when you should use one or the other,
|
||||
according to your need: <ul> <li>Use Country: This is
|
||||
the easiest way when your data come from CSV files
|
||||
that have been created manually.</li> <li>Use
|
||||
Country/Database ID: You should rarely use this
|
||||
notation. It's mostly used by developers as it's main
|
||||
advantage is to never have conflicts (you may have
|
||||
several records with the same name, but they always
|
||||
have a unique Database ID)</li> <li>Use
|
||||
Country/External ID: Use External ID when you import
|
||||
data from a third party application.</li> </ul></p>
|
||||
<p>When you use External IDs, you can import CSV files
|
||||
with the "External ID" column to define the External
|
||||
ID of each record you import. Then, you will be able
|
||||
to make a reference to that record with columns like
|
||||
"Field/External ID". The following two CSV files give
|
||||
you an example for Products and their Categories.</p>
|
||||
<a href="/base_import/static/csv/External_id_3rd_party_application_product_categories.csv">CSV file for categories</a><br/>
|
||||
<a href="/base_import/static/csv/External_id_3rd_party_application_products.csv">CSV file for Products</a>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><a href="#" class="oe_import_toggle">
|
||||
What can I do if I have multiple matches for a field?
|
||||
</a></dt>
|
||||
<dd>
|
||||
<p>If for example you have two product categories
|
||||
with the child name "Sellable" (ie. "Misc.
|
||||
Products/Sellable" & "Other Products/Sellable"),
|
||||
your validation is halted but you may still import
|
||||
your data. However, we recommend you do not import the
|
||||
data because they will all be linked to the first
|
||||
'Sellable' category found in the Product Category list
|
||||
("Misc. Products/Sellable"). We recommend you modify
|
||||
one of the duplicates' values or your product category
|
||||
hierarchy.<br/>
|
||||
However if you do not wish to change your
|
||||
configuration of product categories, we recommend you
|
||||
use make use of the external ID for this field
|
||||
'Category'.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><a href="#" class="oe_import_toggle">
|
||||
How can I import a many2many relationship field
|
||||
(e.g. a customer that has multiple tags)?</a></dt>
|
||||
<dd>
|
||||
<p>The tags should be separated by a comma without any
|
||||
spacing. For example, if you want you customer to be
|
||||
lined to both tags 'Manufacturer' and 'Retailer'
|
||||
then you will encode it as follow "Manufacturer,
|
||||
Retailer" in the same column of your CSV file.</p>
|
||||
<a href="/base_import/static/csv/m2m_customers_tags.csv">
|
||||
CSV file for Manufacturer, Retailer</a><br/>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><a href="#" class="oe_import_toggle">
|
||||
How can I import a one2many relationship (e.g. several
|
||||
Order Lines of a Sale Order)?</a></dt>
|
||||
<dd>
|
||||
<p>If you want to import sales order having several
|
||||
order lines; for each order line, you need to reserve
|
||||
a specific row in the CSV file. The first order line
|
||||
will be imported on the same row as the information
|
||||
relative to order. Any additional lines will need an
|
||||
addtional row that does not have any information in
|
||||
the fields relative to the order.</p>
|
||||
<p>As an example, here is
|
||||
purchase.order_functional_error_line_cant_adpat.CSV
|
||||
file of some quotations you can import, based on demo
|
||||
data.</p>
|
||||
<a href="/base_import/static/csv/purchase.order_functional_error_line_cant_adpat.csv">File for some Quotations</a>
|
||||
<p>The following CSV file shows how to import purchase
|
||||
orders with their respective purchase order lines:</p>
|
||||
<a href="/base_import/static/csv/o2m_purchase_order_lines.csv">Purchase orders with their respective purchase order lines</a>
|
||||
<p>The following CSV file shows how to import
|
||||
suppliers and their respective contacts</p>
|
||||
<a href="/base_import/static/csv/o2m_suppliers_contacts.csv">Suppliers and their respective contacts</a>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<dl>
|
||||
<dt><a href="#" class="oe_import_toggle">
|
||||
Can I import several times the same record?</a></dt>
|
||||
<dd>
|
||||
<p>If you import a file that contains one of the
|
||||
column "External ID" or "Database ID", records that
|
||||
have already been imported will be modified instead of
|
||||
being created. This is very usefull as it allows you
|
||||
to import several times the same CSV file while having
|
||||
made some changes in between two imports. OpenERP will
|
||||
take care of creating or modifying each record
|
||||
depending if it's new or not.</p> <p> This feature
|
||||
allows you to use the Import/Export tool of OpenERP to
|
||||
modify a batch of records in your favorite spreadsheet
|
||||
application.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><a href="#" class="oe_import_toggle">
|
||||
What happens if I do not provide a value for a
|
||||
specific field?</a></dt>
|
||||
<dd>
|
||||
<p>If you do not set all fields in your CSV file,
|
||||
OpenERP will assign the default value for every non
|
||||
defined fields. But if you
|
||||
set fields with empty values in your CSV file, OpenERP
|
||||
will set the EMPTY value in the field, instead of
|
||||
assigning the default value.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><a href="#" class="oe_import_toggle">
|
||||
How to export/import different tables from an SQL
|
||||
application to OpenERP?</a></dt>
|
||||
<dd>
|
||||
<p>If you need to import data from different tables,
|
||||
you will have to recreate relations between records
|
||||
belonging to different tables. (e.g. if you import
|
||||
companies and persons, you will have to recreate the
|
||||
link between each person and the company they work
|
||||
for).</p> <p>To manage relations between tables,
|
||||
you can use the "External ID" facilities of OpenERP.
|
||||
The "External ID" of a record is the unique identifier
|
||||
of this record in another application. This "External
|
||||
ID" must be unique accoss all the records of all
|
||||
objects, so it's a good practice to prefix this
|
||||
"External ID" with the name of the application or
|
||||
table. (like 'company_1', 'person_1' instead of '1')
|
||||
</p> <p>As an example, suppose you have a SQL database
|
||||
with two tables you want to import: companies and
|
||||
persons. Each person belong to one company, so you
|
||||
will have to recreate the link between a person and
|
||||
the company he work for. (If you want to test this
|
||||
example, here is a <a href="/base_import/static/csv/database_import_test.sql">
|
||||
dump of such a PostgreSQL database</a>).</p>
|
||||
<p>We will first export all companies and their
|
||||
"External ID". In PSQL, write the following command:
|
||||
</p> <p>    copy
|
||||
(select 'company_'||id as "External ID",company_name
|
||||
as "Name",'True' as "Is a Company" from companies) TO
|
||||
'/tmp/company.csv' with CSV HEADER;</p>
|
||||
<p>This SQL command will create the following CSV file:
|
||||
<br/>    External ID,Name,Is a Company
|
||||
<br/>    company_1,Bigees,True
|
||||
<br/>    company_2,Organi,True
|
||||
<br/>    company_3,Boum,True</p>
|
||||
<p>To create the CSV file for persons, linked to
|
||||
companies, we will use the following SQL command in
|
||||
PSQL:</p> <p>    copy (select
|
||||
'person_'||id as "External ID",person_name as
|
||||
"Name",'False' as "Is a Company",'company_'||company_id
|
||||
as "Related Company/External ID" from persons) TO
|
||||
'/tmp/person.csv' with CSV</p>
|
||||
<p>It will produce the following CSV file:
|
||||
<br/>    External ID,Name,Is a
|
||||
Company,Related Company/External ID
|
||||
<br/>    person_1,Fabien,False,company_1
|
||||
<br/>    person_2,Laurence,False,company_1
|
||||
<br/>    person_3,Eric,False,company_2
|
||||
<br/>    person_4,Ramsy,False,company_3</p>
|
||||
<p>As you can see in this file, Fabien and Laurence
|
||||
are working for the Bigees company (company_1) and
|
||||
Eric is working for the Organi company. The relation
|
||||
between persons and companies is done using the
|
||||
External ID of the companies. We had to prefix the
|
||||
"External ID" by the name of the table to avoid a
|
||||
conflict of ID between persons and companies (person_1
|
||||
and company_1 who shared the same ID 1 in the orignial
|
||||
database).</p>
|
||||
<p>The two files produced are ready to be imported in
|
||||
OpenERP without any modifications. After having
|
||||
imported these two CSV files, you will have 4 contacts
|
||||
and 3 companies. (the firsts two contacts are linked
|
||||
to the first company). You must first import the
|
||||
companies and then the persons.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</t>
|
||||
|
||||
<t t-name="ImportView.preview">
|
||||
<tr t-if="headers" class="oe_import_grid-header">
|
||||
<td t-foreach="headers" t-as="header" class="oe_import_grid-cell"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue