[MERGE] from trunk

bzr revid: rco@openerp.com-20121105083756-jdr9fxp32djpifqk
This commit is contained in:
Raphael Collet 2012-11-05 09:37:56 +01:00
commit 401dd57f30
36 changed files with 373 additions and 466 deletions

View File

@ -87,9 +87,9 @@ In addition to the above possibilities, when invoked with a non-existing module
sub-modules. sub-modules.
Depending on the unittest2_ class that is used to write the tests (see Depending on the unittest2_ class that is used to write the tests (see
``openerp.tests.common`` for some helper classes that you can re-use), a database :mod:`openerp.tests.common` for some helper classes that you can re-use), a
may be created before the test is run, and the module providing the test will database may be created before the test is run, and the module providing the
be installed on that database. test will be installed on that database.
Because creating a database, installing modules, and then dropping it is Because creating a database, installing modules, and then dropping it is
expensive, it is possible to interleave the run of the ``fast_suite`` tests expensive, it is possible to interleave the run of the ``fast_suite`` tests
@ -98,3 +98,20 @@ each requested module is installed, its fast_suite tests are run. The database
is thus created and dropped (and the modules installed) only once. is thus created and dropped (and the modules installed) only once.
.. _unittest2: http://pypi.python.org/pypi/unittest2 .. _unittest2: http://pypi.python.org/pypi/unittest2
TestCase subclasses
-------------------
.. automodule:: openerp.tests.common
:members:
.. note::
The `setUp` and `tearDown` methods are not part of the tests. Uncaught
exceptions in those methods are errors, not test failures. In particular,
a failing `setUp` will not be followed by a `tearDown` causing any
allocated resource in the `setUp` to not be released by the `tearDown`.
In the :py:class:`openerp.tests.common.TransactionCase` and
:py:class:`openerp.tests.common.SingleTransactionCase`, this means the
test suite can hang because of unclosed cursors.

View File

@ -101,6 +101,7 @@ def preload_registry(dbname):
def run_test_file(dbname, test_file): def run_test_file(dbname, test_file):
""" Preload a registry, possibly run a test file, and start the cron.""" """ Preload a registry, possibly run a test file, and start the cron."""
try: try:
config = openerp.tools.config
db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False) db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
cr = db.cursor() cr = db.cursor()
_logger.info('loading test file %s', test_file) _logger.info('loading test file %s', test_file)

View File

