Merge last changes and resolve conflict

This commit is contained in:
Pedro M. Baeza
2014-05-05 11:48:21 +02:00
63 changed files with 642 additions and 182 deletions

View File

@@ -0,0 +1,35 @@
# Spanish translation for account-financial-tools
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the account-financial-tools package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: account-financial-tools\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-10-18 17:46+0000\n"
"PO-Revision-Date: 2014-04-08 19:44+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: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_cancel_invoice_check_payment_order
#: code:addons/account_cancel_invoice_check_payment_order/account_invoice.py:48
#, python-format
msgid "Error !"
msgstr "Error"
#. module: account_cancel_invoice_check_payment_order
#: code:addons/account_cancel_invoice_check_payment_order/account_invoice.py:51
#, python-format
msgid "Invoice already imported in the payment order (%s) at %s on line %s"
msgstr "Factura ya importada en la orden de pago (%s) en %s en la línea %s"
#. module: account_cancel_invoice_check_payment_order
#: model:ir.model,name:account_cancel_invoice_check_payment_order.model_account_invoice
msgid "Invoice"
msgstr "Factura"

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_cancel_invoice_check_payment_order
#: code:addons/account_cancel_invoice_check_payment_order/account_invoice.py:48

View File

@@ -0,0 +1,36 @@
# Spanish translation for account-financial-tools
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the account-financial-tools package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: account-financial-tools\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-10-18 17:46+0000\n"
"PO-Revision-Date: 2014-04-08 19:45+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: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_cancel_invoice_check_voucher
#: code:addons/account_cancel_invoice_check_voucher/account_invoice.py:49
#, python-format
msgid "Error!"
msgstr "Error"
#. module: account_cancel_invoice_check_voucher
#: code:addons/account_cancel_invoice_check_voucher/account_invoice.py:51
#, python-format
msgid "Invoice already imported in bank statment (%s) at %s on line %s"
msgstr ""
"Factura ya importada en el extracto bancaria (%s) en %s en la línea %s"
#. module: account_cancel_invoice_check_voucher
#: model:ir.model,name:account_cancel_invoice_check_voucher.model_account_invoice
msgid "Invoice"
msgstr "Factura"

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_cancel_invoice_check_voucher
#: code:addons/account_cancel_invoice_check_voucher/account_invoice.py:49

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_chart_update
#: view:wizard.update.charts.accounts:0

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_chart_update
#: view:wizard.update.charts.accounts:0

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
"Language: \n"
#. module: account_chart_update

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_chart_update
#: view:wizard.update.charts.accounts:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_chart_update
#: view:wizard.update.charts.accounts:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_chart_update
#: view:wizard.update.charts.accounts:0

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_chart_update
#: view:wizard.update.charts.accounts:0

View File

@@ -0,0 +1,23 @@
# Spanish translation for account-financial-tools
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the account-financial-tools package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: account-financial-tools\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-10-18 17:47+0000\n"
"PO-Revision-Date: 2014-04-08 19:55+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: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_compute_tax_amount
#: model:ir.model,name:account_compute_tax_amount.model_account_move_line
msgid "Journal Items"
msgstr "Apuntes contables"

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_compute_tax_amount
#: model:ir.model,name:account_compute_tax_amount.model_account_move_line

View File