@ -86,14 +86,12 @@ The kernel of OpenERP, needed for all installation.
'security/base_security.xml', 'security/base_security.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'security/ir.model.access-1.csv', # res.partner.address is deprecated; it is still there for backward compability only and will be removed in next version 'security/ir.model.access-1.csv', # res.partner.address is deprecated; it is still there for backward compability only and will be removed in next version
'res/res_widget_view.xml',
'res/res_widget_data.xml',
], ],
'demo': [ 'demo': [
'base_demo.xml', 'base_demo.xml',
'res/res_partner_demo.xml', 'res/res_partner_demo.xml',
'res/res_partner_demo.yml', 'res/res_partner_demo.yml',
'res/res_widget_demo.xml', 'res/res_partner_image_demo.xml',
], ],
'test': [ 'test': [
'test/base_test.xml', 'test/base_test.xml',

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0.0-rc1\n" "Project-Id-Version: OpenERP Server 6.0.0-rc1\n"
"Report-Msgid-Bugs-To: support@openerp.com\n" "Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-08 00:44+0000\n" "POT-Creation-Date: 2012-02-08 00:44+0000\n"
"PO-Revision-Date: 2011-01-18 05:32+0000\n" "PO-Revision-Date: 2012-11-05 00:42+0000\n"
"Last-Translator: Cristian Salamea (Gnuthink) <ovnicraft@gmail.com>\n" "Last-Translator: Cristian Salamea (Gnuthink) <ovnicraft@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-10-20 05:06+0000\n" "X-Launchpad-Export-Date: 2012-11-05 04:40+0000\n"
"X-Generator: Launchpad (build 16165)\n" "X-Generator: Launchpad (build 16232)\n"
#. module: base #. module: base
#: model:res.country,name:base.sh #: model:res.country,name:base.sh
@ -655,6 +655,26 @@ msgid ""
" Accounting/Reporting/Generic Reporting/Partners/Follow-ups Sent\n" " Accounting/Reporting/Generic Reporting/Partners/Follow-ups Sent\n"
"\n" "\n"
msgstr "" msgstr ""
"\n"
"Modulo para automatizar cartas para facturas no pagadas, con recordatorios "
"multi-nivel\n"
"==========================================================================\n"
"\n"
"Pueden definirse múltiples niveles de recordatorios a través del menú:\n"
" Contabilidad/Configuración/Varios/Seguimientos\n"
"\n"
"Una vez definidos, pueden imprimirse automáticamente recordatorios cada día, "
"simplemente haciendo clic en el menú: \n"
" Contabilidad/Procesamiento periódico/Facturación/Enviar seguimientos\n"
"\n"
"Se generará un PDF con todas las cartas de acuerdo con los diferentes \n"
"niveles de recordatorio definidos. Se pueden definir diferentes políticas\n"
"para las distintas compañías . También se puede enviar correo al cliente.\n"
"\n"
"Debe denotarse que si se quiere revisar el nivel de seguimiento de una "
"empresa/cuenta determinada, se puede realizar en el menú:\n"
" Contabilidad/Informes/Informes genéricos/Empresas/Seguimientos enviados\n"
"\n"
#. module: base #. module: base
#: field:res.country,name:0 #: field:res.country,name:0

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n" "Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n" "Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-08 00:44+0000\n" "POT-Creation-Date: 2012-02-08 00:44+0000\n"
"PO-Revision-Date: 2012-08-20 15:52+0000\n" "PO-Revision-Date: 2012-11-01 18:59+0000\n"
"Last-Translator: Mustufa Rangwala (Open ERP) <mra@tinyerp.com>\n" "Last-Translator: Dusan Laznik <laznik@mentis.si>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-10-20 05:04+0000\n" "X-Launchpad-Export-Date: 2012-11-02 05:09+0000\n"
"X-Generator: Launchpad (build 16165)\n" "X-Generator: Launchpad (build 16218)\n"
#. module: base #. module: base
#: model:res.country,name:base.sh #: model:res.country,name:base.sh
@ -34,7 +34,7 @@ msgstr "DatumČas"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_project_mailgate #: model:ir.module.module,shortdesc:base.module_project_mailgate
msgid "Tasks-Mail Integration" msgid "Tasks-Mail Integration"
msgstr "" msgstr "Integracija email-opravila"
#. module: base #. module: base
#: code:addons/fields.py:582 #: code:addons/fields.py:582
@ -90,7 +90,7 @@ msgstr "Delovni proces"
#. module: base #. module: base
#: selection:ir.sequence,implementation:0 #: selection:ir.sequence,implementation:0
msgid "No gap" msgid "No gap"
msgstr "" msgstr "Bez razmaka"
#. module: base #. module: base
#: selection:base.language.install,lang:0 #: selection:base.language.install,lang:0
@ -179,7 +179,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_web_process #: model:ir.module.module,shortdesc:base.module_web_process
msgid "Process" msgid "Process"
msgstr "" msgstr "Proces"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_analytic_journal_billing_rate #: model:ir.module.module,shortdesc:base.module_analytic_journal_billing_rate
@ -271,7 +271,7 @@ msgstr "Inuktitut / ᐃᓄᒃᑎᑐᑦ"
#: model:ir.module.category,name:base.module_category_sales_management #: model:ir.module.category,name:base.module_category_sales_management
#: model:ir.module.module,shortdesc:base.module_sale #: model:ir.module.module,shortdesc:base.module_sale
msgid "Sales Management" msgid "Sales Management"
msgstr "" msgstr "Prodaja"
#. module: base #. module: base
#: view:res.partner:0 #: view:res.partner:0
@ -372,12 +372,12 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.category,name:base.module_category_customer_relationship_management #: model:ir.module.category,name:base.module_category_customer_relationship_management
msgid "Customer Relationship Management" msgid "Customer Relationship Management"
msgstr "" msgstr "Upravljanje odnosov s kupci (CRM)"
#. module: base #. module: base
#: view:ir.module.module:0 #: view:ir.module.module:0
msgid "Extra" msgid "Extra"
msgstr "" msgstr "Dodatno"
#. module: base #. module: base
#: code:addons/orm.py:2526 #: code:addons/orm.py:2526
@ -388,7 +388,7 @@ msgstr "Neveljavna skupina_z"
#. module: base #. module: base
#: field:ir.module.category,child_ids:0 #: field:ir.module.category,child_ids:0
msgid "Child Applications" msgid "Child Applications"
msgstr "" msgstr "Podrejene aplikacije"
#. module: base #. module: base
#: field:res.partner,credit_limit:0 #: field:res.partner,credit_limit:0
@ -539,7 +539,7 @@ msgstr ""
#. module: base #. module: base
#: view:ir.values:0 #: view:ir.values:0
msgid "Action Binding" msgid "Action Binding"
msgstr "" msgstr "Povezovanje akcij"
#. module: base #. module: base
#: model:res.country,name:base.gf #: model:res.country,name:base.gf
@ -702,7 +702,7 @@ msgstr "Izvoz zaključen"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_plugin_outlook #: model:ir.module.module,shortdesc:base.module_plugin_outlook
msgid "Outlook Plug-In" msgid "Outlook Plug-In"
msgstr "" msgstr "Vtičnik za Outlook"
#. module: base #. module: base
#: view:ir.model:0 #: view:ir.model:0
@ -745,7 +745,7 @@ msgstr "Eritreja"
#. module: base #. module: base
#: sql_constraint:res.company:0 #: sql_constraint:res.company:0
msgid "The company name must be unique !" msgid "The company name must be unique !"
msgstr "" msgstr "Ime podjetja mora biti unikatno !"
#. module: base #. module: base
#: view:res.config:0 #: view:res.config:0
@ -1006,7 +1006,7 @@ msgstr "Zahtevaj tipe sklicov"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_google_base_account #: model:ir.module.module,shortdesc:base.module_google_base_account
msgid "Google Users" msgid "Google Users"
msgstr "" msgstr "Google uporabniki"
#. module: base #. module: base
#: help:ir.server.object.lines,value:0 #: help:ir.server.object.lines,value:0
@ -1069,7 +1069,7 @@ msgstr "Vrsta"
#. module: base #. module: base
#: field:ir.mail_server,smtp_user:0 #: field:ir.mail_server,smtp_user:0
msgid "Username" msgid "Username"
msgstr "" msgstr "Uporabnik"
#. module: base #. module: base
#: code:addons/orm.py:398 #: code:addons/orm.py:398
@ -1217,12 +1217,12 @@ msgstr "Špansko (GT) / Español (GT)"
#. module: base #. module: base
#: field:ir.mail_server,smtp_port:0 #: field:ir.mail_server,smtp_port:0
msgid "SMTP Port" msgid "SMTP Port"
msgstr "" msgstr "SMTP vrata"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_import_sugarcrm #: model:ir.module.module,shortdesc:base.module_import_sugarcrm
msgid "SugarCRM Import" msgid "SugarCRM Import"
msgstr "" msgstr "Uvoz iz SugarCRM-a"
#. module: base #. module: base
#: view:res.lang:0 #: view:res.lang:0
@ -1239,12 +1239,12 @@ msgstr ""
#: code:addons/base/module/wizard/base_language_install.py:55 #: code:addons/base/module/wizard/base_language_install.py:55
#, python-format #, python-format
msgid "Language Pack" msgid "Language Pack"
msgstr "" msgstr "Jezikovni paket"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_web_tests #: model:ir.module.module,shortdesc:base.module_web_tests
msgid "Tests" msgid "Tests"
msgstr "" msgstr "Preizkusi"
#. module: base #. module: base
#: field:ir.ui.view_sc,res_id:0 #: field:ir.ui.view_sc,res_id:0
@ -1305,7 +1305,7 @@ msgstr ""
#. module: base #. module: base
#: field:ir.module.category,parent_id:0 #: field:ir.module.category,parent_id:0
msgid "Parent Application" msgid "Parent Application"
msgstr "" msgstr "Nadrejena aplikacija"
#. module: base #. module: base
#: code:addons/base/res/res_users.py:222 #: code:addons/base/res/res_users.py:222
@ -1322,12 +1322,12 @@ msgstr "Ne izbirajte jezika za izvoz novega jezika."
#: model:ir.module.module,shortdesc:base.module_document #: model:ir.module.module,shortdesc:base.module_document
#: model:ir.module.module,shortdesc:base.module_knowledge #: model:ir.module.module,shortdesc:base.module_knowledge
msgid "Document Management System" msgid "Document Management System"
msgstr "" msgstr "Sistem za upravljanje dokumentov"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_crm_claim #: model:ir.module.module,shortdesc:base.module_crm_claim
msgid "Claims Management" msgid "Claims Management"
msgstr "" msgstr "Pritožbe"
#. module: base #. module: base
#: model:ir.ui.menu,name:base.menu_purchase_root #: model:ir.ui.menu,name:base.menu_purchase_root
@ -1542,7 +1542,7 @@ msgstr "Prijava"
#: model:ir.actions.act_window,name:base.action_wizard_update_translations #: model:ir.actions.act_window,name:base.action_wizard_update_translations
#: model:ir.ui.menu,name:base.menu_wizard_update_translations #: model:ir.ui.menu,name:base.menu_wizard_update_translations
msgid "Synchronize Terms" msgid "Synchronize Terms"
msgstr "" msgstr "Sinhronizacija izrazov"
#. module: base #. module: base
#: view:ir.actions.server:0 #: view:ir.actions.server:0
@ -1585,7 +1585,7 @@ msgstr "Plavajoče"
#: model:ir.module.category,name:base.module_category_warehouse_management #: model:ir.module.category,name:base.module_category_warehouse_management
#: model:ir.module.module,shortdesc:base.module_stock #: model:ir.module.module,shortdesc:base.module_stock
msgid "Warehouse Management" msgid "Warehouse Management"
msgstr "" msgstr "Skladiščno poslovanje"
#. module: base #. module: base
#: model:ir.model,name:base.model_res_request_link #: model:ir.model,name:base.model_res_request_link
@ -1799,7 +1799,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_html_view #: model:ir.module.module,shortdesc:base.module_html_view
msgid "Html View" msgid "Html View"
msgstr "" msgstr "Pogled html"
#. module: base #. module: base
#: field:res.currency,position:0 #: field:res.currency,position:0
@ -1809,7 +1809,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_process #: model:ir.module.module,shortdesc:base.module_process
msgid "Enterprise Process" msgid "Enterprise Process"
msgstr "" msgstr "Proces podjetja"
#. module: base #. module: base
#: help:ir.cron,function:0 #: help:ir.cron,function:0
@ -1868,7 +1868,7 @@ msgstr "Pripeti model"
#. module: base #. module: base
#: field:res.partner.bank,footer:0 #: field:res.partner.bank,footer:0
msgid "Display on Reports" msgid "Display on Reports"
msgstr "" msgstr "Prikaz na poročilih"
#. module: base #. module: base
#: model:ir.module.module,description:base.module_l10n_cn #: model:ir.module.module,description:base.module_l10n_cn
@ -1943,7 +1943,7 @@ msgstr "%s (kopija)"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_account_chart #: model:ir.module.module,shortdesc:base.module_account_chart
msgid "Template of Charts of Accounts" msgid "Template of Charts of Accounts"
msgstr "" msgstr "Predloga kontnega načrta"
#. module: base #. module: base
#: field:res.partner.address,type:0 #: field:res.partner.address,type:0
@ -2030,12 +2030,12 @@ msgstr "Finska"
#: code:addons/base/res/res_company.py:156 #: code:addons/base/res/res_company.py:156
#, python-format #, python-format
msgid "Website: " msgid "Website: "
msgstr "" msgstr "Spletna stran: "
#. module: base #. module: base
#: model:ir.ui.menu,name:base.menu_administration #: model:ir.ui.menu,name:base.menu_administration
msgid "Settings" msgid "Settings"
msgstr "" msgstr "Nastavitve"
#. module: base #. module: base
#: selection:ir.actions.act_window,view_type:0 #: selection:ir.actions.act_window,view_type:0
@ -2175,7 +2175,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_subscription #: model:ir.module.module,shortdesc:base.module_subscription
msgid "Recurring Documents" msgid "Recurring Documents"
msgstr "" msgstr "Ponavljajoči dokumenti"
#. module: base #. module: base
#: model:res.country,name:base.bs #: model:res.country,name:base.bs
@ -2214,7 +2214,7 @@ msgstr "Število osveženih modulov"
#. module: base #. module: base
#: field:ir.cron,function:0 #: field:ir.cron,function:0
msgid "Method" msgid "Method"
msgstr "" msgstr "Način"
#. module: base #. module: base
#: view:res.partner.event:0 #: view:res.partner.event:0
@ -2353,7 +2353,7 @@ msgstr ""
#. module: base #. module: base
#: field:ir.mail_server,smtp_debug:0 #: field:ir.mail_server,smtp_debug:0
msgid "Debugging" msgid "Debugging"
msgstr "" msgstr "Razhroščevanje"
#. module: base #. module: base
#: model:ir.module.module,description:base.module_crm_helpdesk #: model:ir.module.module,description:base.module_crm_helpdesk
@ -2463,7 +2463,7 @@ msgstr "Trenutno razmerje"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_idea #: model:ir.module.module,shortdesc:base.module_idea
msgid "Ideas" msgid "Ideas"
msgstr "" msgstr "Ideje"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_sale_crm #: model:ir.module.module,shortdesc:base.module_sale_crm
@ -2505,7 +2505,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.ui.menu,name:base.menu_invoiced #: model:ir.ui.menu,name:base.menu_invoiced
msgid "Invoicing" msgid "Invoicing"
msgstr "" msgstr "Izdajanje računov"
#. module: base #. module: base
#: field:ir.ui.view_sc,name:0 #: field:ir.ui.view_sc,name:0
@ -2546,7 +2546,7 @@ msgstr ""
#: field:ir.model.data,res_id:0 #: field:ir.model.data,res_id:0
#: field:ir.values,res_id:0 #: field:ir.values,res_id:0
msgid "Record ID" msgid "Record ID"
msgstr "" msgstr "ID zapisa"
#. module: base #. module: base
#: field:ir.actions.server,email:0 #: field:ir.actions.server,email:0
@ -2630,7 +2630,7 @@ msgstr "Napaka pri komuniciranju s strežnikom založniške garancije."
#: model:res.groups,name:base.group_sale_manager #: model:res.groups,name:base.group_sale_manager
#: model:res.groups,name:base.group_tool_manager #: model:res.groups,name:base.group_tool_manager
msgid "Manager" msgid "Manager"
msgstr "" msgstr "Vodja"
#. module: base #. module: base
#: model:ir.ui.menu,name:base.menu_custom #: model:ir.ui.menu,name:base.menu_custom
@ -2667,7 +2667,7 @@ msgstr "Počiši ID-je"
#. module: base #. module: base
#: view:res.groups:0 #: view:res.groups:0
msgid "Inherited" msgid "Inherited"
msgstr "" msgstr "Podedovano"
#. module: base #. module: base
#: field:ir.model.fields,serialization_field_id:0 #: field:ir.model.fields,serialization_field_id:0
@ -2690,7 +2690,7 @@ msgstr "%y - Leto brez stoletja [00,99]."
#: code:addons/base/res/res_company.py:155 #: code:addons/base/res/res_company.py:155
#, python-format #, python-format
msgid "Fax: " msgid "Fax: "
msgstr "" msgstr "Fax: "
#. module: base #. module: base
#: model:res.country,name:base.si #: model:res.country,name:base.si
@ -2700,7 +2700,7 @@ msgstr "Slovenija"
#. module: base #. module: base
#: help:res.currency,name:0 #: help:res.currency,name:0
msgid "Currency Code (ISO 4217)" msgid "Currency Code (ISO 4217)"
msgstr "" msgstr "Šifra valute (ISO 4217)"
#. module: base #. module: base
#: model:ir.actions.act_window,name:base.res_log_act_window #: model:ir.actions.act_window,name:base.res_log_act_window
@ -2818,14 +2818,14 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_stock_planning #: model:ir.module.module,shortdesc:base.module_stock_planning
msgid "Master Procurement Schedule" msgid "Master Procurement Schedule"
msgstr "" msgstr "Planiranje nabave"
#. module: base #. module: base
#: model:ir.model,name:base.model_ir_module_category #: model:ir.model,name:base.model_ir_module_category
#: field:ir.module.module,application:0 #: field:ir.module.module,application:0
#: field:res.groups,category_id:0 #: field:res.groups,category_id:0
msgid "Application" msgid "Application"
msgstr "" msgstr "Program"
#. module: base #. module: base
#: selection:publisher_warranty.contract,state:0 #: selection:publisher_warranty.contract,state:0
@ -3019,7 +3019,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_wiki_quality_manual #: model:ir.module.module,shortdesc:base.module_wiki_quality_manual
msgid "Wiki: Quality Manual" msgid "Wiki: Quality Manual"
msgstr "" msgstr "Wiki: Priročnik kvalitete"
#. module: base #. module: base
#: selection:ir.actions.act_window.view,view_mode:0 #: selection:ir.actions.act_window.view,view_mode:0
@ -3047,7 +3047,7 @@ msgstr "Sektor HR"
#. module: base #. module: base
#: model:ir.ui.menu,name:base.menu_dashboard_admin #: model:ir.ui.menu,name:base.menu_dashboard_admin
msgid "Administration Dashboard" msgid "Administration Dashboard"
msgstr "" msgstr "Nadzorna plošča administracije"
#. module: base #. module: base
#: code:addons/orm.py:4408 #: code:addons/orm.py:4408
@ -3138,7 +3138,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_hr_contract #: model:ir.module.module,shortdesc:base.module_hr_contract
msgid "Employee Contracts" msgid "Employee Contracts"
msgstr "" msgstr "Pogodbe zaposlenih"
#. module: base #. module: base
#: model:ir.module.module,description:base.module_wiki_faq #: model:ir.module.module,description:base.module_wiki_faq
@ -3191,7 +3191,7 @@ msgstr "Naziv kontakta"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_product_manufacturer #: model:ir.module.module,shortdesc:base.module_product_manufacturer
msgid "Products Manufacturers" msgid "Products Manufacturers"
msgstr "" msgstr "Proizvajalci"
#. module: base #. module: base
#: code:addons/base/ir/ir_mail_server.py:217 #: code:addons/base/ir/ir_mail_server.py:217
@ -3202,7 +3202,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_survey #: model:ir.module.module,shortdesc:base.module_survey
msgid "Survey" msgid "Survey"
msgstr "" msgstr "Vprašalnik"
#. module: base #. module: base
#: view:base.language.import:0 #: view:base.language.import:0
@ -3498,7 +3498,7 @@ msgstr ""
#: model:ir.module.category,name:base.module_category_generic_modules_accounting #: model:ir.module.category,name:base.module_category_generic_modules_accounting
#: view:res.company:0 #: view:res.company:0
msgid "Accounting" msgid "Accounting"
msgstr "" msgstr "Računovodstvo"
#. module: base #. module: base
#: model:ir.module.module,description:base.module_account_payment #: model:ir.module.module,description:base.module_account_payment
@ -3543,7 +3543,7 @@ msgstr ""
#. module: base #. module: base
#: constraint:res.partner:0 #: constraint:res.partner:0
msgid "Error ! You cannot create recursive associated members." msgid "Error ! You cannot create recursive associated members."
msgstr "" msgstr "Napaka! Ne morete ustvariti rekurzivno povezane člane."
#. module: base #. module: base
#: view:res.payterm:0 #: view:res.payterm:0
@ -3618,7 +3618,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_point_of_sale #: model:ir.module.module,shortdesc:base.module_point_of_sale
msgid "Point Of Sale" msgid "Point Of Sale"
msgstr "" msgstr "Prodajno mesto"
#. module: base #. module: base
#: code:addons/base/module/module.py:302 #: code:addons/base/module/module.py:302
@ -3654,7 +3654,7 @@ msgstr ""
#. module: base #. module: base
#: selection:ir.sequence,implementation:0 #: selection:ir.sequence,implementation:0
msgid "Standard" msgid "Standard"
msgstr "" msgstr "Običajno"
#. module: base #. module: base
#: model:ir.model,name:base.model_maintenance_contract #: model:ir.model,name:base.model_maintenance_contract
@ -3687,7 +3687,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.category,name:base.module_category_human_resources #: model:ir.module.category,name:base.module_category_human_resources
msgid "Human Resources" msgid "Human Resources"
msgstr "" msgstr "Človeški viri"
#. module: base #. module: base
#: model:ir.actions.act_window,name:base.action_country #: model:ir.actions.act_window,name:base.action_country
@ -3747,7 +3747,7 @@ msgstr "DDV"
#. module: base #. module: base
#: field:res.users,new_password:0 #: field:res.users,new_password:0
msgid "Set password" msgid "Set password"
msgstr "" msgstr "Nastavite geslo"
#. module: base #. module: base
#: view:res.lang:0 #: view:res.lang:0
@ -4251,7 +4251,7 @@ msgstr "Povzetek"
#. module: base #. module: base
#: model:ir.module.category,name:base.module_category_hidden_dependency #: model:ir.module.category,name:base.module_category_hidden_dependency
msgid "Dependency" msgid "Dependency"
msgstr "" msgstr "Odvisnost"
#. module: base #. module: base
#: field:multi_company.default,expression:0 #: field:multi_company.default,expression:0
@ -4582,7 +4582,7 @@ msgstr "Pravila"
#. module: base #. module: base
#: field:ir.mail_server,smtp_host:0 #: field:ir.mail_server,smtp_host:0
msgid "SMTP Server" msgid "SMTP Server"
msgstr "" msgstr "Strežnik SMTP"
#. module: base #. module: base
#: code:addons/base/module/module.py:256 #: code:addons/base/module/module.py:256
@ -4672,7 +4672,7 @@ msgstr "Kenija"
#: model:ir.actions.act_window,name:base.action_translation #: model:ir.actions.act_window,name:base.action_translation
#: model:ir.ui.menu,name:base.menu_action_translation #: model:ir.ui.menu,name:base.menu_action_translation
msgid "Translated Terms" msgid "Translated Terms"
msgstr "" msgstr "Prevedeni izrazi"
#. module: base #. module: base
#: view:res.partner.event:0 #: view:res.partner.event:0
@ -5003,7 +5003,7 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.category,name:base.module_category_localization #: model:ir.module.category,name:base.module_category_localization
msgid "Localization" msgid "Localization"
msgstr "" msgstr "Lokalizacija"
#. module: base #. module: base
#: model:ir.module.module,description:base.module_sale_mrp #: model:ir.module.module,description:base.module_sale_mrp
@ -5096,7 +5096,7 @@ msgstr "Decimalni ločevalnik"
#: view:ir.module.module:0 #: view:ir.module.module:0
#, python-format #, python-format
msgid "Install" msgid "Install"
msgstr "" msgstr "Namesti"
#. module: base #. module: base
#: model:ir.actions.act_window,help:base.action_res_groups #: model:ir.actions.act_window,help:base.action_res_groups
@ -5118,7 +5118,7 @@ msgstr ""
#. module: base #. module: base
#: field:ir.filters,name:0 #: field:ir.filters,name:0
msgid "Filter Name" msgid "Filter Name"
msgstr "" msgstr "Ime filtra"
#. module: base #. module: base
#: view:res.partner:0 #: view:res.partner:0
@ -5225,7 +5225,7 @@ msgstr "Polje"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_project_long_term #: model:ir.module.module,shortdesc:base.module_project_long_term
msgid "Long Term Projects" msgid "Long Term Projects"
msgstr "" msgstr "Dolgoročni projekti"
#. module: base #. module: base
#: model:res.country,name:base.ve #: model:res.country,name:base.ve
@ -5628,7 +5628,7 @@ msgstr "Svalbardovi in Jan Mayenovi otoki"
#. module: base #. module: base
#: model:ir.module.category,name:base.module_category_hidden_test #: model:ir.module.category,name:base.module_category_hidden_test
msgid "Test" msgid "Test"
msgstr "" msgstr "Test"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_web_kanban #: model:ir.module.module,shortdesc:base.module_web_kanban
@ -5718,7 +5718,7 @@ msgstr "Lastnost 'on_delete' za za 'many2one' polja"
#. module: base #. module: base
#: model:ir.module.category,name:base.module_category_accounting_and_finance #: model:ir.module.category,name:base.module_category_accounting_and_finance
msgid "Accounting & Finance" msgid "Accounting & Finance"
msgstr "" msgstr "Računovodstvo & Finance"
#. module: base #. module: base
#: field:ir.actions.server,write_id:0 #: field:ir.actions.server,write_id:0
@ -5746,7 +5746,7 @@ msgstr ""
#: model:ir.module.category,name:base.module_category_usability #: model:ir.module.category,name:base.module_category_usability
#: view:res.users:0 #: view:res.users:0
msgid "Usability" msgid "Usability"
msgstr "" msgstr "Uporabnost"
#. module: base #. module: base
#: field:ir.actions.act_window,domain:0 #: field:ir.actions.act_window,domain:0
@ -5797,7 +5797,7 @@ msgstr "Ime skupine se ne sme začeti z \"-\""
#. module: base #. module: base
#: view:ir.module.module:0 #: view:ir.module.module:0
msgid "Apps" msgid "Apps"
msgstr "" msgstr "Programi"
#. module: base #. module: base
#: view:ir.ui.view_sc:0 #: view:ir.ui.view_sc:0
@ -5853,7 +5853,7 @@ msgstr "Lastnik bančnega računa"
#. module: base #. module: base
#: model:ir.module.category,name:base.module_category_uncategorized #: model:ir.module.category,name:base.module_category_uncategorized
msgid "Uncategorized" msgid "Uncategorized"
msgstr "" msgstr "Neopredeljeno"
#. module: base #. module: base
#: field:ir.attachment,res_name:0 #: field:ir.attachment,res_name:0
@ -5921,7 +5921,7 @@ msgstr ""
#. module: base #. module: base
#: view:res.partner.bank:0 #: view:res.partner.bank:0
msgid "My Banks" msgid "My Banks"
msgstr "" msgstr "Moje banke"
#. module: base #. module: base
#: help:multi_company.default,object_id:0 #: help:multi_company.default,object_id:0
@ -6003,12 +6003,12 @@ msgstr ""
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_base_report_creator #: model:ir.module.module,shortdesc:base.module_base_report_creator
msgid "Query Builder" msgid "Query Builder"
msgstr "" msgstr "Čarovnik za poizvedbe"
#. module: base #. module: base
#: selection:ir.actions.todo,type:0 #: selection:ir.actions.todo,type:0
msgid "Launch Automatically" msgid "Launch Automatically"
msgstr "" msgstr "Zaženi samodejno"
#. module: base #. module: base
#: model:ir.module.module,description:base.module_mail #: model:ir.module.module,description:base.module_mail
@ -6141,7 +6141,7 @@ msgstr ""
#: code:addons/base/module/module.py:392 #: code:addons/base/module/module.py:392
#, python-format #, python-format
msgid "Uninstall" msgid "Uninstall"
msgstr "" msgstr "Odstrani"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_account_budget #: model:ir.module.module,shortdesc:base.module_account_budget
@ -6161,7 +6161,7 @@ msgstr ""
#. module: base #. module: base
#: selection:ir.mail_server,smtp_encryption:0 #: selection:ir.mail_server,smtp_encryption:0
msgid "SSL/TLS" msgid "SSL/TLS"
msgstr "" msgstr "SSL/TLS"
#. module: base #. module: base
#: field:publisher_warranty.contract,check_opw:0 #: field:publisher_warranty.contract,check_opw:0

View File

@ -142,13 +142,13 @@ class report_xml(osv.osv):
} }
_defaults = { _defaults = {
'type': lambda *a: 'ir.actions.report.xml', 'type': 'ir.actions.report.xml',
'multi': lambda *a: False, 'multi': False,
'auto': lambda *a: True, 'auto': True,
'header': lambda *a: True, 'header': True,
'report_sxw_content': lambda *a: False, 'report_sxw_content': False,
'report_type': lambda *a: 'pdf', 'report_type': 'pdf',
'attachment': lambda *a: False, 'attachment': False,
} }
report_xml() report_xml()
@ -251,14 +251,14 @@ class act_window(osv.osv):
} }
_defaults = { _defaults = {
'type': lambda *a: 'ir.actions.act_window', 'type': 'ir.actions.act_window',
'view_type': lambda *a: 'form', 'view_type': 'form',
'view_mode': lambda *a: 'tree,form', 'view_mode': 'tree,form',
'context': lambda *a: '{}', 'context': '{}',
'limit': lambda *a: 80, 'limit': 80,
'target': lambda *a: 'current', 'target': 'current',
'auto_refresh': lambda *a: 0, 'auto_refresh': 0,
'auto_search':lambda *a: True, 'auto_search':True,
'multi': False, 'multi': False,
} }
@ -298,7 +298,7 @@ class act_window_view(osv.osv):
help="If set to true, the action will not be displayed on the right toolbar of a form view."), help="If set to true, the action will not be displayed on the right toolbar of a form view."),
} }
_defaults = { _defaults = {
'multi': lambda *a: False, 'multi': False,
} }
def _auto_init(self, cr, context=None): def _auto_init(self, cr, context=None):
super(act_window_view, self)._auto_init(cr, context) super(act_window_view, self)._auto_init(cr, context)
@ -322,8 +322,8 @@ class act_wizard(osv.osv):
'model': fields.char('Object', size=64), 'model': fields.char('Object', size=64),
} }
_defaults = { _defaults = {
'type': lambda *a: 'ir.actions.wizard', 'type': 'ir.actions.wizard',
'multi': lambda *a: False, 'multi': False,
} }
act_wizard() act_wizard()
@ -344,8 +344,8 @@ class act_url(osv.osv):
) )
} }
_defaults = { _defaults = {
'type': lambda *a: 'ir.actions.act_url', 'type': 'ir.actions.act_url',
'target': lambda *a: 'new' 'target': 'new'
} }
act_url() act_url()
@ -388,7 +388,7 @@ class server_object_lines(osv.osv):
], 'Type', required=True, size=32, change_default=True), ], 'Type', required=True, size=32, change_default=True),
} }
_defaults = { _defaults = {
'type': lambda *a: 'equation', 'type': 'equation',
} }
server_object_lines() server_object_lines()
@ -490,11 +490,11 @@ class actions_server(osv.osv):
'copy_object': fields.reference('Copy Of', selection=_select_objects, size=256), 'copy_object': fields.reference('Copy Of', selection=_select_objects, size=256),
} }
_defaults = { _defaults = {
'state': lambda *a: 'dummy', 'state': 'dummy',
'condition': lambda *a: 'True', 'condition': 'True',
'type': lambda *a: 'ir.actions.server', 'type': 'ir.actions.server',
'sequence': lambda *a: 5, 'sequence': 5,
'code': lambda *a: """# You can use the following variables: 'code': """# You can use the following variables:
# - self: ORM model of the record on which the action is triggered # - self: ORM model of the record on which the action is triggered
# - object: browse_record of the record on which the action is triggered if there is one, otherwise None # - object: browse_record of the record on which the action is triggered if there is one, otherwise None
# - pool: ORM model pool (i.e. self.pool) # - pool: ORM model pool (i.e. self.pool)
@ -747,7 +747,7 @@ class act_window_close(osv.osv):
_inherit = 'ir.actions.actions' _inherit = 'ir.actions.actions'
_table = 'ir_actions' _table = 'ir_actions'
_defaults = { _defaults = {
'type': lambda *a: 'ir.actions.act_window_close', 'type': 'ir.actions.act_window_close',
} }
act_window_close() act_window_close()

View File

@ -80,13 +80,13 @@ class ir_cron(osv.osv):
_defaults = { _defaults = {
'nextcall' : lambda *a: time.strftime(DEFAULT_SERVER_DATETIME_FORMAT), 'nextcall' : lambda *a: time.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
'priority' : lambda *a: 5, 'priority' : 5,
'user_id' : lambda obj,cr,uid,context: uid, 'user_id' : lambda obj,cr,uid,context: uid,
'interval_number' : lambda *a: 1, 'interval_number' : 1,
'interval_type' : lambda *a: 'months', 'interval_type' : 'months',
'numbercall' : lambda *a: 1, 'numbercall' : 1,
'active' : lambda *a: 1, 'active' : 1,
'doall' : lambda *a: 1 'doall' : 1
} }
def _check_args(self, cr, uid, ids, context=None): def _check_args(self, cr, uid, ids, context=None):

View File

@ -197,7 +197,7 @@ class ir_mail_server(osv.osv):
logpiper = WriteToLogger(_logger) logpiper = WriteToLogger(_logger)
smtplib.stderr = logpiper smtplib.stderr = logpiper
smtplib.stdout = logpiper smtplib.stdout = logpiper
return super(ir_mail_server, self).__init__(*args,**kwargs) super(ir_mail_server, self).__init__(*args,**kwargs)
def name_get(self, cr, uid, ids, context=None): def name_get(self, cr, uid, ids, context=None):
return [(a["id"], "(%s)" % (a['name'])) for a in self.read(cr, uid, ids, ['name'], context=context)] return [(a["id"], "(%s)" % (a['name'])) for a in self.read(cr, uid, ids, ['name'], context=context)]

View File

@ -106,7 +106,7 @@ class ir_model(osv.osv):
} }
_defaults = { _defaults = {
'model': lambda *a: 'x_', 'model': 'x_',
'state': lambda self,cr,uid,ctx=None: (ctx and ctx.get('manual',False)) and 'manual' or 'base', 'state': lambda self,cr,uid,ctx=None: (ctx and ctx.get('manual',False)) and 'manual' or 'base',
} }

View File

@ -300,7 +300,7 @@ class view_sc(osv.osv):
_order = 'sequence,name' _order = 'sequence,name'
_defaults = { _defaults = {
'resource': lambda *a: 'ir.ui.menu', 'resource': 'ir.ui.menu',
'user_id': lambda obj, cr, uid, context: uid, 'user_id': lambda obj, cr, uid, context: uid,
} }
_sql_constraints = [ _sql_constraints = [

View File

@ -172,6 +172,7 @@
<field name="author"/> <field name="author"/>
<field name="installed_version"/> <field name="installed_version"/>
<field name="state"/> <field name="state"/>
<field name="category_id" invisible="1"/>
</tree> </tree>
</field> </field>
</record> </record>

View File

@ -46,12 +46,12 @@ class base_module_upgrade(osv.osv_memory):
ids = self.get_module_list(cr, uid, context=context) ids = self.get_module_list(cr, uid, context=context)
if not ids: if not ids:
res['arch'] = '''<form string="Apply Schedule Upgrade" version="7.0"> res['arch'] = '''<form string="Upgrade Completed" version="7.0">
<header> <separator string="Upgrade Completed" colspan="4"/>
<button name="config" string="Start configuration" type="object" icon="gtk-ok"/> <footer>
<button special="cancel" string="Close" icon="gtk-cancel"/> <button name="config" string="Start Configuration" type="object" class="oe_highlight"/> or
</header> <button special="cancel" string="Close" class="oe_link"/>
<separator string="Apply Schedule Upgrade" colspan="4"/> </footer>
</form>''' </form>'''
return res return res

View File

@ -31,7 +31,6 @@ import res_company
import res_users import res_users
import res_request import res_request
import res_lang import res_lang
import res_widget
import ir_property import ir_property
import report import report

View File

@ -155,7 +155,7 @@ class res_partner_bank(osv.osv):
cursor, user, 'country_id', context=context), cursor, user, 'country_id', context=context),
'state_id': lambda obj, cursor, user, context: obj._default_value( 'state_id': lambda obj, cursor, user, context: obj._default_value(
cursor, user, 'state_id', context=context), cursor, user, 'state_id', context=context),
'name': lambda *args: '/' 'name': '/'
} }
def fields_get(self, cr, uid, fields=None, context=None): def fields_get(self, cr, uid, fields=None, context=None):