@@ -19,7 +19,7 @@
##############################################################################
{
'name' : 'Account Constraints',
'version' : '1.0',
'version' : '1.1',
'depends' : [
'account',
],
@@ -37,7 +37,7 @@ and legal state of the art in other software.
Summary of constraints are:
* Add a constraint on account move: you cannot pickup a date that is not
in the fiscal year of the concerned period
in the fiscal year of the concerned period (configurable per journal)
* For manual entries when multicurrency:
@@ -56,8 +56,13 @@ Summary of constraints are:
that the user cannot make mistakes even in draft state, he must pass through the
parent object to make his modification.
Contributors
* Stéphane Bidoul <stephane.bidoul@acsone.eu>
""",
'website': 'http://www.camptocamp.com',
'data': [],
'data': [
'view/account_journal.xml',
],
'installable': True,
}

View File

@@ -22,15 +22,32 @@ from openerp.osv import fields, orm, osv
from openerp.tools.translate import _
class AccountJournal(orm.Model):
_inherit = 'account.journal'
_columns = {
'allow_date_fy': fields.boolean('Check Date in Fiscal Year',
help='If set to True then do not '
'accept the entry if '
'the entry date is not into '
'the fiscal year dates'),
}
_defaults = {
'allow_date_fy': True,
}
class AccountMove(orm.Model):
_inherit = "account.move"
def _check_fiscal_year(self, cr, uid, ids):
for move in self.browse(cr, uid, ids):
date_start = move.period_id.fiscalyear_id.date_start
date_stop = move.period_id.fiscalyear_id.date_stop
if not date_start <= move.date <= date_stop:
return False
if move.journal_id.allow_date_fy:
date_start = move.period_id.fiscalyear_id.date_start
date_stop = move.period_id.fiscalyear_id.date_stop
if not date_start <= move.date <= date_stop:
return False
return True
_constraints = [

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_constraints
#: constraint:account.move.line:0

View File

@@ -0,0 +1,18 @@
<openerp>
<data>
<record id="view_account_journal_allow_date_fy" model="ir.ui.view">
<field name="name">account.journal.allow_date_fy</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<data>
<field name="allow_date" position="after">
<field name="allow_date_fy"/>
</field>
</data>
</field>
</record>
</data>
</openerp>

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_default_draft_move
#: model:ir.model,name:account_default_draft_move.model_account_move

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_default_draft_move
#: model:ir.model,name:account_default_draft_move.model_account_move

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_default_draft_move
#: model:ir.model,name:account_default_draft_move.model_account_move

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_fiscal_position_vat_check
#: view:res.partner:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_fiscal_position_vat_check
#: view:res.partner:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_invoice_currency
#: help:account.invoice,cc_amount_total:0

View File

@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.9\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-11-18 11:53+0000\n"
"PO-Revision-Date: 2014-02-04 16:48+0000\n"
"Last-Translator: Joaquin Gutierrez <Unknown>\n"
"PO-Revision-Date: 2014-04-08 19:42+0000\n"
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@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: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
"Language: \n"
#. module: account_invoice_currency
@@ -51,6 +51,8 @@ msgid ""
"Invoice untaxed amount in the company currency(useful when invoice currency "
"is different from company currency)."
msgstr ""
"Importe sin impuestos de la factura en la moneda de la compañía (útil cuando "
" la moneda de la factura es diferente de la moneda de la compañía)."
#. module: account_invoice_currency
#: view:account.invoice:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_invoice_currency
#: help:account.invoice,cc_amount_total:0

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_journal_always_check_date
#: constraint:account.journal:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_journal_always_check_date
#: constraint:account.journal:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_move_batch_validate
#: field:account.move,post_job_uuid:0

View File

@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name" : "Move line search view - disable defaults for period and journal",
"version" : "0.1",
"author" : "Therp BV",
"category": 'Accounting & Finance',
'description': """
OpenERP 7.0 implements a custom javascript search view for move lines. This
search view shows dropdowns for period and journal. By default, these are
set to the default journal and (current) period.
This module leaves the search view extension for move lines intact, but
disables the default search values for the dropdowns so that you do not
have to disable these before entering your own search queries.
.. image:: /account_move_line_no_default_search/static/src/img/move_line_search_view.png
""",
'website': 'http://therp.nl',
'depends' : [
'account',
],
'js': [
'static/src/js/move_line_search_view.js',
],
'images': [
'static/src/img/move_line_search_view.png',
],
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@@ -0,0 +1,38 @@
/*
Copyright (C) 2013 Therp BV
License: GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 or any later version
Disable default search on the default journal and period
in the javascript search extension on move lines in
openobject-addons/account/static/src/js/account_move_line_quickadd.js
*/
openerp.account_move_line_no_default_search = function (instance) {
instance.web.account.QuickAddListView.include({
start: function() {
/*
Set a hook to be honoured in our override of do_search()
so as to prevent a default search on account move lines
on the default period and journal.
*/
this.block_default_search = true;
return this._super.apply(this, arguments);
},
do_search: function(domain, context, group_by) {
/*
Check for a flag to block default search
and reset default values when it has been found,
then reset the blocking flag.
*/
if (this.block_default_search === true) {
this.current_journal = null;
this.current_period = null;
this.block_default_search = false;
}
return this._super.apply(this, arguments);
},
});
};

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_move_template
#: code:addons/account_move_template/account_document_template.py:68

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_move_template
#: code:addons/account_move_template/account_document_template.py:68

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
"X-Poedit-Language: Catalan\n"
#. module: account_renumber

View File

@@ -15,8 +15,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_renumber
#: selection:wizard.renumber,state:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
"X-Poedit-Language: Catalan\n"
#. module: account_renumber

View File

@@ -1,19 +1,20 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * account_renumber
# * account_renumber
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-04-14 12:12+0000\n"
"PO-Revision-Date: 2014-04-14 14:17+0100\n"
"PO-Revision-Date: 2014-05-05 11:47+0100\n"
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.5.4\n"
#. module: account_renumber
#: code:_description:0
@@ -47,13 +48,7 @@ msgid "Initial"
msgstr "Inicial"
#. module: account_renumber
#: help:wizard.renumber,number_next:0
msgid "Journal sequences will start counting on this number"
msgstr "Las secuencias de diario comenzarán a contar en este número"
#. module: account_renumber
#: view:wizard.renumber:0
#: field:wizard.renumber,journal_ids:0
#: view:wizard.renumber:0 field:wizard.renumber,journal_ids:0
msgid "Journals"
msgstr "Diarios"
@@ -71,7 +66,7 @@ msgstr "Diarios a renumerar"
#: code:addons/account_renumber/wizard/wizard_renumber.py:96
#, python-format
msgid "No Data Available"
msgstr "Sin datos disponibles"
msgstr "No hay datos disponibles"
#. module: account_renumber
#: code:addons/account_renumber/wizard/wizard_renumber.py:97
@@ -80,15 +75,18 @@ msgid "No records found for your selection!"
msgstr "No se han encontrado registros para la selección"
#. module: account_renumber
#: view:wizard.renumber:0
#: field:wizard.renumber,period_ids:0
#: view:wizard.renumber:0 field:wizard.renumber,period_ids:0
msgid "Periods"
msgstr "Periodos"
#. module: account_renumber
#: view:wizard.renumber:0
msgid "Posted moves from those journals will be sorted by date and then assigned sequential numbers using their journal sequence."
msgstr "Los asientos asentados de estos diarios se ordenarán por fecha y entonces se les asignará un número de secuencia usando su secuencia de diario."
msgid ""
"Posted moves from those journals will be sorted by date and then assigned "
"sequential numbers using their journal sequence."
msgstr ""
"Los asientos asentados de estos diarios se ordenarán por fecha y entonces se "
"les asignará un número de secuencia usando su secuencia de diario."
#. module: account_renumber
#: view:wizard.renumber:0
@@ -115,7 +113,7 @@ msgstr "Asientos contables renumerados"
#. module: account_renumber
#: selection:wizard.renumber,state:0
msgid "Renumbering"
msgstr "Renumerados"
msgstr "Renumerando"
#. module: account_renumber
#: view:wizard.renumber:0
@@ -139,3 +137,7 @@ msgstr "desconocido"
msgid "wizard.renumber"
msgstr "Asistente de renumeración de asientos"
#. module: account_renumber
#: help:wizard.renumber,number_next:0
msgid "Journal sequences will start counting on this number"
msgstr "Las secuencias de los diarios empezarán a contar en este número"

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_renumber
#: selection:wizard.renumber,state:0

View File

@@ -15,8 +15,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_renumber
#: selection:wizard.renumber,state:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_renumber
#: selection:wizard.renumber,state:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_renumber
#: selection:wizard.renumber,state:0

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_reversal
#: field:account.move.reverse,move_line_prefix:0

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_reversal
#: field:account.move.reverse,move_line_prefix:0

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_reversal
#: field:account.move.reverse,move_line_prefix:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_reversal
#: field:account.move.reverse,move_line_prefix:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_tax_analysis
#: model:ir.actions.act_window,name:account_tax_analysis.action_account_vat_declaration_analysis

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: currency_rate_date_check
#: help:res.company,currency_rate_max_delta:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: currency_rate_date_check
#: help:res.company,currency_rate_max_delta:0

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: currency_rate_update
#: view:res.company:0

View File

@@ -0,0 +1,184 @@
# Spanish translation for account-financial-tools
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the account-financial-tools package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: account-financial-tools\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-10-18 17:52+0000\n"
"PO-Revision-Date: 2014-04-08 19:54+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: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: currency_rate_update
#: view:res.company:0
msgid "Currency auto update configuration"
msgstr "Configuración de auto actualización de las tasas de cambio"
#. module: currency_rate_update
#: view:res.company:0
msgid "Currency updates services"
msgstr "Servicios de actualización de las tasas de cambio"
#. module: currency_rate_update
#: field:currency.rate.update.service,company_id:0
msgid "linked company"
msgstr "compañía relacionada"
#. module: currency_rate_update
#: view:currency.rate.update.service:0
msgid "Rate"
msgstr "Tasa"
#. module: currency_rate_update
#: view:currency.rate.update.service:0
msgid "Rates"
msgstr "Tasas"
#. module: currency_rate_update
#: field:res.company,multi_company_currency_enable:0
msgid "Multi company currency"
msgstr "Moneda multi-compañía"
#. module: currency_rate_update
#: field:res.company,interval_type:0
msgid "Currency update frequence"
msgstr "Frecuencia de actualización"
#. module: currency_rate_update
#: selection:res.company,interval_type:0
msgid "Day(s)"
msgstr "Día(s)"
#. module: currency_rate_update
#: field:currency.rate.update.service,currency_to_update:0
msgid "currency to update with this service"
msgstr "moneda a actualizar con este servicio"
#. module: currency_rate_update
#: selection:currency.rate.update.service,service:0
msgid "Narodowy Bank Polski"
msgstr "Narodowy Bank Polski"
#. module: currency_rate_update
#: field:currency.rate.update.service,note:0
msgid "update notice"
msgstr "nota de actualización"
#. module: currency_rate_update
#: field:currency.rate.update.service,service:0
msgid "Webservice to use"
msgstr "Servicio web a utilizar"
#. module: currency_rate_update
#: help:currency.rate.update.service,max_delta_days:0
msgid ""
"If the time delta between the rate date given by the webservice and the "
"current date exeeds this value, then the currency rate is not updated in "
"OpenERP."
msgstr ""
"Si la diferencia de tiempo entre la fecha de la tasa dada por el servicio "
"web y la fecha actual excede este valor, entonces la tasa de cambio de "
"divisa no se actualizará en OpenERP."
#. module: currency_rate_update
#: field:res.company,services_to_use:0
msgid "Currency update services"
msgstr "Servicios de actualización de la tasa de cambio"
#. module: currency_rate_update
#: constraint:currency.rate.update.service:0
msgid "'Max delta days' must be >= 0"
msgstr "Los días de diferencia máximos deben ser mayor o igual que 0"
#. module: currency_rate_update
#: code:addons/currency_rate_update/currency_rate_update.py:89
#: sql_constraint:currency.rate.update.service:0
#, python-format
msgid "You can use a service one time per company !"
msgstr "Sólo puedes usar una vez un servicio por compañía"
#. module: currency_rate_update
#: selection:currency.rate.update.service,service:0
msgid "Yahoo Finance "
msgstr "Yahoo Finance "
#. module: currency_rate_update
#: field:currency.rate.update.service,max_delta_days:0
msgid "Max delta days"
msgstr "Días de diferencia máximos"
#. module: currency_rate_update
#: selection:currency.rate.update.service,service:0
msgid "Admin.ch"
msgstr "Admin.ch"
#. module: currency_rate_update
#: model:ir.model,name:currency_rate_update.model_res_company
msgid "Companies"
msgstr "Compañías"
#. module: currency_rate_update
#: view:currency.rate.update.service:0
msgid "Currencies to update with this service"
msgstr "Monedas a actualizar con este servicio"
#. module: currency_rate_update
#: selection:res.company,interval_type:0
msgid "Week(s)"
msgstr "Semana(s)"
#. module: currency_rate_update
#: help:res.company,multi_company_currency_enable:0
msgid ""
"if this case is not check you can not set currency is active on two company"
msgstr ""
"Si está casilla no está marcada, no podrá marcar que una moneda está activa "
"en dos compañías"
#. module: currency_rate_update
#: code:addons/currency_rate_update/currency_rate_update.py:153
#: model:ir.model,name:currency_rate_update.model_currency_rate_update
#: model:ir.model,name:currency_rate_update.model_currency_rate_update_service
#, python-format
msgid "Currency Rate Update"
msgstr "Actualización del tipo de cambio"
#. module: currency_rate_update
#: view:currency.rate.update.service:0
msgid "Logs"
msgstr "Registro"
#. module: currency_rate_update
#: field:res.company,auto_currency_up:0
msgid "Automatical update of the currency this company"
msgstr "Actualización automática del tipo de cambio de esta compañía"
#. module: currency_rate_update
#: selection:res.company,interval_type:0
msgid "Month(s)"
msgstr "Mes(es)"
#. module: currency_rate_update
#: selection:currency.rate.update.service,service:0
msgid "European Central Bank"
msgstr "Banco Central Europeo"
#. module: currency_rate_update
#: help:res.company,interval_type:0
msgid ""
"changing this value will\n"
" also affect other compagnies"
msgstr "cambiando este valor, también afectará a otras compañías"
#. module: currency_rate_update
#: view:res.company:0
msgid "Refresh currencies"
msgstr "Actualizar tipos de cambio"

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: currency_rate_update
#: view:res.company:0

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: currency_rate_update
#: view:res.company:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: currency_rate_update
#: view:res.company:0

View File

@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
@@ -20,6 +20,4 @@
##############################################################################
import partner
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
import company

View File

@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
@@ -21,25 +21,32 @@
{
'name': 'French company identity numbers SIRET/SIREN/NIC',
'version': '1.0',
'version': '1.1',
"category": 'Accounting',
'description': """
This module lets users keep track of the companies' unique
identification numbers from the official SIRENE registry in France:
SIRET, SIREN and NIC. These numbers identify each company and their
subsidiaries, and are often required for administrative tasks.
'description': '''
This module add the French company identity numbers.
====================================================
At the top of the Partner form, users will be able to enter the SIREN
This can help any company doing business with French companies
by letting users track the partners' unique identification
numbers from the official SIRENE registry in France: SIRET, SIREN and NIC.
These numbers identify each company and their subsidiaries, and are
often required for administrative tasks.
On the Partner form, users will be able to enter the SIREN
and NIC numbers, and the SIRET number will be calculated
automatically. The last digits of the SIREN and NIC are control keys:
OpenERP will check their validity when partners are recorded.
""",
'author' : u'Numérigraphe SARL',
'depends': ['account'],
'data': ['partner_view.xml',
],
ATTENTION! this module replaces the fields on the Company form with the new
ones on the Partner form, but it will NOT copy the corresponding data: you
will have to enter them again.
''',
'author': u'Numérigraphe SARL',
'depends': ['account', 'l10n_fr'],
'data': [
'partner_view.xml',
],
'installable': True,
'active': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

44
l10n_fr_siret/company.py Normal file
View File

@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Numérigraphe SARL.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import fields, orm
class res_company(orm.Model):
"""Replace the company's fields for SIRET/RC with the partner's"""
_inherit = 'res.company'
def _get_partner_change(self, cr, uid, ids, context=None):
return self.pool.get('res.partner').search(
cr, uid, [('partner_id', 'in', ids)], context=context)
_columns = {
'siret': fields.related(
'partner_id', 'siret', type='char', store={
'res.partner': (_get_partner_change, ['siren', 'nic'], 20),
'res.company': (lambda self, cr, uid, ids, c={}:
ids, ['partner_id'], 20), }),
'company_registry': fields.related(
'partner_id', 'company_registry', type='char', store={
'res.partner': (_get_partner_change, ['company_registry'], 20),
'res.company': (lambda self, cr, uid, ids, c={}:
ids, ['partner_id'], 20), })
}

View File

@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: l10n_fr_siret
#: field:res.partner,siren:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: l10n_fr_siret
#: field:res.partner,siren:0

View File

@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-01 06:51+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-05-03 06:44+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: l10n_fr_siret
#: field:res.partner,siren:0

View File

@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
@@ -27,10 +27,13 @@ from openerp.osv import fields, orm
def _check_luhn(string):
"""Luhn test to check control keys
Credits: http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers#Python
Credits:
http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers#Python
"""
r = [int(ch) for ch in string][::-1]
return (sum(r[0::2]) + sum(sum(divmod(d*2,10)) for d in r[1::2])) % 10 == 0
return (sum(r[0::2]) + sum(sum(divmod(d * 2, 10))
for d in r[1::2])) % 10 == 0
class Partner(orm.Model):
"""Add the French official company identity numbers SIREN, NIC and SIRET"""
@@ -38,29 +41,26 @@ class Partner(orm.Model):
def _get_siret(self, cr, uid, ids, field_name, arg, context=None):
"""Concatenate the SIREN and NIC to form the SIRET"""
sirets = {}
for partner in self.browse(cr, uid, ids, context=context):
if partner.siren and partner.nic:
sirets[partner.id] = '%s%s' % (partner.siren, partner.nic)
else:
sirets[partner.id] = ''
return sirets
return {partner.id: '%s%s' % (partner.siren, partner.nic or '*****')
if partner.siren else ''
for partner in self.browse(cr, uid, ids, context=context)}
def _check_siret(self, cr, uid, ids):
"""Check the SIREN's and NIC's keys (last digits)"""
for partner in self.browse(cr, uid, ids, context=None):
if partner.nic:
# Check the NIC type and length
if not partner.nic.isdecimal() or len(partner.nic)!=5:
if not partner.nic.isdecimal() or len(partner.nic) != 5:
return False
if partner.siren:
# Check the SIREN type, length and key
if (not partner.siren.isdecimal()
or len(partner.siren)!=9
or not _check_luhn(partner.siren) ):
or len(partner.siren) != 9
or not _check_luhn(partner.siren)):
return False
# Check the NIC key (you need both SIREN and NIC to check it)
if partner.nic and not _check_luhn(partner.siren + partner.nic):
if partner.nic and not _check_luhn(partner.siren
+ partner.nic):
return False
return True
@@ -74,26 +74,24 @@ class Partner(orm.Model):
"of this office in the company in France. It "
"makes the last 5 digits of the SIRET "
"number."),
'siret': fields.function(_get_siret, type="char", string='SIRET',
'siret': fields.function(
_get_siret, type="char", string='SIRET',
method=True, size=14,
store = {
store={
'res.partner': [lambda self, cr, uid, ids, context=None: ids,
['siren', 'nic'],
10]},
['siren', 'nic'], 10]},
help="The SIRET number is the official identity number of this "
"company's office in France. It is composed of the 9 digits "
"of the SIREN number and the 5 digits of the NIC number, ie. "
"14 digits."),
'company_registry': fields.char('Company Registry', size=64,
help="The name of official registry where this "
"company was declared."),
'company_registry': fields.char(
'Company Registry', size=64,
help="The name of official registry where this "
"company was declared."),
}
_constraints = [
(_check_siret,
"The SIREN or NIC number is incorrect.",
["siren", "nic"]),
(_check_siret,
"The SIREN or NIC number is incorrect.",
["siren", "nic"]),
]
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,25 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Add the SIREN, NIC and SIRET numbers -->
<record model="ir.ui.view" id="view_partner_add">
<field name="name">res.partner.form.siret</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form" />
<field name="arch" type="xml">
<page string="Accounting" position="inside">
<group>
<group>
<field name="siren" />
<field name="nic" />
<field name="siret" />
</group>
<group>
<field name="company_registry" />
</group>
</group>
</page>
</field>
</record>
</data>
<data>
<!-- Add the SIREN and RC -->
<record model="ir.ui.view" id="view_partner_add">
<field name="name">res.partner.form.siret</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form" />
<field name="arch" type="xml">
<page string="Accounting" position="inside">
<group>
<group col="4">
<!-- oe_read_only hides the field in read mode
in v8+. v7.0 shows the field - no big deal.
Those who care can patch the web client:
lp:~numerigraphe-team/ocb-web/7.0-hide-oe_read_only
-->
<field name="siret" colspan="4" class="oe_read_only" />
<field name="siren" class="oe_edit_only" string="SIREN/NIC" colspan="3"/>
<field name="nic" class="oe_edit_only" nolabel="1"/>
</group>
<group>
<field name="company_registry" />
</group>
</group>
</page>
</field>
</record>
</data>
</openerp>