View File

@ -51,8 +51,8 @@ class multi_company_default(osv.osv):
} }
_defaults = { _defaults = {
'expression': lambda *a: 'True', 'expression': 'True',
'sequence': lambda *a: 100, 'sequence': 100,
} }
def copy(self, cr, uid, id, default=None, context=None): def copy(self, cr, uid, id, default=None, context=None):
@ -235,7 +235,7 @@ class res_company(osv.osv):
self.cache_restart(cr) self.cache_restart(cr)
return super(res_company, self).create(cr, uid, vals, context=context) return super(res_company, self).create(cr, uid, vals, context=context)
obj_partner = self.pool.get('res.partner') obj_partner = self.pool.get('res.partner')
partner_id = obj_partner.create(cr, uid, {'name': vals['name'], 'is_company':True}, context=context) partner_id = obj_partner.create(cr, uid, {'name': vals['name'], 'is_company':True, 'image': vals.get('logo', False)}, context=context)
vals.update({'partner_id': partner_id}) vals.update({'partner_id': partner_id})
self.cache_restart(cr) self.cache_restart(cr)
company_id = super(res_company, self).create(cr, uid, vals, context=context) company_id = super(res_company, self).create(cr, uid, vals, context=context)

View File

@ -108,6 +108,14 @@
</tree> </tree>
</field> </field>
</record> </record>
<record id="company_normal_action_tree" model="ir.actions.act_window">
<field name="name">Companies</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.company</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('id','=',active_id)]</field>
</record>
<record id="action_res_company_form" model="ir.actions.act_window"> <record id="action_res_company_form" model="ir.actions.act_window">
<field name="name">Companies</field> <field name="name">Companies</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
@ -125,6 +133,13 @@
</record> </record>
<menuitem action="action_res_company_tree" groups="base.group_multi_company" id="menu_action_res_company_tree" parent="base.menu_res_company_global" sequence="16"/> <menuitem action="action_res_company_tree" groups="base.group_multi_company" id="menu_action_res_company_tree" parent="base.menu_res_company_global" sequence="16"/>
<record id="ir_open_company" model="ir.values">
<field eval="'tree_but_open'" name="key2"/>
<field eval="'res.company'" name="model"/>
<field name="name">Companies</field>
<field eval="'ir.actions.act_window,%d'%company_normal_action_tree" name="value"/>
</record>
<record id="view_inventory_tree" model="ir.ui.view"> <record id="view_inventory_tree" model="ir.ui.view">
<field name="name">multi_company.default.tree</field> <field name="name">multi_company.default.tree</field>
<field name="model">multi_company.default</field> <field name="model">multi_company.default</field>

View File

@ -69,7 +69,7 @@ class res_currency(osv.osv):
'position': fields.selection([('after','After Amount'),('before','Before Amount')], 'Symbol Position', help="Determines where the currency symbol should be placed after or before the amount.") 'position': fields.selection([('after','After Amount'),('before','Before Amount')], 'Symbol Position', help="Determines where the currency symbol should be placed after or before the amount.")
} }
_defaults = { _defaults = {
'active': lambda *a: 1, 'active': 1,
'position' : 'after', 'position' : 'after',
'rounding': 0.01, 'rounding': 0.01,
'accuracy': 4, 'accuracy': 4,

View File

@ -143,14 +143,14 @@ class lang(osv.osv):
'thousands_sep':fields.char('Thousands Separator',size=64), 'thousands_sep':fields.char('Thousands Separator',size=64),
} }
_defaults = { _defaults = {
'active': lambda *a: 1, 'active': 1,
'translatable': lambda *a: 0, 'translatable': 0,
'direction': lambda *a: 'ltr', 'direction': 'ltr',
'date_format':_get_default_date_format, 'date_format':_get_default_date_format,
'time_format':_get_default_time_format, 'time_format':_get_default_time_format,
'grouping':lambda *a: '[]', 'grouping': '[]',
'decimal_point':lambda *a: '.', 'decimal_point': '.',
'thousands_sep':lambda *a: ',', 'thousands_sep': ',',
} }
_sql_constraints = [ _sql_constraints = [
('name_uniq', 'unique (name)', 'The name of the language must be unique !'), ('name_uniq', 'unique (name)', 'The name of the language must be unique !'),

View File

@ -135,7 +135,7 @@ class res_partner_category(osv.osv):
(osv.osv._check_recursion, 'Error ! You can not create recursive categories.', ['parent_id']) (osv.osv._check_recursion, 'Error ! You can not create recursive categories.', ['parent_id'])
] ]
_defaults = { _defaults = {
'active': lambda *a: 1, 'active': 1,
} }
_parent_store = True _parent_store = True
_parent_order = 'name' _parent_order = 'name'
@ -213,7 +213,7 @@ class res_partner(osv.osv, format_address):
'employee': fields.boolean('Employee', help="Check this box if this contact is an Employee."), 'employee': fields.boolean('Employee', help="Check this box if this contact is an Employee."),
'function': fields.char('Job Position', size=128), 'function': fields.char('Job Position', size=128),
'type': fields.selection([('default', 'Default'), ('invoice', 'Invoice'), 'type': fields.selection([('default', 'Default'), ('invoice', 'Invoice'),
('delivery', 'Delivery'), ('contact', 'Contact'), ('delivery', 'Shipping'), ('contact', 'Contact'),
('other', 'Other')], 'Address Type', ('other', 'Other')], 'Address Type',
help="Used to select automatically the right address according to the context in sales and purchases documents."), help="Used to select automatically the right address according to the context in sales and purchases documents."),
'street': fields.char('Street', size=128), 'street': fields.char('Street', size=128),
@ -320,6 +320,12 @@ class res_partner(osv.osv, format_address):
return {'value': dict((key, value_or_id(parent[key])) for key in ADDRESS_FIELDS)} return {'value': dict((key, value_or_id(parent[key])) for key in ADDRESS_FIELDS)}
return {} return {}
def onchange_state(self, cr, uid, ids, state_id, context=None):
if state_id:
country_id = self.pool.get('res.country.state').browse(cr, uid, state_id, context).country_id.id
return {'value':{'country_id':country_id}}
return {}
def _check_ean_key(self, cr, uid, ids, context=None): def _check_ean_key(self, cr, uid, ids, context=None):
for partner_o in pooler.get_pool(cr.dbname).get('res.partner').read(cr, uid, ids, ['ean13',]): for partner_o in pooler.get_pool(cr.dbname).get('res.partner').read(cr, uid, ids, ['ean13',]):
thisean=partner_o['ean13'] thisean=partner_o['ean13']

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -162,7 +162,7 @@
<field name="street2"/> <field name="street2"/>
<div class="address_format"> <div class="address_format">
<field name="city" placeholder="City" style="width: 40%%"/> <field name="city" placeholder="City" style="width: 40%%"/>
<field name="state_id" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": True}'/> <field name="state_id" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": True}' on_change="onchange_state(state_id)"/>
<field name="zip" placeholder="ZIP" style="width: 20%%"/> <field name="zip" placeholder="ZIP" style="width: 20%%"/>
</div> </div>
<field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": True}'/> <field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": True}'/>

View File

@ -77,10 +77,10 @@ class res_request(osv.osv):
'history': fields.one2many('res.request.history','req_id', 'History') 'history': fields.one2many('res.request.history','req_id', 'History')
} }
_defaults = { _defaults = {
'act_from': lambda obj,cr,uid,context={}: uid, 'act_from': lambda obj,cr,uid,context=None: uid,
'state': lambda obj,cr,uid,context={}: 'draft', 'state': 'draft',
'active': lambda obj,cr,uid,context={}: True, 'active': True,
'priority': lambda obj,cr,uid,context={}: '1', 'priority': '1',
} }
_order = 'priority desc, trigger_date, create_date desc' _order = 'priority desc, trigger_date, create_date desc'
_table = 'res_request' _table = 'res_request'
@ -94,7 +94,7 @@ class res_request_link(osv.osv):
'priority': fields.integer('Priority'), 'priority': fields.integer('Priority'),
} }
_defaults = { _defaults = {
'priority': lambda *a: 5, 'priority': 5,
} }
_order = 'priority' _order = 'priority'
res_request_link() res_request_link()
@ -110,9 +110,9 @@ class res_request_history(osv.osv):
'date_sent': fields.datetime('Date sent', states={'waiting':[('readonly',True)]}, required=True) 'date_sent': fields.datetime('Date sent', states={'waiting':[('readonly',True)]}, required=True)
} }
_defaults = { _defaults = {
'name': lambda *a: 'NoName', 'name': 'NoName',
'act_from': lambda obj,cr,uid,context={}: uid, 'act_from': lambda obj,cr,uid,context=None: uid,
'act_to': lambda obj,cr,uid,context={}: uid, 'act_to': lambda obj,cr,uid,context=None: uid,
'date_sent': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), 'date_sent': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
} }
res_request_history() res_request_history()

View File

@ -122,7 +122,6 @@ class res_users(osv.osv):
} }
_name = "res.users" _name = "res.users"
_description = 'Users' _description = 'Users'
_order = 'login'
def _set_new_password(self, cr, uid, id, name, value, args, context=None): def _set_new_password(self, cr, uid, id, name, value, args, context=None):
if value is False: if value is False:

View File

@ -1,89 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields,osv
class res_widget(osv.osv):
_name = "res.widget"
_rec_name = "title"
_columns = {
'title' : fields.char('Title', size=64, required=True, translate=True),
'content': fields.text('Content', required=True),
}
res_widget()
class res_widget_user(osv.osv):
_name="res.widget.user"
_rec_name="user_id"
_order = "sequence"
_columns = {
'sequence': fields.integer('Sequence'),
'user_id': fields.many2one('res.users','User', select=1, ondelete='cascade'),
'widget_id': fields.many2one('res.widget','Widget',required=True, ondelete='cascade'),
}
def create(self, cr, uid, vals, context=None):
existing = self.search(cr, uid, [('user_id', '=', vals.get('user_id')), ('widget_id', '=', vals.get('widget_id'))], context=context)
if existing:
res = existing[0]
else:
res = super(res_widget_user, self).create(cr, uid, vals, context=context)
return res
res_widget_user()
class res_widget_wizard(osv.osv_memory):
_name = "res.widget.wizard"
_description = "Add a widget for User"
def widgets_list_get(self, cr, uid,context=None):
widget_obj=self.pool.get('res.widget')
ids=widget_obj.search(cr, uid,[],context=context)
if not len(ids):
return []
reads = widget_obj.read(cr, uid, ids, ['title'], context=context)
res = []
for record in reads:
res.append((record['id'], record['title']))
return res
_columns = {
'widgets_list': fields.selection(widgets_list_get,string='Widget',required=True),
}
def action_get(self, cr, uid, context=None):
return self.pool.get('ir.actions.act_window').for_xml_id(
cr, uid, 'base', 'action_res_widget_wizard', context=context)
def res_widget_add(self, cr, uid, ids, context=None):
widget_id = self.read(cr, uid, ids, context=context)[0]
if widget_id.has_key('widgets_list') and widget_id['widgets_list']:
self.pool.get('res.widget.user').create(
cr, uid, {'user_id':uid, 'widget_id':widget_id['widgets_list']}, context=context)
return {'type': 'ir.actions.act_window_close'}
res_widget_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="openerp_favorites_twitter_widget" model="res.widget">
<field name="title">OpenERP Tweets</field>
<field name="content"><![CDATA[
<script type="text/javascript" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script type="text/javascript">
if (typeof(TWTR) !== 'undefined') {
new TWTR.Widget({
version: 2,
type: 'faves',
rpp: 10,
interval: 6000,
title: '',
subject: '',
width: 'auto',
height: 300,
theme: {
shell: {
background: '#F0EEEE',
color: '#444444'
},
tweets: {
background: '#F0EEEE',
color: '#444444',
links: '#9A0404'
}
},
features: {
scrollbar: true,
loop: false,
live: true,
hashtags: true,
timestamp: true,
avatars: true,
behavior: 'all'
}
}).render().setUser('openerp').start();
}
</script>]]> </field>
</record>
<record id="events_widget" model="res.widget">
<field name="title">Events</field>
<field name="content"><![CDATA[<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<div style="width:195px; text-align:center;" ><iframe src="http://www.eventbrite.com/calendar-widget?eid=852573069" frameborder="0" height="626" width="220" marginheight="0" marginwidth="0" scrolling="no" ></iframe><div style="font-family:Helvetica, Arial; font-size:10px; padding:5px 0 5px; margin:2px; width:195px; text-align:center;" ><a style="color:#ddd; text-decoration:none;" target="_blank" href="http://www.eventbrite.com/features?ref=ecal" >Online Ticketing</a><span style="color:#ddd;" > powered by </span><a style="color:#ddd; text-decoration:none;" target="_blank" href="http://www.eventbrite.com?ref=ecal" >Eventbrite</a></div>]]></field>
</record>
<record id="facebook_widget" model="res.widget">
<field name="title">Facebook</field>
<field name="content"><![CDATA[<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<iframe src="http://www.facebook.com/plugins/activity.php?site=www.facebook.com/OpenERP&width=399&height=300&header=true&colorscheme=light&recommendations=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:399px; height:300px;" allowTransparency="true"></iframe>]]></field>
</record>
<record id="note_widget" model="res.widget">
<field name="title">Notes</field>
<field name="content"><![CDATA[<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/sticky.xml&amp;up_title=Note&amp;up_bgcolor=white&amp;up_textcolor=Black&amp;up_stickydata=&amp;synd=open&amp;w=399&amp;h=200&amp;title=Notes&amp;lang=all&amp;country=ALL&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>]]></field>
</record>
<record id="google_maps_widget" model="res.widget">
<field name="title">Google Maps</field>
<field name="content"><![CDATA[<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/uds/modules/elements/localsearch/localsearch.xml&amp;up_location=Ramillies&amp;up_largeMapMode=1&amp;up_kml=1&amp;up_traffic=&amp;up_locationCacheString=&amp;up_locationCacheLat=&amp;up_locationCacheLng=&amp;up_mapType=m&amp;up_idleZoom=11&amp;up_transitionQuery=&amp;up_rawquery=&amp;up_selectedtext=&amp;synd=open&amp;w=399&amp;h=350&amp;title=Map&amp;lang=all&amp;country=ALL&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>]]></field>
</record>
<record id="currency_converter_widget" model="res.widget">
<field name="title">Currency Converter</field>
<field name="content"><![CDATA[<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script src="http://www.gmodules.com/ig/ifr?url=http://www.pixelmedia.nl/gmodules/ucc.xml&amp;up_fromcur=USD&amp;up_tocur=EUR&amp;synd=open&amp;w=399&amp;h=110&amp;title=Currency+Converter&amp;lang=all&amp;country=ALL&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>]]></field>
</record>
<record id="openerp_favorites" model="res.widget.user">
<field name="widget_id" ref="openerp_favorites_twitter_widget"/>
</record>
</data>
</openerp>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
</data>
</openerp>

View File

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_res_widget_search" model="ir.ui.view">
<field name="name">res.widget.search</field>
<field name="model">res.widget</field>
<field name="arch" type="xml">
<search string="Search Widget">
<field name="title" string="Widget"/>
</search>
</field>
</record>
<record id="res_widget_form" model="ir.ui.view">
<field name="name">res.widget.form</field>
<field name="model">res.widget</field>
<field name="arch" type="xml">
<form string="Widgets" version="7.0">
<sheet>
<group>
<field name="title"/>
<field name="content"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="res_widget_tree" model="ir.ui.view">
<field name="name">res.widget.tree</field>
<field name="model">res.widget</field>
<field name="arch" type="xml">
<tree string="Widgets">
<field name="title"/>
</tree>
</field>
</record>
<record id="res_widget_act_window" model="ir.actions.act_window">
<field name="name">Homepage Widgets</field>
<field name="res_model">res.widget</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_res_widget_search"/>
</record>
<menuitem action="res_widget_act_window" id="menu_res_widget_act_window" parent="base.next_id_2" />
<record id="res_widget_user_tree" model="ir.ui.view">
<field name="name">res.widget.user.tree</field>
<field name="model">res.widget.user</field>
<field name="arch" type="xml">
<tree string="User Widgets">
<field name="sequence" invisible="1"/>
<field name="user_id"/>
<field name="widget_id"/>
</tree>
</field>
</record>
<record id="res_widget_user_form" model="ir.ui.view">
<field name="name">res.widget.user.form</field>
<field name="model">res.widget.user</field>
<field name="arch" type="xml">
<form string="User Widgets" version="7.0">
<sheet>
<group col="4">
<field name="widget_id"/>
<field name="user_id"/>
<field name="sequence"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="res_widget_user_act_window" model="ir.actions.act_window">
<field name="name">Widgets per User</field>
<field name="res_model">res.widget.user</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="res_widget_user_act_window" id="menu_res_widget_user_act_window" parent="base.next_id_2"/>
<record id="view_res_widget_wizard" model="ir.ui.view">
<field name="name">Homepage Widgets Management</field>
<field name="model">res.widget.wizard</field>
<field name="arch" type="xml">
<form string="Widget Wizard" col="4" version="7.0">
<header>
<button name="res_widget_add" string="Add" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<group>
<field name="widgets_list"/>
</group>
</form>
</field>
</record>
<act_window name="Homepage Widgets Management"
res_model="res.widget.wizard" src_model="res.widget.user"
view_mode="form" target="new" key2="client_action_multi"
id="action_res_widget_wizard"/>
</data>
</openerp>

View File

@ -46,12 +46,6 @@
<field name="groups_id" eval="[(6,0, [ref('group_system'), ref('group_erp_manager')])]"/> <field name="groups_id" eval="[(6,0, [ref('group_system'), ref('group_erp_manager')])]"/>
</record> </record>
<record model="ir.rule" id="res_widget_user_rule">
<field name="name">res.widget.user rule</field>
<field name="model_id" ref="model_res_widget_user"/>
<field name="domain_force">['|', ('user_id','=',user.id),('user_id','=',False)]</field>
</record>
<record model="ir.rule" id="res_partner_rule"> <record model="ir.rule" id="res_partner_rule">
<field name="name">res.partner company</field> <field name="name">res.partner company</field>
<field name="model_id" ref="model_res_partner"/> <field name="model_id" ref="model_res_partner"/>

View File

@ -1,6 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_res_widget_user_all","res_widget_user all","model_res_widget_user",,1,1,1,1
"access_res_widget_user_group_user","res_widget_user group_user","model_res_widget_user","group_user",1,1,1,1
"access_ir_attachment_all","ir_attachment all","model_ir_attachment",,1,0,0,0 "access_ir_attachment_all","ir_attachment all","model_ir_attachment",,1,0,0,0
"access_ir_attachment_group_user","ir_attachment group_user","model_ir_attachment","group_user",1,1,1,1 "access_ir_attachment_group_user","ir_attachment group_user","model_ir_attachment","group_user",1,1,1,1
"access_ir_cron_group_cron","ir_cron group_cron","model_ir_cron","group_system",1,1,1,1 "access_ir_cron_group_cron","ir_cron group_cron","model_ir_cron","group_system",1,1,1,1
@ -115,8 +113,6 @@
"access_ir_filter all","ir_filters all","model_ir_filters",,1,0,0,0 "access_ir_filter all","ir_filters all","model_ir_filters",,1,0,0,0
"access_ir_filter employee","ir_filters employee","model_ir_filters","group_user",1,1,1,1 "access_ir_filter employee","ir_filters employee","model_ir_filters","group_user",1,1,1,1
"access_ir_filters","ir_filters_all","model_ir_filters",,1,1,1,1 "access_ir_filters","ir_filters_all","model_ir_filters",,1,1,1,1
"access_res_widget","res.widget","model_res_widget","group_erp_manager",1,1,1,1
"access_res_widget_user","res.widget.user","model_res_widget",,1,0,0,0
"access_ir_config_parameter","ir_config_parameter","model_ir_config_parameter",,1,0,0,0 "access_ir_config_parameter","ir_config_parameter","model_ir_config_parameter",,1,0,0,0
"access_ir_mail_server_all","ir_mail_server","model_ir_mail_server",,1,0,0,0 "access_ir_mail_server_all","ir_mail_server","model_ir_mail_server",,1,0,0,0
"access_ir_actions_client","ir_actions_client all","model_ir_actions_client",,1,0,0,0 "access_ir_actions_client","ir_actions_client all","model_ir_actions_client",,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_res_widget_user_all res_widget_user all model_res_widget_user 1 1 1 1
access_res_widget_user_group_user res_widget_user group_user model_res_widget_user group_user 1 1 1 1
2 access_ir_attachment_all ir_attachment all model_ir_attachment 1 0 0 0
3 access_ir_attachment_group_user ir_attachment group_user model_ir_attachment group_user 1 1 1 1
4 access_ir_cron_group_cron ir_cron group_cron model_ir_cron group_system 1 1 1 1
113 access_ir_filter all ir_filters all model_ir_filters 1 0 0 0
114 access_ir_filter employee ir_filters employee model_ir_filters group_user 1 1 1 1
115 access_ir_filters ir_filters_all model_ir_filters 1 1 1 1
access_res_widget res.widget model_res_widget group_erp_manager 1 1 1 1
access_res_widget_user res.widget.user model_res_widget 1 0 0 0
116 access_ir_config_parameter ir_config_parameter model_ir_config_parameter 1 0 0 0
117 access_ir_mail_server_all ir_mail_server model_ir_mail_server 1 0 0 0
118 access_ir_actions_client ir_actions_client all model_ir_actions_client 1 0 0 0

View File

@ -1548,7 +1548,6 @@ class BaseModel(object):
) )
self._invalids.update(fields) self._invalids.update(fields)
if error_msgs: if error_msgs:
cr.rollback()
raise except_orm('ValidateError', '\n'.join(error_msgs)) raise except_orm('ValidateError', '\n'.join(error_msgs))
else: else:
self._invalids.clear() self._invalids.clear()
@ -2293,7 +2292,9 @@ class BaseModel(object):
if view_type == 'tree' or not action[2].get('multi')] if view_type == 'tree' or not action[2].get('multi')]
resprint = [clean(print_) for print_ in resprint resprint = [clean(print_) for print_ in resprint
if view_type == 'tree' or not print_[2].get('multi')] if view_type == 'tree' or not print_[2].get('multi')]
resrelate = map(lambda x: x[2], resrelate) #When multi="True" set it will display only in More of the list view
resrelate = [clean(action) for action in resrelate
if (action[2].get('multi') and view_type == 'tree') or (not action[2].get('multi') and view_type == 'form')]
for x in itertools.chain(resprint, resaction, resrelate): for x in itertools.chain(resprint, resaction, resrelate):
x['string'] = x['name'] x['string'] = x['name']

View File

@ -9,7 +9,7 @@ See the :ref:`test-framework` section in the :ref:`features` list.
""" """
from . import test_expression, test_html_sanitize, test_ir_sequence, test_orm,\ from . import test_expression, test_html_sanitize, test_ir_sequence, test_orm,\
test_fields, test_per_class_teardown, \ test_fields, test_basecase, \
test_view_validation, test_uninstall, test_misc, test_db_cursor test_view_validation, test_uninstall, test_misc, test_db_cursor
fast_suite = [ fast_suite = [
@ -22,7 +22,7 @@ checks = [
test_db_cursor, test_db_cursor,
test_orm, test_orm,
test_fields, test_fields,
test_per_class_teardown, test_basecase,
test_view_validation, test_view_validation,
test_misc, test_misc,
] ]

View File

@ -1,5 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os """
The module :mod:`openerp.tests.common` provides a few helpers and classes to write
tests.
"""
import threading import threading
import time import time
import unittest2 import unittest2
@ -40,10 +43,11 @@ def stop_openerp():
""" """
openerp.service.stop_services() openerp.service.stop_services()
class BaseCase(unittest2.TestCase): class BaseCase(unittest2.TestCase):
""" """
Subclass of TestCase for common OpenERP-specific code. Subclass of TestCase for common OpenERP-specific code.
This class is abstract and expects self.cr and self.uid to be initialized by subclasses.
""" """
@classmethod @classmethod
@ -54,6 +58,29 @@ class BaseCase(unittest2.TestCase):
def registry(self, model): def registry(self, model):
return openerp.modules.registry.RegistryManager.get(DB)[model] return openerp.modules.registry.RegistryManager.get(DB)[model]
@classmethod
def ref(self, xid):
""" Returns database ID corresponding to a given identifier.
:param xid: fully-qualified record identifier, in the form ``module.identifier``
:raise: ValueError if not found
"""
assert "." in xid, "this method requires a fully qualified parameter, in the following form: 'module.identifier'"
module, xid = xid.split('.')
_, id = self.registry('ir.model.data').get_object_reference(self.cr, self.uid, module, xid)
return id
@classmethod
def browse_ref(self, xid):
""" Returns a browsable record for the given identifier.
:param xid: fully-qualified record identifier, in the form ``module.identifier``
:raise: ValueError if not found
"""
assert "." in xid, "this method requires a fully qualified parameter, in the following form: 'module.identifier'"
module, xid = xid.split('.')
return self.registry('ir.model.data').get_object(self.cr, self.uid, module, xid)
class TransactionCase(BaseCase): class TransactionCase(BaseCase):
""" """
@ -92,8 +119,8 @@ class RpcCase(unittest2.TestCase):
Subclass of TestCase with a few XML-RPC proxies. Subclass of TestCase with a few XML-RPC proxies.
""" """
def __init__(self, name): def __init__(self, methodName='runTest'):
super(RpcCase, self).__init__(name) super(RpcCase, self).__init__(methodName)
class A(object): class A(object):
pass pass

View File

@ -1,10 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest2 import unittest2
import openerp
import common import common
class test_per_class_teardown(common.SingleTransactionCase): class test_single_transaction_case(common.SingleTransactionCase):
""" """
Check the whole-class transaction behavior of SingleTransactionCase. Check the whole-class transaction behavior of SingleTransactionCase.
""" """
@ -22,7 +21,30 @@ class test_per_class_teardown(common.SingleTransactionCase):
ids = self.registry('res.partner').search(cr, uid, [('name', '=', 'test_per_class_teardown_partner')]) ids = self.registry('res.partner').search(cr, uid, [('name', '=', 'test_per_class_teardown_partner')])
self.assertEqual(1, len(ids), "Test partner not found.") self.assertEqual(1, len(ids), "Test partner not found.")
class test_per_method_teardown(common.TransactionCase): def test_20a(self):
""" Create a partner with a XML ID """
cr, uid = self.cr, self.uid
res_partner = self.registry('res.partner')
ir_model_data = self.registry('ir.model.data')
pid, _ = res_partner.name_create(cr, uid, 'Mr Blue')
ir_model_data.create(cr, uid, {'name': 'test_partner_blue',
'module': 'base',
'model': 'res.partner',
'res_id': pid})
def test_20b(self):
""" Resolve xml id with ref() and browse_ref() """
cr, uid = self.cr, self.uid
res_partner = self.registry('res.partner')
xid = 'base.test_partner_blue'
p_ref = self.ref(xid)
self.assertTrue(p_ref, "ref() should resolve xid to database ID")
partner = res_partner.browse(cr, uid, p_ref)
p_browse_ref = self.browse_ref(xid)
self.assertEqual(partner, p_browse_ref, "browse_ref() should resolve xid to browse records")
class test_transaction_case(common.TransactionCase):
""" """
Check the per-method transaction behavior of TransactionCase. Check the per-method transaction behavior of TransactionCase.
""" """

View File

@ -286,8 +286,11 @@ class YamlInterpreter(object):
model = self.get_model(record.model) model = self.get_model(record.model)
view_id = record.view view_id = record.view
if view_id and (view_id is not True): if view_id and (view_id is not True) and isinstance(view_id, basestring):
view_id = self.pool.get('ir.model.data').get_object_reference(self.cr, SUPERUSER_ID, self.module, record.view)[1] module = self.module
if '.' in view_id:
module, view_id = view_id.split('.',1)
view_id = self.pool.get('ir.model.data').get_object_reference(self.cr, SUPERUSER_ID, module, view_id)[1]
if model.is_transient(): if model.is_transient():
record_dict=self.create_osv_memory_record(record, fields) record_dict=self.create_osv_memory_record(record, fields)
@ -378,7 +381,11 @@ class YamlInterpreter(object):
return False return False
return val return val
view = view_info and etree.fromstring(view_info['arch'].encode('utf-8')) or False if view_info:
arch = etree.fromstring(view_info['arch'].encode('utf-8'))
view = arch if len(arch) else False
else:
view = False
fields = fields or {} fields = fields or {}
if view is not False: if view is not False:
fg = view_info['fields'] fg = view_info['fields']

View File

@ -109,6 +109,8 @@ def assert_constructor(loader, node):
def record_constructor(loader, node): def record_constructor(loader, node):
kwargs = loader.construct_mapping(node) kwargs = loader.construct_mapping(node)
assert "model" in kwargs, "'model' argument is required for !record"
assert "id" in kwargs, "'id' argument is required for !record"
return Record(**kwargs) return Record(**kwargs)
def python_constructor(loader, node): def python_constructor(loader, node):