From a4a9c2941f95cbd229171adf9d23c977485a1804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 17 Apr 2012 10:43:15 +0200 Subject: [PATCH 001/963] [REF] Moved nex features merges from api to revisions. bzr revid: tde@openerp.com-20120417084315-omitzsd21sq3mby0 --- doc/index.rst | 31 +++----------------- doc/index.rst.inc | 12 ++++---- doc/{api => revisions}/need_action_specs.rst | 0 doc/{api => revisions}/user_img_specs.rst | 0 4 files changed, 10 insertions(+), 33 deletions(-) rename doc/{api => revisions}/need_action_specs.rst (100%) rename doc/{api => revisions}/user_img_specs.rst (100%) diff --git a/doc/index.rst b/doc/index.rst index 815633aed54..51162354913 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,29 +1,6 @@ -.. OpenERP Web documentation master file, created by - sphinx-quickstart on Fri Mar 18 16:31:55 2011. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. +:orphan: -Welcome to OpenERP Web's documentation! -======================================= +OpenERP Server Developers Documentation +======================================== -Contents: - -.. toctree:: - :maxdepth: 2 - - search-view - - getting-started - production - widgets - addons - development - project - old-version - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` +.. include:: index.rst.inc diff --git a/doc/index.rst.inc b/doc/index.rst.inc index 80873a696ec..da37481785f 100644 --- a/doc/index.rst.inc +++ b/doc/index.rst.inc @@ -1,17 +1,17 @@ -OpenERP Server -'''''''''''''' +OpenERP Server Documentation +''''''''''''''''''''''''''''' .. toctree:: :maxdepth: 1 test-framework -New feature merges -++++++++++++++++++ +Main revisions and new features +++++++++++++++++++++++++++++++++ .. toctree:: :maxdepth: 1 - api/user_img_specs - api/need_action_specs + revisions/user_img_specs + revisions/need_action_specs diff --git a/doc/api/need_action_specs.rst b/doc/revisions/need_action_specs.rst similarity index 100% rename from doc/api/need_action_specs.rst rename to doc/revisions/need_action_specs.rst diff --git a/doc/api/user_img_specs.rst b/doc/revisions/user_img_specs.rst similarity index 100% rename from doc/api/user_img_specs.rst rename to doc/revisions/user_img_specs.rst From 05cbf324d405716eef963984eff530e27c55a02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 17 Apr 2012 11:21:34 +0200 Subject: [PATCH 002/963] [REN] Renamed test-framework to 99_test_framework (temp modification to include dev book) bzr revid: tde@openerp.com-20120417092134-rpmk8rd14svdgde2 --- doc/99_test_framework.rst | 100 ++++++++++++++++++++++++++++++++++++++ doc/index.rst.inc | 3 +- 2 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 doc/99_test_framework.rst diff --git a/doc/99_test_framework.rst b/doc/99_test_framework.rst new file mode 100644 index 00000000000..56951b1a8e1 --- /dev/null +++ b/doc/99_test_framework.rst @@ -0,0 +1,100 @@ +.. _test-framework: + +Test framework +============== + +In addition to the YAML-based tests, OpenERP uses the unittest2_ testing +framework to test both the core ``openerp`` package and its addons. For the +core and each addons, tests are divided between three (overlapping) sets: + +1. A test suite that comprises all the tests that can be run right after the + addons is installed (or, for the core, right after a database is created). + That suite is called ``fast_suite`` and must contain only tests that can be run + frequently. Actually most of the tests should be considered fast enough to be + included in that ``fast_suite`` list and only tests that take a long time to run + (e.g. more than a minute) should not be listed. Those long tests should come up + pretty rarely. + +2. A test suite called ``checks`` provides sanity checks. These tests are + invariants that must be full-filled at any time. They are expected to always + pass: obviously they must pass right after the module is installed (i.e. just + like the ``fast_suite`` tests), but they must also pass after any other module is + installed, after a migration, or even after the database was put in production + for a few months. + +3. The third suite is made of all the tests: those provided by the two above + suites, but also tests that are not explicitely listed in ``fast_suite`` or + ``checks``. They are not explicitely listed anywhere and are discovered + automatically. + +As the sanity checks provide stronger guarantees about the code and database +structure, new tests must be added to the ``checks`` suite whenever it is +possible. Said with other words: one should try to avoid writing tests that +assume a freshly installed/unaltered module or database. + +It is possible to have tests that are not listed in ``fast_suite`` or +``checks``. This is useful if a test takes a lot of time. By default, when +using the testing infrastructure, tests should run fast enough so that people +can use them frequently. One can also use that possiblity for tests that +require some complex setup before they can be successfuly run. + +As a rule of thumb when writing a new test, try to add it to the ``checks`` +suite. If it really needs that the module it belongs to is freshly installed, +add it to ``fast_suite``. Finally, if it can not be run in an acceptable time +frame, don't add it to any explicit list. + +Writing tests +------------- + +The tests must be developed under ``.tests`` (or ``openerp.tests`` +for the core). For instance, with respect to the tests, a module ``foo`` +should be organized as follow:: + + foo/ + __init__.py # does not import .tests + tests/ + __init__.py # import some of the tests sub-modules, and + # list them in fast_suite or checks + test_bar.py # contains unittest2 classes + test_baz.py # idem + ... and so on ... + +The two explicit lists of tests are thus the variables ``foo.tests.fast_suite`` +and ``foo.tests.checks``. As an example, you can take a look at the +``openerp.tests`` module (which follows exactly the same conventions even if it +is not an addons). + +Note that the ``fast_suite`` and ``checks`` variables are really lists of +module objects. They could be directly unittest2 suite objects if necessary in +the future. + +Running the tests +----------------- + +To run the tests (see :ref:`above ` to learn how tests are +organized), the simplest way is to use the ``oe`` command (provided by the +``openerp-command`` project). + +:: + + > oe run-tests # will run all the fast_suite tests + > oe run-tests -m openerp # will run all the fast_suite tests defined in `openerp.tests` + > oe run-tests -m sale # will run all the fast_suite tests defined in `openerp.addons.sale.tests` + > oe run-tests -m foo.test_bar # will run the tests defined in `openerp.addons.foo.tests.test_bar` + +In addition to the above possibilities, when invoked with a non-existing module +(or module.sub-module) name, oe will reply with a list of available test +sub-modules. + +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 +may be created before the test is run, and the module providing the test will +be installed on that database. + +Because creating a database, installing modules, and then dropping it is +expensive, it is possible to interleave the run of the ``fast_suite`` tests +with the initialization of a new database: the dabase is created, and after +each requested module is installed, its fast_suite tests are run. The database +is thus created and dropped (and the modules installed) only once. + +.. _unittest2: http://pypi.python.org/pypi/unittest2 diff --git a/doc/index.rst.inc b/doc/index.rst.inc index da37481785f..e36bccd79d5 100644 --- a/doc/index.rst.inc +++ b/doc/index.rst.inc @@ -5,7 +5,8 @@ OpenERP Server Documentation .. toctree:: :maxdepth: 1 - test-framework + 01_getting_started + 99_test_framework Main revisions and new features ++++++++++++++++++++++++++++++++ From efa85ca0809d109f377adef17fa209d6c81e4e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 17 Apr 2012 11:22:05 +0200 Subject: [PATCH 003/963] [REF] Added first chapter from dev book: getting started. Rewrote the installation guide. bzr revid: tde@openerp.com-20120417092205-5mfvukv35qysj6h6 --- doc/01_getting_started.rst | 279 +++++++++++++++++++++++++++++++++++++ doc/test-framework.rst | 100 ------------- 2 files changed, 279 insertions(+), 100 deletions(-) create mode 100644 doc/01_getting_started.rst delete mode 100644 doc/test-framework.rst diff --git a/doc/01_getting_started.rst b/doc/01_getting_started.rst new file mode 100644 index 00000000000..e7bd882305a --- /dev/null +++ b/doc/01_getting_started.rst @@ -0,0 +1,279 @@ +========================================= +Getting started with OpenERP development +========================================= + +.. toctree:: + :maxdepth: 1 + +Installation from sources +++++++++++++++++++++++++++ + +.._getting_started_installation_source-link: + +Source code is hosted on Launchpad_. In order to get the sources, you will need Bazaar_ to pull the source from Launchpad. Bazaar is a version control system that helps you track project history over time and collaborate efficiently. You may have to create an account on Launchpad to be able to collaborate on OpenERP development. Please refer to the Launchpad and Bazaar documentation to install and setup your development environment. + +The running example of this section is based on an Ubuntu environment. You may have to adapt the steps according to your system. Once your working environment is ready, prepare a working directory that will contain the sources. For a ``source`` base directory, type:: + + mkdir source;cd source + +OpenERP provides a setup script that automatizes the tasks of creating a shared repository and getting the source code. Get the setup script of OpenERP by typing:: + + bzr cat -d lp:~openerp-dev/openerp-tools/trunk setup.sh | sh + +This will create the following two files in your ``source`` directory:: + + -rw-rw-r-- 1 openerp openerp 5465 2012-04-17 11:05 Makefile + -rw-rw-r-- 1 openerp openerp 2902 2012-04-17 11:05 Makefile_helper.py + +If you want some help about the available options, please type:: + + make help + +Next step is to initialize the shared repository and download the sources. Get the current trunk version of OpenERP by typing:: + + make init-trunk + +This will create the following structure inside your ``source`` directory, and fetch the latest source code from ``trunk``:: + + drwxrwxr-x 3 openerp openerp 4096 2012-04-17 11:10 addons + drwxrwxr-x 3 openerp openerp 4096 2012-04-17 11:10 client + drwxrwxr-x 3 openerp openerp 4096 2012-04-17 11:10 client-web + drwxrwxr-x 2 openerp openerp 4096 2012-04-17 11:10 dump + drwxrwxr-x 3 openerp openerp 4096 2012-04-17 11:10 misc + drwxrwxr-x 3 openerp openerp 4096 2012-04-17 11:10 server + drwxrwxr-x 3 openerp openerp 4096 2012-04-17 11:10 web + +Some dependencies are necessary to use OpenERP. Depending on your environment, you might have to install the following packages:: + + sudo apt-get install graphviz ghostscript postgresql + python-imaging python-matplotlib + +Next step is to initialize the database. This will create a new openerp role:: + + make db-setup + +Finally, launch the OpenERP server:: + + make server + +Testing your installation can be done on http://localhost:8069/ . You should see the OpenERP main login page. + +.. _Launchpad: https://launchpad.net/ +.. _Bazaar: http://bazaar.canonical.com/en/ + +Configuration +============= + +.. _getrting_started_configuration-link: + +Two configuration files are available: + + * one for the client: ~/.openerprc + * one for the server: ~/.openerp_serverrc + +Those files follow the convention used by python's ConfigParser module. + +Lines beginning with "#" or ";" are comments. + +The client configuration file is automatically generated upon the first start. The one of the server can automatically be created using the command: :: + + openerp-server.py -s + +If they are not found, the server and the client will start with the default configuration. + + +**Server Configuration File** + +The server configuration file .openerp_serverrc is used to save server startup options. Here is the list of the available options: + +:interface: + Address to which the server will be bound + +:port: + Port the server will listen on + +:database: + Name of the database to use + +:user: + Username used when connecting to the database + +:translate_in: + File used to translate OpenERP to your language + +:translate_out: + File used to export the language OpenERP use + +:language: + Use this language as the language of the server. This must be specified as an ISO country code, as specified by the W3C. + +:verbose: + Enable debug output + +:init: + init a module (use "all" for all modules) + +:update: + update a module (use "all" for all modules) + +:upgrade: + Upgrade/install/uninstall modules + +:db_name: + specify the database name + +:db_user: + specify the database user name + +:db_password: + specify the database password + +:pg_path: + specify the pg executable path + +:db_host: + specify the database host + +:db_port: + specify the database port + +:translate_modules: + Specify modules to export. Use in combination with --i18n-export + + +You can create your own configuration file by specifying -s or --save on the server command line. If you would like to write an alternative configuration file, use -c or --config= +Here is a basic configuration for a server:: + + [options] + verbose = False + xmlrpc = True + database = terp + update = {} + port = 8069 + init = {} + interface = 127.0.0.1 + reportgz = False + +Full Example for Server V5.0 :: + + [printer] + path = none + softpath_html = none + preview = True + softpath = none + + [logging] + output = stdout + logger = + verbose = True + level = error + + [help] + index = http://www.openerp.com/documentation/user-manual/ + context = http://www.openerp.com/scripts/context_index.php + + [form] + autosave = False + toolbar = True + + [support] + recipient = support@openerp.com + support_id = + + [tip] + position = 0 + autostart = False + + [client] + lang = en_US + default_path = /home/user + filetype = {} + theme = none + toolbar = icons + form_tab_orientation = 0 + form_tab = top + + [survey] + position = 3 + + [path] + pixmaps = /usr/share/pixmaps/openerp-client/ + share = /usr/share/openerp-client/ + + [login] + db = eo2 + login = admin + protocol = http:// + port = 8069 + server = localhost + + +Command line options +==================== + +General Options +--------------- + + --version show program version number and exit + -h, --help show this help message and exit + -c CONFIG, --config=CONFIG + specify alternate config file + -s, --save save configuration to ~/.terp_serverrc + -v, --verbose enable debugging + --pidfile=PIDFILE file where the server pid will be stored + --logfile=LOGFILE file where the server log will be stored + -n INTERFACE, --interface=INTERFACE + specify the TCP IP address + -p PORT, --port=PORT specify the TCP port + --net_interface=NETINTERFACE + specify the TCP IP address for netrpc + --net_port=NETPORT specify the TCP port for netrpc + --no-netrpc disable netrpc + --no-xmlrpc disable xmlrpc + -i INIT, --init=INIT init a module (use "all" for all modules) + --without-demo=WITHOUT_DEMO + load demo data for a module (use "all" for all + modules) + -u UPDATE, --update=UPDATE + update a module (use "all" for all modules) + --stop-after-init stop the server after it initializes + --debug enable debug mode + -S, --secure launch server over https instead of http + --smtp=SMTP_SERVER specify the SMTP server for sending mail + +Database related options: +------------------------- + + -d DB_NAME, --database=DB_NAME + specify the database name + -r DB_USER, --db_user=DB_USER + specify the database user name + -w DB_PASSWORD, --db_password=DB_PASSWORD + specify the database password + --pg_path=PG_PATH specify the pg executable path + --db_host=DB_HOST specify the database host + --db_port=DB_PORT specify the database port + +Internationalization options: +----------------------------- + + Use these options to translate OpenERP to another language.See i18n + section of the user manual. Option '-l' is mandatory. + + -l LANGUAGE, --language=LANGUAGE + specify the language of the translation file. Use it + with --i18n-export and --i18n-import + --i18n-export=TRANSLATE_OUT + export all sentences to be translated to a CSV file + and exit + --i18n-import=TRANSLATE_IN + import a CSV file with translations and exit + --modules=TRANSLATE_MODULES + specify modules to export. Use in combination with + --i18n-export + +Options from previous versions: +------------------------------- +Some options were removed in version 6. For example, ``price_accuracy`` is now +configured through the :ref:`decimal_accuracy` screen. + diff --git a/doc/test-framework.rst b/doc/test-framework.rst deleted file mode 100644 index 56951b1a8e1..00000000000 --- a/doc/test-framework.rst +++ /dev/null @@ -1,100 +0,0 @@ -.. _test-framework: - -Test framework -============== - -In addition to the YAML-based tests, OpenERP uses the unittest2_ testing -framework to test both the core ``openerp`` package and its addons. For the -core and each addons, tests are divided between three (overlapping) sets: - -1. A test suite that comprises all the tests that can be run right after the - addons is installed (or, for the core, right after a database is created). - That suite is called ``fast_suite`` and must contain only tests that can be run - frequently. Actually most of the tests should be considered fast enough to be - included in that ``fast_suite`` list and only tests that take a long time to run - (e.g. more than a minute) should not be listed. Those long tests should come up - pretty rarely. - -2. A test suite called ``checks`` provides sanity checks. These tests are - invariants that must be full-filled at any time. They are expected to always - pass: obviously they must pass right after the module is installed (i.e. just - like the ``fast_suite`` tests), but they must also pass after any other module is - installed, after a migration, or even after the database was put in production - for a few months. - -3. The third suite is made of all the tests: those provided by the two above - suites, but also tests that are not explicitely listed in ``fast_suite`` or - ``checks``. They are not explicitely listed anywhere and are discovered - automatically. - -As the sanity checks provide stronger guarantees about the code and database -structure, new tests must be added to the ``checks`` suite whenever it is -possible. Said with other words: one should try to avoid writing tests that -assume a freshly installed/unaltered module or database. - -It is possible to have tests that are not listed in ``fast_suite`` or -``checks``. This is useful if a test takes a lot of time. By default, when -using the testing infrastructure, tests should run fast enough so that people -can use them frequently. One can also use that possiblity for tests that -require some complex setup before they can be successfuly run. - -As a rule of thumb when writing a new test, try to add it to the ``checks`` -suite. If it really needs that the module it belongs to is freshly installed, -add it to ``fast_suite``. Finally, if it can not be run in an acceptable time -frame, don't add it to any explicit list. - -Writing tests -------------- - -The tests must be developed under ``.tests`` (or ``openerp.tests`` -for the core). For instance, with respect to the tests, a module ``foo`` -should be organized as follow:: - - foo/ - __init__.py # does not import .tests - tests/ - __init__.py # import some of the tests sub-modules, and - # list them in fast_suite or checks - test_bar.py # contains unittest2 classes - test_baz.py # idem - ... and so on ... - -The two explicit lists of tests are thus the variables ``foo.tests.fast_suite`` -and ``foo.tests.checks``. As an example, you can take a look at the -``openerp.tests`` module (which follows exactly the same conventions even if it -is not an addons). - -Note that the ``fast_suite`` and ``checks`` variables are really lists of -module objects. They could be directly unittest2 suite objects if necessary in -the future. - -Running the tests ------------------ - -To run the tests (see :ref:`above ` to learn how tests are -organized), the simplest way is to use the ``oe`` command (provided by the -``openerp-command`` project). - -:: - - > oe run-tests # will run all the fast_suite tests - > oe run-tests -m openerp # will run all the fast_suite tests defined in `openerp.tests` - > oe run-tests -m sale # will run all the fast_suite tests defined in `openerp.addons.sale.tests` - > oe run-tests -m foo.test_bar # will run the tests defined in `openerp.addons.foo.tests.test_bar` - -In addition to the above possibilities, when invoked with a non-existing module -(or module.sub-module) name, oe will reply with a list of available test -sub-modules. - -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 -may be created before the test is run, and the module providing the test will -be installed on that database. - -Because creating a database, installing modules, and then dropping it is -expensive, it is possible to interleave the run of the ``fast_suite`` tests -with the initialization of a new database: the dabase is created, and after -each requested module is installed, its fast_suite tests are run. The database -is thus created and dropped (and the modules installed) only once. - -.. _unittest2: http://pypi.python.org/pypi/unittest2 From 8624a85a20be8c77c3d7ab118cf2f21e01e7163b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 17 Apr 2012 13:09:40 +0200 Subject: [PATCH 004/963] [DOC] getting_started: improved content bzr revid: tde@openerp.com-20120417110940-b8mq1sqone0wpycp --- doc/01_getting_started.rst | 547 ++++++++++++++++++++++++------------- 1 file changed, 355 insertions(+), 192 deletions(-) diff --git a/doc/01_getting_started.rst b/doc/01_getting_started.rst index e7bd882305a..d126c4ccb82 100644 --- a/doc/01_getting_started.rst +++ b/doc/01_getting_started.rst @@ -1,14 +1,14 @@ -========================================= +======================================== Getting started with OpenERP development -========================================= +======================================== .. toctree:: - :maxdepth: 1 + :maxdepth: 1 Installation from sources -++++++++++++++++++++++++++ +========================== -.._getting_started_installation_source-link: +.. _getting_started_installation_source-link: Source code is hosted on Launchpad_. In order to get the sources, you will need Bazaar_ to pull the source from Launchpad. Bazaar is a version control system that helps you track project history over time and collaborate efficiently. You may have to create an account on Launchpad to be able to collaborate on OpenERP development. Please refer to the Launchpad and Bazaar documentation to install and setup your development environment. @@ -45,8 +45,14 @@ This will create the following structure inside your ``source`` directory, and f Some dependencies are necessary to use OpenERP. Depending on your environment, you might have to install the following packages:: - sudo apt-get install graphviz ghostscript postgresql - python-imaging python-matplotlib + sudo apt-get install graphviz ghostscript postgresql-client + + sudo apt-get install python-dateutil python-feedparser python-gdata + python-ldap python-libxslt1 python-lxml python-mako, python-openid + python-psycopg2 python-pybabel python-pychart python-pydot + python-pyparsing python-reportlab python-simplejson python-tz + python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt + python-yaml python-zsi python-imaging python-matplotlib Next step is to initialize the database. This will create a new openerp role:: @@ -61,189 +67,46 @@ Testing your installation can be done on http://localhost:8069/ . You should see .. _Launchpad: https://launchpad.net/ .. _Bazaar: http://bazaar.canonical.com/en/ -Configuration -============= - -.. _getrting_started_configuration-link: - -Two configuration files are available: - - * one for the client: ~/.openerprc - * one for the server: ~/.openerp_serverrc - -Those files follow the convention used by python's ConfigParser module. - -Lines beginning with "#" or ";" are comments. - -The client configuration file is automatically generated upon the first start. The one of the server can automatically be created using the command: :: - - openerp-server.py -s - -If they are not found, the server and the client will start with the default configuration. - - -**Server Configuration File** - -The server configuration file .openerp_serverrc is used to save server startup options. Here is the list of the available options: - -:interface: - Address to which the server will be bound - -:port: - Port the server will listen on - -:database: - Name of the database to use - -:user: - Username used when connecting to the database - -:translate_in: - File used to translate OpenERP to your language - -:translate_out: - File used to export the language OpenERP use - -:language: - Use this language as the language of the server. This must be specified as an ISO country code, as specified by the W3C. - -:verbose: - Enable debug output - -:init: - init a module (use "all" for all modules) - -:update: - update a module (use "all" for all modules) - -:upgrade: - Upgrade/install/uninstall modules - -:db_name: - specify the database name - -:db_user: - specify the database user name - -:db_password: - specify the database password - -:pg_path: - specify the pg executable path - -:db_host: - specify the database host - -:db_port: - specify the database port - -:translate_modules: - Specify modules to export. Use in combination with --i18n-export - - -You can create your own configuration file by specifying -s or --save on the server command line. If you would like to write an alternative configuration file, use -c or --config= -Here is a basic configuration for a server:: - - [options] - verbose = False - xmlrpc = True - database = terp - update = {} - port = 8069 - init = {} - interface = 127.0.0.1 - reportgz = False - -Full Example for Server V5.0 :: - - [printer] - path = none - softpath_html = none - preview = True - softpath = none - - [logging] - output = stdout - logger = - verbose = True - level = error - - [help] - index = http://www.openerp.com/documentation/user-manual/ - context = http://www.openerp.com/scripts/context_index.php - - [form] - autosave = False - toolbar = True - - [support] - recipient = support@openerp.com - support_id = - - [tip] - position = 0 - autostart = False - - [client] - lang = en_US - default_path = /home/user - filetype = {} - theme = none - toolbar = icons - form_tab_orientation = 0 - form_tab = top - - [survey] - position = 3 - - [path] - pixmaps = /usr/share/pixmaps/openerp-client/ - share = /usr/share/openerp-client/ - - [login] - db = eo2 - login = admin - protocol = http:// - port = 8069 - server = localhost - - Command line options ==================== -General Options ---------------- +Using the command :: - --version show program version number and exit - -h, --help show this help message and exit - -c CONFIG, --config=CONFIG - specify alternate config file - -s, --save save configuration to ~/.terp_serverrc - -v, --verbose enable debugging - --pidfile=PIDFILE file where the server pid will be stored - --logfile=LOGFILE file where the server log will be stored - -n INTERFACE, --interface=INTERFACE - specify the TCP IP address - -p PORT, --port=PORT specify the TCP port - --net_interface=NETINTERFACE - specify the TCP IP address for netrpc - --net_port=NETPORT specify the TCP port for netrpc - --no-netrpc disable netrpc - --no-xmlrpc disable xmlrpc - -i INIT, --init=INIT init a module (use "all" for all modules) - --without-demo=WITHOUT_DEMO - load demo data for a module (use "all" for all - modules) - -u UPDATE, --update=UPDATE - update a module (use "all" for all modules) - --stop-after-init stop the server after it initializes - --debug enable debug mode - -S, --secure launch server over https instead of http - --smtp=SMTP_SERVER specify the SMTP server for sending mail - -Database related options: -------------------------- + ./openerp-server --help + +gives you the available command line options. For OpenERP server at revision 4133, an output example is given in the `Command line options example`_. Here are a few interesting command line options. + +General Options ++++++++++++++++ + +:: + + --version show program version number and exit + -h, --help show this help message and exit + -c CONFIG, --config=CONFIG specify alternate config file + -s, --save save configuration to ~/.terp_serverrc + -v, --verbose enable debugging + --pidfile=PIDFILE file where the server pid will be stored + --logfile=LOGFILE file where the server log will be stored + -n INTERFACE, --interface=INTERFACE specify the TCP IP address + -p PORT, --port=PORT specify the TCP port + --net_interface=NETINTERFACE specify the TCP IP address for netrpc + --net_port=NETPORT specify the TCP port for netrpc + --no-netrpc disable netrpc + --no-xmlrpc disable xmlrpc + -i INIT, --init=INIT init a module (use "all" for all modules) + --without-demo=WITHOUT_DEMO load demo data for a module (use "all" for all modules) + -u UPDATE, --update=UPDATE update a module (use "all" for all modules) + --stop-after-init stop the server after it initializes + --debug enable debug mode + -S, --secure launch server over https instead of http + --smtp=SMTP_SERVER specify the SMTP server for sending mail +Database related options +++++++++++++++++++++++++ + +:: + -d DB_NAME, --database=DB_NAME specify the database name -r DB_USER, --db_user=DB_USER @@ -254,11 +117,10 @@ Database related options: --db_host=DB_HOST specify the database host --db_port=DB_PORT specify the database port -Internationalization options: ------------------------------ +Internationalization options +++++++++++++++++++++++++++++ - Use these options to translate OpenERP to another language.See i18n - section of the user manual. Option '-l' is mandatory. +Use these options to translate OpenERP to another language.See i18n section of the user manual. Option '-l' is mandatory.:: -l LANGUAGE, --language=LANGUAGE specify the language of the translation file. Use it @@ -272,8 +134,309 @@ Internationalization options: specify modules to export. Use in combination with --i18n-export -Options from previous versions: -------------------------------- -Some options were removed in version 6. For example, ``price_accuracy`` is now +Options from previous versions +++++++++++++++++++++++++++++++ + +Some options were removed in OpenERP version 6. For example, ``price_accuracy`` is now configured through the :ref:`decimal_accuracy` screen. +Configuration +============== + +.. _getting_started_configuration-link: + +Two configuration files are available: + + * one for the client: ``~/.openerprc`` + * one for the server: ``~/.openerp_serverrc`` + +If they are not found, the server and the client will start with a default configuration. Those files follow the convention used by python's ConfigParser module. Please note that lines beginning with "#" or ";" are comments. The client configuration file is automatically generated upon the first start. The sezrver configuration file can automatically be created using the command :: + + ./openerp-server -s or ./openerp-server --save + +You can specify alternate configuration files with :: + + -c CONFIG, --config=CONFIG specify alternate config file + +An example of server configuration file for + +Appendix +======== + +Command line options example +++++++++++++++++++++++++++++ + +Usage: openerp-server [options] + +**Options**:: + + --version show program's version number and exit + -h, --help show this help message and exit + +**Common options**:: + + -c CONFIG, --config=CONFIG + specify alternate config file + -s, --save save configuration to ~/.openerp_serverrc + -i INIT, --init=INIT + install one or more modules (comma-separated list, use + "all" for all modules), requires -d + -u UPDATE, --update=UPDATE + update one or more modules (comma-separated list, use + "all" for all modules). Requires -d. + --without-demo=WITHOUT_DEMO + disable loading demo data for modules to be installed + (comma-separated, use "all" for all modules). Requires + -d and -i. Default is none + -P IMPORT_PARTIAL, --import-partial=IMPORT_PARTIAL + Use this for big data importation, if it crashes you + will be able to continue at the current state. Provide + a filename to store intermediate importation states. + --pidfile=PIDFILE file where the server pid will be stored + --addons-path=ADDONS_PATH + specify additional addons paths (separated by commas). + --load=SERVER_WIDE_MODULES + Comma-separated list of server-wide modules + default=web + +**XML-RPC Configuration**:: + + --xmlrpc-interface=XMLRPC_INTERFACE + Specify the TCP IP address for the XML-RPC protocol. + The empty string binds to all interfaces. + --xmlrpc-port=XMLRPC_PORT + specify the TCP port for the XML-RPC protocol + --no-xmlrpc disable the XML-RPC protocol + --proxy-mode Enable correct behavior when behind a reverse proxy + +**XML-RPC Secure Configuration**:: + + --xmlrpcs-interface=XMLRPCS_INTERFACE + Specify the TCP IP address for the XML-RPC Secure + protocol. The empty string binds to all interfaces. + --xmlrpcs-port=XMLRPCS_PORT + specify the TCP port for the XML-RPC Secure protocol + --no-xmlrpcs disable the XML-RPC Secure protocol + --cert-file=SECURE_CERT_FILE + specify the certificate file for the SSL connection + --pkey-file=SECURE_PKEY_FILE + specify the private key file for the SSL connection + +**NET-RPC Configuration**:: + + --netrpc-interface=NETRPC_INTERFACE + specify the TCP IP address for the NETRPC protocol + --netrpc-port=NETRPC_PORT + specify the TCP port for the NETRPC protocol + --no-netrpc disable the NETRPC protocol + +**Web interface Configuration**:: + + --db-filter=REGEXP Filter listed database + +**Static HTTP service**:: + + --static-http-enable + enable static HTTP service for serving plain HTML + files + --static-http-document-root=STATIC_HTTP_DOCUMENT_ROOT + specify the directory containing your static HTML + files (e.g '/var/www/') + --static-http-url-prefix=STATIC_HTTP_URL_PREFIX + specify the URL root prefix where you want web + browsers to access your static HTML files (e.g '/') + +**Testing Configuration**:: + + --test-file=TEST_FILE + Launch a YML test file. + --test-report-directory=TEST_REPORT_DIRECTORY + If set, will save sample of all reports in this + directory. + --test-enable Enable YAML and unit tests. + --test-commit Commit database changes performed by YAML or XML + tests. + +**Logging Configuration**:: + + --logfile=LOGFILE file where the server log will be stored + --no-logrotate do not rotate the logfile + --syslog Send the log to the syslog server + --log-handler=PREFIX:LEVEL + setup a handler at LEVEL for a given PREFIX. An empty + PREFIX indicates the root logger. This option can be + repeated. Example: "openerp.orm:DEBUG" or + "werkzeug:CRITICAL" (default: ":INFO") + --log-request shortcut for --log- + handler=openerp.netsvc.rpc.request:DEBUG + --log-response shortcut for --log- + handler=openerp.netsvc.rpc.response:DEBUG + --log-web shortcut for --log- + handler=openerp.addons.web.common.http:DEBUG + --log-sql shortcut for --log-handler=openerp.sql_db:DEBUG + --log-level=LOG_LEVEL + specify the level of the logging. Accepted values: + ['info', 'debug_rpc', 'warn', 'test', 'critical', + 'debug_sql', 'error', 'debug', 'debug_rpc_answer', + 'notset'] (deprecated option). + +**SMTP Configuration**:: + + --email-from=EMAIL_FROM + specify the SMTP email address for sending email + --smtp=SMTP_SERVER specify the SMTP server for sending email + --smtp-port=SMTP_PORT + specify the SMTP port + --smtp-ssl specify the SMTP server support SSL or not + --smtp-user=SMTP_USER + specify the SMTP username for sending email + --smtp-password=SMTP_PASSWORD + specify the SMTP password for sending email + +**Database related options**:: + + -d DB_NAME, --database=DB_NAME + specify the database name + -r DB_USER, --db_user=DB_USER + specify the database user name + -w DB_PASSWORD, --db_password=DB_PASSWORD + specify the database password + --pg_path=PG_PATH specify the pg executable path + --db_host=DB_HOST specify the database host + --db_port=DB_PORT specify the database port + --db_maxconn=DB_MAXCONN + specify the the maximum number of physical connections + to posgresql + --db-template=DB_TEMPLATE + specify a custom database template to create a new + database + +**Internationalisation options**:: + + Use these options to translate OpenERP to another language.See i18n + section of the user manual. Option '-d' is mandatory.Option '-l' is + mandatory in case of importation + + --load-language=LOAD_LANGUAGE + specifies the languages for the translations you want + to be loaded + -l LANGUAGE, --language=LANGUAGE + specify the language of the translation file. Use it + with --i18n-export or --i18n-import + --i18n-export=TRANSLATE_OUT + export all sentences to be translated to a CSV file, a + PO file or a TGZ archive and exit + --i18n-import=TRANSLATE_IN + import a CSV or a PO file with translations and exit. + The '-l' option is required. + --i18n-overwrite overwrites existing translation terms on updating a + module or importing a CSV or a PO file. + --modules=TRANSLATE_MODULES + specify modules to export. Use in combination with + --i18n-export + +**Security-related options**:: + + --no-database-list disable the ability to return the list of databases + +**Advanced options**:: + + --cache-timeout=CACHE_TIMEOUT + set the timeout for the cache system + --debug enable debug mode + --stop-after-init stop the server after its initialization + -t TIMEZONE, --timezone=TIMEZONE + specify reference timezone for the server (e.g. + Europe/Brussels + --osv-memory-count-limit=OSV_MEMORY_COUNT_LIMIT + Force a limit on the maximum number of records kept in + the virtual osv_memory tables. The default is False, + which means no count-based limit. + --osv-memory-age-limit=OSV_MEMORY_AGE_LIMIT + Force a limit on the maximum age of records kept in + the virtual osv_memory tables. This is a decimal value + expressed in hours, and the default is 1 hour. + --max-cron-threads=MAX_CRON_THREADS + Maximum number of threads processing concurrently cron + jobs. + --virtual-memory-limit=VIRTUAL_MEMORY_LIMIT + Maximum allowed virtual memory per Gunicorn process. + When the limit is reached, any memory allocation will + fail. + --virtual-memory-reset=VIRTUAL_MEMORY_RESET + Maximum allowed virtual memory per Gunicorn process. + When the limit is reached, the worker will be reset + after the current request. + --cpu-time-limit=CPU_TIME_LIMIT + Maximum allowed CPU time per Gunicorn process. When + the limit is reached, an exception is raised. + --unaccent Use the unaccent function provided by the database + when available. + +Server configuration file ++++++++++++++++++++++++++ + +:: + + [options] + addons_path = /home/openerp/workspace/openerp-dev/addons/trunk,/home/openerp/workspace/openerp-dev/web/trunk/addons + admin_passwd = admin + cache_timeout = 100000 + cpu_time_limit = 60 + csv_internal_sep = , + db_host = False + db_maxconn = 64 + db_name = False + db_password = False + db_port = False + db_template = template0 + db_user = openerp + dbfilter = .* + debug_mode = False + demo = {} + email_from = False + import_partial = + list_db = True + log_handler = [':INFO'] + log_level = info + logfile = False + login_message = False + logrotate = True + max_cron_threads = 4 + netrpc = True + netrpc_interface = + netrpc_port = 8070 + osv_memory_age_limit = 1.0 + osv_memory_count_limit = False + pg_path = None + pidfile = False + proxy_mode = False + reportgz = False + secure_cert_file = server.cert + secure_pkey_file = server.pkey + server_wide_modules = None + smtp_password = False + smtp_port = 25 + smtp_server = localhost + smtp_ssl = False + smtp_user = False + static_http_document_root = None + static_http_enable = False + static_http_url_prefix = None + syslog = False + test_commit = False + test_enable = False + test_file = False + test_report_directory = False + timezone = False + translate_modules = ['all'] + unaccent = False + virtual_memory_limit = 805306368 + virtual_memory_reset = 671088640 + without_demo = False + xmlrpc = True + xmlrpc_interface = + xmlrpc_port = 8069 + xmlrpcs = True + xmlrpcs_interface = + xmlrpcs_port = 8071 From 6d16d56970f1f01a5e360916e792c640bd127655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 17 Apr 2012 13:10:16 +0200 Subject: [PATCH 005/963] [DOC] [ADD] Added architecture chapter. bzr revid: tde@openerp.com-20120417111016-nnjncznndlcchyrg --- doc/02_architecture.rst | 569 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 569 insertions(+) create mode 100644 doc/02_architecture.rst diff --git a/doc/02_architecture.rst b/doc/02_architecture.rst new file mode 100644 index 00000000000..867d5be7c15 --- /dev/null +++ b/doc/02_architecture.rst @@ -0,0 +1,569 @@ +======================================== +Architecture +======================================== + +MVC architecture +================ + +According to `Wikipedia `_, "a Model-view-controller (MVC) is an architectural pattern used in software engineering". In complex computer applications presenting lots of data to the user, one often wishes to separate data (model) and user interface (view) concerns. Changes to the user interface does therefore not impact data management, and data can be reorganized without changing the user interface. The model-view-controller solves this problem by decoupling data access and business logic from data presentation and user interaction, by introducing an intermediate component: the controller. + +.. figure:: images/MVCDiagram.png + :scale: 100 + :align: center + + MVC Diagram + +For example in the diagram above, the solid lines for the arrows starting from the controller and going to both the view and the model mean that the controller has a complete access to both the view and the model. The dashed line for the arrow going from the view to the controller means that the view has a limited access to the controller. The reasons of this design are : + + * From **View** to **Model** : the model sends notification to the view when its data has been modified in order the view to redraw its content. The model doesn't need to know the inner workings of the view to perform this operation. However, the view needs to access the internal parts of the model. + * From **View** to **Controller** : the reason why the view has limited access to the controller is because the dependencies from the view to the controller need to be minimal: the controller can be replaced at any moment. + +MVC Model in OpenERP +-------------------- + +In OpenERP, we can apply this model-view-controller semantic with + + * model : The PostgreSQL tables. + * view : views are defined in XML files in OpenERP. + * controller : The objects of OpenERP. + + +MVCSQL +------ + +Example 1 ++++++++++ + +Suppose sale is a variable on a record of the sale.order object related to the 'sale_order' table. You can acquire such a variable doing this.:: + + sale = self.browse(cr, uid, ID) + +(where cr is the current row, from the database cursor, uid is the current user's ID for security checks, and ID is the sale order's ID or list of IDs if we want more than one) + +Suppose you want to get: the country name of the first contact of a partner related to the ID sale order. You can do the following in OpenERP:: + + country_name = sale.partner_id.address[0].country_id.name + +If you want to write the same thing in traditional SQL development, it will be in python: (we suppose cr is the cursor on the database, with psycopg) + +.. code-block:: python + + cr.execute('select partner_id from sale_order where id=%d', (ID,)) + partner_id = cr.fetchone()[0] + cr.execute('select country_id from res_partner_address where partner_id=%d', (partner_id,)) + country_id = cr.fetchone()[0] + cr.execute('select name from res_country where id=%d', (country_id,)) + del partner_id + del country_id + country_name = cr.fetchone()[0] + +Of course you can do better if you develop smartly in SQL, using joins or subqueries. But you have to be smart and most of the time you will not be able to make such improvements: + + * Maybe some parts are in others functions + * There may be a loop in different elements + * You have to use intermediate variables like country_id + +The first operation as an object call is much better for several reasons: + + * It uses objects facilities and works with modules inheritances, overload, ... + * It's simpler, more explicit and uses less code + * It's much more efficient as you will see in the following examples + * Some fields do not directly correspond to a SQL field (e.g.: function fields in Python) + + +Prefetching ++++++++++++ + +Suppose that later in the code, in another function, you want to access the name of the partner associated to your sale order. You can use this:: + + partner_name = sale.partner_id.name + +And this will not generate any SQL query as it has been prefetched by the object relational mapping engine of OpenERP. + + +Loops and special fields +++++++++++++++++++++++++ + +Suppose now that you want to compute the totals of 10 sales order by countries. You can do this in OpenERP within a OpenERP object: + +.. code-block:: python + + def get_totals(self, cr, uid, ids): + countries = {} + for sale in self.browse(cr, uid, ids): + country = sale.partner_invoice_id.country + countries.setdefault(country, 0.0) + countries[country] += sale.amount_untaxed + return countries + +And, to print them as a good way, you can add this on your object: + +.. code-block:: python + + def print_totals(self, cr, uid, ids): + result = self.get_totals(cr, uid, ids) + for country in result.keys(): + print '[%s] %s: %.2f' (country.code, country.name, result[country]) + +The 2 functions will generate 4 SQL queries in total ! This is due to the SQL engine of OpenERP that does prefetching, works on lists and uses caching methods. The 3 queries are: + + 1. Reading the sale.order to get ID's of the partner's address + 2. Reading the partner's address for the countries + 3. Calling the amount_untaxed function that will compute a total of the sale order lines + 4. Reading the countries info (code and name) + +That's great because if you run this code on 1000 sales orders, you have the guarantee to only have 4 SQL queries. + +Notes: + + * IDS is the list of the 10 ID's: [12,15,18,34, ...,99] + * The arguments of a function are always the same: + + - cr: the cursor database (from psycopg) + - uid: the user id (for security checks) + * If you run this code on 5000 sales orders, you may have 8 SQL queries because as SQL queries are not allowed to take too much memory, it may have to do two separate readings. + + +Complex example ++++++++++++++++ + +Here is a complete example, from the OpenERP official distribution, of the function that does bill of material explosion and computation of associated routings: + +.. code-block:: python + + class mrp_bom(osv.osv): + ... + def _bom_find(self, cr, uid, product_id, product_uom, properties=[]): + bom_result = False + # Why searching on BoM without parent ? + cr.execute('select id from mrp_bom where product_id=%d and bom_id is null + order by sequence', (product_id,)) + ids = map(lambda x: x[0], cr.fetchall()) + max_prop = 0 + result = False + for bom in self.pool.get('mrp.bom').browse(cr, uid, ids): + prop = 0 + for prop_id in bom.property_ids: + if prop_id.id in properties: + prop+=1 + if (prop>max_prop) or ((max_prop==0) and not result): + result = bom.id + max_prop = prop + return result + + def _bom_explode(self, cr, uid, bom, factor, properties, addthis=False, level=10): + factor = factor / (bom.product_efficiency or 1.0) + factor = rounding(factor, bom.product_rounding) + if factor`_, +`three-tier architecture +`_. +The application tier itself is written as a core, multiple additional +modules can be installed to create a particular configuration of +OpenERP. + +The core of OpenERP and its modules are written in `Python +`_. The functionality of a module is exposed through +XML-RPC (and/or NET-RPC depending on the server's configuration)[#]. Modules +typically make use of OpenERP's ORM to persist their data in a relational +database (PostgreSQL). Modules can insert data in the database during +installation by providing XML, CSV, or YML files. + +.. figure:: images/client_server.png + :scale: 85 + :align: center + +.. [#] JSON-RPC is planned for OpenERP v6.1. + +The OpenERP server +------------------ + +OpenERP provides an application server on which specific business applications +can be built. It is also a complete development framework, offering a range of +features to write those applications. The salient features are a flexible ORM, +a MVC architecture, extensible data models and views, different report engines, +all tied together in a coherent, network-accessible framework. + +From a developer perspective, the server acts both as a library which brings +the above benefits while hiding the low-level, nitty-gritty details, and as a +simple way to install, configure and run the written applications. + +Modules +------- + +By itself, the OpenERP server is not very useful. For any enterprise, the value +of OpenERP lies in its different modules. It is the role of the modules to +implement any business needs. The server is only the necessary machinery to run +the modules. A lot of modules already exist. Any official OpenERP release +includes about 170 of them, and hundreds of modules are available through the +community. Examples of modules are Account, CRM, HR, Marketing, MRP, Sale, etc. + +A module is usually composed of data models, together with some initial data, +views definitions (i.e. how data from specific data models should be displayed +to the user), wizards (specialized screens to help the user for specific +interactions), workflows definitions, and reports. + +Clients +------- + +Clients can communicate with an OpenERP server using XML-RPC. A custom, faster +protocol called NET-RPC is also provided but will shortly disappear, replaced +by JSON-RPC. XML-RPC, as JSON-RPC in the future, makes it possible to write +clients for OpenERP in a variety of programming languages. OpenERP S.A. +develops two different clients: a desktop client, written with the widely used +`GTK+ `_ graphical toolkit, and a web client that should +run in any modern web browser. + +As the logic of OpenERP should entirely reside on the server, the client is +conceptually very simple; it issues a request to the server and display the result +(e.g. a list of customers) in different manners (as forms, lists, calendars, +...). Upon user actions, it will send modified data to the server. + +Relational database server and ORM +---------------------------------- + +The data tier of OpenERP is provided by a PostgreSQL relational database. While +direct SQL queries can be executed from OpenERP modules, most database access +to the relational database is done through the `Object-Relational Mapping +`_. + +The ORM is one of the salient features mentioned above. The data models are +described in Python and OpenERP creates the underlying database tables. All the +benefits of RDBMS (unique constraints, relational integrity, efficient +querying, ...) are used when possible and completed by Python flexibility. For +instance, arbitrary constraints written in Python can be added to any model. +Different modular extensibility mechanisms are also afforded by OpenERP[#]. + +.. [#] It is important to understand the ORM responsibility before attempting to by-pass it and access directly the underlying database via raw SQL queries. When using the ORM, OpenERP can make sure the data remains free of any corruption. For instance, a module can react to data creation in a particular table. This reaction can only happen if the ORM is used to create that data. + +Models +------ + +To define data models and otherwise pursue any work with the associated data, +OpenERP as many ORMs uses the concept of 'model'. A model is the authoritative +specification of how some data are structured, constrained, and manipulated. In +practice, a model is written as a Python class. The class encapsulates anything +there is to know about the model: the different fields composing the model, +default values to be used when creating new records, constraints, and so on. It +also holds the dynamic aspect of the data it controls: methods on the class can +be written to implement any business needs (for instance, what to do upon user +action, or upon workflow transitions). + +There are two different models. One is simply called 'model', and the second is +called 'transient model'. The two models provide the same capabilities with a +single difference: transient models are automatically cleared from the +database (they can be cleaned when some limit on the number of records is +reached, or when they are untouched for some time). + +To describe the data model per se, OpenERP offers a range of different kind of +fields. There are basic fields such as integer, or text fields. There are +relational fields to implement one-to-many, many-to-one, and many-to-many +relationships. There are so-called function fields, which are dynamically +computed and are not necessarily available in database, and more. + +Access to data is controlled by OpenERP and configured by different mechanisms. +This ensures that different users can have read and/or write access to only the +relevant data. Access can be controlled with respect to user groups and rules +based on the value of the data themselves. + +Modules +------- + +OpenERP supports a modular approach both from a development perspective and a +deployment point of view. In essence, a module groups everything related to a +single concern in one meaningful entity. It is comprised of models, views, +workflows, and wizards. + +Services and WSGI +----------------- + +Everything in OpenERP, and models methods in particular, are exposed via the +network and a security layer. Access to the data model is in fact a 'service' +and it is possible to expose new services. For instance, a WebDAV service and a +FTP service are available. + +While not mandatory, the services can make use of the `WSGI +`_ stack. +WSGI is a standard solution in the Python ecosystem to write HTTP servers, +applications, and middleware which can be used in a mix-and-match fashion. +By using WSGI, it is possible to run OpenERP in any WSGI-compliant server, but +also to use OpenERP to host a WSGI application. + +A striking example of this possibility is the OpenERP Web project. OpenERP Web +is the server-side counter part to the web clients. It is OpenERP Web which +provides the web pages to the browser and manages web sessions. OpenERP Web is +a WSGI-compliant application. As such, it can be run as a stand-alone HTTP +server or embedded inside OpenERP. + +XML-RPC, JSON-RPC +----------------- + +The access to the models makes also use of the WSGI stack. This can be done +using the XML-RPC protocol, and JSON-RPC will be added soon. + + +Explanation of modules: + +**Server - Base distribution** + +We use a distributed communication mechanism inside the OpenERP server. Our engine supports most commonly distributed patterns: request/reply, publish/subscribe, monitoring, triggers/callback, ... + +Different business objects can be in different computers or the same objects can be on multiple computers to perform load-balancing. + +**Server - Object Relational Mapping (ORM)** + +This layer provides additional object functionality on top of PostgreSQL: + + * Consistency: powerful validity checks, + * Work with objects (methods, references, ...) + * Row-level security (per user/group/role) + * Complex actions on a group of resources + * Inheritance + +**Server - Web-Services** + +The web-service module offer a common interface for all web-services + + * SOAP + * XML-RPC + * NET-RPC + +Business objects can also be accessed via the distributed object mechanism. They can all be modified via the client interface with contextual views. + +**Server - Workflow Engine** + +Workflows are graphs represented by business objects that describe the dynamics of the company. Workflows are also used to track processes that evolve over time. + +An example of workflow used in OpenERP: + +A sales order generates an invoice and a shipping order + +**Server - Report Engine** + +Reports in OpenERP can be rendered in different ways: + + * Custom reports: those reports can be directly created via the client interface, no programming required. Those reports are represented by business objects (ir.report.custom) + * High quality personalized reports using openreport: no programming required but you have to write 2 small XML files: + + - a template which indicates the data you plan to report + - an XSL:RML stylesheet + * Hard coded reports + * OpenOffice Writer templates + +Nearly all reports are produced in PDF. + +**Server - Business Objects** + +Almost everything is a business object in OpenERP, they describe all data of the program (workflows, invoices, users, customized reports, ...). Business objects are described using the ORM module. They are persistent and can have multiple views (described by the user or automatically calculated). + +Business objects are structured in the /module directory. + +**Client - Wizards** + +Wizards are graphs of actions/windows that the user can perform during a session. + +**Client - Widgets** + +Widgets are probably, although the origin of the term seems to be very difficult to trace, "WIndow gaDGETS" in the IT world, which mean they are gadgets before anything, which implement elementary features through a portable visual tool. + +All common widgets are supported: + + * entries + * textboxes + * floating point numbers + * dates (with calendar) + * checkboxes + * ... + +And also all special widgets: + + * buttons that call actions + * references widgets + + - one2one + + - many2one + + - many2many + + - one2many in list + + - ... + +Widget have different appearances in different views. For example, the date widget in the search dialog represents two normal dates for a range of date (from...to...). + +Some widgets may have different representations depending on the context. For example, the one2many widget can be represented as a form with multiple pages or a multi-columns list. + +Events on the widgets module are processed with a callback mechanism. A callback mechanism is a process whereby an element defines the type of events he can handle and which methods should be called when this event is triggered. Once the event is triggered, the system knows that the event is bound to a specific method, and calls that method back. Hence callback. + + +Module Integrations +=================== + +The are many different modules available for OpenERP and suited for different business models. Nearly all of these are optional (except ModulesAdminBase), making it easy to customize OpenERP to serve specific business needs. All the modules are in a directory named addons/ on the server. You simply need to copy or delete a module directory in order to either install or delete the module on the OpenERP platform. + +Some modules depend on other modules. See the file addons/module/__openerp__.py for more information on the dependencies. + +Here is an example of __openerp__.py: + +.. code-block:: python + + { + "name" : "Open TERP Accounting", + "version" : "1.0", + "author" : "Bob Gates - Not So Tiny", + "website" : "http://www.openerp.com/", + "category" : "Generic Modules/Others", + "depends" : ["base"], + "description" : """A + Multiline + Description + """, + "init_xml" : ["account_workflow.xml", "account_data.xml", "account_demo.xml"], + "demo_xml" : ["account_demo.xml"], + "update_xml" : ["account_view.xml", "account_report.xml", "account_wizard.xml"], + "active": False, + "installable": True + } + +When initializing a module, the files in the init_xml list are evaluated in turn and then the files in the update_xml list are evaluated. When updating a module, only the files from the **update_xml** list are evaluated. + + +Inheritance +=========== + +Traditional Inheritance +----------------------- + +Introduction +++++++++++++ + +Objects may be inherited in some custom or specific modules. It is better to inherit an object to add/modify some fields. + +It is done with:: + + _inherit='object.name' + +Extension of an object +++++++++++++++++++++++ + +There are two possible ways to do this kind of inheritance. Both ways result in a new class of data, which holds parent fields and behaviour as well as additional fields and behaviour, but they differ in heavy programatical consequences. + +While Example 1 creates a new subclass "custom_material" that may be "seen" or "used" by any view or tree which handles "network.material", this will not be the case for Example 2. + +This is due to the table (other.material) the new subclass is operating on, which will never be recognized by previous "network.material" views or trees. + +Example 1:: + + class custom_material(osv.osv): + _name = 'network.material' + _inherit = 'network.material' + _columns = { + 'manuf_warranty': fields.boolean('Manufacturer warranty?'), + } + _defaults = { + 'manuf_warranty': lambda *a: False, + } + custom_material() + +.. tip:: Notice + + _name == _inherit + +In this example, the 'custom_material' will add a new field 'manuf_warranty' to the object 'network.material'. New instances of this class will be visible by views or trees operating on the superclasses table 'network.material'. + +This inheritancy is usually called "class inheritance" in Object oriented design. The child inherits data (fields) and behavior (functions) of his parent. + + +Example 2:: + + class other_material(osv.osv): + _name = 'other.material' + _inherit = 'network.material' + _columns = { + 'manuf_warranty': fields.boolean('Manufacturer warranty?'), + } + _defaults = { + 'manuf_warranty': lambda *a: False, + } + other_material() + +.. tip:: Notice + + _name != _inherit + +In this example, the 'other_material' will hold all fields specified by 'network.material' and it will additionally hold a new field 'manuf_warranty'. All those fields will be part of the table 'other.material'. New instances of this class will therefore never been seen by views or trees operating on the superclasses table 'network.material'. + +This type of inheritancy is known as "inheritance by prototyping" (e.g. Javascript), because the newly created subclass "copies" all fields from the specified superclass (prototype). The child inherits data (fields) and behavior (functions) of his parent. + +Inheritance by Delegation +------------------------- + + **Syntax :**:: + + class tiny_object(osv.osv) + _name = 'tiny.object' + _table = 'tiny_object' + _inherits = { 'tiny.object_a' : 'name_col_a', 'tiny.object_b' : 'name_col_b', + ..., 'tiny.object_n' : 'name_col_n' } + (...) + + +The object 'tiny.object' inherits from all the columns and all the methods from the n objects 'tiny.object_a', ..., 'tiny.object_n'. + +To inherit from multiple tables, the technique consists in adding one column to the table tiny_object per inherited object. This column will store a foreign key (an id from another table). The values *'name_col_a' 'name_col_b' ... 'name_col_n'* are of type string and determine the title of the columns in which the foreign keys from 'tiny.object_a', ..., 'tiny.object_n' are stored. + +This inheritance mechanism is usually called " *instance inheritance* " or " *value inheritance* ". A resource (instance) has the VALUES of its parents. From 597a2877235c88750b5441d4e5325b4561977f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 17 Apr 2012 14:52:42 +0200 Subject: [PATCH 006/963] [DOC] [REF] Refactored architecture chapter. bzr revid: tde@openerp.com-20120417125242-5xy4tugaa9fd7e4q --- doc/02_architecture.rst | 727 +++++++++++----------------------------- doc/index.rst.inc | 3 +- 2 files changed, 196 insertions(+), 534 deletions(-) diff --git a/doc/02_architecture.rst b/doc/02_architecture.rst index 867d5be7c15..bf1b3192e37 100644 --- a/doc/02_architecture.rst +++ b/doc/02_architecture.rst @@ -2,568 +2,229 @@ Architecture ======================================== -MVC architecture -================ +OpenERP as a multitenant three-tiers architecture +================================================= -According to `Wikipedia `_, "a Model-view-controller (MVC) is an architectural pattern used in software engineering". In complex computer applications presenting lots of data to the user, one often wishes to separate data (model) and user interface (view) concerns. Changes to the user interface does therefore not impact data management, and data can be reorganized without changing the user interface. The model-view-controller solves this problem by decoupling data access and business logic from data presentation and user interaction, by introducing an intermediate component: the controller. +This section presents the OpenERP architecture along with technology details +of the application. The tiers composing OpenERP are presented. Communication +means and protocols between the application components are also presented. +Some details about used development languages and technology stack are then summarized. -.. figure:: images/MVCDiagram.png - :scale: 100 +OpenERP is a `multitenant `_, `three-tiers architecture +`_: +database tier for data storage, application tier for processing and functionalities +and presentation tier providing user interface. Those are separate layers +inside OpenERP. The application tier itself is written as a core; multiple +additional modules can be installed in order to create a particular instance +of OpenERP adapted to specific needs and requirements. Moreover, OpenERP +follows the Model-View-Controller (MVC) architectural pattern. + +A typical deployment of OpenERP is shown on `Figure 1`_. This deployment is +called Web embedded deployment. As shown, an OpenERP system consists of +three main components: + +- a PostgreSQL database server which contains all OpenERP databases. + Databases contain all application data, and also most of the OpenERP + system configuration elements. Note that this server can possibly be + deployed using clustered databases. +- the OpenERP Server, which contains all the enterprise logic and ensures + that OpenERP runs optimally. One layer of the server is dedicated to + communicate and interface with the PostgreSQL database, the ORM engine. + Another layer allows communications between the server and a web browser, + the Web layer. Having more than one server is possible, for example in + conjunction with a load balancing mechanism. +- the client, which allow users to access OpenERP. Two clients exist, a + desktop GTK client and a browser-based client + + - the GTK client access directly to the OpenERP Server + - users can also use standard web browsers to access OpenERP. In that + case, an OpenERP application is loaded. It handles communications between + the browser and the Web layer of the server. + +The database server and the OpenERP server can be installed on the same computer, +or distributed onto separate computer servers, for example for performance considerations. + +.. _`Figure 1`: +.. figure:: _static/02_openerp_architecture.png + :width: 50% + :alt: OpenERP 6.1 architecture for embedded web deployment :align: center + + OpenERP 6.1 architecture for embedded web deployment - MVC Diagram +The next subsections give details about the different tiers of the OpenERP +architecture. -For example in the diagram above, the solid lines for the arrows starting from the controller and going to both the view and the model mean that the controller has a complete access to both the view and the model. The dashed line for the arrow going from the view to the controller means that the view has a limited access to the controller. The reasons of this design are : +PostgreSQL database ++++++++++++++++++++ - * From **View** to **Model** : the model sends notification to the view when its data has been modified in order the view to redraw its content. The model doesn't need to know the inner workings of the view to perform this operation. However, the view needs to access the internal parts of the model. - * From **View** to **Controller** : the reason why the view has limited access to the controller is because the dependencies from the view to the controller need to be minimal: the controller can be replaced at any moment. +The data tier of OpenERP is provided by a PostgreSQL relational database. +While direct SQL queries can be executed from OpenERP modules, most accesses +to the relational database are done through the server Object Relational +Mapping layer. -MVC Model in OpenERP --------------------- +Databases contain all application data, and also most of the OpenERP system +configuration elements. Note that this server can possibly be deployed using +clustered databases. -In OpenERP, we can apply this model-view-controller semantic with - - * model : The PostgreSQL tables. - * view : views are defined in XML files in OpenERP. - * controller : The objects of OpenERP. - - -MVCSQL ------- - -Example 1 -+++++++++ - -Suppose sale is a variable on a record of the sale.order object related to the 'sale_order' table. You can acquire such a variable doing this.:: - - sale = self.browse(cr, uid, ID) - -(where cr is the current row, from the database cursor, uid is the current user's ID for security checks, and ID is the sale order's ID or list of IDs if we want more than one) - -Suppose you want to get: the country name of the first contact of a partner related to the ID sale order. You can do the following in OpenERP:: - - country_name = sale.partner_id.address[0].country_id.name - -If you want to write the same thing in traditional SQL development, it will be in python: (we suppose cr is the cursor on the database, with psycopg) - -.. code-block:: python - - cr.execute('select partner_id from sale_order where id=%d', (ID,)) - partner_id = cr.fetchone()[0] - cr.execute('select country_id from res_partner_address where partner_id=%d', (partner_id,)) - country_id = cr.fetchone()[0] - cr.execute('select name from res_country where id=%d', (country_id,)) - del partner_id - del country_id - country_name = cr.fetchone()[0] - -Of course you can do better if you develop smartly in SQL, using joins or subqueries. But you have to be smart and most of the time you will not be able to make such improvements: - - * Maybe some parts are in others functions - * There may be a loop in different elements - * You have to use intermediate variables like country_id - -The first operation as an object call is much better for several reasons: - - * It uses objects facilities and works with modules inheritances, overload, ... - * It's simpler, more explicit and uses less code - * It's much more efficient as you will see in the following examples - * Some fields do not directly correspond to a SQL field (e.g.: function fields in Python) - - -Prefetching -+++++++++++ - -Suppose that later in the code, in another function, you want to access the name of the partner associated to your sale order. You can use this:: - - partner_name = sale.partner_id.name - -And this will not generate any SQL query as it has been prefetched by the object relational mapping engine of OpenERP. - - -Loops and special fields -++++++++++++++++++++++++ - -Suppose now that you want to compute the totals of 10 sales order by countries. You can do this in OpenERP within a OpenERP object: - -.. code-block:: python - - def get_totals(self, cr, uid, ids): - countries = {} - for sale in self.browse(cr, uid, ids): - country = sale.partner_invoice_id.country - countries.setdefault(country, 0.0) - countries[country] += sale.amount_untaxed - return countries - -And, to print them as a good way, you can add this on your object: - -.. code-block:: python - - def print_totals(self, cr, uid, ids): - result = self.get_totals(cr, uid, ids) - for country in result.keys(): - print '[%s] %s: %.2f' (country.code, country.name, result[country]) - -The 2 functions will generate 4 SQL queries in total ! This is due to the SQL engine of OpenERP that does prefetching, works on lists and uses caching methods. The 3 queries are: - - 1. Reading the sale.order to get ID's of the partner's address - 2. Reading the partner's address for the countries - 3. Calling the amount_untaxed function that will compute a total of the sale order lines - 4. Reading the countries info (code and name) - -That's great because if you run this code on 1000 sales orders, you have the guarantee to only have 4 SQL queries. - -Notes: - - * IDS is the list of the 10 ID's: [12,15,18,34, ...,99] - * The arguments of a function are always the same: - - - cr: the cursor database (from psycopg) - - uid: the user id (for security checks) - * If you run this code on 5000 sales orders, you may have 8 SQL queries because as SQL queries are not allowed to take too much memory, it may have to do two separate readings. - - -Complex example -+++++++++++++++ - -Here is a complete example, from the OpenERP official distribution, of the function that does bill of material explosion and computation of associated routings: - -.. code-block:: python - - class mrp_bom(osv.osv): - ... - def _bom_find(self, cr, uid, product_id, product_uom, properties=[]): - bom_result = False - # Why searching on BoM without parent ? - cr.execute('select id from mrp_bom where product_id=%d and bom_id is null - order by sequence', (product_id,)) - ids = map(lambda x: x[0], cr.fetchall()) - max_prop = 0 - result = False - for bom in self.pool.get('mrp.bom').browse(cr, uid, ids): - prop = 0 - for prop_id in bom.property_ids: - if prop_id.id in properties: - prop+=1 - if (prop>max_prop) or ((max_prop==0) and not result): - result = bom.id - max_prop = prop - return result - - def _bom_explode(self, cr, uid, bom, factor, properties, addthis=False, level=10): - factor = factor / (bom.product_efficiency or 1.0) - factor = rounding(factor, bom.product_rounding) - if factor`_, -`three-tier architecture -`_. -The application tier itself is written as a core, multiple additional -modules can be installed to create a particular configuration of -OpenERP. - -The core of OpenERP and its modules are written in `Python -`_. The functionality of a module is exposed through -XML-RPC (and/or NET-RPC depending on the server's configuration)[#]. Modules -typically make use of OpenERP's ORM to persist their data in a relational -database (PostgreSQL). Modules can insert data in the database during -installation by providing XML, CSV, or YML files. - -.. figure:: images/client_server.png - :scale: 85 - :align: center - -.. [#] JSON-RPC is planned for OpenERP v6.1. - -The OpenERP server ------------------- +OpenERP server +++++++++++++++ OpenERP provides an application server on which specific business applications -can be built. It is also a complete development framework, offering a range of -features to write those applications. The salient features are a flexible ORM, -a MVC architecture, extensible data models and views, different report engines, -all tied together in a coherent, network-accessible framework. +can be built. It is also a complete development framework, offering a range +of features to write those applications. Among those features, the OpenERP +ORM provides functionalities and an interface on top of the PostgreSQL server. +The OpenERP server also features a specific layer designed to communicate +with the web browser-based client. This layer connects users using standard +browsers to the server. From a developer perspective, the server acts both as a library which brings -the above benefits while hiding the low-level, nitty-gritty details, and as a -simple way to install, configure and run the written applications. +the above benefits while hiding the low-level details, and as a simple way +to install, configure and run the written applications. The server also contains +other services, such as extensible data models and view, workflow engine or +reports engine. However, those are OpenERP services not specifically related +to security, and are therefore not discussed in details in this document. -Modules -------- +**Server - ORM** -By itself, the OpenERP server is not very useful. For any enterprise, the value -of OpenERP lies in its different modules. It is the role of the modules to -implement any business needs. The server is only the necessary machinery to run -the modules. A lot of modules already exist. Any official OpenERP release -includes about 170 of them, and hundreds of modules are available through the -community. Examples of modules are Account, CRM, HR, Marketing, MRP, Sale, etc. +The Object Relational Mapping ORM layer is one of the salient features of +the OpenERP Server. It provides additional and essential functionalities +on top of PostgreSQL server. Data models are described in Python and OpenERP +creates the underlying database tables using this ORM. All the benefits of +RDBMS such as unique constraints, relational integrity or efficient querying +are used and completed by Python flexibility. For instance, arbitrary constraints +written in Python can be added to any model. Different modular extensibility +mechanisms are also afforded by OpenERP. -A module is usually composed of data models, together with some initial data, -views definitions (i.e. how data from specific data models should be displayed -to the user), wizards (specialized screens to help the user for specific -interactions), workflows definitions, and reports. +It is important to understand the ORM responsibility before attempting to +by-pass it and to access directly the underlying database via raw SQL queries. +When using the ORM, OpenERP can make sure the data remains free of any corruption. +For instance, a module can react to data creation in a particular table. +This behavior can occur only if queries go through the ORM. + +The services granted by the ORM are among other : + + - consistency validation by powerful validity checks, + - providing an interface on objects (methods, references, ...) allowing + to design and implement efficient modules, + - row-level security per user and group; more details about users and user + groups are given in the section Users and User Roles, + - complex actions on a group of resources, + - inheritance service allowing fine modeling of new resources + +**Server - Web** + +The web layer offers an interface to communicate with standard browsers. +In the 6.1 version of OpenERP, the web-client has been rewritten and integrated +into the OpenERP server tier. This layer relies on CherryPy for the routing +layer of communications, especially for session and cookies management. + +**Modules** + +By itself, the OpenERP server is a core. For any enterprise, the value of +OpenERP lies in its different modules. The role of the modules is to implement +any business requirement. The server is the only necessary component to +add modules. Any official OpenERP release includes a lot of modules, and +hundreds of modules are available thanks to the community. Examples of +such modules are Account, CRM, HR, Marketing, MRP, Sale, etc. Clients -------- ++++++++ -Clients can communicate with an OpenERP server using XML-RPC. A custom, faster -protocol called NET-RPC is also provided but will shortly disappear, replaced -by JSON-RPC. XML-RPC, as JSON-RPC in the future, makes it possible to write -clients for OpenERP in a variety of programming languages. OpenERP S.A. -develops two different clients: a desktop client, written with the widely used -`GTK+ `_ graphical toolkit, and a web client that should -run in any modern web browser. +As the application logic is mainly contained server-side, the client is +conceptually simple. It issues a request to the server, gets data back +and display the result (e.g. a list of customers) in different ways +(as forms, lists, calendars, ...). Upon user actions, it sends queries +to modify data to the server. -As the logic of OpenERP should entirely reside on the server, the client is -conceptually very simple; it issues a request to the server and display the result -(e.g. a list of customers) in different manners (as forms, lists, calendars, -...). Upon user actions, it will send modified data to the server. +Two clients can be used for user access to OpenERP, a GTK client and a +browser-based client. The GTK client communicates directly with the server. +Using the GTK client requires the client to be installed on the workstation +of each user. -Relational database server and ORM ----------------------------------- +The browser-based client holds an OpenERP application that handles communications +between the browser and the Web layer of the server. The static code of the web +application is minimal. It consists of a minimal flow of HTML that is in charge +of loading the application code in Javascript. This client-side OpenERP application +sends user requests to the server, and gets data back. Data management is +done dynamically in this client. Using this client is therefore easy for +users, but also for administrators because it does not require any software +installation on the user machine. -The data tier of OpenERP is provided by a PostgreSQL relational database. While -direct SQL queries can be executed from OpenERP modules, most database access -to the relational database is done through the `Object-Relational Mapping -`_. -The ORM is one of the salient features mentioned above. The data models are -described in Python and OpenERP creates the underlying database tables. All the -benefits of RDBMS (unique constraints, relational integrity, efficient -querying, ...) are used when possible and completed by Python flexibility. For -instance, arbitrary constraints written in Python can be added to any model. -Different modular extensibility mechanisms are also afforded by OpenERP[#]. +MVC architecture in OpenERP +=========================== -.. [#] It is important to understand the ORM responsibility before attempting to by-pass it and access directly the underlying database via raw SQL queries. When using the ORM, OpenERP can make sure the data remains free of any corruption. For instance, a module can react to data creation in a particular table. This reaction can only happen if the ORM is used to create that data. +According to `Wikipedia `_, +"a Model-view-controller (MVC) is an architectural pattern used in software +engineering". In complex computer applications presenting lots of data to +the user, one often wishes to separate data (model) and user interface (view) +concerns. Changes to the user interface does therefore not impact data +management, and data can be reorganized without changing the user interface. +The model-view-controller solves this problem by decoupling data access +and business logic from data presentation and user interaction, by +introducing an intermediate component: the controller. -Models ------- +.. _`Figure 3`: +.. figure:: _static/02_mvc_diagram.png + :width: 35% + :alt: Model-View-Controller diagram + :align: center + + Model-View-Controller diagram -To define data models and otherwise pursue any work with the associated data, -OpenERP as many ORMs uses the concept of 'model'. A model is the authoritative -specification of how some data are structured, constrained, and manipulated. In -practice, a model is written as a Python class. The class encapsulates anything -there is to know about the model: the different fields composing the model, -default values to be used when creating new records, constraints, and so on. It -also holds the dynamic aspect of the data it controls: methods on the class can -be written to implement any business needs (for instance, what to do upon user -action, or upon workflow transitions). +For example in the diagram above, the solid lines for the arrows starting +from the controller and going to both the view and the model mean that the +controller has a complete access to both the view and the model. The dashed +line for the arrow going from the view to the controller means that the view +has a limited access to the controller. The reasons of this design are : -There are two different models. One is simply called 'model', and the second is -called 'transient model'. The two models provide the same capabilities with a -single difference: transient models are automatically cleared from the -database (they can be cleaned when some limit on the number of records is -reached, or when they are untouched for some time). + - From **View** to **Model** : the model sends notification to the view + when its data has been modified in order the view to redraw its content. + The model doesn't need to know the inner workings of the view to perform + this operation. However, the view needs to access the internal parts of the model. + - From **View** to **Controller** : the reason why the view has limited + access to the controller is because the dependencies from the view to + the controller need to be minimal: the controller can be replaced at + any moment. -To describe the data model per se, OpenERP offers a range of different kind of -fields. There are basic fields such as integer, or text fields. There are -relational fields to implement one-to-many, many-to-one, and many-to-many -relationships. There are so-called function fields, which are dynamically -computed and are not necessarily available in database, and more. +OpenERP follows the MVC semantic with -Access to data is controlled by OpenERP and configured by different mechanisms. -This ensures that different users can have read and/or write access to only the -relevant data. Access can be controlled with respect to user groups and rules -based on the value of the data themselves. + - model : The PostgreSQL tables. + - view : views are defined in XML files in OpenERP. + - controller : The objects of OpenERP. -Modules -------- -OpenERP supports a modular approach both from a development perspective and a -deployment point of view. In essence, a module groups everything related to a -single concern in one meaningful entity. It is comprised of models, views, -workflows, and wizards. +Network communications +====================== + +GTK clients communicate with the OpenERP server using XML-RPC protocol by +default. However, using a secured version XML-RPCS is possible when configurating +your OpenERP instance. In previous versions of OpenERP, a custom protocol +called NET-RPC was used. It was a binary version of the XML-RPC protocol, +allowing faster communications. However, this protocol will no longer be +used in OpenERP. The use of JSON-RPC is also planned for the 6.1 version +of OpenERP. + +Web-based clients communicate using HTTP protocol. As for XML-RPC, it is +possible to configure OpenERP to use secured HTTPS connections. Services and WSGI ------------------ - -Everything in OpenERP, and models methods in particular, are exposed via the -network and a security layer. Access to the data model is in fact a 'service' -and it is possible to expose new services. For instance, a WebDAV service and a -FTP service are available. - -While not mandatory, the services can make use of the `WSGI -`_ stack. -WSGI is a standard solution in the Python ecosystem to write HTTP servers, -applications, and middleware which can be used in a mix-and-match fashion. -By using WSGI, it is possible to run OpenERP in any WSGI-compliant server, but -also to use OpenERP to host a WSGI application. - -A striking example of this possibility is the OpenERP Web project. OpenERP Web -is the server-side counter part to the web clients. It is OpenERP Web which -provides the web pages to the browser and manages web sessions. OpenERP Web is -a WSGI-compliant application. As such, it can be run as a stand-alone HTTP -server or embedded inside OpenERP. - -XML-RPC, JSON-RPC ------------------ - -The access to the models makes also use of the WSGI stack. This can be done -using the XML-RPC protocol, and JSON-RPC will be added soon. - - -Explanation of modules: - -**Server - Base distribution** - -We use a distributed communication mechanism inside the OpenERP server. Our engine supports most commonly distributed patterns: request/reply, publish/subscribe, monitoring, triggers/callback, ... - -Different business objects can be in different computers or the same objects can be on multiple computers to perform load-balancing. - -**Server - Object Relational Mapping (ORM)** - -This layer provides additional object functionality on top of PostgreSQL: - - * Consistency: powerful validity checks, - * Work with objects (methods, references, ...) - * Row-level security (per user/group/role) - * Complex actions on a group of resources - * Inheritance - -**Server - Web-Services** - -The web-service module offer a common interface for all web-services - - * SOAP - * XML-RPC - * NET-RPC - -Business objects can also be accessed via the distributed object mechanism. They can all be modified via the client interface with contextual views. - -**Server - Workflow Engine** - -Workflows are graphs represented by business objects that describe the dynamics of the company. Workflows are also used to track processes that evolve over time. - -An example of workflow used in OpenERP: - -A sales order generates an invoice and a shipping order - -**Server - Report Engine** - -Reports in OpenERP can be rendered in different ways: - - * Custom reports: those reports can be directly created via the client interface, no programming required. Those reports are represented by business objects (ir.report.custom) - * High quality personalized reports using openreport: no programming required but you have to write 2 small XML files: - - - a template which indicates the data you plan to report - - an XSL:RML stylesheet - * Hard coded reports - * OpenOffice Writer templates - -Nearly all reports are produced in PDF. - -**Server - Business Objects** - -Almost everything is a business object in OpenERP, they describe all data of the program (workflows, invoices, users, customized reports, ...). Business objects are described using the ORM module. They are persistent and can have multiple views (described by the user or automatically calculated). - -Business objects are structured in the /module directory. - -**Client - Wizards** - -Wizards are graphs of actions/windows that the user can perform during a session. - -**Client - Widgets** - -Widgets are probably, although the origin of the term seems to be very difficult to trace, "WIndow gaDGETS" in the IT world, which mean they are gadgets before anything, which implement elementary features through a portable visual tool. - -All common widgets are supported: - - * entries - * textboxes - * floating point numbers - * dates (with calendar) - * checkboxes - * ... - -And also all special widgets: - - * buttons that call actions - * references widgets - - - one2one - - - many2one - - - many2many - - - one2many in list - - - ... - -Widget have different appearances in different views. For example, the date widget in the search dialog represents two normal dates for a range of date (from...to...). - -Some widgets may have different representations depending on the context. For example, the one2many widget can be represented as a form with multiple pages or a multi-columns list. - -Events on the widgets module are processed with a callback mechanism. A callback mechanism is a process whereby an element defines the type of events he can handle and which methods should be called when this event is triggered. Once the event is triggered, the system knows that the event is bound to a specific method, and calls that method back. Hence callback. - - -Module Integrations -=================== - -The are many different modules available for OpenERP and suited for different business models. Nearly all of these are optional (except ModulesAdminBase), making it easy to customize OpenERP to serve specific business needs. All the modules are in a directory named addons/ on the server. You simply need to copy or delete a module directory in order to either install or delete the module on the OpenERP platform. - -Some modules depend on other modules. See the file addons/module/__openerp__.py for more information on the dependencies. - -Here is an example of __openerp__.py: - -.. code-block:: python - - { - "name" : "Open TERP Accounting", - "version" : "1.0", - "author" : "Bob Gates - Not So Tiny", - "website" : "http://www.openerp.com/", - "category" : "Generic Modules/Others", - "depends" : ["base"], - "description" : """A - Multiline - Description - """, - "init_xml" : ["account_workflow.xml", "account_data.xml", "account_demo.xml"], - "demo_xml" : ["account_demo.xml"], - "update_xml" : ["account_view.xml", "account_report.xml", "account_wizard.xml"], - "active": False, - "installable": True - } - -When initializing a module, the files in the init_xml list are evaluated in turn and then the files in the update_xml list are evaluated. When updating a module, only the files from the **update_xml** list are evaluated. - - -Inheritance -=========== - -Traditional Inheritance ------------------------ - -Introduction -++++++++++++ - -Objects may be inherited in some custom or specific modules. It is better to inherit an object to add/modify some fields. - -It is done with:: - - _inherit='object.name' - -Extension of an object -++++++++++++++++++++++ - -There are two possible ways to do this kind of inheritance. Both ways result in a new class of data, which holds parent fields and behaviour as well as additional fields and behaviour, but they differ in heavy programatical consequences. - -While Example 1 creates a new subclass "custom_material" that may be "seen" or "used" by any view or tree which handles "network.material", this will not be the case for Example 2. - -This is due to the table (other.material) the new subclass is operating on, which will never be recognized by previous "network.material" views or trees. - -Example 1:: - - class custom_material(osv.osv): - _name = 'network.material' - _inherit = 'network.material' - _columns = { - 'manuf_warranty': fields.boolean('Manufacturer warranty?'), - } - _defaults = { - 'manuf_warranty': lambda *a: False, - } - custom_material() - -.. tip:: Notice - - _name == _inherit - -In this example, the 'custom_material' will add a new field 'manuf_warranty' to the object 'network.material'. New instances of this class will be visible by views or trees operating on the superclasses table 'network.material'. - -This inheritancy is usually called "class inheritance" in Object oriented design. The child inherits data (fields) and behavior (functions) of his parent. - - -Example 2:: - - class other_material(osv.osv): - _name = 'other.material' - _inherit = 'network.material' - _columns = { - 'manuf_warranty': fields.boolean('Manufacturer warranty?'), - } - _defaults = { - 'manuf_warranty': lambda *a: False, - } - other_material() - -.. tip:: Notice - - _name != _inherit - -In this example, the 'other_material' will hold all fields specified by 'network.material' and it will additionally hold a new field 'manuf_warranty'. All those fields will be part of the table 'other.material'. New instances of this class will therefore never been seen by views or trees operating on the superclasses table 'network.material'. - -This type of inheritancy is known as "inheritance by prototyping" (e.g. Javascript), because the newly created subclass "copies" all fields from the specified superclass (prototype). The child inherits data (fields) and behavior (functions) of his parent. - -Inheritance by Delegation -------------------------- - - **Syntax :**:: - - class tiny_object(osv.osv) - _name = 'tiny.object' - _table = 'tiny_object' - _inherits = { 'tiny.object_a' : 'name_col_a', 'tiny.object_b' : 'name_col_b', - ..., 'tiny.object_n' : 'name_col_n' } - (...) - - -The object 'tiny.object' inherits from all the columns and all the methods from the n objects 'tiny.object_a', ..., 'tiny.object_n'. - -To inherit from multiple tables, the technique consists in adding one column to the table tiny_object per inherited object. This column will store a foreign key (an id from another table). The values *'name_col_a' 'name_col_b' ... 'name_col_n'* are of type string and determine the title of the columns in which the foreign keys from 'tiny.object_a', ..., 'tiny.object_n' are stored. - -This inheritance mechanism is usually called " *instance inheritance* " or " *value inheritance* ". A resource (instance) has the VALUES of its parents. +================= + +Everything in OpenERP, and objects methods in particular, are exposed via +the network and a security layer. Access to the data model is in fact a ‘service’ +and it is possible to expose new services. For instance, a WebDAV service and +a FTP service are available. + +While not mandatory, the services can make use of the `WSGI +`_ stack. WSGI is +a standard solution in the Python ecosystem to write HTTP servers, applications, +and middleware which can be used in a mix-and-match fashion. By using WSGI, +it is possible to run OpenERP in any WSGI compliant server. It is also +possible to use OpenERP to host a WSGI application. + +A striking example of this possibility is the OpenERP Web layer that is +the server-side counter part to the web clients. It provides the requested +data to the browser and manages web sessions. It is a WSGI-compliant application. +As such, it can be run as a stand-alone HTTP server or embedded inside OpenERP. diff --git a/doc/index.rst.inc b/doc/index.rst.inc index e36bccd79d5..670ffd7f53d 100644 --- a/doc/index.rst.inc +++ b/doc/index.rst.inc @@ -3,9 +3,10 @@ OpenERP Server Documentation ''''''''''''''''''''''''''''' .. toctree:: - :maxdepth: 1 + :maxdepth: 2 01_getting_started + 02_architecture 99_test_framework Main revisions and new features From 7ceabb818d266458c4e52502e40ce03bca67c961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 17 Apr 2012 15:40:34 +0200 Subject: [PATCH 007/963] [DOC] [ADD] Added module development chapter from developer book. bzr revid: tde@openerp.com-20120417134034-dqrgog0nxhz3d10e --- doc/03_module_dev.rst | 12 + doc/03_module_dev_01.rst | 597 ++++++++++++++++ doc/03_module_dev_02.rst | 959 +++++++++++++++++++++++++ doc/03_module_dev_03.rst | 1428 ++++++++++++++++++++++++++++++++++++++ doc/03_module_dev_04.rst | 365 ++++++++++ doc/03_module_dev_05.rst | 91 +++ doc/api/startup.rst | 1 - doc/index.rst | 1 + doc/index.rst.inc | 15 +- 9 files changed, 3466 insertions(+), 3 deletions(-) create mode 100644 doc/03_module_dev.rst create mode 100644 doc/03_module_dev_01.rst create mode 100644 doc/03_module_dev_02.rst create mode 100644 doc/03_module_dev_03.rst create mode 100644 doc/03_module_dev_04.rst create mode 100644 doc/03_module_dev_05.rst diff --git a/doc/03_module_dev.rst b/doc/03_module_dev.rst new file mode 100644 index 00000000000..a019af94601 --- /dev/null +++ b/doc/03_module_dev.rst @@ -0,0 +1,12 @@ +======= +Modules +======= + +.. toctree:: + :maxdepth: 2 + + 03_module_dev_01 + 03_module_dev_02 + 03_module_dev_03 + 03_module_dev_04 + 03_module_dev_05 diff --git a/doc/03_module_dev_01.rst b/doc/03_module_dev_01.rst new file mode 100644 index 00000000000..2da148fe1ca --- /dev/null +++ b/doc/03_module_dev_01.rst @@ -0,0 +1,597 @@ +Module development +================== + +Module Structure ++++++++++++++++++ + +All the modules are located in the source/addons directory. The following +steps are necessary to create a new module: + + * create a subdirectory in the source/addons directory + * create the import **__init__.py** file + * create a module description file: **__openerp__.py** + * create the **Python** file containing the **objects** + * create **.xml files** that create the data (views, menu entries, demo data, ...) + * optionally create **reports**, **wizards** or **workflows**. + +Python Module Descriptor File __init__.py +----------------------------------------- + +The ``__init__.py`` file is, like any Python module, executed at the start +of the program. It needs to import the Python files that need to be loaded. + +So, if you create a "module.py" file, containing the description of your +objects, you have to write one line in __init__.py:: + + import module + +OpenERP Module Descriptor File __openerp__.py +--------------------------------------------- + +In the created module directory, you must add a **__openerp__.py** file. +This file, which must be in Python format, is responsible to + + 1. determine the *XML files that will be parsed* during the initialization + of the server, and also to + 2. determine the *dependencies* of the created module. + +This file must contain a Python dictionary with the following values: + +**name** + + The (Plain English) name of the module. + +**version** + + The version of the module. + +**description** + + The module description (text). + +**author** + + The author of the module. + +**website** + + The website of the module. + +**license** + + The license of the module (default:GPL-2). + +**depends** + + List of modules on which this module depends. The base module must + almost always be in the dependencies because some necessary data for + the views, reports, ... are in the base module. + +**init_xml** + + List of .xml files to load when the server is launched with the "--init=module" + argument. Filepaths must be relative to the directory where the module is. + OpenERP XML File Format is detailed in this section. + +**update_xml** + + List of .xml files to load when the server is launched with the "--update=module" + launched. Filepaths must be relative to the directory where the module is. + OpenERP XML File Format is detailed in this section. The files in **update_xml** + concern: views, reports and wizards. + +**installable** + + True or False. Determines if the module is installable or not. + +**active** + + True or False (default: False). Determines the modules that are installed + on the database creation. + +**Example** + +Here is an example of __openerp__.py file for the product module + +.. code-block:: python + + { + "name" : "Products & Pricelists", + "version" : "1.1", + "author" : "Open", + "category" : "Generic Modules/Inventory Control", + "depends" : ["base", "account"], + "init_xml" : [], + "demo_xml" : ["product_demo.xml"], + "update_xml" : ["product_data.xml", "product_report.xml", "product_wizard.xml", + "product_view.xml", "pricelist_view.xml"], + "installable": True, + "active": True + } + +The files that must be placed in init_xml are the ones that relate to the +workflow definition, data to load at the installation of the software and +the data for the demonstrations. + + +XML Files ++++++++++ + +XML files located in the module directory are used to modify the structure of +the database. They are used for many purposes, among which we can cite : + + * initialization and demonstration data declaration, + * views declaration, + * reports declaration, + * wizards declaration, + * workflows declaration. + +General structure of OpenERP XML files is more detailed in the +:ref:`xml-serialization` section. Look here if you are interested in learning +more about *initialization* and *demonstration data declaration* XML files. The +following section are only related to XML specific to *actions, menu entries, +reports, wizards* and *workflows* declaration. + + +Objects ++++++++ + +All OpenERP resources are objects: menus, actions, reports, invoices, partners, ... OpenERP is based on an object relational mapping of a database to control the information. Object names are hierarchical, as in the following examples: + + * account.transfer : a money transfer + * account.invoice : an invoice + * account.invoice.line : an invoice line + +Generally, the first word is the name of the module: account, stock, sale. + +Other advantages of an ORM; + + * simpler relations : invoice.partner.address[0].city + * objects have properties and methods: invoice.pay(3400 EUR), + * inheritance, high level constraints, ... + +It is easier to manipulate one object (example, a partner) than several tables (partner address, categories, events, ...) + + +.. figure:: images/pom_3_0_3.png + :scale: 50 + :align: center + + *The Physical Objects Model of [OpenERP version 3.0.3]* + + +PostgreSQL and ORM +------------------ + +The ORM of OpenERP is constructed over PostgreSQL. It is thus possible to +query the object used by OpenERP using the object interface or by directly +using SQL statements. + +But it is dangerous to write or read directly in the PostgreSQL database, as +you will shortcut important steps like constraints checking or workflow +modification. + +.. note:: + + The Physical Database Model of OpenERP + +Pre-Installed Data +------------------ + +Data can be inserted or updated into the PostgreSQL tables corresponding to the +OpenERP objects using XML files. The general structure of an OpenERP XML file +is as follows: + +.. code-block:: xml + + + + + + + "field1 content" + + + "field2 content" + + (...) + + + (...) + + (...) + + + +Fields content are strings that must be encoded as *UTF-8* in XML files. + +Let's review an example taken from the OpenERP source (base_demo.xml in the base module): + +.. code-block:: xml + + + Tiny sprl + + + + +.. code-block:: xml + + + admin + admin + Administrator + Administrator + + + + + + + +This last record defines the admin user : + + * The fields login, password, etc are straightforward. + * The ref attribute allows to fill relations between the records : + +.. code-block:: xml + + + +The field **company_id** is a many-to-one relation from the user object to the company object, and **main_company** is the id of to associate. + + * The **eval** attribute allows to put some python code in the xml: here the groups_id field is a many2many. For such a field, "[(6,0,[group_admin])]" means : Remove all the groups associated with the current user and use the list [group_admin] as the new associated groups (and group_admin is the id of another record). + + * The **search** attribute allows to find the record to associate when you do not know its xml id. You can thus specify a search criteria to find the wanted record. The criteria is a list of tuples of the same form than for the predefined search method. If there are several results, an arbitrary one will be chosen (the first one): + +.. code-block:: xml + + + +This is a classical example of the use of **search** in demo data: here we do not really care about which partner we want to use for the test, so we give an empty list. Notice the **model** attribute is currently mandatory. + +Record Tag +////////// + +**Description** + +The addition of new data is made with the record tag. This one takes a mandatory attribute : model. Model is the object name where the insertion has to be done. The tag record can also take an optional attribute: id. If this attribute is given, a variable of this name can be used later on, in the same file, to make reference to the newly created resource ID. + +A record tag may contain field tags. They indicate the record's fields value. If a field is not specified the default value will be used. + +**Example** + +.. code-block:: xml + + + account.invoice + Invoices List + account.invoice.list + account/report/invoice.xsl + account/report/invoice.xml + + +Field tag +///////// + +The attributes for the field tag are the following: + +name : mandatory + the field name + +eval : optional + python expression that indicating the value to add + +ref + reference to an id defined in this file + +model + model to be looked up in the search + +search + a query + +Function tag +//////////// + +A function tag can contain other function tags. + +model : mandatory + The model to be used + +name : mandatory + the function given name + +eval + should evaluate to the list of parameters of the method to be called, excluding cr and uid + +**Example** + +.. code-block:: xml + + + +Getitem tag +/////////// + +Takes a subset of the evaluation of the last child node of the tag. + +type : mandatory + int or list + +index : mandatory + int or string (a key of a dictionary) + +**Example** + +Evaluates to the first element of the list of ids returned by the function node + +.. code-block:: xml + + + + + +i18n +"""" + +Improving Translations +////////////////////// + +.. describe:: Translating in launchpad + +Translations are managed by +the `Launchpad Web interface `_. Here, you'll +find the list of translatable projects. + +Please read the `FAQ `_ before asking questions. + +.. describe:: Translating your own module + +.. versionchanged:: 5.0 + +Contrary to the 4.2.x version, the translations are now done by module. So, +instead of an unique ``i18n`` folder for the whole application, each module has +its own ``i18n`` folder. In addition, OpenERP can now deal with ``.po`` [#f_po]_ +files as import/export format. The translation files of the installed languages +are automatically loaded when installing or updating a module. OpenERP can also +generate a .tgz archive containing well organised ``.po`` files for each selected +module. + +.. [#f_po] http://www.gnu.org/software/autoconf/manual/gettext/PO-Files.html#PO-Files + +Process +""""""" + +Defining the process +//////////////////// + +Through the interface and module recorder. +Then, put the generated XML in your own module. + +Views +""""" + +Technical Specifications - Architecture - Views +/////////////////////////////////////////////// + +Views are a way to represent the objects on the client side. They indicate to the client how to lay out the data coming from the objects on the screen. + +There are two types of views: + + * form views + * tree views + +Lists are simply a particular case of tree views. + +A same object may have several views: the first defined view of a kind (*tree, form*, ...) will be used as the default view for this kind. That way you can have a default tree view (that will act as the view of a one2many) and a specialized view with more or less information that will appear when one double-clicks on a menu item. For example, the products have several views according to the product variants. + +Views are described in XML. + +If no view has been defined for an object, the object is able to generate a view to represent itself. This can limit the developer's work but results in less ergonomic views. + + +Usage example +///////////// + +When you open an invoice, here is the chain of operations followed by the client: + + * An action asks to open the invoice (it gives the object's data (account.invoice), the view, the domain (e.g. only unpaid invoices) ). + * The client asks (with XML-RPC) to the server what views are defined for the invoice object and what are the data it must show. + * The client displays the form according to the view + +.. figure:: images/arch_view_use.png + :scale: 50 + :align: center + +To develop new objects +////////////////////// + +The design of new objects is restricted to the minimum: create the objects and optionally create the views to represent them. The PostgreSQL tables do not have to be written by hand because the objects are able to automatically create them (or adapt them in case they already exist). + +Reports +""""""" + +OpenERP uses a flexible and powerful reporting system. Reports are generated either in PDF or in HTML. Reports are designed on the principle of separation between the data layer and the presentation layer. + +Reports are described more in details in the `Reporting `_ chapter. + +Wizards +""""""" + +Here's an example of a .XML file that declares a wizard. + +.. code-block:: xml + + + + + + + + +A wizard is declared using a wizard tag. See "Add A New Wizard" for more information about wizard XML. + +also you can add wizard in menu using following xml entry + +.. code-block:: xml + + + + + + + + + +Workflow +"""""""" + +The objects and the views allow you to define new forms very simply, lists/trees and interactions between them. But that is not enough, you must define the dynamics of these objects. + +A few examples: + + * a confirmed sale order must generate an invoice, according to certain conditions + * a paid invoice must, only under certain conditions, start the shipping order + +The workflows describe these interactions with graphs. One or several workflows may be associated to the objects. Workflows are not mandatory; some objects don't have workflows. + +Below is an example workflow used for sale orders. It must generate invoices and shipments according to certain conditions. + +.. figure:: images/arch_workflow_sale.png + :scale: 85 + :align: center + + +In this graph, the nodes represent the actions to be done: + + * create an invoice, + * cancel the sale order, + * generate the shipping order, ... + +The arrows are the conditions; + + * waiting for the order validation, + * invoice paid, + * click on the cancel button, ... + +The squared nodes represent other Workflows; + + * the invoice + * the shipping + + +Profile Module +++++++++++++++ + +The purpose of a profile is to initialize OpenERP with a set of modules directly after the database has been created. A profile is a special kind of module that contains no code, only *dependencies on other modules*. + +In order to create a profile, you only have to create a new directory in server/addons (you *should* call this folder profile_modulename), in which you put an *empty* __init__.py file (as every directory Python imports must contain an __init__.py file), and a __openerp__.py whose structure is as follows : + +.. code-block:: python + + { + "name":"''Name of the Profile'', + "version":"''Version String''", + "author":"''Author Name''", + "category":"Profile", + "depends":[''List of the modules to install with the profile''], + "demo_xml":[], + "update_xml":[], + "active":False, + "installable":True, + } + +Here's the code of the file source/addons/profile_tools/__openerp__.py, +which corresponds to the tools profile in OpenERP. + +.. code-block:: python + + { + "name" : "Miscellaneous Tools", + "version" : "1.0", + "depends" : ["base", "base_setup"], + "author" : "OpenERP SA", + "category" : "Hidden/Dependency", + 'complexity': "easy", + "description": """ + Installer for extra Hidden like lunch, survey, idea, share, etc. + ================================================================ + + Makes the Extra Hidden Configuration available from where you can install + modules like share, lunch, pad, idea, survey and subscription. + """, + 'website': 'http://www.openerp.com', + 'init_xml': [], + 'update_xml': [ + ], + 'demo_xml': [], + 'installable': True, + 'auto_install': False, + 'certificate' : '00557100228403879621', + 'images': ['images/config_extra_Hidden.jpeg'], + } + + + + + +Action creation +--------------- + +Linking events to action +++++++++++++++++++++++++ + +The available type of events are: + + * **client_print_multi** (print from a list or form) + * **client_action_multi** (action from a list or form) + * **tree_but_open** (double click on the item of a tree, like the menu) + * **tree_but_action** (action on the items of a tree) + +To map an events to an action: + +.. code-block:: xml + + + tree_but_open + account.journal.period + Open Journal + + + + +If you double click on a journal/period (object: account.journal.period), this will open the selected wizard. (id="action_move_journal_line_form_select"). + +You can use a res_id field to allow this action only if the user click on a specific object. + +.. code-block:: xml + + + tree_but_open + account.journal.period + Open Journal + + + + + +The action will be triggered if the user clicks on the account.journal.period n°3. + +When you declare wizard, report or menus, the ir.values creation is automatically made with these tags: + + * + * + * + +So you usually do not need to add the mapping by yourself. diff --git a/doc/03_module_dev_02.rst b/doc/03_module_dev_02.rst new file mode 100644 index 00000000000..c7075a8f7ae --- /dev/null +++ b/doc/03_module_dev_02.rst @@ -0,0 +1,959 @@ +Objects, Fields and Methods +=========================== + +OpenERP Objects +--------------- + +.. This chapter is dedicated to detailed objects definition: + all fields + all objects + inheritancies + +All the ERP's pieces of data are accessible through "objects". As an example, there is a res.partner object to access the data concerning the partners, an account.invoice object for the data concerning the invoices, etc... + +Please note that there is an object for every type of resource, and not an +object per resource. We have thus a res.partner object to manage all the +partners and not a *res.partner* object per partner. If we talk in "object +oriented" terms, we could also say that there is an object per level. + +The direct consequences is that all the methods of objects have a common parameter: the "ids" parameter. This specifies on which resources (for example, on which partner) the method must be applied. Precisely, this parameter contains a list of resource ids on which the method must be applied. + +For example, if we have two partners with the identifiers 1 and 5, and we want to call the res_partner method "send_email", we will write something like:: + + res_partner.send_email(... , [1, 5], ...) + +We will see the exact syntax of object method calls further in this document. + +In the following section, we will see how to define a new object. Then, we will check out the different methods of doing this. + +For developers: + +* OpenERP "objects" are usually called classes in object oriented programming. +* A OpenERP "resource" is usually called an object in OO programming, instance of a class. + +It's a bit confusing when you try to program inside OpenERP, because the language used is Python, and Python is a fully object oriented language, and has objects and instances ... + +Luckily, an OpenERP "resource" can be converted magically into a nice Python object using the "browse" class method (OpenERP object method). + + +The ORM - Object-relational mapping - Models +-------------------------------------------- + +The ORM, short for Object-Relational Mapping, is a central part of OpenERP. + +In OpenERP, the data model is described and manipulated through Python classes +and objects. It is the ORM job to bridge the gap -- as transparently as +possible for the developer -- between Python and the underlying relational +database (PostgreSQL), which will provide the persistence we need for our +objects. + + +OpenERP Object Attributes +------------------------- + +Objects Introduction +++++++++++++++++++++ + +To define a new object, you must define a new Python class then instantiate it. This class must inherit from the osv class in the osv module. + +Object definition ++++++++++++++++++ + +The first line of the object definition will always be of the form:: + + class name_of_the_object(osv.osv): + _name = 'name.of.the.object' + _columns = { ... } + ... + name_of_the_object() + +An object is defined by declaring some fields with predefined names in the +class. Two of them are required (_name and _columns), the rest are optional. +The predefined fields are: + +Predefined fields ++++++++++++++++++ + +`_auto` + Determines whether a corresponding PostgreSQL table must be generated + automatically from the object. Setting _auto to False can be useful in case + of OpenERP objects generated from PostgreSQL views. See the "Reporting From + PostgreSQL Views" section for more details. + +`_columns (required)` + The object fields. See the :ref:`fields ` section for further details. + +`_constraints` + The constraints on the object. See the constraints section for details. + +`_sql_constraints` + The SQL Constraint on the object. See the SQL constraints section for further details. + +`_defaults` + The default values for some of the object's fields. See the default value section for details. + +`_inherit` + The name of the osv object which the current object inherits from. See the :ref:`object inheritance section` + (first form) for further details. + +`_inherits` + The list of osv objects the object inherits from. This list must be given in + a python dictionary of the form: {'name_of_the_parent_object': + 'name_of_the_field', ...}. See the :ref:`object inheritance section` + (second form) for further details. Default value: {}. + +`_log_access` + Determines whether or not the write access to the resource must be logged. + If true, four fields will be created in the SQL table: create_uid, + create_date, write_uid, write_date. Those fields represent respectively the + id of the user who created the record, the creation date of record, the id + of the user who last modified the record, and the date of that last + modification. This data may be obtained by using the perm_read method. + +`_name (required)` + Name of the object. Default value: None. + +`_order` + Name of the fields used to sort the results of the search and read methods. + + Default value: 'id'. + + Examples:: + + _order = "name" + _order = "date_order desc" + +`_rec_name` + Name of the field in which the name of every resource is stored. Default + value: 'name'. Note: by default, the name_get method simply returns the + content of this field. + +`_sequence` + Name of the SQL sequence that manages the ids for this object. Default value: None. + +`_sql` + SQL code executed upon creation of the object (only if _auto is True). It means this code gets executed after the table is created. + +`_table` + Name of the SQL table. Default value: the value of the _name field above + with the dots ( . ) replaced by underscores ( _ ). + + +.. _inherit-link: + +Object Inheritance - _inherit +----------------------------- + +Introduction +++++++++++++ + +Objects may be inherited in some custom or specific modules. It is better to +inherit an object to add/modify some fields. + +It is done with:: + + _inherit='object.name' + +Extension of an object +++++++++++++++++++++++ + +There are two possible ways to do this kind of inheritance. Both ways result in +a new class of data, which holds parent fields and behaviour as well as +additional fields and behaviour, but they differ in heavy programatical +consequences. + +While Example 1 creates a new subclass "custom_material" that may be "seen" or +"used" by any view or tree which handles "network.material", this will not be +the case for Example 2. + +This is due to the table (other.material) the new subclass is operating on, +which will never be recognized by previous "network.material" views or trees. + +Example 1:: + + class custom_material(osv.osv): + _name = 'network.material' + _inherit = 'network.material' + _columns = { + 'manuf_warranty': fields.boolean('Manufacturer warranty?'), + } + _defaults = { + 'manuf_warranty': lambda *a: False, + } + custom_material() + +.. tip:: Notice + + _name == _inherit + +In this example, the 'custom_material' will add a new field 'manuf_warranty' to +the object 'network.material'. New instances of this class will be visible by +views or trees operating on the superclasses table 'network.material'. + +This inheritancy is usually called "class inheritance" in Object oriented +design. The child inherits data (fields) and behavior (functions) of his +parent. + + +Example 2:: + + class other_material(osv.osv): + _name = 'other.material' + _inherit = 'network.material' + _columns = { + 'manuf_warranty': fields.boolean('Manufacturer warranty?'), + } + _defaults = { + 'manuf_warranty': lambda *a: False, + } + other_material() + +.. tip:: Notice + + _name != _inherit + +In this example, the 'other_material' will hold all fields specified by +'network.material' and it will additionally hold a new field 'manuf_warranty'. +All those fields will be part of the table 'other.material'. New instances of +this class will therefore never been seen by views or trees operating on the +superclasses table 'network.material'. + +This type of inheritancy is known as "inheritance by prototyping" (e.g. +Javascript), because the newly created subclass "copies" all fields from the +specified superclass (prototype). The child inherits data (fields) and behavior +(functions) of his parent. + + +.. _inherits-link: + +Inheritance by Delegation - _inherits +------------------------------------- + + **Syntax :**:: + + class tiny_object(osv.osv) + _name = 'tiny.object' + _table = 'tiny_object' + _inherits = { + 'tiny.object_a': 'object_a_id', + 'tiny.object_b': 'object_b_id', + ... , + 'tiny.object_n': 'object_n_id' + } + (...) + +The object 'tiny.object' inherits from all the columns and all the methods from +the n objects 'tiny.object_a', ..., 'tiny.object_n'. + +To inherit from multiple tables, the technique consists in adding one column to +the table tiny_object per inherited object. This column will store a foreign +key (an id from another table). The values *'object_a_id' 'object_b_id' ... +'object_n_id'* are of type string and determine the title of the columns in +which the foreign keys from 'tiny.object_a', ..., 'tiny.object_n' are stored. + +This inheritance mechanism is usually called " *instance inheritance* " or " +*value inheritance* ". A resource (instance) has the VALUES of its parents. + + +.. _fields-link: + +Fields Introduction +------------------- + +Objects may contain different types of fields. Those types can be divided into +three categories: simple types, relation types and functional fields. The +simple types are integers, floats, booleans, strings, etc ... ; the relation +types are used to represent relations between objects (one2one, one2many, +many2one). Functional fields are special fields because they are not stored in +the database but calculated in real time given other fields of the view. + +Here's the header of the initialization method of the class any field defined +in OpenERP inherits (as you can see in server/bin/osv/fields.py):: + + def __init__(self, string='unknown', required=False, readonly=False, + domain=None, context="", states=None, priority=0, change_default=False, size=None, + ondelete="set null", translate=False, select=False, **args) : + +There are a common set of optional parameters that are available to most field +types: + +:change_default: + Whether or not the user can define default values on other fields depending + on the value of this field. Those default values need to be defined in + the ir.values table. +:help: + A description of how the field should be used: longer and more descriptive + than `string`. It will appear in a tooltip when the mouse hovers over the + field. +:ondelete: + How to handle deletions in a related record. Allowable values are: + 'restrict', 'no action', 'cascade', 'set null', and 'set default'. +:priority: Not used? +:readonly: `True` if the user cannot edit this field, otherwise `False`. +:required: + `True` if this field must have a value before the object can be saved, + otherwise `False`. +:size: The size of the field in the database: number characters or digits. +:states: + Lets you override other parameters for specific states of this object. + Accepts a dictionary with the state names as keys and a list of name/value + tuples as the values. For example: `states={'posted':[('readonly',True)]}` +:string: + The field name as it should appear in a label or column header. Strings + containing non-ASCII characters must use python unicode objects. + For example: `'tested': fields.boolean(u'Testé')` +:translate: + `True` if the *content* of this field should be translated, otherwise + `False`. + +There are also some optional parameters that are specific to some field types: + +:context: + Define a variable's value visible in the view's context or an on-change + function. Used when searching child table of `one2many` relationship? +:domain: + Domain restriction on a relational field. + + Default value: []. + + Example: domain=[('field','=',value)]) +:invisible: Hide the field's value in forms. For example, a password. +:on_change: + Default value for the `on_change` attribute in the view. This will launch + a function on the server when the field changes in the client. For example, + `on_change="onchange_shop_id(shop_id)"`. +:relation: + Used when a field is an id reference to another table. This is the name of + the table to look in. Most commonly used with related and function field + types. +:select: + Default value for the `select` attribute in the view. 1 means basic search, + and 2 means advanced search. + + +Type of Fields +-------------- + +Basic Types ++++++++++++ + +:boolean: + + A boolean (true, false). + + Syntax:: + + fields.boolean('Field Name' [, Optional Parameters]), + +:integer: + + An integer. + + Syntax:: + + fields.integer('Field Name' [, Optional Parameters]), + +:float: + + A floating point number. + + Syntax:: + + fields.float('Field Name' [, Optional Parameters]), + + .. note:: + + The optional parameter digits defines the precision and scale of the + number. The scale being the number of digits after the decimal point + whereas the precision is the total number of significant digits in the + number (before and after the decimal point). If the parameter digits is + not present, the number will be a double precision floating point number. + Warning: these floating-point numbers are inexact (not any value can be + converted to its binary representation) and this can lead to rounding + errors. You should always use the digits parameter for monetary amounts. + + Example:: + + 'rate': fields.float( + 'Relative Change rate', + digits=(12,6) [, + Optional Parameters]), + +:char: + + A string of limited length. The required size parameter determines its size. + + Syntax:: + + fields.char( + 'Field Name', + size=n [, + Optional Parameters]), # where ''n'' is an integer. + + Example:: + + 'city' : fields.char('City Name', size=30, required=True), + +:text: + + A text field with no limit in length. + + Syntax:: + + fields.text('Field Name' [, Optional Parameters]), + +:date: + + A date. + + Syntax:: + + fields.date('Field Name' [, Optional Parameters]), + +:datetime: + + Allows to store a date and the time of day in the same field. + + Syntax:: + + fields.datetime('Field Name' [, Optional Parameters]), + +:binary: + + A binary chain + +:selection: + + A field which allows the user to make a selection between various predefined values. + + Syntax:: + + fields.selection((('n','Unconfirmed'), ('c','Confirmed')), + 'Field Name' [, Optional Parameters]), + + .. note:: + + Format of the selection parameter: tuple of tuples of strings of the form:: + + (('key_or_value', 'string_to_display'), ... ) + + .. note:: + You can specify a function that will return the tuple. Example :: + + def _get_selection(self, cursor, user_id, context=None): + return ( + ('choice1', 'This is the choice 1'), + ('choice2', 'This is the choice 2')) + + _columns = { + 'sel' : fields.selection( + _get_selection, + 'What do you want ?') + } + + *Example* + + Using relation fields **many2one** with **selection**. In fields definitions add:: + + ..., + 'my_field': fields.many2one( + 'mymodule.relation.model', + 'Title', + selection=_sel_func), + ..., + + And then define the _sel_func like this (but before the fields definitions):: + + def _sel_func(self, cr, uid, context=None): + obj = self.pool.get('mymodule.relation.model') + ids = obj.search(cr, uid, []) + res = obj.read(cr, uid, ids, ['name', 'id'], context) + res = [(r['id'], r['name']) for r in res] + return res + +Relational Types +++++++++++++++++ + +:one2one: + + A one2one field expresses a one:to:one relation between two objects. It is + deprecated. Use many2one instead. + + Syntax:: + + fields.one2one('other.object.name', 'Field Name') + +:many2one: + + Associates this object to a parent object via this Field. For example + Department an Employee belongs to would Many to one. i.e Many employees will + belong to a Department + + Syntax:: + + fields.many2one( + 'other.object.name', + 'Field Name', + optional parameters) + + Optional parameters: + + - ondelete: What should happen when the resource this field points to is deleted. + + Predefined value: "cascade", "set null", "restrict", "no action", "set default" + + Default value: "set null" + - required: True + - readonly: True + - select: True - (creates an index on the Foreign Key field) + + *Example* :: + + 'commercial': fields.many2one( + 'res.users', + 'Commercial', + ondelete='cascade'), + +:one2many: + + TODO + + Syntax:: + + fields.one2many( + 'other.object.name', + 'Field relation id', + 'Fieldname', + optional parameter) + + Optional parameters: + - invisible: True/False + - states: ? + - readonly: True/False + + *Example* :: + + 'address': fields.one2many( + 'res.partner.address', + 'partner_id', + 'Contacts'), + +:many2many: + + TODO + + Syntax:: + + fields.many2many('other.object.name', + 'relation object', + 'actual.object.id', + 'other.object.id', + 'Field Name') + + Where: + - other.object.name is the other object which belongs to the relation + - relation object is the table that makes the link + - actual.object.id and other.object.id are the fields' names used in the relation table + + Example:: + + 'category_ids': + fields.many2many( + 'res.partner.category', + 'res_partner_category_rel', + 'partner_id', + 'category_id', + 'Categories'), + + To make it bidirectional (= create a field in the other object):: + + class other_object_name2(osv.osv): + _inherit = 'other.object.name' + _columns = { + 'other_fields': fields.many2many( + 'actual.object.name', + 'relation object', + 'actual.object.id', + 'other.object.id', + 'Other Field Name'), + } + other_object_name2() + + Example:: + + class res_partner_category2(osv.osv): + _inherit = 'res.partner.category' + _columns = { + 'partner_ids': fields.many2many( + 'res.partner', + 'res_partner_category_rel', + 'category_id', + 'partner_id', + 'Partners'), + } + res_partner_category2() + +:related: + + Sometimes you need to refer to the relation of a relation. For example, + supposing you have objects: City -> State -> Country, and you need to refer to + the Country from a City, you can define a field as below in the City object:: + + 'country_id': fields.related( + 'state_id', + 'country_id', + type="many2one", + relation="res.country", + string="Country", + store=False) + + Where: + - The first set of parameters are the chain of reference fields to + follow, with the desired field at the end. + - :guilabel:`type` is the type of that desired field. + - Use :guilabel:`relation` if the desired field is still some kind of + reference. :guilabel:`relation` is the table to look up that + reference in. + + +Functional Fields ++++++++++++++++++ + +A functional field is a field whose value is calculated by a function (rather +than being stored in the database). + +**Parameters:** :: + + fnct, arg=None, fnct_inv=None, fnct_inv_arg=None, type="float", + fnct_search=None, obj=None, method=False, store=False, multi=False + +where + + * :guilabel:`fnct` is the function or method that will compute the field + value. It must have been declared before declaring the functional field. + * :guilabel:`fnct_inv` is the function or method that will allow writing + values in that field. + * :guilabel:`type` is the field type name returned by the function. It can + be any field type name except function. + * :guilabel:`fnct_search` allows you to define the searching behaviour on + that field. + * :guilabel:`method` whether the field is computed by a method (of an + object) or a global function + * :guilabel:`store` If you want to store field in database or not. Default + is False. + * :guilabel:`multi` is a group name. All fields with the same `multi` + parameter will be calculated in a single function call. + +fnct parameter +"""""""""""""" +If *method* is True, the signature of the method must be:: + + def fnct(self, cr, uid, ids, field_name, arg, context): + +otherwise (if it is a global function), its signature must be:: + + def fnct(cr, table, ids, field_name, arg, context): + +Either way, it must return a dictionary of values of the form +**{id'_1_': value'_1_', id'_2_': value'_2_',...}.** + +The values of the returned dictionary must be of the type specified by the type +argument in the field declaration. + +If *multi* is set, then *field_name* is replaced by *field_names*: a list +of the field names that should be calculated. Each value in the returned +dictionary is also a dictionary from field name to value. For example, if the +fields `'name'`, and `'age'` are both based on the `vital_statistics` function, +then the return value of `vital_statistics` might look like this when `ids` is +`[1, 2, 5]`:: + + { + 1: {'name': 'Bob', 'age': 23}, + 2: {'name': 'Sally', 'age', 19}, + 5: {'name': 'Ed', 'age': 62} + } + +fnct_inv parameter +"""""""""""""""""" +If *method* is true, the signature of the method must be:: + + def fnct(self, cr, uid, ids, field_name, field_value, arg, context): + + +otherwise (if it is a global function), it should be:: + + def fnct(cr, table, ids, field_name, field_value, arg, context): + +fnct_search parameter +""""""""""""""""""""" +If method is true, the signature of the method must be:: + + def fnct(self, cr, uid, obj, name, args, context): + +otherwise (if it is a global function), it should be:: + + def fnct(cr, uid, obj, name, args, context): + +The return value is a list containing 3-part tuples which are used in search function:: + + return [('id','in',[1,3,5])] + +*obj* is the same as *self*, and *name* receives the field name. *args* is a list +of 3-part tuples containing search criteria for this field, although the search +function may be called separately for each tuple. + +Example +""""""" +Suppose we create a contract object which is : + +.. code-block:: python + + class hr_contract(osv.osv): + _name = 'hr.contract' + _description = 'Contract' + _columns = { + 'name' : fields.char('Contract Name', size=30, required=True), + 'employee_id' : fields.many2one('hr.employee', 'Employee', required=True), + 'function' : fields.many2one('res.partner.function', 'Function'), + } + hr_contract() + +If we want to add a field that retrieves the function of an employee by looking its current contract, we use a functional field. The object hr_employee is inherited this way: + +.. code-block:: python + + class hr_employee(osv.osv): + _name = "hr.employee" + _description = "Employee" + _inherit = "hr.employee" + _columns = { + 'contract_ids' : fields.one2many('hr.contract', 'employee_id', 'Contracts'), + 'function' : fields.function( + _get_cur_function_id, + type='many2one', + obj="res.partner.function", + method=True, + string='Contract Function'), + } + hr_employee() + +.. note:: three points + + * :guilabel:`type` ='many2one' is because the function field must create + a many2one field; function is declared as a many2one in hr_contract also. + * :guilabel:`obj` ="res.partner.function" is used to specify that the + object to use for the many2one field is res.partner.function. + * We called our method :guilabel:`_get_cur_function_id` because its role + is to return a dictionary whose keys are ids of employees, and whose + corresponding values are ids of the function of those employees. The + code of this method is: + +.. code-block:: python + + def _get_cur_function_id(self, cr, uid, ids, field_name, arg, context): + for i in ids: + #get the id of the current function of the employee of identifier "i" + sql_req= """ + SELECT f.id AS func_id + FROM hr_contract c + LEFT JOIN res_partner_function f ON (f.id = c.function) + WHERE + (c.employee_id = %d) + """ % (i,) + + cr.execute(sql_req) + sql_res = cr.dictfetchone() + + if sql_res: #The employee has one associated contract + res[i] = sql_res['func_id'] + else: + #res[i] must be set to False and not to None because of XML:RPC + # "cannot marshal None unless allow_none is enabled" + res[i] = False + return res + +The id of the function is retrieved using a SQL query. Note that if the query +returns no result, the value of sql_res['func_id'] will be None. We force the +False value in this case value because XML:RPC (communication between the server +and the client) doesn't allow to transmit this value. + +store Parameter +""""""""""""""" +It will calculate the field and store the result in the table. The field will be +recalculated when certain fields are changed on other objects. It uses the +following syntax: + +.. code-block:: python + + store = { + 'object_name': ( + function_name, + ['field_name1', 'field_name2'], + priority) + } + +It will call function function_name when any changes are written to fields in the +list ['field1','field2'] on object 'object_name'. The function should have the +following signature:: + + def function_name(self, cr, uid, ids, context=None): + +Where `ids` will be the ids of records in the other object's table that have +changed values in the watched fields. The function should return a list of ids +of records in its own table that should have the field recalculated. That list +will be sent as a parameter for the main function of the field. + +Here's an example from the membership module: + +.. code-block:: python + + 'membership_state': + fields.function( + _membership_state, + method=True, + string='Current membership state', + type='selection', + selection=STATE, + store={ + 'account.invoice': (_get_invoice_partner, ['state'], 10), + 'membership.membership_line': (_get_partner_id,['state'], 10), + 'res.partner': ( + lambda self, cr, uid, ids, c={}: ids, + ['free_member'], + 10) + }), + +Property Fields ++++++++++++++++ + +.. describe:: Declaring a property + +A property is a special field: fields.property. + +.. code-block:: python + + class res_partner(osv.osv): + _name = "res.partner" + _inherit = "res.partner" + _columns = { + 'property_product_pricelist': + fields.property( + 'product.pricelist', + type='many2one', + relation='product.pricelist', + string="Sale Pricelist", + method=True, + view_load=True, + group_name="Pricelists Properties"), + } + + +Then you have to create the default value in a .XML file for this property: + +.. code-block:: xml + + + property_product_pricelist + + + + +.. + +.. tip:: + + if the default value points to a resource from another module, you can use the ref function like this: + + + +**Putting properties in forms** + +To add properties in forms, just put the tag in your form. This will automatically add all properties fields that are related to this object. The system will add properties depending on your rights. (some people will be able to change a specific property, others won't). + +Properties are displayed by section, depending on the group_name attribute. (It is rendered in the client like a separator tag). + +**How does this work ?** + +The fields.property class inherits from fields.function and overrides the read and write method. The type of this field is many2one, so in the form a property is represented like a many2one function. + +But the value of a property is stored in the ir.property class/table as a complete record. The stored value is a field of type reference (not many2one) because each property may point to a different object. If you edit properties values (from the administration menu), these are represented like a field of type reference. + +When you read a property, the program gives you the property attached to the instance of object you are reading. If this object has no value, the system will give you the default property. + +The definition of a property is stored in the ir.model.fields class like any other fields. In the definition of the property, you can add groups that are allowed to change to property. + +**Using properties or normal fields** + +When you want to add a new feature, you will have to choose to implement it as a property or as normal field. Use a normal field when you inherit from an object and want to extend this object. Use a property when the new feature is not related to the object but to an external concept. + + +Here are a few tips to help you choose between a normal field or a property: + +Normal fields extend the object, adding more features or data. + +A property is a concept that is attached to an object and have special features: + +* Different value for the same property depending on the company +* Rights management per field +* It's a link between resources (many2one) + +**Example 1: Account Receivable** + +The default "Account Receivable" for a specific partner is implemented as a property because: + + * This is a concept related to the account chart and not to the partner, so it is an account property that is visible on a partner form. Rights have to be managed on this fields for accountants, these are not the same rights that are applied to partner objects. So you have specific rights just for this field of the partner form: only accountants may change the account receivable of a partner. + + * This is a multi-company field: the same partner may have different account receivable values depending on the company the user belongs to. In a multi-company system, there is one account chart per company. The account receivable of a partner depends on the company it placed the sale order. + + * The default account receivable is the same for all partners and is configured from the general property menu (in administration). + +.. note:: + One interesting thing is that properties avoid "spaghetti" code. The account module depends on the partner (base) module. But you can install the partner (base) module without the accounting module. If you add a field that points to an account in the partner object, both objects will depend on each other. It's much more difficult to maintain and code (for instance, try to remove a table when both tables are pointing to each others.) + +**Example 2: Product Times** + +The product expiry module implements all delays related to products: removal date, product usetime, ... This module is very useful for food industries. + +This module inherits from the product.product object and adds new fields to it: + +.. code-block:: python + + class product_product(osv.osv): + + _inherit = 'product.product' + _name = 'product.product' + _columns = { + + 'life_time': fields.integer('Product lifetime'), + 'use_time': fields.integer('Product usetime'), + 'removal_time': fields.integer('Product removal time'), + 'alert_time': fields.integer('Product alert time'), + } + + product_product() + +.. + +This module adds simple fields to the product.product object. We did not use properties because: + + * We extend a product, the life_time field is a concept related to a product, not to another object. + * We do not need a right management per field, the different delays are managed by the same people that manage all products. + + +ORM methods +----------- + +Keeping the context in ORM methods +++++++++++++++++++++++++++++++++++ + +In OpenObject, the context holds very important data such as the language in +which a document must be written, whether function field needs updating or not, +etc. + +When calling an ORM method, you will probably already have a context - for +example the framework will provide you with one as a parameter of almost +every method. +If you do have a context, it is very important that you always pass it through +to every single method you call. + +This rule also applies to writing ORM methods. You should expect to receive a +context as parameter, and always pass it through to every other method you call.. diff --git a/doc/03_module_dev_03.rst b/doc/03_module_dev_03.rst new file mode 100644 index 00000000000..975ebbb3064 --- /dev/null +++ b/doc/03_module_dev_03.rst @@ -0,0 +1,1428 @@ +Views and Events +================ + +Introduction to Views +--------------------- + +As all data of the program is stored in objects, as explained in the Objects section, how are these objects exposed to the user ? We will try to answer this question in this section. + +First of all, let's note that every resource type uses its own interface. For example, the screen to modify a partner's data is not the same as the one to modify an invoice. + +Then, you have to know that the OpenERP user interface is dynamic, it means that it is not described "statically" by some code, but dynamically built from XML descriptions of the client screens. + +From now on, we will call these screen descriptions views. + +A notable characteristic of these views is that they can be edited at any moment (even during the program execution). After a modification to a displayed view has occurred, you simply need to close the tab corresponding to that 'view' and re-open it for the changes to appear. + +Views principles +++++++++++++++++ + +Views describe how each object (type of resource) is displayed. More precisely, for each object, we can define one (or several) view(s) to describe which fields should be drawn and how. + +There are two types of views: + + #. form views + #. tree views + +.. note:: Since OpenERP 4.1, form views can also contain graphs. + + +Form views +---------- + +The field disposition in a form view always follows the same principle. Fields are distributed on the screen following the rules below: + + * By default, each field is preceded by a label, with its name. + * Fields are placed on the screen from left to right, and from top to bottom, according to the order in which they are declared in the view. + * Every screen is divided into 4 columns, each column being able to contain either a label, or an "edition" field. As every edition field is preceded (by default) by a label with its name, there will be two fields (and their respective labels) on each line of the screen. The green and red zones on the screen-shot below, illustrate those 4 columns. They designate respectively the labels and their corresponding fields. + +.. figure:: images/sale_order.png + :scale: 50 + :align: center + + +Views also support more advanced placement options: + + * A view field can use several columns. For example, on the screen-shot below, the zone in the blue frame is, in fact, the only field of a "one to many". We will come back later on this note, but let's note that it uses the whole width of the screen and not only one column. + + .. figure:: images/sale_order_sale_order_lines.png + :scale: 50 + :align: center + + * We can also make the opposite operation: take a columns group and divide it in as many columns as desired. The surrounded green zones of the screen above are good examples. Precisely, the green framework up and on the right side takes the place of two columns, but contains 4 columns. + +As we can see below in the purple zone of the screen, there is also a way to distribute the fields of an object on different tabs. + +.. figure:: images/sale_order_notebook.png + :scale: 50 + :align: center + + +Tree views +----------- + +These views are used when we work in list mode (in order to visualize several resources at once) and in the search screen. These views are simpler than the form views and thus have less options. + +.. figure:: images/tree_view.png + :scale: 50 + :align: center + +Graph views +-------------- + +A graph is a new mode of view for all views of type form. If, for example, a sale order line must be visible as list or as graph, define it like this in the action that open this sale order line. Do not set the view mode as "tree,form,graph" or "form,graph" - it must be "graph,tree" to show the graph first or "tree,graph" to show the list first. (This view mode is extra to your "form,tree" view and should have a separate menu item): + +.. code-block:: xml + + form + tree,graph + +view_type:: + + tree = (tree with shortcuts at the left), form = (switchable view form/list) + +view_mode:: + + tree,graph : sequences of the views when switching + +Then, the user will be able to switch from one view to the other. Unlike forms and trees, OpenERP is not able to automatically create a view on demand for the graph type. So, you must define a view for this graph: + + +.. code-block:: xml + + + sale.order.line.graph + sale.order.line + graph + + + + + + + + + +The graph view + +A view of type graph is just a list of fields for the graph. + +Graph tag +++++++++++ + +The default type of the graph is a pie chart - to change it to a barchart change **** to **** You also may change the orientation. + +:Example : + +.. code-block:: xml + + + +Field tag ++++++++++ + +The first field is the X axis. The second one is the Y axis and the optional third one is the Z axis for 3 dimensional graphs. You can apply a few attributes to each field/axis: + + * **group**: if set to true, the client will group all item of the same value for this field. For each other field, it will apply an operator + * **operator**: the operator to apply is another field is grouped. By default it's '+'. Allowed values are: + + + +: addition + + \*: multiply + + \**: exponent + + min: minimum of the list + + max: maximum of the list + +:Defining real statistics on objects: + +The easiest method to compute real statistics on objects is: + + 1. Define a statistic object which is a postgresql view + 2. Create a tree view and a graph view on this object + +You can get en example in all modules of the form: report\_.... Example: report_crm. + + +Search views +-------------- + +Search views are a new feature of OpenERP supported as of version 6.0 +It creates a customized search panel, and is declared quite similarly to a form view, +except that the view type and root element change to ``search`` instead of ``form``. + +.. image:: images/search.png + :scale: 50 + :align: center + +Following is the list of new elements and features supported in search views. + +Group tag ++++++++++ + +Unlike form group elements, search view groups support unlimited number of widget(fields or filters) +in a row (no automatic line wrapping), and only use the following attributes: + + + ``expand``: turns on the expander icon on the group (1 for expanded by default, 0 for collapsed) + + ``string``: label for the group + +.. code-block:: xml + + + + + + + + +In the screenshot above the green area is an expandable group. + +Filter tag ++++++++++++ +Filters are displayed as a toggle button on search panel +Filter elements can add new values in the current domain or context of the search view. +Filters can be added as a child element of field too, to indicate that they apply specifically +to that field (in this case the button's icon will smaller) + +In the picture above the red area contains filters at the top of the form while +the blue area highlights a field and it's child filter. + +.. code-block:: xml + + + + + + +Group By +++++++++ + +.. code-block:: xml + + + +Above filters groups records sharing the same ``project_id`` value. Groups are loaded +lazily, so the inner records are only loaded when the group is expanded. +The group header lines contain the common values for all records in that group, and all numeric +fields currently displayed in the view are replaced by the sum of the values in that group. + +It is also possible to group on multiple values by specifying a list of fields instead of a single string. +In this case nested groups will be displayed:: + + + +Fields +++++++ + +Field elements in search views are used to get user-provided values +for searches. As a result, as for group elements, they are quite +different than form view's fields: + +* a search field can contain filters, which generally indicate that + both field and filter manage the same field and are related. + + Those inner filters are rendered as smaller buttons, right next to + the field, and *must not* have a ``string`` attribute. + +* a search field really builds a domain composed of ``[(field_name, + operator, field_value)]``. This domain can be overridden in two + ways: + + * ``@operator`` replaces the default operator for the field (which + depends on its type) + + * ``@filter_domain`` lets you provide a fully custom domain, which + will replace the default domain creation + +* a search field does not create a context by default, but you can + provide an ``@context`` which will be evaluated and merged into the + wider context (as with a ``filter`` element). + +To get the value of the field in your ``@context`` or +``@filter_domain``, you can use the variable ``self``: + +.. code-block:: xml + + + +or + +.. code-block:: xml + + + +Range fields (date, datetime, time) +""""""""""""""""""""""""""""""""""" + +The range fields are composed of two input widgets (from and two) +instead of just one. + +This leads to peculiarities (compared to non-range search fields): + +* It is not possible to override the operator of a range field via + ``@operator``, as the domain is built of two sections and each + section uses a different operator. + +* Instead of being a simple value (integer, string, float) ``self`` + for use in ``@filter_domain`` and ``@context`` is a ``dict``. + + Because each input widget of a range field can be empty (and the + field itself will still be valid), care must be taken when using + ``self``: it has two string keys ``"from"`` and ``"to"``, but any of + these keys can be either missing entirely or set to the value + ``False``. + +Actions for Search view ++++++++++++++++++++++++ + +After declaring a search view, it will be used automatically for all tree views on the same model. +If several search views exist for a single model, the one with the highest priority (lowest sequence) will +be used. Another option is to explicitly select the search view you want to use, by setting the +``search_view_id`` field of the action. + +In addition to being able to pass default form values in the context of the action, OpenERP 6.0 now +supports passing initial values for search views too, via the context. The context keys need to match the +``search_default_XXX`` format. ``XXX`` may refer to the ``name`` of a ```` or ```` +in the search view (as the ``name`` attribute is not required on filters, this only works for filters that have +an explicit ``name`` set). The value should be either the initial value for search fields, or +simply a boolean value for filters, to toggle them + +.. code-block:: xml + + + Tasks + project.task + form + tree,form,calendar,gantt,graph + + + {"search_default_current":1,"search_default_user_id":uid} + + + +Custom Filters +++++++++++++++ + +As of v6.0, all search views also features custom search filters, as show below. +Users can define their own custom filters using any of the fields available on the current model, +combining them with AND/OR operators. It is also possible to save any search context (the combination +of all currently applied domain and context values) as a personal filter, which can be recalled +at any time. Filters can also be turned into Shortcuts directly available in the User's homepage. + +.. image:: images/filter.png + :scale: 50 + :align: center + + +In above screenshot we filter Partner where Salesman = Demo user and Country = Belgium, +We can save this search criteria as a Shortcut or save as Filter. + +Filters are user specific and can be modified via the Manage Filters option in the filters drop-down. + + +Calendar Views +-------------- + +Calendar view provides timeline/schedule view for the data. + +View Specification +++++++++++++++++++ + +Here is an example view: + +.. code-block:: xml + + + + + + +Here is the list of supported attributes for ``calendar`` tag: + + ``string`` + The title string for the view. + + ``date_start`` + A ``datetime`` field to specify the starting date for the calendar item. This + attribute is required. + + ``date_stop`` + A ``datetime`` field to specify the end date. Ignored if ``date_delay`` + attribute is specified. + + ``date_delay`` + A ``numeric`` field to specify time in hours for a record. This attribute + will get preference over ``date_stop`` and ``date_stop`` will be ignored. + + ``day_length`` + An ``integer`` value to specify working day length. Default is ``8`` hours. + + ``color`` + A field, generally ``many2one``, to colorize calendar/gantt items. + + ``mode`` + A string value to set default view/zoom mode. For ``calendar`` view, this can be + one of following (default is ``month``): + + * ``day`` + * ``week`` + * ``month`` + +Screenshots ++++++++++++ + +Month Calendar: + +.. figure:: images/calendar_month.png + :scale: 50% + :align: center + +Week Calendar: + +.. figure:: images/calendar_week.png + :scale: 50% + :align: center + + +Gantt Views +----------- + +Gantt view provides timeline view for the data. Generally, it can be used to display +project tasks and resource allocation. + +A Gantt chart is a graphical display of all the tasks that a project is composed of. +Each bar on the chart is a graphical representation of the length of time the task is +planned to take. + +A resource allocation summary bar is shown on top of all the grouped tasks, +representing how effectively the resources are allocated among the tasks. + +Color coding of the summary bar is as follows: + + * `Gray` shows that the resource is not allocated to any task at that time + * `Blue` shows that the resource is fully allocated at that time. + * `Red` shows that the resource is overallocated + +View Specification +++++++++++++++++++ + +Here is an example view: + +.. code-block:: xml + + + + + + + +The ``attributes`` accepted by the ``gantt`` tag are similar to ``calendar`` view tag. The +``level`` tag is used to group the records by some ``many2one`` field. Currently, only +one level is supported. + +Here is the list of supported attributes for ``gantt`` tag: + + ``string`` + The title string for the view. + + ``date_start`` + A ``datetime`` field to specify the starting date for the gantt item. This + attribute is required. + + ``date_stop`` + A ``datetime`` field to specify the end date. Ignored if ``date_delay`` + attribute is specified. + + ``date_delay`` + A ``numeric`` field to specify time in hours for a record. This attribute + will get preference over ``date_stop`` and ``date_stop`` will be ignored. + + ``day_length`` + An ``integer`` value to specify working day length. Default is ``8`` hours. + + ``color`` + A field, generally ``many2one``, to colorize calendar/gantt items. + + ``mode`` + A string value to set default view/zoom mode. For ``gantt`` view, this can be + one of following (default is ``month``): + + * ``day`` + * ``3days`` + * ``week`` + * ``3weeks`` + * ``month`` + * ``3months`` + * ``year`` + * ``3years`` + * ``5years`` + +The ``level`` tag supports following attributes: + + ``object`` + An openerp object having many2one relationship with view object. + + ``link`` + The field name in current object that links to the given ``object``. + + ``domain`` + The domain to be used to filter the given ``object`` records. + +Drag and Drop ++++++++++++++ + +The left side pane displays list of the tasks grouped by the given ``level`` field. +You can reorder or change the group of any records by dragging them. + +The main content pane displays horizontal bars plotted on a timeline grid. A group +of bars are summarized with a top summary bar displaying resource allocation of all +the underlying tasks. + +You can change the task start time by dragging the tasks horizontally. While +end time can be changed by dragging right end of a bar. + +.. note:: + + The time is calculated considering ``day_length`` so a bar will span more + then one day if total time for a task is greater then ``day_length`` value. + +Screenshots ++++++++++++ + +.. figure:: images/gantt.png + :scale: 50% + :align: center + + +Design Elements +--------------- + +The files describing the views are of the form: + +:Example: + +.. code-block:: xml + + + + + [view definitions] + + + +The view definitions contain mainly three types of tags: + + * **** tags with the attribute model="ir.ui.view", which contain the view definitions themselves + * **** tags with the attribute model="ir.actions.act_window", which link actions to these views + * **** tags, which create entries in the menu, and link them with actions + +New : You can specify groups for whom the menu is accessible using the groups +attribute in the `menuitem` tag. + +New : You can now add shortcut using the `shortcut` tag. + +:Example: + +.. code-block:: xml + + + +Note that you should add an id attribute on the `menuitem` which is referred by +menu attribute. + +.. code-block:: xml + + + sale.order.form + sale.order + + +
+ ......... +
+
+
+ +Default value for the priority field : 16. When not specified the system will use the view with the lower priority. + +View Types +++++++++++ + +Tree View +""""""""" +You can specify the columns to include in the list, along with some details of +the list's appearance. The search fields aren't specified here, they're +specified by the `select` attribute in the form view fields. + +.. code-block:: xml + + + stock.location.tree + stock.location + tree + + + + + + + + + + + + +That example is just a flat list, but you can also display a real tree structure +by specifying a `field_parent`. The name is a bit misleading, though; the field +you specify must contain a list of all **child** entries. + +.. code-block:: xml + + + stock.location.tree + stock.location + tree + child_ids + + + + + + + + +On the `tree` element, the following attributes are supported: + +colors + Conditions for applying different colors to items in the list. The default + is black. +toolbar + Set this to 1 if you want a tree structure to list the top level entries + in a separate toolbar area. When you click on an entry in the toolbar, all + its descendants will be displayed in the main tree. The value is ignored + for flat lists. + +Grouping Elements ++++++++++++++++++ + +Separator +""""""""" + +Adds a separator line + +:Example: + +.. code-block:: xml + + + +The string attribute defines its label and the colspan attribute defines his horizontal size (in number of columns). + +Notebook +"""""""" + +: With notebooks you can distribute the view fields on different tabs (each one defined by a page tag). You can use the tabpos properties to set tab at: up, down, left, right. + +:Example: + +.. code-block:: xml + + .... + +Group +""""" + +: groups several columns and split the group in as many columns as desired. + + * **colspan**: the number of columns to use + * **rowspan**: the number of rows to use + * **expand**: if we should expand the group or not + * **col**: the number of columns to provide (to its children) + * **string**: (optional) If set, a frame will be drawn around the group of fields, with a label containing the string. Otherwise, the frame will be invisible. + +:Example: + +.. code-block:: xml + + + +
+ +
From 4a8e00cac7ba39a99f2a4fac9cdd4a4f171370ed Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Mon, 25 Jun 2012 12:21:09 +0530 Subject: [PATCH 022/963] [FIX]base:fix the issue convert to quote is not working via Scheduled Calls lp bug: https://launchpad.net/bugs/1017353 fixed bzr revid: mma@tinyerp.com-20120625065109-5ciy82syodgtbcg9 --- addons/sale_crm/wizard/crm_make_sale.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/sale_crm/wizard/crm_make_sale.py b/addons/sale_crm/wizard/crm_make_sale.py index 9484b87652e..fd84e33610f 100644 --- a/addons/sale_crm/wizard/crm_make_sale.py +++ b/addons/sale_crm/wizard/crm_make_sale.py @@ -64,7 +64,9 @@ class crm_make_sale(osv.osv_memory): """ if context is None: context = {} - + # update context: if come from phonecall, default state values can make the quote crash lp:1017353 + context.pop('default_state', False) + case_obj = self.pool.get('crm.lead') sale_obj = self.pool.get('sale.order') partner_obj = self.pool.get('res.partner') From e46502580a5c9e19c31e15dd308e99307bbb68ed Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Wed, 25 Jul 2012 16:43:27 +0530 Subject: [PATCH 023/963] [IMP] changed the condition in def create_move of account_asset/account_asset.py bzr revid: bde@tinyerp.com-20120725111327-rd1se9de0yoj8wgg --- addons/account_asset/account_asset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 8cd73c60aa7..fe0ee8b3922 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -366,8 +366,6 @@ class account_asset_depreciation_line(osv.osv): currency_obj = self.pool.get('res.currency') created_move_ids = [] for line in self.browse(cr, uid, ids, context=context): - if currency_obj.is_zero(cr, uid, line.asset_id.currency_id, line.remaining_value): - can_close = True depreciation_date = line.asset_id.prorata and line.asset_id.purchase_date or time.strftime('%Y-%m-%d') period_ids = period_obj.find(cr, uid, depreciation_date, context=context) company_currency = line.asset_id.company_id.currency_id.id @@ -419,6 +417,8 @@ class account_asset_depreciation_line(osv.osv): }) self.write(cr, uid, line.id, {'move_id': move_id}, context=context) created_move_ids.append(move_id) + if currency_obj.is_zero(cr, uid, line.asset_id.currency_id, line.asset_id.value_residual): + can_close = True if can_close: asset_obj.write(cr, uid, [line.asset_id.id], {'state': 'close'}, context=context) return created_move_ids From b54a4164ce20782bab62523f262e6b7d0895af34 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 18 Sep 2012 18:51:41 +0200 Subject: [PATCH 024/963] [ADD]Project initialization bzr revid: dle@openerp.com-20120918165141-15gqir34wwa2lein --- addons/hr_fleet_management/__init.py__ | 1 + addons/hr_fleet_management/__openerp__.py | 17 +++++++++++++++++ .../hr_fleet_management/hr_fleet_management.py | 10 ++++++++++ .../view/hr_fleet_management_view.xml | 14 ++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 addons/hr_fleet_management/__init.py__ create mode 100644 addons/hr_fleet_management/__openerp__.py create mode 100644 addons/hr_fleet_management/hr_fleet_management.py create mode 100644 addons/hr_fleet_management/view/hr_fleet_management_view.xml diff --git a/addons/hr_fleet_management/__init.py__ b/addons/hr_fleet_management/__init.py__ new file mode 100644 index 00000000000..4fe53db08ca --- /dev/null +++ b/addons/hr_fleet_management/__init.py__ @@ -0,0 +1 @@ +import hr_fleet_management diff --git a/addons/hr_fleet_management/__openerp__.py b/addons/hr_fleet_management/__openerp__.py new file mode 100644 index 00000000000..c701d545707 --- /dev/null +++ b/addons/hr_fleet_management/__openerp__.py @@ -0,0 +1,17 @@ +{ + "name": "Fleet Management", + "version": "0.1", + "depends": ["base"], + "author": "Denis Ledoux", + "category": "Test", + "description": """ + Fleet management module for managing company vehicles: + - managing cars + - managing cars insurance + - remind insurance renewing + """, + 'data': [’hr_fleet_management_view.xml’], + 'demo': [], + 'installable': True, + 'auto_install': False, +} diff --git a/addons/hr_fleet_management/hr_fleet_management.py b/addons/hr_fleet_management/hr_fleet_management.py new file mode 100644 index 00000000000..fb6cda1da39 --- /dev/null +++ b/addons/hr_fleet_management/hr_fleet_management.py @@ -0,0 +1,10 @@ +from osv import osv, fields + +class Car (osv.Model): + + _name = ’hr_fleet_management.car’ + + _columns = { + ’name’ : fields.char(’Car name’, 128, required = True), + ’description’ : fields.text(’Description’), + } diff --git a/addons/hr_fleet_management/view/hr_fleet_management_view.xml b/addons/hr_fleet_management/view/hr_fleet_management_view.xml new file mode 100644 index 00000000000..95eb0c046ff --- /dev/null +++ b/addons/hr_fleet_management/view/hr_fleet_management_view.xml @@ -0,0 +1,14 @@ + + + + + + + Cars + car_fleet_management.car + form + tree,form + + + + From 6821ec7b869b9e96f6e1865fb616bca7f4f85989 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 19 Sep 2012 10:02:42 +0200 Subject: [PATCH 025/963] [FIX]Syntax Errors bzr revid: dle@openerp.com-20120919080242-cdwzf8n2r5z6r47j --- addons/hr_fleet_management/__openerp__.py | 14 +++++++------- .../view/hr_fleet_management_view.xml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/hr_fleet_management/__openerp__.py b/addons/hr_fleet_management/__openerp__.py index c701d545707..9e35814f5d4 100644 --- a/addons/hr_fleet_management/__openerp__.py +++ b/addons/hr_fleet_management/__openerp__.py @@ -1,16 +1,16 @@ { - "name": "Fleet Management", - "version": "0.1", - "depends": ["base"], - "author": "Denis Ledoux", - "category": "Test", - "description": """ + 'name': 'Fleet Management', + 'version': '0.1', + 'depends': ['base'], + 'author': 'OpenERP SA', + 'category': 'Test', + 'description': """ Fleet management module for managing company vehicles: - managing cars - managing cars insurance - remind insurance renewing """, - 'data': [’hr_fleet_management_view.xml’], + 'data': ['hr_fleet_management_view.xml'], 'demo': [], 'installable': True, 'auto_install': False, diff --git a/addons/hr_fleet_management/view/hr_fleet_management_view.xml b/addons/hr_fleet_management/view/hr_fleet_management_view.xml index 95eb0c046ff..963c339a1bb 100644 --- a/addons/hr_fleet_management/view/hr_fleet_management_view.xml +++ b/addons/hr_fleet_management/view/hr_fleet_management_view.xml @@ -9,6 +9,6 @@ form tree,form - + From e12222d2afa4acfb18a81c2a20a5125e5b0015f3 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 19 Sep 2012 11:02:51 +0200 Subject: [PATCH 026/963] [FIX]init.py name issue bzr revid: dle@openerp.com-20120919090251-1yr44930z25nfh5j --- addons/hr_fleet_management/{__init.py__ => __init__.py} | 0 addons/hr_fleet_management/__openerp__.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename addons/hr_fleet_management/{__init.py__ => __init__.py} (100%) diff --git a/addons/hr_fleet_management/__init.py__ b/addons/hr_fleet_management/__init__.py similarity index 100% rename from addons/hr_fleet_management/__init.py__ rename to addons/hr_fleet_management/__init__.py diff --git a/addons/hr_fleet_management/__openerp__.py b/addons/hr_fleet_management/__openerp__.py index 9e35814f5d4..a38e815e364 100644 --- a/addons/hr_fleet_management/__openerp__.py +++ b/addons/hr_fleet_management/__openerp__.py @@ -1,7 +1,7 @@ { 'name': 'Fleet Management', 'version': '0.1', - 'depends': ['base'], + 'depends': ['base','hr'], 'author': 'OpenERP SA', 'category': 'Test', 'description': """ From b659893dbcd707078b98754a94b412e10b3eb2d1 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 19 Sep 2012 11:26:30 +0200 Subject: [PATCH 027/963] [FIX]Encodage declared bzr revid: dle@openerp.com-20120919092630-jistvpazjete84fm --- addons/hr_fleet_management/__openerp__.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/addons/hr_fleet_management/__openerp__.py b/addons/hr_fleet_management/__openerp__.py index a38e815e364..1a3acb9b742 100644 --- a/addons/hr_fleet_management/__openerp__.py +++ b/addons/hr_fleet_management/__openerp__.py @@ -1,3 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 . +# +############################################################################## + { 'name': 'Fleet Management', 'version': '0.1', From acc87133f4a78686694dbe4344d8a5b1fe9fb595 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 19 Sep 2012 13:22:55 +0200 Subject: [PATCH 028/963] [FIX]XML Syntax Error bzr revid: dle@openerp.com-20120919112255-uyel7xe66ghj294k --- addons/hr_fleet_management/__init__.py | 2 ++ addons/hr_fleet_management/__openerp__.py | 2 +- .../hr_fleet_management.py | 18 ++++++++--- .../view/hr_fleet_management_view.xml | 32 +++++++++++++++---- 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/addons/hr_fleet_management/__init__.py b/addons/hr_fleet_management/__init__.py index 4fe53db08ca..4da53d5adab 100644 --- a/addons/hr_fleet_management/__init__.py +++ b/addons/hr_fleet_management/__init__.py @@ -1 +1,3 @@ +# -*- coding: utf-8 -*- + import hr_fleet_management diff --git a/addons/hr_fleet_management/__openerp__.py b/addons/hr_fleet_management/__openerp__.py index 1a3acb9b742..7823e967699 100644 --- a/addons/hr_fleet_management/__openerp__.py +++ b/addons/hr_fleet_management/__openerp__.py @@ -31,7 +31,7 @@ - managing cars insurance - remind insurance renewing """, - 'data': ['hr_fleet_management_view.xml'], + 'data': ['view/hr_fleet_management_view.xml'], 'demo': [], 'installable': True, 'auto_install': False, diff --git a/addons/hr_fleet_management/hr_fleet_management.py b/addons/hr_fleet_management/hr_fleet_management.py index fb6cda1da39..46efcdfd46e 100644 --- a/addons/hr_fleet_management/hr_fleet_management.py +++ b/addons/hr_fleet_management/hr_fleet_management.py @@ -1,10 +1,20 @@ +# -*- coding: utf-8 -*- from osv import osv, fields -class Car (osv.Model): +class fleet_vehicle_model (osv.Model): - _name = ’hr_fleet_management.car’ + _name = 'fleet.vehicle.model' + _description = '...' _columns = { - ’name’ : fields.char(’Car name’, 128, required = True), - ’description’ : fields.text(’Description’), + 'name' : fields.char('Car name', 128, required = True), + } + +class fleet_vehicle(osv.Model): + _name = 'fleet.vehicle' + _description = 'Fleet Vehicle' + + _columns = { + 'name' : fields.char('Name', size=32, required=True), + 'model_id' : fields.many2one('fleet.vehicle.model','Model', required=True), } diff --git a/addons/hr_fleet_management/view/hr_fleet_management_view.xml b/addons/hr_fleet_management/view/hr_fleet_management_view.xml index 963c339a1bb..9deb8786382 100644 --- a/addons/hr_fleet_management/view/hr_fleet_management_view.xml +++ b/addons/hr_fleet_management/view/hr_fleet_management_view.xml @@ -1,14 +1,34 @@ - - - - Cars - car_fleet_management.car + + + fleet.vehicle.model.form + fleet.vehicle.model + +
+ + +
+
+ + + fleet.vehicle.model.tree + fleet.vehicle.model + + + + + + + + Vehicle Model + fleet.vehicle.model form tree,form - + + +
From 3637d57127dd4cbdefd3f11d86d742f8a5c8fecb Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 19 Sep 2012 18:13:27 +0200 Subject: [PATCH 029/963] [ADD]Stephane classes and views bzr revid: dle@openerp.com-20120919161327-u72nqktzmowzdjg9 --- addons/hr_car/__init__.py | 2 + addons/hr_car/__openerp__.py | 18 ++++ addons/hr_car/hr_car.py | 76 +++++++++++++++++ addons/hr_car/hr_car_view.xml | 154 ++++++++++++++++++++++++++++++++++ 4 files changed, 250 insertions(+) create mode 100644 addons/hr_car/__init__.py create mode 100644 addons/hr_car/__openerp__.py create mode 100644 addons/hr_car/hr_car.py create mode 100644 addons/hr_car/hr_car_view.xml diff --git a/addons/hr_car/__init__.py b/addons/hr_car/__init__.py new file mode 100644 index 00000000000..ec344119076 --- /dev/null +++ b/addons/hr_car/__init__.py @@ -0,0 +1,2 @@ +# import the hr_car code +import hr_car \ No newline at end of file diff --git a/addons/hr_car/__openerp__.py b/addons/hr_car/__openerp__.py new file mode 100644 index 00000000000..f24d0efc758 --- /dev/null +++ b/addons/hr_car/__openerp__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +{ + 'name' : 'Car Management', + 'version' : '0.1', + 'depends' : [ + 'base', + 'hr', + ], + 'author' : 'OpenERP S.A.', + 'description' : """ + I'm a good module and I will handle the cars of your company ! + """, + 'installable' : True, + 'application' : True, + 'data' : [ + 'hr_car_view.xml', + ] +} \ No newline at end of file diff --git a/addons/hr_car/hr_car.py b/addons/hr_car/hr_car.py new file mode 100644 index 00000000000..74dcb123af1 --- /dev/null +++ b/addons/hr_car/hr_car.py @@ -0,0 +1,76 @@ +from osv import osv, fields + +class fleet_vehicle_model(osv.Model): + _name = 'fleet.vehicle.model' + _description = '...' + + _columns = { + 'name' : fields.char('Name', size=32, required=True), + } + +class fleet_vehicle(osv.Model): + _name = 'fleet.vehicle' + _description = 'Fleet Vehicle' + + _columns = { + 'name' : fields.char('Name', size=32, required=True), + 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True), + 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Logs'), + + 'next_repair_km' : fields.integer('Next Repair Km'), + 'message' : fields.char('Message', size=128, readonly=True), + } + + def on_change_model(self, cr, uid, ids, model_id, context=None): + # print "ids: %r" % (ids,) + # print "model_id: %r" % (model_id,) + # print "context: %r" % (context,) + # import logging + # logger = logging.getLogger('fleet.vehicle') + # logger.info('Hello') + + # import ipdb + # ipdb.set_trace() + + if not model_id: + return {} + + model = self.pool.get('fleet.vehicle.model').browse(cr, uid, model_id, context=context) + + print "model: %r" % (model.name,) + + return { + 'value' : { + 'message' : "You have selected this %s model" % (model.name,), + } + } + +class fleet_vehicle_log_type(osv.Model): + _name = 'fleet.vehicle.log.type' + + _columns = { + 'name' : fields.char('Name', size=32, required=True), + } + +class fleet_vehicle_log(osv.Model): + _name = 'fleet.vehicle.log' + + _columns = { + 'employee_id' : fields.many2one('hr.employee', 'Employee', required=True), + 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), + + 'create_date' : fields.datetime('Creation Date', readonly=True), + + 'description' : fields.text('Description'), + 'type' : fields.many2one('fleet.vehicle.log.type', 'Type', required=True), + + + } + +class hr_employee(osv.Model): + _inherit = 'hr.employee' + + _columns = { + 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), + 'log_ids' : fields.one2many('fleet.vehicle.log', 'employee_id', 'Logs'), + } \ No newline at end of file diff --git a/addons/hr_car/hr_car_view.xml b/addons/hr_car/hr_car_view.xml new file mode 100644 index 00000000000..eff345d7b90 --- /dev/null +++ b/addons/hr_car/hr_car_view.xml @@ -0,0 +1,154 @@ + + + + + fleet.vehicle.model.form + fleet.vehicle.model + +
+ + +
+
+ + fleet.vehicle.model.tree + fleet.vehicle.model + + + + + + + + + Vehicle Model + fleet.vehicle.model + form + tree,form + + + + + + + + fleet.vehicle.form + fleet.vehicle + +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + fleet.vehicle.tree + fleet.vehicle + + + + + + + + + + Vehicles + fleet.vehicle + form + tree,form + + + + + + + fleet.vehicle.log.form + fleet.vehicle.log + +
+ + + + + + + + + +
+
+
+ + + fleet.vehicle.log.tree + fleet.vehicle.log + + + + + + + + + + + + + Vehicle Logs + fleet.vehicle.log + form + tree,form + + + + + + + fleet.hr.employee.form + hr.employee + form + + + + + + + + + + + + + +
+
From a3c51b5e7ca72b00271c988f14d5d854f4ae0fdf Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 20 Sep 2012 10:26:38 +0200 Subject: [PATCH 030/963] [ADD][REM]Renaming of the folder module bzr revid: dle@openerp.com-20120920082638-3kfu4qt1ebh5ccub --- addons/{hr_car => fleet}/__init__.py | 0 addons/{hr_car => fleet}/__openerp__.py | 0 addons/{hr_car => fleet}/hr_car.py | 0 addons/{hr_car => fleet}/hr_car_view.xml | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename addons/{hr_car => fleet}/__init__.py (100%) rename addons/{hr_car => fleet}/__openerp__.py (100%) rename addons/{hr_car => fleet}/hr_car.py (100%) rename addons/{hr_car => fleet}/hr_car_view.xml (100%) diff --git a/addons/hr_car/__init__.py b/addons/fleet/__init__.py similarity index 100% rename from addons/hr_car/__init__.py rename to addons/fleet/__init__.py diff --git a/addons/hr_car/__openerp__.py b/addons/fleet/__openerp__.py similarity index 100% rename from addons/hr_car/__openerp__.py rename to addons/fleet/__openerp__.py diff --git a/addons/hr_car/hr_car.py b/addons/fleet/hr_car.py similarity index 100% rename from addons/hr_car/hr_car.py rename to addons/fleet/hr_car.py diff --git a/addons/hr_car/hr_car_view.xml b/addons/fleet/hr_car_view.xml similarity index 100% rename from addons/hr_car/hr_car_view.xml rename to addons/fleet/hr_car_view.xml From a491f75c5c2ab7d74095b51b3a9fb94a72886048 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 20 Sep 2012 11:08:46 +0200 Subject: [PATCH 031/963] rename files to match module name bzr revid: csn@openerp.com-20120920090846-obht1omarbvlt38o --- addons/fleet/__init__.py | 2 +- addons/fleet/__openerp__.py | 2 +- addons/fleet/{hr_car.py => fleet.py} | 0 addons/fleet/{hr_car_view.xml => fleet_view.xml} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename addons/fleet/{hr_car.py => fleet.py} (100%) rename addons/fleet/{hr_car_view.xml => fleet_view.xml} (100%) diff --git a/addons/fleet/__init__.py b/addons/fleet/__init__.py index ec344119076..a09fca549ce 100644 --- a/addons/fleet/__init__.py +++ b/addons/fleet/__init__.py @@ -1,2 +1,2 @@ # import the hr_car code -import hr_car \ No newline at end of file +import fleet \ No newline at end of file diff --git a/addons/fleet/__openerp__.py b/addons/fleet/__openerp__.py index f24d0efc758..4c144090af0 100644 --- a/addons/fleet/__openerp__.py +++ b/addons/fleet/__openerp__.py @@ -13,6 +13,6 @@ 'installable' : True, 'application' : True, 'data' : [ - 'hr_car_view.xml', + 'fleet_view.xml', ] } \ No newline at end of file diff --git a/addons/fleet/hr_car.py b/addons/fleet/fleet.py similarity index 100% rename from addons/fleet/hr_car.py rename to addons/fleet/fleet.py diff --git a/addons/fleet/hr_car_view.xml b/addons/fleet/fleet_view.xml similarity index 100% rename from addons/fleet/hr_car_view.xml rename to addons/fleet/fleet_view.xml From 2019d656e982cd28f7a60a4cbbcd74df0317500e Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 20 Sep 2012 13:52:04 +0200 Subject: [PATCH 032/963] add a submodel field to vehicule model bzr revid: csn@openerp.com-20120920115204-6ip6c3gvh84o6b14 --- addons/fleet/fleet.py | 1 + addons/fleet/fleet_view.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 74dcb123af1..e807bb82998 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -6,6 +6,7 @@ class fleet_vehicle_model(osv.Model): _columns = { 'name' : fields.char('Name', size=32, required=True), + 'submodel' : fields.char('Submodel',size=32,required=True), } class fleet_vehicle(osv.Model): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index eff345d7b90..cc41662459c 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -7,6 +7,7 @@
+ @@ -16,6 +17,7 @@ + From 460bed1f3a47d311b4d24f22c7591760ece8fb2b Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 20 Sep 2012 13:57:55 +0200 Subject: [PATCH 033/963] [ADD]Fields bzr revid: dle@openerp.com-20120920115755-l2ta12vdttcfu71t --- addons/fleet/fleet.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index e807bb82998..40ac85b501a 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -5,6 +5,8 @@ class fleet_vehicle_model(osv.Model): _description = '...' _columns = { + 'type' : fields.char('Type', size=32, required=True), + 'brand' : fields.char('Brand', size=32, required=True), 'name' : fields.char('Name', size=32, required=True), 'submodel' : fields.char('Submodel',size=32,required=True), } @@ -14,7 +16,8 @@ class fleet_vehicle(osv.Model): _description = 'Fleet Vehicle' _columns = { - 'name' : fields.char('Name', size=32, required=True), + 'registration' : fields.char('registration', size=32, required=True), + 'driver' : fields.many2one('fleet.vehicle', 'employee_id', required=False), 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True), 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Logs'), From 3fabc8ef5a777036c1074ad35d506925a9da24b8 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 20 Sep 2012 14:16:36 +0200 Subject: [PATCH 034/963] [ADD]Add vendor field in vehicle model bzr revid: dle@openerp.com-20120920121636-dhz39kuvtiw9rxuo --- addons/fleet/fleet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 40ac85b501a..439a938d2a9 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -8,7 +8,8 @@ class fleet_vehicle_model(osv.Model): 'type' : fields.char('Type', size=32, required=True), 'brand' : fields.char('Brand', size=32, required=True), 'name' : fields.char('Name', size=32, required=True), - 'submodel' : fields.char('Submodel',size=32,required=True), + 'make' : fields.char('Make',size=32,required=True), + 'vendors': fields.many2many('fleet.vehicle.model','fleet.vehicle.model.vendors','partner_id','Vendors'); } class fleet_vehicle(osv.Model): @@ -16,7 +17,7 @@ class fleet_vehicle(osv.Model): _description = 'Fleet Vehicle' _columns = { - 'registration' : fields.char('registration', size=32, required=True), + 'registration' : fields.char('Registration', size=32, required=True), 'driver' : fields.many2one('fleet.vehicle', 'employee_id', required=False), 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True), 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Logs'), From 2f35d71a26391c0596c3831e4188b58f852e5ceb Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 20 Sep 2012 14:24:35 +0200 Subject: [PATCH 035/963] [FIX]Rename errors bzr revid: dle@openerp.com-20120920122435-jwweq52c8f82eo9d --- addons/fleet/fleet.py | 2 +- addons/fleet/fleet_view.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 439a938d2a9..d003adb3447 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -9,7 +9,7 @@ class fleet_vehicle_model(osv.Model): 'brand' : fields.char('Brand', size=32, required=True), 'name' : fields.char('Name', size=32, required=True), 'make' : fields.char('Make',size=32,required=True), - 'vendors': fields.many2many('fleet.vehicle.model','fleet.vehicle.model.vendors','partner_id','Vendors'); + 'vendors': fields.many2many('fleet.vehicle.model','fleet_vehicle_model_vendors','partner_id','Vendors'), } class fleet_vehicle(osv.Model): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index cc41662459c..2b8fccb5659 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -7,7 +7,7 @@
- + @@ -17,7 +17,7 @@ - + @@ -40,7 +40,7 @@
- + @@ -69,7 +69,7 @@ fleet.vehicle - + From 2c03c650a1f78e254ce23f51679b649a7772fe7e Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 20 Sep 2012 14:49:37 +0200 Subject: [PATCH 036/963] [FIX]Many2many vendors arguments issue bzr revid: dle@openerp.com-20120920124937-npuspa3ge4oyn2eg --- addons/fleet/__openerp__.py | 2 +- addons/fleet/fleet.py | 2 +- addons/fleet/fleet_view.xml | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/fleet/__openerp__.py b/addons/fleet/__openerp__.py index 4c144090af0..34cc89514a9 100644 --- a/addons/fleet/__openerp__.py +++ b/addons/fleet/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- { - 'name' : 'Car Management', + 'name' : 'Fleet Management', 'version' : '0.1', 'depends' : [ 'base', diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index d003adb3447..771767c117d 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -9,7 +9,7 @@ class fleet_vehicle_model(osv.Model): 'brand' : fields.char('Brand', size=32, required=True), 'name' : fields.char('Name', size=32, required=True), 'make' : fields.char('Make',size=32,required=True), - 'vendors': fields.many2many('fleet.vehicle.model','fleet_vehicle_model_vendors','partner_id','Vendors'), + 'partner_id': fields.many2many('fleet.vehicle.model','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), } class fleet_vehicle(osv.Model): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 2b8fccb5659..823170356d7 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -6,8 +6,11 @@ fleet.vehicle.model + + + @@ -16,8 +19,11 @@ fleet.vehicle.model + + + From a476b48b94540ba82742977638ce3aaf1bc1446c Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 20 Sep 2012 14:56:21 +0200 Subject: [PATCH 037/963] [FIX]Many2many vendors wrong resource id fixed bzr revid: dle@openerp.com-20120920125621-uc6uqnksvayub0ei --- addons/fleet/fleet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 771767c117d..328814bd810 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -9,7 +9,7 @@ class fleet_vehicle_model(osv.Model): 'brand' : fields.char('Brand', size=32, required=True), 'name' : fields.char('Name', size=32, required=True), 'make' : fields.char('Make',size=32,required=True), - 'partner_id': fields.many2many('fleet.vehicle.model','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), + 'partner_id': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), } class fleet_vehicle(osv.Model): From d42f3d1627e6344b68113385c010a2e105f2ccba Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 20 Sep 2012 15:07:14 +0200 Subject: [PATCH 038/963] [ADD]Vehicle Type object bzr revid: dle@openerp.com-20120920130714-3ebx1yi23653vnty --- addons/fleet/fleet.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 328814bd810..ce30f82b611 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -1,11 +1,18 @@ from osv import osv, fields +class fleet_vehicle_model(osv.Model): + _name = 'fleet.vehicle.type' + _description = 'Type of the vehicle' + _columns = { + 'name' : fields.char('Name', size=32, required=True), + } + class fleet_vehicle_model(osv.Model): _name = 'fleet.vehicle.model' _description = '...' _columns = { - 'type' : fields.char('Type', size=32, required=True), + 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=True), 'brand' : fields.char('Brand', size=32, required=True), 'name' : fields.char('Name', size=32, required=True), 'make' : fields.char('Make',size=32,required=True), From 586914863f88e654662b8b5e1ba41d3258fdb2c7 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 20 Sep 2012 15:11:32 +0200 Subject: [PATCH 039/963] [MERGE]add object brand bzr revid: csn@openerp.com-20120920131132-i3eq3et5y3x0cyuk --- addons/fleet/fleet.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index ce30f82b611..a02e26aa64d 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -9,16 +9,23 @@ class fleet_vehicle_model(osv.Model): class fleet_vehicle_model(osv.Model): _name = 'fleet.vehicle.model' - _description = '...' + _description = '' _columns = { + 'brand' : fields.many2one('fleet.vehicle.model.brand', 'brand', required=True), 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=True), - 'brand' : fields.char('Brand', size=32, required=True), 'name' : fields.char('Name', size=32, required=True), 'make' : fields.char('Make',size=32,required=True), 'partner_id': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), } +class fleet_vehicle_model_brand(osv.Model): + _name = 'fleet.vehicle.model.brand' + _description = 'Brand model of the vehicle' + _columns = { + 'name' : fields.char('Brand Name',size=32, required=True), + } + class fleet_vehicle(osv.Model): _name = 'fleet.vehicle' _description = 'Fleet Vehicle' From 0b9d4cd9735044d65c441659b577db18b7ccbac0 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 20 Sep 2012 15:18:04 +0200 Subject: [PATCH 040/963] [add]add object for model name and model make bzr revid: csn@openerp.com-20120920131804-sieluxv9tnz8qlhp --- addons/fleet/fleet.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index a02e26aa64d..ffee441c858 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -12,10 +12,10 @@ class fleet_vehicle_model(osv.Model): _description = '' _columns = { - 'brand' : fields.many2one('fleet.vehicle.model.brand', 'brand', required=True), + 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True), 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=True), - 'name' : fields.char('Name', size=32, required=True), - 'make' : fields.char('Make',size=32,required=True), + 'name' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=True), + 'make' : fields.many2one('fleet.vehicle.model.make', 'Model make', required=True), 'partner_id': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), } @@ -26,6 +26,20 @@ class fleet_vehicle_model_brand(osv.Model): 'name' : fields.char('Brand Name',size=32, required=True), } +class fleet_vehicle_model_name(osv.Model): + _name = 'fleet.vehicle.model.name' + _description = 'Name model of the vehicle' + _columns = { + 'name' : fields.char('Name',size=32, required=True), + } + +class fleet_vehicle_model_make(osv.Model): + _name = 'fleet.vehicle.model.make' + _description = 'Make model of the vehicle' + _columns = { + 'name' : fields.char('Make',size=32, required=True), + } + class fleet_vehicle(osv.Model): _name = 'fleet.vehicle' _description = 'Fleet Vehicle' From ee0be8846b78ac2eaf3f757dafb8e90e1cbe720d Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 20 Sep 2012 15:48:53 +0200 Subject: [PATCH 041/963] [add]add some fields in vehicle object and associated view bzr revid: csn@openerp.com-20120920134853-tq1e7b58opf93a06 --- addons/fleet/fleet.py | 8 +++++++- addons/fleet/fleet_view.xml | 21 +++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index ffee441c858..b219c702636 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -45,10 +45,16 @@ class fleet_vehicle(osv.Model): _description = 'Fleet Vehicle' _columns = { - 'registration' : fields.char('Registration', size=32, required=True), + 'registration' : fields.char('Registration', size=32, required=False), + 'vin_sn' : fields.char('VIN SN', size=32, required=False), 'driver' : fields.many2one('fleet.vehicle', 'employee_id', required=False), 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True), 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Logs'), + 'acquisition_date' : fields.date('Acquisition date', required=False), + 'acquisition_price' : fields.integer('Price'), + 'color' : fields.char('Color',size=32), + 'status' : fields.char('Status',size=32), + 'location' : fields.char('Location',size=32), 'next_repair_km' : fields.integer('Next Repair Km'), 'message' : fields.char('Message', size=128, readonly=True), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 823170356d7..c46d8b4afa6 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -45,10 +45,21 @@
- - - - + + + + + + + + + + + + + + + @@ -77,6 +88,8 @@ + + From ea636eb033cc62516282fd73c4c431404e83d315 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 20 Sep 2012 17:21:21 +0200 Subject: [PATCH 042/963] [CHANGE]Correct some mistakes in an object name bzr revid: csn@openerp.com-20120920152121-24nlyjripej2v502 --- addons/fleet/fleet.py | 9 +++++---- addons/fleet/fleet_view.xml | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index b219c702636..51e4e92d874 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -1,6 +1,6 @@ from osv import osv, fields -class fleet_vehicle_model(osv.Model): +class fleet_vehicle_model_type(osv.Model): _name = 'fleet.vehicle.type' _description = 'Type of the vehicle' _columns = { @@ -9,12 +9,13 @@ class fleet_vehicle_model(osv.Model): class fleet_vehicle_model(osv.Model): _name = 'fleet.vehicle.model' - _description = '' + _description = 'Model of a vehicle' _columns = { + 'name' : fields.char('Name',size=32, required=True), 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True), 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=True), - 'name' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=True), + 'modelname' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=True), 'make' : fields.many2one('fleet.vehicle.model.make', 'Model make', required=True), 'partner_id': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), } @@ -47,7 +48,7 @@ class fleet_vehicle(osv.Model): _columns = { 'registration' : fields.char('Registration', size=32, required=False), 'vin_sn' : fields.char('VIN SN', size=32, required=False), - 'driver' : fields.many2one('fleet.vehicle', 'employee_id', required=False), + 'driver' : fields.many2one('hr.employee', 'Driver',required=False), 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True), 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Logs'), 'acquisition_date' : fields.date('Acquisition date', required=False), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index c46d8b4afa6..ec242704053 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -6,9 +6,10 @@ fleet.vehicle.model + - + @@ -19,9 +20,10 @@ fleet.vehicle.model + - + From 05172d18d73d9d425f6ef9d710589bad627dc549 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Fri, 21 Sep 2012 10:28:25 +0200 Subject: [PATCH 043/963] [ADD]Sheet style to view for models and new models fields bzr revid: dle@openerp.com-20120921082825-somoslhvu78fnafg --- addons/fleet/fleet.py | 6 ++++++ addons/fleet/fleet_view.xml | 38 ++++++++++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 51e4e92d874..c4d21777d30 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -18,6 +18,12 @@ class fleet_vehicle_model(osv.Model): 'modelname' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=True), 'make' : fields.many2one('fleet.vehicle.model.make', 'Model make', required=True), 'partner_id': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), + + 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), + 'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False), + 'horses' : fields.integer('Horses',required=False), + 'power' : fields.integer('Power',required=False,help='Power in kW of the vehicle'), + 'co2' : fields.float('CO2 Emissions',required=False,help='CO2 emissions of the vehicle'), } class fleet_vehicle_model_brand(osv.Model): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index ec242704053..81a4aa96138 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -5,13 +5,37 @@ fleet.vehicle.model.form fleet.vehicle.model -
- - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 7f581c3193720432e42b471c9f19a875ef88dcce Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Fri, 21 Sep 2012 10:33:26 +0200 Subject: [PATCH 044/963] [ADD]Year fields for vehicle model and renaming power (kW) label bzr revid: dle@openerp.com-20120921083326-eciail9u934t1o81 --- addons/fleet/fleet.py | 13 +++++++------ addons/fleet/fleet_view.xml | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index c4d21777d30..2c36eb86c92 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -12,17 +12,18 @@ class fleet_vehicle_model(osv.Model): _description = 'Model of a vehicle' _columns = { - 'name' : fields.char('Name',size=32, required=True), - 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True), - 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=True), - 'modelname' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=True), - 'make' : fields.many2one('fleet.vehicle.model.make', 'Model make', required=True), + 'name' : fields.char('Name',size=32, required=False), + 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=False), + 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=False), + 'modelname' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=False), + 'make' : fields.many2one('fleet.vehicle.model.make', 'Model make', required=False), + 'year' : fields.integer('Year', required=False), 'partner_id': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), 'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False), 'horses' : fields.integer('Horses',required=False), - 'power' : fields.integer('Power',required=False,help='Power in kW of the vehicle'), + 'power' : fields.integer('Power (kW)',required=False,help='Power in kW of the vehicle'), 'co2' : fields.float('CO2 Emissions',required=False,help='CO2 emissions of the vehicle'), } diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 81a4aa96138..f1a8ea81815 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -14,7 +14,8 @@
- + + From bf589e6a24b3ec2c9c3a0e83980149610431710c Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Fri, 21 Sep 2012 11:57:15 +0200 Subject: [PATCH 045/963] [ADD]Complete model name function bzr revid: dle@openerp.com-20120921095715-q3wl2w7wnemv0vc9 --- addons/fleet/fleet.py | 25 ++++++++++++++++++++++++- addons/fleet/fleet_view.xml | 1 - 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 2c36eb86c92..1ef220e9537 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -8,11 +8,34 @@ class fleet_vehicle_model_type(osv.Model): } class fleet_vehicle_model(osv.Model): + + def name_get(self, cr, uid, ids, context=None): + if not ids: + return [] + reads = self.read(cr, uid, ids, ['brand','modelname','make','year'], context=context) + res = [] + for record in reads: + name = '' + if record['modelname']: + name = name+ ' / ' +record['modelname'][1] + if record['modelname']: + name = name+ ' / ' +record['modelname'][1] + if record['make']: + name = name+ ' / ' +record['make'][1] + if record['year']: + name = name+ ' / ' +str(record['year']) + res.append((record['id'], name)) + return res + + def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): + res = self.name_get(cr, uid, ids, context=context) + return dict(res) + _name = 'fleet.vehicle.model' _description = 'Model of a vehicle' _columns = { - 'name' : fields.char('Name',size=32, required=False), + 'name' : fields.function(_name_get_fnc, type="char", string='Name'), 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=False), 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=False), 'modelname' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=False), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index f1a8ea81815..dcbc1ba39f9 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -45,7 +45,6 @@ fleet.vehicle.model - From 1ab5e7e100d16ecc0992839169ac02e056ef903c Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Fri, 21 Sep 2012 12:56:43 +0200 Subject: [PATCH 046/963] [CORRECT]correction of the name computation field in model object bzr revid: csn@openerp.com-20120921105643-j1hatbzx3odrqazo --- addons/fleet/fleet.py | 14 ++++++++------ addons/fleet/fleet_view.xml | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 1ef220e9537..7b602406882 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -6,18 +6,20 @@ class fleet_vehicle_model_type(osv.Model): _columns = { 'name' : fields.char('Name', size=32, required=True), } - +#comment to delete class fleet_vehicle_model(osv.Model): def name_get(self, cr, uid, ids, context=None): if not ids: return [] - reads = self.read(cr, uid, ids, ['brand','modelname','make','year'], context=context) + reads = self.read(cr, uid, ids, ['type','brand','modelname','make','year'], context=context) res = [] for record in reads: name = '' - if record['modelname']: - name = name+ ' / ' +record['modelname'][1] + if record['type']: + name = record['type'][1] + " - " + if record['brand']: + name = name + record['brand'][1] if record['modelname']: name = name+ ' / ' +record['modelname'][1] if record['make']: @@ -36,8 +38,8 @@ class fleet_vehicle_model(osv.Model): _columns = { 'name' : fields.function(_name_get_fnc, type="char", string='Name'), - 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=False), - 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=False), + 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True), + 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=True), 'modelname' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=False), 'make' : fields.many2one('fleet.vehicle.model.make', 'Model make', required=False), 'year' : fields.integer('Year', required=False), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index dcbc1ba39f9..d4043fa0628 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -197,5 +197,6 @@ --> + From 52c00df8d239f6a96b68a1dac86134d0036c6973 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Fri, 21 Sep 2012 13:20:51 +0200 Subject: [PATCH 047/963] [ADD]Add horsepower_tax field bzr revid: dle@openerp.com-20120921112051-qmv79v6v0r0eumuc --- addons/fleet/fleet.py | 4 +++- addons/fleet/fleet_view.xml | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 7b602406882..68408580155 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -47,7 +47,8 @@ class fleet_vehicle_model(osv.Model): 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), 'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False), - 'horses' : fields.integer('Horses',required=False), + 'horsepower' : fields.integer('Horsepower',required=False), + 'horsepower_tax': fields.float('Horsepower Taxation'), 'power' : fields.integer('Power (kW)',required=False,help='Power in kW of the vehicle'), 'co2' : fields.float('CO2 Emissions',required=False,help='CO2 emissions of the vehicle'), } @@ -71,6 +72,7 @@ class fleet_vehicle_model_make(osv.Model): _description = 'Make model of the vehicle' _columns = { 'name' : fields.char('Make',size=32, required=True), + 'country_id': fields.many2one('res.country', 'Country', required=False), } class fleet_vehicle(osv.Model): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index d4043fa0628..59e38bdc7fd 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -27,11 +27,12 @@ + - + + - From 185530153085c415879195b32a87353a9b03ba18 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Fri, 21 Sep 2012 13:32:28 +0200 Subject: [PATCH 048/963] [ADD]add help messages to each field and removed the message field in vehicle object bzr revid: csn@openerp.com-20120921113228-75qsgqfyenpzegll --- addons/fleet/fleet.py | 36 +++++++++++++++++++++--------------- addons/fleet/fleet_view.xml | 4 ++-- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 68408580155..a124eb969df 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -38,11 +38,11 @@ class fleet_vehicle_model(osv.Model): _columns = { 'name' : fields.function(_name_get_fnc, type="char", string='Name'), - 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True), - 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=True), - 'modelname' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=False), - 'make' : fields.many2one('fleet.vehicle.model.make', 'Model make', required=False), - 'year' : fields.integer('Year', required=False), + 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True, help='Brand of the vehicle'), + 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=True, help='Type of vehicle (car, bike, ...)'), + 'modelname' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=False, help='Model name of the vehicle'), + 'make' : fields.many2one('fleet.vehicle.model.make', 'Model make', required=False, help='Make of the vehicle'), + 'year' : fields.integer('Year', required=False, help='Year of fabrication of the vehicle'), 'partner_id': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), @@ -80,19 +80,25 @@ class fleet_vehicle(osv.Model): _description = 'Fleet Vehicle' _columns = { - 'registration' : fields.char('Registration', size=32, required=False), - 'vin_sn' : fields.char('VIN SN', size=32, required=False), - 'driver' : fields.many2one('hr.employee', 'Driver',required=False), - 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True), + 'registration' : fields.char('Registration', size=32, required=False, help='Registration number of the vehicle (ie: plate number for a car)'), + 'vin_sn' : fields.char('Chassis Number', size=32, required=False, help='Unique number written on the vehicle motor (VIN/SN number)'), + 'driver' : fields.many2one('hr.employee', 'Driver',required=False, help='Driver of the vehicle'), + 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True, help='Model of the vehicle'), 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Logs'), - 'acquisition_date' : fields.date('Acquisition date', required=False), - 'acquisition_price' : fields.integer('Price'), - 'color' : fields.char('Color',size=32), - 'status' : fields.char('Status',size=32), - 'location' : fields.char('Location',size=32), + 'acquisition_date' : fields.date('Acquisition date', required=False, help='Date when the vehicle has been bought'), + 'acquisition_price' : fields.integer('Price', help='Price of the bought vehicle'), + 'color' : fields.char('Color',size=32, help='Color of the vehicle'), + 'status' : fields.char('Status',size=32, help='Status of the vehicle (in repair, active, ...)'), + 'location' : fields.char('Location',size=32, help='Location of the vehicle (garage, ...)'), 'next_repair_km' : fields.integer('Next Repair Km'), - 'message' : fields.char('Message', size=128, readonly=True), + + 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), + 'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False), + 'horses' : fields.integer('Horses',required=False), + 'power' : fields.integer('Power (kW)',required=False,help='Power in kW of the vehicle'), + 'co2' : fields.float('CO2 Emissions',required=False,help='CO2 emissions of the vehicle'), + } def on_change_model(self, cr, uid, ids, model_id, context=None): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 59e38bdc7fd..c746a9e6b16 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -50,6 +50,7 @@ + @@ -76,9 +77,8 @@ - + - From 80b84053d9a14c6a2b6b6a1e863f0ea829db2626 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Fri, 21 Sep 2012 14:12:37 +0200 Subject: [PATCH 049/963] [ADD]view for configuration menu bzr revid: csn@openerp.com-20120921121237-dh09b3gh9c6b8is6 --- addons/fleet/fleet_view.xml | 76 ++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index c746a9e6b16..bce81274543 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -63,9 +63,83 @@ tree,form + + fleet.vehicle.type.tree + fleet.vehicle.type + + + + + + + + + Type of Vehicle + fleet.vehicle.type + form + tree,form + + + + + fleet.vehicle.model.brand.tree + fleet.vehicle.model.brand + + + + + + + + + Model brand of Vehicle + fleet.vehicle.model.brand + form + tree,form + + + + fleet.vehicle.model.name.tree + fleet.vehicle.model.name + + + + + + + + + Model name of Vehicle + fleet.vehicle.model.name + form + tree,form + + + + fleet.vehicle.model.make.tree + fleet.vehicle.model.make + + + + + + + + + Model make of Vehicle + fleet.vehicle.model.make + form + tree,form + + - + + + + + + fleet.vehicle.form From 73400dac7bd985444860c7759a1d92705f4cd212 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Fri, 21 Sep 2012 15:16:02 +0200 Subject: [PATCH 050/963] [IMP] Make term changed to version, and change of relationship between version and its model bzr revid: dle@openerp.com-20120921131602-5rtzewizms4c353j --- addons/fleet/fleet.py | 32 ++++++++-------- addons/fleet/fleet_view.xml | 73 ++++++++++++++++++++++++------------- 2 files changed, 64 insertions(+), 41 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index a124eb969df..4e2cb890d1d 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -12,7 +12,7 @@ class fleet_vehicle_model(osv.Model): def name_get(self, cr, uid, ids, context=None): if not ids: return [] - reads = self.read(cr, uid, ids, ['type','brand','modelname','make','year'], context=context) + reads = self.read(cr, uid, ids, ['type','brand','modelname','version','year'], context=context) res = [] for record in reads: name = '' @@ -22,8 +22,8 @@ class fleet_vehicle_model(osv.Model): name = name + record['brand'][1] if record['modelname']: name = name+ ' / ' +record['modelname'][1] - if record['make']: - name = name+ ' / ' +record['make'][1] + if record['version']: + name = name+ ' / ' +record['version'][1] if record['year']: name = name+ ' / ' +str(record['year']) res.append((record['id'], name)) @@ -41,16 +41,9 @@ class fleet_vehicle_model(osv.Model): 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True, help='Brand of the vehicle'), 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=True, help='Type of vehicle (car, bike, ...)'), 'modelname' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=False, help='Model name of the vehicle'), - 'make' : fields.many2one('fleet.vehicle.model.make', 'Model make', required=False, help='Make of the vehicle'), + 'version' : fields.one2many('fleet.vehicle.model.version', 'model_version_id', 'Versions'), 'year' : fields.integer('Year', required=False, help='Year of fabrication of the vehicle'), 'partner_id': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), - - 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), - 'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False), - 'horsepower' : fields.integer('Horsepower',required=False), - 'horsepower_tax': fields.float('Horsepower Taxation'), - 'power' : fields.integer('Power (kW)',required=False,help='Power in kW of the vehicle'), - 'co2' : fields.float('CO2 Emissions',required=False,help='CO2 emissions of the vehicle'), } class fleet_vehicle_model_brand(osv.Model): @@ -67,12 +60,19 @@ class fleet_vehicle_model_name(osv.Model): 'name' : fields.char('Name',size=32, required=True), } -class fleet_vehicle_model_make(osv.Model): - _name = 'fleet.vehicle.model.make' - _description = 'Make model of the vehicle' +class fleet_vehicle_model_version(osv.Model): + _name = 'fleet.vehicle.model.version' + _description = 'version model of the vehicle' _columns = { - 'name' : fields.char('Make',size=32, required=True), - 'country_id': fields.many2one('res.country', 'Country', required=False), + 'name' : fields.char('name',size=32, required=True), + 'model_version_id' : fields.many2one('fleet.vehicle.model', 'Associated model', required=True, help='Model name of the vehicle associated to this version'), + + 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), + 'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False), + 'horsepower' : fields.integer('Horsepower',required=False), + 'horsepower_tax': fields.float('Horsepower Taxation'), + 'power' : fields.integer('Power (kW)',required=False,help='Power in kW of the vehicle'), + 'co2' : fields.float('CO2 Emissions',required=False,help='CO2 emissions of the vehicle'), } class fleet_vehicle(osv.Model): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index bce81274543..53109f23336 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -13,29 +13,18 @@ - - + + + + - - - - - - - - - - - - - - +
@@ -49,7 +38,7 @@ - + @@ -115,19 +104,53 @@ tree,form - - fleet.vehicle.model.make.tree - fleet.vehicle.model.make + + fleet.vehicle.model.version.tree + fleet.vehicle.model.version - + + + - - Model make of Vehicle - fleet.vehicle.model.make + + fleet.vehicle.model.version.form + fleet.vehicle.model.version + +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + Model version of Vehicle + fleet.vehicle.model.version form tree,form @@ -139,7 +162,7 @@ - + fleet.vehicle.form From 0582e611407bd917d7ffceac92f1c3f52108d844 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Fri, 21 Sep 2012 16:34:15 +0200 Subject: [PATCH 051/963] [REM]Removing of models type, versions and engine. Too much complexity. bzr revid: dle@openerp.com-20120921143415-6fiuv49wanwhc75v --- addons/fleet/fleet.py | 59 ++--------------- addons/fleet/fleet_view.xml | 128 +++++++----------------------------- 2 files changed, 28 insertions(+), 159 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 4e2cb890d1d..5cb01797e48 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -9,41 +9,13 @@ class fleet_vehicle_model_type(osv.Model): #comment to delete class fleet_vehicle_model(osv.Model): - def name_get(self, cr, uid, ids, context=None): - if not ids: - return [] - reads = self.read(cr, uid, ids, ['type','brand','modelname','version','year'], context=context) - res = [] - for record in reads: - name = '' - if record['type']: - name = record['type'][1] + " - " - if record['brand']: - name = name + record['brand'][1] - if record['modelname']: - name = name+ ' / ' +record['modelname'][1] - if record['version']: - name = name+ ' / ' +record['version'][1] - if record['year']: - name = name+ ' / ' +str(record['year']) - res.append((record['id'], name)) - return res - - def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): - res = self.name_get(cr, uid, ids, context=context) - return dict(res) - _name = 'fleet.vehicle.model' _description = 'Model of a vehicle' _columns = { - 'name' : fields.function(_name_get_fnc, type="char", string='Name'), + 'name' : fields.char('Brand Name',size=32, required=True), 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True, help='Brand of the vehicle'), - 'type' : fields.many2one('fleet.vehicle.type', 'Vehicle Type', required=True, help='Type of vehicle (car, bike, ...)'), - 'modelname' : fields.many2one('fleet.vehicle.model.name', 'Model name', required=False, help='Model name of the vehicle'), - 'version' : fields.one2many('fleet.vehicle.model.version', 'model_version_id', 'Versions'), - 'year' : fields.integer('Year', required=False, help='Year of fabrication of the vehicle'), - 'partner_id': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), + 'vendors': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), } class fleet_vehicle_model_brand(osv.Model): @@ -53,28 +25,6 @@ class fleet_vehicle_model_brand(osv.Model): 'name' : fields.char('Brand Name',size=32, required=True), } -class fleet_vehicle_model_name(osv.Model): - _name = 'fleet.vehicle.model.name' - _description = 'Name model of the vehicle' - _columns = { - 'name' : fields.char('Name',size=32, required=True), - } - -class fleet_vehicle_model_version(osv.Model): - _name = 'fleet.vehicle.model.version' - _description = 'version model of the vehicle' - _columns = { - 'name' : fields.char('name',size=32, required=True), - 'model_version_id' : fields.many2one('fleet.vehicle.model', 'Associated model', required=True, help='Model name of the vehicle associated to this version'), - - 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), - 'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False), - 'horsepower' : fields.integer('Horsepower',required=False), - 'horsepower_tax': fields.float('Horsepower Taxation'), - 'power' : fields.integer('Power (kW)',required=False,help='Power in kW of the vehicle'), - 'co2' : fields.float('CO2 Emissions',required=False,help='CO2 emissions of the vehicle'), - } - class fleet_vehicle(osv.Model): _name = 'fleet.vehicle' _description = 'Fleet Vehicle' @@ -90,15 +40,16 @@ class fleet_vehicle(osv.Model): 'color' : fields.char('Color',size=32, help='Color of the vehicle'), 'status' : fields.char('Status',size=32, help='Status of the vehicle (in repair, active, ...)'), 'location' : fields.char('Location',size=32, help='Location of the vehicle (garage, ...)'), + 'doors' : fields.integer('Number of doors', help='Number of doors of the vehicle'), 'next_repair_km' : fields.integer('Next Repair Km'), 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), 'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False), - 'horses' : fields.integer('Horses',required=False), + 'horsepower' : fields.integer('Horsepower',required=False), + 'horsepower_tax': fields.float('Horsepower Taxation'), 'power' : fields.integer('Power (kW)',required=False,help='Power in kW of the vehicle'), 'co2' : fields.float('CO2 Emissions',required=False,help='CO2 emissions of the vehicle'), - } def on_change_model(self, cr, uid, ids, model_id, context=None): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 53109f23336..6e3a045cfab 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -9,22 +9,17 @@ - - + + - - + - - - - + - @@ -35,12 +30,9 @@ fleet.vehicle.model - + - - - - + @@ -51,25 +43,7 @@ form tree,form
- - - fleet.vehicle.type.tree - fleet.vehicle.type - - - - - - - - - Type of Vehicle - fleet.vehicle.type - form - tree,form - - - + fleet.vehicle.model.brand.tree fleet.vehicle.model.brand @@ -87,82 +61,11 @@ tree,form - - fleet.vehicle.model.name.tree - fleet.vehicle.model.name - - - - - - - - - Model name of Vehicle - fleet.vehicle.model.name - form - tree,form - - - - fleet.vehicle.model.version.tree - fleet.vehicle.model.version - - - - - - - - - - - fleet.vehicle.model.version.form - fleet.vehicle.model.version - -
- - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - Model version of Vehicle - fleet.vehicle.model.version - form - tree,form - - - - - fleet.vehicle.form @@ -176,9 +79,10 @@ + - + @@ -199,6 +103,20 @@ + + + + + + + + + + + + + +
From 059f36dd890f571e66e9abc9309ce59f00821fa0 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Fri, 21 Sep 2012 16:47:44 +0200 Subject: [PATCH 052/963] [FIX]correct bug when trying to create a new vehicle and add its log, remove the vehicle field bzr revid: csn@openerp.com-20120921144744-c9h5t2dq129rt3yr --- addons/fleet/fleet_view.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 6e3a045cfab..3b2f7a41923 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -101,6 +101,16 @@ +
+ + + + + + + + +
From 70b5da11839eb57d9006dd53e5a122805b10f614 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Fri, 21 Sep 2012 17:10:22 +0200 Subject: [PATCH 053/963] [ADD]add log object for fuel, insurance, services bzr revid: csn@openerp.com-20120921151022-yjp2vtpic6vl18kl --- addons/fleet/fleet.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 5cb01797e48..316d2e69733 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -98,6 +98,27 @@ class fleet_vehicle_log(osv.Model): } +class fleet_vehicle_log_fuel(osv.Model): + _inherit = 'fleet.vehicle.log' + _name = 'fleet.vehicle.log.fuel' + _columns = { + 'description' : fields.text('Description'), + } + +class fleet_vehicle_log_insurance(osv.Model): + _inherit = 'fleet.vehicle.log' + _name = 'fleet.vehicle.log.insurance' + _columns = { + 'description' : fields.text('Description'), + } + +class fleet_vehicle_log_services(osv.Model): + _inherit = 'fleet.vehicle.log' + _name = 'fleet.vehicle.log.services' + _columns = { + 'description' : fields.text('Description'), + } + class hr_employee(osv.Model): _inherit = 'hr.employee' From a4b56f7455bfdc7f44c8133368d62e8b29475468 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Fri, 21 Sep 2012 17:42:44 +0200 Subject: [PATCH 054/963] [ADD]Concatenate function to give Brand + model as complete name bzr revid: dle@openerp.com-20120921154244-g7hv96uljkfvyevz --- addons/fleet/fleet.py | 25 ++++++++++++++++++++++--- addons/fleet/fleet_view.xml | 5 ++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 316d2e69733..b95e4288c18 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -6,15 +6,34 @@ class fleet_vehicle_model_type(osv.Model): _columns = { 'name' : fields.char('Name', size=32, required=True), } -#comment to delete +#comment to delete#comment to delete class fleet_vehicle_model(osv.Model): + def name_get(self, cr, uid, ids, context=None): + if context is None: + context = {} + if not ids: + return [] + reads = self.browse(cr, uid, ids, context=context) + res = [] + for record in reads: + name = record.modelname + if record.brand: + name = record.brand.name+' / '+name + res.append((record.id, name)) + return res + + def _model_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): + res = self.name_get(cr, uid, ids, context=context) + return dict(res) + _name = 'fleet.vehicle.model' _description = 'Model of a vehicle' _columns = { - 'name' : fields.char('Brand Name',size=32, required=True), - 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True, help='Brand of the vehicle'), + 'name' : fields.function(_model_name_get_fnc, type="char", string='Name', store=True), + 'modelname' : fields.char('Model name', size=32, required=True), + 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=False, help='Brand of the vehicle'), 'vendors': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), } diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 3b2f7a41923..e54462c19ff 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -9,11 +9,10 @@ - - + - + From 45e76287a2a39e5f0b724e98a33d1a01ba179d87 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Mon, 24 Sep 2012 09:42:39 +0200 Subject: [PATCH 055/963] [ADD]add some fields for fuel logs and also create the form bzr revid: csn@openerp.com-20120924074239-862w7lqvkkafd48e --- addons/fleet/fleet.py | 5 ++++- addons/fleet/fleet_view.xml | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index b95e4288c18..78dae6c7b60 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -54,6 +54,7 @@ class fleet_vehicle(osv.Model): 'driver' : fields.many2one('hr.employee', 'Driver',required=False, help='Driver of the vehicle'), 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True, help='Model of the vehicle'), 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Logs'), + 'log_fuel' : fields.one2many('fleet.vehicle.log.fuel','vehicle_id', 'Fuel Logs'), 'acquisition_date' : fields.date('Acquisition date', required=False, help='Date when the vehicle has been bought'), 'acquisition_price' : fields.integer('Price', help='Price of the bought vehicle'), 'color' : fields.char('Color',size=32, help='Color of the vehicle'), @@ -109,7 +110,7 @@ class fleet_vehicle_log(osv.Model): 'employee_id' : fields.many2one('hr.employee', 'Employee', required=True), 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), - 'create_date' : fields.datetime('Creation Date', readonly=True), + 'create_date' : fields.datetime('Creation Date'), 'description' : fields.text('Description'), 'type' : fields.many2one('fleet.vehicle.log.type', 'Type', required=True), @@ -122,6 +123,8 @@ class fleet_vehicle_log_fuel(osv.Model): _name = 'fleet.vehicle.log.fuel' _columns = { 'description' : fields.text('Description'), + 'liter' : fields.integer('Liter'), + 'price_per_liter' : fields.float('Price per liter'), } class fleet_vehicle_log_insurance(osv.Model): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index e54462c19ff..2204e8b937f 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -92,6 +92,28 @@ + + + + + + + + +
+ + + + + + + + + + +
+
+
From 87673678ada0b4fd86ac1e1bda2a19e54f2f5467 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Mon, 24 Sep 2012 11:14:26 +0200 Subject: [PATCH 056/963] [RESOLVED]solved conflicts in log object and removed log type object bzr revid: csn@openerp.com-20120924091426-i57amm2p6t1fskc1 --- addons/fleet/fleet.py | 20 ++++++-------------- addons/fleet/fleet_view.xml | 2 ++ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index c2e233b12f7..e5e84550797 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -117,13 +117,6 @@ class fleet_vehicle(osv.Model): } } -class fleet_vehicle_log_type(osv.Model): - _name = 'fleet.vehicle.log.type' - - _columns = { - 'name' : fields.char('Name', size=32, required=True), - } - class fleet_vehicle_log(osv.Model): _name = 'fleet.vehicle.log' @@ -131,11 +124,12 @@ class fleet_vehicle_log(osv.Model): 'employee_id' : fields.many2one('hr.employee', 'Employee', required=True), 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), - 'create_date' : fields.datetime('Creation Date'), + 'create_date' : fields.date('Creation Date'), 'description' : fields.text('Description'), - 'type' : fields.char('Type', size=32, required=False), - } + 'type' : fields.char('Type',size=32), + } + _defaults = { 'type' : 'Log', } @@ -147,11 +141,9 @@ class fleet_vehicle_log_fuel(osv.Model): 'description' : fields.text('Description'), 'liter' : fields.integer('Liter'), 'price_per_liter' : fields.float('Price per liter'), - 'type' : fields.char('Type', size=32, required=False), - } - _defaults = { - 'type' : 'Fuel', + 'type' : fields.char('Type',size=32), } + _defaults = {'type': 'Refueling',} class fleet_vehicle_log_insurance(osv.Model): _inherit = 'fleet.vehicle.log' diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index c19d9760197..9c611c9cea8 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -97,6 +97,8 @@ + +
From c94b5016a57edf0cc8a9784a5372d67936d3cdca Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 24 Sep 2012 11:20:48 +0200 Subject: [PATCH 057/963] [ADD]Invoice link for fuel log bzr revid: dle@openerp.com-20120924092048-ux61kn6howa0yaoe --- addons/fleet/__openerp__.py | 1 + addons/fleet/fleet.py | 3 ++- addons/fleet/fleet_view.xml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/fleet/__openerp__.py b/addons/fleet/__openerp__.py index 34cc89514a9..b91071a575e 100644 --- a/addons/fleet/__openerp__.py +++ b/addons/fleet/__openerp__.py @@ -5,6 +5,7 @@ 'depends' : [ 'base', 'hr', + 'account', ], 'author' : 'OpenERP S.A.', 'description' : """ diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index e5e84550797..82702e5ca19 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -141,7 +141,8 @@ class fleet_vehicle_log_fuel(osv.Model): 'description' : fields.text('Description'), 'liter' : fields.integer('Liter'), 'price_per_liter' : fields.float('Price per liter'), - 'type' : fields.char('Type',size=32), + 'type' : fields.char('Type', size=32), + 'invoice' : fields.many2one('account.invoice', 'Invoice', required=False, help='Invoice of the refueling log'), } _defaults = {'type': 'Refueling',} diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 9c611c9cea8..2c2eda08eac 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -100,6 +100,7 @@ + @@ -109,6 +110,7 @@ + From 9d4d16263ecf8af81f92594473323c36e22bb26b Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 24 Sep 2012 12:17:20 +0200 Subject: [PATCH 058/963] [ADD] Amount field for fuel log, with get_price function and associated on_change bzr revid: dle@openerp.com-20120924101720-69eqj01p39irbj09 --- addons/fleet/fleet.py | 24 ++++++++++++++++++++++++ addons/fleet/fleet_view.xml | 6 ++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 82702e5ca19..5fcbd54f20a 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -135,12 +135,36 @@ class fleet_vehicle_log(osv.Model): } class fleet_vehicle_log_fuel(osv.Model): + _inherit = 'fleet.vehicle.log' + + def _get_price(self, cr, uid, ids, fields, args, context=None): + result = {} + for record in self.browse(cr, uid, ids, context=None): + res = record.liter * record.price_per_liter + result[record.id] = { + 'amount' : res, + } + return result + + def on_change_fuel(self, cr, uid, ids, liter, price_per_liter, context=None): + + print 'Amount : ' + str(liter * price_per_liter) + + return { + 'value' : { + 'amount' : liter * price_per_liter, + } + } + + + _name = 'fleet.vehicle.log.fuel' _columns = { 'description' : fields.text('Description'), 'liter' : fields.integer('Liter'), 'price_per_liter' : fields.float('Price per liter'), + 'amount': fields.function(_get_price, type='float', multi='fuel', string='Fuel Amount'), 'type' : fields.char('Type', size=32), 'invoice' : fields.many2one('account.invoice', 'Invoice', required=False, help='Invoice of the refueling log'), } diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 2c2eda08eac..85a0472f8c6 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -99,6 +99,7 @@ +
@@ -107,8 +108,9 @@ - - + + + From 5e30915ed2d3f5d728a4f4d23adc1307c30f1638 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 24 Sep 2012 13:57:39 +0200 Subject: [PATCH 059/963] [ADD]OpenChatter and replace account.invoice by a simple reference number bzr revid: dle@openerp.com-20120924115739-nbpo80ugq6w0dl32 --- addons/fleet/__openerp__.py | 1 - addons/fleet/fleet.py | 4 +++- addons/fleet/fleet_view.xml | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/fleet/__openerp__.py b/addons/fleet/__openerp__.py index b91071a575e..34cc89514a9 100644 --- a/addons/fleet/__openerp__.py +++ b/addons/fleet/__openerp__.py @@ -5,7 +5,6 @@ 'depends' : [ 'base', 'hr', - 'account', ], 'author' : 'OpenERP S.A.', 'description' : """ diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 5fcbd54f20a..162e2bada36 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -46,6 +46,8 @@ class fleet_vehicle_model_brand(osv.Model): class fleet_vehicle(osv.Model): + _inherit = 'mail.thread' + def name_get(self, cr, uid, ids, context=None): if context is None: context = {} @@ -166,7 +168,7 @@ class fleet_vehicle_log_fuel(osv.Model): 'price_per_liter' : fields.float('Price per liter'), 'amount': fields.function(_get_price, type='float', multi='fuel', string='Fuel Amount'), 'type' : fields.char('Type', size=32), - 'invoice' : fields.many2one('account.invoice', 'Invoice', required=False, help='Invoice of the refueling log'), + 'inv_ref' : fields.char('Invoice Ref.', size=32), } _defaults = {'type': 'Refueling',} diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 85a0472f8c6..f9b63fc4fbe 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -101,7 +101,7 @@ - +
@@ -112,7 +112,7 @@ - +
@@ -154,6 +154,10 @@
+
+ + +
From 3d2607669f964f0ab5b1acdf1a548061a3595e7d Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 24 Sep 2012 14:51:11 +0200 Subject: [PATCH 060/963] [ADD][FIX]Add services logs and fix relation between driver and his vehicles bzr revid: dle@openerp.com-20120924125111-7g3wheu0689pw4nv --- addons/fleet/fleet.py | 23 +++++++++++++++++++---- addons/fleet/fleet_view.xml | 30 +++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 162e2bada36..da3ecec63a7 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -78,6 +78,7 @@ class fleet_vehicle(osv.Model): 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True, help='Model of the vehicle'), 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Logs'), 'log_fuel' : fields.one2many('fleet.vehicle.log.fuel','vehicle_id', 'Fuel Logs'), + 'log_services' : fields.one2many('fleet.vehicle.log.services','vehicle_id', 'Services Logs'), 'acquisition_date' : fields.date('Acquisition date', required=False, help='Date when the vehicle has been bought'), 'acquisition_price' : fields.integer('Price', help='Price of the bought vehicle'), 'color' : fields.char('Color',size=32, help='Color of the vehicle'), @@ -85,8 +86,6 @@ class fleet_vehicle(osv.Model): 'location' : fields.char('Location',size=32, help='Location of the vehicle (garage, ...)'), 'doors' : fields.integer('Number of doors', help='Number of doors of the vehicle'), - 'next_repair_km' : fields.integer('Next Repair Km'), - 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), 'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False), 'horsepower' : fields.integer('Horsepower',required=False), @@ -179,17 +178,33 @@ class fleet_vehicle_log_insurance(osv.Model): 'description' : fields.text('Description'), } +class service_type(osv.Model): + _name = 'fleet.service.type' + _columns = { + 'name': fields.char('Name', required=True, translate=True), + } + class fleet_vehicle_log_services(osv.Model): + def _compute_complete_service(self, cr, uid, ids, field, arg, context=None): + return dict( + (record.id, " ".join(service.name for service in record.service_ids)) + for record in self.browse(cr, uid, ids, context=context) + ) _inherit = 'fleet.vehicle.log' _name = 'fleet.vehicle.log.services' _columns = { - 'description' : fields.text('Description'), + 'vehicle_id' :fields.many2one('fleet.vehicle', 'Vehicle', required=True), + 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), + 'amount' :fields.float('Amount', help="Total cost of the service"), + 'reference' :fields.char('Reference',size=128), + 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), + 'complete_service': fields.function(_compute_complete_service, type="char", string='Services completed'), } class hr_employee(osv.Model): _inherit = 'hr.employee' _columns = { - 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), + 'vehicle_id' : fields.one2many('fleet.vehicle','driver', 'Vehicle',type="char"), 'log_ids' : fields.one2many('fleet.vehicle.log', 'employee_id', 'Logs'), } \ No newline at end of file diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index f9b63fc4fbe..330c4b61d62 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -89,8 +89,31 @@ - - + + + + + + + + + + + +
+ + + + + + + + + + + +
+
@@ -169,6 +192,7 @@ + @@ -236,7 +260,7 @@ - + From a9d4bf30bb55acf889538ab715dba1c682d2d38a Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Mon, 24 Sep 2012 15:03:35 +0200 Subject: [PATCH 061/963] [MERGE]removed some conflicts in view bzr revid: csn@openerp.com-20120924130335-vvkhdz9jexcnsqrq --- addons/fleet/fleet_view.xml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 330c4b61d62..f758ce680b6 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -228,17 +228,21 @@ - fleet.vehicle.log.tree - fleet.vehicle.log - - - - - - - - - + + fleet.vehicle.log.tree + fleet.vehicle.log + + + + + + + + + + + + From 0efec5d0047773bbdf3be92cf5ef63a4f2ae50c3 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 24 Sep 2012 15:08:43 +0200 Subject: [PATCH 062/963] [REM]Complete services fields bzr revid: dle@openerp.com-20120924130843-tpnhes50q7rryg5l --- addons/fleet/fleet.py | 6 ------ addons/fleet/fleet_view.xml | 4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index da3ecec63a7..425c1d4db00 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -185,11 +185,6 @@ class service_type(osv.Model): } class fleet_vehicle_log_services(osv.Model): - def _compute_complete_service(self, cr, uid, ids, field, arg, context=None): - return dict( - (record.id, " ".join(service.name for service in record.service_ids)) - for record in self.browse(cr, uid, ids, context=context) - ) _inherit = 'fleet.vehicle.log' _name = 'fleet.vehicle.log.services' _columns = { @@ -198,7 +193,6 @@ class fleet_vehicle_log_services(osv.Model): 'amount' :fields.float('Amount', help="Total cost of the service"), 'reference' :fields.char('Reference',size=128), 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), - 'complete_service': fields.function(_compute_complete_service, type="char", string='Services completed'), } class hr_employee(osv.Model): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index f758ce680b6..c82e326587d 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -97,8 +97,7 @@ - - +
@@ -109,7 +108,6 @@ -
From c36fa305777ba408a0fb03a60ccd4ef8a858c939 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 24 Sep 2012 15:11:23 +0200 Subject: [PATCH 063/963] [FIX]services widget at wrong place bzr revid: dle@openerp.com-20120924131123-sfs73lkgb5ef7a3f --- addons/fleet/fleet_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index c82e326587d..fc63fd75f95 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -97,7 +97,7 @@ - +
@@ -107,7 +107,7 @@ - +
From 63f67de14ed658272aa366ea9f85afa36d5fcc97 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 24 Sep 2012 16:49:27 +0200 Subject: [PATCH 064/963] [ADD]demo file, + openchatter fixes bzr revid: dle@openerp.com-20120924144927-ukw5wbvpazj4a4ea --- addons/fleet/__openerp__.py | 1 + addons/fleet/demo.xml | 67 +++++++++++++++++++++++++++++++++++++ addons/fleet/fleet.py | 18 +++++++--- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 addons/fleet/demo.xml diff --git a/addons/fleet/__openerp__.py b/addons/fleet/__openerp__.py index 34cc89514a9..36294c4086b 100644 --- a/addons/fleet/__openerp__.py +++ b/addons/fleet/__openerp__.py @@ -6,6 +6,7 @@ 'base', 'hr', ], + 'demo': ['demo.xml'], 'author' : 'OpenERP S.A.', 'description' : """ I'm a good module and I will handle the cars of your company ! diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml new file mode 100644 index 00000000000..e2cb94a18aa --- /dev/null +++ b/addons/fleet/demo.xml @@ -0,0 +1,67 @@ + + + + + + Opel + + + + BMW + + + + Audi + + + + Mercedes + + + + Corsa + + + + + Astra + + + + + 1-ACK-205 + 5454541 + + Black + Grand-Rosiere + 5 + + + + + + 1-SYN-404 + 1337 + + Red + Grand-Rosiere + 5 + + + + + + Oil change + + + + + + + Services + 500.0 + + + + + diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 425c1d4db00..c3dffa41f0a 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -48,6 +48,12 @@ class fleet_vehicle(osv.Model): _inherit = 'mail.thread' + def create_send_note(self, cr, uid, ids, context=None): + for id in ids: + message = _("%s has been created.")% (self.case_get_note_msg_prefix(cr, uid, id, context=context)) + self.message_post(cr, uid, [id], body=message, context=context) + return True + def name_get(self, cr, uid, ids, context=None): if context is None: context = {} @@ -137,7 +143,9 @@ class fleet_vehicle_log(osv.Model): class fleet_vehicle_log_fuel(osv.Model): - _inherit = 'fleet.vehicle.log' + + _inherit = ['fleet.vehicle.log','mail.thread'] + def _get_price(self, cr, uid, ids, fields, args, context=None): result = {} @@ -185,15 +193,16 @@ class service_type(osv.Model): } class fleet_vehicle_log_services(osv.Model): - _inherit = 'fleet.vehicle.log' + _inherit = ['fleet.vehicle.log'] + _name = 'fleet.vehicle.log.services' _columns = { - 'vehicle_id' :fields.many2one('fleet.vehicle', 'Vehicle', required=True), 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), 'amount' :fields.float('Amount', help="Total cost of the service"), 'reference' :fields.char('Reference',size=128), 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), } + _defaults = {'type': 'Services'} class hr_employee(osv.Model): _inherit = 'hr.employee' @@ -201,4 +210,5 @@ class hr_employee(osv.Model): _columns = { 'vehicle_id' : fields.one2many('fleet.vehicle','driver', 'Vehicle',type="char"), 'log_ids' : fields.one2many('fleet.vehicle.log', 'employee_id', 'Logs'), - } \ No newline at end of file + } + From 4fe5d8c18da7f5047730a619e84885cbaa4d7a24 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Mon, 24 Sep 2012 17:29:37 +0200 Subject: [PATCH 065/963] [ADD]view for repair log and services log bzr revid: csn@openerp.com-20120924152937-xt6axiw64d47eky1 --- addons/fleet/fleet.py | 5 +- addons/fleet/fleet_view.xml | 91 ++++++++++++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 4 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index c3dffa41f0a..f30728c0043 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -170,10 +170,9 @@ class fleet_vehicle_log_fuel(osv.Model): _name = 'fleet.vehicle.log.fuel' _columns = { - 'description' : fields.text('Description'), 'liter' : fields.integer('Liter'), 'price_per_liter' : fields.float('Price per liter'), - 'amount': fields.function(_get_price, type='float', multi='fuel', string='Fuel Amount'), + 'amount': fields.function(_get_price, type='float', multi='fuel', string='Total Price'), 'type' : fields.char('Type', size=32), 'inv_ref' : fields.char('Invoice Ref.', size=32), } @@ -198,7 +197,7 @@ class fleet_vehicle_log_services(osv.Model): _name = 'fleet.vehicle.log.services' _columns = { 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), - 'amount' :fields.float('Amount', help="Total cost of the service"), + 'amount' :fields.float('Cost', help="Total cost of the service"), 'reference' :fields.char('Reference',size=128), 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), } diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index fc63fd75f95..d741a57e093 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -240,7 +240,6 @@
-
@@ -252,6 +251,96 @@ + + fleet.vehicle.log.fuel.form + fleet.vehicle.log.fuel + +
+ + + + + + + + + + + +
+
+
+ + + + fleet.vehicle.log.fuel.tree + fleet.vehicle.log.fuel + + + + + + + + + + + + + + + Vehicle Fuel Logs + fleet.vehicle.log.fuel + form + tree,form + + + + + + fleet.vehicle.log.services.form + fleet.vehicle.log.services + +
+ + + + + + + + + + + +
+
+
+ + + + fleet.vehicle.log.services.tree + fleet.vehicle.log.services + + + + + + + + + + + + + + Vehicle Services Logs + fleet.vehicle.log.services + form + tree,form + + + fleet.hr.employee.form From abc69034311024a38e565e84dd577f381b943067 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 24 Sep 2012 17:38:26 +0200 Subject: [PATCH 066/963] [ADD] Vehicle insurances fields bzr revid: dle@openerp.com-20120924153826-9wuc7f7e16e5q722 --- addons/fleet/fleet.py | 13 +++++++++++++ addons/fleet/fleet_view.xml | 31 ++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index f30728c0043..9b31120ebc6 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -85,6 +85,7 @@ class fleet_vehicle(osv.Model): 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Logs'), 'log_fuel' : fields.one2many('fleet.vehicle.log.fuel','vehicle_id', 'Fuel Logs'), 'log_services' : fields.one2many('fleet.vehicle.log.services','vehicle_id', 'Services Logs'), + 'log_insurances' : fields.one2many('fleet.vehicle.log.insurance','vehicle_id', 'Insurances'), 'acquisition_date' : fields.date('Acquisition date', required=False, help='Date when the vehicle has been bought'), 'acquisition_price' : fields.integer('Price', help='Price of the bought vehicle'), 'color' : fields.char('Color',size=32, help='Color of the vehicle'), @@ -178,12 +179,24 @@ class fleet_vehicle_log_fuel(osv.Model): } _defaults = {'type': 'Refueling',} +class fleet_insurance_type(osv.Model): + _name = 'fleet.insurance.type' + _columns = { + 'name': fields.char('Name', required=True, translate=True), + } + class fleet_vehicle_log_insurance(osv.Model): _inherit = 'fleet.vehicle.log' _name = 'fleet.vehicle.log.insurance' _columns = { + 'insurance_type' : fields.many2one('fleet.insurance.type', 'Type', required=False, help='Type of the insurance'), + 'start_date' : fields.date('Start date', required=False, help='Date when the coverage of the insurance begins'), + 'expiration_date' : fields.date('Expiration date', required=False, help='Date when the coverage of the insurance expirates'), + 'price' : fields.float('Price', help="Cost of the insurance for the specified period"), + 'insurer_id' :fields.many2one('res.partner', 'Insurer', domain="[('supplier','=',True)]"), 'description' : fields.text('Description'), } + _defaults = {'type': 'Insurance',} class service_type(osv.Model): _name = 'fleet.service.type' diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index d741a57e093..f5e94e519ce 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -89,6 +89,35 @@ + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+
+
@@ -99,7 +128,7 @@ -
+ From a4d644cd33fb3747064bcbaee5b780e13fb80be8 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 24 Sep 2012 17:58:24 +0200 Subject: [PATCH 067/963] [IMP]Logs views improvement, various logs concatened in one view. Add demo data for fuel logs bzr revid: dle@openerp.com-20120924155824-v78fhhjfwm07oa27 --- addons/fleet/demo.xml | 9 +++ addons/fleet/fleet.py | 5 +- addons/fleet/fleet_view.xml | 137 ++++++++++++++++++------------------ 3 files changed, 80 insertions(+), 71 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index e2cb94a18aa..2e8f3f02b48 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -63,5 +63,14 @@ + + + + + Fuel + 40.0 + 1.45 + + diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 9b31120ebc6..c17fc0a1fcd 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -82,7 +82,7 @@ class fleet_vehicle(osv.Model): 'vin_sn' : fields.char('Chassis Number', size=32, required=False, help='Unique number written on the vehicle motor (VIN/SN number)'), 'driver' : fields.many2one('hr.employee', 'Driver',required=False, help='Driver of the vehicle'), 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True, help='Model of the vehicle'), - 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Logs'), + 'log_ids' : fields.one2many('fleet.vehicle.log', 'vehicle_id', 'Other Logs'), 'log_fuel' : fields.one2many('fleet.vehicle.log.fuel','vehicle_id', 'Fuel Logs'), 'log_services' : fields.one2many('fleet.vehicle.log.services','vehicle_id', 'Services Logs'), 'log_insurances' : fields.one2many('fleet.vehicle.log.insurance','vehicle_id', 'Insurances'), @@ -171,10 +171,9 @@ class fleet_vehicle_log_fuel(osv.Model): _name = 'fleet.vehicle.log.fuel' _columns = { - 'liter' : fields.integer('Liter'), + 'liter' : fields.float('Liter'), 'price_per_liter' : fields.float('Price per liter'), 'amount': fields.function(_get_price, type='float', multi='fuel', string='Total Price'), - 'type' : fields.char('Type', size=32), 'inv_ref' : fields.char('Invoice Ref.', size=32), } _defaults = {'type': 'Refueling',} diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index f5e94e519ce..9955e931112 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -118,75 +118,76 @@
- - - - - - - - - - -
- - - - - - - - - - -
-
-
- - - - - - - - - - - -
- - - - - - - - - - - -
-
-
- - - - - - - -
- - - - - - - - -
-
+ + + + + + + + + + +
+ + + + + + + + + + +
+
+
+ + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + +
+
+
From 33de7c58320735d0ee79428188fe5ccd61fb7373 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 25 Sep 2012 09:47:20 +0200 Subject: [PATCH 068/963] [FIX]bug getname when brand deleted bzr revid: dle@openerp.com-20120925074720-fosudvzez8lanhul --- addons/fleet/fleet.py | 8 +++++--- addons/fleet/fleet_view.xml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index c17fc0a1fcd..d4c6607d2e1 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -18,7 +18,7 @@ class fleet_vehicle_model(osv.Model): res = [] for record in reads: name = record.modelname - if record.brand: + if record.brand.name: name = record.brand.name+' / '+name res.append((record.id, name)) return res @@ -64,8 +64,10 @@ class fleet_vehicle(osv.Model): for record in reads: if record.registration: name = record.registration - if record.model_id: - name = record.model_id.brand.name+' / '+record.model_id.modelname + ' / ' + name + if record.model_id.modelname: + name = record.model_id.modelname + ' / ' + name + if record.model_id.brand.name: + name = record.model_id.brand.name+' / '+ name res.append((record.id, name)) return res diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 9955e931112..0ee708ca38e 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -29,8 +29,8 @@ fleet.vehicle.model - + From 3fdd614cc8256c623f35ef57d5aaeaf270d68a43 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 25 Sep 2012 10:35:00 +0200 Subject: [PATCH 069/963] [UPDATE]changes create_date fields in log by creation_date to remove a warning - create_date is a reserved fields bzr revid: csn@openerp.com-20120925083500-lihupfbu5y9ycq7b --- addons/fleet/demo.xml | 4 ++-- addons/fleet/fleet.py | 17 +++++++++++++---- addons/fleet/fleet_view.xml | 26 +++++++++++++------------- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 2e8f3f02b48..e7377705447 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -57,7 +57,7 @@ - + Services 500.0 @@ -66,7 +66,7 @@ - + Fuel 40.0 1.45 diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index d4c6607d2e1..9826b08e792 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -131,16 +131,18 @@ class fleet_vehicle_log(osv.Model): _name = 'fleet.vehicle.log' _columns = { + 'name' : fields.char('Log',size=32), 'employee_id' : fields.many2one('hr.employee', 'Employee', required=True), 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), - 'create_date' : fields.date('Creation Date'), + 'date_creation' : fields.date('Creation Date'), 'description' : fields.text('Description'), 'type' : fields.char('Type',size=32), } _defaults = { + 'name' : 'Log', 'type' : 'Log', } @@ -178,7 +180,10 @@ class fleet_vehicle_log_fuel(osv.Model): 'amount': fields.function(_get_price, type='float', multi='fuel', string='Total Price'), 'inv_ref' : fields.char('Invoice Ref.', size=32), } - _defaults = {'type': 'Refueling',} + _defaults = { + 'name': 'Fuel log', + 'type': 'Refueling', + } class fleet_insurance_type(osv.Model): _name = 'fleet.insurance.type' @@ -197,7 +202,9 @@ class fleet_vehicle_log_insurance(osv.Model): 'insurer_id' :fields.many2one('res.partner', 'Insurer', domain="[('supplier','=',True)]"), 'description' : fields.text('Description'), } - _defaults = {'type': 'Insurance',} + _defaults = { + 'name': 'Insurance log', + 'type': 'Insurance',} class service_type(osv.Model): _name = 'fleet.service.type' @@ -215,7 +222,9 @@ class fleet_vehicle_log_services(osv.Model): 'reference' :fields.char('Reference',size=128), 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), } - _defaults = {'type': 'Services'} + _defaults = { + 'name': 'Service log', + 'type': 'Services'} class hr_employee(osv.Model): _inherit = 'hr.employee' diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 0ee708ca38e..0ded1d69d71 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -109,7 +109,7 @@ - + @@ -127,12 +127,12 @@ - +
- + @@ -151,12 +151,12 @@ - + - + @@ -174,13 +174,13 @@ - + - + @@ -245,7 +245,7 @@ - + @@ -263,7 +263,7 @@ - + @@ -288,7 +288,7 @@ - + @@ -307,7 +307,7 @@ fleet.vehicle.log.fuel - + @@ -334,7 +334,7 @@ - + @@ -353,7 +353,7 @@ fleet.vehicle.log.services - + From 10cd8374b83b445124de5a70becf2a95d4c10a82 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 25 Sep 2012 10:40:05 +0200 Subject: [PATCH 070/963] [FIX]Fuel price computation bzr revid: dle@openerp.com-20120925084005-b037jpy4xg6d0ev6 --- addons/fleet/fleet.py | 50 +++++++++++++++++++++++++------------ addons/fleet/fleet_view.xml | 18 ++++++++----- 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 9826b08e792..3ed8c426581 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -151,33 +151,51 @@ class fleet_vehicle_log_fuel(osv.Model): _inherit = ['fleet.vehicle.log','mail.thread'] + def on_change_liter(self, cr, uid, ids, liter, price_per_liter, amount, context=None): - def _get_price(self, cr, uid, ids, fields, args, context=None): - result = {} - for record in self.browse(cr, uid, ids, context=None): - res = record.liter * record.price_per_liter - result[record.id] = { - 'amount' : res, - } - return result + print 'Debug :' + str(liter) + ' | ' + str(price_per_liter) + ' | ' + str(amount) - def on_change_fuel(self, cr, uid, ids, liter, price_per_liter, context=None): + if liter > 0 and price_per_liter > 0: + return {'value' : {'liter': liter,'price_per_liter': price_per_liter, 'amount' : liter * price_per_liter,}} + elif liter > 0 and amount > 0: + return {'value' : {'liter' : liter, 'amount' : amount, 'price_per_liter' : float(amount / liter),}} + elif price_per_liter > 0 and amount > 0: + return {'value' : {'price_per_liter' : price_per_liter, 'amount' : amount, 'liter' : float(amount / price_per_liter),}} + else : + return {} - print 'Amount : ' + str(liter * price_per_liter) + def on_change_price_per_liter(self, cr, uid, ids, liter, price_per_liter, amount, context=None): - return { - 'value' : { - 'amount' : liter * price_per_liter, - } - } + print 'Debug :' + str(liter) + ' | ' + str(price_per_liter) + ' | ' + str(amount) + if price_per_liter > 0 and liter > 0: + return {'value' : {'liter' : liter, 'price_per_liter' : price_per_liter, 'amount' : liter * price_per_liter,}} + elif price_per_liter > 0 and amount > 0: + return {'value' : {'price_per_liter' : price_per_liter, 'amount' : amount, 'liter' : float(amount / price_per_liter),}} + elif liter > 0 and amount > 0: + return {'value' : {'liter' : liter, 'amount' : amount, 'price_per_liter' : float(amount / liter),}} + else : + return {} + + def on_change_amount(self, cr, uid, ids, liter, price_per_liter, amount, context=None): + + print 'Debug :' + str(liter) + ' | ' + str(price_per_liter) + ' | ' + str(amount) + + if amount > 0 and liter > 0: + return {'value' : {'liter' : liter, 'amount' : amount, 'price_per_liter' : float(amount / liter),}} + elif amount > 0 and price_per_liter > 0: + return {'value' : {'price_per_liter' : price_per_liter, 'amount' : amount, 'liter' : float(amount / price_per_liter),}} + elif liter > 0 and price_per_liter > 0: + return {'value' : {'liter' : liter, 'price_per_liter' : price_per_liter, 'amount' : liter * price_per_liter,}} + else : + return {} _name = 'fleet.vehicle.log.fuel' _columns = { 'liter' : fields.float('Liter'), 'price_per_liter' : fields.float('Price per liter'), - 'amount': fields.function(_get_price, type='float', multi='fuel', string='Total Price'), + 'amount': fields.float('Total price'), 'inv_ref' : fields.char('Invoice Ref.', size=32), } _defaults = { diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 0ded1d69d71..0164037a6e0 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -155,14 +155,20 @@ + + + + + + + + + + + + - - - - - - From 6733a3f8ec26f359bbc2b9bb25419c6e647282bf Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Tue, 25 Sep 2012 11:11:26 +0200 Subject: [PATCH 071/963] test academy bzr revid: api@openerp.com-20120925091126-zdthas0x2exi1bep --- addons/openacademy/__init__.py | 1 + addons/openacademy/__openerp__.py | 16 +++++++ addons/openacademy/openacademy.py | 30 ++++++++++++ addons/openacademy/openacademy_view.xml | 33 +++++++++++++ addons/openacademy/temporary.py | 64 +++++++++++++++++++++++++ 5 files changed, 144 insertions(+) create mode 100644 addons/openacademy/__init__.py create mode 100644 addons/openacademy/__openerp__.py create mode 100644 addons/openacademy/openacademy.py create mode 100644 addons/openacademy/openacademy_view.xml create mode 100644 addons/openacademy/temporary.py diff --git a/addons/openacademy/__init__.py b/addons/openacademy/__init__.py new file mode 100644 index 00000000000..de12070d44b --- /dev/null +++ b/addons/openacademy/__init__.py @@ -0,0 +1 @@ +import openacademy \ No newline at end of file diff --git a/addons/openacademy/__openerp__.py b/addons/openacademy/__openerp__.py new file mode 100644 index 00000000000..9514efb6df0 --- /dev/null +++ b/addons/openacademy/__openerp__.py @@ -0,0 +1,16 @@ +{ + 'name': 'Open Academy', + 'version': '1.0', + 'depends': ['base'], + 'author': 'Arnaud_Pineux', + 'category': 'Test', + 'description': """ + Open Academy module for managing trainings: + - training courses + - training sessions + - attendees registration """, + 'data': ['openacademy_view.xml'], + 'demo': [], + 'installable': True, + 'application' : True, +} diff --git a/addons/openacademy/openacademy.py b/addons/openacademy/openacademy.py new file mode 100644 index 00000000000..b134ee5b45d --- /dev/null +++ b/addons/openacademy/openacademy.py @@ -0,0 +1,30 @@ +from openerp.osv import osv, fields + +class Course (osv.Model): + _name = "openacademy.course" + _description = "OpenAcademy course" + _column = { + 'name': fields.char('Course Title',size=128,required=True), + 'description': fields.text('Description'), + 'responsible_id': fields.many2one('res.users',string='responsible',ondelete='set null'), + 'session_ids': fields.one2many('openacademy.session','course_id','Session'), + } +class Session(osv.Model): + _name = 'openacademy.session' + _description = "OpenAcademy session" + _columns = { + 'name': fields.char('Session Title', size=128, required=True), + 'start_date': fields.date('Start Date'), + 'duration': fields.float('Duration', digits=(6,2), help="Duration in days"), + 'seats': fields.integer('Number of seats'), + 'instructor_id': fields.many2one('res.partner','Intructor'), + 'course_id': fields.many2one('openacademy.course','course',required=True,ondelete='cascade'), + 'attendee_ids': fields.one2many('openacademy.attendee','session_id','Attendees'), + } +class Attendee(osv.Model): + _name = 'openacademy.attendee' + _description = "OpenAcademy Attendee" + _columns = { + 'partner_id': fields.many2one('res.partner','Partner',required=True,ondelete='cascade'), + 'session_id': fields.many2one('openacademy.session','Session',required=True,ondelete='cascade'), + } \ No newline at end of file diff --git a/addons/openacademy/openacademy_view.xml b/addons/openacademy/openacademy_view.xml new file mode 100644 index 00000000000..e694788aa69 --- /dev/null +++ b/addons/openacademy/openacademy_view.xml @@ -0,0 +1,33 @@ + + + + + Courses + openacademy.course + form + tree,form + + + + openacadamy.course.tree + openacademy.course + + + + + + + + + + Sessions + openacademy.session + form + tree,form + + + + + + + \ No newline at end of file diff --git a/addons/openacademy/temporary.py b/addons/openacademy/temporary.py new file mode 100644 index 00000000000..86e482a33e5 --- /dev/null +++ b/addons/openacademy/temporary.py @@ -0,0 +1,64 @@ + + + course.form + openacademy.course + form + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + session.tree + openacademy.session + tree + + + + + + + + + + session.form + openacademy.session + form + +
+ + + + + + + + + + + + + +
+
\ No newline at end of file From 9d2dfd6d2e75954d4e4ffe0c3ac2e8ae1bea3d61 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 25 Sep 2012 11:20:22 +0200 Subject: [PATCH 072/963] [FIX]Fuel price computation bugs, missing float casts bzr revid: dle@openerp.com-20120925092022-vpwh5likl1ul37qm --- addons/fleet/fleet.py | 28 +++++++++++++--------------- addons/fleet/fleet_view.xml | 2 ++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 3ed8c426581..087efc67002 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -153,40 +153,37 @@ class fleet_vehicle_log_fuel(osv.Model): def on_change_liter(self, cr, uid, ids, liter, price_per_liter, amount, context=None): - print 'Debug :' + str(liter) + ' | ' + str(price_per_liter) + ' | ' + str(amount) - if liter > 0 and price_per_liter > 0: - return {'value' : {'liter': liter,'price_per_liter': price_per_liter, 'amount' : liter * price_per_liter,}} + return {'value' : {'amount' : float(liter) * float(price_per_liter),}} elif liter > 0 and amount > 0: - return {'value' : {'liter' : liter, 'amount' : amount, 'price_per_liter' : float(amount / liter),}} + return {'value' : {'price_per_liter' : float(amount) / float(liter),}} elif price_per_liter > 0 and amount > 0: - return {'value' : {'price_per_liter' : price_per_liter, 'amount' : amount, 'liter' : float(amount / price_per_liter),}} + return {'value' : {'liter' : float(amount) / float(price_per_liter),}} else : return {} def on_change_price_per_liter(self, cr, uid, ids, liter, price_per_liter, amount, context=None): - print 'Debug :' + str(liter) + ' | ' + str(price_per_liter) + ' | ' + str(amount) - + liter = float(liter); + price_per_liter = float(price_per_liter); if price_per_liter > 0 and liter > 0: - return {'value' : {'liter' : liter, 'price_per_liter' : price_per_liter, 'amount' : liter * price_per_liter,}} + print 'Debug :' + str(liter) + ' | ' + str(price_per_liter) + ' | ' + str(amount) + return {'value' : {'amount' : float(liter) * float(price_per_liter),}} elif price_per_liter > 0 and amount > 0: - return {'value' : {'price_per_liter' : price_per_liter, 'amount' : amount, 'liter' : float(amount / price_per_liter),}} + return {'value' : {'liter' : float(amount) / float(price_per_liter),}} elif liter > 0 and amount > 0: - return {'value' : {'liter' : liter, 'amount' : amount, 'price_per_liter' : float(amount / liter),}} + return {'value' : {'price_per_liter' : float(amount) / float(liter),}} else : return {} def on_change_amount(self, cr, uid, ids, liter, price_per_liter, amount, context=None): - print 'Debug :' + str(liter) + ' | ' + str(price_per_liter) + ' | ' + str(amount) - if amount > 0 and liter > 0: - return {'value' : {'liter' : liter, 'amount' : amount, 'price_per_liter' : float(amount / liter),}} + return {'value' : {'price_per_liter' : float(amount) / float(liter),}} elif amount > 0 and price_per_liter > 0: - return {'value' : {'price_per_liter' : price_per_liter, 'amount' : amount, 'liter' : float(amount / price_per_liter),}} + return {'value' : {'liter' : float(amount) / float(price_per_liter),}} elif liter > 0 and price_per_liter > 0: - return {'value' : {'liter' : liter, 'price_per_liter' : price_per_liter, 'amount' : liter * price_per_liter,}} + return {'value' : {'amount' : float(liter) * float(price_per_liter),}} else : return {} @@ -197,6 +194,7 @@ class fleet_vehicle_log_fuel(osv.Model): 'price_per_liter' : fields.float('Price per liter'), 'amount': fields.float('Total price'), 'inv_ref' : fields.char('Invoice Ref.', size=32), + 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), } _defaults = { 'name': 'Fuel log', diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 0164037a6e0..7d0c6f737f7 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -150,6 +150,7 @@ +
@@ -165,6 +166,7 @@ +
From 81f5b7c64b45d020d82a04d38d571d35e5f97eff Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 25 Sep 2012 12:40:57 +0200 Subject: [PATCH 073/963] [FIX]Odometer logs bzr revid: dle@openerp.com-20120925104057-ztuns0n60pycg64z --- addons/fleet/fleet.py | 29 +++++++++++++++++++- addons/fleet/fleet_view.xml | 53 +++++++++++++++++++++++++++---------- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 087efc67002..6bc74d40191 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -88,6 +88,7 @@ class fleet_vehicle(osv.Model): 'log_fuel' : fields.one2many('fleet.vehicle.log.fuel','vehicle_id', 'Fuel Logs'), 'log_services' : fields.one2many('fleet.vehicle.log.services','vehicle_id', 'Services Logs'), 'log_insurances' : fields.one2many('fleet.vehicle.log.insurance','vehicle_id', 'Insurances'), + 'log_odometer' : fields.one2many('fleet.vehicle.log.odometer','vehicle_id', 'Odometer'), 'acquisition_date' : fields.date('Acquisition date', required=False, help='Date when the vehicle has been bought'), 'acquisition_price' : fields.integer('Price', help='Price of the bought vehicle'), 'color' : fields.char('Color',size=32, help='Color of the vehicle'), @@ -195,6 +196,7 @@ class fleet_vehicle_log_fuel(osv.Model): 'amount': fields.float('Total price'), 'inv_ref' : fields.char('Invoice Ref.', size=32), 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), + 'log_odometer_id' :fields.many2one('fleet.vehicle.log.odometer', 'Odometer Log'), } _defaults = { 'name': 'Fuel log', @@ -222,7 +224,7 @@ class fleet_vehicle_log_insurance(osv.Model): 'name': 'Insurance log', 'type': 'Insurance',} -class service_type(osv.Model): +class fleet_service_type(osv.Model): _name = 'fleet.service.type' _columns = { 'name': fields.char('Name', required=True, translate=True), @@ -242,6 +244,31 @@ class fleet_vehicle_log_services(osv.Model): 'name': 'Service log', 'type': 'Services'} +class fleet_vehicle_log_services(osv.Model): + _inherit = ['fleet.vehicle.log'] + + _name = 'fleet.vehicle.log.services' + _columns = { + 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), + 'amount' :fields.float('Cost', help="Total cost of the service"), + 'reference' :fields.char('Reference',size=128), + 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), + } + _defaults = { + 'name': 'Service log', + 'type': 'Services'} + +class fleet_vehicle_log_odometer(osv.Model): + _inherit = ['fleet.vehicle.log'] + + _name = 'fleet.vehicle.log.odometer' + _columns = { + 'value' : fields.float('Value', required=True, help="Meter reading at service, fuel up and others"), + } + _defaults = { + 'name': 'Odometer Log', + 'type': 'Odometer'} + class hr_employee(osv.Model): _inherit = 'hr.employee' diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 7d0c6f737f7..9ea77645379 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -119,6 +119,30 @@
+ + + + + + + + +
+ + + + + + + + + + + + +
+
+
@@ -153,6 +177,7 @@ +
@@ -161,6 +186,7 @@ + @@ -315,13 +341,12 @@ fleet.vehicle.log.fuel - - - - - - - + + + + + + @@ -342,13 +367,13 @@ - - - - - - - + + + + + + + From b7a600f5de1b4b6346e25b6d48d0a46e98179671 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 25 Sep 2012 13:47:14 +0200 Subject: [PATCH 074/963] [ADD]Openchatter posts bzr revid: dle@openerp.com-20120925114714-z9yghyym20xcmhah --- addons/fleet/fleet.py | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 6bc74d40191..e6dd18cbd29 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -48,12 +48,6 @@ class fleet_vehicle(osv.Model): _inherit = 'mail.thread' - def create_send_note(self, cr, uid, ids, context=None): - for id in ids: - message = _("%s has been created.")% (self.case_get_note_msg_prefix(cr, uid, id, context=context)) - self.message_post(cr, uid, [id], body=message, context=context) - return True - def name_get(self, cr, uid, ids, context=None): if context is None: context = {} @@ -127,6 +121,14 @@ class fleet_vehicle(osv.Model): 'message' : "You have selected this %s model" % (model.name,), } } + def create(self, cr, uid, data, context=None): + vehicle_id = super(fleet_vehicle, self).create(cr, uid, data, context=context) + try: + vehicle = self.browse(cr, uid, vehicle_id, context=context) + self.message_post(cr, uid, [vehicle_id], body='Vehicle %s has been added to the fleet!' % (vehicle.name), context=context) + except: + pass # group deleted: do not push a message + return vehicle_id class fleet_vehicle_log(osv.Model): _name = 'fleet.vehicle.log' @@ -244,20 +246,6 @@ class fleet_vehicle_log_services(osv.Model): 'name': 'Service log', 'type': 'Services'} -class fleet_vehicle_log_services(osv.Model): - _inherit = ['fleet.vehicle.log'] - - _name = 'fleet.vehicle.log.services' - _columns = { - 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), - 'amount' :fields.float('Cost', help="Total cost of the service"), - 'reference' :fields.char('Reference',size=128), - 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), - } - _defaults = { - 'name': 'Service log', - 'type': 'Services'} - class fleet_vehicle_log_odometer(osv.Model): _inherit = ['fleet.vehicle.log'] From 7df4da3c4a0d2279a9f04f6ab236dcfa47c72d8a Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 25 Sep 2012 14:09:42 +0200 Subject: [PATCH 075/963] [ADD]security access rules for each object bzr revid: csn@openerp.com-20120925120942-rdaiucpwmt4jl8v3 --- addons/fleet/__openerp__.py | 3 ++- addons/fleet/security/ir.model.access.csv | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 addons/fleet/security/ir.model.access.csv diff --git a/addons/fleet/__openerp__.py b/addons/fleet/__openerp__.py index 36294c4086b..bcf63662081 100644 --- a/addons/fleet/__openerp__.py +++ b/addons/fleet/__openerp__.py @@ -15,5 +15,6 @@ 'application' : True, 'data' : [ 'fleet_view.xml', - ] + ], + 'update_xml' : ['security/ir.model.access.csv'], } \ No newline at end of file diff --git a/addons/fleet/security/ir.model.access.csv b/addons/fleet/security/ir.model.access.csv new file mode 100644 index 00000000000..3a1b3808642 --- /dev/null +++ b/addons/fleet/security/ir.model.access.csv @@ -0,0 +1,12 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +fleet_vehicle_model_access_right,fleet_vehicle_model_access_right,model_fleet_vehicle_model,,1,1,1,1 +fleet_vehicle_type_access_right,fleet_vehicle_type_access_right,model_fleet_vehicle_type,,1,1,1,1 +fleet_vehicle_model_brand_access_right,fleet_vehicle_model_brand_access_right,model_fleet_vehicle_model_brand,,1,1,1,1 +fleet_vehicle_access_right,fleet_vehicle_access_right,model_fleet_vehicle,,1,1,1,1 +fleet_vehicle_log_access_right,fleet_vehicle_log_access_right,model_fleet_vehicle_log,,1,1,1,1 +fleet_vehicle_log_fuel_access_right,fleet_vehicle_log_fuel_access_right,model_fleet_vehicle_log_fuel,,1,1,1,1 +fleet_vehicle_log_services_access_right,fleet_vehicle_log_services_access_right,model_fleet_vehicle_log_services,,1,1,1,1 +fleet_vehicle_log_insurance_access_right,fleet_vehicle_log_insurance_access_right,model_fleet_vehicle_log_insurance,,1,1,1,1 +fleet_vehicle_log_odometer_access_right,fleet_vehicle_log_odometer_access_right,model_fleet_vehicle_log_odometer,,1,1,1,1 +fleet_insurance_type_access_right,fleet_insurance_type_access_right,model_fleet_insurance_type,,1,1,1,1 +fleet_service_type_access_right,fleet_service_type_access_right,model_fleet_service_type,,1,1,1,1 \ No newline at end of file From b0cd93db7584f22cd8041d89f74af3e57ecc0611 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 25 Sep 2012 15:48:39 +0200 Subject: [PATCH 076/963] [ADD]button to show log in vehicle view and change field registration to be required=true bzr revid: csn@openerp.com-20120925134839-gpfbt3betm0f65u3 --- addons/fleet/fleet.py | 19 ++++++++++++++++++- addons/fleet/fleet_view.xml | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index e6dd18cbd29..7debd38d25c 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -69,12 +69,29 @@ class fleet_vehicle(osv.Model): res = self.name_get(cr, uid, ids, context=context) return dict(res) + + def action_showLog(self, cr, uid, ids, context=None): + """ This opens log view to view and add new log for this vehicle + @return: + """ + print 'HELLO YOU--------------------------------------------' + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','fleet_vehicle_log_act', context) + return res + #res['context'] = { + # 'default_partner_ids': applicant.partner_id and [applicant.partner_id.id] or False, + # 'default_user_id': uid, + # 'default_state': 'open', + # 'default_name': applicant.name, + # 'default_categ_ids': category and [category.id] or False, + #} + #return res + _name = 'fleet.vehicle' _description = 'Fleet Vehicle' _columns = { 'name' : fields.function(_vehicle_name_get_fnc, type="char", string='Name', store=True), - 'registration' : fields.char('Registration', size=32, required=False, help='Registration number of the vehicle (ie: plate number for a car)'), + 'registration' : fields.char('Registration', size=32, required=True, help='Registration number of the vehicle (ie: plate number for a car)'), 'vin_sn' : fields.char('Chassis Number', size=32, required=False, help='Unique number written on the vehicle motor (VIN/SN number)'), 'driver' : fields.many2one('hr.employee', 'Driver',required=False, help='Driver of the vehicle'), 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True, help='Model of the vehicle'), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 9ea77645379..02910111571 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -72,6 +72,9 @@
+
+
From 87a949c8ba92964f8d3913daf5d8c32231ee3b4a Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 25 Sep 2012 15:49:41 +0200 Subject: [PATCH 077/963] [ADD]Odometer views + change message_post args + rename log_odometer of fuel log bzr revid: dle@openerp.com-20120925134941-utrgip0vprhgtoxz --- addons/fleet/fleet.py | 12 +++- addons/fleet/fleet_view.xml | 109 +++++++++++++++++++++++++++--------- 2 files changed, 91 insertions(+), 30 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 7debd38d25c..999eeb72a6e 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -142,11 +142,19 @@ class fleet_vehicle(osv.Model): vehicle_id = super(fleet_vehicle, self).create(cr, uid, data, context=context) try: vehicle = self.browse(cr, uid, vehicle_id, context=context) - self.message_post(cr, uid, [vehicle_id], body='Vehicle %s has been added to the fleet!' % (vehicle.name), context=context) + self.message_post(cr, uid, [vehicle_id], body='Vehicle %s has been added to the fleet!' % (vehicle.registration), context=context) except: pass # group deleted: do not push a message return vehicle_id + def write(self, cr, uid, ids, vals, context=None): + vehicle_id = super(fleet_vehicle,self).write(cr, uid, ids, vals, context) + try: + self.message_post(cr, uid, [vehicle_id], body='Vehicle edited', context=context) + except: + pass + return vehicle_id + class fleet_vehicle_log(osv.Model): _name = 'fleet.vehicle.log' @@ -215,7 +223,7 @@ class fleet_vehicle_log_fuel(osv.Model): 'amount': fields.float('Total price'), 'inv_ref' : fields.char('Invoice Ref.', size=32), 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), - 'log_odometer_id' :fields.many2one('fleet.vehicle.log.odometer', 'Odometer Log'), + 'log_odometer' :fields.many2one('fleet.vehicle.log.odometer', 'Odometer Log'), } _defaults = { 'name': 'Fuel log', diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 02910111571..3da7fa629ac 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -180,7 +180,7 @@ - + @@ -189,7 +189,7 @@ - + @@ -298,13 +298,11 @@ fleet.vehicle.log - - - - - - - + + + + + @@ -324,13 +322,22 @@ + + + + + + + + + + + + + + + - - - - - - @@ -339,19 +346,18 @@ - - fleet.vehicle.log.fuel.tree - fleet.vehicle.log.fuel - - - - - - - - - - + fleet.vehicle.log.fuel.tree + fleet.vehicle.log.fuel + + + + + + + + + + @@ -363,6 +369,53 @@ + + fleet.vehicle.log.odometer.form + fleet.vehicle.log.odometer + + + + + + + + + + + + + + + + + + + + + + + fleet.vehicle.log.odometer.tree + fleet.vehicle.log.odometer + + + + + + + + + + + + + Vehicle Odometer Logs + fleet.vehicle.log.odometer + form + tree,form + + + + fleet.vehicle.log.services.form fleet.vehicle.log.services From 5cfb4d3a0c4d911846742fc7ddb5363b7a255c0c Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 25 Sep 2012 16:39:30 +0200 Subject: [PATCH 078/963] [REM]Odometer field for fuel log bzr revid: dle@openerp.com-20120925143930-ezhre39jw27zj7ji --- addons/fleet/fleet.py | 2 +- addons/fleet/fleet_view.xml | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 999eeb72a6e..4224d7ad2c1 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -223,7 +223,7 @@ class fleet_vehicle_log_fuel(osv.Model): 'amount': fields.float('Total price'), 'inv_ref' : fields.char('Invoice Ref.', size=32), 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), - 'log_odometer' :fields.many2one('fleet.vehicle.log.odometer', 'Odometer Log'), + } _defaults = { 'name': 'Fuel log', diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 3da7fa629ac..480560735b6 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -180,7 +180,6 @@ -
@@ -189,7 +188,6 @@ - @@ -328,7 +326,6 @@ - @@ -350,11 +347,12 @@ fleet.vehicle.log.fuel - - + + + From be9558576924f572452584cc463efa42912f348a Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 25 Sep 2012 16:53:39 +0200 Subject: [PATCH 079/963] [ADD]demo example for odometer log bzr revid: dle@openerp.com-20120925145339-ibwkf9kr0ec60ada --- addons/fleet/demo.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index e7377705447..b83d0a49160 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -71,6 +71,15 @@ 40.0 1.45 + + + + + + Odometer + 1579.5 + Odometer value when vehicle retrieved from partner + From ab1044c0ff823b792cc9fb764afee41129fa745e Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 25 Sep 2012 17:14:50 +0200 Subject: [PATCH 080/963] [FIX]fix button in vehicle edition to point to log bzr revid: csn@openerp.com-20120925151450-y898trkc4bkb7b00 --- addons/fleet/fleet.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 999eeb72a6e..8bdb8df4290 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -74,17 +74,22 @@ class fleet_vehicle(osv.Model): """ This opens log view to view and add new log for this vehicle @return: """ - print 'HELLO YOU--------------------------------------------' + #print 'HELLO YOU--------------------------------------------' + #print ids[0] + + #vehicle = self.browse(cr, uid, ids[0], context) + #logids = self.browse(cr,uid,log_ids,context) + #print vehicle + #print vehicle.name + #print vehicle.registration + #print logids + #print logids.type res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','fleet_vehicle_log_act', context) - return res - #res['context'] = { - # 'default_partner_ids': applicant.partner_id and [applicant.partner_id.id] or False, - # 'default_user_id': uid, - # 'default_state': 'open', - # 'default_name': applicant.name, - # 'default_categ_ids': category and [category.id] or False, - #} #return res + #res['context'] = { + # 'default_type': 'log', + #} + return res _name = 'fleet.vehicle' _description = 'Fleet Vehicle' From b766b84e1fc9c5b0a8565211234b21c08732a0d7 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 26 Sep 2012 09:49:15 +0200 Subject: [PATCH 081/963] [ADD]Odometer logs in fuel and services log bzr revid: dle@openerp.com-20120926074915-v0y98pr167p3hew1 --- addons/fleet/fleet.py | 7 +++++-- addons/fleet/fleet_view.xml | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 4224d7ad2c1..02ff58b06f3 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -222,8 +222,8 @@ class fleet_vehicle_log_fuel(osv.Model): 'price_per_liter' : fields.float('Price per liter'), 'amount': fields.float('Total price'), 'inv_ref' : fields.char('Invoice Ref.', size=32), - 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), - + 'vendor_id' : fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), + 'odometer_log' : fields.one2many('fleet.vehicle.log.odometer','fuel_log', 'Odometer',type="char"), } _defaults = { 'name': 'Fuel log', @@ -266,6 +266,7 @@ class fleet_vehicle_log_services(osv.Model): 'amount' :fields.float('Cost', help="Total cost of the service"), 'reference' :fields.char('Reference',size=128), 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), + 'odometer_log' : fields.one2many('fleet.vehicle.log.odometer','fuel_log', 'Odometer',type="char"), } _defaults = { 'name': 'Service log', @@ -277,6 +278,8 @@ class fleet_vehicle_log_odometer(osv.Model): _name = 'fleet.vehicle.log.odometer' _columns = { 'value' : fields.float('Value', required=True, help="Meter reading at service, fuel up and others"), + 'fuel_log' :fields.many2one('fleet.vehicle.log.fuel', 'Fuel log'), + 'service_log' :fields.many2one('fleet.vehicle.log.services', 'Services log'), } _defaults = { 'name': 'Odometer Log', diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 480560735b6..e8cd4532020 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -165,6 +165,7 @@ +
@@ -198,6 +199,7 @@
+
@@ -336,6 +338,7 @@
+
@@ -354,6 +357,7 @@ +
@@ -428,6 +432,7 @@ + @@ -446,6 +451,7 @@ +
From 91c4c5cee35a25d89476c4bf3c0227b7e930ed80 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 26 Sep 2012 10:07:10 +0200 Subject: [PATCH 082/963] [FIX]Fuel log demo amount value missing & odometer_log view fields remove widget bzr revid: dle@openerp.com-20120926080710-zx5815d0dhwodtwz --- addons/fleet/demo.xml | 1 + addons/fleet/fleet_view.xml | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index b83d0a49160..123b85f847a 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -70,6 +70,7 @@ Fuel 40.0 1.45 + 58 diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index e8cd4532020..13e8e112fc4 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -165,7 +165,7 @@ - + @@ -199,7 +199,7 @@ - + @@ -338,7 +338,7 @@ - + @@ -357,7 +357,7 @@ - + @@ -432,7 +432,7 @@ - + @@ -451,7 +451,7 @@ - + From 25690457a54206f6ab0aeeda184794808fa87bff Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 26 Sep 2012 10:36:49 +0200 Subject: [PATCH 083/963] [ADD]odometer log views in fields of fuel log, service log, and vehicle views bzr revid: dle@openerp.com-20120926083649-1yd3wmxp5eop1vy4 --- addons/fleet/fleet_view.xml | 94 ++++++++++++++++++++++++++++++++----- 1 file changed, 83 insertions(+), 11 deletions(-) diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 13e8e112fc4..bba87629940 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -165,7 +165,25 @@ - + + + + + + +
+ + + + + + + + + + +
+
@@ -199,7 +217,25 @@ - + + + + + + +
+ + + + + + + + + + +
+
@@ -338,7 +374,25 @@ - + + + + + + +
+ + + + + + + + + + +
+
@@ -432,7 +486,25 @@ - + + + + + + +
+ + + + + + + + + + +
+
@@ -445,13 +517,13 @@ fleet.vehicle.log.services - - - - - - - + + + + + + + From fa2c2af8b48c7722d8c861c8a1d3888ba0cbeca7 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 26 Sep 2012 11:28:58 +0200 Subject: [PATCH 084/963] [ADD]Message post when registration or driver changed for a vehicle bzr revid: dle@openerp.com-20120926092858-k10gxe8kqfekku5s --- addons/fleet/fleet.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 32bd7d56573..fbdcad60f7f 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -1,3 +1,4 @@ +from itertools import chain from osv import osv, fields class fleet_vehicle_model_type(osv.Model): @@ -155,8 +156,15 @@ class fleet_vehicle(osv.Model): def write(self, cr, uid, ids, vals, context=None): vehicle_id = super(fleet_vehicle,self).write(cr, uid, ids, vals, context) try: - self.message_post(cr, uid, [vehicle_id], body='Vehicle edited', context=context) - except: + changes = {} + for key,value in vals.items(): + if key == 'registration' or key == 'driver': + changes[key] = value + if len(changes) > 0: + self.message_post(cr, uid, [vehicle_id], body='Vehicle edited. Changes : '+ str(changes), context=context) + #self.message_post(cr, uid, [vehicle_id], body='Vehicle edited. Changes : '+ ','.join(chain(*str(changes.items()))), context=context) + except Exception as e: + print e pass return vehicle_id From 6002e6abd0ed0ce7940e5397261a54bf81d4fb37 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 26 Sep 2012 11:34:38 +0200 Subject: [PATCH 085/963] [ADD]add function to compute name of different logs bzr revid: csn@openerp.com-20120926093438-u4n824s5ckfaqxdp --- addons/fleet/fleet.py | 31 +++++++++++++++++++++++++------ addons/fleet/fleet_view.xml | 2 +- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index fbdcad60f7f..bfc67be7beb 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -171,8 +171,27 @@ class fleet_vehicle(osv.Model): class fleet_vehicle_log(osv.Model): _name = 'fleet.vehicle.log' + def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): + if context is None: + context = {} + if not ids: + return {} + reads = self.browse(cr, uid, ids, context=context) + res = [] + for record in reads: + name = record.type + if record.employee_id.name: + name = name+ ' / '+ record.employee_id.name + if record.vehicle_id.name: + name = name+ ' / '+ record.vehicle_id.name + if record.date_creation: + name = name+ ' / '+record.date_creation + res.append((record.id, name)) + + return dict(res) + _columns = { - 'name' : fields.char('Log',size=32), + 'name' : fields.function(_name_get_fnc, type="text", string='Log', store=True), 'employee_id' : fields.many2one('hr.employee', 'Employee', required=True), 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), @@ -183,7 +202,7 @@ class fleet_vehicle_log(osv.Model): } _defaults = { - 'name' : 'Log', + #'name' : 'Log', 'type' : 'Log', } @@ -239,7 +258,7 @@ class fleet_vehicle_log_fuel(osv.Model): 'odometer_log' : fields.one2many('fleet.vehicle.log.odometer','fuel_log', 'Odometer',type="char"), } _defaults = { - 'name': 'Fuel log', + # 'name': 'Fuel log', 'type': 'Refueling', } @@ -261,7 +280,7 @@ class fleet_vehicle_log_insurance(osv.Model): 'description' : fields.text('Description'), } _defaults = { - 'name': 'Insurance log', + #'name': 'Insurance log', 'type': 'Insurance',} class fleet_service_type(osv.Model): @@ -282,7 +301,7 @@ class fleet_vehicle_log_services(osv.Model): 'odometer_log' : fields.one2many('fleet.vehicle.log.odometer','fuel_log', 'Odometer',type="char"), } _defaults = { - 'name': 'Service log', + # 'name': 'Service log', 'type': 'Services'} class fleet_vehicle_log_odometer(osv.Model): @@ -295,7 +314,7 @@ class fleet_vehicle_log_odometer(osv.Model): 'service_log' :fields.many2one('fleet.vehicle.log.services', 'Services log'), } _defaults = { - 'name': 'Odometer Log', + # 'name': 'Odometer Log', 'type': 'Odometer'} class hr_employee(osv.Model): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index bba87629940..41eaa22254f 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -73,7 +73,7 @@
-
From 18833a0397e13dfabd92ac0cd43972aa8422656a Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 26 Sep 2012 14:35:12 +0200 Subject: [PATCH 086/963] [ADD]description and other fields in the manifest __openerp__.py, need to change picture with one of a car bzr revid: csn@openerp.com-20120926123512-9rwkpr0zo8qwb83g --- addons/fleet/__openerp__.py | 26 +++++++++++++++++++------- addons/fleet/fleet.py | 4 ++-- addons/fleet/static/src/img/icon.png | Bin 0 -> 20448 bytes 3 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 addons/fleet/static/src/img/icon.png diff --git a/addons/fleet/__openerp__.py b/addons/fleet/__openerp__.py index bcf63662081..ff903419efc 100644 --- a/addons/fleet/__openerp__.py +++ b/addons/fleet/__openerp__.py @@ -2,19 +2,31 @@ { 'name' : 'Fleet Management', 'version' : '0.1', + 'author' : 'OpenERP S.A.', + 'category': 'Fleet Management', + 'website' : 'http://www.openerp.com', + 'summary' : 'Manage your fleet of vehicle', + 'description' : """ +Easy way to manage your fleet +=============================== + +With this easy to use module, you can in a few clicks manage your entire vehicle fleet. + +Managing a single vehicle or thousands of them has never been easier. + +Encode your vehicle, group them with tags, view the ones that interest you with the search function. + +Add insurance and services reminder that will help you by sending you a mail when you need to renew the insurance of a vehicle or do the next maintenance. +""", 'depends' : [ 'base', 'hr', ], - 'demo': ['demo.xml'], - 'author' : 'OpenERP S.A.', - 'description' : """ - I'm a good module and I will handle the cars of your company ! - """, - 'installable' : True, - 'application' : True, 'data' : [ 'fleet_view.xml', ], 'update_xml' : ['security/ir.model.access.csv'], + 'demo': ['demo.xml'], + 'installable' : True, + 'application' : True, } \ No newline at end of file diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index bfc67be7beb..6da7e6d68ae 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -34,7 +34,7 @@ class fleet_vehicle_model(osv.Model): _columns = { 'name' : fields.function(_model_name_get_fnc, type="char", string='Name', store=True), 'modelname' : fields.char('Model name', size=32, required=True), - 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=False, help='Brand of the vehicle'), + 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True, help='Brand of the vehicle'), 'vendors': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), } @@ -192,7 +192,7 @@ class fleet_vehicle_log(osv.Model): _columns = { 'name' : fields.function(_name_get_fnc, type="text", string='Log', store=True), - 'employee_id' : fields.many2one('hr.employee', 'Employee', required=True), + 'employee_id' : fields.many2one('hr.employee', 'Employee'), 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), 'date_creation' : fields.date('Creation Date'), diff --git a/addons/fleet/static/src/img/icon.png b/addons/fleet/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..8600d565da54d27a7e01690aca37113b6203d2a1 GIT binary patch literal 20448 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 b^}7ET(hk%2fpqe100000NkvXXu0mjfr$i~8 literal 0 HcmV?d00001 From f7372cc5eab3161b36dfcd2a4002578b6ad648f1 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 26 Sep 2012 15:09:01 +0200 Subject: [PATCH 087/963] [ADD]Logo of brand bzr revid: dle@openerp.com-20120926130901-xri7y3dsl76n9o7n --- addons/fleet/demo.xml | 1 + addons/fleet/fleet.py | 4 ++++ addons/fleet/fleet_view.xml | 9 +++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 123b85f847a..50604d76624 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -4,6 +4,7 @@ Opel + diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 6da7e6d68ae..17abf800cbd 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -36,6 +36,7 @@ class fleet_vehicle_model(osv.Model): 'modelname' : fields.char('Model name', size=32, required=True), 'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model brand', required=True, help='Brand of the vehicle'), 'vendors': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False), + 'image': fields.related('brand','image',type="binary",string="Logo",store=False) } class fleet_vehicle_model_brand(osv.Model): @@ -43,6 +44,7 @@ class fleet_vehicle_model_brand(osv.Model): _description = 'Brand model of the vehicle' _columns = { 'name' : fields.char('Brand Name',size=32, required=True), + 'image': fields.binary("Logo",help="This field holds the image used as logo for the brand, limited to 128x128px."), } class fleet_vehicle(osv.Model): @@ -119,6 +121,8 @@ class fleet_vehicle(osv.Model): 'horsepower_tax': fields.float('Horsepower Taxation'), 'power' : fields.integer('Power (kW)',required=False,help='Power in kW of the vehicle'), 'co2' : fields.float('CO2 Emissions',required=False,help='CO2 emissions of the vehicle'), + + 'image': fields.related('model_id','image',type="binary",string="Logo",store=False) } def on_change_model(self, cr, uid, ids, model_id, context=None): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 41eaa22254f..92d557ea69c 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -7,6 +7,7 @@ + @@ -49,6 +50,7 @@ + @@ -75,11 +77,14 @@
+ + + + + - - From 971f1a66ce4305b95829b50b3946088cde1037a1 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 26 Sep 2012 16:13:52 +0200 Subject: [PATCH 088/963] [IMP]Deleting generic logs and inherits from odometer part 1 bzr revid: dle@openerp.com-20120926141352-nfsrwmibms0xg0dg --- addons/fleet/demo.xml | 19 +------- addons/fleet/fleet.py | 31 ++++++++++--- addons/fleet/fleet_view.xml | 87 ++++++++++++++----------------------- 3 files changed, 58 insertions(+), 79 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 50604d76624..fa81e8f26c1 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -64,24 +64,9 @@ - - - - - Fuel - 40.0 - 1.45 - 58 - + + - - - - - Odometer - 1579.5 - Odometer value when vehicle retrieved from partner - diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 17abf800cbd..192160e1c38 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -1,5 +1,7 @@ from itertools import chain from osv import osv, fields +import time + class fleet_vehicle_model_type(osv.Model): _name = 'fleet.vehicle.type' @@ -172,6 +174,23 @@ class fleet_vehicle(osv.Model): pass return vehicle_id +class fleet_vehicle_odometer(osv.Model): + _name='fleet.vehicle.odometer' + _description='Odometer log for a vehicle' + + _columns = { + 'name' : fields.char('Name',size=64), + + 'date' : fields.date('Date'), + 'value' : fields.float('Odometer Value'), + 'unit' : fields.selection([('kilometers', 'Kilometers'),('miles','Miles')], 'Odometer Unit', help='Unit of the measurement',required=False), + 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), + 'notes' : fields.text('Notes'), + } + _defaults = { + 'date' : time.strftime('%Y-%m-%d') + } + class fleet_vehicle_log(osv.Model): _name = 'fleet.vehicle.log' @@ -212,8 +231,7 @@ class fleet_vehicle_log(osv.Model): class fleet_vehicle_log_fuel(osv.Model): - - _inherit = ['fleet.vehicle.log','mail.thread'] + _inherits = {'fleet.vehicle.odometer': 'request_id'} def on_change_liter(self, cr, uid, ids, liter, price_per_liter, amount, context=None): @@ -253,18 +271,17 @@ class fleet_vehicle_log_fuel(osv.Model): _name = 'fleet.vehicle.log.fuel' + _columns = { + 'name' : fields.char('Name',size=64), 'liter' : fields.float('Liter'), 'price_per_liter' : fields.float('Price per liter'), 'amount': fields.float('Total price'), + 'purchaser_id' : fields.many2one('res.partner', 'Purchaser'), 'inv_ref' : fields.char('Invoice Ref.', size=32), 'vendor_id' : fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), - 'odometer_log' : fields.one2many('fleet.vehicle.log.odometer','fuel_log', 'Odometer',type="char"), + #'odometer_id': fields.many2one('fleet.vehicle.odometer','Odometer', ondelete='cascade', required=False), } - _defaults = { - # 'name': 'Fuel log', - 'type': 'Refueling', - } class fleet_insurance_type(osv.Model): _name = 'fleet.insurance.type' diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 92d557ea69c..962d7309ee7 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -200,47 +200,34 @@ - + - + - - + + - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + @@ -363,41 +350,30 @@
- - + + + + - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - +
@@ -413,10 +389,11 @@ - - + + + + - From 49bae040aa8899e06b14547a668055756f051559 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 26 Sep 2012 16:56:03 +0200 Subject: [PATCH 089/963] [IMP]Deleting generic logs and inherits from odometer part 2 + Fix demos values bzr revid: dle@openerp.com-20120926145603-m7dkh9mf320i31uj --- addons/fleet/demo.xml | 23 +++++++--- addons/fleet/fleet.py | 39 ++++++++-------- addons/fleet/fleet_view.xml | 91 ++++++++++++------------------------- 3 files changed, 65 insertions(+), 88 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index fa81e8f26c1..33e2491890c 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -1,6 +1,6 @@ - + Opel @@ -56,17 +56,26 @@ - - - Services + + 5 + 500.0 + 4574.2321 - - - + + + + 6 + + 20 + 1.4 + 28 + + 67458 + diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 192160e1c38..3db8c38db30 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -231,7 +231,7 @@ class fleet_vehicle_log(osv.Model): class fleet_vehicle_log_fuel(osv.Model): - _inherits = {'fleet.vehicle.odometer': 'request_id'} + _inherits = {'fleet.vehicle.odometer': 'odometer_id'} def on_change_liter(self, cr, uid, ids, liter, price_per_liter, amount, context=None): @@ -249,7 +249,6 @@ class fleet_vehicle_log_fuel(osv.Model): liter = float(liter); price_per_liter = float(price_per_liter); if price_per_liter > 0 and liter > 0: - print 'Debug :' + str(liter) + ' | ' + str(price_per_liter) + ' | ' + str(amount) return {'value' : {'amount' : float(liter) * float(price_per_liter),}} elif price_per_liter > 0 and amount > 0: return {'value' : {'liter' : float(amount) / float(price_per_liter),}} @@ -274,13 +273,30 @@ class fleet_vehicle_log_fuel(osv.Model): _columns = { 'name' : fields.char('Name',size=64), + 'liter' : fields.float('Liter'), 'price_per_liter' : fields.float('Price per liter'), 'amount': fields.float('Total price'), 'purchaser_id' : fields.many2one('res.partner', 'Purchaser'), - 'inv_ref' : fields.char('Invoice Ref.', size=32), + 'inv_ref' : fields.char('Invoice Reference', size=64), 'vendor_id' : fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), - #'odometer_id': fields.many2one('fleet.vehicle.odometer','Odometer', ondelete='cascade', required=False), + } + +class fleet_vehicle_log_services(osv.Model): + + _inherits = {'fleet.vehicle.odometer': 'odometer_id'} + + _name = 'fleet.vehicle.log.services' + _columns = { + + 'name' : fields.char('Name',size=64), + + 'amount' :fields.float('Cost', help="Total cost of the service"), + + 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), + 'purchaser_id' : fields.many2one('res.partner', 'Purchaser'), + 'inv_ref' : fields.char('Invoice Reference', size=64), + 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), } class fleet_insurance_type(osv.Model): @@ -310,21 +326,6 @@ class fleet_service_type(osv.Model): 'name': fields.char('Name', required=True, translate=True), } -class fleet_vehicle_log_services(osv.Model): - _inherit = ['fleet.vehicle.log'] - - _name = 'fleet.vehicle.log.services' - _columns = { - 'vendor_id' :fields.many2one('res.partner', 'Vendor', domain="[('supplier','=',True)]"), - 'amount' :fields.float('Cost', help="Total cost of the service"), - 'reference' :fields.char('Reference',size=128), - 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), - 'odometer_log' : fields.one2many('fleet.vehicle.log.odometer','fuel_log', 'Odometer',type="char"), - } - _defaults = { - # 'name': 'Service log', - 'type': 'Services'} - class fleet_vehicle_log_odometer(osv.Model): _inherit = ['fleet.vehicle.log'] diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 962d7309ee7..885c48a602f 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -154,41 +154,22 @@ - - + - - - + + + +
- - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
@@ -394,6 +375,7 @@ + @@ -460,33 +442,18 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + +
@@ -499,13 +466,13 @@ fleet.vehicle.log.services - - + - - - + + + + From 39ecef851c9df2e57a6b28eeeff5dcc239df9083 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 26 Sep 2012 17:11:50 +0200 Subject: [PATCH 090/963] [IMP]Deleting generic logs and inherits from odometer part 3. Final. bzr revid: dle@openerp.com-20120926151150-c8wp3yeduzte6omx --- addons/fleet/fleet.py | 63 ++------------ addons/fleet/fleet_view.xml | 159 ++++-------------------------------- 2 files changed, 23 insertions(+), 199 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 3db8c38db30..c10b7680901 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -191,44 +191,6 @@ class fleet_vehicle_odometer(osv.Model): 'date' : time.strftime('%Y-%m-%d') } -class fleet_vehicle_log(osv.Model): - _name = 'fleet.vehicle.log' - - def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): - if context is None: - context = {} - if not ids: - return {} - reads = self.browse(cr, uid, ids, context=context) - res = [] - for record in reads: - name = record.type - if record.employee_id.name: - name = name+ ' / '+ record.employee_id.name - if record.vehicle_id.name: - name = name+ ' / '+ record.vehicle_id.name - if record.date_creation: - name = name+ ' / '+record.date_creation - res.append((record.id, name)) - - return dict(res) - - _columns = { - 'name' : fields.function(_name_get_fnc, type="text", string='Log', store=True), - 'employee_id' : fields.many2one('hr.employee', 'Employee'), - 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), - - 'date_creation' : fields.date('Creation Date'), - - 'description' : fields.text('Description'), - 'type' : fields.char('Type',size=32), - } - - _defaults = { - #'name' : 'Log', - 'type' : 'Log', - } - class fleet_vehicle_log_fuel(osv.Model): _inherits = {'fleet.vehicle.odometer': 'odometer_id'} @@ -292,7 +254,6 @@ class fleet_vehicle_log_services(osv.Model): 'name' : fields.char('Name',size=64), 'amount' :fields.float('Cost', help="Total cost of the service"), - 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), 'purchaser_id' : fields.many2one('res.partner', 'Purchaser'), 'inv_ref' : fields.char('Invoice Reference', size=64), @@ -306,19 +267,20 @@ class fleet_insurance_type(osv.Model): } class fleet_vehicle_log_insurance(osv.Model): - _inherit = 'fleet.vehicle.log' + _inherits = {'fleet.vehicle.odometer': 'odometer_id'} + _name = 'fleet.vehicle.log.insurance' _columns = { + + 'name' : fields.char('Name',size=64), + 'insurance_type' : fields.many2one('fleet.insurance.type', 'Type', required=False, help='Type of the insurance'), 'start_date' : fields.date('Start date', required=False, help='Date when the coverage of the insurance begins'), 'expiration_date' : fields.date('Expiration date', required=False, help='Date when the coverage of the insurance expirates'), 'price' : fields.float('Price', help="Cost of the insurance for the specified period"), 'insurer_id' :fields.many2one('res.partner', 'Insurer', domain="[('supplier','=',True)]"), - 'description' : fields.text('Description'), + 'ins_ref' : fields.char('Insurance Reference', size=64), } - _defaults = { - #'name': 'Insurance log', - 'type': 'Insurance',} class fleet_service_type(osv.Model): _name = 'fleet.service.type' @@ -326,19 +288,6 @@ class fleet_service_type(osv.Model): 'name': fields.char('Name', required=True, translate=True), } -class fleet_vehicle_log_odometer(osv.Model): - _inherit = ['fleet.vehicle.log'] - - _name = 'fleet.vehicle.log.odometer' - _columns = { - 'value' : fields.float('Value', required=True, help="Meter reading at service, fuel up and others"), - 'fuel_log' :fields.many2one('fleet.vehicle.log.fuel', 'Fuel log'), - 'service_log' :fields.many2one('fleet.vehicle.log.services', 'Services log'), - } - _defaults = { - # 'name': 'Odometer Log', - 'type': 'Odometer'} - class hr_employee(osv.Model): _inherit = 'hr.employee' diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 885c48a602f..50952f8c57e 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -100,26 +100,34 @@ - + - + +
- + - - - - - - + + + + + + + + + + + + + @@ -127,30 +135,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -214,26 +198,6 @@ - - - - - - - - -
- - - - - - - - -
-
-
@@ -283,48 +247,6 @@ - - fleet.vehicle.log.form - fleet.vehicle.log - -
- - - - - - - - - -
-
-
- - - - fleet.vehicle.log.tree - fleet.vehicle.log - - - - - - - - - - - - - Vehicle Logs - fleet.vehicle.log - form - tree,form - - - - fleet.vehicle.log.fuel.form fleet.vehicle.log.fuel @@ -389,53 +311,6 @@ - - fleet.vehicle.log.odometer.form - fleet.vehicle.log.odometer - -
- - - - - - - - - - - - - - - -
-
-
- - - fleet.vehicle.log.odometer.tree - fleet.vehicle.log.odometer - - - - - - - - - - - - - Vehicle Odometer Logs - fleet.vehicle.log.odometer - form - tree,form - - - - fleet.vehicle.log.services.form fleet.vehicle.log.services From b3a470b0bb81b377681937ae350bd8f9e433fe83 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 26 Sep 2012 17:18:49 +0200 Subject: [PATCH 091/963] [IMP]Deleting generic logs and inherits from odometer part 4. Removing Access Rights bzr revid: dle@openerp.com-20120926151849-5mjlb5qyxj6j8d5x --- addons/fleet/fleet_view.xml | 2 +- addons/fleet/security/ir.model.access.csv | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 50952f8c57e..30ab6d04b22 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -77,7 +77,7 @@
- + diff --git a/addons/fleet/security/ir.model.access.csv b/addons/fleet/security/ir.model.access.csv index 3a1b3808642..89932e92e15 100644 --- a/addons/fleet/security/ir.model.access.csv +++ b/addons/fleet/security/ir.model.access.csv @@ -3,10 +3,8 @@ fleet_vehicle_model_access_right,fleet_vehicle_model_access_right,model_fleet_ve fleet_vehicle_type_access_right,fleet_vehicle_type_access_right,model_fleet_vehicle_type,,1,1,1,1 fleet_vehicle_model_brand_access_right,fleet_vehicle_model_brand_access_right,model_fleet_vehicle_model_brand,,1,1,1,1 fleet_vehicle_access_right,fleet_vehicle_access_right,model_fleet_vehicle,,1,1,1,1 -fleet_vehicle_log_access_right,fleet_vehicle_log_access_right,model_fleet_vehicle_log,,1,1,1,1 fleet_vehicle_log_fuel_access_right,fleet_vehicle_log_fuel_access_right,model_fleet_vehicle_log_fuel,,1,1,1,1 fleet_vehicle_log_services_access_right,fleet_vehicle_log_services_access_right,model_fleet_vehicle_log_services,,1,1,1,1 fleet_vehicle_log_insurance_access_right,fleet_vehicle_log_insurance_access_right,model_fleet_vehicle_log_insurance,,1,1,1,1 -fleet_vehicle_log_odometer_access_right,fleet_vehicle_log_odometer_access_right,model_fleet_vehicle_log_odometer,,1,1,1,1 fleet_insurance_type_access_right,fleet_insurance_type_access_right,model_fleet_insurance_type,,1,1,1,1 fleet_service_type_access_right,fleet_service_type_access_right,model_fleet_service_type,,1,1,1,1 \ No newline at end of file From c88f379ea06ae2da595a03e593d319d03d584e2a Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 26 Sep 2012 17:35:21 +0200 Subject: [PATCH 092/963] [ADD]Brand Image value for demo bzr revid: dle@openerp.com-20120926153521-orkwag7fikyxua5u --- addons/fleet/demo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 33e2491890c..b4e819f558e 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -4,7 +4,7 @@ Opel - + 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 From 545e3c98c350a5d1cf43b16ebc0cf959d58abd6e Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 27 Sep 2012 09:48:17 +0200 Subject: [PATCH 093/963] [ADD]solved conflicts and add working buttons in vehicle view to show log bzr revid: csn@openerp.com-20120927074817-g1t6oxf0dt3d5o1l --- addons/fleet/fleet.py | 12 +++++++----- addons/fleet/fleet_view.xml | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index c10b7680901..aa2a580eb56 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -75,7 +75,7 @@ class fleet_vehicle(osv.Model): return dict(res) - def action_showLog(self, cr, uid, ids, context=None): + def act_show_log(self, cr, uid, ids, context=None): """ This opens log view to view and add new log for this vehicle @return: """ @@ -89,11 +89,13 @@ class fleet_vehicle(osv.Model): #print vehicle.registration #print logids #print logids.type - res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','fleet_vehicle_log_act', context) + category = self.pool.get('ir.model.data').get_object(cr, uid, 'fleet', 'fleet_vehicle_form', context) + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log', context) #return res - #res['context'] = { - # 'default_type': 'log', - #} + res['context'] = { + 'default_vehicle_id': ids[0]#'Corsa',#category and category.id or False, + } + res['domain']=[('vehicle_id','=', ids[0])] return res _name = 'fleet.vehicle' diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 30ab6d04b22..3d7c16048fe 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -74,14 +74,17 @@
-
-
+ + @@ -237,6 +240,16 @@ + + + Vehicles fleet.vehicle From 92c99faf6efbf9c714ac786abc0776c0cef53d64 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 27 Sep 2012 09:57:26 +0200 Subject: [PATCH 094/963] [ADD]working buttons and removed log tab from vehicle view bzr revid: csn@openerp.com-20120927075726-kdimd6ru0g1fysph --- addons/fleet/fleet.py | 32 ++++++++++++++++---------------- addons/fleet/fleet_view.xml | 20 +++++++++++++++----- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index aa2a580eb56..6c5f5ab27f8 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -75,29 +75,29 @@ class fleet_vehicle(osv.Model): return dict(res) - def act_show_log(self, cr, uid, ids, context=None): + def act_show_log_services(self, cr, uid, ids, context=None): """ This opens log view to view and add new log for this vehicle - @return: + @return: the service log view """ - #print 'HELLO YOU--------------------------------------------' - #print ids[0] - - #vehicle = self.browse(cr, uid, ids[0], context) - #logids = self.browse(cr,uid,log_ids,context) - #print vehicle - #print vehicle.name - #print vehicle.registration - #print logids - #print logids.type - category = self.pool.get('ir.model.data').get_object(cr, uid, 'fleet', 'fleet_vehicle_form', context) - res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log', context) - #return res + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log_services', context) res['context'] = { - 'default_vehicle_id': ids[0]#'Corsa',#category and category.id or False, + 'default_vehicle_id': ids[0] } res['domain']=[('vehicle_id','=', ids[0])] return res + def act_show_log_fuel(self, cr, uid, ids, context=None): + """ This opens log view to view and add new log for this vehicle + @return: the service log view + """ + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log_fuel', context) + res['context'] = { + 'default_vehicle_id': ids[0] + } + res['domain']=[('vehicle_id','=', ids[0])] + return res + + _name = 'fleet.vehicle' _description = 'Fleet Vehicle' diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 3d7c16048fe..893ceff493d 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -76,7 +76,8 @@
-
@@ -137,7 +138,7 @@
- + @@ -242,12 +243,21 @@ + + From 7fbe02004fc1088829a97b5b90a3b966ee5ce0a8 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 27 Sep 2012 10:00:59 +0200 Subject: [PATCH 095/963] [FIX]vehicle registration>license plate, doors > default : 5, company_id + groups bzr revid: dle@openerp.com-20120927080059-h4409j15qiiq8isi --- addons/fleet/demo.xml | 4 ++-- addons/fleet/fleet.py | 16 +++++++++------- addons/fleet/fleet_view.xml | 5 +++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index b4e819f558e..d88cab40bd0 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -30,7 +30,7 @@ - 1-ACK-205 + 1-ACK-205 5454541 Black @@ -41,7 +41,7 @@ - 1-SYN-404 + 1-SYN-404 1337 Red diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 6c5f5ab27f8..bff36d6ac45 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -61,8 +61,8 @@ class fleet_vehicle(osv.Model): reads = self.browse(cr, uid, ids, context=context) res = [] for record in reads: - if record.registration: - name = record.registration + if record.license_plate: + name = record.license_plate if record.model_id.modelname: name = record.model_id.modelname + ' / ' + name if record.model_id.brand.name: @@ -74,7 +74,6 @@ class fleet_vehicle(osv.Model): res = self.name_get(cr, uid, ids, context=context) return dict(res) - def act_show_log_services(self, cr, uid, ids, context=None): """ This opens log view to view and add new log for this vehicle @return: the service log view @@ -97,13 +96,13 @@ class fleet_vehicle(osv.Model): res['domain']=[('vehicle_id','=', ids[0])] return res - _name = 'fleet.vehicle' _description = 'Fleet Vehicle' _columns = { 'name' : fields.function(_vehicle_name_get_fnc, type="char", string='Name', store=True), - 'registration' : fields.char('Registration', size=32, required=True, help='Registration number of the vehicle (ie: plate number for a car)'), + 'company_id': fields.many2one('res.company', 'Company'), + 'license_plate' : fields.char('License plate', size=32, required=True, help='License plate number of the vehicle (ie: plate number for a car)'), 'vin_sn' : fields.char('Chassis Number', size=32, required=False, help='Unique number written on the vehicle motor (VIN/SN number)'), 'driver' : fields.many2one('hr.employee', 'Driver',required=False, help='Driver of the vehicle'), 'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True, help='Model of the vehicle'), @@ -128,6 +127,9 @@ class fleet_vehicle(osv.Model): 'image': fields.related('model_id','image',type="binary",string="Logo",store=False) } + _defaults = { + 'doors' : 5, + } def on_change_model(self, cr, uid, ids, model_id, context=None): # print "ids: %r" % (ids,) @@ -156,7 +158,7 @@ class fleet_vehicle(osv.Model): vehicle_id = super(fleet_vehicle, self).create(cr, uid, data, context=context) try: vehicle = self.browse(cr, uid, vehicle_id, context=context) - self.message_post(cr, uid, [vehicle_id], body='Vehicle %s has been added to the fleet!' % (vehicle.registration), context=context) + self.message_post(cr, uid, [vehicle_id], body='Vehicle %s has been added to the fleet!' % (vehicle.license_plate), context=context) except: pass # group deleted: do not push a message return vehicle_id @@ -166,7 +168,7 @@ class fleet_vehicle(osv.Model): try: changes = {} for key,value in vals.items(): - if key == 'registration' or key == 'driver': + if key == 'license_plate' or key == 'driver': changes[key] = value if len(changes) > 0: self.message_post(cr, uid, [vehicle_id], body='Vehicle edited. Changes : '+ str(changes), context=context) diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 893ceff493d..8b473dd9051 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -83,7 +83,8 @@ - + + @@ -232,7 +233,7 @@ fleet.vehicle - + From 5f9b6e5702773ed40078eceea1cb3c750791d898 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 27 Sep 2012 10:09:12 +0200 Subject: [PATCH 096/963] [ADD]Vehicle tags bzr revid: dle@openerp.com-20120927080912-3v0gaakcc9nle89w --- addons/fleet/fleet.py | 10 ++++++++-- addons/fleet/fleet_view.xml | 14 +++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index bff36d6ac45..92fb48067c4 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -9,7 +9,13 @@ class fleet_vehicle_model_type(osv.Model): _columns = { 'name' : fields.char('Name', size=32, required=True), } -#comment to delete#comment to delete + +class fleet_vehicle_tag(osv.Model): + _name = 'fleet.vehicle.tag' + _columns = { + 'name': fields.char('Name', required=True, translate=True), + } + class fleet_vehicle_model(osv.Model): def name_get(self, cr, uid, ids, context=None): @@ -110,13 +116,13 @@ class fleet_vehicle(osv.Model): 'log_fuel' : fields.one2many('fleet.vehicle.log.fuel','vehicle_id', 'Fuel Logs'), 'log_services' : fields.one2many('fleet.vehicle.log.services','vehicle_id', 'Services Logs'), 'log_insurances' : fields.one2many('fleet.vehicle.log.insurance','vehicle_id', 'Insurances'), - 'log_odometer' : fields.one2many('fleet.vehicle.log.odometer','vehicle_id', 'Odometer'), 'acquisition_date' : fields.date('Acquisition date', required=False, help='Date when the vehicle has been bought'), 'acquisition_price' : fields.integer('Price', help='Price of the bought vehicle'), 'color' : fields.char('Color',size=32, help='Color of the vehicle'), 'status' : fields.char('Status',size=32, help='Status of the vehicle (in repair, active, ...)'), 'location' : fields.char('Location',size=32, help='Location of the vehicle (garage, ...)'), 'doors' : fields.integer('Number of doors', help='Number of doors of the vehicle'), + 'tag_ids' :fields.many2many('fleet.vehicle.tag','vehicle_vehicle_tag_rel','vehicle_tag_id','tag_id','Tags'), 'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False), 'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 8b473dd9051..bc64161bdb3 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -79,12 +79,16 @@
- - - - - + + + + + + + + + From 3bf35c4651d1b74a58e19f21ca79a82626594ef3 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 27 Sep 2012 15:24:50 +0200 Subject: [PATCH 097/963] [ADD]States with statusbar. TOCHANGE : useless domain in vehicle view, cause of domain evaluation bug for widget statusbar bzr revid: dle@openerp.com-20120927132450-bmzt6hf3rsny0ewo --- addons/fleet/demo.xml | 27 +++++++++++++++++++++++++++ addons/fleet/fleet.py | 13 ++++++++++--- addons/fleet/fleet_view.xml | 25 +++++++++++++++++++++++-- addons/survey/survey_view.xml | 4 +--- 4 files changed, 61 insertions(+), 8 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index d88cab40bd0..ddd21708af7 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -29,6 +29,31 @@
+ + In shop + 1 + + + + Inactive + 2 + + + + Active + 3 + + + + Out of order + 4 + + + + Sold + 5 + + 1-ACK-205 5454541 @@ -38,6 +63,7 @@ 5 + @@ -49,6 +75,7 @@ 5 + diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 92fb48067c4..0077b4f4634 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -2,7 +2,6 @@ from itertools import chain from osv import osv, fields import time - class fleet_vehicle_model_type(osv.Model): _name = 'fleet.vehicle.type' _description = 'Type of the vehicle' @@ -16,6 +15,14 @@ class fleet_vehicle_tag(osv.Model): 'name': fields.char('Name', required=True, translate=True), } +class fleet_vehicle_state(osv.Model): + _name = 'fleet.vehicle.state' + _columns = { + 'name': fields.char('Name', required=True), + 'sequence': fields.integer('Order',help="Used to order the note stages") + } + _order = 'sequence asc' + class fleet_vehicle_model(osv.Model): def name_get(self, cr, uid, ids, context=None): @@ -100,7 +107,7 @@ class fleet_vehicle(osv.Model): 'default_vehicle_id': ids[0] } res['domain']=[('vehicle_id','=', ids[0])] - return res + return res _name = 'fleet.vehicle' _description = 'Fleet Vehicle' @@ -119,7 +126,7 @@ class fleet_vehicle(osv.Model): 'acquisition_date' : fields.date('Acquisition date', required=False, help='Date when the vehicle has been bought'), 'acquisition_price' : fields.integer('Price', help='Price of the bought vehicle'), 'color' : fields.char('Color',size=32, help='Color of the vehicle'), - 'status' : fields.char('Status',size=32, help='Status of the vehicle (in repair, active, ...)'), + 'state': fields.many2one('fleet.vehicle.state', 'State', help='Current state of the vehicle', domain='[]'), 'location' : fields.char('Location',size=32, help='Location of the vehicle (garage, ...)'), 'doors' : fields.integer('Number of doors', help='Number of doors of the vehicle'), 'tag_ids' :fields.many2many('fleet.vehicle.tag','vehicle_vehicle_tag_rel','vehicle_tag_id','tag_id','Tags'), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index bc64161bdb3..2d49c2cf659 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -62,19 +62,40 @@ tree,form + + fleet.vehicle.state.tree + fleet.vehicle.state + + + + + + + + + + States of Vehicle + fleet.vehicle.state + form + tree,form + + + fleet.vehicle.form fleet.vehicle
+
+ +
-
- + @@ -226,16 +226,9 @@ fleet.vehicle - - - - - - - - - - + + +
From 9473646d3b0001cdcec672efb380443d7e64af2c Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 2 Oct 2012 13:40:59 +0200 Subject: [PATCH 132/963] [ADD][FIX]Demo values for fuel logs, many2many table missing fleet_ prefix bzr revid: dle@openerp.com-20121002114059-dhz466a1j2m3h6pi --- addons/fleet/demo.xml | 406 +++++++++++++++++++++++++++++++++--- addons/fleet/fleet.py | 6 +- addons/fleet/fleet_view.xml | 2 +- 3 files changed, 379 insertions(+), 35 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 3038dfbbabb..39083fc028c 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -1831,24 +1831,19 @@ gg== 1
- - Inactive + + Active 2 - - Active + + Inactive 3 - - Out of order - 4 - - Sold - 5 + 4 @@ -2136,32 +2131,381 @@ gg== Windshield Wiper(s) Replacement - - - - 5 - - 500.0 - - 4574.2321 - 1000 - kilometers - Usual car maintenance - - 6 - - 20 - 1.4 - 28 - + 2012-01-01 + 40 + 1.3 + 52 67458 - 400 - kilometers - Trip to Paris + 0 + First refueling + + + + + 6 + 2012-02-11 + 50 + 1.3 + 65 + 455812 + 658 + Second refueling of the car + + + + + + 6 + 2012-03-23 + 45 + 1.32 + 59.4 + 45199877 + 1360 + Some notes ... + + + + + + 6 + 2012-04-5 + 55 + 1.32 + 72.6 + 654 + 2044 + Some notes + + + + + + 6 + 2012-04-25 + 40 + 1.35 + 54 + 55488 + 2756 + Some notes + + + + + + 6 + 2012-05-15 + 55.8 + 1.35 + 75.33 + 4952 + 3410 + Some notes + + + + + + 6 + 2012-06-11 + 55.8 + 1.35 + 75.33 + 4952 + 3750 + Some notes + + + + + + 6 + 2012-07-02 + 47.8 + 1.35 + 64.53 + 15151 + 4115 + Some notes + + + + + + 6 + 2012-07-28 + 25 + 1.35 + 33.75 + 874195 + 4750 + Some notes + + + + + + 6 + 2012-08-17 + 51.2 + 1.35 + 69.12 + 4431 + 5171 + Some notes + + + + + + 6 + 2012-09-11 + 45.36 + 1.35 + 61.236 + 11234 + 5873 + Some notes + + + + + + 6 + 2012-10-06 + 53.4 + 1.37 + 73.158 + 798846 + 6571 + Some notes + + + + + + 6 + 2012-11-02 + 48.5 + 1.37 + 66.445 + 7954 + 7292 + Some notes + + + + + + 6 + 2012-12-02 + 35 + 1.4 + 49 + 545 + 7981 + Some notes + + + + + + 6 + 2012-01-01 + 40 + 1.3 + 52 + 67458 + 0 + First refueling + + + + + + 6 + 2012-02-11 + 50 + 1.3 + 65 + 455812 + 658 + Second refueling of the car + + + + + + 6 + 2012-03-23 + 45 + 1.32 + 59.4 + 45199877 + 1360 + Some notes ... + + + + + + 6 + 2012-04-5 + 55 + 1.32 + 72.6 + 654 + 2044 + Some notes + + + + + + 6 + 2012-04-25 + 40 + 1.35 + 54 + 55488 + 2756 + Some notes + + + + + + 6 + 2012-05-15 + 55.8 + 1.35 + 75.33 + 4952 + 3410 + Some notes + + + + + + 6 + 2012-06-11 + 55.8 + 1.35 + 75.33 + 4952 + 3750 + Some notes + + + + + + 6 + 2012-07-02 + 47.8 + 1.35 + 64.53 + 15151 + 4115 + Some notes + + + + + + 6 + 2012-07-28 + 25 + 1.35 + 33.75 + 874195 + 4750 + Some notes + + + + + + 6 + 2012-08-17 + 51.2 + 1.35 + 69.12 + 4431 + 5171 + Some notes + + + + + + 6 + 2012-09-11 + 45.36 + 1.35 + 61.236 + 11234 + 5873 + Some notes + + + + + + 6 + 2012-10-06 + 53.4 + 1.37 + 73.158 + 798846 + 6571 + Some notes + + + + + + 6 + 2012-11-02 + 48.5 + 1.37 + 66.445 + 7954 + 7292 + Some notes + + + + + + 6 + 2012-12-02 + 35 + 1.4 + 49 + 545 + 7981 + Some notes + + + + + + 5 + 2012-10-01 + 500.0 + + 4574.2321 + 1000 + Usual car maintenance + + diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 06ae81e93f2..dfa7c61ae37 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -176,7 +176,7 @@ class fleet_vehicle(osv.Model): reads = self.browse(cr, uid, ids, context=context) res = [] for record in reads: - odometers = self.pool.get('fleet.vehicle.odometer').search(cr,uid,[('vehicle_id','=',record.id)], order='date desc') + odometers = self.pool.get('fleet.vehicle.odometer').search(cr,uid,[('vehicle_id','=',record.id)], order='value desc') if len(odometers) > 0: res.append((record.id,self.pool.get('fleet.vehicle.odometer').browse(cr, uid, odometers[0], context=context).value)) else : @@ -282,7 +282,7 @@ class fleet_vehicle(osv.Model): 'state': fields.many2one('fleet.vehicle.state', 'State', help='Current state of the vehicle', ), 'location' : fields.char('Location',size=32, help='Location of the vehicle (garage, ...)'), 'doors' : fields.integer('Doors Number', help='Number of doors of the vehicle'), - 'tag_ids' :fields.many2many('fleet.vehicle.tag','vehicle_vehicle_tag_rel','vehicle_tag_id','tag_id','Tags'), + 'tag_ids' :fields.many2many('fleet.vehicle.tag','fleet_vehicle_vehicle_tag_rel','vehicle_tag_id','tag_id','Tags'), 'odometer' : fields.function(_vehicle_odometer_get_fnc, type="float", string='Odometer', store=False), 'odometer_unit': fields.selection([('kilometers', 'Kilometers'),('miles','Miles')], 'Odometer Unit', help='Unit of the odometer ',required=False), @@ -462,7 +462,7 @@ class fleet_vehicle_log_services(osv.Model): #'name' : fields.char('Name',size=64), 'date' :fields.date('Service Date',help='Date when the service will be/has been performed'), 'amount' :fields.float('Cost', help="Total cost of the service"), - 'service_ids' :fields.many2many('fleet.service.type','vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), + 'service_ids' :fields.many2many('fleet.service.type','fleet_vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), 'purchaser_id' : fields.many2one('res.partner', 'Purchaser',domain="['|',('customer','=',True),('employee','=',True)]"), 'inv_ref' : fields.char('Invoice Reference', size=64), 'vendor_id' :fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index e888bd55dc8..af64e5a3d7d 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -446,8 +446,8 @@ - + From 70756e82b5cfa21fba0b864ec840cc5187ae1159 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 2 Oct 2012 14:17:59 +0200 Subject: [PATCH 133/963] [FIX][IMP]Message_post while vehicle edited, + add old value bzr revid: dle@openerp.com-20121002121759-j7vfonyxrkpietg0 --- addons/fleet/fleet.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index dfa7c61ae37..d996a1029c5 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -302,6 +302,7 @@ class fleet_vehicle(osv.Model): 'insurance_renewal_overdue' : fields.function(get_overdue_insurance_reminder,type="integer",string='Insurance Renewal Overdue',store=True), 'next_service_date' : fields.function(get_next_service_reminder,type="date",string='Next Service Due Date',store=False), + } _defaults = { @@ -333,25 +334,21 @@ class fleet_vehicle(osv.Model): return vehicle_id def write(self, cr, uid, ids, vals, context=None): + changes = [] + if 'driver' in vals: + value = self.pool.get('res.partner').browse(cr,uid,vals['driver'],context=context).name + changes.append('Driver: from \'' + self.browse(cr, uid, ids, context)[0].driver.name + '\' to \'' + value+'\'') + if 'state' in vals: + value = self.pool.get('fleet.vehicle.state').browse(cr,uid,vals['state'],context=context).name + changes.append('State: from \'' + self.browse(cr, uid, ids, context)[0].state.name + '\' to \'' + value+'\'') + if 'license_plate' in vals: + changes.append('License Plate: from \'' + self.browse(cr, uid, ids, context)[0].license_plate + '\' to \'' + vals['license_plate']+'\'') + vehicle_id = super(fleet_vehicle,self).write(cr, uid, ids, vals, context) + try: - changes = [] - for key,value in vals.items(): - if key in ['license_plate','driver','state']: - if key == 'driver': - value = self.pool.get('res.partner').browse(cr,uid,value,context=context).name - if key == 'state': - value = self.pool.get('fleet.vehicle.state').browse(cr,uid,value,context=context).name - if key == 'driver': - key = 'Driver' - elif key == 'license_plate': - key = 'License Plate' - elif key =='state': - key = 'State' - changes.append(key + ' to \'' + value+'\'') if len(changes) > 0: - self.message_post(cr, uid, [vehicle_id], body='Vehicle edited. Changes : '+ ", ".join(changes), context=context) - #self.message_post(cr, uid, [vehicle_id], body='Vehicle edited. Changes : '+ ','.join(chain(*str(changes.items()))), context=context) + self.message_post(cr, uid, [self.browse(cr, uid, ids, context)[0].id], body=", ".join(changes), context=context) except Exception as e: print e pass From 3cf6b50a83b11dd0b4f994b1d2a3bc065f31ce55 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 2 Oct 2012 14:43:34 +0200 Subject: [PATCH 134/963] [ADD][FIX]Log odometer unit on change vehicle + field odometer value and unit concatened in all forms bzr revid: dle@openerp.com-20121002124334-ordn8cx4z8dsfw3h --- addons/fleet/demo.xml | 10 +++++++ addons/fleet/fleet.py | 58 +++++++++++++++++++++++++++++++++++-- addons/fleet/fleet_view.xml | 37 ++++++++++++++--------- 3 files changed, 88 insertions(+), 17 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 39083fc028c..644534d138e 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -1865,6 +1865,8 @@ gg== kilometers + 20000 + 450 @@ -1878,6 +1880,8 @@ gg== kilometers + 16000 + 400 @@ -1891,6 +1895,8 @@ gg== kilometers + 20000 + 450 @@ -1904,6 +1910,8 @@ gg== kilometers + 20000 + 450 @@ -1917,6 +1925,8 @@ gg== kilometers + 18000 + 425 diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index d996a1029c5..9b7f95e3d8e 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -277,7 +277,6 @@ class fleet_vehicle(osv.Model): 'log_services' : fields.one2many('fleet.vehicle.log.services','vehicle_id', 'Services Logs'), 'log_insurances' : fields.one2many('fleet.vehicle.log.insurance','vehicle_id', 'Insurances'), 'acquisition_date' : fields.date('Acquisition Date', required=False, help='Date when the vehicle has been bought'), - 'acquisition_price' : fields.integer('Price', help='Price of the bought vehicle'), 'color' : fields.char('Color',size=32, help='Color of the vehicle'), 'state': fields.many2one('fleet.vehicle.state', 'State', help='Current state of the vehicle', ), 'location' : fields.char('Location',size=32, help='Location of the vehicle (garage, ...)'), @@ -302,7 +301,8 @@ class fleet_vehicle(osv.Model): 'insurance_renewal_overdue' : fields.function(get_overdue_insurance_reminder,type="integer",string='Insurance Renewal Overdue',store=True), 'next_service_date' : fields.function(get_next_service_reminder,type="date",string='Next Service Due Date',store=False), - + 'car_value': fields.float('Car value', help='Value of the bought vehicle'), + 'leasing_value': fields.float('Leasing value',help='Value of the leasing(Monthly, usually'), } _defaults = { @@ -378,7 +378,20 @@ class fleet_vehicle_odometer(osv.Model): def _vehicle_log_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): res = self.name_get(cr, uid, ids, context=context) return dict(res) - + + def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): + + if not vehicle_id: + return {} + + odometer_unit = self.pool.get('fleet.vehicle').browse(cr, uid, vehicle_id, context=context).odometer_unit + + return { + 'value' : { + 'unit' : odometer_unit, + } + } + _columns = { 'name' : fields.function(_vehicle_log_name_get_fnc, type="char", string='Name', store=True), @@ -396,6 +409,19 @@ class fleet_vehicle_log_fuel(osv.Model): _inherits = {'fleet.vehicle.odometer': 'odometer_id'} + def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): + + if not vehicle_id: + return {} + + odometer_unit = self.pool.get('fleet.vehicle').browse(cr, uid, vehicle_id, context=context).odometer_unit + + return { + 'value' : { + 'unit' : odometer_unit, + } + } + def on_change_liter(self, cr, uid, ids, liter, price_per_liter, amount, context=None): if liter > 0 and price_per_liter > 0: @@ -451,6 +477,19 @@ class fleet_vehicle_log_fuel(osv.Model): class fleet_vehicle_log_services(osv.Model): + def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): + + if not vehicle_id: + return {} + + odometer_unit = self.pool.get('fleet.vehicle').browse(cr, uid, vehicle_id, context=context).odometer_unit + + return { + 'value' : { + 'unit' : odometer_unit, + } + } + _inherits = {'fleet.vehicle.odometer': 'odometer_id'} _name = 'fleet.vehicle.log.services' @@ -485,6 +524,19 @@ class fleet_insurance_state(osv.Model): class fleet_vehicle_log_insurance(osv.Model): _inherits = {'fleet.vehicle.odometer': 'odometer_id'} + def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): + + if not vehicle_id: + return {} + + odometer_unit = self.pool.get('fleet.vehicle').browse(cr, uid, vehicle_id, context=context).odometer_unit + + return { + 'value' : { + 'unit' : odometer_unit, + } + } + def compute_next_year_date(self, strdate): nextyear=int(strdate[:4])+1 return str(nextyear)+strdate[4:] diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index af64e5a3d7d..739f029d4d1 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -177,7 +177,8 @@ - + + @@ -356,7 +357,7 @@ - + @@ -365,8 +366,10 @@ - - +
+ + +
@@ -416,9 +419,11 @@
- - - + +
+ + +
@@ -431,7 +436,7 @@ fleet.vehicle.odometer - + @@ -469,7 +474,7 @@ - + @@ -479,8 +484,10 @@ - - +
+ + +
@@ -547,7 +554,7 @@ - + @@ -556,8 +563,10 @@ - - +
+ + +
From a900b6803b0c5fbf5b2309ab679862c9e2c4e723 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 2 Oct 2012 14:47:41 +0200 Subject: [PATCH 135/963] [ADD]Insurance type demo values bzr revid: dle@openerp.com-20121002124741-3hqcf1fyaf9uzx3y --- addons/fleet/demo.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 644534d138e..bf31a2ebd85 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -1854,6 +1854,18 @@ gg== Terminated + + Big risks + + + + Small risks + + + + Omium + + 1-ACK-205 5454541 From 4336e3953a97d6668ba6f743b9cc8556d0cd29d9 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 2 Oct 2012 14:50:55 +0200 Subject: [PATCH 136/963] [ADD]change to kanban vehicle view and add some color in kanban and tree view when insurance goes near expiration date bzr revid: csn@openerp.com-20121002125055-fq6tu09z43lhfyn9 --- addons/fleet/fleet.py | 7 +++--- addons/fleet/fleet_view.xml | 45 +++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 9b7f95e3d8e..698e3db16db 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -264,7 +264,8 @@ class fleet_vehicle(osv.Model): _name = 'fleet.vehicle' _description = 'Fleet Vehicle' - _order = 'insurance_renewal_overdue desc, insurance_renewal_due_soon desc' + #_order = 'insurance_renewal_overdue desc, insurance_renewal_due_soon desc' + _order= 'name asc' _columns = { 'name' : fields.function(_vehicle_name_get_fnc, type="char", string='Name', store=True), 'company_id': fields.many2one('res.company', 'Company'), @@ -297,8 +298,8 @@ class fleet_vehicle(osv.Model): 'image_medium': fields.related('model_id','image_medium',type="binary",string="Logo",store=False), 'image_small': fields.related('model_id','image_small',type="binary",string="Logo",store=False), - 'insurance_renewal_due_soon' : fields.function(get_next_insurance_reminder,type="integer",string='Insurance Renewal Due Soon',store=True), - 'insurance_renewal_overdue' : fields.function(get_overdue_insurance_reminder,type="integer",string='Insurance Renewal Overdue',store=True), + 'insurance_renewal_due_soon' : fields.function(get_next_insurance_reminder,type="integer",string='Insurance Renewal Due Soon',store=False), + 'insurance_renewal_overdue' : fields.function(get_overdue_insurance_reminder,type="integer",string='Insurance Renewal Overdue',store=False), 'next_service_date' : fields.function(get_next_service_reminder,type="date",string='Next Service Due Date',store=False), 'car_value': fields.float('Car value', help='Value of the bought vehicle'), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 739f029d4d1..19372915ab0 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -207,7 +207,7 @@ fleet.vehicle.tree fleet.vehicle - + @@ -215,9 +215,9 @@ - - - + + + @@ -277,23 +277,18 @@
  • - -
  • -
  • - - -
  • -
  • - Insurance renewal
    - due soon
    -
  • -
  • - - overdue -
  • -
  • - Service Alert
    - due soon
    -
  • -
  • - - overdue + + + Alert Insurance Renewal + + + + + + Alert Insurance Renewal + + +
  • @@ -623,7 +618,13 @@ - + + In Progress + + + + Terminated + @@ -523,7 +523,7 @@ fleet.vehicle.log.fuel.graph fleet.vehicle.log.fuel - graph + @@ -601,7 +601,6 @@ fleet.vehicle.log.services.graph fleet.vehicle.log.services - graph diff --git a/addons/fleet/security/ir.model.access.csv b/addons/fleet/security/ir.model.access.csv index 89932e92e15..bfc1fe13843 100644 --- a/addons/fleet/security/ir.model.access.csv +++ b/addons/fleet/security/ir.model.access.csv @@ -1,10 +1,14 @@ id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink fleet_vehicle_model_access_right,fleet_vehicle_model_access_right,model_fleet_vehicle_model,,1,1,1,1 fleet_vehicle_type_access_right,fleet_vehicle_type_access_right,model_fleet_vehicle_type,,1,1,1,1 +fleet_vehicle_tag_access_right,fleet_vehicle_tag_access_right,model_fleet_vehicle_tag,,1,1,1,1 +fleet_vehicle_state_access_right,fleet_vehicle_state_access_right,model_fleet_vehicle_state,,1,1,1,1 +fleet_vehicle_odometer_access_right,fleet_vehicle_odometer_access_right,model_fleet_vehicle_odometer,,1,1,1,1 fleet_vehicle_model_brand_access_right,fleet_vehicle_model_brand_access_right,model_fleet_vehicle_model_brand,,1,1,1,1 fleet_vehicle_access_right,fleet_vehicle_access_right,model_fleet_vehicle,,1,1,1,1 fleet_vehicle_log_fuel_access_right,fleet_vehicle_log_fuel_access_right,model_fleet_vehicle_log_fuel,,1,1,1,1 fleet_vehicle_log_services_access_right,fleet_vehicle_log_services_access_right,model_fleet_vehicle_log_services,,1,1,1,1 -fleet_vehicle_log_insurance_access_right,fleet_vehicle_log_insurance_access_right,model_fleet_vehicle_log_insurance,,1,1,1,1 -fleet_insurance_type_access_right,fleet_insurance_type_access_right,model_fleet_insurance_type,,1,1,1,1 +fleet_vehicle_log_contract_access_right,fleet_vehicle_log_contract_access_right,model_fleet_vehicle_log_contract,,1,1,1,1 +fleet_contract_type_access_right,fleet_contract_type_access_right,model_fleet_contract_type,,1,1,1,1 +fleet_contract_state_access_right,fleet_contract_state_access_right,model_fleet_contract_state,,1,1,1,1 fleet_service_type_access_right,fleet_service_type_access_right,model_fleet_service_type,,1,1,1,1 \ No newline at end of file From befdb18c74d6df26ffdae7436821628fc67c7c7c Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 3 Oct 2012 10:57:02 +0200 Subject: [PATCH 142/963] [ADD]Cost types bzr revid: dle@openerp.com-20121003085702-0uc4ynbw0hl51sx0 --- addons/fleet/fleet.py | 10 ++++++++++ addons/fleet/fleet_view.xml | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 3aafb066a09..2ad6a15ff14 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -5,6 +5,15 @@ import tools import datetime +class fleet_vehicle_cost(osv.Model): + _name = 'fleet.vehicle.cost' + _description = 'Cost of vehicle' + _columns = { + 'price': fields.float('Price'), + 'type': fields.many2one('fleet.service.type', 'Service type', required=True, help='Service type purchased with this cost'), + 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this cost'), + } + class fleet_vehicle_model_type(osv.Model): _name = 'fleet.vehicle.type' _description = 'Type of the vehicle' @@ -564,6 +573,7 @@ class fleet_vehicle_log_contract(osv.Model): 'ins_ref' : fields.char('Contract Reference', size=64), 'state' : fields.many2one('fleet.contract.state', 'Contract Status', help='Choose wheter the contract is still valid or not'), 'notes' : fields.text('Terms and Conditions'), + 'costs' : fields.one2many('fleet.vehicle.cost', 'vehicle_id', 'Costs covered'), } _defaults = { 'purchaser_id': lambda self, cr, uid, ctx: uid, diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 7cb2d5029e9..b6406e77fb2 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -365,6 +365,22 @@
    + + + + + + + + + + + + + + + +
    From 2d5fb352502b31b527b28ff69cd3b0c1297c43d2 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 3 Oct 2012 11:00:08 +0200 Subject: [PATCH 143/963] [ADD]color to contract when approching renewal date iff contract status is in progress bzr revid: csn@openerp.com-20121003090008-9wbzoe24sjrpumke --- addons/fleet/fleet.py | 25 ++++++++++++++++++++++++- addons/fleet/fleet_view.xml | 3 ++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 2ad6a15ff14..7e5eeade941 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -558,6 +558,29 @@ class fleet_vehicle_log_contract(osv.Model): else: return {} + def str_to_date(self,strdate): + return datetime.datetime(int(strdate[:4]),int(strdate[5:7]),int(strdate[8:])) + + def get_warning_date(self,cr,uid,ids,prop,unknow_none,context=None): + if context is None: + context={} + if not ids: + return dict([]) + reads = self.browse(cr,uid,ids,context=context) + res=[] + for record in reads: + if (record.state): + if (record.expiration_date and record.state.name=='In Progress'): + today=self.str_to_date(time.strftime('%Y-%m-%d')) + renew_date = self.str_to_date(record.expiration_date) + diff_time=int((renew_date-today).days) + res.append((record.id,diff_time)) + else: + res.append((record.id,0)) + else: + res.append((record.id,0)) + return dict(res) + _name = 'fleet.vehicle.log.contract' _order='state,expiration_date' _columns = { @@ -567,6 +590,7 @@ class fleet_vehicle_log_contract(osv.Model): 'contract_type' : fields.many2one('fleet.contract.type', 'Type', required=False, help='Type of the contract'), 'start_date' : fields.date('Start Date', required=False, help='Date when the coverage of the contract begins'), 'expiration_date' : fields.date('Expiration Date', required=False, help='Date when the coverage of the contract expirates (by default, one year after begin date)'), + 'warning_date' : fields.function(get_warning_date,type='integer',string='Warning Date',store=False), 'price' : fields.float('Price', help="Cost of the contract for the specified period"), 'insurer_id' :fields.many2one('res.partner', 'Insurer', domain="[('supplier','=',True)]"), 'purchaser_id' : fields.many2one('res.partner', 'Purchaser',domain="['|',('customer','=',True),('employee','=',True)]"), @@ -578,7 +602,6 @@ class fleet_vehicle_log_contract(osv.Model): _defaults = { 'purchaser_id': lambda self, cr, uid, ctx: uid, 'start_date' : time.strftime('%Y-%m-%d'), - #'state' : 'in_progress', #'expiration_date' : self.compute_next_year_date(time.strftime('%Y-%m-%d')), } diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index b6406e77fb2..68e552e0a3c 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -401,12 +401,13 @@ fleet.vehicle.log.contract.tree fleet.vehicle.log.contract - + + From 7a8a5abeff95a0fb30a36abcfad3397df62966ca Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 3 Oct 2012 11:54:04 +0200 Subject: [PATCH 144/963] [ADD]working color reminder for contract and also change header status bar for contract bzr revid: csn@openerp.com-20121003095404-lgh3k0wrnttx59pu --- addons/fleet/fleet.py | 26 ++++++++++++++++++++------ addons/fleet/fleet_view.xml | 9 ++++++--- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 7e5eeade941..dae0b6e948f 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -235,7 +235,7 @@ class fleet_vehicle(osv.Model): reads = self.browse(cr,uid,ids,context=context) res=[] for record in reads: - contracts = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','In Progress')],order='expiration_date') + contracts = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','In Progress'),('reminder','=',True)],order='expiration_date') due_soon=0 if (len(contracts) > 0): for element in contracts: @@ -569,16 +569,19 @@ class fleet_vehicle_log_contract(osv.Model): reads = self.browse(cr,uid,ids,context=context) res=[] for record in reads: - if (record.state): + if (record.reminder==True): if (record.expiration_date and record.state.name=='In Progress'): today=self.str_to_date(time.strftime('%Y-%m-%d')) renew_date = self.str_to_date(record.expiration_date) diff_time=int((renew_date-today).days) - res.append((record.id,diff_time)) + if (diff_time<=0): + res.append((record.id,0)) + else: + res.append((record.id,diff_time)) else: - res.append((record.id,0)) + res.append((record.id,-1)) else: - res.append((record.id,0)) + res.append((record.id,-1)) return dict(res) _name = 'fleet.vehicle.log.contract' @@ -595,17 +598,28 @@ class fleet_vehicle_log_contract(osv.Model): 'insurer_id' :fields.many2one('res.partner', 'Insurer', domain="[('supplier','=',True)]"), 'purchaser_id' : fields.many2one('res.partner', 'Purchaser',domain="['|',('customer','=',True),('employee','=',True)]"), 'ins_ref' : fields.char('Contract Reference', size=64), - 'state' : fields.many2one('fleet.contract.state', 'Contract Status', help='Choose wheter the contract is still valid or not'), + 'state' : fields.selection([('open', 'In Progress'), ('closed', 'Terminated')], 'Status', readonly=True, help='Choose wheter the contract is still valid or not'), + #'state' : fields.many2one('fleet.contract.state', 'Contract Status', help='Choose wheter the contract is still valid or not'), + 'reminder' : fields.boolean('Renewal Reminder', help="Warn the user when this contract needs to be renewed"), 'notes' : fields.text('Terms and Conditions'), 'costs' : fields.one2many('fleet.vehicle.cost', 'vehicle_id', 'Costs covered'), } _defaults = { 'purchaser_id': lambda self, cr, uid, ctx: uid, 'start_date' : time.strftime('%Y-%m-%d'), + 'state':'open', #'expiration_date' : self.compute_next_year_date(time.strftime('%Y-%m-%d')), } + def contract_close(self, cr, uid, ids, *args): + self.write(cr, uid, ids, {'state': 'closed'}) + return True + + def contract_open(self, cr, uid, ids, *args): + self.write(cr, uid, ids, {'state': 'open'}) + return True + class fleet_service_type(osv.Model): _name = 'fleet.service.type' _columns = { diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 68e552e0a3c..1f838ef697d 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -348,13 +348,15 @@
    - +
    - + @@ -363,6 +365,7 @@ + @@ -401,7 +404,7 @@ fleet.vehicle.log.contract.tree fleet.vehicle.log.contract - + From 98e4bac0826b8fa1cc9b08db2b3d38fa26b3e576 Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Wed, 3 Oct 2012 16:30:01 +0530 Subject: [PATCH 145/963] [FIX] field 'content_type' does not exist in model bzr revid: rgaopenerp-20121003110001-xdqt5035ddy5964f --- addons/mail/tests/test_mail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/tests/test_mail.py b/addons/mail/tests/test_mail.py index 7ec37d952bc..10506388da8 100644 --- a/addons/mail/tests/test_mail.py +++ b/addons/mail/tests/test_mail.py @@ -505,7 +505,7 @@ class test_mail(TestMailMockups): # 1. mass_mail on pigs and bird compose_id = mail_compose.create(cr, uid, - {'subject': _subject, 'body': '${object.description}', 'content_type': 'html'}, + {'subject': _subject, 'body': '${object.description}'}, {'default_composition_mode': 'mass_mail', 'default_model': 'mail.group', 'default_res_id': False, 'active_ids': [self.group_pigs_id, group_bird_id]}) compose = mail_compose.browse(cr, uid, compose_id) From f4aa60ad14271de5f55c13927c88ffdd8d020c92 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 3 Oct 2012 13:50:21 +0200 Subject: [PATCH 146/963] [FIX]fix bug on color attribution for contract near expiration date bzr revid: csn@openerp.com-20121003115021-8472hwn159aut2um --- addons/fleet/fleet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index dae0b6e948f..4ac8975a7e2 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -207,7 +207,7 @@ class fleet_vehicle(osv.Model): reads = self.browse(cr,uid,ids,context=context) res=[] for record in reads: - contracts = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','In Progress')],order='expiration_date') + contracts = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','open'),('reminder','=',True)],order='expiration_date') overdue=0 if (len(contracts) > 0): for element in contracts: @@ -235,7 +235,7 @@ class fleet_vehicle(osv.Model): reads = self.browse(cr,uid,ids,context=context) res=[] for record in reads: - contracts = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','In Progress'),('reminder','=',True)],order='expiration_date') + contracts = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','open'),('reminder','=',True)],order='expiration_date') due_soon=0 if (len(contracts) > 0): for element in contracts: @@ -570,7 +570,7 @@ class fleet_vehicle_log_contract(osv.Model): res=[] for record in reads: if (record.reminder==True): - if (record.expiration_date and record.state.name=='In Progress'): + if (record.expiration_date and record.state=='open'): today=self.str_to_date(time.strftime('%Y-%m-%d')) renew_date = self.str_to_date(record.expiration_date) diff_time=int((renew_date-today).days) From 3f51a37d3b263e9e30b34292817b3c5fd9a44718 Mon Sep 17 00:00:00 2001 From: Paramjit Singh Sahota Date: Wed, 3 Oct 2012 18:46:11 +0530 Subject: [PATCH 147/963] [IMP]Improved code for the kanban of EVENT module. In which date is not getting the shadow effect. bzr revid: psa@tinyerp.com-20121003131611-5i0fvvwjdm7hqety --- addons/event/static/src/css/event.css | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/event/static/src/css/event.css b/addons/event/static/src/css/event.css index 8602ea24d53..dd6cc21ffc9 100644 --- a/addons/event/static/src/css/event.css +++ b/addons/event/static/src/css/event.css @@ -19,6 +19,7 @@ color: #8A89BA; -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); background-color: #FFFFFF; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); } .oe_event_month_year{ border-bottom-left-radius:3px; From 543e1a22ddebbb23a2d4b7c3acb16fdc3f1a0e06 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 3 Oct 2012 15:30:15 +0200 Subject: [PATCH 148/963] [FIX]add class to kanban view to better show when contract alert shows up bzr revid: csn@openerp.com-20121003133015-5qkcdmisubkks2tv --- addons/fleet/demo.xml | 4 ++-- addons/fleet/fleet_view.xml | 29 ++++++++++++++--------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index d8926afe79b..c83076311a4 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -1855,11 +1855,11 @@ gg== - Big risks + Insurance - Small risks + Leasing diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 1f838ef697d..72b973c2ccc 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -231,6 +231,7 @@ + @@ -265,6 +266,17 @@ + + + Contract Renewal + + + + + + Contract Renewal + +
    @@ -277,20 +289,7 @@
  • -
  • - - - Alert Contract Renewal - - - - - - Alert Contract Renewal - - - -
  • + @@ -404,7 +403,7 @@ fleet.vehicle.log.contract.tree fleet.vehicle.log.contract - + From 8e2e69976a47ed0f19d7afda0a99551ac35ec5af Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Wed, 3 Oct 2012 19:03:20 +0530 Subject: [PATCH 149/963] [FIX] crm: Field 'categ_id' does not exist on browse bzr revid: rgaopenerp-20121003133320-pmkxe7i9iq4q71z8 --- addons/base_action_rule/base_action_rule.py | 5 ++--- addons/crm/crm_action_rule.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 7e9bbacab13..ac3c2cc483f 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -397,9 +397,8 @@ the rule to mark CC(mail to any other person defined in actions)."), obj.state = action.act_state write['state'] = action.act_state - if hasattr(obj, 'categ_id') and action.act_categ_id: - obj.categ_id = action.act_categ_id - write['categ_id'] = action.act_categ_id.id + if hasattr(obj, 'categ_ids') and action.act_categ_id: + write['categ_ids'] = [4, 0, action.act_categ_id.id] model_obj.write(cr, uid, [obj.id], write, context) diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 8b1ba655afc..b56c4d39126 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -57,8 +57,8 @@ class base_action_rule(osv.osv): if hasattr(obj, 'section_id'): ok = ok and (not action.trg_section_id or action.trg_section_id.id == obj.section_id.id) - if hasattr(obj, 'categ_id'): - ok = ok and (not action.trg_categ_id or action.trg_categ_id.id == obj.categ_id.id) + if hasattr(obj, 'categ_ids'): + ok = ok and (not action.trg_categ_id or action.trg_categ_id.id in obj.categ_ids) #Cheking for history regex = action.regex_history From 7a8b30aeba232e2b668d9ef217b8ee34d9bb8e1c Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 3 Oct 2012 15:38:11 +0200 Subject: [PATCH 150/963] [DEL]removed unused object contract state bzr revid: csn@openerp.com-20121003133811-u31kfolwiv0xer3s --- addons/fleet/demo.xml | 8 -------- addons/fleet/fleet.py | 7 ------- addons/fleet/security/ir.model.access.csv | 1 - 3 files changed, 16 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index c83076311a4..0874900379b 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -1846,14 +1846,6 @@ gg== 4 - - In Progress - - - - Terminated - - Insurance diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 4ac8975a7e2..529ae35fac8 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -525,12 +525,6 @@ class fleet_contract_type(osv.Model): 'name': fields.char('Name', required=True, translate=True), } -class fleet_contract_state(osv.Model): - _name = 'fleet.contract.state' - _columns = { - 'name':fields.char('Contract Status',size=32), - } - class fleet_vehicle_log_contract(osv.Model): _inherits = {'fleet.vehicle.odometer': 'odometer_id'} @@ -599,7 +593,6 @@ class fleet_vehicle_log_contract(osv.Model): 'purchaser_id' : fields.many2one('res.partner', 'Purchaser',domain="['|',('customer','=',True),('employee','=',True)]"), 'ins_ref' : fields.char('Contract Reference', size=64), 'state' : fields.selection([('open', 'In Progress'), ('closed', 'Terminated')], 'Status', readonly=True, help='Choose wheter the contract is still valid or not'), - #'state' : fields.many2one('fleet.contract.state', 'Contract Status', help='Choose wheter the contract is still valid or not'), 'reminder' : fields.boolean('Renewal Reminder', help="Warn the user when this contract needs to be renewed"), 'notes' : fields.text('Terms and Conditions'), 'costs' : fields.one2many('fleet.vehicle.cost', 'vehicle_id', 'Costs covered'), diff --git a/addons/fleet/security/ir.model.access.csv b/addons/fleet/security/ir.model.access.csv index bfc1fe13843..f4a00bb8fd1 100644 --- a/addons/fleet/security/ir.model.access.csv +++ b/addons/fleet/security/ir.model.access.csv @@ -10,5 +10,4 @@ fleet_vehicle_log_fuel_access_right,fleet_vehicle_log_fuel_access_right,model_fl fleet_vehicle_log_services_access_right,fleet_vehicle_log_services_access_right,model_fleet_vehicle_log_services,,1,1,1,1 fleet_vehicle_log_contract_access_right,fleet_vehicle_log_contract_access_right,model_fleet_vehicle_log_contract,,1,1,1,1 fleet_contract_type_access_right,fleet_contract_type_access_right,model_fleet_contract_type,,1,1,1,1 -fleet_contract_state_access_right,fleet_contract_state_access_right,model_fleet_contract_state,,1,1,1,1 fleet_service_type_access_right,fleet_service_type_access_right,model_fleet_service_type,,1,1,1,1 \ No newline at end of file From 656fef712b57e64a1d539d93b2f57b4e6472155b Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 3 Oct 2012 16:57:57 +0200 Subject: [PATCH 151/963] [IMP]Odometer not inherited anymore, many2one with function field bzr revid: dle@openerp.com-20121003145757-9fbmbbnkb33nf7lk --- addons/fleet/fleet.py | 216 ++++++++++++++++++++++++++++++++---- addons/fleet/fleet_view.xml | 34 +++--- 2 files changed, 211 insertions(+), 39 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 529ae35fac8..4b874ab1680 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -3,7 +3,13 @@ from osv import osv, fields import time import tools import datetime - +from osv.orm import except_orm +from tools.translate import _ +############################ +############################ +#Vehicle.cost class +############################ +############################ class fleet_vehicle_cost(osv.Model): _name = 'fleet.vehicle.cost' @@ -14,12 +20,11 @@ class fleet_vehicle_cost(osv.Model): 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this cost'), } -class fleet_vehicle_model_type(osv.Model): - _name = 'fleet.vehicle.type' - _description = 'Type of the vehicle' - _columns = { - 'name' : fields.char('Name', size=32, required=True), - } +############################ +############################ +#Vehicle.tag class +############################ +############################ class fleet_vehicle_tag(osv.Model): _name = 'fleet.vehicle.tag' @@ -27,6 +32,12 @@ class fleet_vehicle_tag(osv.Model): 'name': fields.char('Name', required=True, translate=True), } +############################ +############################ +#Vehicle.state class +############################ +############################ + class fleet_vehicle_state(osv.Model): _name = 'fleet.vehicle.state' _columns = { @@ -35,6 +46,12 @@ class fleet_vehicle_state(osv.Model): } _order = 'sequence asc' +############################ +############################ +#Vehicle.model class +############################ +############################ + class fleet_vehicle_model(osv.Model): def name_get(self, cr, uid, ids, context=None): @@ -81,6 +98,12 @@ class fleet_vehicle_model(osv.Model): 'image_small': fields.related('brand','image_small',type="binary",string="Logo",store=False), } +############################ +############################ +#Vehicle.brand class +############################ +############################ + class fleet_vehicle_model_brand(osv.Model): _name = 'fleet.vehicle.model.brand' _description = 'Brand model of the vehicle' @@ -119,6 +142,13 @@ class fleet_vehicle_model_brand(osv.Model): "Use this field anywhere a small image is required."), } +############################ +############################ +#Vehicle class +############################ +############################ + + class fleet_vehicle(osv.Model): _inherit = 'mail.thread' @@ -277,6 +307,7 @@ class fleet_vehicle(osv.Model): _order= 'name asc' _columns = { 'name' : fields.function(_vehicle_name_get_fnc, type="char", string='Name', store=True), + 'company_id': fields.many2one('res.company', 'Company'), 'license_plate' : fields.char('License Plate', size=32, required=True, help='License plate number of the vehicle (ie: plate number for a car)'), 'vin_sn' : fields.char('Chassis Number', size=32, required=False, help='Unique number written on the vehicle motor (VIN/SN number)'), @@ -364,6 +395,12 @@ class fleet_vehicle(osv.Model): pass return vehicle_id +############################ +############################ +#Vehicle.odometer class +############################ +############################ + class fleet_vehicle_odometer(osv.Model): _name='fleet.vehicle.odometer' _description='Odometer log for a vehicle' @@ -388,7 +425,6 @@ class fleet_vehicle_odometer(osv.Model): def _vehicle_log_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): res = self.name_get(cr, uid, ids, context=context) return dict(res) - def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): if not vehicle_id: @@ -407,17 +443,31 @@ class fleet_vehicle_odometer(osv.Model): 'date' : fields.date('Purchase Date'), 'value' : fields.float('Odometer Value',group_operator="max"), - 'unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), + 'unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), } _defaults = { 'date' : time.strftime('%Y-%m-%d') } +############################ +############################ +#Vehicle.log classes +############################ +############################ + + +############################ +############################ +#Vehicle.log.fuel class +############################ +############################ + + class fleet_vehicle_log_fuel(osv.Model): - _inherits = {'fleet.vehicle.odometer': 'odometer_id'} + #_inherits = {'fleet.vehicle.odometer': 'odometer_id'} def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): @@ -467,12 +517,39 @@ class fleet_vehicle_log_fuel(osv.Model): else : return {} + def _get_odometer(self, cr, uid, ids, odometer_id, arg, context): + res = dict.fromkeys(ids, False) + for record in self.browse(cr,uid,ids,context=context): + if record.odometer_id: + res[record.id] = record.odometer_id.value + return res + + def _set_odometer(self, cr, uid, id, name, value, args=None, context=None): + if value: + try: + value = float(value) + except ValueError: + #_logger.exception(value+' is not a correct odometer value. Please, fill a float for this field') + raise except_orm(_('Error!'), value+' is not a correct odometer value. Please, fill a float for this field') + + date = self.browse(cr, uid, id, context=context).date + if not(date): + date = time.strftime('%Y-%m-%d') + vehicle_id = self.browse(cr, uid, id, context=context).vehicle_id + data = {'value' : value,'date' : date,'vehicle_id' : vehicle_id.id} + odometer_id = self.pool.get('fleet.vehicle.odometer').create(cr, uid, data, context=context) + self.write(cr, uid, id, {'odometer_id': odometer_id}) + return value + self.write(cr, uid, id, {'odometer_id': ''}) + return False + _name = 'fleet.vehicle.log.fuel' _columns = { #'name' : fields.char('Name',size=64), - + 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this fuel log'), + 'date' :fields.date('Refueling Date',help='Date when the refueling has been performed'), 'liter' : fields.float('Liter'), 'price_per_liter' : fields.float('Price Per Liter'), 'amount': fields.float('Total price'), @@ -480,11 +557,22 @@ class fleet_vehicle_log_fuel(osv.Model): 'inv_ref' : fields.char('Invoice Reference', size=64), 'vendor_id' : fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), 'notes' : fields.text('Notes'), + 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), + 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='string',string='Odometer',store=False), + 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), } _defaults = { 'purchaser_id': lambda self, cr, uid, ctx: uid, + 'date' : time.strftime('%Y-%m-%d'), } +############################ +############################ +#Vehicle.log.service class +############################ +############################ + + class fleet_vehicle_log_services(osv.Model): def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): @@ -496,16 +584,41 @@ class fleet_vehicle_log_services(osv.Model): return { 'value' : { - 'unit' : odometer_unit, + 'odometer_unit' : odometer_unit, } } - _inherits = {'fleet.vehicle.odometer': 'odometer_id'} + def _get_odometer(self, cr, uid, ids, odometer_id, arg, context): + res = dict.fromkeys(ids, False) + for record in self.browse(cr,uid,ids,context=context): + if record.odometer_id: + res[record.id] = record.odometer_id.value + return res + + def _set_odometer(self, cr, uid, id, name, value, args=None, context=None): + if value: + try: + value = float(value) + except ValueError: + #_logger.exception(value+' is not a correct odometer value. Please, fill a float for this field') + raise except_orm(_('Error!'), value+' is not a correct odometer value. Please, fill a float for this field') + + date = self.browse(cr, uid, id, context=context).date + if not(date): + date = time.strftime('%Y-%m-%d') + vehicle_id = self.browse(cr, uid, id, context=context).vehicle_id + data = {'value' : value,'date' : date,'vehicle_id' : vehicle_id.id} + odometer_id = self.pool.get('fleet.vehicle.odometer').create(cr, uid, data, context=context) + self.write(cr, uid, id, {'odometer_id': odometer_id}) + return value + self.write(cr, uid, id, {'odometer_id': ''}) + return False _name = 'fleet.vehicle.log.services' _columns = { #'name' : fields.char('Name',size=64), + 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this services log'), 'date' :fields.date('Service Date',help='Date when the service will be/has been performed'), 'amount' :fields.float('Cost', help="Total cost of the service"), 'service_ids' :fields.many2many('fleet.service.type','fleet_vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), @@ -513,20 +626,61 @@ class fleet_vehicle_log_services(osv.Model): 'inv_ref' : fields.char('Invoice Reference', size=64), 'vendor_id' :fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), 'notes' : fields.text('Notes'), + + 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), + 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer',store=False), + 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), } _defaults = { 'purchaser_id': lambda self, cr, uid, ctx: uid, 'date' : time.strftime('%Y-%m-%d'), } -class fleet_contract_type(osv.Model): - _name = 'fleet.contract.type' +############################ +############################ +#Vehicle.service.type class +############################ +############################ + +class fleet_service_type(osv.Model): + _name = 'fleet.service.type' _columns = { 'name': fields.char('Name', required=True, translate=True), } +############################ +############################ +#Vehicle.log.contract class +############################ +############################ + class fleet_vehicle_log_contract(osv.Model): - _inherits = {'fleet.vehicle.odometer': 'odometer_id'} + + def _get_odometer(self, cr, uid, ids, odometer_id, arg, context): + res = dict.fromkeys(ids, False) + for record in self.browse(cr,uid,ids,context=context): + if record.odometer_id: + res[record.id] = record.odometer_id.value + return res + + def _set_odometer(self, cr, uid, id, name, value, args=None, context=None): + if value: + try: + value = float(value) + except ValueError: + #_logger.exception(value+' is not a correct odometer value. Please, fill a float for this field') + raise except_orm(_('Error!'), value+' is not a correct odometer value. Please, fill a float for this field') + + date = self.browse(cr, uid, id, context=context).date + if not(date): + date = time.strftime('%Y-%m-%d') + vehicle_id = self.browse(cr, uid, id, context=context).vehicle_id + data = {'value' : value,'date' : date,'vehicle_id' : vehicle_id.id} + odometer_id = self.pool.get('fleet.vehicle.odometer').create(cr, uid, data, context=context) + self.write(cr, uid, id, {'odometer_id': odometer_id}) + return value + self.write(cr, uid, id, {'odometer_id': ''}) + return False def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): @@ -537,7 +691,7 @@ class fleet_vehicle_log_contract(osv.Model): return { 'value' : { - 'unit' : odometer_unit, + 'odometer_unit' : odometer_unit, } } @@ -583,7 +737,8 @@ class fleet_vehicle_log_contract(osv.Model): _columns = { #'name' : fields.char('Name',size=64), - + 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this contract log'), + 'date' :fields.date('Contract Date',help='Date when the contract has been signed'), 'contract_type' : fields.many2one('fleet.contract.type', 'Type', required=False, help='Type of the contract'), 'start_date' : fields.date('Start Date', required=False, help='Date when the coverage of the contract begins'), 'expiration_date' : fields.date('Expiration Date', required=False, help='Date when the coverage of the contract expirates (by default, one year after begin date)'), @@ -596,6 +751,10 @@ class fleet_vehicle_log_contract(osv.Model): 'reminder' : fields.boolean('Renewal Reminder', help="Warn the user when this contract needs to be renewed"), 'notes' : fields.text('Terms and Conditions'), 'costs' : fields.one2many('fleet.vehicle.cost', 'vehicle_id', 'Costs covered'), + + 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), + 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='string',string='Odometer',store=False), + 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), } _defaults = { 'purchaser_id': lambda self, cr, uid, ctx: uid, @@ -613,8 +772,25 @@ class fleet_vehicle_log_contract(osv.Model): self.write(cr, uid, ids, {'state': 'open'}) return True -class fleet_service_type(osv.Model): - _name = 'fleet.service.type' +############################ +############################ +#Vehicle.log.contract.type class +############################ +############################ + +class fleet_contract_type(osv.Model): + _name = 'fleet.contract.type' _columns = { 'name': fields.char('Name', required=True, translate=True), + } +############################ +############################ +#Vehicle.log.contract.state class +############################ +############################ + +class fleet_contract_state(osv.Model): + _name = 'fleet.contract.state' + _columns = { + 'name':fields.char('Contract Status',size=32), } \ No newline at end of file diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 72b973c2ccc..c8ce7fc44c1 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -247,8 +247,7 @@ - - + @@ -386,8 +385,8 @@
    - - + +
    @@ -412,8 +411,7 @@ - - +
    @@ -436,10 +434,10 @@ -
    - - -
    +
    + + +
    @@ -501,8 +499,8 @@
    - - + +
    @@ -530,11 +528,11 @@ - - - + + + @@ -580,8 +578,8 @@
    - - + +
    @@ -611,8 +609,6 @@ - - From 6f97f45ee8cd4200f11e5d3c3e2ab6a06b95fc2c Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 3 Oct 2012 17:04:19 +0200 Subject: [PATCH 152/963] [FIX]replace string type by char in object bzr revid: csn@openerp.com-20121003150419-9t3jmprmjh5b6lux --- addons/fleet/fleet.py | 4 ++-- addons/fleet/security/ir.model.access.csv | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 4b874ab1680..82abc7c80e4 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -558,7 +558,7 @@ class fleet_vehicle_log_fuel(osv.Model): 'vendor_id' : fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), 'notes' : fields.text('Notes'), 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), - 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='string',string='Odometer',store=False), + 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer',store=False), 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), } _defaults = { @@ -753,7 +753,7 @@ class fleet_vehicle_log_contract(osv.Model): 'costs' : fields.one2many('fleet.vehicle.cost', 'vehicle_id', 'Costs covered'), 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), - 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='string',string='Odometer',store=False), + 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer',store=False), 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), } _defaults = { diff --git a/addons/fleet/security/ir.model.access.csv b/addons/fleet/security/ir.model.access.csv index f4a00bb8fd1..6b67ccda9c4 100644 --- a/addons/fleet/security/ir.model.access.csv +++ b/addons/fleet/security/ir.model.access.csv @@ -1,6 +1,5 @@ id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink fleet_vehicle_model_access_right,fleet_vehicle_model_access_right,model_fleet_vehicle_model,,1,1,1,1 -fleet_vehicle_type_access_right,fleet_vehicle_type_access_right,model_fleet_vehicle_type,,1,1,1,1 fleet_vehicle_tag_access_right,fleet_vehicle_tag_access_right,model_fleet_vehicle_tag,,1,1,1,1 fleet_vehicle_state_access_right,fleet_vehicle_state_access_right,model_fleet_vehicle_state,,1,1,1,1 fleet_vehicle_odometer_access_right,fleet_vehicle_odometer_access_right,model_fleet_vehicle_odometer,,1,1,1,1 From 7baf04078665cdd1a185eaff4685cf64d9984a8c Mon Sep 17 00:00:00 2001 From: Paramjit Singh Sahota Date: Thu, 4 Oct 2012 12:13:18 +0530 Subject: [PATCH 153/963] [IMP]Improved code for the kanban of Home >> My Groups >> JOIN GROUP which was not properly visible in IE9. bzr revid: psa@tinyerp.com-20121004064318-d91ei034jros4btw --- addons/mail/static/src/css/mail_group.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/css/mail_group.css b/addons/mail/static/src/css/mail_group.css index b700cb8c80f..9ca0055c17f 100644 --- a/addons/mail/static/src/css/mail_group.css +++ b/addons/mail/static/src/css/mail_group.css @@ -48,10 +48,11 @@ -o-border-radius: 3px; -ms-border-radius: 3px; border-radius: 3px; + border-collapse: separate; -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); -o-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); - -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); } .oe_group_photo { From 23140e888bd84746aa786870508bd876a907700b Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Thu, 4 Oct 2012 09:30:13 +0200 Subject: [PATCH 154/963] [MERGE]Lunch_new application bzr revid: api@openerp.com-20121004073013-p5dgp53kcmbs0kwm --- addons/hr/hr.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/hr/hr.py b/addons/hr/hr.py index aac1f41574f..0d984709527 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -139,7 +139,6 @@ class hr_job(osv.osv): def job_open(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state': 'open', 'no_of_recruitment': 0}) return True - hr_job() class hr_employee(osv.osv): From 5ac75e44aa8aa733774d00f35eb1e1c9badab8a3 Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Thu, 4 Oct 2012 09:31:56 +0200 Subject: [PATCH 155/963] [MERGE]Lunch_new application bzr revid: api@openerp.com-20121004073156-asqlj77f8v3q9m58 --- addons/lunch/i18n/ar.po | 555 ++++++++++++++++ addons/lunch/i18n/bg.po | 555 ++++++++++++++++ addons/lunch/i18n/ca.po | 577 +++++++++++++++++ addons/lunch/i18n/cs.po | 583 +++++++++++++++++ addons/lunch/i18n/da.po | 552 ++++++++++++++++ addons/lunch/i18n/de.po | 597 ++++++++++++++++++ addons/lunch/i18n/es.po | 589 +++++++++++++++++ addons/lunch/i18n/es_CR.po | 596 +++++++++++++++++ addons/lunch/i18n/es_MX.po | 560 ++++++++++++++++ addons/lunch/i18n/es_PY.po | 577 +++++++++++++++++ addons/lunch/i18n/es_VE.po | 560 ++++++++++++++++ addons/lunch/i18n/fi.po | 555 ++++++++++++++++ addons/lunch/i18n/fr.po | 589 +++++++++++++++++ addons/lunch/i18n/gl.po | 575 +++++++++++++++++ addons/lunch/i18n/hr.po | 552 ++++++++++++++++ addons/lunch/i18n/hu.po | 577 +++++++++++++++++ addons/lunch/i18n/it.po | 577 +++++++++++++++++ addons/lunch/i18n/ja.po | 554 ++++++++++++++++ addons/lunch/i18n/lunch.pot | 570 +++++++++++++++++ addons/lunch/i18n/nl.po | 552 ++++++++++++++++ addons/lunch/i18n/pt.po | 567 +++++++++++++++++ addons/lunch/i18n/pt_BR.po | 555 ++++++++++++++++ addons/lunch/i18n/ro.po | 582 +++++++++++++++++ addons/lunch/i18n/ru.po | 576 +++++++++++++++++ addons/lunch/i18n/sr@latin.po | 552 ++++++++++++++++ addons/lunch/i18n/sv.po | 552 ++++++++++++++++ addons/lunch/i18n/tr.po | 552 ++++++++++++++++ addons/lunch/i18n/zh_CN.po | 575 +++++++++++++++++ addons/lunch/i18n/zh_TW.po | 552 ++++++++++++++++ addons/lunch/lunch_demo.xml | 25 + addons/lunch/lunch_installer_view.xml | 52 ++ addons/lunch/lunch_report.xml | 13 + addons/lunch/report/__init__.py | 25 + addons/lunch/report/order.py | 71 +++ addons/lunch/report/order.rml | 184 ++++++ addons/lunch/report/report_lunch_order.py | 68 ++ .../lunch/report/report_lunch_order_view.xml | 51 ++ addons/lunch/security/ir.model.access.csv | 8 + addons/lunch/security/lunch_security.xml | 17 + addons/lunch/static/src/img/icon.png | Bin 0 -> 26815 bytes addons/lunch/test/lunch_report.yml | 8 + addons/lunch/test/test_lunch.yml | 128 ++++ addons/lunch/wizard/__init__.py | 27 + addons/lunch/wizard/lunch_cashbox_clean.py | 65 ++ .../lunch/wizard/lunch_cashbox_clean_view.xml | 39 ++ addons/lunch/wizard/lunch_order_cancel.py | 45 ++ .../lunch/wizard/lunch_order_cancel_view.xml | 39 ++ addons/lunch/wizard/lunch_order_confirm.py | 56 ++ .../lunch/wizard/lunch_order_confirm_view.xml | 40 ++ addons/lunch_new/__init__.py | 24 + addons/lunch_new/__openerp__.py | 42 ++ addons/lunch_new/lunch.py | 170 +++++ addons/lunch_new/lunch_view.xml | 395 ++++++++++++ addons/lunch_new/partner.py | 7 + addons/lunch_new/partner_view.xml | 18 + addons/lunch_new/static/src/img/warning.png | Bin 0 -> 33407 bytes addons/lunch_new/wizard/__init__.py | 23 + addons/lunch_new/wizard/lunch_cancel.py | 32 + addons/lunch_new/wizard/lunch_cancel_view.xml | 32 + addons/lunch_new/wizard/lunch_validation.py | 29 + .../wizard/lunch_validation_view.xml | 34 + 61 files changed, 18232 insertions(+) create mode 100644 addons/lunch/i18n/ar.po create mode 100644 addons/lunch/i18n/bg.po create mode 100644 addons/lunch/i18n/ca.po create mode 100644 addons/lunch/i18n/cs.po create mode 100644 addons/lunch/i18n/da.po create mode 100644 addons/lunch/i18n/de.po create mode 100644 addons/lunch/i18n/es.po create mode 100644 addons/lunch/i18n/es_CR.po create mode 100644 addons/lunch/i18n/es_MX.po create mode 100644 addons/lunch/i18n/es_PY.po create mode 100644 addons/lunch/i18n/es_VE.po create mode 100644 addons/lunch/i18n/fi.po create mode 100644 addons/lunch/i18n/fr.po create mode 100644 addons/lunch/i18n/gl.po create mode 100644 addons/lunch/i18n/hr.po create mode 100644 addons/lunch/i18n/hu.po create mode 100644 addons/lunch/i18n/it.po create mode 100644 addons/lunch/i18n/ja.po create mode 100644 addons/lunch/i18n/lunch.pot create mode 100644 addons/lunch/i18n/nl.po create mode 100644 addons/lunch/i18n/pt.po create mode 100644 addons/lunch/i18n/pt_BR.po create mode 100644 addons/lunch/i18n/ro.po create mode 100644 addons/lunch/i18n/ru.po create mode 100644 addons/lunch/i18n/sr@latin.po create mode 100644 addons/lunch/i18n/sv.po create mode 100644 addons/lunch/i18n/tr.po create mode 100644 addons/lunch/i18n/zh_CN.po create mode 100644 addons/lunch/i18n/zh_TW.po create mode 100644 addons/lunch/lunch_demo.xml create mode 100644 addons/lunch/lunch_installer_view.xml create mode 100644 addons/lunch/lunch_report.xml create mode 100644 addons/lunch/report/__init__.py create mode 100644 addons/lunch/report/order.py create mode 100644 addons/lunch/report/order.rml create mode 100644 addons/lunch/report/report_lunch_order.py create mode 100644 addons/lunch/report/report_lunch_order_view.xml create mode 100644 addons/lunch/security/ir.model.access.csv create mode 100644 addons/lunch/security/lunch_security.xml create mode 100644 addons/lunch/static/src/img/icon.png create mode 100644 addons/lunch/test/lunch_report.yml create mode 100644 addons/lunch/test/test_lunch.yml create mode 100644 addons/lunch/wizard/__init__.py create mode 100644 addons/lunch/wizard/lunch_cashbox_clean.py create mode 100644 addons/lunch/wizard/lunch_cashbox_clean_view.xml create mode 100644 addons/lunch/wizard/lunch_order_cancel.py create mode 100644 addons/lunch/wizard/lunch_order_cancel_view.xml create mode 100644 addons/lunch/wizard/lunch_order_confirm.py create mode 100644 addons/lunch/wizard/lunch_order_confirm_view.xml create mode 100644 addons/lunch_new/__init__.py create mode 100644 addons/lunch_new/__openerp__.py create mode 100644 addons/lunch_new/lunch.py create mode 100644 addons/lunch_new/lunch_view.xml create mode 100644 addons/lunch_new/partner.py create mode 100644 addons/lunch_new/partner_view.xml create mode 100644 addons/lunch_new/static/src/img/warning.png create mode 100644 addons/lunch_new/wizard/__init__.py create mode 100644 addons/lunch_new/wizard/lunch_cancel.py create mode 100644 addons/lunch_new/wizard/lunch_cancel_view.xml create mode 100644 addons/lunch_new/wizard/lunch_validation.py create mode 100644 addons/lunch_new/wizard/lunch_validation_view.xml diff --git a/addons/lunch/i18n/ar.po b/addons/lunch/i18n/ar.po new file mode 100644 index 00000000000..e44694042a8 --- /dev/null +++ b/addons/lunch/i18n/ar.po @@ -0,0 +1,555 @@ +# Arabic translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-01-12 22:03+0000\n" +"Last-Translator: kifcaliph \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "تجميع حسب..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "اليوم" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "مارس" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "الإجمالي:" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "يوم" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "إلغاء اﻻمر" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "المقدار" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "المنتجات" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " شهر " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "مؤكد" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "تأكيد" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "الحالة" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "السعر الإجمالي" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "تاريخ الإنشاء" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "تأكيد الأمر" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "يوليو" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "صندوق" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " شهر-١ " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "تاريخ الإنشاء" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "أبريل" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "سبتمبر" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "ديسمبر" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "شهر" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "نعم" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "فئة" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " سنة " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "كلا" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "أغسطس" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "يونيو" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "اسم المستخدم" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "تحليل المبيعات" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "مستخدم" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "تاريخ" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "نوفمبر" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "أكتوبر" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "يناير" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "نشط" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "ترتيب التواريخ" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "إلغاء" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "سعر الوحدة" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "المنتج" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "وصف" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "مايو" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "السعر" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "إجمالي السعر" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "فبراير" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "الاسم" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "أمر" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "مدير" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "Draft" +#~ msgstr "مسودة" diff --git a/addons/lunch/i18n/bg.po b/addons/lunch/i18n/bg.po new file mode 100644 index 00000000000..e5084e2c549 --- /dev/null +++ b/addons/lunch/i18n/bg.po @@ -0,0 +1,555 @@ +# Bulgarian translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2011-03-22 19:18+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Bulgarian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Поръчки за обяд" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Групиране по..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 Дни " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Днес" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Март" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Общо :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Ден" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Отказ на поръчка" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Количество" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Продукти" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Месец " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Потвърдено" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Потвърждение" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Област" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Обща цена" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Дата на създаване" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Име/Дата" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Потвърждения на поръчка" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Юли" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Кутия" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 Дни " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Месец-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Дата на създаване" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Нулиране" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Април" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Септември" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Декември" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Месец" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Име на кутията" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Да" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Категория" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Година " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Категории на продукта" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Не" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Август" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Юни" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Име на потребител" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Анализ на продажби" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Потребител" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Дата" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Ноември" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Октомври" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Януари" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Активен" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "По дата" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Отказ" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Единична цена" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Продукт" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Описание" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Май" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Цена" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Обща цена" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Февруари" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Име" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Обща сума" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Подреждане" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Мениджър" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 дни " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "За потвърждение" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Година" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "Draft" +#~ msgstr "Чернова" diff --git a/addons/lunch/i18n/ca.po b/addons/lunch/i18n/ca.po new file mode 100644 index 00000000000..ccd1f668811 --- /dev/null +++ b/addons/lunch/i18n/ca.po @@ -0,0 +1,577 @@ +# Catalan translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 17:54+0000\n" +"Last-Translator: Raphael Collet (OpenERP) \n" +"Language-Team: Catalan \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Resetear caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Comandes de menjar" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Segur que voleu cancel·lar aquesta comanda?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Moviments d'efectiu" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Agrupa per..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Confirmeu comanda" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 Dies " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Avui" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Març" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Dia" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Cancel·la comanda" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Import" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Productes" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Import disponible per usuari i caixa" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mes " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Estadístiques de comandes de menjar" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Moviments de caixa" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmat" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirma" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Cerca comandes de menjar" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Estat" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Preu total" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Import de caixa per usuari" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Data de creació" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nom/Data" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descripció comanda" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Confirma la comanda" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Juliol" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Caixa" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 Dies " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mes-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Data de creació" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Categories de producte " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Fixa a zero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Moviment de caixa" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Abril" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Setembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Desembre" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mes" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Nom de la caixa" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Si" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categoria" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Any " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categories de producte" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "No" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Confirmació de comandes" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "Esteu segur que voleu reiniciar aquesta caixa d'efectiu?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Agost" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Anàlisis comandes de menjar" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Juny" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Nom del usuari" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Anàlisi de vendes" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Menjar" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Usuari/a" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Data" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Novembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Octubre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Gener" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Nom de la caixa" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "Neteja caixa" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Actiu" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Data de comanda" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Caixa per al menjar " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Estableix caixa a zero" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Cancel·la" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Caixes " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Preu unitari" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Producte" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descripció" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Maig" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Preu" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Cerca moviment de caixa" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Total caixa" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Producte menjar" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Total restant" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Preu total" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Febrer" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nom" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Import total" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Categoria relacionada amb els productes" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Caixes" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Comanda" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Comanda menjar" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Estat de la caixa per usuari" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Director" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 Dies " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Per confirmar" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Any" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "Draft" +#~ msgstr "Esborrany" + +#~ msgid "Category related to Products" +#~ msgstr "Categoria relacionada amb els productes" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " El mòdul base per gestionar menjars.\n" +#~ "\n" +#~ " Permet gestionar les comandes de menjar, els moviments d'efectiu, la " +#~ "caixa i els productes.\n" +#~ " Estableix diferents categories per al producte.\n" +#~ " " + +#~ msgid "Lunch Module" +#~ msgstr "Mòdul de menjars" diff --git a/addons/lunch/i18n/cs.po b/addons/lunch/i18n/cs.po new file mode 100644 index 00000000000..c01fcf3373e --- /dev/null +++ b/addons/lunch/i18n/cs.po @@ -0,0 +1,583 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * lunch +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 17:22+0000\n" +"Last-Translator: Jiří Hajda \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" +"X-Poedit-Language: Czech\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Nulovat pokladnu" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "Částka pokladny v aktuálním roce" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Obědnávky obědů" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Jste si jisti, že chcete zrušit tuto objednávku ?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Pohyby hotovosti" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Seskupit podle..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "potvrdit objednávku" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 dnů " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Dnes" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Březen" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Celkem :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Den" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Zrušit objednávku" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" +"Můžete vytvořit pokladu podle zaměstnance, pokud chcete udržet přehled o " +"dlužených částkách podle zaměstnance podle toho co si objednal." + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Částka" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Výrobky" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Množství dostupné podle uživatele a balení" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Měsíc " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Statistika obědnávek obědů" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "PohybyHotovosti" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Potvrzeno" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Potvrdit" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Hledat obědnávku obědu" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Stav" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "Nový" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Celková cena" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Množství balení podle uživatele" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Datum vytvoření" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Jméno/Datum" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Popis objednávky" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "Částka pokladny v minulém měsíci" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Potvrdit objednávku" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Červenec" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Krabice" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 dní " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Měsíc-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Datum vytvoření" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Kategorie výrobku " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Nastavit na nulu" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Pohyb hotovosti" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "Úkoly vykonané v posledních 365 dnech" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Duben" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Září" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Prosinec" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Měsíc" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Jméno balení" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Ano" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Kategorie" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Rok " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Kategorie výrobku" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Ne" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Potvrzení objednávek" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "Jste si jisti, že chcete nulovat tuto pokladnu ?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" +"Určuje všechny výrobky, které zaměstnanci mohou objednat pro obědový čas. " +"Pokud si objednáte oběd na více místech, můžete použít kategorie výrobků pro " +"rozdělení dodavatelů. Bude pak jednodušší pro správce obědů filtrovat " +"objednávky obědů podle kategorie." + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Srpen" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Analýza objednávek obědu" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Červen" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Uživatelské jméno" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Analýza prodeje" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Oběd" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Uživatel" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Datum" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Listopad" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Říjen" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Leden" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Jméno balení" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "vyčistit pokladna" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Aktivní" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Datum objednávky" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Pokladna pro obědy " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Nastavit pokladnu na nulu" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "Obecné informace" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Zrušit" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Pokladny " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Cena za kus" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Výrobek" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Popis" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Květen" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Cena" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Hledat PohybyHotovosti" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Celkem balení" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Výrobek obědu" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Celkem zbývajících" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Celková cena" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Únor" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Jméno" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Celková částka" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "Úkoly vykonané v posledních 30 dnech" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Kategorie vztažená k výrobkům" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Pokladny" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Objednávka" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Obědnávka obědu" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "Obsah pokladny v aktuálním měsíci" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "Určete vaše obědové výrobky" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "Úkoly během posledních 7 dní" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Pozice hotovosti podle uživatele" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Správce" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 dní " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "K potvrzení" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Rok" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "Vytvořit obědové pokladny" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " Základní modul pro správu obědů\n" +#~ "\n" +#~ " udržuje přehled o Obědnávkách obědů, Pohybech hotovosti, Pokladně, " +#~ "Výrobcích.\n" +#~ " Používá různé kategorie pro výrobky.\n" +#~ " " + +#~ msgid "Lunch Module" +#~ msgstr "Modul obědů" + +#~ msgid "Draft" +#~ msgstr "Koncept" + +#~ msgid "Category related to Products" +#~ msgstr "Kategorie vztažená k výrobkům" diff --git a/addons/lunch/i18n/da.po b/addons/lunch/i18n/da.po new file mode 100644 index 00000000000..0a2e7fe4062 --- /dev/null +++ b/addons/lunch/i18n/da.po @@ -0,0 +1,552 @@ +# Danish translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-01-27 09:08+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Danish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" diff --git a/addons/lunch/i18n/de.po b/addons/lunch/i18n/de.po new file mode 100644 index 00000000000..71dc88a4024 --- /dev/null +++ b/addons/lunch/i18n/de.po @@ -0,0 +1,597 @@ +# German translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 17:56+0000\n" +"Last-Translator: Ferdinand-camptocamp \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Zurücksetzen Kasse" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "Kassen Betrag aktuelles Jahr" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Aufträge des Tages" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Möchten Sie wirklich die Bestellung stornieren ?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Einzahlungen" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Gruppierung..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Bestätige Bestellung" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 Tage " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Heute" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "März" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Bruttobetrag:" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Tag" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Storno Bestellung" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" +"Sie können eine Kasse je Mitarbeiter führen, wenn Sie die Beträge je " +"Mitarbeiter entsprechend seiner Bestellungen evident halten wollen" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Betrag" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Produkte" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Kasse nach Benutzer und Mittagskasse" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Monat " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Statistik Mittagessen" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Einzahlung" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Bestätigt" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Bestätige" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Suche Bestellung Mittagessen" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Status" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "Neu" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Gesamtpreis" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Einzahlung durch Benutzer" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Datum Erstellung" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Name/Datum" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Beschreibung Bestellung" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "Einzahlungen letztes Monat" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Bestätige Bestellung" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Juli" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Kasse" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 Tage " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Monat-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Datum erstellt" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Produktkategorien " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Setze auf 0" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Einzahlung" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "Aufgaben in den letzten 365 Tagen" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "April" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "September" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Dezember" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Monat" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Name Kasse" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Ja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Kategorie" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Jahr " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Kategorien Produkte" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Nein" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Bestätigung Bestellung" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "Möchten Sie wirklich die Kasse zurücksetzen?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" +"Definieren Sie alle Produkte die Mitarbeiter als Mittagstisch bestellen " +"können. Wenn Sie das Essen bei verschiedenen Stellen bestellen, dann " +"verwenden sie am Besten Produktkategorien je Anbieter. Der Manger kann die " +"Produkte dann je Kategorie bestellen." + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "August" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Auswertung Mittagessen" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Juni" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Benutzer Name" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Analyse Verkauf" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Mittagessen" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Benutzer" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Datum" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "November" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Oktober" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Januar" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Name Mittagskasse" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "Kassenausgleich" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Aktiv" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Datum Auftrag" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Mittagskasse " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Setze Kasse auf 0" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "Allgemeine Informationen" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Abbrechen" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Mittagskasse " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Preis/ME" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Produkt" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Beschreibung" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Mai" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Preis" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Suche Einzahlung" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Summe Mittagskasse" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Produkt Mittagessen" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Restgeld" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Gesamtpreis" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Februar" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Name" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Gesamtbetrag" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "Aufgaben erledit in den letzten 30 Tagen" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Kategorie Produkte" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Kassen" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Auftrag" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Auftrag Mittagessen" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "Einzahlungen laufendes Monat" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "Definieren Sie Ihre Essensprodukte" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "Aufgaben der letzten 7 Tage" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Guthaben nach Benutzer" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Manager" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 Tage " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "zu Bestätigen" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Jahr" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "Erzeugen Sie Essenskassen" + +#~ msgid "Invalid model name in the action definition." +#~ msgstr "Ungültiger Modulname in der Aktionsdefinition." + +#~ msgid "Lunch Module" +#~ msgstr "Modul Mittagessen" + +#~ msgid "Invalid XML for View Architecture!" +#~ msgstr "Fehlerhafter XML Quellcode für diese Ansicht!" + +#~ msgid "Draft" +#~ msgstr "Entwurf" + +#~ msgid "" +#~ "The Object name must start with x_ and not contain any special character !" +#~ msgstr "" +#~ "Die Objektbezeichnung muss mit x_ beginnen und darf keine Sonderzeichen " +#~ "beinhalten!" + +#~ msgid "Category related to Products" +#~ msgstr "Kategorie Produkte" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " Dieses Modul ist ein einfaches Basismodul zur Verwaltung der täglichen " +#~ "Mitarbeiterverpflegung.\n" +#~ "\n" +#~ " Die Anwendung verfolgt die Bestellungen von Mitarbeitern und prüft Ein- " +#~ "und Auszahlung aus der\n" +#~ " Gemeinschaftskasse. Ausserdem können für den Zweck der Anwendung " +#~ "Produkte und Kategorien definiert werden.\n" +#~ " " diff --git a/addons/lunch/i18n/es.po b/addons/lunch/i18n/es.po new file mode 100644 index 00000000000..e0782438720 --- /dev/null +++ b/addons/lunch/i18n/es.po @@ -0,0 +1,589 @@ +# Spanish translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 17:49+0000\n" +"Last-Translator: Raphael Collet (OpenERP) \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Resetear caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Pedidos de comida" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "¿Seguro que desea cancelar este pedido?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Movimientos de caja" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Agrupar por..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 días " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Hoy" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Marzo" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Día" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Cancelar pedido" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Importe" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Productos" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Importe disponible por usuario y caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mes " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Estadísticas de pedidos de comida" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Movimientos de caja" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmado" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirmar" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Buscar pedido de comida" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Estado" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "Nuevo" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Precio total" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Importe de caja por Usuario" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Fecha de creación" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nombre/Fecha" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descripción pedido" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Julio" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Caja" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 días " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mes-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Fecha de creación" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Categorías de producto " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Establecer a cero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Movimiento de caja" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Abril" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Septiembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Diciembre" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mes" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Nombre de la caja" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Sí" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categoría" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Año " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categorías de producto" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "No" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Confirmación de pedido" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "¿Está seguro que desea reiniciar esta caja de efectivo?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Agosto" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Análisis pedidos de comida" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Junio" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Nombre usuario" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Análisis ventas" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Comidas" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Usuario" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Fecha" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Noviembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Octubre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Enero" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Nombre caja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "Limpiar caja" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Activo" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Fecha pedido" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Caja para la comida " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Establecer caja a cero" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "Información general" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Cancelar" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Cajas " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Precio unitario" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Producto" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descripción" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Mayo" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Precio" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Buscar movimiento de caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Total caja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Producto comida" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Total restante" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Precio total" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Febrero" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nombre" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Importe total" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "Tareas realizadas en los últimos 30 días" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Categoría relacionada con los productos" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Cajas" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Pedido" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Pedido de comida" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Estado de la caja por usuario" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Gerente" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 días " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Para confirmar" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Año" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "Draft" +#~ msgstr "Borrador" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " El módulo base para manejar comidas.\n" +#~ "\n" +#~ " Permite gestionar los pedidos de comida, los movimientos de efectivo, la " +#~ "caja y los productos.\n" +#~ " Establece diferentes categorías para el producto.\n" +#~ " " + +#~ msgid "Lunch Module" +#~ msgstr "Módulo de comidas" + +#~ msgid "Category related to Products" +#~ msgstr "Categoría relacionada con los productos" + +#~ msgid "Invalid model name in the action definition." +#~ msgstr "Nombre del modelo inválido en la definición de acción." + +#~ msgid "" +#~ "The Object name must start with x_ and not contain any special character !" +#~ msgstr "" +#~ "¡El nombre del objeto debe empezar con x_ y no contener ningún carácter " +#~ "especial!" + +#~ msgid "Invalid XML for View Architecture!" +#~ msgstr "¡XML inválido para la definición de la vista!" diff --git a/addons/lunch/i18n/es_CR.po b/addons/lunch/i18n/es_CR.po new file mode 100644 index 00000000000..3415b8a68d5 --- /dev/null +++ b/addons/lunch/i18n/es_CR.po @@ -0,0 +1,596 @@ +# Spanish translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-02-17 19:52+0000\n" +"Last-Translator: Freddy Gonzalez \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" +"Language: es\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Resetear caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "Cuadro de cantidad en el año en curso" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Pedidos de comida" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "¿Seguro que desea cancelar este pedido?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Movimientos de caja" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Agrupar por..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 días " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Hoy" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Marzo" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Día" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Cancelar pedido" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" +"Usted puede crear en caja por el empleado, si desea realizar un seguimiento " +"de la cantidad adeudada por el empleado de acuerdo a lo que se ha ordenado." + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Importe" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Productos" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Importe disponible por usuario y caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mes " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Estadísticas de pedidos de comida" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Movimientos de caja" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmado" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirmar" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Buscar pedido de comida" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Estado" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "Nuevo" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Precio total" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Importe de caja por Usuario" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Fecha de creación" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nombre/Fecha" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descripción pedido" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "Cuadro de cantidad del mes pasado" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Julio" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Caja" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 días " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mes-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Fecha de creación" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Categorías de producto " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Establecer a cero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Movimiento de caja" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "Trabajos realizados en los últimos 365 días" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Abril" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Septiembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Diciembre" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mes" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Nombre de la caja" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Sí" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categoría" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Año " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categorías de producto" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "No" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Confirmación de pedido" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "¿Está seguro que desea reiniciar esta caja de efectivo?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" +"Definir todos los productos que los empleados pueden pedir para la hora del " +"almuerzo. Si pide comida en varios lugares, puede utilizar las categorías de " +"productos de dividir por el proveedor. Será más fácil para el gerente del " +"almuerzo para filtrar las órdenes de almuerzo por categorías." + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Agosto" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Análisis pedidos de comida" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Junio" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Nombre usuario" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Análisis ventas" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Comidas" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Usuario" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Fecha" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Noviembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Octubre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Enero" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Nombre caja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "Limpiar caja" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Activo" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Fecha pedido" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Caja para la comida " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Establecer caja a cero" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "Información general" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Cancelar" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Cajas " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Precio unitario" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Producto" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descripción" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Mayo" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Precio" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Buscar movimiento de caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Total caja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Producto comida" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Total restante" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Precio total" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Febrero" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nombre" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Importe total" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "Tareas realizadas en los últimos 30 días" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Cajas" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Pedido" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Pedido de comida" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "Cuadro de cantidad en el mes actual" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "Defina sus productos para el almuerzo" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "Tareas durante los últimos 7 días" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Estado de la caja por usuario" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Gerente" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 días " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Para confirmar" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Año" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "Crear almuerzos de cuadros en efectivo" + +#~ msgid "Category related to Products" +#~ msgstr "Categoría relacionada con los productos" + +#~ msgid "Draft" +#~ msgstr "Borrador" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " El módulo base para manejar comidas.\n" +#~ "\n" +#~ " Permite gestionar los pedidos de comida, los movimientos de efectivo, la " +#~ "caja y los productos.\n" +#~ " Establece diferentes categorías para el producto.\n" +#~ " " + +#~ msgid "Lunch Module" +#~ msgstr "Módulo de comidas" + +#~ msgid "Invalid model name in the action definition." +#~ msgstr "Nombre del modelo inválido en la definición de acción." + +#~ msgid "" +#~ "The Object name must start with x_ and not contain any special character !" +#~ msgstr "" +#~ "¡El nombre del objeto debe empezar con x_ y no contener ningún carácter " +#~ "especial!" + +#~ msgid "Invalid XML for View Architecture!" +#~ msgstr "¡XML inválido para la definición de la vista!" diff --git a/addons/lunch/i18n/es_MX.po b/addons/lunch/i18n/es_MX.po new file mode 100644 index 00000000000..d21682f1b55 --- /dev/null +++ b/addons/lunch/i18n/es_MX.po @@ -0,0 +1,560 @@ +# Spanish translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-01-11 11:15+0000\n" +"PO-Revision-Date: 2011-01-16 17:39+0000\n" +"Last-Translator: Jordi Esteve (www.zikzakmedia.com) " +"\n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-09-05 05:55+0000\n" +"X-Generator: Launchpad (build 13830)\n" + +#. module: lunch +#: wizard_view:lunch.cashbox.clean,init:0 +msgid "Reset cashbox" +msgstr "Resetear caja" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Pedidos de comida" + +#. module: lunch +#: wizard_view:lunch.order.cancel,init:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "¿Seguro que desea cancelar este pedido?" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Movimientos de caja" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:lunch.order:0 +#: view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Agrupar por..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 días " + +#. module: lunch +#: model:ir.module.module,description:lunch.module_meta_information +msgid "" +"\n" +" The base module to manage lunch\n" +"\n" +" keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +" Apply Different Category for the product.\n" +" " +msgstr "" +"\n" +" El módulo base para manejar comidas.\n" +"\n" +" Permite gestionar los pedidos de comida, los movimientos de efectivo, la " +"caja y los productos.\n" +" Establece diferentes categorías para el producto.\n" +" " + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:lunch.order:0 +msgid "Today" +msgstr "Hoy" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "March" +msgstr "Marzo" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total :" + +#. module: lunch +#: field:report.lunch.amount,day:0 +#: view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Día" + +#. module: lunch +#: model:ir.actions.wizard,name:lunch.wizard_id_cancel +#: wizard_view:lunch.order.cancel,init:0 +msgid "Cancel Order" +msgstr "Cancelar pedido" + +#. module: lunch +#: field:lunch.cashmove,amount:0 +#: field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Importe" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form +#: view:lunch.product:0 +msgid "Products" +msgstr "Productos" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Importe disponible por usuario y caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mes " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Estadísticas de pedidos de comida" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: view:lunch.cashmove:0 +#: field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Movimientos de caja" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmado" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirmar" + +#. module: lunch +#: model:ir.module.module,shortdesc:lunch.module_meta_information +msgid "Lunch Module" +msgstr "Módulo de comidas" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Buscar pedido de comida" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Estado" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Precio total" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Importe de caja por Usuario" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Fecha de creación" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nombre/Fecha" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descripción pedido" + +#. module: lunch +#: model:ir.actions.wizard,name:lunch.lunch_order_confirm +#: wizard_button:lunch.order.confirm,init,go:0 +msgid "Confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "July" +msgstr "Julio" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Box" +msgstr "Caja" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 días " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mes-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Fecha de creación" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Categorías de producto " + +#. module: lunch +#: wizard_button:lunch.cashbox.clean,init,zero:0 +msgid "Set to Zero" +msgstr "Establecer a cero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Movimiento de caja" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "April" +msgstr "Abril" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "September" +msgstr "Septiembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "December" +msgstr "Diciembre" + +#. module: lunch +#: field:report.lunch.amount,month:0 +#: view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mes" + +#. module: lunch +#: wizard_field:lunch.order.confirm,init,confirm_cashbox:0 +msgid "Name of box" +msgstr "Nombre de la caja" + +#. module: lunch +#: wizard_button:lunch.order.cancel,init,cancel:0 +msgid "Yes" +msgstr "Sí" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category +#: view:lunch.category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categoría" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Año " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categorías de producto" + +#. module: lunch +#: wizard_button:lunch.order.cancel,init,end:0 +msgid "No" +msgstr "No" + +#. module: lunch +#: wizard_view:lunch.order.confirm,init:0 +msgid "Orders Confirmation" +msgstr "Confirmación de pedido" + +#. module: lunch +#: wizard_view:lunch.cashbox.clean,init:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "¿Está seguro que desea reiniciar esta caja de efectivo?" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "Draft" +msgstr "Borrador" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "August" +msgstr "Agosto" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Análisis pedidos de comida" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "June" +msgstr "Junio" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 +#: field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 +msgid "User Name" +msgstr "Nombre usuario" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Análisis ventas" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch +msgid "Lunch" +msgstr "Comidas" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:report.lunch.order:0 +msgid "User" +msgstr "Usuario" + +#. module: lunch +#: field:lunch.order,date:0 +msgid "Date" +msgstr "Fecha" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "November" +msgstr "Noviembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "October" +msgstr "Octubre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "January" +msgstr "Enero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "Limpiar caja" + +#. module: lunch +#: field:lunch.cashmove,active:0 +#: field:lunch.product,active:0 +msgid "Active" +msgstr "Activo" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Fecha pedido" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Caja para la comida " + +#. module: lunch +#: model:ir.actions.wizard,name:lunch.wizard_clean_cashbox +msgid "Set CashBox to Zero" +msgstr "Establecer caja a cero" + +#. module: lunch +#: field:lunch.cashmove,box:0 +#: field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Nombre caja" + +#. module: lunch +#: wizard_button:lunch.cashbox.clean,init,end:0 +#: wizard_button:lunch.order.confirm,init,end:0 +msgid "Cancel" +msgstr "Cancelar" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Cajas " + +#. module: lunch +#: rml:lunch.order:0 +msgid "Unit Price" +msgstr "Precio unitario" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Producto" + +#. module: lunch +#: rml:lunch.order:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descripción" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "May" +msgstr "Mayo" + +#. module: lunch +#: field:lunch.order,price:0 +#: field:lunch.product,price:0 +msgid "Price" +msgstr "Precio" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Buscar movimiento de caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Total caja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Producto comida" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Total restante" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Precio total" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "February" +msgstr "Febrero" + +#. module: lunch +#: field:lunch.cashbox,name:0 +#: field:lunch.cashmove,name:0 +#: field:lunch.category,name:0 +#: rml:lunch.order:0 +#: field:lunch.product,name:0 +msgid "Name" +msgstr "Nombre" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Importe total" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Categoría relacionada con los productos" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form +#: view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Cajas" + +#. module: lunch +#: view:lunch.category:0 +#: rml:lunch.order:0 +#: view:lunch.order:0 +msgid "Order" +msgstr "Pedido" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch +#: report:lunch.order:0 +msgid "Lunch Order" +msgstr "Pedido de comida" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Estado de la caja por usuario" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Gerente" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 días " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Para confirmar" + +#. module: lunch +#: field:report.lunch.amount,year:0 +#: view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Año" + +#~ msgid "Invalid model name in the action definition." +#~ msgstr "Nombre del modelo inválido en la definición de acción." + +#~ msgid "" +#~ "The Object name must start with x_ and not contain any special character !" +#~ msgstr "" +#~ "¡El nombre del objeto debe empezar con x_ y no contener ningún carácter " +#~ "especial!" + +#~ msgid "Invalid XML for View Architecture!" +#~ msgstr "¡XML inválido para la definición de la vista!" diff --git a/addons/lunch/i18n/es_PY.po b/addons/lunch/i18n/es_PY.po new file mode 100644 index 00000000000..954a6cd4330 --- /dev/null +++ b/addons/lunch/i18n/es_PY.po @@ -0,0 +1,577 @@ +# Spanish (Paraguay) translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2011-03-21 16:32+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Spanish (Paraguay) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Resetear caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Pedidos de comida" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "¿Seguro que desea cancelar este pedido?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Movimientos de caja" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Agrupar por..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 Días " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Hoy" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Marzo" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Día" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Cancelar pedido" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Importe" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Productos" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Importe disponible por usuario y caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mes " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Estadísticas de pedidos de comida" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Movimientos de caja" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmado" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirmar" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Buscar pedido de comida" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Departamento" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Precio total" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Importe de caja por Usuario" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Fecha creación" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nombre/Fecha" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descripción pedido" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Julio" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Caja" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 Días " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mes-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Fecha de creación" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Categorías de producto " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Establecer a cero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Movimiento de caja" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Abril" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Septiembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Diciembre" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mes" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Nombre de la caja" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Sí" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categoría" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Año " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categorías de producto" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "No" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Confirmación de pedido" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "¿Está seguro que desea reiniciar esta caja de efectivo?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Agosto" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Análisis pedidos de comida" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Junio" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Nombre del usuario" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Análisis ventas" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Comidas" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Usuario" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Fecha" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Noviembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Octubre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Enero" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Nombre caja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "Limpiar caja" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Activo" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Fecha pedido" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Caja para la comida " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Establecer caja a cero" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Cancelar" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Cajas " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Precio Unitario" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Producto" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descripción" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "may" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Precio" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Buscar movimiento de caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Total caja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Producto comida" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Total restante" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Precio total" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Febrero" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nombre" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Importe total" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Cajas" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Orden" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Pedido de comida" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Estado de la caja por usuario" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Gerente" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 Días " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Para confirmar" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Año" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " El módulo base para manejar comidas.\n" +#~ "\n" +#~ " Permite gestionar los pedidos de comida, los movimientos de efectivo, la " +#~ "caja y los productos.\n" +#~ " Establece diferentes categorías para el producto.\n" +#~ " " + +#~ msgid "Lunch Module" +#~ msgstr "Módulo de comidas" + +#~ msgid "Draft" +#~ msgstr "Borrador" + +#~ msgid "Category related to Products" +#~ msgstr "Categoría relacionada con los productos" diff --git a/addons/lunch/i18n/es_VE.po b/addons/lunch/i18n/es_VE.po new file mode 100644 index 00000000000..d21682f1b55 --- /dev/null +++ b/addons/lunch/i18n/es_VE.po @@ -0,0 +1,560 @@ +# Spanish translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-01-11 11:15+0000\n" +"PO-Revision-Date: 2011-01-16 17:39+0000\n" +"Last-Translator: Jordi Esteve (www.zikzakmedia.com) " +"\n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-09-05 05:55+0000\n" +"X-Generator: Launchpad (build 13830)\n" + +#. module: lunch +#: wizard_view:lunch.cashbox.clean,init:0 +msgid "Reset cashbox" +msgstr "Resetear caja" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Pedidos de comida" + +#. module: lunch +#: wizard_view:lunch.order.cancel,init:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "¿Seguro que desea cancelar este pedido?" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Movimientos de caja" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:lunch.order:0 +#: view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Agrupar por..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 días " + +#. module: lunch +#: model:ir.module.module,description:lunch.module_meta_information +msgid "" +"\n" +" The base module to manage lunch\n" +"\n" +" keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +" Apply Different Category for the product.\n" +" " +msgstr "" +"\n" +" El módulo base para manejar comidas.\n" +"\n" +" Permite gestionar los pedidos de comida, los movimientos de efectivo, la " +"caja y los productos.\n" +" Establece diferentes categorías para el producto.\n" +" " + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:lunch.order:0 +msgid "Today" +msgstr "Hoy" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "March" +msgstr "Marzo" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total :" + +#. module: lunch +#: field:report.lunch.amount,day:0 +#: view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Día" + +#. module: lunch +#: model:ir.actions.wizard,name:lunch.wizard_id_cancel +#: wizard_view:lunch.order.cancel,init:0 +msgid "Cancel Order" +msgstr "Cancelar pedido" + +#. module: lunch +#: field:lunch.cashmove,amount:0 +#: field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Importe" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form +#: view:lunch.product:0 +msgid "Products" +msgstr "Productos" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Importe disponible por usuario y caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mes " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Estadísticas de pedidos de comida" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: view:lunch.cashmove:0 +#: field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Movimientos de caja" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmado" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirmar" + +#. module: lunch +#: model:ir.module.module,shortdesc:lunch.module_meta_information +msgid "Lunch Module" +msgstr "Módulo de comidas" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Buscar pedido de comida" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Estado" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Precio total" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Importe de caja por Usuario" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Fecha de creación" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nombre/Fecha" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descripción pedido" + +#. module: lunch +#: model:ir.actions.wizard,name:lunch.lunch_order_confirm +#: wizard_button:lunch.order.confirm,init,go:0 +msgid "Confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "July" +msgstr "Julio" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Box" +msgstr "Caja" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 días " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mes-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Fecha de creación" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Categorías de producto " + +#. module: lunch +#: wizard_button:lunch.cashbox.clean,init,zero:0 +msgid "Set to Zero" +msgstr "Establecer a cero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Movimiento de caja" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "April" +msgstr "Abril" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "September" +msgstr "Septiembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "December" +msgstr "Diciembre" + +#. module: lunch +#: field:report.lunch.amount,month:0 +#: view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mes" + +#. module: lunch +#: wizard_field:lunch.order.confirm,init,confirm_cashbox:0 +msgid "Name of box" +msgstr "Nombre de la caja" + +#. module: lunch +#: wizard_button:lunch.order.cancel,init,cancel:0 +msgid "Yes" +msgstr "Sí" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category +#: view:lunch.category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categoría" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Año " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categorías de producto" + +#. module: lunch +#: wizard_button:lunch.order.cancel,init,end:0 +msgid "No" +msgstr "No" + +#. module: lunch +#: wizard_view:lunch.order.confirm,init:0 +msgid "Orders Confirmation" +msgstr "Confirmación de pedido" + +#. module: lunch +#: wizard_view:lunch.cashbox.clean,init:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "¿Está seguro que desea reiniciar esta caja de efectivo?" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "Draft" +msgstr "Borrador" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "August" +msgstr "Agosto" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Análisis pedidos de comida" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "June" +msgstr "Junio" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 +#: field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 +msgid "User Name" +msgstr "Nombre usuario" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Análisis ventas" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch +msgid "Lunch" +msgstr "Comidas" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:report.lunch.order:0 +msgid "User" +msgstr "Usuario" + +#. module: lunch +#: field:lunch.order,date:0 +msgid "Date" +msgstr "Fecha" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "November" +msgstr "Noviembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "October" +msgstr "Octubre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "January" +msgstr "Enero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "Limpiar caja" + +#. module: lunch +#: field:lunch.cashmove,active:0 +#: field:lunch.product,active:0 +msgid "Active" +msgstr "Activo" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Fecha pedido" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Caja para la comida " + +#. module: lunch +#: model:ir.actions.wizard,name:lunch.wizard_clean_cashbox +msgid "Set CashBox to Zero" +msgstr "Establecer caja a cero" + +#. module: lunch +#: field:lunch.cashmove,box:0 +#: field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Nombre caja" + +#. module: lunch +#: wizard_button:lunch.cashbox.clean,init,end:0 +#: wizard_button:lunch.order.confirm,init,end:0 +msgid "Cancel" +msgstr "Cancelar" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Cajas " + +#. module: lunch +#: rml:lunch.order:0 +msgid "Unit Price" +msgstr "Precio unitario" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Producto" + +#. module: lunch +#: rml:lunch.order:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descripción" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "May" +msgstr "Mayo" + +#. module: lunch +#: field:lunch.order,price:0 +#: field:lunch.product,price:0 +msgid "Price" +msgstr "Precio" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Buscar movimiento de caja" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Total caja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Producto comida" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Total restante" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Precio total" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "February" +msgstr "Febrero" + +#. module: lunch +#: field:lunch.cashbox,name:0 +#: field:lunch.cashmove,name:0 +#: field:lunch.category,name:0 +#: rml:lunch.order:0 +#: field:lunch.product,name:0 +msgid "Name" +msgstr "Nombre" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Importe total" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Categoría relacionada con los productos" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form +#: view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Cajas" + +#. module: lunch +#: view:lunch.category:0 +#: rml:lunch.order:0 +#: view:lunch.order:0 +msgid "Order" +msgstr "Pedido" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch +#: report:lunch.order:0 +msgid "Lunch Order" +msgstr "Pedido de comida" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Estado de la caja por usuario" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Gerente" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 días " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Para confirmar" + +#. module: lunch +#: field:report.lunch.amount,year:0 +#: view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Año" + +#~ msgid "Invalid model name in the action definition." +#~ msgstr "Nombre del modelo inválido en la definición de acción." + +#~ msgid "" +#~ "The Object name must start with x_ and not contain any special character !" +#~ msgstr "" +#~ "¡El nombre del objeto debe empezar con x_ y no contener ningún carácter " +#~ "especial!" + +#~ msgid "Invalid XML for View Architecture!" +#~ msgstr "¡XML inválido para la definición de la vista!" diff --git a/addons/lunch/i18n/fi.po b/addons/lunch/i18n/fi.po new file mode 100644 index 00000000000..2a065665c1a --- /dev/null +++ b/addons/lunch/i18n/fi.po @@ -0,0 +1,555 @@ +# Finnish translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2011-02-19 16:47+0000\n" +"Last-Translator: Pekka Pylvänäinen \n" +"Language-Team: Finnish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Haluatko varmasti poistaa tämän tilauksen ?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Ryhmittele" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Vahvista tilaus" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Tänään" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Maaliskuu" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Yhteensä:" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Päivä" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Peruuta tilaus" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Tuotteet" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Vahvistettu" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Vahvista" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Vahvista tilaus" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Heinäkuu" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 päivää " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Luontipäivä" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Tuotekategoriat " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Huhtikuu" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Syyskuu" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Joulukuu" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Kategoria" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Tuotekategoriat" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Ei" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Elokuu" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Kesäkuu" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Käyttäjänimi" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Myyntianalyysi" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Käyttäjä" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Marraskuu" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Lokakuu" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Tammikuu" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Aktiivinen" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Peruuta" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Yksikköhinta" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Tuote" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Kuvaus" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Toukokuu" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Hinta" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Hinta yhteensä" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Helmikuu" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nimi" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Yhteensä" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Tilaus" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "Draft" +#~ msgstr "Luonnos" diff --git a/addons/lunch/i18n/fr.po b/addons/lunch/i18n/fr.po new file mode 100644 index 00000000000..152640fbad6 --- /dev/null +++ b/addons/lunch/i18n/fr.po @@ -0,0 +1,589 @@ +# French translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 17:25+0000\n" +"Last-Translator: Raphael Collet (OpenERP) \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Réinitialiser la caisse" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Commandes de repas" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Confirmez-vous l'annulation de cette commande ?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Déplacement de trésorerie" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Grouper par ..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "confirmer la commande" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 jours " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Aujourd'hui" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Mars" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Jour" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Annuler la commande" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Montant" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Produits" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Montant disponible par utilisateur et par boîte" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mois " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Statistiques des commandes de repas" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Transfert de trésorerie" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmée" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirmer" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Recherche de commande de repas" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "État" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Prix total" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Montant de la boîte par utilisateur" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Date de création" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nom/Date" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Description de commande" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Confirmer la commande" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Juillet" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Boîte" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 jours " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mois -1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Date de création" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Catégories de produits " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Mettre à zéro" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Déplacement de trésorerie" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "avril" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "septembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "décembre" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mois" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Nom de la boîte" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Oui" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Catégorie" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Année " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Catégories de produits" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Non" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Confirmation de commandes" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "Êtes-vous sûr de vouloir réinitialiser cette caisse ?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "août" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Analyse des commandes de repas" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "juin" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Nom d'utilisateur" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Analyse des ventes" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Déjeuner" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Utilisateur" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Date" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "novembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "octobre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "janvier" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Nom de boîte" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "nettoyer la caisse" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Actif" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Date de commande" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Caisse pour les repas " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Mettre la caisse à zéro" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Annuler" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Caisses " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Prix unitaire" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Produit" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Description" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "mai" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Prix" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Recherche de mouvement de trésorerie" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Total boîte" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Produit repas" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Total restant" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Prix total" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "février" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nom" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Montant total" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Catégorie relative aux produits" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Caisses" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Commande" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Commande de repas" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Situation de trésorerie par utilisateur" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Responsable" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 Jours " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "A confirmer" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Année" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "Invalid model name in the action definition." +#~ msgstr "Nom de modèle incorrect dans la définition de l'action" + +#~ msgid "Invalid XML for View Architecture!" +#~ msgstr "XML incorrect dans l'architecture de la vue !" + +#~ msgid "Draft" +#~ msgstr "Brouillon" + +#~ msgid "" +#~ "The Object name must start with x_ and not contain any special character !" +#~ msgstr "" +#~ "Le nom de l'objet doit commencer par x_ et ne doit contenir aucun caractère " +#~ "spécial !" + +#~ msgid "Lunch Module" +#~ msgstr "Module déjeuner" + +#~ msgid "Category related to Products" +#~ msgstr "Catégorie relative aux produits" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " Le module de base pour gérer l'organisation des repas\n" +#~ "\n" +#~ " Suivre les commandes de repas, les mouvements d'argent, la caisse, les " +#~ "produits.\n" +#~ " Appliquer différentes catégories de produits.\n" +#~ " " diff --git a/addons/lunch/i18n/gl.po b/addons/lunch/i18n/gl.po new file mode 100644 index 00000000000..f84fe5e4858 --- /dev/null +++ b/addons/lunch/i18n/gl.po @@ -0,0 +1,575 @@ +# Galician translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 17:41+0000\n" +"Last-Translator: Raphael Collet (OpenERP) \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Resetear caixa" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Pedidos de comida" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Realmente desexa anular este pedido?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Movementos de caixa" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Agrupar por..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Confirmar pedido" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 días " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Hoxe" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Marzo" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total:" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Día" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Anular pedido" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Importe" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Produtos" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Importe dispoñible por usuario e caixa" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mes " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Estatísticas de pedidos de comida" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Movementos de caixa" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmado" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirmar" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Buscar pedido de comida" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Estado" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Prezo total" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Importe de caixa por Usuario" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Data de creación" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nome/Data" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descrición pedido" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Confirmar o pedido" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Xullo" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Caixa" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 días " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mes-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Data de creación" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Categorías de produto " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Establecer a cero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Movemento de caixa" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Abril" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Setembro" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Decembro" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mes" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Nome da caixa" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Sí" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categoría" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Año " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categorías de produto" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Non" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Confirmación de pedido" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "Está seguro que desexa reiniciar esta caixa de efectivo?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Agosto" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Análise dos pedidos de comida" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Xuño" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Nome de usuario" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Análise de vendas" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Comida" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Usuario" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Data" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Novembro" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Outubro" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Xaneiro" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Nome caixa" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "Limpar caixa" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Activo" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Data pedido" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Caixa para a comida " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Establecer caixa a cero" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Anular" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Caixas " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Prezo unidade" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Produto" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descrición" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Maio" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Prezo" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Buscar movemento de caixa" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Total caixa" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Produto comida" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Total restante" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Prezo total" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Febreiro" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nome" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Importe total" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Categoría relacionada cos produtos" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Caixas" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Pedido" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Pedido de comida" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Estado da caixa por usuario" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Xestor" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 días " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Para confirmar" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Ano" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " O módulo base para manexar comidas. Permite xestionar os pedidos de " +#~ "comida, os movementos de efectivo, a caixa e os produtos. Establece " +#~ "diferentes categorías para o produto.\n" +#~ " " + +#~ msgid "Lunch Module" +#~ msgstr "Módulo de comidas" + +#~ msgid "Draft" +#~ msgstr "Borrador" + +#~ msgid "Category related to Products" +#~ msgstr "Categoría relacionada cos produtos" diff --git a/addons/lunch/i18n/hr.po b/addons/lunch/i18n/hr.po new file mode 100644 index 00000000000..c534383e261 --- /dev/null +++ b/addons/lunch/i18n/hr.po @@ -0,0 +1,552 @@ +# Croatian translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2011-12-19 17:25+0000\n" +"Last-Translator: Goran Kliska \n" +"Language-Team: Croatian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Grupiraj po..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 Dana " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Danas" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Ožujak" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Ukupno :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Dan" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Otkaži narudžbu" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Iznos" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Proizvodi" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Potvrđen" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" diff --git a/addons/lunch/i18n/hu.po b/addons/lunch/i18n/hu.po new file mode 100644 index 00000000000..0b93eda8215 --- /dev/null +++ b/addons/lunch/i18n/hu.po @@ -0,0 +1,577 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * lunch +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0dev\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 17:38+0000\n" +"Last-Translator: NOVOTRADE RENDSZERHÁZ ( novotrade.hu ) " +"\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Kézi pénztár ürítése" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Ebédrendelések" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Biztos, hogy törölni akarja ezt a rendelést?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Pénzmozgások" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Csoportosítás..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "megerősített rendelés" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " Hetente " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Ma" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Március" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Összesen :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Nap" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Rendelés törlése" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Összeg" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Termékek" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Pénzösszeg elérhető a felhasználó és a kassza által" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Hónap " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Ebédrendelés statisztika" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Pénzmozgás" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Megerősített" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Megerősítés" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Ebédrendelés keresése" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Státusz" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Teljes ár" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Felhasználó része a pénztárban" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Létrehozás dátuma" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Név/Dátum" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Rendelés leírása" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Rendelés megerősítése" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Július" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Doboz" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 nap " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Hónap-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Létrehozás dátuma" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Termék kategóriák " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Beállítás nullára" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Pénz mozgatás" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Április" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Szeptember" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "December" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Hónap" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Doboz megnevezése" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Igen" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Kategória" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Év " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Termékkategóriák" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Nem" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Rendelések megerősítése" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "Biztos benne hogy törli a kassza összes előzményét és üríti azt?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Augusztus" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Ebédrendelés elemzése" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Június" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Felhasználónév" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Értékesítési elemzés" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Ebéd" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Felhasználó" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Dátum" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "November" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Október" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Január" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Doboz megnevezése" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "Kassza tisztítása" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Aktív" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Rendelés dátuma" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Ebédpénz kassza " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Kassza nullázása" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Mégse" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Kézi kasszák " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Egységár" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Termék" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Leírás" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Május" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Ár" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Pénzmozgás keresése" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Osszes doboz" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Ebéd termék" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Összes hátralévő" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Végösszeg" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Február" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Név" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Összesen" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Termékkel összekapcsolódó kategóriák" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Kasszák" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Megrendelés" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Ebédrendelés" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Készpénzállapot felhasználónként" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Menedzser" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 nap " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Megerősített" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Év" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "Lunch Module" +#~ msgstr "Ebédmodul" + +#~ msgid "Draft" +#~ msgstr "Tervezet" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " Alap modul az ebédpénz nyilvántartásához\n" +#~ "\n" +#~ " nyilvántartja az ebéd rendelést, a pénz mozgást, kézi pénztárat, " +#~ "terméket.\n" +#~ " Több termék kategória is alkalmazható.\n" +#~ " " + +#~ msgid "Category related to Products" +#~ msgstr "Termékkel összekapcsolódó kategóriák" diff --git a/addons/lunch/i18n/it.po b/addons/lunch/i18n/it.po new file mode 100644 index 00000000000..4fe86dc254c --- /dev/null +++ b/addons/lunch/i18n/it.po @@ -0,0 +1,577 @@ +# Italian translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 18:14+0000\n" +"Last-Translator: Raphael Collet (OpenERP) \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Ordini pranzo" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Siete sicuri di volere annullare questo ordine?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Movimenti di cassa" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Raggruppa per..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Conferma ordine" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 giorni " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Oggi" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Marzo" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Totale:" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Giorno" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Annulla Ordine" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Importo" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Prodotti" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mese " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Statistiche ordini pranzo" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Movimento di cassa" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confermato" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Conferma" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Cerca ordine pranzo" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Stato" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Prezzo totale" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Data creazione" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nome / Data" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descrizione ordine" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Conferma Ordine" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Luglio" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Scatola" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 giorni " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mese-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Data di Creazione" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Categorie prodotto " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Imposta a Zero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Movimento di cassa" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Aprile" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Settembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Dicembre" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mese" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Sì" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categoria" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Anno " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categorie Prodotto" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "No" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Conferma ordini" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "Siete sicuri di volere resettare questa cassa comune?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Agosto" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Analisi ordini pranzo" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Giugno" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Nome utente" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Analisi delle vendite" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Pranzo" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Utente" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Data" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Novembre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Ottobre" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Gennaio" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Attivo" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Data ordine" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Annulla" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Prezzo unitario" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Prodotto" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descrizione" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Maggio" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Prezzo" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Cerca movimento di cassa" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Totale rimanente" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Prezzo totale" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Febbraio" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nome" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Importo Totale" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Categoria relativa ai prodotti" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Ordine" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Ordine pranzo" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Posizione cassa per utente" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Manager" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 giorni " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Da confermare" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Anno" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "Lunch Module" +#~ msgstr "Modulo pranzo" + +#~ msgid "Draft" +#~ msgstr "Bozza" + +#~ msgid "Category related to Products" +#~ msgstr "Categoria relativa ai prodotti" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " Il modulo base per gestire il pranzo\n" +#~ "\n" +#~ " tiene traccia degli ordini del pranzo, movimenti di cassa, cassa comune, " +#~ "prodotti.\n" +#~ " Applica differenti categorie per i prodotti.\n" +#~ " " diff --git a/addons/lunch/i18n/ja.po b/addons/lunch/i18n/ja.po new file mode 100644 index 00000000000..46a179d8188 --- /dev/null +++ b/addons/lunch/i18n/ja.po @@ -0,0 +1,554 @@ +# Japanese translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-06-08 02:44+0000\n" +"Last-Translator: Akira Hiyama \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "金庫のリセット" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "現在年のボックス数" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "昼食オーダー" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "本当にこのオーダーをキャンセルしますか?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "現金移動" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "グループ化…" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "オーダーの確認" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7日 " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "本日" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "3月" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "合計:" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "日" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "オーダーのキャンセル" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "従業員毎に何がオーダーされたかによる金額を追跡したい場合は、従業員毎の金庫を作成することができます。" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "量" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "製品" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "ユーザとボックスで使用可能な量" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " 月 " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "昼食オーダー統計" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "現金移動" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "確認済" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "確認" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "昼食オーダーの検索" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "状態" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "新規" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "合計価格" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "ユーザ毎のボックス量" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "作成日" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "名前 / 日付" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "オーダーの詳細" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "先月のボックス量" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "オーダーの確認" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "7月" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "ボックス" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365日 " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " 月-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "作成日" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " 製品分類 " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "0に設定" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "現金移動" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "直近365日で実行されたタスク" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "4月" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "9月" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "12月" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "月" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "ボックスの名前" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "分類" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " 年 " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "製品分類" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "オーダー確認" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "本当にこの金庫をリセットしますか?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" +"従業員が昼食時間にオーダーできる全ての製品を定義します。複数の場所で昼食をオーダーするなら、仕入先毎に分離した製品分類を使うことができます。これは昼食マネ" +"ジャにとって分類別に昼食オーダーをフィルタすることを容易にします。" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "8月" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "昼食オーダー分析" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "6月" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "ユーザ名" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "販売分析" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "昼食" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "ユーザ" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "日付" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "11月" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "10月" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "1月" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "ボックス名" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "金庫のクリア" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "アクティブ" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "日付順" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "昼食用金庫 " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "金庫に0を設定" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "一般情報" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "キャンセル" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " 金庫 " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "単価" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "製品" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "詳細" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "5月" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "価格" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "現金移動の検索" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "ボックス合計" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "昼食製品" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "残り合計" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "合計価格" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "2月" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "名前" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "合計金額" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "直近30日で実行したタスク" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "製品に関連する分類" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "金庫" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "オーダー" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "昼食オーダー" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "現在月のボックス量" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "昼食製品を定義して下さい。" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "直近7日間のタスク" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "ユーザ毎の現金持高" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "マネジャ" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30日 " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "確認" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "年" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "昼食用金庫の作成" diff --git a/addons/lunch/i18n/lunch.pot b/addons/lunch/i18n/lunch.pot new file mode 100644 index 00000000000..fa0d7310ae5 --- /dev/null +++ b/addons/lunch/i18n/lunch.pot @@ -0,0 +1,570 @@ +# #-#-#-#-# lunch.pot (OpenERP Server 6.1rc1) #-#-#-#-# +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * lunch +# +# #-#-#-#-# lunch.pot.web (PROJECT VERSION) #-#-#-#-# +# Translations template for PROJECT. +# Copyright (C) 2012 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2012. +# +#, fuzzy +msgid "" +msgstr "" +"#-#-#-#-# lunch.pot (OpenERP Server 6.1rc1) #-#-#-#-#\n" +"Project-Id-Version: OpenERP Server 6.1rc1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-02-08 00:36+0000\n" +"PO-Revision-Date: 2012-02-08 00:36+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" +"#-#-#-#-# lunch.pot.web (PROJECT VERSION) #-#-#-#-#\n" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.6\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" diff --git a/addons/lunch/i18n/nl.po b/addons/lunch/i18n/nl.po new file mode 100644 index 00000000000..5317a3c7159 --- /dev/null +++ b/addons/lunch/i18n/nl.po @@ -0,0 +1,552 @@ +# Dutch translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-07-29 09:58+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Reset kas" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "Kasbedrag in huidig jaar" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Lunch Orders" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Weet u zeker dat u deze order wilt annuleren?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Kas mutaties" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Groepeer op.." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Bevestig order" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 Dagen " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Vandaag" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Maart" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Totaal :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Dag" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Annuleer order" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Bedrag" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Producten" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Bedrag beschikbaar per gebruiker en kas" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Maand " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Lunch order analyses" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Kas muttatie" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Bevestigd" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Bevestig" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Zoek lunchorders" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Status" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "Nieuw" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Totaalprijs" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Aanmaakdatum" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Naam/Datum" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Order omschrijving" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Bevestig Order" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Juli" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 Dagen " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Maand-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Aanmaakdatum" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Product categorieën " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Zet op nul" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Kas mutatie" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "Taken uitgevoert de laatste 365 dagen" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "April" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "September" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "December" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Maand" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Ja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categorie" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Jaar " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Product categorieën" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Nee" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Order bevestigen" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Augustus" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Lunch orders analyse" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Juni" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Gebruikersnaam" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Verkoopanalyse" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Lunch" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Gebruiker" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Datum" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "November" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Oktober" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Januari" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Actief" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Orderdatum" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "Algemene informatie" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Anulleren" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Eenheidsprijs" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Product" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Omschrijving" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Mei" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Prijs" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Lunch product" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Totaal overgebleven" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Februari" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Naam" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Totaalbedrag" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "Taken uitgevoerd in de laatste 30 dagen" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Order" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Luchorder" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "Definieer uw lunch producten" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "Taken afgelopen 7 dagen" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Manager" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 Dagen " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Jaar" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" diff --git a/addons/lunch/i18n/pt.po b/addons/lunch/i18n/pt.po new file mode 100644 index 00000000000..5920eb0984c --- /dev/null +++ b/addons/lunch/i18n/pt.po @@ -0,0 +1,567 @@ +# Portuguese translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2010-12-15 08:50+0000\n" +"Last-Translator: OpenERP Administrators \n" +"Language-Team: Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Tem a certeza de que quer cancelar esta ordem?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Agrupar por..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 dias " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Hoje" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Março" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Dia" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Cancelar Ordem" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Montante" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Artigos" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mês " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmado" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirmar" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Estado" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "Novo" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Preço Total" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Data da Criação" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nome/Data" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descrição da Ordem" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Confirmar Ordem" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Julho" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Caixa" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 dias " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mês-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Data de Criação" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Categorias do artigo " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Por a zero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Abril" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Setembro" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Dezembro" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mês" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Nome da caixa" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Sim" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categori­a" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Ano " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categorias do Artigo" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Não" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Confirmação de ordens" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Agosto" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Junho" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Nome do Utilizador" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Análise de vendas" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Almoço" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Utilizador" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Data" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Novembro" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Outubro" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Janeiro" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Nome Caixa" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Ativo" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Data da ordem" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "Informação Geral" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Cancelar" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Preço Unitário" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Artigo" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descrição" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Maio" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Preço" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Preço total" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Fevereiro" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nome" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Montante Total" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Ordem" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Gestor" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 dias " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Para confirmar" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Ano" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "Invalid model name in the action definition." +#~ msgstr "Nome de modelo inválido na definição da ação" + +#~ msgid "Invalid XML for View Architecture!" +#~ msgstr "XML inválido para a arquitetura da vista" + +#~ msgid "Draft" +#~ msgstr "Rascunho" + +#~ msgid "" +#~ "The Object name must start with x_ and not contain any special character !" +#~ msgstr "" +#~ "O nome do Objeto deve começar com x_ e não pode conter nenhum caracter " +#~ "especial !" diff --git a/addons/lunch/i18n/pt_BR.po b/addons/lunch/i18n/pt_BR.po new file mode 100644 index 00000000000..38305da7217 --- /dev/null +++ b/addons/lunch/i18n/pt_BR.po @@ -0,0 +1,555 @@ +# Brazilian Portuguese translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2011-03-15 01:10+0000\n" +"Last-Translator: Emerson \n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Tem certeza que deseja cancelar este pedido?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Agrupar Por..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "confirmar o Pedido" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 Dias " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Hoje" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Março" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Dia" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Cancelar Pedido" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Valor" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Produtos" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Mês " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmado" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirmar" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Status" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Preço Total" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Data de Criação" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nome/Data" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descrição do Pedido" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Confirmar Pedido" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Julho" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Caixa" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 dias " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Mês-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Data de Criação" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Definir como Zero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Abril" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Setembro" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Dezembro" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Mês" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Sim" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categoria" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Ano " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categorias de Produtos" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Não" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Agosto" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Junho" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Nome do Usuário" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Análise de Vendas" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Usuário" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Data" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Novembro" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Outubro" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Janeiro" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Ativo" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Data do Pedido" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Cancelar" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Preço Unitário" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Produto" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descrição" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Maio" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Preço" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Fevereiro" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nome" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Valor total" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Pedido" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Gerente" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 Dias " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "Draft" +#~ msgstr "Provisório" diff --git a/addons/lunch/i18n/ro.po b/addons/lunch/i18n/ro.po new file mode 100644 index 00000000000..47e0409b19a --- /dev/null +++ b/addons/lunch/i18n/ro.po @@ -0,0 +1,582 @@ +# Romanian translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 17:51+0000\n" +"Last-Translator: Raphael Collet (OpenERP) \n" +"Language-Team: Romanian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Resetati casa de bani" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "Suma din casa de bani in anul curent" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Comenzi pranz" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Sunteti sigur(a) că doriti sa anulati aceasta comanda?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Miscari Numerar" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Grupati dupa..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "confirmati Comanda" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 Zile " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Astazi" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Martie" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Total :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Zi" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Anulati Comanda" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" +"Puteti crea casa de bani per angajat daca doriti sa tineti evidenta sumei " +"datorate de angajat in functie de ceea ce a oferit." + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Suma" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Produse" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Suma disponibila dupa utilizator si casa de bani" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Luna " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Statistici Comenzi pranz" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Miscare numerar" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Confirmat(a)" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Confirmati" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Cautati Comanda pranz" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Stare" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "Nou(a)" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Pret total" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Suma din casa de bani dupa Utilizator" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Data crearii" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Nume/Data" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Descriere comanda" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "Suma din casa de bani luna trecuta" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Confirmati comanda" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Iulie" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Caseta" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 Zile " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Luna-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Data crearii" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Categorii Produs " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Setati pe zero" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Miscare numerar" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "Sarcini efectuate in ultimele 365 de zile" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Aprilie" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Septembrie" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Decembrie" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Luna" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Nume caseta" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Da" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Categorie" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " An " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Categorii de produse" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Nu" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Confirmare Comenzi" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "Sunteti sigur(a) ca doriti sa resetati aceasta casa de bani?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" +"Definiti toate produsele pe care angajatii le pot comanda la pranz. In cazul " +"in care comandati pranzul din mai multe locuri, puteti folosi categoriile de " +"produse pentru a le imparti dupa furnizor. Ii va fi mai usor managerului " +"care se ocupa cu pranzul sa filtreze comenzile de pranz dupa categirii." + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "August" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Analiza comenzii pentru pranz" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Iunie" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Nume de utilizator" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Analiza vanzarilor" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Pranz" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Utilizator" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Data" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Noiembrie" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Octombrie" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Ianuarie" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Nume Caseta" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "goliti casa de bani" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Activ(a)" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Data comenzii" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Caseta de bani pentru pranz " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Setati Casa de bani pe zero" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "Informatii generale" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Anulati" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Case de bani " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Pret unitar" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Produs" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Descriere" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Mai" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Pret" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Cautati Miscarea numerarului" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Total caseta" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Produs pranz" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Total ramas" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Pret total" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Februarie" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Nume" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Suma totala" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "Sarcini efectuate in ultimele 30 de zile" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Categorii asociate Produselor" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Case de bani" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Comanda" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Comanda pranz" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "Suma din casa de bani in luna curenta" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "Definiti Produsele pentru pranz" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "Sarcini din ultimele 7 zile" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Pozitie numerar dupa Utilizator" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Manager" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 zile " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "De confirmat" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "An" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "Creati Case de bani pentru pranz" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " Modulul de bază pentru gestionarea pranzului\n" +#~ "\n" +#~ " tine evidenta Comenzii pentru pranz, Miscărilor numerarului, Casei de " +#~ "bani, Produsului.\n" +#~ " " + +#~ msgid "Lunch Module" +#~ msgstr "Modul pranz" + +#~ msgid "Draft" +#~ msgstr "Ciornă" + +#~ msgid "Category related to Products" +#~ msgstr "Categorii asociate Produselor" diff --git a/addons/lunch/i18n/ru.po b/addons/lunch/i18n/ru.po new file mode 100644 index 00000000000..9b274e5d3e3 --- /dev/null +++ b/addons/lunch/i18n/ru.po @@ -0,0 +1,576 @@ +# Russian translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 18:01+0000\n" +"Last-Translator: Raphael Collet (OpenERP) \n" +"Language-Team: Russian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "Сброс кассы" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Заказы на ланч" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "Вы уверены, что хотите отменить этот заказ?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Движение средств" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Группировать по ..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Подтвердить заказ" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 дней " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Сегодня" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Март" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Итого:" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "День" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Отменить заказ" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Сумма" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Продукция" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "Доступные суммы по пользователям и кассам" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Месяц " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "Статистика заказа ланчей" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "Движение Средств" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Подтверждено" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Подтвердить" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "Поиск заказа" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Состояние" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Итоговая цена" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "Сумма в кассе по пользователям" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Дата создания" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "Название/Дата" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "Описание заказа" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Подтвердить заказ" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "Июль" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Касса" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 Дней " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Месяц-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Дата создания" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " Категории продукции " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "Обнулить" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "Движение средств" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "Апрель" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "Сентябрь" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "Декабрь" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Месяц" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "Название кассы" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Да" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Категория" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " Год " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Категории продукции" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Нет" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "Подтверждение заказов" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "Вы уверены, что хотите сбросить состояние кассы?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "Август" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Анализ заказов" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "Июнь" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Имя пользователя" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Анализ продаж" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Ланч" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Пользователь" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Дата" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "Ноябрь" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "Октябрь" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "Январь" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "Наименование кассы" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "очистить кассу" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Активно" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Дата заказа" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "Касса на ланч " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "Обнулить кассу" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Отменить" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Кассы " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Цена единицы" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Продукция" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Описание" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "Май" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Стоимость" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "Поиск по движению средств" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "Итого касса" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "Продукция ланча" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "Итоговый остаток" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "Итоговая цена" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "Февраль" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Наименование" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Итоговая сумма" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "Категория, связанная с продукцией" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Кассы" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Заказ" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Заказ ланча" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "Расположение средств по пользователям" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Руководитель" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 Дней " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "Ожидающие подтверждения" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "Год" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " Базовый модуль управления ланчами\n" +#~ "\n" +#~ " Отслеживание заказов, движения средств, кассы, продукции.\n" +#~ " Возможность разнесения продукции по категориям.\n" +#~ " " + +#~ msgid "Lunch Module" +#~ msgstr "Модуль Ланч" + +#~ msgid "Draft" +#~ msgstr "Черновик" + +#~ msgid "Category related to Products" +#~ msgstr "Категория, связанная с продукцией" diff --git a/addons/lunch/i18n/sr@latin.po b/addons/lunch/i18n/sr@latin.po new file mode 100644 index 00000000000..48314312862 --- /dev/null +++ b/addons/lunch/i18n/sr@latin.po @@ -0,0 +1,552 @@ +# Serbian latin translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2010-12-10 18:23+0000\n" +"Last-Translator: Milan Milosevic \n" +"Language-Team: Serbian latin \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "Protok Gotovine" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" diff --git a/addons/lunch/i18n/sv.po b/addons/lunch/i18n/sv.po new file mode 100644 index 00000000000..b7b10f93dd4 --- /dev/null +++ b/addons/lunch/i18n/sv.po @@ -0,0 +1,552 @@ +# Swedish translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-06-27 11:33+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Lunchorder" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Gruppera på..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "Bekräfta order" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 Dagar " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Idag" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "mars" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "Totalt :" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "Dag" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "Avbryt order" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "Belopp" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "Produkter" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " Månad " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "Bekräftad" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "Bekräfta" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "Status" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "Ny" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "Totalt belopp" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "Registeringsdatum" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "Bekräfta order" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "juli" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "Låda" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 dagar " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " Månad-1 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "Registreringsdatum" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "april" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "september" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "december" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "Månad" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "Ja" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "Kategori" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " År " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "Produktkategorier" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "Nej" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "augusti" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "Lunchorderanalys" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "juni" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "Användarnamn" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "Försäljningsanalys" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "Lunch" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "Användare" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "Datum" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "november" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "oktober" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "januari" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "Aktiva" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "Orderdatum" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "Allmän information" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "Avbryt" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " Kassalådor " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "Styckpris" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "Produkt" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "Beskrivning" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "maj" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "Pris" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "februari" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "Namn" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "Totalt belopp" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "Kassalådor" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "Order" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "Lunchorder" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "Chef" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 dagar " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "År" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" diff --git a/addons/lunch/i18n/tr.po b/addons/lunch/i18n/tr.po new file mode 100644 index 00000000000..03befa9c538 --- /dev/null +++ b/addons/lunch/i18n/tr.po @@ -0,0 +1,552 @@ +# Turkish translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-01-25 17:28+0000\n" +"Last-Translator: Ahmet Altınışık \n" +"Language-Team: Turkish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "Öğle Yemeği Siparişleri" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "Grupla..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "Bugün" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "Mart" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" diff --git a/addons/lunch/i18n/zh_CN.po b/addons/lunch/i18n/zh_CN.po new file mode 100644 index 00000000000..704ad9ce969 --- /dev/null +++ b/addons/lunch/i18n/zh_CN.po @@ -0,0 +1,575 @@ +# Chinese (Simplified) translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2012-05-10 18:07+0000\n" +"Last-Translator: Jeff Wang \n" +"Language-Team: Chinese (Simplified) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "重设外卖现金" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "本年的额度金额" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "午餐订单" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "您确定要取消此订单?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "现金划拨" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "分组..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "确认订单" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 天 " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "今日" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "3月" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "总计:" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "日" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "取消订单" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "你可以按员工来创建现金额度,这样你可以按实际订餐跟踪这个员工的消费金额" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "金额" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "品种列表" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "用户和外卖现金的可用金额" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr " 月 " + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "午餐订单统计" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "现金划拨" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "已确认" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "确认" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "搜索午餐订单" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "状态" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "新建" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "总价格" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "用户的外卖现金金额" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "创建日期" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "单号/日期" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "订单说明" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "上个月的额度金额" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "确认订单" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "7月" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "外卖现金" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr " 365 日 " + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr " 上月 " + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "创建日期" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr " 品种分类 " + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "设为0" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "现金划拨" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "过去365天执行的任务" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "4月" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "9月" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "12月" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "月" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "外卖现金名称" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "是" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "分类" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr " 年 " + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "品种分类" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "否" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "订单确认" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "你确定要重置这外卖现金?" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "定义午餐时间可以预定的所有产品。如果你在多个地方订餐,你可以用产品类别来区分供应商。这样午餐经理就能按类别过滤订单。" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "8月" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "午餐订单分析" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "6月" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "用户名" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "销售分析" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "午餐管理" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "用户" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "日期" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "11月" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "10月" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "1月" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "外卖现金的名称" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "外卖现金清零" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "生效" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "订单日期" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "午餐的外卖现金 " + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "设置外卖现金为0" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "常规信息" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "取消" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr " 外卖现金列表 " + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "单价" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "品种" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "说明" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "5月" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "价格" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "搜索外卖现金" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "总外卖现金" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "午餐品种" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "总剩余" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "总价" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "2月" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "名称" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "总金额" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "最近 30 天内执行的任务" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "该分类的品种" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "外卖现金列表" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "订单" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "午餐订单" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "本月的额度" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "定义您的午餐产品" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "七天内的任务" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "用户现金状况" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "经理" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr " 30 天 " + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "待确认" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "年" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "新建午餐现金额度" + +#~ msgid "Lunch Module" +#~ msgstr "午餐管理模块" + +#~ msgid "Draft" +#~ msgstr "草稿" + +#~ msgid "" +#~ "\n" +#~ " The base module to manage lunch\n" +#~ "\n" +#~ " keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +#~ " Apply Different Category for the product.\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " 这是一个管理午餐的模块\n" +#~ "保存对午餐订单,现金划拨,外卖现金,外卖品种等的跟踪信息。\n" +#~ "加入不同类型的外卖品种。\n" +#~ " " + +#~ msgid "Category related to Products" +#~ msgstr "该分类的品种" diff --git a/addons/lunch/i18n/zh_TW.po b/addons/lunch/i18n/zh_TW.po new file mode 100644 index 00000000000..abe6d12e60d --- /dev/null +++ b/addons/lunch/i18n/zh_TW.po @@ -0,0 +1,552 @@ +# Chinese (Traditional) translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:37+0100\n" +"PO-Revision-Date: 2011-09-27 08:10+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Chinese (Traditional) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n" +"X-Generator: Launchpad (build 15864)\n" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "午膳訂單" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "是否取消此訂單?" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "分組根據..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "確認訂單" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 天 " + +#. module: lunch +#: view:lunch.cashmove:0 view:lunch.order:0 +msgid "Today" +msgstr "今日" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "March" +msgstr "三月" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,day:0 view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel +#: model:ir.actions.act_window,name:lunch.action_lunch_order_cancel_values +#: model:ir.model,name:lunch.model_lunch_order_cancel view:lunch.order:0 +#: view:lunch.order.cancel:0 +msgid "Cancel Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.action_create_cashbox +msgid "" +"You can create on cashbox by employee if you want to keep track of the " +"amount due by employee according to what have been ordered." +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form view:lunch.product:0 +msgid "Products" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "New" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in last month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm +#: model:ir.actions.act_window,name:lunch.action_lunch_order_confirm_values +#: view:lunch.order:0 view:lunch.order.confirm:0 +msgid "Confirm Order" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "July" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.amount:0 view:report.lunch.order:0 +msgid "Box" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Set to Zero" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 365 days" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "April" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "September" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "December" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,month:0 view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "" + +#. module: lunch +#: field:lunch.order.confirm,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: view:lunch.order.cancel:0 +msgid "Yes" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category view:lunch.category:0 +#: view:lunch.order:0 field:lunch.order,category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 view:lunch.order.cancel:0 +msgid "No" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: view:lunch.cashbox.clean:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,help:lunch.view_lunch_product_form_installer +msgid "" +"Define all products that the employees can order for the lunch time. If you " +"order lunch at several places, you can use the product categories to split " +"by supplier. It will be easier for the lunch manager to filter lunch orders " +"by categories." +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "August" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "June" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 field:report.lunch.order,user_id:0 +msgid "User Name" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_root_configuration +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 view:report.lunch.order:0 +msgid "User" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 field:lunch.order,date:0 +msgid "Date" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "November" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "October" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "January" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,box:0 field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 field:lunch.product,active:0 +msgid "Active" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_clean_values +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: view:lunch.product:0 +msgid "General Information" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Cancel" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Unit Price" +msgstr "" + +#. module: lunch +#: field:lunch.order,product:0 +msgid "Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,name:0 report:lunch.order:0 view:lunch.product:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "May" +msgstr "" + +#. module: lunch +#: field:lunch.order,price:0 field:lunch.product,price:0 +msgid "Price" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 selection:report.lunch.order,month:0 +msgid "February" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,name:0 field:lunch.category,name:0 +#: field:lunch.product,name:0 field:report.lunch.order,box_name:0 +msgid "Name" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks performed in last 30 days" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category Related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 report:lunch.order:0 view:lunch.order:0 +msgid "Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Box amount in current month" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.view_lunch_product_form_installer +msgid "Define Your Lunch Products" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Tasks during last 7 days" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_create_cashbox +msgid "Create Lunch Cash Boxes" +msgstr "" diff --git a/addons/lunch/lunch_demo.xml b/addons/lunch/lunch_demo.xml new file mode 100644 index 00000000000..543086d6620 --- /dev/null +++ b/addons/lunch/lunch_demo.xml @@ -0,0 +1,25 @@ + + + + + + Sandwich + + + + Club + + 2.75 + + + + Cashbox + + + + + + + + + diff --git a/addons/lunch/lunch_installer_view.xml b/addons/lunch/lunch_installer_view.xml new file mode 100644 index 00000000000..d63f44b5ff2 --- /dev/null +++ b/addons/lunch/lunch_installer_view.xml @@ -0,0 +1,52 @@ + + + + Define Your Lunch Products + ir.actions.act_window + lunch.product + form + tree,form + + +

    + Click to add a new product that can be ordered for the lunch. +

    + We suggest you to put the real price so that the exact due + amount is deduced from each employee's cash boxes when they + order. +

    + If you order lunch at several places, you can use the product + categories to split by supplier. It will be easier to filter + lunch orders. +

    +
    +
    + + + + 50 + + + + Create Lunch Cash Boxes + ir.actions.act_window + lunch.cashbox + form + tree,form + +

    + Click to add a new cash box. +

    + You can create on cash box by employee if you want to keep + track of the amount due by employee according to what have been + ordered. +

    +
    +
    + + + + 51 + +
    +
    diff --git a/addons/lunch/lunch_report.xml b/addons/lunch/lunch_report.xml new file mode 100644 index 00000000000..c5e933847cd --- /dev/null +++ b/addons/lunch/lunch_report.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/addons/lunch/report/__init__.py b/addons/lunch/report/__init__.py new file mode 100644 index 00000000000..4a56869bf83 --- /dev/null +++ b/addons/lunch/report/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import order +import report_lunch_order +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/lunch/report/order.py b/addons/lunch/report/order.py new file mode 100644 index 00000000000..11ca7f79dbc --- /dev/null +++ b/addons/lunch/report/order.py @@ -0,0 +1,71 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import time +from report import report_sxw +from osv import osv + + +class order(report_sxw.rml_parse): + + def get_lines(self, user,objects): + lines=[] + for obj in objects: + if user.id==obj.user_id.id: + lines.append(obj) + return lines + + def get_total(self, user,objects): + lines=[] + for obj in objects: + if user.id==obj.user_id.id: + lines.append(obj) + total=0.0 + for line in lines: + total+=line.price + self.net_total+=total + return total + + def get_nettotal(self): + return self.net_total + + def get_users(self, objects): + users=[] + for obj in objects: + if obj.user_id not in users: + users.append(obj.user_id) + return users + + def __init__(self, cr, uid, name, context): + super(order, self).__init__(cr, uid, name, context) + self.net_total=0.0 + self.localcontext.update({ + 'time': time, + 'get_lines': self.get_lines, + 'get_users': self.get_users, + 'get_total': self.get_total, + 'get_nettotal': self.get_nettotal, + }) + +report_sxw.report_sxw('report.lunch.order', 'lunch.order', + 'addons/lunch/report/order.rml',parser=order, header='external') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/lunch/report/order.rml b/addons/lunch/report/order.rml new file mode 100644 index 00000000000..b09b59bb96b --- /dev/null +++ b/addons/lunch/report/order.rml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name/Date + + + Order + + + Description + + + Unit Price + + + + + + + + + + + + + + + + [[ user.name ]] + [[ user.login ]] + [[ user.email ]] + + + + Lunch Order + + + + Name/Date + + + Order + + + Description + + + Unit Price + + + +
    + [[repeatIn(get_users(objects),'o')]] + + + + [[ o.name ]] + + + + + + + + [[ formatLang(get_total(o,objects)) ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + + + +
    + [[ repeatIn(get_lines(o,objects),'lines') ]] + + + + [[ formatLang(lines.date,date='True') ]] + + + [[ (lines.product and lines.product.name) or '' ]] + + + [[ lines.descript]] + + + [[ lines.price ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + + + +
    +
    + + + + + + + + + Total : + + + [[ formatLang(get_nettotal()) ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + + + + + + +
    +
    +
    diff --git a/addons/lunch/report/report_lunch_order.py b/addons/lunch/report/report_lunch_order.py new file mode 100644 index 00000000000..7e2b8de9f49 --- /dev/null +++ b/addons/lunch/report/report_lunch_order.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import tools +from osv import fields,osv + +class report_lunch_order(osv.osv): + _name = "report.lunch.order" + _description = "Lunch Orders Statistics" + _auto = False + _rec_name = 'date' + _columns = { + 'date': fields.date('Date Order', readonly=True, select=True), + 'year': fields.char('Year', size=4, readonly=True), + 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), + ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), + ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), + 'day': fields.char('Day', size=128, readonly=True), + 'user_id': fields.many2one('res.users', 'User Name'), + 'box_name': fields.char('Name', size=30), + 'price_total':fields.float('Total Price', readonly=True), + } + _order = 'date desc' + def init(self, cr): + tools.drop_view_if_exists(cr, 'report_lunch_order') + cr.execute(""" + create or replace view report_lunch_order as ( + select + min(lo.id) as id, + lo.date as date, + to_char(lo.date, 'YYYY') as year, + to_char(lo.date, 'MM') as month, + to_char(lo.date, 'YYYY-MM-DD') as day, + lo.user_id, + cm.name as box_name, + sum(lp.price) as price_total + + from + lunch_order as lo + left join lunch_cashmove as cm on (cm.id = lo.cashmove) + left join lunch_cashbox as lc on (lc.id = cm.box) + left join lunch_product as lp on (lo.product = lp.id) + + group by + lo.date,lo.user_id,cm.name + ) + """) +report_lunch_order() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/lunch/report/report_lunch_order_view.xml b/addons/lunch/report/report_lunch_order_view.xml new file mode 100644 index 00000000000..e92007592ac --- /dev/null +++ b/addons/lunch/report/report_lunch_order_view.xml @@ -0,0 +1,51 @@ + + + + + + report.lunch.order.tree + report.lunch.order + + + + + + + + + + + + + + + report.lunch.order.search + report.lunch.order + + + + + + + + + + + + + + + + Lunch Order Analysis + report.lunch.order + form + tree + + {'search_default_month':1,'search_default_User':1} + + + + + + + diff --git a/addons/lunch/security/ir.model.access.csv b/addons/lunch/security/ir.model.access.csv new file mode 100644 index 00000000000..72c06cceb2b --- /dev/null +++ b/addons/lunch/security/ir.model.access.csv @@ -0,0 +1,8 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_lunch_order_user,lunch.order user,model_lunch_order,base.group_tool_user,1,1,1,1 +access_lunch_cashmove_user,lunch.cashmove user,model_lunch_cashmove,base.group_tool_user,1,1,1,1 +access_report_lunch_amount_manager,report.lunch.amount manager,model_report_lunch_amount,base.group_tool_manager,1,1,1,1 +access_lunch_category_manager,lunch.category.user,model_lunch_category,base.group_tool_user,1,1,1,1 +access_report_lunch_order_manager,report.lunch.order manager,model_report_lunch_order,base.group_tool_manager,1,1,1,1 +access_lunch_product_user,lunch.product user,model_lunch_product,base.group_tool_user,1,1,1,1 +access_lunch_cashbox_user,lunch.cashbox user,model_lunch_cashbox,base.group_tool_user,1,1,1,1 diff --git a/addons/lunch/security/lunch_security.xml b/addons/lunch/security/lunch_security.xml new file mode 100644 index 00000000000..46293a97561 --- /dev/null +++ b/addons/lunch/security/lunch_security.xml @@ -0,0 +1,17 @@ + + + + + + User + + + + Manager + + + + + + + diff --git a/addons/lunch/static/src/img/icon.png b/addons/lunch/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7493a3c7f4eb88f83a5c38b0ddf439468196e069 GIT binary patch literal 26815 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. +# +# 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 . +# +############################################################################## + +import lunch_order_confirm +import lunch_order_cancel +import lunch_cashbox_clean + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/lunch/wizard/lunch_cashbox_clean.py b/addons/lunch/wizard/lunch_cashbox_clean.py new file mode 100644 index 00000000000..e95d05870f9 --- /dev/null +++ b/addons/lunch/wizard/lunch_cashbox_clean.py @@ -0,0 +1,65 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +from osv import fields, osv + +class lunch_cashbox_clean(osv.osv_memory): + + _name = "lunch.cashbox.clean" + _description = "clean cashbox" + + def set_to_zero(self, cr, uid, ids, context=None): + + """ + clean Cashbox. set active fields False. + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List Lunch cashbox Clean’s IDs + @return:Dictionary {}. + """ + #TOFIX: use orm methods + if context is None: + context = {} + data = context and context.get('active_ids', []) or [] + cashmove_ref = self.pool.get('lunch.cashmove') + cr.execute("select user_cashmove, box,sum(amount) from lunch_cashmove \ + where active = 't' and box IN %s group by user_cashmove, \ + box" , (tuple(data),)) + res = cr.fetchall() + + cr.execute("update lunch_cashmove set active = 'f' where active= 't' \ + and box IN %s" , (tuple(data),)) + #TOCHECK: Why need to create duplicate entry after clean box ? + + #for (user_id, box_id, amount) in res: + # cashmove_ref.create(cr, uid, { + # 'name': 'Summary for user' + str(user_id), + # 'amount': amount, + # 'user_cashmove': user_id, + # 'box': box_id, + # 'active': True, + # }) + return {'type': 'ir.actions.act_window_close'} + +lunch_cashbox_clean() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/lunch/wizard/lunch_cashbox_clean_view.xml b/addons/lunch/wizard/lunch_cashbox_clean_view.xml new file mode 100644 index 00000000000..5ba2a6ff3bf --- /dev/null +++ b/addons/lunch/wizard/lunch_cashbox_clean_view.xml @@ -0,0 +1,39 @@ + + + + + + + + lunch.cashbox.clean.form + lunch.cashbox.clean + + + + +
    +
    + +
    +
    + + + Set CashBox to Zero + lunch.cashbox.clean + form + tree,form + + new + + + + +
    +
    diff --git a/addons/lunch/wizard/lunch_order_cancel.py b/addons/lunch/wizard/lunch_order_cancel.py new file mode 100644 index 00000000000..a0c8779b323 --- /dev/null +++ b/addons/lunch/wizard/lunch_order_cancel.py @@ -0,0 +1,45 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## +from osv import fields, osv + +class lunch_order_cancel(osv.osv_memory): + """ + Cancel Lunch Order + """ + _name = "lunch.order.cancel" + _description = "Cancel Order" + + def cancel(self, cr, uid, ids, context=None): + """ + Cancel cashmove entry from cashmoves and update state to draft. + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List Lunch Order Cancel’s IDs + """ + if context is None: + context = {} + data = context and context.get('active_ids', []) or [] + return self.pool.get('lunch.order').lunch_order_cancel(cr, uid, data, context) + +lunch_order_cancel() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/lunch/wizard/lunch_order_cancel_view.xml b/addons/lunch/wizard/lunch_order_cancel_view.xml new file mode 100644 index 00000000000..8421dd74f9b --- /dev/null +++ b/addons/lunch/wizard/lunch_order_cancel_view.xml @@ -0,0 +1,39 @@ + + + + + + + + lunch.order.cancel.form + lunch.order.cancel + +
    + + +
    +
    +
    +
    +
    + + + Cancel Order + lunch.order.cancel + form + tree,form + + new + + + + +
    +
    diff --git a/addons/lunch/wizard/lunch_order_confirm.py b/addons/lunch/wizard/lunch_order_confirm.py new file mode 100644 index 00000000000..279234897de --- /dev/null +++ b/addons/lunch/wizard/lunch_order_confirm.py @@ -0,0 +1,56 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +from osv import fields, osv + +class lunch_order_confirm(osv.osv_memory): + """ + Confirm Lunch Order + """ + _name = "lunch.order.confirm" + _description = "confirm Order" + + _columns = { + 'confirm_cashbox':fields.many2one('lunch.cashbox', 'Name of box', required=True), + } + + def confirm(self, cr, uid, ids, context=None): + """ + confirm Lunch Order.Create cashmoves in launch cashmoves when state is + confirm in lunch order. + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List Lunch Order confirm’s IDs + @return: Dictionary {}. + """ + if context is None: + context = {} + data = context and context.get('active_ids', []) or [] + order_ref = self.pool.get('lunch.order') + + for confirm_obj in self.browse(cr, uid, ids, context=context): + order_ref.confirm(cr, uid, data, confirm_obj.confirm_cashbox.id, context) + return {'type': 'ir.actions.act_window_close'} + +lunch_order_confirm() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/lunch/wizard/lunch_order_confirm_view.xml b/addons/lunch/wizard/lunch_order_confirm_view.xml new file mode 100644 index 00000000000..dadde4ed089 --- /dev/null +++ b/addons/lunch/wizard/lunch_order_confirm_view.xml @@ -0,0 +1,40 @@ + + + + + + + + lunch.order.confirm.form + lunch.order.confirm + +
    + + + + +
    +
    +
    +
    +
    + + + Confirm Order + lunch.order.confirm + form + tree,form + + new + + + + +
    +
    diff --git a/addons/lunch_new/__init__.py b/addons/lunch_new/__init__.py new file mode 100644 index 00000000000..398a42669ca --- /dev/null +++ b/addons/lunch_new/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2012 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import lunch +import partner +import wizard \ No newline at end of file diff --git a/addons/lunch_new/__openerp__.py b/addons/lunch_new/__openerp__.py new file mode 100644 index 00000000000..3d30f75ac97 --- /dev/null +++ b/addons/lunch_new/__openerp__.py @@ -0,0 +1,42 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2012 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +{ + 'name': 'Lunch Orders', + 'author': 'OpenERP SA', + 'version': '0.2', + 'depends': ['base'], + 'category' : 'Tools', + 'description': """ +The base module to manage lunch. +================================ + +keep track for the Lunch Order, Cash Moves and Product. Apply Different +Category for the product. + """, + 'data': ['lunch_view.xml','partner_view.xml','wizard/lunch_validation_view.xml','wizard/lunch_cancel_view.xml'], + 'demo': [], + 'test': [], + 'installable': True, + 'application' : True, + 'certificate' : '001292377792581874189', + 'images': [], +} diff --git a/addons/lunch_new/lunch.py b/addons/lunch_new/lunch.py new file mode 100644 index 00000000000..e9402a16bb0 --- /dev/null +++ b/addons/lunch_new/lunch.py @@ -0,0 +1,170 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## +import addons +import tools +from osv import osv, fields + +class lunch_order(osv.Model): + """ lunch order """ + _name = 'lunch.order' + _description = 'Lunch Order' + + def _price_get(self,cr,uid,ids,name,arg,context=None): + orders = self.browse(cr,uid,ids,context=context) + result={} + for order in orders: + value = 0.0 + for product in order.products: + if product.state != 'cancelled': + value+=product.product.price + result[order.id]=value + return result + + def onchange_price(self,cr,uid,ids,products,context=None): + res = {'value':{'total':0.0}} + if products: + tot = 0.0 + for prod in products: + #price = self.pool.get('lunch.product').read(cr, uid, prod, ['price'])['price'] + #tot += price + res = {'value':{'total':2.0}} + # prods = self.pool.get('lunch.order.line').read(cr,uid,products,['price'])['price'] + # res = {'value':{'total': self._price_get(cr,uid,ids,products,context),}} + return res + + _columns = { + 'user_id' : fields.many2one('res.users','User Name',required=True,readonly=True, states={'new':[('readonly', False)]}), + 'date': fields.date('Date', required=True,readonly=True, states={'new':[('readonly', False)]}), + 'products' : fields.one2many('lunch.order.line','order_id','Products',ondelete="cascade",readonly=True,states={'new':[('readonly', False)]}), + 'total' : fields.function(_price_get, string="Total",store=True), + 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled'), ('partially','Parcially Confirmed')], \ + 'Status', readonly=True, select=True), + } + + _defaults = { + 'user_id': lambda self, cr, uid, context: uid, + 'date': fields.date.context_today, + 'state': lambda self, cr, uid, context: 'new', + } + +class lunch_order_line(osv.Model): #define each product that will be in one ORDER. + """ lunch order line """ + _name = 'lunch.order.line' + _description = 'lunch order line' + + def _price_get(self,cr,uid,ids,name,arg,context=None): + orderLines = self.browse(cr,uid,ids,context=context) + result={} + for orderLine in orderLines: + result[orderLine.id]=orderLine.product.price + return result + + def onchange_price(self,cr,uid,ids,product,context=None): + if product: + price = self.pool.get('lunch.product').read(cr, uid, product, ['price'])['price'] + return {'value': {'price': price}} + return {'value': {'price': 0.0}} + + def confirm(self,cr,uid,ids,order,context=None): + cashmove_ref = self.pool.get('lunch.cashmove') + for order in self.browse(cr,uid,ids,context=context): + if order.state == 'new': + new_id = cashmove_ref.create(cr,uid,{'user_id': order.user_id.id, 'amount':-order.price,'description':'Order','cash_id':order.id, 'state':'order', 'date':order.date}) + self.write(cr, uid, [order.id], {'state': 'confirmed', 'cashmove':new_id}) + return {} + + _columns = { + 'date' : fields.related('order_id','date',type='date', string="Date", readonly=True,store=True), + 'supplier' : fields.related('product','supplier',type='many2one',relation='res.partner',string="Supplier",readonly=True,store=True), + 'user_id' : fields.related('order_id', 'user_id', type='many2one', relation='res.users', string='User', readonly=True), + 'product' : fields.many2one('lunch.product','Product',required=True), #one offer can have more than one product and one product can be in more than one offer. + 'note' : fields.text('Note',size=256,required=False), + 'order_id' : fields.many2one('lunch.order','Order',required=True,ondelete='cascade'), + 'price' : fields.function(_price_get, string="Price",store=True), + 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled')], \ + 'Status', readonly=True, select=True), + 'cashmove': fields.one2many('lunch.cashmove','order_id','Cash Move',ondelete='cascade'), + } + _defaults = { + 'state': lambda self, cr, uid, context: 'new', + } + +class lunch_product(osv.Model): + """ lunch product """ + _name = 'lunch.product' + _description = 'lunch product' + _columns = { + 'name' : fields.char('Product',required=True, size=64), + 'category_id': fields.many2one('lunch.product.category', 'Category'), + 'description': fields.text('Description', size=256, required=False), + 'price': fields.float('Price', digits=(16,2)), + 'active': fields.boolean('Active'), #If this product isn't offered anymore, the active boolean is set to false. This will allow to keep trace of previous orders and cashmoves. + 'supplier' : fields.many2one('res.partner','Supplier',required=True, domain=[('supplier_lunch','=',True)]), + } + +class lunch_product_category(osv.Model): + """ lunch product category """ + _name = 'lunch.product.category' + _description = 'lunch product category' + _columns = { + 'name' : fields.char('Category', required=True, size=64), #such as PIZZA, SANDWICH, PASTA, CHINESE, BURGER, ... + } + +class lunch_cashmove(osv.Model): + """ lunch cashmove => order or payment """ + _name = 'lunch.cashmove' + _description = 'lunch description' + _columns = { + 'user_id' : fields.many2one('res.users','User Name',required=True), + 'date' : fields.date('Date', required=True), + 'amount' : fields.float('Amount', required=True), #depending on the kind of cashmove, the amount will be positive or negative + 'description' : fields.text('Description',size=256), #the description can be an order or a payment + 'order_id' : fields.many2one('lunch.order.line','Order',required=False,ondelete='cascade'), + 'state' : fields.selection([('order','Order'),('payment','Payment')],'Is an order or a Payment'), + } + _defaults = { + 'user_id': lambda self, cr, uid, context: uid, + 'date': fields.date.context_today, + 'state': lambda self, cr, uid, context: 'payment', + } + + +class lunch_alert(osv.Model): + """ lunch alert """ + _name = 'lunch.alert' + _description = 'lunch alert' + _columns = { + 'message' : fields.text('Message',size=256, required=True), + 'active' : fields.boolean('Active'), + 'day' : fields.selection([('specific','Specific day'), ('week','Every Week'), ('days','Every Day')], 'Recurrency'), + 'specific' : fields.date('Day'), + 'monday' : fields.boolean('Monday'), + 'tuesday' : fields.boolean('Tuesday'), + 'wednesday' : fields.boolean('Wednesday'), + 'thursday' : fields.boolean('Thursday'), + 'friday' : fields.boolean('Friday'), + 'saturday' : fields.boolean('Saturday'), + 'sunday' : fields.boolean('Sunday'), + 'from' : fields.selection([('0','00h00'),('1','00h30'),('2','01h00'),('3','01h30'),('4','02h00'),('5','02h30'),('6','03h00'),('7','03h30'),('8','04h00'),('9','04h30'),('10','05h00'),('11','05h30'),('12','06h00'),('13','06h30'),('14','07h00'),('15','07h30'),('16','08h00'),('17','08h30'),('18','09h00'),('19','09h30'),('20','10h00'),('21','10h30'),('22','11h00'),('23','11h30'),('24','12h00'),('25','12h30'),('26','13h00'),('27','13h30'),('28','14h00'),('29','14h30'),('30','15h00'),('31','15h30'),('32','16h00'),('33','16h30'),('34','17h00'),('35','17h30'),('36','18h00'),('37','18h30'),('38','19h00'),('39','19h30'),('40','20h00'),('41','20h30'),('42','21h00'),('43','21h30'),('44','22h00'),('45','22h30'),('46','23h00'),('47','23h30')],'Between',required=True), #defines from when (hours) the alert will be displayed + 'to' : fields.selection([('0','00h00'),('1','00h30'),('2','01h00'),('3','01h30'),('4','02h00'),('5','02h30'),('6','03h00'),('7','03h30'),('8','04h00'),('9','04h30'),('10','05h00'),('11','05h30'),('12','06h00'),('13','06h30'),('14','07h00'),('15','07h30'),('16','08h00'),('17','08h30'),('18','09h00'),('19','09h30'),('20','10h00'),('21','10h30'),('22','11h00'),('23','11h30'),('24','12h00'),('25','12h30'),('26','13h00'),('27','13h30'),('28','14h00'),('29','14h30'),('30','15h00'),('31','15h30'),('32','16h00'),('33','16h30'),('34','17h00'),('35','17h30'),('36','18h00'),('37','18h30'),('38','19h00'),('39','19h30'),('40','20h00'),('41','20h30'),('42','21h00'),('43','21h30'),('44','22h00'),('45','22h30'),('46','23h00'),('47','23h30')],'and',required=True), # to when (hours) the alert will be disabled + } + + diff --git a/addons/lunch_new/lunch_view.xml b/addons/lunch_new/lunch_view.xml new file mode 100644 index 00000000000..2146f17ed97 --- /dev/null +++ b/addons/lunch_new/lunch_view.xml @@ -0,0 +1,395 @@ + + + + + + + + + + + + + Search + lunch.order.line + search + + + + + + + + + + + + lunch order list + lunch.order.line + + + + + + + + + + + + lunch employee payment + lunch.cashmove + search + + + + + + + + + lunch cashmove + lunch.cashmove + search + + + + + + + + + + Your Orders + lunch.order + tree,form + +

    + Click to create a lunch order. +

    +

    + Use lunch order if you need to order any food for your lunch. +

    +
    +
    + + + + + Your Account + lunch.cashmove + tree + +

    + Here you can see your cash moves. There are your orders and refund. +

    +
    +
    + + + + + Orders by Supplier + lunch.order.line + tree + + {"search_default_group_by_supplier":1, "search_default_today":1} + +

    + Here you can see the orders of the day grouped by suppliers. +

    +
    +
    + + + + + Control Suppliers + lunch.order.line + tree + + {"search_default_group_by_date":1, "search_default_group_by_supplier":1} + +

    + Here you can see the orders of the month grouped by suppliers. +

    +
    +
    + + + + + Control Accounts + lunch.cashmove + tree,form + + {"search_default_group_by_user":1} + +

    + Click to create a transaction. +

    +

    + The different cash moves are used to see the orders but also the + employees' refunds. +

    +
    +
    + + + + + + Register Cash Moves + lunch.cashmove + tree,form + + {"search_default_is_payment":1} + +

    + Click to create a payment. +

    +

    + Here you can see the employees' refund. +

    +
    +
    + + + + + Products + lunch.product + tree,form + +

    + Click to create a product for lunch. +

    +

    + A product is defined by its name, category, price and supplier. +

    +
    +
    + + + + + Product Categories + lunch.product.category + tree,form + +

    + Click to create a lunch category. +

    +

    + Here you can find every lunch categories for products. +

    +
    +
    + + + + + Alerts + lunch.alert + tree,form + +

    + Click to create a lunch alert. +

    +

    + Alerts are used to warn employee and user from possible issues about the lunch. +

    +
    +
    + + + + + Order lines Tree + lunch.order.line + tree + + + + + + + + + + + + + + + + Orders Tree + lunch.order + + + + + + + + + + + + Orders Form + lunch.order + form + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + Products Tree + lunch.product + tree + + + + + + + + + + + + + + Products Form + lunch.product + form + +
    + + + + + + + + + + + +
    +
    + + + + cashmove tree + lunch.cashmove + tree + + + + + + + + + + + + cashmove form + lunch.cashmove + form + +
    + + + + + + + + + +
    +
    + + + + alert tree + lunch.alert + tree + + + + + + + + + + alert tree + lunch.alert + form + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    diff --git a/addons/lunch_new/partner.py b/addons/lunch_new/partner.py new file mode 100644 index 00000000000..5cdbd82230f --- /dev/null +++ b/addons/lunch_new/partner.py @@ -0,0 +1,7 @@ +from osv import osv, fields + +class res_partner (osv.Model): + _inherit = 'res.partner' + _columns = { + 'supplier_lunch': fields.boolean('Lunch Supplier'), + } \ No newline at end of file diff --git a/addons/lunch_new/partner_view.xml b/addons/lunch_new/partner_view.xml new file mode 100644 index 00000000000..c5cdb8c8995 --- /dev/null +++ b/addons/lunch_new/partner_view.xml @@ -0,0 +1,18 @@ + + + + + partner.supplier.name.form + res.partner + form + + + + + + + + + + + \ No newline at end of file diff --git a/addons/lunch_new/static/src/img/warning.png b/addons/lunch_new/static/src/img/warning.png new file mode 100644 index 0000000000000000000000000000000000000000..98b79e9699ae3495a1f585c869d8cded4c937ced GIT binary patch literal 33407 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�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
  • MQkJyve%MIG9seUcL@v# z3CYQ0GP`Y(i>Od1L1_C@;6RNfuY=*P4Kxfnn~>!;HG9a1l^ODHZ#OLY-EP==uAIb; zYZe!Iz4TT+G7hdKMp&7DS&ceNvMkvq_w^&xs}A1F2A8BSha<{z)IX0Y#jj3RSG^QD z2J6e0m(YyM)0KfRXv$D=B10UN)9rznb{2!Fd@zTZ<;O7;AKh}uxNUYzq=_UN2qUHUR$3(04eX?Y8N$pjMx4-9Tj6@RppTfUF92NbAC%bXfj-S z{Q~>J7$+pwTL<@Nyh62pMZ}1~o)7^@uKOzAC<%Ctl6v$Fy&>)d`ULkLm$Q#OY(&|d zn&`Jg&#=>`U#7HAb55So@{J5y94LEQ-C&}bZZ+c+LThm=N~bMBt@mJfM!-pc8Z3jC z+wlBur4+YPA}X{0gmXD+G>(yXgL(8?fsONlcpLk;bf#x^BJ)-vi>W>k*qtl14EQZm zarV!arCf*vv&Os*hOx60Jyc!xDCYMTJ>-Wb**yD-bt0_=z!=g{=v5;HEc5}KL?(tD&L;c?UyxLeL>^)X-{AI?x>j8YzLI7_f;i9mtS9PHVYPuUCprpB-8z zqZ?-fTV8Nco{ped?tqgtum^hQd&&Vk^v5W_*T%O?RA+i1TA|gs!MyxT`|P>RBRxl! zgD!;J_PjhE0F(cMoEP6apV!}E{e_JagPM9n5tko+sDlw5MvkW0*OJxaYYV+j>mja8 zb5Fw%-YEFMftbg?lCXCg+<=T|W2M5yb*s9uTM3#?J4N|afLJ|UO$_!|<`Gvn>t$xZ z_i&iI1`sSs9DTUhv-Yj}&qcz&icQ|6wImCk_eS&%=%^r|4C{knKov(#>{~kFP89z; ziuW)Z#oeS?8?qwecU+lh&0(2J6Hx}lQ0ek$W^*833o$-k03{&^JV@i9;7i^+0Y*00Rl z;N(dlM8#G9_5e5r89H%ycASRHI%VrTj1O_!x?hR4mZMs;#hxxXz17$l+bEPv6IndW zi8U@tkJA_wTjvkE0(ccTw8*Qc5HwW%N5-<-`&8P}LE^Xd$Hp7GU1a}G02Wr75sW`- zsz`9z>CXWCPsi+@4r?h#B;;b;)POQ3?nWkOZJ-G(`19`Od#w-oAn-r>VdGbqKO6d? zqc8Qp#uxJAllxy6Q8%(rKx?). +# +# 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 . +# +############################################################################## + +import lunch_validation +import lunch_cancel diff --git a/addons/lunch_new/wizard/lunch_cancel.py b/addons/lunch_new/wizard/lunch_cancel.py new file mode 100644 index 00000000000..ea100b9889c --- /dev/null +++ b/addons/lunch_new/wizard/lunch_cancel.py @@ -0,0 +1,32 @@ +from osv import osv, fields + +class lunch_cancel(osv.Model): + """ lunch cancel """ + _name = 'lunch.cancel' + _description = 'cancel lunch order' + + def cancel(self,cr,uid,ids,context=None): + #confirm one or more order.line, update order status and create new cashmove + cashmove_ref = self.pool.get('lunch.cashmove') + order_lines_ref = self.pool.get('lunch.order.line') + orders_ref = self.pool.get('lunch.order') + order_ids = context.get('active_ids', []) + + for order in order_lines_ref.browse(cr,uid,order_ids,context=context): + order_lines_ref.write(cr,uid,[order.id],{'state':'cancelled'},context) + for cash in order.cashmove: + cashmove_ref.unlink(cr,uid,cash.id,context) + for order in order_lines_ref.browse(cr,uid,order_ids,context=context): + hasconfirmed = False + hasnew = False + for product in order.order_id.products: + if product.state=='confirmed': + hasconfirmed= True + if product.state=='new': + hasnew= True + if hasnew == False: + if hasconfirmed == False: + orders_ref.write(cr,uid,[order.order_id.id],{'state':'cancelled'},context) + return {} + orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) + return {} diff --git a/addons/lunch_new/wizard/lunch_cancel_view.xml b/addons/lunch_new/wizard/lunch_cancel_view.xml new file mode 100644 index 00000000000..fa6e8cb497b --- /dev/null +++ b/addons/lunch_new/wizard/lunch_cancel_view.xml @@ -0,0 +1,32 @@ + + + + + cancel order lines + lunch.cancel + form + +
    + + + +
    +
    +
    +
    +
    + + + +
    +
    \ No newline at end of file diff --git a/addons/lunch_new/wizard/lunch_validation.py b/addons/lunch_new/wizard/lunch_validation.py new file mode 100644 index 00000000000..dc18d89a5a3 --- /dev/null +++ b/addons/lunch_new/wizard/lunch_validation.py @@ -0,0 +1,29 @@ +from osv import osv, fields + +class lunch_validation(osv.Model): + """ lunch validation """ + _name = 'lunch.validation' + _description = 'lunch validation for order' + + def confirm(self,cr,uid,ids,context=None): + #confirm one or more order.line, update order status and create new cashmove + cashmove_ref = self.pool.get('lunch.cashmove') + order_lines_ref = self.pool.get('lunch.order.line') + orders_ref = self.pool.get('lunch.order') + order_ids = context.get('active_ids', []) + + for order in order_lines_ref.browse(cr,uid,order_ids,context=context): + if order.state!='confirmed': + new_id = cashmove_ref.create(cr,uid,{'user_id': order.user_id.id, 'amount':0 - order.price,'description':order.product.name, 'order_id':order.id, 'state':'order', 'date':order.date}) + order_lines_ref.write(cr,uid,[order.id],{'cashmove':[('0',new_id)], 'state':'confirmed'},context) + for order in order_lines_ref.browse(cr,uid,order_ids,context=context): + isconfirmed = True + for product in order.order_id.products: + if product.state == 'new': + isconfirmed = False + if product.state == 'cancelled': + isconfirmed = False + orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) + if isconfirmed == True: + orders_ref.write(cr,uid,[order.order_id.id],{'state':'confirmed'},context) + return {} \ No newline at end of file diff --git a/addons/lunch_new/wizard/lunch_validation_view.xml b/addons/lunch_new/wizard/lunch_validation_view.xml new file mode 100644 index 00000000000..154556afad9 --- /dev/null +++ b/addons/lunch_new/wizard/lunch_validation_view.xml @@ -0,0 +1,34 @@ + + + + + validate order lines + lunch.validation + form + +
    + + + +
    +
    +
    +
    +
    + + + +
    +
    From 2ee00a9527c958b7501f81e8005e92a6626f976c Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Thu, 4 Oct 2012 13:13:34 +0530 Subject: [PATCH 156/963] [fix] add hook in purchase to fix warrning of field 'purchase_id' does not exist on browse bzr revid: rgaopenerp-20121004074334-ardk1mi41e5hmabc --- addons/procurement/schedulers.py | 19 ++++++++++--------- addons/purchase/purchase.py | 6 ++++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/addons/procurement/schedulers.py b/addons/procurement/schedulers.py index 1c8ac5934fc..0c96bf1e689 100644 --- a/addons/procurement/schedulers.py +++ b/addons/procurement/schedulers.py @@ -197,6 +197,12 @@ class procurement_order(osv.osv): 'location_id': orderpoint.location_id.id, 'procure_method': 'make_to_order', 'origin': orderpoint.name} + + def _product_virtual_get(self, cr, uid, order_point): + location_obj = self.pool.get('stock.location') + return location_obj._product_virtual_get(cr, uid, + order_point.location_id.id, [order_point.product_id.id], + {'uom': order_point.product_uom.id})[order_point.product_id.id] def _procure_orderpoint_confirm(self, cr, uid, automatic=False,\ use_new_cursor=False, context=None, user_id=False): @@ -217,7 +223,7 @@ class procurement_order(osv.osv): if use_new_cursor: cr = pooler.get_db(use_new_cursor).cursor() orderpoint_obj = self.pool.get('stock.warehouse.orderpoint') - location_obj = self.pool.get('stock.location') + procurement_obj = self.pool.get('procurement.order') wf_service = netsvc.LocalService("workflow") offset = 0 @@ -227,14 +233,9 @@ class procurement_order(osv.osv): while ids: ids = orderpoint_obj.search(cr, uid, [], offset=offset, limit=100) for op in orderpoint_obj.browse(cr, uid, ids, context=context): - if op.procurement_id.state != 'exception': - if op.procurement_id and hasattr(op.procurement_id, 'purchase_id'): - if op.procurement_id.purchase_id.state in ('draft', 'confirmed'): - continue - prods = location_obj._product_virtual_get(cr, uid, - op.location_id.id, [op.product_id.id], - {'uom': op.product_uom.id})[op.product_id.id] - + prods = self._product_virtual_get(cr, uid, op) + if prods is None: + continue if prods < op.product_min_qty: qty = max(op.product_min_qty, op.product_max_qty)-prods diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index d654078a055..5cb88fb60f7 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1080,6 +1080,12 @@ class procurement_order(osv.osv): self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': res[procurement.id]}) self.running_send_note(cr, uid, [procurement.id], context=context) return res + + def _product_virtual_get(self, cr, uid, order_point): + procurement = order_point.procurement_id + if procurement and procurement.state != 'exception' and procurement.purchase_id and procurement.purchase_id.state in ('draft', 'confirmed'): + return None + return super(procurement_order, self)._product_virtual_get(cr, uid, order_point) procurement_order() From 07a3db142023f323ea5c14247355b65507d6c9f2 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 4 Oct 2012 11:17:53 +0200 Subject: [PATCH 157/963] [FIX]Inherits from cost problems bzr revid: dle@openerp.com-20121004091753-8vg0ctsk5f8ys8sd --- addons/fleet/demo.xml | 232 +++++++++++++++++++++++++++++++----- addons/fleet/fleet.py | 34 ++++-- addons/fleet/fleet_view.xml | 101 +++++++++------- 3 files changed, 282 insertions(+), 85 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 0874900379b..5778f5f83fc 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -2145,6 +2145,12 @@ gg== Windshield Wiper(s) Replacement + + + 2012-01-01 + 0 + + @@ -2154,10 +2160,16 @@ gg== 1.3 52 67458 - 0 + First refueling + + + 2012-02-11 + 658 + + @@ -2167,10 +2179,16 @@ gg== 1.3 65 455812 - 658 + Second refueling of the car + + + 2012-03-23 + 1360 + + @@ -2180,10 +2198,16 @@ gg== 1.32 59.4 45199877 - 1360 + Some notes ... + + + 2012-04-5 + 2044 + + @@ -2193,10 +2217,16 @@ gg== 1.32 72.6 654 - 2044 + Some notes + + + 2012-04-25 + 2756 + + @@ -2206,10 +2236,16 @@ gg== 1.35 54 55488 - 2756 + Some notes + + + 2012-05-15 + 3410 + + @@ -2219,10 +2255,16 @@ gg== 1.35 75.33 4952 - 3410 + Some notes + + + 2012-06-11 + 3750 + + @@ -2232,10 +2274,16 @@ gg== 1.35 75.33 4952 - 3750 + Some notes + + + 2012-07-02 + 4115 + + @@ -2245,10 +2293,16 @@ gg== 1.35 64.53 15151 - 4115 + Some notes + + + 2012-07-28 + 4750 + + @@ -2258,10 +2312,16 @@ gg== 1.35 33.75 874195 - 4750 + Some notes + + + 2012-08-17 + 5171 + + @@ -2271,10 +2331,16 @@ gg== 1.35 69.12 4431 - 5171 + Some notes + + + 2012-09-11 + 5873 + + @@ -2284,10 +2350,16 @@ gg== 1.35 61.236 11234 - 5873 + Some notes + + + 2012-10-06 + 6571 + + @@ -2297,10 +2369,16 @@ gg== 1.37 73.158 798846 - 6571 + Some notes + + + 2012-11-02 + 7954 + + @@ -2310,10 +2388,16 @@ gg== 1.37 66.445 7954 - 7292 + Some notes + + + 2012-12-02 + 7981 + + @@ -2323,10 +2407,16 @@ gg== 1.4 49 545 - 7981 + Some notes + + + 2012-01-01 + 0 + + @@ -2336,10 +2426,16 @@ gg== 1.3 52 67458 - 0 + First refueling + + + 2012-02-11 + 658 + + @@ -2349,10 +2445,16 @@ gg== 1.3 65 455812 - 658 + Second refueling of the car + + + 2012-03-23 + 1360 + + @@ -2362,10 +2464,16 @@ gg== 1.32 59.4 45199877 - 1360 + Some notes ... + + + 2012-04-5 + 2044 + + @@ -2375,10 +2483,16 @@ gg== 1.32 72.6 654 - 2044 + Some notes + + + 2012-04-25 + 2756 + + @@ -2388,10 +2502,16 @@ gg== 1.35 54 55488 - 2756 + Some notes + + + 2012-05-15 + 3410 + + @@ -2401,10 +2521,16 @@ gg== 1.35 75.33 4952 - 3410 + Some notes + + + 2012-06-11 + 3750 + + @@ -2414,10 +2540,16 @@ gg== 1.35 75.33 4952 - 3750 + Some notes + + + 2012-07-02 + 4115 + + @@ -2427,10 +2559,16 @@ gg== 1.35 64.53 15151 - 4115 + Some notes + + + 2012-07-28 + 4750 + + @@ -2440,10 +2578,16 @@ gg== 1.35 33.75 874195 - 4750 + Some notes + + + 2012-08-17 + 5171 + + @@ -2453,10 +2597,16 @@ gg== 1.35 69.12 4431 - 5171 + Some notes + + + 2012-09-11 + 5873 + + @@ -2466,10 +2616,16 @@ gg== 1.35 61.236 11234 - 5873 + Some notes + + + 2012-10-06 + 6571 + + @@ -2479,10 +2635,16 @@ gg== 1.37 73.158 798846 - 6571 + Some notes + + + 2012-11-02 + 7292 + + @@ -2492,10 +2654,16 @@ gg== 1.37 66.445 7954 - 7292 + Some notes + + + 2012-12-02 + 7981 + + @@ -2505,10 +2673,16 @@ gg== 1.4 49 545 - 7981 + Some notes + + + 2012-10-01 + 1000 + + @@ -2517,7 +2691,7 @@ gg== 500.0 4574.2321 - 1000 + Usual car maintenance diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 82abc7c80e4..91fa7209614 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -15,10 +15,16 @@ class fleet_vehicle_cost(osv.Model): _name = 'fleet.vehicle.cost' _description = 'Cost of vehicle' _columns = { - 'price': fields.float('Price'), - 'type': fields.many2one('fleet.service.type', 'Service type', required=True, help='Service type purchased with this cost'), - 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this cost'), + 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this fuel log'), + 'cost_type': fields.many2one('fleet.service.type', 'Service type', required=False, help='Service type purchased with this cost'), + 'amount': fields.float('Total Price'), + 'parent_id': fields.many2one('fleet.vehicle.cost', 'Parent', required=False, help='Parent cost to this current cost'), } + def create(self, cr, uid, data, context=None): + if 'parent_id' in data: + data['vehicle_id'] = self.browse(cr, uid, data['parent_id'], context=context).vehicle_id.id + cost_id = super(fleet_vehicle_cost, self).create(cr, uid, data, context=context) + return cost_id ############################ ############################ @@ -468,6 +474,7 @@ class fleet_vehicle_odometer(osv.Model): class fleet_vehicle_log_fuel(osv.Model): #_inherits = {'fleet.vehicle.odometer': 'odometer_id'} + _inherits = {'fleet.vehicle.cost': 'cost_id'} def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): @@ -478,7 +485,7 @@ class fleet_vehicle_log_fuel(osv.Model): return { 'value' : { - 'unit' : odometer_unit, + 'odometer_unit' : odometer_unit, } } @@ -548,11 +555,9 @@ class fleet_vehicle_log_fuel(osv.Model): _columns = { #'name' : fields.char('Name',size=64), - 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this fuel log'), 'date' :fields.date('Refueling Date',help='Date when the refueling has been performed'), 'liter' : fields.float('Liter'), 'price_per_liter' : fields.float('Price Per Liter'), - 'amount': fields.float('Total price'), 'purchaser_id' : fields.many2one('res.partner', 'Purchaser',domain="['|',('customer','=',True),('employee','=',True)]"), 'inv_ref' : fields.char('Invoice Reference', size=64), 'vendor_id' : fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), @@ -564,6 +569,7 @@ class fleet_vehicle_log_fuel(osv.Model): _defaults = { 'purchaser_id': lambda self, cr, uid, ctx: uid, 'date' : time.strftime('%Y-%m-%d'), + } ############################ @@ -575,6 +581,8 @@ class fleet_vehicle_log_fuel(osv.Model): class fleet_vehicle_log_services(osv.Model): + _inherits = {'fleet.vehicle.cost': 'cost_id'} + def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): if not vehicle_id: @@ -618,10 +626,9 @@ class fleet_vehicle_log_services(osv.Model): _columns = { #'name' : fields.char('Name',size=64), - 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this services log'), + 'date' :fields.date('Service Date',help='Date when the service will be/has been performed'), - 'amount' :fields.float('Cost', help="Total cost of the service"), - 'service_ids' :fields.many2many('fleet.service.type','fleet_vehicle_service_type_rel','vehicle_service_type_id','service_id','Services completed'), + 'service_ids' : fields.one2many('fleet.vehicle.cost', 'parent_id', 'Services completed'), 'purchaser_id' : fields.many2one('res.partner', 'Purchaser',domain="['|',('customer','=',True),('employee','=',True)]"), 'inv_ref' : fields.char('Invoice Reference', size=64), 'vendor_id' :fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), @@ -655,6 +662,8 @@ class fleet_service_type(osv.Model): ############################ class fleet_vehicle_log_contract(osv.Model): + + _inherits = {'fleet.vehicle.cost': 'cost_id'} def _get_odometer(self, cr, uid, ids, odometer_id, arg, context): res = dict.fromkeys(ids, False) @@ -737,20 +746,19 @@ class fleet_vehicle_log_contract(osv.Model): _columns = { #'name' : fields.char('Name',size=64), - 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this contract log'), 'date' :fields.date('Contract Date',help='Date when the contract has been signed'), - 'contract_type' : fields.many2one('fleet.contract.type', 'Type', required=False, help='Type of the contract'), + 'start_date' : fields.date('Start Date', required=False, help='Date when the coverage of the contract begins'), 'expiration_date' : fields.date('Expiration Date', required=False, help='Date when the coverage of the contract expirates (by default, one year after begin date)'), 'warning_date' : fields.function(get_warning_date,type='integer',string='Warning Date',store=False), - 'price' : fields.float('Price', help="Cost of the contract for the specified period"), + 'insurer_id' :fields.many2one('res.partner', 'Insurer', domain="[('supplier','=',True)]"), 'purchaser_id' : fields.many2one('res.partner', 'Purchaser',domain="['|',('customer','=',True),('employee','=',True)]"), 'ins_ref' : fields.char('Contract Reference', size=64), 'state' : fields.selection([('open', 'In Progress'), ('closed', 'Terminated')], 'Status', readonly=True, help='Choose wheter the contract is still valid or not'), 'reminder' : fields.boolean('Renewal Reminder', help="Warn the user when this contract needs to be renewed"), 'notes' : fields.text('Terms and Conditions'), - 'costs' : fields.one2many('fleet.vehicle.cost', 'vehicle_id', 'Costs covered'), + 'costs' : fields.one2many('fleet.vehicle.cost', 'parent_id', 'Costs covered'), 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer',store=False), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index c8ce7fc44c1..21c41cd45e3 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -351,48 +351,50 @@ - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    -
    -
    + + + +
    -
    - - + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    +
    + +
    + + +
    @@ -404,13 +406,13 @@ - + - + @@ -570,18 +572,31 @@ - - - - - -
    +
    + + + + + + +
    + + + + + + +
    +
    + +
    + @@ -603,7 +618,7 @@ - + From 8e7e767002b7873938b9dc7281b8d189c9071890 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 4 Oct 2012 11:26:43 +0200 Subject: [PATCH 158/963] [ADD]merge and add help view in contract bzr revid: csn@openerp.com-20121004092643-v76awrhy6d4nahmu --- addons/fleet/demo.xml | 12 ------------ addons/fleet/fleet.py | 10 ++++++---- addons/fleet/fleet_view.xml | 18 +++++++++++++++++- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 5778f5f83fc..f5648aa462e 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -2683,17 +2683,5 @@ gg== 1000 - - - - 5 - 2012-10-01 - 500.0 - - 4574.2321 - - Usual car maintenance - - diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 91fa7209614..a7dccc8285f 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -753,19 +753,21 @@ class fleet_vehicle_log_contract(osv.Model): 'warning_date' : fields.function(get_warning_date,type='integer',string='Warning Date',store=False), 'insurer_id' :fields.many2one('res.partner', 'Insurer', domain="[('supplier','=',True)]"), - 'purchaser_id' : fields.many2one('res.partner', 'Purchaser',domain="['|',('customer','=',True),('employee','=',True)]"), + 'purchaser_id' : fields.many2one('res.partner', 'Contractor',domain="['|',('customer','=',True),('employee','=',True)]",help='Person to which the contract is signed for'), 'ins_ref' : fields.char('Contract Reference', size=64), 'state' : fields.selection([('open', 'In Progress'), ('closed', 'Terminated')], 'Status', readonly=True, help='Choose wheter the contract is still valid or not'), - 'reminder' : fields.boolean('Renewal Reminder', help="Warn the user when this contract needs to be renewed"), - 'notes' : fields.text('Terms and Conditions'), + 'reminder' : fields.boolean('Renewal Reminder', help="Warn the user a few days before the expiration date of this contract"), + 'notes' : fields.text('Terms and Conditions', help='Write here all supplementary informations relative to this contract'), 'costs' : fields.one2many('fleet.vehicle.cost', 'parent_id', 'Costs covered'), + 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), - 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer',store=False), + 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer',store=False,help='Odometer measure of the vehicle at the moment of this log'), 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), } _defaults = { 'purchaser_id': lambda self, cr, uid, ctx: uid, + 'date' : time.strftime('%Y-%m-%d'), 'start_date' : time.strftime('%Y-%m-%d'), 'state':'open', #'expiration_date' : self.compute_next_year_date(time.strftime('%Y-%m-%d')), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 21c41cd45e3..664239672ad 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -354,6 +354,7 @@ + @@ -372,6 +373,7 @@ + @@ -390,10 +392,11 @@ + - + @@ -424,6 +427,19 @@ fleet.vehicle.log.contract form tree,form + +

    + Click to create a new contract. +

    + Here you can create new contracts and show all existing + contracts. Contracts can be of various type, from insurance + contracts to leasing contracts. Each contract is associated + to an existing vehicle and can also be associated to a user. + For each contract, you can ask for a reminder that will color + the contract in orange when the expiration date is near or in + red when the expiration date is passed. +

    +
    From 1697d619c3630f8e3280525ce5a763fb92890def Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Thu, 4 Oct 2012 12:20:33 +0200 Subject: [PATCH 159/963] [ADD]change in contract view and model bzr revid: csn@openerp.com-20121004102033-mr108oy63dnmxlik --- addons/fleet/demo.xml | 12 ------- addons/fleet/fleet.py | 38 +++++++++-------------- addons/fleet/fleet_view.xml | 7 ++--- addons/fleet/security/ir.model.access.csv | 1 - 4 files changed, 16 insertions(+), 42 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index f5648aa462e..c03d19c908e 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -1846,18 +1846,6 @@ gg== 4 - - Insurance - - - - Leasing - - - - Omium - - 1-ACK-205 5454541 diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index a7dccc8285f..9cdea1091bf 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -243,7 +243,7 @@ class fleet_vehicle(osv.Model): reads = self.browse(cr,uid,ids,context=context) res=[] for record in reads: - contracts = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','open'),('reminder','=',True)],order='expiration_date') + contracts = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','open')],order='expiration_date') overdue=0 if (len(contracts) > 0): for element in contracts: @@ -271,7 +271,7 @@ class fleet_vehicle(osv.Model): reads = self.browse(cr,uid,ids,context=context) res=[] for record in reads: - contracts = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','open'),('reminder','=',True)],order='expiration_date') + contracts = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','open')],order='expiration_date') due_soon=0 if (len(contracts) > 0): for element in contracts: @@ -726,19 +726,19 @@ class fleet_vehicle_log_contract(osv.Model): reads = self.browse(cr,uid,ids,context=context) res=[] for record in reads: - if (record.reminder==True): - if (record.expiration_date and record.state=='open'): - today=self.str_to_date(time.strftime('%Y-%m-%d')) - renew_date = self.str_to_date(record.expiration_date) - diff_time=int((renew_date-today).days) - if (diff_time<=0): - res.append((record.id,0)) - else: - res.append((record.id,diff_time)) + #if (record.reminder==True): + if (record.expiration_date and record.state=='open'): + today=self.str_to_date(time.strftime('%Y-%m-%d')) + renew_date = self.str_to_date(record.expiration_date) + diff_time=int((renew_date-today).days) + if (diff_time<=0): + res.append((record.id,0)) else: - res.append((record.id,-1)) + res.append((record.id,diff_time)) else: res.append((record.id,-1)) + #else: + # res.append((record.id,-1)) return dict(res) _name = 'fleet.vehicle.log.contract' @@ -756,13 +756,13 @@ class fleet_vehicle_log_contract(osv.Model): 'purchaser_id' : fields.many2one('res.partner', 'Contractor',domain="['|',('customer','=',True),('employee','=',True)]",help='Person to which the contract is signed for'), 'ins_ref' : fields.char('Contract Reference', size=64), 'state' : fields.selection([('open', 'In Progress'), ('closed', 'Terminated')], 'Status', readonly=True, help='Choose wheter the contract is still valid or not'), - 'reminder' : fields.boolean('Renewal Reminder', help="Warn the user a few days before the expiration date of this contract"), + #'reminder' : fields.boolean('Renewal Reminder', help="Warn the user a few days before the expiration date of this contract"), 'notes' : fields.text('Terms and Conditions', help='Write here all supplementary informations relative to this contract'), 'costs' : fields.one2many('fleet.vehicle.cost', 'parent_id', 'Costs covered'), 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), - 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer',store=False,help='Odometer measure of the vehicle at the moment of this log'), + 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Value',store=False,help='Odometer measure of the vehicle at the moment of this log'), 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), } _defaults = { @@ -782,17 +782,7 @@ class fleet_vehicle_log_contract(osv.Model): self.write(cr, uid, ids, {'state': 'open'}) return True -############################ -############################ -#Vehicle.log.contract.type class -############################ -############################ -class fleet_contract_type(osv.Model): - _name = 'fleet.contract.type' - _columns = { - 'name': fields.char('Name', required=True, translate=True), - } ############################ ############################ #Vehicle.log.contract.state class diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 664239672ad..6ff1485d727 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -355,9 +355,10 @@ - + + + + + + @@ -383,8 +404,8 @@ - - + + - + @@ -406,11 +427,11 @@ - - - + + + - + - - @@ -454,6 +457,17 @@ + + + fleet.vehicle.log.contract.tree fleet.vehicle.log.contract @@ -467,7 +481,6 @@ - From 183646f3df0ab079686d91c77beff441cba7ef61 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Mon, 22 Oct 2012 17:27:19 +0200 Subject: [PATCH 237/963] [ADD]wizard for renewing contracts bzr revid: csn@openerp.com-20121022152719-jywhocuqj9sxnv5x --- addons/fleet/__init__.py | 3 ++- addons/fleet/__openerp__.py | 3 ++- addons/fleet/fleet.py | 42 ++++++++++++++++++++++++------------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/addons/fleet/__init__.py b/addons/fleet/__init__.py index a09fca549ce..369c7f372c6 100644 --- a/addons/fleet/__init__.py +++ b/addons/fleet/__init__.py @@ -1,2 +1,3 @@ # import the hr_car code -import fleet \ No newline at end of file +import fleet +import wizard \ No newline at end of file diff --git a/addons/fleet/__openerp__.py b/addons/fleet/__openerp__.py index 3689040bef4..74f1df2e336 100644 --- a/addons/fleet/__openerp__.py +++ b/addons/fleet/__openerp__.py @@ -20,7 +20,8 @@ Vehicle, leasing, insurances, cost 'data' : [ 'fleet_view.xml', 'data.xml', - 'board_fleet_view.xml' + 'board_fleet_view.xml', + 'wizard/renew_contract_view.xml', ], 'update_xml' : ['security/ir.model.access.csv'], diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 59af1d77d79..66e8cfcfe48 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -944,21 +944,35 @@ class fleet_vehicle_log_contract(osv.Model): def act_renew_contract(self,cr,uid,ids,context=None): contracts = self.browse(cr,uid,ids,context=context) - res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_renew_contract', context) + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_renew_contract_wizard', context) for element in contracts: - print '--------------------------' - print element.vehicle_id.id - print element.cost_type.id - print element.amount - print element.odometer - print element.insurer_id - res['context'] = { - 'default_vehicle_id': element.vehicle_id.id, - 'default_cost_type': element.cost_type.id, - 'default_amount': element.amount, - 'default_odometer': element.odometer, - #'default_insurer_id': element.insurer_id, - } + temp = [] + temp.append(('default_vehicle_id',element.vehicle_id.id)) + temp.append(('default_cost_type',element.cost_type.id)) + temp.append(('default_amount',element.amount)) + temp.append(('default_odometer_id',element.odometer_id.id)) + temp.append(('default_odometer_unit',element.odometer_unit)) + temp.append(('default_insurer_id',element.insurer_id.id)) + cost_temp = [] + for costs in element.cost_ids: + cost_temp.append(costs.id) + temp.append(('default_cost_ids',cost_temp)) + temp.append(('default_date',time.strftime('%Y-%m-%d'))) + temp.append(('default_start_date',element.expiration_date)) + temp.append(('default_purchaser_id',element.purchaser_id.id)) + temp.append(('default_ins_ref',element.ins_ref)) + temp.append(('default_state','open')) + temp.append(('default_notes',element.notes)) + + res['context'] = dict(temp) + #res['context']['default_vehicle_id'] = element.vehicle_id.id + #res['context'] = { + # 'default_vehicle_id': element.vehicle_id.id, + # 'default_cost_type': element.cost_type.id, + # 'default_amount': element.amount, + # 'default_odometer': element.odometer, + # 'default_insurer_id': element.insurer_id.id, + #} #res['domain']=[('vehicle_id','=', ids[0])] return res #return None From a1da4c7fad24dfdc4faceb1f0dcc5d00a5e0d246 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Mon, 22 Oct 2012 17:27:36 +0200 Subject: [PATCH 238/963] [ADD]wizard for renewing contracts bzr revid: csn@openerp.com-20121022152736-fiqiyp2sh1pr3lbw --- addons/fleet/wizard/__init__.py | 1 + addons/fleet/wizard/renew_contract.py | 140 ++++++++++++++++++++ addons/fleet/wizard/renew_contract_view.xml | 70 ++++++++++ 3 files changed, 211 insertions(+) create mode 100644 addons/fleet/wizard/__init__.py create mode 100644 addons/fleet/wizard/renew_contract.py create mode 100644 addons/fleet/wizard/renew_contract_view.xml diff --git a/addons/fleet/wizard/__init__.py b/addons/fleet/wizard/__init__.py new file mode 100644 index 00000000000..bc7dae97d56 --- /dev/null +++ b/addons/fleet/wizard/__init__.py @@ -0,0 +1 @@ +import renew_contract \ No newline at end of file diff --git a/addons/fleet/wizard/renew_contract.py b/addons/fleet/wizard/renew_contract.py new file mode 100644 index 00000000000..04f21227eb3 --- /dev/null +++ b/addons/fleet/wizard/renew_contract.py @@ -0,0 +1,140 @@ +from osv import osv, fields +import datetime + +class renew_contract(osv.TransientModel): + _name = "fleet.vehicle.contract.renew" + _description = "wizard to renew a contract" + + def name_get(self, cr, uid, ids, context=None): + if context is None: + context = {} + if not ids: + return [] + reads = self.browse(cr, uid, ids, context=context) + res = [] + for record in reads: + if record.vehicle_id.name: + name = str(record.vehicle_id.name) + if record.cost_type.name: + name = name+ ' / '+ str(record.cost_type.name) + if record.date: + name = name+ ' / '+ record.date + res.append((record.id, name)) + return res + + def _vehicle_contract_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): + res = self.name_get(cr, uid, ids, context=context) + return dict(res) + + def _get_odometer(self, cr, uid, ids, odometer_id, arg, context): + res = dict.fromkeys(ids, False) + for record in self.browse(cr,uid,ids,context=context): + if record.odometer_id: + res[record.id] = record.odometer_id.value + return res + + def _set_odometer(self, cr, uid, id, name, value, args=None, context=None): + if value: + try: + value = float(value) + except ValueError: + #_logger.exception(value+' is not a correct odometer value. Please, fill a float for this field') + raise except_orm(_('Error!'), value+' is not a correct odometer value. Please, fill a float for this field') + + date = self.browse(cr, uid, id, context=context).date + if not(date): + date = time.strftime('%Y-%m-%d') + vehicle_id = self.browse(cr, uid, id, context=context).vehicle_id + data = {'value' : value,'date' : date,'vehicle_id' : vehicle_id.id} + odometer_id = self.pool.get('fleet.vehicle.odometer').create(cr, uid, data, context=context) + self.write(cr, uid, id, {'odometer_id': odometer_id}) + return value + self.write(cr, uid, id, {'odometer_id': ''}) + return False + + def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): + + if not vehicle_id: + return {} + + odometer_unit = self.pool.get('fleet.vehicle').browse(cr, uid, vehicle_id, context=context).odometer_unit + + return { + 'value' : { + 'odometer_unit' : odometer_unit, + } + } + + def compute_next_year_date(self, strdate): + oneyear=datetime.timedelta(days=365) + curdate = self.str_to_date(strdate) + nextyear=curdate+oneyear#int(strdate[:4])+1 + return str(nextyear)#+strdate[4:] + + #def on_change_start_date(self, cr, uid, ids, strdate, context=None): + # if (strdate): + + # return {'value' : {'expiration_date' : self.compute_next_year_date(strdate),}} + # else: + # return {} + + def str_to_date(self,strdate): + return datetime.datetime(int(strdate[:4]),int(strdate[5:7]),int(strdate[8:])) + + def get_warning_date(self,cr,uid,ids,prop,unknow_none,context=None): + if context is None: + context={} + if not ids: + return dict([]) + reads = self.browse(cr,uid,ids,context=context) + res=[] + for record in reads: + #if (record.reminder==True): + if (record.expiration_date and record.state=='open'): + today=self.str_to_date(time.strftime('%Y-%m-%d')) + renew_date = self.str_to_date(record.expiration_date) + diff_time=int((renew_date-today).days) + if (diff_time<=0): + res.append((record.id,0)) + else: + res.append((record.id,diff_time)) + else: + res.append((record.id,-1)) + #else: + # res.append((record.id,-1)) + return dict(res) + + _columns = { + 'name' : fields.function(_vehicle_contract_name_get_fnc, type="text", string='Name', store=True), + 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this fuel log'), + 'cost_type': fields.many2one('fleet.service.type', 'Service type', required=False, help='Service type purchased with this cost'), + 'amount': fields.float('Total Price'), + + 'parent_id': fields.many2one('fleet.vehicle.cost', 'Parent', required=False, help='Parent cost to this current cost'), + 'cost_ids' : fields.one2many('fleet.vehicle.cost', 'parent_id', 'Included Services'), + + 'date' :fields.date('Date',help='Date when the cost has been executed'), + + 'start_date' : fields.date('Contract Start Date', required=False, help='Date when the coverage of the contract begins'), + 'expiration_date' : fields.date('Contract Expiration Date', required=False, help='Date when the coverage of the contract expirates (by default, one year after begin date)'), + 'warning_date' : fields.function(get_warning_date,type='integer',string='Warning Date',store=False), + + 'insurer_id' :fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), + 'purchaser_id' : fields.many2one('res.partner', 'Contractor',domain="['|',('customer','=',True),('employee','=',True)]",help='Person to which the contract is signed for'), + 'ins_ref' : fields.char('Contract Reference', size=64), + 'state' : fields.selection([('open', 'In Progress'), ('closed', 'Terminated')], 'Status', readonly=True, help='Choose wheter the contract is still valid or not'), + #'reminder' : fields.boolean('Renewal Reminder', help="Warn the user a few days before the expiration date of this contract"), + 'notes' : fields.text('Terms and Conditions', help='Write here all supplementary informations relative to this contract'), + 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), + 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer Value',store=False,help='Odometer measure of the vehicle at the moment of this log'), + 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), + #'cost_amount': fields.related('cost_id','amount',type="float",string="Amount",store=True, readonly=True), + } + + + + def renew(self, cr, uid, ids, context=None): + print '-------------------------------' + print 'renew contract' + print '-------------------------------' + return {} \ No newline at end of file diff --git a/addons/fleet/wizard/renew_contract_view.xml b/addons/fleet/wizard/renew_contract_view.xml new file mode 100644 index 00000000000..9113ebb595e --- /dev/null +++ b/addons/fleet/wizard/renew_contract_view.xml @@ -0,0 +1,70 @@ + + + + + fleet.vehicle.contract.wizard.form + fleet.vehicle.contract.renew + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + +
    +
    \ No newline at end of file From ae95cab5332fe3730381329bf31d0baf668cd721 Mon Sep 17 00:00:00 2001 From: Vijaykumar Baladaniya Date: Tue, 23 Oct 2012 10:57:15 +0530 Subject: [PATCH 239/963] [FIX] point_of_sale: Add a context on launch_payment() method. bzr revid: vba@tinyerp.com-20121023052715-78d4sykmrrpzult0 --- addons/point_of_sale/wizard/pos_payment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index ca9331012b7..6dd02179f30 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -85,6 +85,7 @@ class pos_make_payment(osv.osv_memory): 'target': 'new', 'views': False, 'type': 'ir.actions.act_window', + 'context': context, } def print_report(self, cr, uid, ids, context=None): From 507b632e41fff52f9097c3ed2592c5ec46b8b3c9 Mon Sep 17 00:00:00 2001 From: Paramjit Singh Sahota Date: Tue, 23 Oct 2012 11:31:26 +0530 Subject: [PATCH 240/963] [IMP] Improved code the kanban image which cuts from upper side. bzr revid: psa@tinyerp.com-20121023060126-k6m0o0bfk9gnqf2s --- addons/hr/static/src/css/hr.css | 2 +- addons/mail/static/src/css/mail_group.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr/static/src/css/hr.css b/addons/hr/static/src/css/hr.css index e0eb8c198a5..f395f9939e5 100644 --- a/addons/hr/static/src/css/hr.css +++ b/addons/hr/static/src/css/hr.css @@ -22,7 +22,7 @@ -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); -o-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); - box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.4); + box-shadow: 0 1px 4px 3px rgba(0, 0, 0, 0.4); } .oe_employee_picture { diff --git a/addons/mail/static/src/css/mail_group.css b/addons/mail/static/src/css/mail_group.css index 9ca0055c17f..78467245557 100644 --- a/addons/mail/static/src/css/mail_group.css +++ b/addons/mail/static/src/css/mail_group.css @@ -51,7 +51,7 @@ border-collapse: separate; -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); + box-shadow: 0 1px 4px 3px rgba(0, 0, 0, 0.4); -o-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); } From 36fabd70a06bf53611211acdb932bf4554c15755 Mon Sep 17 00:00:00 2001 From: "Rajesh Prajapati (OpenERP)" Date: Tue, 23 Oct 2012 11:57:41 +0530 Subject: [PATCH 241/963] [IMP] purchase : string changed bzr revid: rpr@tinyerp.com-20121023062741-piioezk25796h9jf --- addons/purchase/res_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/res_config.py b/addons/purchase/res_config.py index 19b059d4d5b..75e42d14905 100644 --- a/addons/purchase/res_config.py +++ b/addons/purchase/res_config.py @@ -43,7 +43,7 @@ class purchase_config_settings(osv.osv_memory): 'group_costing_method':fields.boolean("Compute product cost price based on average cost", implied_group='product.group_costing_method', help="""Allows you to compute product cost price based on average cost."""), - 'group_purchase_delivery_address': fields.boolean("Allow a different address for incoming products and invoicings", + 'group_purchase_delivery_address': fields.boolean("Allow a different address for incoming products and invoicing", implied_group='purchase.group_delivery_invoice_address', help="Allows you to specify different delivery and invoice addresses on a purchase order."), 'module_warning': fields.boolean("Alerts by products or supplier", From a519d96aa9713574144340c6548032bfbf03178f Mon Sep 17 00:00:00 2001 From: "Rajesh Prajapati (OpenERP)" Date: Tue, 23 Oct 2012 12:26:10 +0530 Subject: [PATCH 242/963] [IMP] sale : string changed from plugin to plug-in bzr revid: rpr@tinyerp.com-20121023065610-41a67irfmb0t4tpn --- addons/base_setup/res_config.py | 4 ++-- addons/plugin_outlook/plugin_outlook.xml | 2 +- addons/plugin_thunderbird/plugin_thunderbird.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/base_setup/res_config.py b/addons/base_setup/res_config.py index 0dc4a0f0794..e7898395d62 100644 --- a/addons/base_setup/res_config.py +++ b/addons/base_setup/res_config.py @@ -60,14 +60,14 @@ class sale_config_settings(osv.osv_memory): 'module_web_linkedin': fields.boolean('Get contacts automatically from linkedIn', help="""When you create a new contact (person or company), you will be able to load all the data from LinkedIn (photos, address, etc)."""), 'module_crm': fields.boolean('CRM'), - 'module_plugin_thunderbird': fields.boolean('Enable Thunderbird plugin', + 'module_plugin_thunderbird': fields.boolean('Enable Thunderbird plug-in', help="""The plugin allows you archive email and its attachments to the selected OpenERP objects. You can select a partner, or a lead and attach the selected mail as a .eml file in the attachment of a selected record. You can create documents for CRM Lead, Partner from the selected emails. This installs the module plugin_thunderbird."""), - 'module_plugin_outlook': fields.boolean('Enable Outlook plugin', + 'module_plugin_outlook': fields.boolean('Enable Outlook plug-in', help="""The Outlook plugin allows you to select an object that you would like to add to your email and its attachments from MS Outlook. You can select a partner, or a lead object and archive a selected diff --git a/addons/plugin_outlook/plugin_outlook.xml b/addons/plugin_outlook/plugin_outlook.xml index e99fbf72b6d..6ecbd14b31a 100644 --- a/addons/plugin_outlook/plugin_outlook.xml +++ b/addons/plugin_outlook/plugin_outlook.xml @@ -51,7 +51,7 @@
  • diff --git a/addons/plugin_thunderbird/plugin_thunderbird.xml b/addons/plugin_thunderbird/plugin_thunderbird.xml index 5ea5fc38219..cf30bdf0e9b 100644 --- a/addons/plugin_thunderbird/plugin_thunderbird.xml +++ b/addons/plugin_thunderbird/plugin_thunderbird.xml @@ -57,7 +57,7 @@
    From 23d286ef524c7993c8416bcea52a1a80b62e5616 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 23 Oct 2012 09:53:28 +0200 Subject: [PATCH 243/963] [ADD]Generated costs for contracts bzr revid: dle@openerp.com-20121023075328-63q25k9iqigc1izf --- addons/fleet/demo.xml | 5 +++++ addons/fleet/fleet.py | 9 +++++++++ addons/fleet/fleet_view.xml | 40 ++++++++++++++++++++++++++----------- 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 7c6e1c5ab0a..1603c2ee654 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -732,6 +732,7 @@ 450 + monthly 2012-01-01 @@ -768,6 +769,7 @@ 400 + monthly 2012-01-01 @@ -804,6 +806,7 @@ 400 + monthly 2012-01-01 @@ -840,6 +843,7 @@ 400 + monthly 2012-01-01 @@ -876,6 +880,7 @@ 400 + monthly 2012-01-01 diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 66e8cfcfe48..7fed70f6752 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -48,6 +48,8 @@ class fleet_vehicle_cost(osv.Model): 'cost_ids' : fields.one2many('fleet.vehicle.cost', 'parent_id', 'Included Services'), 'date' :fields.date('Date',help='Date when the cost has been executed'), + + 'contract_id' : fields.many2one('fleet.vehicle.log.contract', 'Contract', required=False, help='Contract attached to this cost'), } _default ={ @@ -60,6 +62,11 @@ class fleet_vehicle_cost(osv.Model): if 'parent_id' in data and data['parent_id']: data['vehicle_id'] = self.browse(cr, uid, data['parent_id'], context=context).vehicle_id.id data['date'] = self.browse(cr, uid, data['parent_id'], context=context).date + if 'contract_id' in data and data['contract_id']: + print str(data) + data['vehicle_id'] = self.pool.get('fleet.vehicle.log.contract').browse(cr, uid, data['contract_id'], context=context).vehicle_id.id + data['cost_type'] = self.pool.get('fleet.vehicle.log.contract').browse(cr, uid, data['contract_id'], context=context).cost_type.id + print 'Contract : '+ str(data['contract_id']) + ' Add generated cost for vehicle ' + str(data['vehicle_id']) + ' with cost type : ' + str(data['cost_type']) cost_id = super(fleet_vehicle_cost, self).create(cr, uid, data, context=context) return cost_id @@ -999,6 +1006,8 @@ class fleet_vehicle_log_contract(osv.Model): 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer Value',store=False,help='Odometer measure of the vehicle at the moment of this log'), 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), 'cost_amount': fields.related('cost_id','amount',type="float",string="Amount",store=True, readonly=True), + 'cost_frequency': fields.selection([('daily', 'Daily'),('weekly','Weekly'),('monthly','Monthly'),('yearly','Yearly')], 'Cost Frequency', help='Frequency of the costs',required=True), + 'generated_cost_ids' : fields.one2many('fleet.vehicle.cost', 'contract_id', 'Generated Costs',ondelete='cascade'), } _defaults = { 'purchaser_id': lambda self, cr, uid, ctx: uid, diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index e58ed5bb5d5..9b172e9904c 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -419,7 +419,11 @@ - +
    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -481,6 +499,7 @@ +
    @@ -719,11 +738,8 @@ - - - From 0696aa196d473ba2049f6f90b1b825f164bc8d5a Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Tue, 23 Oct 2012 14:19:49 +0530 Subject: [PATCH 244/963] [IMP] portal_sale: change help text for menus bzr revid: cha@tinyerp.com-20121023084949-vn1fz0axxqbj1oyt --- addons/portal_sale/portal_sale_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/portal_sale/portal_sale_view.xml b/addons/portal_sale/portal_sale_view.xml index 6b25d87b791..b46175f7feb 100644 --- a/addons/portal_sale/portal_sale_view.xml +++ b/addons/portal_sale/portal_sale_view.xml @@ -45,7 +45,7 @@ kanban,tree,form - No public products. + There are no public products. @@ -65,7 +65,7 @@ {'type':'receipt'} current - You don't have any payment. + You don't have any refunds or payments. Date: Tue, 23 Oct 2012 14:54:57 +0530 Subject: [PATCH 245/963] [IMP]bom_lines=False added in duplicating BOM bzr revid: kbh@tinyerp.com-20121023092457-o6d2ubyb7mzslwtp --- addons/mrp/mrp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 3ae27bf2c41..fb3ad899c88 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -371,7 +371,7 @@ class mrp_bom(osv.osv): if default is None: default = {} bom_data = self.read(cr, uid, id, [], context=context) - default.update(name=_("%s (copy)") % (bom_data['name']), bom_id=False) + default.update(name=_("%s (copy)") % (bom_data['name']), bom_id=False, bom_lines=False) return super(mrp_bom, self).copy_data(cr, uid, id, default, context=context) def create(self, cr, uid, vals, context=None): From d31ffbd1830351b2ab37886ebe185328159960ce Mon Sep 17 00:00:00 2001 From: "Rajesh Prajapati (OpenERP)" Date: Tue, 23 Oct 2012 15:26:30 +0530 Subject: [PATCH 246/963] [IMP] sale : bullet removed and close button added bzr revid: rpr@tinyerp.com-20121023095630-uhfm502p6o8fn4d8 --- addons/plugin_outlook/plugin_outlook.xml | 11 ++++++---- .../plugin_thunderbird/plugin_thunderbird.xml | 21 +++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/addons/plugin_outlook/plugin_outlook.xml b/addons/plugin_outlook/plugin_outlook.xml index 6ecbd14b31a..1d2917cf89e 100644 --- a/addons/plugin_outlook/plugin_outlook.xml +++ b/addons/plugin_outlook/plugin_outlook.xml @@ -19,14 +19,17 @@

    Click on the link above to download the installer for either 32 or 64 bits, and execute it.

    System requirements:

    -
      -
    • 1. MS Outlook 2005 or above.
    • -
    • 2. MS .Net Framework 3.5 or above.
    • -
    +
      +
    1. MS Outlook 2005 or above.
    2. +
    3. MS .Net Framework 3.5 or above.
    4. +
    +
    +
    +
    diff --git a/addons/plugin_thunderbird/plugin_thunderbird.xml b/addons/plugin_thunderbird/plugin_thunderbird.xml index cf30bdf0e9b..f1ec262c03f 100644 --- a/addons/plugin_thunderbird/plugin_thunderbird.xml +++ b/addons/plugin_thunderbird/plugin_thunderbird.xml @@ -20,19 +20,22 @@

    Thunderbird plugin installation:

    -
      -
    • 1. Save the Thunderbird plug-in.
    • -
    • 2. From the Thunderbird menubar: Tools ­> Add-ons -> Screwdriver/Wrench Icon -> Install add-on from file...
    • -
    • 3. Select the plug-in (the file named openerp_plugin.xpi).
    • -
    • 4. Click "Install Now".
    • -
    • 5. Restart Thunderbird.
    • -
    • 6. From the Thunderbird menubar: OpenERP -> Configuration.
    • -
    • 7. Configure your openerp server.
    • -
    +
      +
    1. Save the Thunderbird plug-in.
    2. +
    3. From the Thunderbird menubar: Tools ­> Add-ons -> Screwdriver/Wrench Icon -> Install add-on from file...
    4. +
    5. Select the plug-in (the file named openerp_plugin.xpi).
    6. +
    7. Click "Install Now".
    8. +
    9. Restart Thunderbird.
    10. +
    11. From the Thunderbird menubar: OpenERP -> Configuration.
    12. +
    13. Configure your openerp server.
    14. +
    +
    +
    +
    From c8d4483ba31475bcfac6f53084f70bbe6d6a8841 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Tue, 23 Oct 2012 15:27:56 +0530 Subject: [PATCH 247/963] [IMP] portal_event: change help text for event menu bzr revid: cha@tinyerp.com-20121023095756-6xssqpsxzw9wzbzz --- addons/portal_event/portal_event_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal_event/portal_event_view.xml b/addons/portal_event/portal_event_view.xml index 1e046bc9e7f..5d2397f6148 100755 --- a/addons/portal_event/portal_event_view.xml +++ b/addons/portal_event/portal_event_view.xml @@ -13,7 +13,7 @@ kanban,calendar,tree,form,graph {"search_default_upcoming":1} - No public events. + There are no public events. Date: Tue, 23 Oct 2012 12:15:09 +0200 Subject: [PATCH 248/963] [ADD] Added basic skel. bzr revid: vta@openerp.com-20121023101509-5hyjjanz89pj1qbh --- addons/saas_analytics/__init__.py | 0 addons/saas_analytics/__openerp__.py | 41 ++++++++++++++ addons/saas_analytics/controllers/__init__.py | 3 ++ addons/saas_analytics/controllers/main.py | 32 +++++++++++ .../saas_analytics/static/src/img/icon128.png | Bin 0 -> 11486 bytes .../static/src/js/web_analytics.js | 50 ++++++++++++++++++ 6 files changed, 126 insertions(+) create mode 100644 addons/saas_analytics/__init__.py create mode 100644 addons/saas_analytics/__openerp__.py create mode 100644 addons/saas_analytics/controllers/__init__.py create mode 100644 addons/saas_analytics/controllers/main.py create mode 100644 addons/saas_analytics/static/src/img/icon128.png create mode 100644 addons/saas_analytics/static/src/js/web_analytics.js diff --git a/addons/saas_analytics/__init__.py b/addons/saas_analytics/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/addons/saas_analytics/__openerp__.py b/addons/saas_analytics/__openerp__.py new file mode 100644 index 00000000000..d8ee68a2d9d --- /dev/null +++ b/addons/saas_analytics/__openerp__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2010-2012 OpenERP s.a. (). +# +# 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 . +# +############################################################################## +{ + 'name': 'Google Analytics', + 'version': '1.0', + 'category': 'Tools', + 'complexity': "easy", + 'description': """ +Google Analytics. +============================== + +Collects web application usage with Google Analytics. + """, + 'author': 'OpenERP SA', + 'website': 'http://openerp.com', + 'depends': ['web'], + 'icon': '/web_analytics/static/src/img/icon128.png', + 'data': [], + 'installable': True, + 'active': False, + 'js': ['static/src/js/web_analytics.js'], +} + diff --git a/addons/saas_analytics/controllers/__init__.py b/addons/saas_analytics/controllers/__init__.py new file mode 100644 index 00000000000..9f828025b8e --- /dev/null +++ b/addons/saas_analytics/controllers/__init__.py @@ -0,0 +1,3 @@ +import main + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/saas_analytics/controllers/main.py b/addons/saas_analytics/controllers/main.py new file mode 100644 index 00000000000..81ca3417255 --- /dev/null +++ b/addons/saas_analytics/controllers/main.py @@ -0,0 +1,32 @@ +import json +import textwrap + +import simplejson +import werkzeug.wrappers + +import web.common.http as openerpweb +import web.controllers.main + +class web_analytics(openerpweb.Controller): + + # This controllers redirects virtual urls of the form /web_analytics/MODEL/VIEW + # as provided to google by the analytics modules to a real url that openerp can + # understand of the form /web/webclient/home/#model=MODEL&view_type=VIEW + # So that the user can click openerp urls inside google analytics. + + @openerpweb.httprequest + def redirect(self,req): + url = req.httprequest.base_url + suburl = url.split('/') + suburl = suburl[suburl.index('redirect')+1:] + + rurl = "/web/webclient/home/#" + if len(suburl) >=1 and suburl[0]: + rurl += "model="+str(suburl[0]) + if len(suburl) >=2 and suburl[1]: + rurl += "&view_type="+str(suburl[1]) + + redirect = werkzeug.utils.redirect(rurl, 303) + + return redirect + diff --git a/addons/saas_analytics/static/src/img/icon128.png b/addons/saas_analytics/static/src/img/icon128.png new file mode 100644 index 0000000000000000000000000000000000000000..320c1f3ec34c5c73d10b512d4a1bf03d87d85f33 GIT binary patch literal 11486 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 ve3UPGXiZo(TM7KX)R%>XS1df+3;7 Date: Tue, 23 Oct 2012 15:57:34 +0530 Subject: [PATCH 249/963] [REM]remove suffix copy from duplicating BOM bzr revid: kbh@tinyerp.com-20121023102734-1d0upye19ps64be1 --- addons/mrp/mrp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index fb3ad899c88..f760087d872 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -371,7 +371,7 @@ class mrp_bom(osv.osv): if default is None: default = {} bom_data = self.read(cr, uid, id, [], context=context) - default.update(name=_("%s (copy)") % (bom_data['name']), bom_id=False, bom_lines=False) + default.update(name=_("%s") % (bom_data['name']), bom_id=False) return super(mrp_bom, self).copy_data(cr, uid, id, default, context=context) def create(self, cr, uid, vals, context=None): From 3bde64f49c3c5d04b92cdf3cb0d0b67da9655149 Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Tue, 23 Oct 2012 17:44:07 +0530 Subject: [PATCH 250/963] [IMP]hr_expense:fields are readonly when expense is apporved bzr revid: kbh@tinyerp.com-20121023121407-6qarpm3ppdmgm8cu --- addons/hr_expense/hr_expense.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 487e4f58782..ee79e03fa77 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -64,22 +64,22 @@ class hr_expense_expense(osv.osv): _description = "Expense" _order = "id desc" _columns = { - 'name': fields.char('Description', size=128, required=True), + 'name': fields.char('Description', size=128, required=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'id': fields.integer('Sheet ID', readonly=True), - 'date': fields.date('Date', select=True), + 'date': fields.date('Date', select=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'journal_id': fields.many2one('account.journal', 'Force Journal', help = "The journal used when the expense is done."), - 'employee_id': fields.many2one('hr.employee', "Employee", required=True), + 'employee_id': fields.many2one('hr.employee', "Employee", required=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'user_id': fields.many2one('res.users', 'User', required=True), 'date_confirm': fields.date('Confirmation Date', select=True, help = "Date of the confirmation of the sheet expense. It's filled when the button Confirm is pressed."), 'date_valid': fields.date('Validation Date', select=True, help = "Date of the acceptation of the sheet expense. It's filled when the button Accept is pressed."), - 'user_valid': fields.many2one('res.users', 'Validation User'), + 'user_valid': fields.many2one('res.users', 'Validation User', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'account_move_id': fields.many2one('account.move', 'Ledger Posting'), 'line_ids': fields.one2many('hr.expense.line', 'expense_id', 'Expense Lines', readonly=True, states={'draft':[('readonly',False)]} ), 'note': fields.text('Note'), 'amount': fields.function(_amount, string='Total Amount', digits_compute= dp.get_precision('Account')), 'voucher_id': fields.many2one('account.voucher', "Employee's Receipt"), - 'currency_id': fields.many2one('res.currency', 'Currency', required=True), - 'department_id':fields.many2one('hr.department','Department'), + 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), + 'department_id':fields.many2one('hr.department','Department', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'company_id': fields.many2one('res.company', 'Company', required=True), 'state': fields.selection([ ('draft', 'New'), From d4f970ff9ccb21d6e31982e70f8d41f9075b6cbd Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Tue, 23 Oct 2012 18:09:10 +0530 Subject: [PATCH 251/963] [IMP]hr_expense:delete only those expense which are in draft states bzr revid: kbh@tinyerp.com-20121023123910-v1sd0wtgis9cn0w6 --- addons/hr_expense/hr_expense.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index ee79e03fa77..06852e08e96 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -100,6 +100,12 @@ class hr_expense_expense(osv.osv): 'currency_id': _get_currency, } + def unlink(self, cr, uid, ids, context=None): + for rec in self.browse(cr, uid, ids, context=context): + if rec.state != 'draft': + raise osv.except_osv(_('Warning!'),_('You cannot delete an expense which is in %s state!')%(rec.state)) + return super(hr_expense_expense, self).unlink(cr, uid, ids, context) + def onchange_currency_id(self, cr, uid, ids, currency_id=False, company_id=False, context=None): res = {'value': {'journal_id': False}} journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','purchase'), ('currency','=',currency_id), ('company_id', '=', company_id)], context=context) From 24635aae19b3a1faab455dbbfa8b8cc547013876 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 23 Oct 2012 15:01:52 +0200 Subject: [PATCH 252/963] [ADD]add renew contract bzr revid: csn@openerp.com-20121023130152-51hd311rn0prj3oq --- addons/fleet/fleet.py | 35 +++++++++++++++++++++-------------- addons/fleet/fleet_view.xml | 8 ++++---- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 7fed70f6752..3cc7d5f6284 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -916,7 +916,8 @@ class fleet_vehicle_log_contract(osv.Model): nextyear=curdate+oneyear#int(strdate[:4])+1 return str(nextyear)#+strdate[4:] - def on_change_start_date(self, cr, uid, ids, strdate, context=None): + def on_change_start_date(self, cr, uid, ids, strdate, enddate, context=None): + if (strdate): return {'value' : {'expiration_date' : self.compute_next_year_date(strdate),}} @@ -951,7 +952,7 @@ class fleet_vehicle_log_contract(osv.Model): def act_renew_contract(self,cr,uid,ids,context=None): contracts = self.browse(cr,uid,ids,context=context) - res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_renew_contract_wizard', context) + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_renew_contract', context) for element in contracts: temp = [] temp.append(('default_vehicle_id',element.vehicle_id.id)) @@ -965,24 +966,29 @@ class fleet_vehicle_log_contract(osv.Model): cost_temp.append(costs.id) temp.append(('default_cost_ids',cost_temp)) temp.append(('default_date',time.strftime('%Y-%m-%d'))) - temp.append(('default_start_date',element.expiration_date)) + temp.append(('default_start_date',str(self.str_to_date(element.expiration_date)+datetime.timedelta(days=1)))) temp.append(('default_purchaser_id',element.purchaser_id.id)) temp.append(('default_ins_ref',element.ins_ref)) temp.append(('default_state','open')) temp.append(('default_notes',element.notes)) + temp.append(('default_cost_frequency',element.cost_frequency)) + generated_cost = [] + for gen_cost in element.generated_cost_ids: + generated_cost.append(gen_cost.id) + temp.append(('default_generated_cost_ids',generated_cost)) + + #compute end date + startdate = self.str_to_date(element.start_date) + enddate = self.str_to_date(element.expiration_date) + diffdate = (enddate-startdate) + newenddate = enddate+diffdate + temp.append(('default_expiration_date',str(newenddate))) res['context'] = dict(temp) - #res['context']['default_vehicle_id'] = element.vehicle_id.id - #res['context'] = { - # 'default_vehicle_id': element.vehicle_id.id, - # 'default_cost_type': element.cost_type.id, - # 'default_amount': element.amount, - # 'default_odometer': element.odometer, - # 'default_insurer_id': element.insurer_id.id, - #} - #res['domain']=[('vehicle_id','=', ids[0])] + return res - #return None + + _name = 'fleet.vehicle.log.contract' _order='state,expiration_date' @@ -1014,13 +1020,14 @@ class fleet_vehicle_log_contract(osv.Model): 'date' : time.strftime('%Y-%m-%d'), 'start_date' : time.strftime('%Y-%m-%d'), 'state':'open', - #'expiration_date' : self.compute_next_year_date(time.strftime('%Y-%m-%d')), + 'expiration_date' : lambda self,cr,uid,ctx: self.compute_next_year_date(time.strftime('%Y-%m-%d')), } def copy(self, cr, uid, id, default=None, context=None): default = default or {} current_object = self.browse(cr,uid,id,context) + default['date'] = time.strftime('%Y-%m-%d') default['start_date'] = time.strftime('%Y-%m-%d') default['expiration_date'] = self.compute_next_year_date(time.strftime('%Y-%m-%d')) #default['name'] = current_object.name diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 9b172e9904c..6ca53514e1f 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -45,8 +45,8 @@

    Click to create a new model.

    - Here you can add the different model for a - particular brand of vehicle. Like Audi A3, + Specify the different model for a particular + brand of vehicle. For example Audi A3, Audi A4, ...

    @@ -147,7 +147,6 @@

    Click to create a new state.

    - Here you can create and organize the state for a vehicle. A state can help you knowing in what condition your vehicle is. In reparation, Sold, Active, ...

    @@ -258,6 +257,7 @@ + @@ -436,7 +436,7 @@ - + From ceec3ec123c5303cef2e1b6182eea8d182e8359b Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 23 Oct 2012 15:46:54 +0200 Subject: [PATCH 253/963] [ADD]Cron for generated costs bzr revid: dle@openerp.com-20121023134654-xbvm5egnc44ro8k8 --- addons/fleet/data.xml | 15 ++++++++++++++- addons/fleet/demo.xml | 6 +++--- addons/fleet/fleet.py | 38 +++++++++++++++++++++++++++++++++++--- 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/addons/fleet/data.xml b/addons/fleet/data.xml index 07cf8062cde..f6da343abf0 100644 --- a/addons/fleet/data.xml +++ b/addons/fleet/data.xml @@ -2,7 +2,7 @@ - Creation ofVehicle services and Services renewals reminders + Creation of Vehicle services and Services renewals reminders 1 @@ -14,6 +14,19 @@ + + Generation of contracts costs based on the costs frequency + + + 1 + minutes + -1 + + + + + + Calculation Benefit In Kind service diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 1603c2ee654..f58bc5a9159 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -769,7 +769,7 @@ 400 - monthly + weekly 2012-01-01 @@ -806,7 +806,7 @@ 400 - monthly + daily 2012-01-01 @@ -843,7 +843,7 @@ 400 - monthly + yearly 2012-01-01 diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 3cc7d5f6284..7feda666814 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -1,8 +1,9 @@ +# -*- coding: utf-8 -*- from itertools import chain from osv import osv, fields import time -import tools import datetime +import tools from osv.orm import except_orm from tools.translate import _ ############################ @@ -63,10 +64,8 @@ class fleet_vehicle_cost(osv.Model): data['vehicle_id'] = self.browse(cr, uid, data['parent_id'], context=context).vehicle_id.id data['date'] = self.browse(cr, uid, data['parent_id'], context=context).date if 'contract_id' in data and data['contract_id']: - print str(data) data['vehicle_id'] = self.pool.get('fleet.vehicle.log.contract').browse(cr, uid, data['contract_id'], context=context).vehicle_id.id data['cost_type'] = self.pool.get('fleet.vehicle.log.contract').browse(cr, uid, data['contract_id'], context=context).cost_type.id - print 'Contract : '+ str(data['contract_id']) + ' Add generated cost for vehicle ' + str(data['vehicle_id']) + ' with cost type : ' + str(data['cost_type']) cost_id = super(fleet_vehicle_cost, self).create(cr, uid, data, context=context) return cost_id @@ -849,6 +848,39 @@ class fleet_service_type(osv.Model): class fleet_vehicle_log_contract(osv.Model): _inherits = {'fleet.vehicle.cost': 'cost_id'} + + def run_scheduler(self,cr,uid,context=None): + + d = datetime.datetime.now() + #d = datetime.date(2001, 01, 01) + + frequencies = [] + if d.day == 1 and d.month == 1: + frequencies.append(('cost_frequency','=','yearly')) + if d.day == 1: + frequencies.append(('cost_frequency','=','monthly')) + if d.isoweekday() == 1: + frequencies.append(('cost_frequency','=','weekly')) + frequencies.append(('cost_frequency','=','daily')) + + frequencies_size = len(frequencies) + for i in range(frequencies_size-1): + frequencies.insert(0,'|') + + condition = ['&','&','&',('state','=','open',),('start_date','<=',d),('expiration_date','>=',d)] + condition.extend(frequencies) + + print str(condition) + contract_ids = self.pool.get('fleet.vehicle.log.contract').search(cr, uid, condition, offset=0, limit=None, order=None,context=None, count=False) + for contract_id in contract_ids: + + nbr = self.pool.get('fleet.vehicle.cost').search(cr,uid,['&',('contract_id','=',contract_id),('date','=',d)],context=context,count=True) + + if not nbr: + contract = self.pool.get('fleet.vehicle.log.contract').browse(cr,uid,contract_id,context=context) + data = {'amount' : contract.amount,'date' : d,'vehicle_id' : contract.vehicle_id.id,'cost_type' : contract.cost_type.id,'contract_id' : contract_id} + cost_id = self.pool.get('fleet.vehicle.cost').create(cr, uid, data, context=context) + return True def name_get(self, cr, uid, ids, context=None): if context is None: From 5a929ccd14c12970f401e74e79dbb729d488e8e2 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 23 Oct 2012 15:59:01 +0200 Subject: [PATCH 254/963] [ADD]Distinction in contracts for generated costs and activation costs bzr revid: dle@openerp.com-20121023135901-cpsrbry9uwl84bg2 --- addons/fleet/demo.xml | 15 ++++++++++----- addons/fleet/fleet.py | 6 ++---- addons/fleet/fleet_view.xml | 5 +++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index f58bc5a9159..5db21ef9298 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -731,7 +731,8 @@ - 450 + 0 + 450 monthly 2012-01-01 @@ -768,7 +769,8 @@ - 400 + 0 + 400 weekly 2012-01-01 @@ -805,7 +807,8 @@ - 400 + 0 + 400 daily 2012-01-01 @@ -842,7 +845,8 @@ - 400 + 0 + 400 yearly 2012-01-01 @@ -879,7 +883,8 @@ - 400 + 0 + 400 monthly 2012-01-01 diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 7feda666814..d2d59adef1e 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -878,7 +878,7 @@ class fleet_vehicle_log_contract(osv.Model): if not nbr: contract = self.pool.get('fleet.vehicle.log.contract').browse(cr,uid,contract_id,context=context) - data = {'amount' : contract.amount,'date' : d,'vehicle_id' : contract.vehicle_id.id,'cost_type' : contract.cost_type.id,'contract_id' : contract_id} + data = {'amount' : contract.cost_generated,'date' : d,'vehicle_id' : contract.vehicle_id.id,'cost_type' : contract.cost_type.id,'contract_id' : contract_id} cost_id = self.pool.get('fleet.vehicle.cost').create(cr, uid, data, context=context) return True @@ -1026,9 +1026,6 @@ class fleet_vehicle_log_contract(osv.Model): _order='state,expiration_date' _columns = { 'name' : fields.function(_vehicle_contract_name_get_fnc, type="text", string='Name', store=True), - #'name' : fields.char('Name',size=64), - - #'cost_type': fields.many2one('fleet.service.type', 'Service type', required=False, help='Service type purchased with this cost', domain="[('category','=','contract')]"), 'start_date' : fields.date('Contract Start Date', required=False, help='Date when the coverage of the contract begins'), 'expiration_date' : fields.date('Contract Expiration Date', required=False, help='Date when the coverage of the contract expirates (by default, one year after begin date)'), @@ -1044,6 +1041,7 @@ class fleet_vehicle_log_contract(osv.Model): 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer Value',store=False,help='Odometer measure of the vehicle at the moment of this log'), 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), 'cost_amount': fields.related('cost_id','amount',type="float",string="Amount",store=True, readonly=True), + 'cost_generated': fields.float('Generated costs amount'), 'cost_frequency': fields.selection([('daily', 'Daily'),('weekly','Weekly'),('monthly','Monthly'),('yearly','Yearly')], 'Cost Frequency', help='Frequency of the costs',required=True), 'generated_cost_ids' : fields.one2many('fleet.vehicle.cost', 'contract_id', 'Generated Costs',ondelete='cascade'), } diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 6ca53514e1f..11dcf3a6420 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -419,9 +419,10 @@ - From 5663bd8335aa576f4c9a4e11268d5efc6299d96c Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 23 Oct 2012 16:06:14 +0200 Subject: [PATCH 255/963] [ADD]Different vehicle tree view for dashboard bzr revid: dle@openerp.com-20121023140614-pl4153el0xej3i43 --- addons/fleet/board_fleet_view.xml | 18 +++++++++++++++++- addons/fleet/fleet_view.xml | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/addons/fleet/board_fleet_view.xml b/addons/fleet/board_fleet_view.xml index 1f38985c29e..09a670b5d13 100644 --- a/addons/fleet/board_fleet_view.xml +++ b/addons/fleet/board_fleet_view.xml @@ -1,6 +1,22 @@ + + fleet.vehicle.tree.board + fleet.vehicle + + + + + + + + + + + + + Fuel Costs by Month fleet.vehicle.log.fuel @@ -39,7 +55,7 @@ Vehicles which need contracts renewal fleet.vehicle - + form tree ['|',('contract_renewal_due_soon','>',0),('contract_renewal_overdue','>',0)] diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 11dcf3a6420..2f96e34cfd0 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -231,6 +231,7 @@ fleet.vehicle.tree fleet.vehicle + 1 From ba1adaef65362ab45e38be1adc6ff746438fcca6 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 23 Oct 2012 16:31:08 +0200 Subject: [PATCH 256/963] [ADD]Demo values and optimize date comparaison for generation of contracts costs bzr revid: dle@openerp.com-20121023143108-3gq57w6l0fzmdv01 --- addons/fleet/board_fleet_view.xml | 4 +-- addons/fleet/demo.xml | 50 +++++++++++++++++++++++++++++-- addons/fleet/fleet.py | 6 ++-- 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/addons/fleet/board_fleet_view.xml b/addons/fleet/board_fleet_view.xml index 09a670b5d13..3ef597733bb 100644 --- a/addons/fleet/board_fleet_view.xml +++ b/addons/fleet/board_fleet_view.xml @@ -28,9 +28,7 @@ Services Costs by Month fleet.vehicle.log.services - - - + form tree diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 5db21ef9298..359ad8a3b48 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -729,6 +729,50 @@ + + + 513 + + 2012-10-15 + + 124 + + Maintenance + + + + + 412 + + 2012-10-08 + + 20984 + + Maintenance + + + + + 275 + + 2012-09-25 + + 241 + + Maintenance + + + + + 302 + + 2012-09-15 + + 22513 + + Maintenance + + 0 @@ -771,7 +815,7 @@ 0 400 - weekly + monthly 2012-01-01 @@ -809,7 +853,7 @@ 0 400 - daily + monthly 2012-01-01 @@ -847,7 +891,7 @@ 0 400 - yearly + monthly 2012-01-01 diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index d2d59adef1e..a85b1dd8ad8 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -851,8 +851,8 @@ class fleet_vehicle_log_contract(osv.Model): def run_scheduler(self,cr,uid,context=None): - d = datetime.datetime.now() - #d = datetime.date(2001, 01, 01) + #d = datetime.datetime.now() + d = datetime.date(2012, 8, 01) frequencies = [] if d.day == 1 and d.month == 1: @@ -867,7 +867,7 @@ class fleet_vehicle_log_contract(osv.Model): for i in range(frequencies_size-1): frequencies.insert(0,'|') - condition = ['&','&','&',('state','=','open',),('start_date','<=',d),('expiration_date','>=',d)] + condition = ['&','&','&',('state','=','open',),('start_date','<=',d.strftime('%Y-%m-%d')),('expiration_date','>=',d.strftime('%Y-%m-%d'))] condition.extend(frequencies) print str(condition) From 7d15ab44f439138b18a56a908ba9ca120c993b98 Mon Sep 17 00:00:00 2001 From: "vta vta@openerp.com" <> Date: Tue, 23 Oct 2012 17:15:49 +0200 Subject: [PATCH 257/963] [FIX] Fixed naming, the account used in ga, and the controller. bzr revid: vta@openerp.com-20121023151549-atepg5qan70xhmiq --- .../__init__.py | 0 .../__openerp__.py | 1 - .../controllers/__init__.py | 0 .../controllers/main.py | 8 ++-- .../static/src/img/icon.png} | Bin .../static/src/js/web_analytics.js | 40 ++++++++++-------- 6 files changed, 28 insertions(+), 21 deletions(-) rename addons/{saas_analytics => web_analytics}/__init__.py (100%) rename addons/{saas_analytics => web_analytics}/__openerp__.py (96%) rename addons/{saas_analytics => web_analytics}/controllers/__init__.py (100%) rename addons/{saas_analytics => web_analytics}/controllers/main.py (85%) rename addons/{saas_analytics/static/src/img/icon128.png => web_analytics/static/src/img/icon.png} (100%) rename addons/{saas_analytics => web_analytics}/static/src/js/web_analytics.js (51%) diff --git a/addons/saas_analytics/__init__.py b/addons/web_analytics/__init__.py similarity index 100% rename from addons/saas_analytics/__init__.py rename to addons/web_analytics/__init__.py diff --git a/addons/saas_analytics/__openerp__.py b/addons/web_analytics/__openerp__.py similarity index 96% rename from addons/saas_analytics/__openerp__.py rename to addons/web_analytics/__openerp__.py index d8ee68a2d9d..2fa95c7398b 100644 --- a/addons/saas_analytics/__openerp__.py +++ b/addons/web_analytics/__openerp__.py @@ -32,7 +32,6 @@ Collects web application usage with Google Analytics. 'author': 'OpenERP SA', 'website': 'http://openerp.com', 'depends': ['web'], - 'icon': '/web_analytics/static/src/img/icon128.png', 'data': [], 'installable': True, 'active': False, diff --git a/addons/saas_analytics/controllers/__init__.py b/addons/web_analytics/controllers/__init__.py similarity index 100% rename from addons/saas_analytics/controllers/__init__.py rename to addons/web_analytics/controllers/__init__.py diff --git a/addons/saas_analytics/controllers/main.py b/addons/web_analytics/controllers/main.py similarity index 85% rename from addons/saas_analytics/controllers/main.py rename to addons/web_analytics/controllers/main.py index 81ca3417255..82c42efecb0 100644 --- a/addons/saas_analytics/controllers/main.py +++ b/addons/web_analytics/controllers/main.py @@ -11,16 +11,18 @@ class web_analytics(openerpweb.Controller): # This controllers redirects virtual urls of the form /web_analytics/MODEL/VIEW # as provided to google by the analytics modules to a real url that openerp can - # understand of the form /web/webclient/home/#model=MODEL&view_type=VIEW + # understand of the form /#model=MODEL&view_type=VIEW # So that the user can click openerp urls inside google analytics. + _cp_path = "/web_analytics" + @openerpweb.httprequest - def redirect(self,req): + def redirect(self, req): url = req.httprequest.base_url suburl = url.split('/') suburl = suburl[suburl.index('redirect')+1:] - rurl = "/web/webclient/home/#" + rurl = "/#" if len(suburl) >=1 and suburl[0]: rurl += "model="+str(suburl[0]) if len(suburl) >=2 and suburl[1]: diff --git a/addons/saas_analytics/static/src/img/icon128.png b/addons/web_analytics/static/src/img/icon.png similarity index 100% rename from addons/saas_analytics/static/src/img/icon128.png rename to addons/web_analytics/static/src/img/icon.png diff --git a/addons/saas_analytics/static/src/js/web_analytics.js b/addons/web_analytics/static/src/js/web_analytics.js similarity index 51% rename from addons/saas_analytics/static/src/js/web_analytics.js rename to addons/web_analytics/static/src/js/web_analytics.js index 5ef824ec260..800e41b5a64 100644 --- a/addons/saas_analytics/static/src/js/web_analytics.js +++ b/addons/web_analytics/static/src/js/web_analytics.js @@ -13,20 +13,21 @@ openerp.web_analytics = function(instance) { * web_client.do_push_state() method which is responsible of changing the openerp current url */ - - if (instance.webclient) { - //_gaq.push(['_setAccount', 'UA-25293939-2']); // fva@openerp.com localhost - _gaq.push(['_setAccount', 'UA-28648768-1']); // fva@openerp.com runbot - //_gaq.push(['_setAccount', 'UA-28648768-1']); // fva@openerp.com - //_gaq.push(['_setAccount', 'UA-7333765-1']); // fp@openerp.com - //_gaq.push(['_setAccount', 'UA-7333765-1']); // fp@openerp.com - _gaq.push(['_setDomainName', '.openerp.com']); + // _gaq.push(['_setAccount', 'UA-25293939-2']); // fva@openerp.com localhost + // _gaq.push(['_setAccount', 'UA-28648768-1']); // fva@openerp.com runbot + // _gaq.push(['_setAccount', 'UA-28648768-1']); // fva@openerp.com + // _gaq.push(['_setAccount', 'UA-7333765-1']); // fp@openerp.com + // _gaq.push(['_setAccount', 'UA-7333765-1']); // fp@openerp.com + // _gaq.push(['_setDomainName', '.openerp.com']); + + _gaq.push(['_setAccount', 'UA-35793871-1']); // vta@openerp.com localhost + _gaq.push(['setDomainName', 'none']); _gaq.push(['_trackPageview']); - var connection = this.sessions.session0.connection; - _gaq.push(['_setCustomVar',1,'Paying User',String(connection.openerp_entreprise),1]); - _gaq.push(['_setCustomVar',2,'Admin User',String(connection.uid == 1),1]); + // var connection = instance.session.connection; + _gaq.push(['_setCustomVar', 1, 'Normal User', String(instance.session.uid === 1), 1]); + _gaq.push(['_setCustomVar', 2, 'Admin User', String(instance.session.uid === 1), 1]); // Google Analytics Code snippet (function() { @@ -36,15 +37,20 @@ openerp.web_analytics = function(instance) { ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga,s); - }) (); + })(); - instance.webclient.do_push_state.add(function(state) { + var self = this; + instance.webclient.on('state_pushed', self, function(state) { + var model_whitelist = {'sale.order':'', 'purchase.order':'', 'crm.lead':''}; + var view_type_blacklist = {'default':''}; var model = state["model"] || "no_model"; var view_type = state["view_type"] || "default"; - var vurl = "web_analytics/redirect/"+ model + "/" + view_type - console.log(vurl); - _gaq.push(['_trackPageview',vurl]); + if ((model in model_whitelist) && !(view_type in view_type_blacklist)) { + var vurl = "web_analytics/redirect/"+ model + "/" + view_type + console.log(vurl); + _gaq.push(['_trackPageview',vurl]); + } }); } -}; +}; \ No newline at end of file From 6ea4181244579279fde119a79ac214531922870d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 23 Oct 2012 17:56:31 +0200 Subject: [PATCH 258/963] [FIX] mail: incoming emails are not correctly set with email type. bzr revid: tde@openerp.com-20121023155631-h7gbhrmgpg3mwj0f --- addons/mail/mail_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 04da686b49d..273e0edaa36 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -554,7 +554,7 @@ class mail_thread(osv.AbstractModel): ('file2', 'bytes')} } """ - msg_dict = {} + msg_dict = {'type': 'email'} if not isinstance(message, Message): if isinstance(message, unicode): # Warning: message_from_string doesn't always work correctly on unicode, From a8da0fbef74cf71d934140c3b9a27b2846b1ebc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 23 Oct 2012 17:57:10 +0200 Subject: [PATCH 259/963] [IMP] mail: res_partner override: incoming emails are set as private, by setting thread_id to False. In message_post, this will set model and res_id of the message to False, leading to a private message. bzr revid: tde@openerp.com-20121023155710-j6ugemc60khdqk74 --- addons/mail/res_partner.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/addons/mail/res_partner.py b/addons/mail/res_partner.py index 6b13fe6ad20..46b250328f8 100644 --- a/addons/mail/res_partner.py +++ b/addons/mail/res_partner.py @@ -42,4 +42,21 @@ class res_partner_mail(osv.Model): 'notification_email_send': lambda *args: 'comment' } + def message_post(self, cr, uid, thread_id, body='', subject=None, type='notification', + subtype=None, parent_id=False, attachments=None, context=None, **kwargs): + """ Override related to res.partner. In case of email message, set it as + private: + - add the target partner in the message partner_ids + - set thread_id as None, because this will trigger the 'private' + aspect of the message (model=False, res_is=False) + """ + if isinstance(thread_id, (list, tuple)): + thread_id = thread_id[0] + if type == 'email': + partner_ids = kwargs.get('partner_ids', []) + partner_ids.append(thread_id) + kwargs['partner_ids'] = partner_ids + return super(res_partner_mail, self).message_post(cr, uid, False, body=body, subject=subject, + type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, **kwargs) + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 2bf0904440bf4a38eacc4454627b42c05a22a1ae Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 23 Oct 2012 19:25:36 +0200 Subject: [PATCH 260/963] [FIX]Cron not though correctly bzr revid: dle@openerp.com-20121023172536-y843yfdjb2tar188 --- addons/fleet/fleet.py | 75 +++++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index a85b1dd8ad8..5ee2509b531 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -6,6 +6,7 @@ import datetime import tools from osv.orm import except_orm from tools.translate import _ +from dateutil.relativedelta import relativedelta ############################ ############################ #Vehicle.cost class @@ -51,10 +52,12 @@ class fleet_vehicle_cost(osv.Model): 'date' :fields.date('Date',help='Date when the cost has been executed'), 'contract_id' : fields.many2one('fleet.vehicle.log.contract', 'Contract', required=False, help='Contract attached to this cost'), + 'auto_generated' : fields.boolean('automatically generated',readonly=True,required=True) } _default ={ 'parent_id':None, + 'auto_generated' : False, } @@ -851,40 +854,56 @@ class fleet_vehicle_log_contract(osv.Model): def run_scheduler(self,cr,uid,context=None): - #d = datetime.datetime.now() - d = datetime.date(2012, 8, 01) + d = datetime.datetime.now() + #d = datetime.datetime(2012, 12, 01) - frequencies = [] - if d.day == 1 and d.month == 1: - frequencies.append(('cost_frequency','=','yearly')) - if d.day == 1: - frequencies.append(('cost_frequency','=','monthly')) - if d.isoweekday() == 1: - frequencies.append(('cost_frequency','=','weekly')) - frequencies.append(('cost_frequency','=','daily')) + contract_ids = self.pool.get('fleet.vehicle.log.contract').search(cr, uid, [('state','=','open')], offset=0, limit=None, order=None,context=None, count=False) + for contract in self.pool.get('fleet.vehicle.log.contract').browse(cr,uid,contract_ids,context=context): + if contract.generated_cost_ids != []: + last_cost_id = self.pool.get('fleet.vehicle.cost').search(cr, uid, ['&',('contract_id','=',contract.id),('auto_generated','=',True)], offset=0, limit=1, order='date desc',context=None, count=False) + last_cost_date = self.pool.get('fleet.vehicle.cost').browse(cr,uid,last_cost_id[0],context=None).date + else : + last_cost_date = False - frequencies_size = len(frequencies) - for i in range(frequencies_size-1): - frequencies.insert(0,'|') - - condition = ['&','&','&',('state','=','open',),('start_date','<=',d.strftime('%Y-%m-%d')),('expiration_date','>=',d.strftime('%Y-%m-%d'))] - condition.extend(frequencies) - - print str(condition) - contract_ids = self.pool.get('fleet.vehicle.log.contract').search(cr, uid, condition, offset=0, limit=None, order=None,context=None, count=False) - for contract_id in contract_ids: - - nbr = self.pool.get('fleet.vehicle.cost').search(cr,uid,['&',('contract_id','=',contract_id),('date','=',d)],context=context,count=True) - - if not nbr: - contract = self.pool.get('fleet.vehicle.log.contract').browse(cr,uid,contract_id,context=context) - data = {'amount' : contract.cost_generated,'date' : d,'vehicle_id' : contract.vehicle_id.id,'cost_type' : contract.cost_type.id,'contract_id' : contract_id} - cost_id = self.pool.get('fleet.vehicle.cost').create(cr, uid, data, context=context) + if contract.cost_frequency == 'yearly': + delta = relativedelta(years=+1) + if last_cost_date: + startdate = datetime.datetime(int(last_cost_date[:4]),1,1) + relativedelta(years=+1) + else: + startdate = datetime.datetime(int(contract.start_date[:4]),1,1) + enddate = datetime.datetime(d.year,1,1) + if contract.cost_frequency == 'monthly': + delta = relativedelta(months=+1) + if last_cost_date: + startdate = datetime.datetime(int(last_cost_date[:4]),int(last_cost_date[5:7]),1) + relativedelta(months=+1) + else: + startdate = datetime.datetime(int(contract.start_date[:4]),int(contract.start_date[5:7]),1) + enddate = datetime.datetime(d.year,d.month,1) + if contract.cost_frequency == 'weekly': + delta = relativedelta(weeks=+1) + if last_cost_date: + startdate = datetime.datetime.strptime(last_cost_date[:4]+'-'+last_cost_date[5:7]+'-'+str(self.str_to_date(last_cost_date).weekday()),'%Y-%m-%w') + relativedelta(weeks=+1) + else: + startdate = datetime.datetime.strptime(contract.start_date[:4]+'-'+contract.start_date[5:7]+'-'+str(self.str_to_date(contract.start_date).weekday()),'%Y-%m-%w') + enddate = datetime.datetime.strptime(d.year+'-'+d.month+'-'+d.weekday(),'%Y-%m-%w') + if contract.cost_frequency == 'daily': + delta = relativedelta(days=+1) + if last_cost_date: + startdate = datetime.datetime.strptime(last_cost_date,'%Y-%m-%d') + relativedelta(days=+1) + else: + startdate = datetime.datetime.strptime(contract.start_date,'%Y-%m-%d') + enddate = d + print 'Start : '+str(startdate)+', End : '+str(enddate) + while startdate <= enddate: + data = {'amount' : contract.cost_generated,'date' : startdate,'vehicle_id' : contract.vehicle_id.id,'cost_type' : contract.cost_type.id,'contract_id' : contract.id,'auto_generated' : True} + print data + cost_id = self.pool.get('fleet.vehicle.cost').create(cr, uid, data, context=context) + startdate += delta return True def name_get(self, cr, uid, ids, context=None): if context is None: - context = {} + context = {} if not ids: return [] reads = self.browse(cr, uid, ids, context=context) From 0ddd32f68f11c5dd0875c1697f4098293070d3bd Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Tue, 23 Oct 2012 19:44:47 +0200 Subject: [PATCH 261/963] [FIX]Contracts cost cron weekly fixed bzr revid: dle@openerp.com-20121023174447-imj5zsc3we4jlasb --- addons/fleet/fleet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 5ee2509b531..ff08d360fea 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -872,21 +872,21 @@ class fleet_vehicle_log_contract(osv.Model): else: startdate = datetime.datetime(int(contract.start_date[:4]),1,1) enddate = datetime.datetime(d.year,1,1) - if contract.cost_frequency == 'monthly': + elif contract.cost_frequency == 'monthly': delta = relativedelta(months=+1) if last_cost_date: startdate = datetime.datetime(int(last_cost_date[:4]),int(last_cost_date[5:7]),1) + relativedelta(months=+1) else: startdate = datetime.datetime(int(contract.start_date[:4]),int(contract.start_date[5:7]),1) enddate = datetime.datetime(d.year,d.month,1) - if contract.cost_frequency == 'weekly': + elif contract.cost_frequency == 'weekly': delta = relativedelta(weeks=+1) if last_cost_date: startdate = datetime.datetime.strptime(last_cost_date[:4]+'-'+last_cost_date[5:7]+'-'+str(self.str_to_date(last_cost_date).weekday()),'%Y-%m-%w') + relativedelta(weeks=+1) else: startdate = datetime.datetime.strptime(contract.start_date[:4]+'-'+contract.start_date[5:7]+'-'+str(self.str_to_date(contract.start_date).weekday()),'%Y-%m-%w') - enddate = datetime.datetime.strptime(d.year+'-'+d.month+'-'+d.weekday(),'%Y-%m-%w') - if contract.cost_frequency == 'daily': + enddate = datetime.datetime.strptime(str(d.year)+'-'+d.strftime('%W')+'-'+d.strftime('%w'),'%Y-%W-%w') + elif contract.cost_frequency == 'daily': delta = relativedelta(days=+1) if last_cost_date: startdate = datetime.datetime.strptime(last_cost_date,'%Y-%m-%d') + relativedelta(days=+1) From c144f3e183935b148d09f116e3d609b26a34ff18 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 24 Oct 2012 10:24:28 +0200 Subject: [PATCH 262/963] [IMP]Cron dates bzr revid: dle@openerp.com-20121024082428-230yvc0prch4d7wf --- addons/fleet/fleet.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index ff08d360fea..ec3d9ccae96 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -854,7 +854,7 @@ class fleet_vehicle_log_contract(osv.Model): def run_scheduler(self,cr,uid,context=None): - d = datetime.datetime.now() + d = datetime.date.today() #d = datetime.datetime(2012, 12, 01) contract_ids = self.pool.get('fleet.vehicle.log.contract').search(cr, uid, [('state','=','open')], offset=0, limit=None, order=None,context=None, count=False) @@ -864,38 +864,37 @@ class fleet_vehicle_log_contract(osv.Model): last_cost_date = self.pool.get('fleet.vehicle.cost').browse(cr,uid,last_cost_id[0],context=None).date else : last_cost_date = False - if contract.cost_frequency == 'yearly': delta = relativedelta(years=+1) if last_cost_date: - startdate = datetime.datetime(int(last_cost_date[:4]),1,1) + relativedelta(years=+1) + startdate = datetime.date(int(last_cost_date[:4]),1,1) + relativedelta(years=+1) else: - startdate = datetime.datetime(int(contract.start_date[:4]),1,1) - enddate = datetime.datetime(d.year,1,1) + startdate = datetime.date(int(contract.start_date[:4]),1,1) + enddate = datetime.date(d.year,1,1) elif contract.cost_frequency == 'monthly': delta = relativedelta(months=+1) if last_cost_date: - startdate = datetime.datetime(int(last_cost_date[:4]),int(last_cost_date[5:7]),1) + relativedelta(months=+1) + startdate = datetime.date(int(last_cost_date[:4]),int(last_cost_date[5:7]),1) + relativedelta(months=+1) else: - startdate = datetime.datetime(int(contract.start_date[:4]),int(contract.start_date[5:7]),1) - enddate = datetime.datetime(d.year,d.month,1) + startdate = datetime.date(int(contract.start_date[:4]),int(contract.start_date[5:7]),1) + enddate = datetime.date(d.year,d.month,1) elif contract.cost_frequency == 'weekly': delta = relativedelta(weeks=+1) if last_cost_date: - startdate = datetime.datetime.strptime(last_cost_date[:4]+'-'+last_cost_date[5:7]+'-'+str(self.str_to_date(last_cost_date).weekday()),'%Y-%m-%w') + relativedelta(weeks=+1) + startdate = datetime.datetime.strptime(last_cost_date[:4]+'-'+self.str_to_date(last_cost_date[5:7]).strftime('%W')+'-'+str(self.str_to_date(last_cost_date).weekday()),'%Y-%W-%w').date() + relativedelta(weeks=+1) else: - startdate = datetime.datetime.strptime(contract.start_date[:4]+'-'+contract.start_date[5:7]+'-'+str(self.str_to_date(contract.start_date).weekday()),'%Y-%m-%w') - enddate = datetime.datetime.strptime(str(d.year)+'-'+d.strftime('%W')+'-'+d.strftime('%w'),'%Y-%W-%w') + startdate = datetime.date.strptime(contract.start_date[:4]+'-'+self.str_to_date(contract.start_date[5:7]).strftime('%W')+'-'+str(self.str_to_date(contract.start_date).weekday()).date(),'%Y-%W-%w') + enddate = datetime.date.strptime(str(d.year)+'-'+d.strftime('%W')+'-'+d.strftime('%w'),'%Y-%W-%w') elif contract.cost_frequency == 'daily': delta = relativedelta(days=+1) if last_cost_date: - startdate = datetime.datetime.strptime(last_cost_date,'%Y-%m-%d') + relativedelta(days=+1) + startdate = datetime.datetime.strptime(last_cost_date,'%Y-%m-%d').date() + relativedelta(days=+1) else: - startdate = datetime.datetime.strptime(contract.start_date,'%Y-%m-%d') + startdate = datetime.datetime.strptime(contract.start_date,'%Y-%m-%d').date() enddate = d print 'Start : '+str(startdate)+', End : '+str(enddate) while startdate <= enddate: - data = {'amount' : contract.cost_generated,'date' : startdate,'vehicle_id' : contract.vehicle_id.id,'cost_type' : contract.cost_type.id,'contract_id' : contract.id,'auto_generated' : True} + data = {'amount' : contract.cost_generated,'date' : startdate.strftime('%Y-%m-%d'),'vehicle_id' : contract.vehicle_id.id,'cost_type' : contract.cost_type.id,'contract_id' : contract.id,'auto_generated' : True} print data cost_id = self.pool.get('fleet.vehicle.cost').create(cr, uid, data, context=context) startdate += delta From 22b8f785466c89078c230b2d7601d3a85a71a54c Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 24 Oct 2012 11:11:31 +0200 Subject: [PATCH 263/963] [ADD]Unique frequency for contracts costs frequency + [FIX]Week interval bugs + replace title and help messages bzr revid: dle@openerp.com-20121024091131-j1o5kf2klt0827be --- addons/fleet/demo.xml | 40 ++++++++++++++++++------------------- addons/fleet/fleet.py | 19 +++++++++++++----- addons/fleet/fleet_view.xml | 3 ++- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/addons/fleet/demo.xml b/addons/fleet/demo.xml index 359ad8a3b48..8b4275dd4bf 100644 --- a/addons/fleet/demo.xml +++ b/addons/fleet/demo.xml @@ -776,15 +776,15 @@ 0 - 450 - monthly + 20 + daily - 2012-01-01 + - Usual leasing contract + Daily leasing contract @@ -814,15 +814,15 @@ 0 - 400 - monthly + 150 + weekly - 2012-01-01 + - Usual leasing contract + Weekly leasing contract @@ -855,12 +855,12 @@ 400 monthly - 2012-01-01 + - Usual leasing contract + Monthly leasing contract @@ -890,15 +890,15 @@ 0 - 400 - monthly + 4000 + yearly - 2012-01-01 + - Usual leasing contract + Yearly leasing contract @@ -928,15 +928,15 @@ 0 - 400 - monthly + 17000 + unique - 2012-01-01 - - + + + - Usual leasing contract + Unique leasing contract diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index ec3d9ccae96..eaebbf9398a 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -859,6 +859,8 @@ class fleet_vehicle_log_contract(osv.Model): contract_ids = self.pool.get('fleet.vehicle.log.contract').search(cr, uid, [('state','=','open')], offset=0, limit=None, order=None,context=None, count=False) for contract in self.pool.get('fleet.vehicle.log.contract').browse(cr,uid,contract_ids,context=context): + if not contract.start_date: + break; if contract.generated_cost_ids != []: last_cost_id = self.pool.get('fleet.vehicle.cost').search(cr, uid, ['&',('contract_id','=',contract.id),('auto_generated','=',True)], offset=0, limit=1, order='date desc',context=None, count=False) last_cost_date = self.pool.get('fleet.vehicle.cost').browse(cr,uid,last_cost_id[0],context=None).date @@ -881,10 +883,10 @@ class fleet_vehicle_log_contract(osv.Model): elif contract.cost_frequency == 'weekly': delta = relativedelta(weeks=+1) if last_cost_date: - startdate = datetime.datetime.strptime(last_cost_date[:4]+'-'+self.str_to_date(last_cost_date[5:7]).strftime('%W')+'-'+str(self.str_to_date(last_cost_date).weekday()),'%Y-%W-%w').date() + relativedelta(weeks=+1) + startdate = datetime.datetime.strptime(last_cost_date[:4]+'-'+self.str_to_date(last_cost_date).strftime('%W')+'-'+str(self.str_to_date(last_cost_date).weekday()),'%Y-%W-%w').date() + relativedelta(weeks=+1) else: - startdate = datetime.date.strptime(contract.start_date[:4]+'-'+self.str_to_date(contract.start_date[5:7]).strftime('%W')+'-'+str(self.str_to_date(contract.start_date).weekday()).date(),'%Y-%W-%w') - enddate = datetime.date.strptime(str(d.year)+'-'+d.strftime('%W')+'-'+d.strftime('%w'),'%Y-%W-%w') + startdate = datetime.datetime.strptime(contract.start_date[:4]+'-'+self.str_to_date(contract.start_date).strftime('%W')+'-'+str(self.str_to_date(contract.start_date).weekday()),'%Y-%W-%w').date() + enddate = datetime.datetime.strptime(str(d.year)+'-'+d.strftime('%W')+'-'+d.strftime('%w'),'%Y-%W-%w').date() elif contract.cost_frequency == 'daily': delta = relativedelta(days=+1) if last_cost_date: @@ -892,6 +894,13 @@ class fleet_vehicle_log_contract(osv.Model): else: startdate = datetime.datetime.strptime(contract.start_date,'%Y-%m-%d').date() enddate = d + elif contract.cost_frequency == 'unique': + delta = relativedelta(days=+1) + if not last_cost_date: + enddate = startdate = datetime.datetime.strptime(contract.start_date,'%Y-%m-%d').date() + else: + startdate = 1 + enddate = 0 print 'Start : '+str(startdate)+', End : '+str(enddate) while startdate <= enddate: data = {'amount' : contract.cost_generated,'date' : startdate.strftime('%Y-%m-%d'),'vehicle_id' : contract.vehicle_id.id,'cost_type' : contract.cost_type.id,'contract_id' : contract.id,'auto_generated' : True} @@ -1059,8 +1068,8 @@ class fleet_vehicle_log_contract(osv.Model): 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer Value',store=False,help='Odometer measure of the vehicle at the moment of this log'), 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), 'cost_amount': fields.related('cost_id','amount',type="float",string="Amount",store=True, readonly=True), - 'cost_generated': fields.float('Generated costs amount'), - 'cost_frequency': fields.selection([('daily', 'Daily'),('weekly','Weekly'),('monthly','Monthly'),('yearly','Yearly')], 'Cost Frequency', help='Frequency of the costs',required=True), + 'cost_generated': fields.float('Recuring Costs Amount',help="Costs paid at regular intervals, depending on the cost frequency. If the cost frequency is set to unique, the cost will be logged at the start date"), + 'cost_frequency': fields.selection([('unique','Unique'),('daily', 'Daily'),('weekly','Weekly'),('monthly','Monthly'),('yearly','Yearly')], 'Cost Frequency', help='Frequency of the costs',required=True), 'generated_cost_ids' : fields.one2many('fleet.vehicle.cost', 'contract_id', 'Generated Costs',ondelete='cascade'), } _defaults = { diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 2f96e34cfd0..07ea7eec78d 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -500,7 +500,8 @@ - + + From 92528bd5101d95a0fd69f0a83ac96644f5b75fd0 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Wed, 24 Oct 2012 11:55:10 +0200 Subject: [PATCH 264/963] [IMP]Vehicles list in dashboard now in kanban view bzr revid: dle@openerp.com-20121024095510-hzmfg1gjcfr5sazs --- addons/fleet/board_fleet_view.xml | 22 +++------------------- addons/fleet/fleet_view.xml | 2 +- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/addons/fleet/board_fleet_view.xml b/addons/fleet/board_fleet_view.xml index 3ef597733bb..f0ada104dbb 100644 --- a/addons/fleet/board_fleet_view.xml +++ b/addons/fleet/board_fleet_view.xml @@ -1,22 +1,6 @@ - - fleet.vehicle.tree.board - fleet.vehicle - - - - - - - - - - - - - Fuel Costs by Month fleet.vehicle.log.fuel @@ -50,10 +34,10 @@ [('parent_id','=',False)] - + Vehicles which need contracts renewal fleet.vehicle - + form tree ['|',('contract_renewal_due_soon','>',0),('contract_renewal_overdue','>',0)] @@ -71,7 +55,7 @@
    - + diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 07ea7eec78d..9a450c0c2d7 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -500,7 +500,7 @@ - + From f579cc927f2a392e9db3772f1fbc3f0f81cf9a23 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 24 Oct 2012 12:54:54 +0200 Subject: [PATCH 265/963] [FIX] files filtering when loading... stuff. also, cleanup module file (remove extra imports, extra default key in manifest) bzr revid: xmo@openerp.com-20121024105454-nqw9taxladjofz2v --- openerp/modules/loading.py | 5 ++++- openerp/modules/module.py | 10 ---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py index 57fb92a6ee0..ceb87afc67f 100644 --- a/openerp/modules/loading.py +++ b/openerp/modules/loading.py @@ -113,6 +113,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= if kind in ('demo', 'demo_xml'): noupdate = True try: + ext = ext.lower() if ext == '.csv': if kind in ('init', 'init_xml'): noupdate = True @@ -121,8 +122,10 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= process_sql_file(cr, fp) elif ext == '.yml': tools.convert_yaml_import(cr, module_name, fp, kind, idref, mode, noupdate, report) - else: + elif ext == '.xml': tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report) + else: + _logger.debug("Ignoring %s due to unknown type", filename) finally: fp.close() diff --git a/openerp/modules/module.py b/openerp/modules/module.py index 6ec9e86340c..39c9817a878 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -28,15 +28,9 @@ import sys import types import zipimport -import openerp - -import openerp.osv as osv import openerp.tools as tools import openerp.tools.osutil as osutil from openerp.tools.safe_eval import safe_eval as eval -from openerp.tools.translate import _ - -import openerp.netsvc as netsvc import zipfile import openerp.release as release @@ -48,9 +42,6 @@ from cStringIO import StringIO import logging -import openerp.modules.db -import openerp.modules.graph - _logger = logging.getLogger(__name__) _ad = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'addons') # default addons path (base) @@ -335,7 +326,6 @@ def load_information_from_description_file(module): 'description': '', 'icon': get_module_icon(module), 'installable': True, - 'auto_install': False, 'license': 'AGPL-3', 'name': False, 'post_load': None, From 124480d095c0c8559eab7f7ea134b0bc106d590a Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 24 Oct 2012 12:55:31 +0200 Subject: [PATCH 266/963] [FIX] reference to invalid and non-existant js file bzr revid: xmo@openerp.com-20121024105531-c0uou49k828wc01t --- addons/base_setup/__openerp__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/base_setup/__openerp__.py b/addons/base_setup/__openerp__.py index de2d8236ece..e74238ba59c 100644 --- a/addons/base_setup/__openerp__.py +++ b/addons/base_setup/__openerp__.py @@ -44,7 +44,6 @@ Shows you a list of applications features to install from. 'installable': True, 'auto_install': False, 'images': ['images/base_setup1.jpeg','images/base_setup2.jpeg','images/base_setup3.jpeg','images/base_setup4.jpeg',], - 'js': ['static/src/js/base_setup.js'], 'css': ['static/src/css/base_setup.css'], } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 403d2ec6d1952a5b846ed8e4c9422893ec0574fd Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 24 Oct 2012 12:55:48 +0200 Subject: [PATCH 267/963] [FIX] process: dependencies bzr revid: xmo@openerp.com-20121024105548-tmcpidjteuf2uwei --- addons/process/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/process/__openerp__.py b/addons/process/__openerp__.py index fcae18c5490..c998288a614 100644 --- a/addons/process/__openerp__.py +++ b/addons/process/__openerp__.py @@ -35,7 +35,7 @@ This module shows the basic processes involved in the selected modules and in th """, 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', - 'depends': ['base'], + 'depends': ['web'], 'data': [ 'security/ir.model.access.csv', 'process_view.xml' From b2e32b21faf1362a718d9e07106394c5eef77b40 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 24 Oct 2012 12:56:12 +0200 Subject: [PATCH 268/963] [FIX] base_import: dummy test file bzr revid: xmo@openerp.com-20121024105612-84fb2gav0jpp2hkc --- addons/base_import/__openerp__.py | 3 ++- addons/base_import/static/test/states.js | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 addons/base_import/static/test/states.js diff --git a/addons/base_import/__openerp__.py b/addons/base_import/__openerp__.py index f5a707650d8..559031f4b4f 100644 --- a/addons/base_import/__openerp__.py +++ b/addons/base_import/__openerp__.py @@ -24,7 +24,7 @@ Re-implement openerp's file import system: 'category': 'Uncategorized', 'website': 'http://www.openerp.com', 'author': 'OpenERP SA', - 'depends': ['base'], + 'depends': ['web'], 'installable': True, 'auto_install': True, 'css': [ @@ -37,4 +37,5 @@ Re-implement openerp's file import system: 'static/src/js/import.js', ], 'qweb': ['static/src/xml/import.xml'], + 'test': ['static/test/states.js'], } diff --git a/addons/base_import/static/test/states.js b/addons/base_import/static/test/states.js new file mode 100644 index 00000000000..3e349907a6f --- /dev/null +++ b/addons/base_import/static/test/states.js @@ -0,0 +1,6 @@ +$(document).ready(function () { + module('foo'); + test('dummy', function () { + ok(42); + }); +}); From 97654d6767c697ca5303a3eb76c19cd9a85d5d1a Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 24 Oct 2012 13:58:49 +0200 Subject: [PATCH 269/963] [ADD]help messages and correct a bug on vehicle kanban view when the car had no contract bzr revid: csn@openerp.com-20121024115849-orxkd2pyctl1f2fz --- addons/fleet/fleet.py | 10 ++- addons/fleet/fleet_view.xml | 171 ++++++++++++++++++++++++------------ 2 files changed, 120 insertions(+), 61 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index eaebbf9398a..a8d0370408e 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -406,11 +406,13 @@ class fleet_vehicle(osv.Model): return dict([]) reads = self.browse(cr,uid,ids,context=context) res=[] - for record in reads: - ids = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','open')],limit=1,order='expiration_date asc') - if len(ids) > 0: - res.append((record.id,self.pool.get('fleet.vehicle.log.contract').browse(cr,uid,ids[0],context=context).cost_type.name)) + if (record.log_contracts): + ids = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','open')],limit=1,order='expiration_date asc') + if len(ids) > 0: + res.append((record.id,self.pool.get('fleet.vehicle.log.contract').browse(cr,uid,ids[0],context=context).cost_type.name)) + else: + res.append((record.id,'')) return dict(res) def get_total_contract_reminder(self,cr,uid,ids,prop,unknow_none,context=None): diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 9a450c0c2d7..462c201c7ff 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -335,51 +335,95 @@ - - + + Services Logs + fleet.vehicle.log.services + fleet.vehicle + form + tree,form + +

    + Click to create a new service entry. +

    + OpenERP helps you keeping track of all the services done + on your vehicle. Services can be of many type, occasional + repair, fixed maintenance, etc. +

    +
    +
    - + + Fuel Logs + fleet.vehicle.log.fuel + fleet.vehicle + form + tree,form,graph + +

    + Click to create a new fuel log. +

    + Here you can add refuelling entries for all vehicles. + You can also show the log for a particular vehicle using + the search field. +

    +
    +
    - + + Contract + fleet.vehicle.log.contract + fleet.vehicle + form + tree,form + +

    + Click to create a new contract. +

    + OpenERP helps you managing all the contracts for your + vehicle, leasing, insurance, or any other type of contract. +

    + The contract form includes all sort of details, like the + activation cost, recurrent cost, the services included in + the contract, beginning and possibly ending date, etc. +

    +
    +
    - + + Costs + fleet.vehicle.cost + fleet.vehicle + form + tree,form,graph + {"search_default_parent_false" : True} + +

    + Click to create a new cost. +

    + OpenERP helps you managing the costs for your different vehicles + Costs are generally created from services and contract and appears here. +

    + Thanks to the different filters, OpenERP can only print the effective + costs, sort them by type and by vehicle. +

    +
    +
    + + + Odometer + fleet.vehicle.odometer + fleet.vehicle + form + tree,form,graph + +

    + Here you can add various odometer entries for all vehicles. + You can also show odometer value for a particular vehicle using + the search field. +

    +
    +
    @@ -391,10 +435,12 @@

    Click to create a new vehicle.

    - Here you can create and add new vehicles to your fleet. - You can associate a driver, add tags, contracts, services - and other informations to a vehicle. You can also sort - them by brand, plate number, driver, location, tags, status. + OpenERP will help you manage your fleet by keeping + track of the contracts, services, costs, fuel logs associated + to a particular vehicle. +

    + When a contract arrives near expiration date, a visual warning + will show you that you need to renew that particular contract.

    @@ -530,10 +576,12 @@

    Click to create a new contract.

    - Here you can create new contracts and show all existing - contracts. Contracts can be of various type, from insurance - contracts to leasing contracts. Each contract is associated - to an existing vehicle and can also be associated to a user. + OpenERP helps you managing all the contracts for your + vehicle, leasing, insurance, or any other type of contract. +

    + The contract form includes all sort of details, like the + activation cost, recurrent cost, the services included in + the contract, beginning and possibly ending date, etc.

    @@ -787,12 +835,11 @@ tree,form,graph

    - Click to create a new service log entry. + Click to create a new service entry.

    - Here you can create new services entries and show all past and - future services. A service can be an occasional repair on a - vehicle or a fixed maintenance. A service is associated to - an existing vehicle. + OpenERP helps you keeping track of all the services done + on your vehicle. Services can be of many type, occasional + repair, fixed maintenance, etc.

    @@ -819,10 +866,9 @@

    Click to create a new type of service.

    - Here you can add new services, each service - belong to a category.
    + Each service belongs to a category.
    - contract if this service is used in a contract (ie: leasing, ...).
    - - service if it is used as a service (ie: repair, ...).
    + - service if it is used as a service (ie: repair, change tire...).
    - both if it is used in both case.

    @@ -901,6 +947,17 @@ form tree,form,graph {"search_default_parent_false" : True} + +

    + Click to create a new cost. +

    + OpenERP helps you managing the costs for your different vehicles + Costs are generally created from services and contract and appears here. +

    + Thanks to the different filters, OpenERP can only print the effective + costs, sort them by type and by vehicle. +

    +
    From 757328b2fee078edf9c99e78f9ab083195e44c0a Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 24 Oct 2012 14:17:19 +0200 Subject: [PATCH 270/963] [FIX]removed useless code in view as well as wizard class bzr revid: csn@openerp.com-20121024121719-jp3wfyz2v7oaaxgr --- addons/fleet/__init__.py | 3 +- addons/fleet/__openerp__.py | 1 - addons/fleet/fleet.py | 13 +- addons/fleet/fleet_view.xml | 90 ------------- addons/fleet/wizard/__init__.py | 1 - addons/fleet/wizard/renew_contract.py | 140 -------------------- addons/fleet/wizard/renew_contract_view.xml | 70 ---------- 7 files changed, 8 insertions(+), 310 deletions(-) delete mode 100644 addons/fleet/wizard/__init__.py delete mode 100644 addons/fleet/wizard/renew_contract.py delete mode 100644 addons/fleet/wizard/renew_contract_view.xml diff --git a/addons/fleet/__init__.py b/addons/fleet/__init__.py index 369c7f372c6..a09fca549ce 100644 --- a/addons/fleet/__init__.py +++ b/addons/fleet/__init__.py @@ -1,3 +1,2 @@ # import the hr_car code -import fleet -import wizard \ No newline at end of file +import fleet \ No newline at end of file diff --git a/addons/fleet/__openerp__.py b/addons/fleet/__openerp__.py index 74f1df2e336..953b63ae82f 100644 --- a/addons/fleet/__openerp__.py +++ b/addons/fleet/__openerp__.py @@ -21,7 +21,6 @@ Vehicle, leasing, insurances, cost 'fleet_view.xml', 'data.xml', 'board_fleet_view.xml', - 'wizard/renew_contract_view.xml', ], 'update_xml' : ['security/ir.model.access.csv'], diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index a8d0370408e..e912066c669 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -232,7 +232,7 @@ class fleet_vehicle(osv.Model): """ This opens log view to view and add new log for this vehicle @return: the service log view """ - res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log_services', context) + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','fleet_vehicle_log_services_act', context) res['context'] = { 'default_vehicle_id': ids[0] } @@ -243,7 +243,7 @@ class fleet_vehicle(osv.Model): """ This opens log view to view and add new log for this vehicle @return: the contract log view """ - res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log_contract', context) + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','fleet_vehicle_log_contract_act', context) res['context'] = { 'default_vehicle_id': ids[0] } @@ -254,7 +254,7 @@ class fleet_vehicle(osv.Model): """ This opens log view to view and add new log for this vehicle @return: the fuel log view """ - res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log_fuel', context) + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','fleet_vehicle_log_fuel_act', context) res['context'] = { 'default_vehicle_id': ids[0] } @@ -265,9 +265,10 @@ class fleet_vehicle(osv.Model): """ This opens log view to view and add new log for this vehicle @return: the costs log view """ - res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log_cost', context) + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','fleet_vehicle_costs_act', context) res['context'] = { - 'default_vehicle_id': ids[0] + 'default_vehicle_id': ids[0], + 'search_default_parent_false' : True } res['domain']=[('vehicle_id','=', ids[0])] return res @@ -276,7 +277,7 @@ class fleet_vehicle(osv.Model): """ This opens log view to view and add new log for this vehicle @return: the odometer log view """ - res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log_odometer', context) + res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','fleet_vehicle_odometer_act', context) res['context'] = { 'default_vehicle_id': ids[0] } diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 462c201c7ff..b978a3f7f8a 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -334,96 +334,6 @@
    - - - - Services Logs - fleet.vehicle.log.services - fleet.vehicle - form - tree,form - -

    - Click to create a new service entry. -

    - OpenERP helps you keeping track of all the services done - on your vehicle. Services can be of many type, occasional - repair, fixed maintenance, etc. -

    -
    -
    - - - Fuel Logs - fleet.vehicle.log.fuel - fleet.vehicle - form - tree,form,graph - -

    - Click to create a new fuel log. -

    - Here you can add refuelling entries for all vehicles. - You can also show the log for a particular vehicle using - the search field. -

    -
    -
    - - - Contract - fleet.vehicle.log.contract - fleet.vehicle - form - tree,form - -

    - Click to create a new contract. -

    - OpenERP helps you managing all the contracts for your - vehicle, leasing, insurance, or any other type of contract. -

    - The contract form includes all sort of details, like the - activation cost, recurrent cost, the services included in - the contract, beginning and possibly ending date, etc. -

    -
    -
    - - - Costs - fleet.vehicle.cost - fleet.vehicle - form - tree,form,graph - {"search_default_parent_false" : True} - -

    - Click to create a new cost. -

    - OpenERP helps you managing the costs for your different vehicles - Costs are generally created from services and contract and appears here. -

    - Thanks to the different filters, OpenERP can only print the effective - costs, sort them by type and by vehicle. -

    -
    -
    - - - Odometer - fleet.vehicle.odometer - fleet.vehicle - form - tree,form,graph - -

    - Here you can add various odometer entries for all vehicles. - You can also show odometer value for a particular vehicle using - the search field. -

    -
    -
    diff --git a/addons/fleet/wizard/__init__.py b/addons/fleet/wizard/__init__.py deleted file mode 100644 index bc7dae97d56..00000000000 --- a/addons/fleet/wizard/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import renew_contract \ No newline at end of file diff --git a/addons/fleet/wizard/renew_contract.py b/addons/fleet/wizard/renew_contract.py deleted file mode 100644 index 04f21227eb3..00000000000 --- a/addons/fleet/wizard/renew_contract.py +++ /dev/null @@ -1,140 +0,0 @@ -from osv import osv, fields -import datetime - -class renew_contract(osv.TransientModel): - _name = "fleet.vehicle.contract.renew" - _description = "wizard to renew a contract" - - def name_get(self, cr, uid, ids, context=None): - if context is None: - context = {} - if not ids: - return [] - reads = self.browse(cr, uid, ids, context=context) - res = [] - for record in reads: - if record.vehicle_id.name: - name = str(record.vehicle_id.name) - if record.cost_type.name: - name = name+ ' / '+ str(record.cost_type.name) - if record.date: - name = name+ ' / '+ record.date - res.append((record.id, name)) - return res - - def _vehicle_contract_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): - res = self.name_get(cr, uid, ids, context=context) - return dict(res) - - def _get_odometer(self, cr, uid, ids, odometer_id, arg, context): - res = dict.fromkeys(ids, False) - for record in self.browse(cr,uid,ids,context=context): - if record.odometer_id: - res[record.id] = record.odometer_id.value - return res - - def _set_odometer(self, cr, uid, id, name, value, args=None, context=None): - if value: - try: - value = float(value) - except ValueError: - #_logger.exception(value+' is not a correct odometer value. Please, fill a float for this field') - raise except_orm(_('Error!'), value+' is not a correct odometer value. Please, fill a float for this field') - - date = self.browse(cr, uid, id, context=context).date - if not(date): - date = time.strftime('%Y-%m-%d') - vehicle_id = self.browse(cr, uid, id, context=context).vehicle_id - data = {'value' : value,'date' : date,'vehicle_id' : vehicle_id.id} - odometer_id = self.pool.get('fleet.vehicle.odometer').create(cr, uid, data, context=context) - self.write(cr, uid, id, {'odometer_id': odometer_id}) - return value - self.write(cr, uid, id, {'odometer_id': ''}) - return False - - def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None): - - if not vehicle_id: - return {} - - odometer_unit = self.pool.get('fleet.vehicle').browse(cr, uid, vehicle_id, context=context).odometer_unit - - return { - 'value' : { - 'odometer_unit' : odometer_unit, - } - } - - def compute_next_year_date(self, strdate): - oneyear=datetime.timedelta(days=365) - curdate = self.str_to_date(strdate) - nextyear=curdate+oneyear#int(strdate[:4])+1 - return str(nextyear)#+strdate[4:] - - #def on_change_start_date(self, cr, uid, ids, strdate, context=None): - # if (strdate): - - # return {'value' : {'expiration_date' : self.compute_next_year_date(strdate),}} - # else: - # return {} - - def str_to_date(self,strdate): - return datetime.datetime(int(strdate[:4]),int(strdate[5:7]),int(strdate[8:])) - - def get_warning_date(self,cr,uid,ids,prop,unknow_none,context=None): - if context is None: - context={} - if not ids: - return dict([]) - reads = self.browse(cr,uid,ids,context=context) - res=[] - for record in reads: - #if (record.reminder==True): - if (record.expiration_date and record.state=='open'): - today=self.str_to_date(time.strftime('%Y-%m-%d')) - renew_date = self.str_to_date(record.expiration_date) - diff_time=int((renew_date-today).days) - if (diff_time<=0): - res.append((record.id,0)) - else: - res.append((record.id,diff_time)) - else: - res.append((record.id,-1)) - #else: - # res.append((record.id,-1)) - return dict(res) - - _columns = { - 'name' : fields.function(_vehicle_contract_name_get_fnc, type="text", string='Name', store=True), - 'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this fuel log'), - 'cost_type': fields.many2one('fleet.service.type', 'Service type', required=False, help='Service type purchased with this cost'), - 'amount': fields.float('Total Price'), - - 'parent_id': fields.many2one('fleet.vehicle.cost', 'Parent', required=False, help='Parent cost to this current cost'), - 'cost_ids' : fields.one2many('fleet.vehicle.cost', 'parent_id', 'Included Services'), - - 'date' :fields.date('Date',help='Date when the cost has been executed'), - - 'start_date' : fields.date('Contract Start Date', required=False, help='Date when the coverage of the contract begins'), - 'expiration_date' : fields.date('Contract Expiration Date', required=False, help='Date when the coverage of the contract expirates (by default, one year after begin date)'), - 'warning_date' : fields.function(get_warning_date,type='integer',string='Warning Date',store=False), - - 'insurer_id' :fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), - 'purchaser_id' : fields.many2one('res.partner', 'Contractor',domain="['|',('customer','=',True),('employee','=',True)]",help='Person to which the contract is signed for'), - 'ins_ref' : fields.char('Contract Reference', size=64), - 'state' : fields.selection([('open', 'In Progress'), ('closed', 'Terminated')], 'Status', readonly=True, help='Choose wheter the contract is still valid or not'), - #'reminder' : fields.boolean('Renewal Reminder', help="Warn the user a few days before the expiration date of this contract"), - 'notes' : fields.text('Terms and Conditions', help='Write here all supplementary informations relative to this contract'), - 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), - 'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer Value',store=False,help='Odometer measure of the vehicle at the moment of this log'), - 'odometer_unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), - #'cost_amount': fields.related('cost_id','amount',type="float",string="Amount",store=True, readonly=True), - } - - - - def renew(self, cr, uid, ids, context=None): - print '-------------------------------' - print 'renew contract' - print '-------------------------------' - return {} \ No newline at end of file diff --git a/addons/fleet/wizard/renew_contract_view.xml b/addons/fleet/wizard/renew_contract_view.xml deleted file mode 100644 index 9113ebb595e..00000000000 --- a/addons/fleet/wizard/renew_contract_view.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - fleet.vehicle.contract.wizard.form - fleet.vehicle.contract.renew - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - - - - -
    -
    \ No newline at end of file From d73352a676a6240ffeef8e65a2e71b36e3d426d9 Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Wed, 24 Oct 2012 15:03:15 +0200 Subject: [PATCH 271/963] [MERGE]Lunch_new application bzr revid: api@openerp.com-20121024130315-vbfrp648vt4rgj97 --- addons/lunch/report/order.py | 2 +- addons/lunch/report/order.rml | 4 +- addons/lunch/report/report_lunch_order.py | 10 +- .../lunch/report/report_lunch_order_view.xml | 1 - addons/lunch_new/__init__.py | 8 +- addons/lunch_new/__openerp__.py | 6 +- addons/lunch_new/lunch.py | 281 ++++++++---------- addons/lunch_new/lunch_alert.py | 46 +++ addons/lunch_new/lunch_cashmove.py | 45 +++ addons/lunch_new/lunch_demo.xml | 217 ++++++++++++++ addons/lunch_new/lunch_order_line.py | 108 +++++++ addons/lunch_new/lunch_preference.py | 52 ++++ addons/lunch_new/lunch_product.py | 47 +++ addons/lunch_new/lunch_report.xml | 13 + addons/lunch_new/report/__init__.py | 25 ++ addons/lunch_new/report/order.py | 78 +++++ addons/lunch_new/report/order.rml | 184 ++++++++++++ addons/lunch_new/report/report_lunch_order.py | 65 ++++ .../report/report_lunch_order_view.xml | 48 +++ addons/lunch_new/security/groups.xml | 137 +++++++++ addons/lunch_new/security/ir.model.access.csv | 15 + addons/lunch_new/{ => view}/lunch_view.xml | 203 ++++++------- addons/lunch_new/{ => view}/partner_view.xml | 0 23 files changed, 1317 insertions(+), 278 deletions(-) create mode 100644 addons/lunch_new/lunch_alert.py create mode 100644 addons/lunch_new/lunch_cashmove.py create mode 100644 addons/lunch_new/lunch_demo.xml create mode 100644 addons/lunch_new/lunch_order_line.py create mode 100644 addons/lunch_new/lunch_preference.py create mode 100644 addons/lunch_new/lunch_product.py create mode 100644 addons/lunch_new/lunch_report.xml create mode 100644 addons/lunch_new/report/__init__.py create mode 100644 addons/lunch_new/report/order.py create mode 100644 addons/lunch_new/report/order.rml create mode 100644 addons/lunch_new/report/report_lunch_order.py create mode 100644 addons/lunch_new/report/report_lunch_order_view.xml create mode 100644 addons/lunch_new/security/groups.xml create mode 100644 addons/lunch_new/security/ir.model.access.csv rename addons/lunch_new/{ => view}/lunch_view.xml (76%) rename addons/lunch_new/{ => view}/partner_view.xml (100%) diff --git a/addons/lunch/report/order.py b/addons/lunch/report/order.py index 11ca7f79dbc..08daebec482 100644 --- a/addons/lunch/report/order.py +++ b/addons/lunch/report/order.py @@ -26,7 +26,7 @@ from osv import osv class order(report_sxw.rml_parse): - def get_lines(self, user,objects): + def get_lines(self,user,objects): lines=[] for obj in objects: if user.id==obj.user_id.id: diff --git a/addons/lunch/report/order.rml b/addons/lunch/report/order.rml index b09b59bb96b..ca334a369f7 100644 --- a/addons/lunch/report/order.rml +++ b/addons/lunch/report/order.rml @@ -107,7 +107,7 @@ - Lunch Order + Lunch Orders @@ -152,7 +152,7 @@ [[ (lines.product and lines.product.name) or '' ]] - [[ lines.descript]] + [[ lines.note]] [[ lines.price ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] diff --git a/addons/lunch/report/report_lunch_order.py b/addons/lunch/report/report_lunch_order.py index 7e2b8de9f49..f874cfbf521 100644 --- a/addons/lunch/report/report_lunch_order.py +++ b/addons/lunch/report/report_lunch_order.py @@ -22,7 +22,7 @@ import tools from osv import fields,osv -class report_lunch_order(osv.osv): +class report_lunch_order_line(osv.osv): _name = "report.lunch.order" _description = "Lunch Orders Statistics" _auto = False @@ -39,6 +39,7 @@ class report_lunch_order(osv.osv): 'price_total':fields.float('Total Price', readonly=True), } _order = 'date desc' + def init(self, cr): tools.drop_view_if_exists(cr, 'report_lunch_order') cr.execute(""" @@ -50,19 +51,14 @@ class report_lunch_order(osv.osv): to_char(lo.date, 'MM') as month, to_char(lo.date, 'YYYY-MM-DD') as day, lo.user_id, - cm.name as box_name, sum(lp.price) as price_total - from lunch_order as lo - left join lunch_cashmove as cm on (cm.id = lo.cashmove) - left join lunch_cashbox as lc on (lc.id = cm.box) left join lunch_product as lp on (lo.product = lp.id) group by - lo.date,lo.user_id,cm.name + lo.date,lo.user_id ) """) -report_lunch_order() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/lunch/report/report_lunch_order_view.xml b/addons/lunch/report/report_lunch_order_view.xml index e92007592ac..2758cd1653c 100644 --- a/addons/lunch/report/report_lunch_order_view.xml +++ b/addons/lunch/report/report_lunch_order_view.xml @@ -1,7 +1,6 @@ - report.lunch.order.tree report.lunch.order diff --git a/addons/lunch_new/__init__.py b/addons/lunch_new/__init__.py index 398a42669ca..b1e06385412 100644 --- a/addons/lunch_new/__init__.py +++ b/addons/lunch_new/__init__.py @@ -21,4 +21,10 @@ import lunch import partner -import wizard \ No newline at end of file +import wizard +import lunch_preference +import lunch_product +import lunch_alert +import lunch_cashmove +import lunch_order_line +import report \ No newline at end of file diff --git a/addons/lunch_new/__openerp__.py b/addons/lunch_new/__openerp__.py index 3d30f75ac97..95bdc786fb8 100644 --- a/addons/lunch_new/__openerp__.py +++ b/addons/lunch_new/__openerp__.py @@ -32,8 +32,10 @@ The base module to manage lunch. keep track for the Lunch Order, Cash Moves and Product. Apply Different Category for the product. """, - 'data': ['lunch_view.xml','partner_view.xml','wizard/lunch_validation_view.xml','wizard/lunch_cancel_view.xml'], - 'demo': [], + 'data': ['security/groups.xml','view/lunch_view.xml','view/partner_view.xml','wizard/lunch_validation_view.xml','wizard/lunch_cancel_view.xml','lunch_report.xml', + 'report/report_lunch_order_view.xml', + 'security/ir.model.access.csv',], + 'demo': ['lunch_demo.xml',], 'test': [], 'installable': True, 'application' : True, diff --git a/addons/lunch_new/lunch.py b/addons/lunch_new/lunch.py index 76c0ec7d6ea..e341ef42307 100644 --- a/addons/lunch_new/lunch.py +++ b/addons/lunch_new/lunch.py @@ -1,3 +1,4 @@ + # -*- encoding: utf-8 -*- ############################################################################## # @@ -24,6 +25,7 @@ import pytz import time from osv import osv, fields from datetime import datetime, timedelta +from lxml import etree class lunch_order(osv.Model): """ lunch order """ @@ -41,6 +43,27 @@ class lunch_order(osv.Model): result[order.id]=value return result + def add_preference(self,cr,uid,ids,pref_id,context=None): + pref_ref = self.pool.get("lunch.preference") + orderline_ref = self.pool.get('lunch.order.line') + order = self.browse(cr,uid,ids,context=context)[0] + pref = pref_ref.browse(cr,uid,pref_id,context=context) + prod_ref = self.pool.get('lunch.product') + if pref["user_id"].id == uid: + new_order_line = {} + new_order_line['date'] = order["date"] + new_order_line['user_id'] = uid + new_order_line['product'] = pref["product"].id + new_order_line['note'] = pref["note"] + new_order_line['order_id'] = order.id + new_order_line['price'] = pref["price"] + new_order_line['supplier'] = prod_ref.browse(cr,uid,pref["product"].id,context=context)['supplier'].id + new_id = orderline_ref.create(cr,uid,new_order_line) + order.products.append(new_id) + total = self._price_get(cr,uid,ids," "," ",context=context) + self.write(cr,uid,ids,{'total':total},context) + return True + def _alerts_get(self,cr,uid,ids,name,arg,context=None): orders = self.browse(cr,uid,ids,context=context) alert_ref = self.pool.get('lunch.alert') @@ -89,7 +112,7 @@ class lunch_order(osv.Model): min_from = int((alert.active_from-hour_from)*60) from_alert = datetime.strptime(str(hour_from)+":"+str(min_from),"%H:%M") if mynow.time()>=from_alert.time() and mynow.time()<=to_alert.time(): - alert_msg+=" * " + alert_msg+="* " alert_msg+=alert.message alert_msg+='\n' return alert_msg @@ -99,18 +122,110 @@ class lunch_order(osv.Model): if products: tot = 0.0 for prod in products: - #price = self.pool.get('lunch.product').read(cr, uid, prod, ['price'])['price'] - #tot += price - res = {'value':{'total':2.0}} - # prods = self.pool.get('lunch.order.line').read(cr,uid,products,['price'])['price'] - # res = {'value':{'total': self._price_get(cr,uid,ids,products,context),}} + orderline = {} + if isinstance(prod[1],bool): + orderline = prod[2] + tot += orderline['price'] + else: + orderline = self.pool.get('lunch.order.line').browse(cr,uid,prod[1],context=context) + tot += orderline.price + res = {'value':{'total':tot}} return res - def _default_product_get(self,cr,uid,arg,context=None): - cr.execute('''SELECT lp.name, lp.description, lp.price, lp.supplier, lp.active, lp.category_id FROM lunch_product AS lp''') + def _default_product_get(self,cr,uid,args,context=None): + cr.execute('''SELECT lol.id, lol.date, lol.user_id, lol.product, lol.note, lol.price, lol.write_date FROM lunch_order_line AS lol ORDER BY write_date''') res = cr.dictfetchall() - return res + result = [] + i=0 + pref_ref = self.pool.get('lunch.preference') + for temp in res: + if i==20: + break + if temp['user_id'] == uid: + prod = self.pool.get('lunch.product').browse(cr, uid, temp['product']) + temp['product_name'] = prod.name + temp['date'] = temp['write_date'] + new_id = pref_ref.create(cr,uid,temp) + result.append(new_id) + i+=1 + return result + + def create(self, cr, uid, values, context=None): + pref_ref = self.pool.get('lunch.preference') + pref_ids = pref_ref.search(cr,uid,[],context=context) + prod_ref = self.pool.get('lunch.product') + new_id = super(lunch_order, self).create(cr, uid, values, context=context) + already_exists = False + if len(values['products'])>0 and values['user_id']==uid: + for pref in pref_ref.browse(cr,uid,pref_ids,context=context): + if pref['product'].id == values['products'][0][2]['product']: + if pref['note'] == values['products'][0][2]['note']: + if pref['price'] == values['products'][0][2]['price']: + already_exists = True + if already_exists == False and len(values['products'])>0: + new_pref = pref_ref.create(cr,uid,{'date':values['date'], 'color':0, 'order_id':new_id, 'user_id':values['user_id'], 'product':values['products'][0][2]['product'], 'product_name':prod_ref.browse(cr,uid,values['products'][0][2]['product'])['name'], 'note':values['products'][0][2]['note'], 'price':values['products'][0][2]['price']},context=context) + return new_id + def _default_preference_get(self,cr,uid,args,context=None): + pref_ref = self.pool.get('lunch.preference') + pref_ids = pref_ref.search(cr,uid,[],order='date desc',limit=20,context=context) + result = [] + for pref in pref_ref.browse(cr,uid,pref_ids,context=context): + result.append(pref.id) + return result + + def __getattr__(self, attr): + if attr.startswith('add_preference_'): + pref_id = int(attr[15:]) + def specific_function(cr, uid, ids, context=None): + return self.add_preference(cr, uid, ids, pref_id, context=context) + return specific_function + return super(lunch_order,self).__getattr__(self,attr) + + def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): + res = super(lunch_order,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) + if view_type == 'form': + doc = etree.XML(res['arch']) + for sheet in doc: + elements = sheet.xpath("//group[@name='pref']") + for element in elements: + pref_ref = self.pool.get("lunch.preference") + pref_ids = pref_ref.search(cr,uid,[],context=context) + for pref in pref_ref.browse(cr,uid,pref_ids,context): + if pref['user_id'].id == uid: + function_name = "add_preference_" + function_name += str(pref.id) + new_element = etree.Element("button") + new_element.set('name',function_name) + new_element.set('icon','gtk-add') + new_element.set('type','object') + ##### title ##### + title = etree.Element('h3') + title.text = pref['product_name'] + ##### price ##### + price_element=etree.Element("font") + text = "Price: " + text+= str(pref['price']) + text+= "€ " + price_element.text = str(text) + ##### note ##### + note = etree.Element('i') + note.text = "Note: "+str(pref['note']) + ##### div ##### + div_element = etree.Element("group") + element.append(div_element) + div_element.append(title) + div_element.append(etree.Element("br")) + div_element.append(price_element) + div_element.append(etree.Element("br")) + div_element.append(new_element) + div_element.append(etree.Element("br")) + div_element.append(note) + div_element.append(etree.Element("br")) + div_element.append(etree.Element("br")) + res['arch'] = etree.tostring(doc) + return res + return res _columns = { 'user_id' : fields.many2one('res.users','User Name',required=True,readonly=True, states={'new':[('readonly', False)]}), @@ -120,7 +235,7 @@ class lunch_order(osv.Model): 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled'), ('partially','Parcially Confirmed')], \ 'Status', readonly=True, select=True), 'alerts': fields.function(_alerts_get, string="Alerts", type='text'), - 'preferences': fields.one2many("lunch.product",'order_id',readonly=True), + 'preferences': fields.many2many("lunch.preference",'lunch_preference_rel','preferences','order_id','Preferences'), } _defaults = { @@ -128,150 +243,6 @@ class lunch_order(osv.Model): 'date': fields.date.context_today, 'state': lambda self, cr, uid, context: 'new', 'alerts': _default_alerts_get, - 'preferences': _default_product_get, + 'preferences': _default_preference_get, } -class lunch_order_line(osv.Model): #define each product that will be in one ORDER. - """ lunch order line """ - _name = 'lunch.order.line' - _description = 'lunch order line' - - def _price_get(self,cr,uid,ids,name,arg,context=None): - orderLines = self.browse(cr,uid,ids,context=context) - result={} - for orderLine in orderLines: - result[orderLine.id]=orderLine.product.price - return result - - def onchange_price(self,cr,uid,ids,product,context=None): - if product: - price = self.pool.get('lunch.product').read(cr, uid, product, ['price'])['price'] - return {'value': {'price': price}} - return {'value': {'price': 0.0}} - - - def confirm(self,cr,uid,ids,context=None): - #confirm one or more order.line, update order status and create new cashmove - cashmove_ref = self.pool.get('lunch.cashmove') - orders_ref = self.pool.get('lunch.order') - - for order in self.browse(cr,uid,ids,context=context): - if order.state!='confirmed': - new_id = cashmove_ref.create(cr,uid,{'user_id': order.user_id.id, 'amount':0 - order.price,'description':order.product.name, 'order_id':order.id, 'state':'order', 'date':order.date}) - self.write(cr,uid,[order.id],{'cashmove':[('0',new_id)], 'state':'confirmed'},context) - for order in self.browse(cr,uid,ids,context=context): - isconfirmed = True - for product in order.order_id.products: - if product.state == 'new': - isconfirmed = False - if product.state == 'cancelled': - isconfirmed = False - orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) - if isconfirmed == True: - orders_ref.write(cr,uid,[order.order_id.id],{'state':'confirmed'},context) - return {} - - def cancel(self,cr,uid,ids,context=None): - #confirm one or more order.line, update order status and create new cashmove - cashmove_ref = self.pool.get('lunch.cashmove') - orders_ref = self.pool.get('lunch.order') - - for order in self.browse(cr,uid,ids,context=context): - self.write(cr,uid,[order.id],{'state':'cancelled'},context) - for cash in order.cashmove: - cashmove_ref.unlink(cr,uid,cash.id,context) - for order in self.browse(cr,uid,ids,context=context): - hasconfirmed = False - hasnew = False - for product in order.order_id.products: - if product.state=='confirmed': - hasconfirmed= True - if product.state=='new': - hasnew= True - if hasnew == False: - if hasconfirmed == False: - orders_ref.write(cr,uid,[order.order_id.id],{'state':'cancelled'},context) - return {} - orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) - return {} - - _columns = { - 'date' : fields.related('order_id','date',type='date', string="Date", readonly=True,store=True), - 'supplier' : fields.related('product','supplier',type='many2one',relation='res.partner',string="Supplier",readonly=True,store=True), - 'user_id' : fields.related('order_id', 'user_id', type='many2one', relation='res.users', string='User', readonly=True), - 'product' : fields.many2one('lunch.product','Product',required=True), #one offer can have more than one product and one product can be in more than one offer. - 'note' : fields.text('Note',size=256,required=False), - 'order_id' : fields.many2one('lunch.order','Order',required=True,ondelete='cascade'), - 'price' : fields.function(_price_get, string="Price",store=True), - 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled')], \ - 'Status', readonly=True, select=True), - 'cashmove': fields.one2many('lunch.cashmove','order_id','Cash Move',ondelete='cascade'), - } - _defaults = { - 'state': lambda self, cr, uid, context: 'new', - } - -class lunch_product(osv.Model): - """ lunch product """ - _name = 'lunch.product' - _description = 'lunch product' - _columns = { - 'name' : fields.char('Product',required=True, size=64), - 'category_id': fields.many2one('lunch.product.category', 'Category'), - 'description': fields.text('Description', size=256, required=False), - 'price': fields.float('Price', digits=(16,2)), - 'active': fields.boolean('Active'), #If this product isn't offered anymore, the active boolean is set to false. This will allow to keep trace of previous orders and cashmoves. - 'supplier' : fields.many2one('res.partner','Supplier',required=True, domain=[('supplier_lunch','=',True)]), - 'order_id' : fields.many2one('lunch.order','Order'), - } - -class lunch_product_category(osv.Model): - """ lunch product category """ - _name = 'lunch.product.category' - _description = 'lunch product category' - _columns = { - 'name' : fields.char('Category', required=True, size=64), #such as PIZZA, SANDWICH, PASTA, CHINESE, BURGER, ... - } - -class lunch_cashmove(osv.Model): - """ lunch cashmove => order or payment """ - _name = 'lunch.cashmove' - _description = 'lunch description' - _columns = { - 'user_id' : fields.many2one('res.users','User Name',required=True), - 'date' : fields.date('Date', required=True), - 'amount' : fields.float('Amount', required=True), #depending on the kind of cashmove, the amount will be positive or negative - 'description' : fields.text('Description',size=256), #the description can be an order or a payment - 'order_id' : fields.many2one('lunch.order.line','Order',required=False,ondelete='cascade'), - 'state' : fields.selection([('order','Order'),('payment','Payment')],'Is an order or a Payment'), - } - _defaults = { - 'user_id': lambda self, cr, uid, context: uid, - 'date': fields.date.context_today, - 'state': lambda self, cr, uid, context: 'payment', - } - - -class lunch_alert(osv.Model): - """ lunch alert """ - _name = 'lunch.alert' - _description = 'lunch alert' - _columns = { - 'message' : fields.text('Message',size=256, required=True), - 'active' : fields.boolean('Active'), - 'day' : fields.selection([('specific','Specific day'), ('week','Every Week'), ('days','Every Day')], 'Recurrency'), - 'specific' : fields.date('Day'), - 'monday' : fields.boolean('Monday'), - 'tuesday' : fields.boolean('Tuesday'), - 'wednesday' : fields.boolean('Wednesday'), - 'thursday' : fields.boolean('Thursday'), - 'friday' : fields.boolean('Friday'), - 'saturday' : fields.boolean('Saturday'), - 'sunday' : fields.boolean('Sunday'), - 'active_from': fields.float('Between',required=True), - 'active_to': fields.float('And',required=True), - #'active_from' : fields.selection([('0','00h00'),('1','00h30'),('2','01h00'),('3','01h30'),('4','02h00'),('5','02h30'),('6','03h00'),('7','03h30'),('8','04h00'),('9','04h30'),('10','05h00'),('11','05h30'),('12','06h00'),('13','06h30'),('14','07h00'),('15','07h30'),('16','08h00'),('17','08h30'),('18','09h00'),('19','09h30'),('20','10h00'),('21','10h30'),('22','11h00'),('23','11h30'),('24','12h00'),('25','12h30'),('26','13h00'),('27','13h30'),('28','14h00'),('29','14h30'),('30','15h00'),('31','15h30'),('32','16h00'),('33','16h30'),('34','17h00'),('35','17h30'),('36','18h00'),('37','18h30'),('38','19h00'),('39','19h30'),('40','20h00'),('41','20h30'),('42','21h00'),('43','21h30'),('44','22h00'),('45','22h30'),('46','23h00'),('47','23h30')],'Between',required=True), #defines from when (hours) the alert will be displayed - #'active_to' : fields.selection([('0','00h00'),('1','00h30'),('2','01h00'),('3','01h30'),('4','02h00'),('5','02h30'),('6','03h00'),('7','03h30'),('8','04h00'),('9','04h30'),('10','05h00'),('11','05h30'),('12','06h00'),('13','06h30'),('14','07h00'),('15','07h30'),('16','08h00'),('17','08h30'),('18','09h00'),('19','09h30'),('20','10h00'),('21','10h30'),('22','11h00'),('23','11h30'),('24','12h00'),('25','12h30'),('26','13h00'),('27','13h30'),('28','14h00'),('29','14h30'),('30','15h00'),('31','15h30'),('32','16h00'),('33','16h30'),('34','17h00'),('35','17h30'),('36','18h00'),('37','18h30'),('38','19h00'),('39','19h30'),('40','20h00'),('41','20h30'),('42','21h00'),('43','21h30'),('44','22h00'),('45','22h30'),('46','23h00'),('47','23h30')],'and',required=True), # to when (hours) the alert will be disabled - } - - diff --git a/addons/lunch_new/lunch_alert.py b/addons/lunch_new/lunch_alert.py new file mode 100644 index 00000000000..be1920f3971 --- /dev/null +++ b/addons/lunch_new/lunch_alert.py @@ -0,0 +1,46 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## +import addons +import tools +import pytz +import time +from osv import osv, fields +from datetime import datetime, timedelta + +class lunch_alert(osv.Model): + """ lunch alert """ + _name = 'lunch.alert' + _description = 'lunch alert' + _columns = { + 'message' : fields.text('Message',size=256, required=True), + 'active' : fields.boolean('Active'), + 'day' : fields.selection([('specific','Specific day'), ('week','Every Week'), ('days','Every Day')], 'Recurrency'), + 'specific' : fields.date('Day'), + 'monday' : fields.boolean('Monday'), + 'tuesday' : fields.boolean('Tuesday'), + 'wednesday' : fields.boolean('Wednesday'), + 'thursday' : fields.boolean('Thursday'), + 'friday' : fields.boolean('Friday'), + 'saturday' : fields.boolean('Saturday'), + 'sunday' : fields.boolean('Sunday'), + 'active_from': fields.float('Between',required=True), + 'active_to': fields.float('And',required=True), + } \ No newline at end of file diff --git a/addons/lunch_new/lunch_cashmove.py b/addons/lunch_new/lunch_cashmove.py new file mode 100644 index 00000000000..9651067e795 --- /dev/null +++ b/addons/lunch_new/lunch_cashmove.py @@ -0,0 +1,45 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## +import addons +import tools +import pytz +import time +from osv import osv, fields +from datetime import datetime, timedelta + +class lunch_cashmove(osv.Model): + """ lunch cashmove => order or payment """ + _name = 'lunch.cashmove' + _description = 'lunch cashmove' + _columns = { + 'user_id' : fields.many2one('res.users','User Name',required=True), + 'date' : fields.date('Date', required=True), + 'amount' : fields.float('Amount', required=True), #depending on the kind of cashmove, the amount will be positive or negative + 'description' : fields.text('Description',size=256), #the description can be an order or a payment + 'order_id' : fields.many2one('lunch.order.line','Order',required=False,ondelete='cascade'), + 'state' : fields.selection([('order','Order'),('payment','Payment')],'Is an order or a Payment'), + } + _defaults = { + 'user_id': lambda self, cr, uid, context: uid, + 'date': fields.date.context_today, + 'state': lambda self, cr, uid, context: 'payment', + } + diff --git a/addons/lunch_new/lunch_demo.xml b/addons/lunch_new/lunch_demo.xml new file mode 100644 index 00000000000..ff20b7e9cbf --- /dev/null +++ b/addons/lunch_new/lunch_demo.xml @@ -0,0 +1,217 @@ + + + + + + + + + + Sandwich + + + Pizza + + + Pasta + + + + Coin gourmand + True + + + + Pizza Inn + True + + + + Club + + 3.30 + True + + Jambon, Fromage, Salade, Tomates, comcombres, oeufs + + + + Le Campagnard + + 3.30 + True + + Brie, Miel, Cerneaux de noix + + + + Le Pâté Crème + + 2.50 + True + + + + + + Fromage Gouda + + 2.50 + True + + + + + + Poulet Curry + + 2.60 + True + + + + + + Pizza Margherita + + 6.90 + True + + Tomates, Mozzarella + + + + Pizza Italiana + + 7.40 + True + + Tomates fraiches, Basilic, Mozzarella + + + + Pâtes Bolognese + + 7.70 + True + + + + + + Pâtes Napoli + + 7.70 + True + + Tomates, Basilic + + + + + + + new + + + + + + + confirmed + + + + + + + cancelled + + + + + + + new + + +Emmental + + + + + + + + confirmed + + +Champignons + + + + + + + + cancelled + + +Salade +Tomates +Comcombres + + + + + + + + 0 + Fromage Gouda + 2.50 + +Salade +Tomates +Comcombres + + + + + + + 0 + Pizza Italiana + 7.40 + +Champignons + + + + + + + 0 + Pâtes Bolognese + 7.70 + +Emmental + + + + + + Pizza Italiana + -7.40 + + order + + + + + + Payment: 5 lunch tickets (6€) + 30 + payment + + + + Lunch must be ordered before 10h30 am + days + t + 0 + 0 + + + + diff --git a/addons/lunch_new/lunch_order_line.py b/addons/lunch_new/lunch_order_line.py new file mode 100644 index 00000000000..58ca3d7cdae --- /dev/null +++ b/addons/lunch_new/lunch_order_line.py @@ -0,0 +1,108 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## +import addons +import tools +import pytz +import time +from osv import osv, fields +from datetime import datetime, timedelta + +class lunch_order_line(osv.Model): #define each product that will be in one ORDER. + """ lunch order line """ + _name = 'lunch.order.line' + _description = 'lunch order line' + + def _price_get(self,cr,uid,ids,name,arg,context=None): + orderLines = self.browse(cr,uid,ids,context=context) + result={} + for orderLine in orderLines: + result[orderLine.id]=orderLine.product.price + return result + + def onchange_price(self,cr,uid,ids,product,context=None): + if product: + price = self.pool.get('lunch.product').read(cr, uid, product, ['price'])['price'] + return {'value': {'price': price}} + return {'value': {'price': 0.0}} + + + def confirm(self,cr,uid,ids,context=None): + #confirm one or more order.line, update order status and create new cashmove + cashmove_ref = self.pool.get('lunch.cashmove') + orders_ref = self.pool.get('lunch.order') + + for order in self.browse(cr,uid,ids,context=context): + if order.state!='confirmed': + new_id = cashmove_ref.create(cr,uid,{'user_id': order.user_id.id, 'amount':0 - order.price,'description':order.product.name, 'order_id':order.id, 'state':'order', 'date':order.date}) + self.write(cr,uid,[order.id],{'cashmove':[('0',new_id)], 'state':'confirmed'},context) + for order in self.browse(cr,uid,ids,context=context): + isconfirmed = True + for product in order.order_id.products: + if product.state == 'new': + isconfirmed = False + if product.state == 'cancelled': + isconfirmed = False + orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) + if isconfirmed == True: + orders_ref.write(cr,uid,[order.order_id.id],{'state':'confirmed'},context) + return {} + + def cancel(self,cr,uid,ids,context=None): + #confirm one or more order.line, update order status and create new cashmove + cashmove_ref = self.pool.get('lunch.cashmove') + orders_ref = self.pool.get('lunch.order') + + for order in self.browse(cr,uid,ids,context=context): + self.write(cr,uid,[order.id],{'state':'cancelled'},context) + for cash in order.cashmove: + cashmove_ref.unlink(cr,uid,cash.id,context) + for order in self.browse(cr,uid,ids,context=context): + hasconfirmed = False + hasnew = False + for product in order.order_id.products: + if product.state=='confirmed': + hasconfirmed= True + if product.state=='new': + hasnew= True + if hasnew == False: + if hasconfirmed == False: + orders_ref.write(cr,uid,[order.order_id.id],{'state':'cancelled'},context) + return {} + orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) + return {} + + _columns = { + 'date' : fields.related('order_id','date',type='date', string="Date", readonly=True,store=True), + 'supplier' : fields.related('product','supplier',type='many2one',relation='res.partner',string="Supplier",readonly=True,store=True), + 'user_id' : fields.related('order_id', 'user_id', type='many2one', relation='res.users', string='User', readonly=True, store=True), + 'product' : fields.many2one('lunch.product','Product',required=True), #one offer can have more than one product and one product can be in more than one offer. + 'note' : fields.text('Note',size=256,required=False), + 'order_id' : fields.many2one('lunch.order','Order',ondelete='cascade'), + 'price' : fields.function(_price_get, string="Price",store=True), + 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled')], \ + 'Status', readonly=True, select=True), + 'cashmove': fields.one2many('lunch.cashmove','order_id','Cash Move',ondelete='cascade'), + + } + _defaults = { + 'state': lambda self, cr, uid, context: 'new', + } + diff --git a/addons/lunch_new/lunch_preference.py b/addons/lunch_new/lunch_preference.py new file mode 100644 index 00000000000..825fc76abce --- /dev/null +++ b/addons/lunch_new/lunch_preference.py @@ -0,0 +1,52 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## +import addons +import tools +import pytz +import time +from osv import osv, fields +from datetime import datetime, timedelta + +class lunch_preference(osv.Model): + _name = 'lunch.preference' + _description= "user preferences" + + def onclick_preference(self,cr,uid,ids,context=None): + print cr + print uid + print ids + print context + print self.pool.get('lunch.preference').browse(cr,uid,ids,context)[0]['product_name'] + return True + + _columns = { + 'date' : fields.date('Date', required=True,readonly=True), + 'color': fields.integer('Color'), + 'user_id' : fields.many2one('res.users','User Name',required=True,readonly=True), + 'product' : fields.many2one('lunch.product','Product',required=True), + 'product_name' : fields.char('Product name',size=64), + 'note' : fields.text('Note',size=256,required=False), + 'price' : fields.float('Price',digits=(16,2)), + } + + _defaults = { + 'color': 1, + } \ No newline at end of file diff --git a/addons/lunch_new/lunch_product.py b/addons/lunch_new/lunch_product.py new file mode 100644 index 00000000000..77589cc969c --- /dev/null +++ b/addons/lunch_new/lunch_product.py @@ -0,0 +1,47 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## +import addons +import tools +import pytz +import time +from osv import osv, fields +from datetime import datetime, timedelta + +class lunch_product(osv.Model): + """ lunch product """ + _name = 'lunch.product' + _description = 'lunch product' + _columns = { + 'name' : fields.char('Product',required=True, size=64), + 'category_id': fields.many2one('lunch.product.category', 'Category'), + 'description': fields.text('Description', size=256, required=False), + 'price': fields.float('Price', digits=(16,2)), + 'active': fields.boolean('Active'), #If this product isn't offered anymore, the active boolean is set to false. This will allow to keep trace of previous orders and cashmoves. + 'supplier' : fields.many2one('res.partner','Supplier',required=True, domain=[('supplier_lunch','=',True)]), + } + +class lunch_product_category(osv.Model): + """ lunch product category """ + _name = 'lunch.product.category' + _description = 'lunch product category' + _columns = { + 'name' : fields.char('Category', required=True, size=64), #such as PIZZA, SANDWICH, PASTA, CHINESE, BURGER, ... + } \ No newline at end of file diff --git a/addons/lunch_new/lunch_report.xml b/addons/lunch_new/lunch_report.xml new file mode 100644 index 00000000000..942caadeed3 --- /dev/null +++ b/addons/lunch_new/lunch_report.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/addons/lunch_new/report/__init__.py b/addons/lunch_new/report/__init__.py new file mode 100644 index 00000000000..4a56869bf83 --- /dev/null +++ b/addons/lunch_new/report/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import order +import report_lunch_order +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/lunch_new/report/order.py b/addons/lunch_new/report/order.py new file mode 100644 index 00000000000..abd5b2726a3 --- /dev/null +++ b/addons/lunch_new/report/order.py @@ -0,0 +1,78 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import time +from report import report_sxw +from osv import osv + + +class order(report_sxw.rml_parse): + + def get_lines(self, user,objects): + lines=[] + for obj in objects: + if user.id==obj.user_id.id: + lines.append(obj) + return lines + + def get_total(self, user,objects): + lines=[] + for obj in objects: + if user.id==obj.user_id.id: + lines.append(obj) + total=0.0 + for line in lines: + total+=line.price + self.net_total+=total + return total + + def get_nettotal(self): + return self.net_total + + def get_users(self, objects): + users=[] + for obj in objects: + if obj.user_id not in users: + users.append(obj.user_id) + return users + + def get_note(self,objects): + notes=[] + for obj in objects: + notes.append(obj.note) + return notes + + def __init__(self, cr, uid, name, context): + super(order, self).__init__(cr, uid, name, context) + self.net_total=0.0 + self.localcontext.update({ + 'time': time, + 'get_lines': self.get_lines, + 'get_users': self.get_users, + 'get_total': self.get_total, + 'get_nettotal': self.get_nettotal, + 'get_note': self.get_note, + }) + +report_sxw.report_sxw('report.lunch.order.line', 'lunch.order.line', + 'addons/lunch/report/order.rml',parser=order, header='external') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/lunch_new/report/order.rml b/addons/lunch_new/report/order.rml new file mode 100644 index 00000000000..b09b59bb96b --- /dev/null +++ b/addons/lunch_new/report/order.rml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name/Date + + + Order + + + Description + + + Unit Price + + + + + + + + + + + + + + + + [[ user.name ]] + [[ user.login ]] + [[ user.email ]] + + + + Lunch Order + + + + Name/Date + + + Order + + + Description + + + Unit Price + + + +
    + [[repeatIn(get_users(objects),'o')]] + + + + [[ o.name ]] + + + + + + + + [[ formatLang(get_total(o,objects)) ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + + + +
    + [[ repeatIn(get_lines(o,objects),'lines') ]] + + + + [[ formatLang(lines.date,date='True') ]] + + + [[ (lines.product and lines.product.name) or '' ]] + + + [[ lines.descript]] + + + [[ lines.price ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + + + +
    +
    + + + + + + + + + Total : + + + [[ formatLang(get_nettotal()) ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + + + + + + +
    +
    +
    diff --git a/addons/lunch_new/report/report_lunch_order.py b/addons/lunch_new/report/report_lunch_order.py new file mode 100644 index 00000000000..43da1844ab7 --- /dev/null +++ b/addons/lunch_new/report/report_lunch_order.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import tools +from osv import fields,osv + +class report_lunch_order(osv.osv): + _name = "report.lunch.order.line" + _description = "Lunch Orders Statistics" + _auto = False + _rec_name = 'date' + _columns = { + 'date': fields.date('Date Order', readonly=True, select=True), + 'year': fields.char('Year', size=4, readonly=True), + 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), + ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), + ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), + 'day': fields.char('Day', size=128, readonly=True), + 'user_id': fields.many2one('res.users', 'User Name'), + 'price_total':fields.float('Total Price', readonly=True), + 'note' : fields.text('Note',size=256,readonly=True), + } + _order = 'date desc' + def init(self, cr): + tools.drop_view_if_exists(cr, 'report_lunch_order_line') + cr.execute(""" + create or replace view report_lunch_order_line as ( + select + min(lo.id) as id, + lo.date as date, + to_char(lo.date, 'YYYY') as year, + to_char(lo.date, 'MM') as month, + to_char(lo.date, 'YYYY-MM-DD') as day, + lo.user_id, + lo.note as note, + sum(lp.price) as price_total + + from + lunch_order_line as lo + left join lunch_product as lp on (lo.product = lp.id) + group by + lo.date,lo.user_id,lo.note + ) + """) +report_lunch_order() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/lunch_new/report/report_lunch_order_view.xml b/addons/lunch_new/report/report_lunch_order_view.xml new file mode 100644 index 00000000000..b916cab79f9 --- /dev/null +++ b/addons/lunch_new/report/report_lunch_order_view.xml @@ -0,0 +1,48 @@ + + + + + + report.lunch.order.tree + report.lunch.order.line + + + + + + + + + + + + + + + report.lunch.order.search + report.lunch.order.line + + + + + + + + + + + + + + + + Lunch Order Analysis + report.lunch.order.line + form + tree + + {'search_default_month':1,'search_default_User':1} + + + + diff --git a/addons/lunch_new/security/groups.xml b/addons/lunch_new/security/groups.xml new file mode 100644 index 00000000000..df8b675425d --- /dev/null +++ b/addons/lunch_new/security/groups.xml @@ -0,0 +1,137 @@ + + + + + Lunch / Manager + + + Lunch / User + + + + + lunch orders + + + + + + + + + lunch orders + + + + + + + + + lunch order lines + + + + + + + + + lunch order lines + + + + + + + + + lunch cashmoves + + + + + + + + + lunch cashmoves + + + + + + + + + lunch products + + + + + + + + + lunch products + + + + + + + + + lunch products + + + + + + + + + lunch products + + + + + + + + + lunch alerts + + + + + + + + + lunch alerts + + + + + + + + + lunch preferences + + + + + + + + + lunch preferences + + + + + + + diff --git a/addons/lunch_new/security/ir.model.access.csv b/addons/lunch_new/security/ir.model.access.csv new file mode 100644 index 00000000000..23a43a5bd93 --- /dev/null +++ b/addons/lunch_new/security/ir.model.access.csv @@ -0,0 +1,15 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +order_user,"Order user",model_lunch_order,group_lunch_manager,1,1,1,1 +order_line_user,"Order Line user",model_lunch_order_line,group_lunch_manager,1,1,1,1 +cashmove_user,"Cashmove user",model_lunch_cashmove,group_lunch_manager,1,1,1,1 +product_user,"Product user",model_lunch_product,group_lunch_manager,1,1,1,1 +product_category_user,"Product category user",model_lunch_product_category,group_lunch_manager,1,1,1,1 +alert_user,"Alert user",model_lunch_alert,group_lunch_manager,1,1,1,1 +preference_user,"Preference user",model_lunch_preference,group_lunch_manager,1,1,1,1 +order_user,"Order user",model_lunch_order,group_lunch_user,1,1,1,0 +order_line_user,"Order Line user",model_lunch_order_line,group_lunch_user,1,1,1,1 +cashmove_user,"Cashmove user",model_lunch_cashmove,group_lunch_user,1,0,0,0 +product_user,"Product user",model_lunch_product,group_lunch_user,1,0,0,0 +product_category_user,"Product category user",model_lunch_product_category,group_lunch_user,1,0,0,0 +alert_user,"Alert user",model_lunch_alert,group_lunch_user,1,0,0,0 +preference_user,"Preference user",model_lunch_preference,group_lunch_user,1,1,1,1 \ No newline at end of file diff --git a/addons/lunch_new/lunch_view.xml b/addons/lunch_new/view/lunch_view.xml similarity index 76% rename from addons/lunch_new/lunch_view.xml rename to addons/lunch_new/view/lunch_view.xml index 5ef29b55378..0480d7186f6 100644 --- a/addons/lunch_new/lunch_view.xml +++ b/addons/lunch_new/view/lunch_view.xml @@ -4,9 +4,9 @@ - - - + + + @@ -20,7 +20,6 @@ -
    @@ -79,6 +78,13 @@ Your Orders lunch.order + form + + + + + Your Orders + lunch.order tree,form {"search_default_is_mine":1} @@ -91,7 +97,7 @@

    - + @@ -106,7 +112,7 @@

    - + @@ -180,7 +186,7 @@ Products lunch.product - tree,form,kanban + tree,form

    Click to create a product for lunch. @@ -206,6 +212,24 @@

    + + + Product category Form + lunch.product.category + form + +
    +
    +
    + + + + + +
    +
    +
    + @@ -238,8 +262,8 @@ -
    From 01b61e48ab3a61fe2b9bd60ca150eea840ba7457 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Thu, 25 Oct 2012 13:00:47 +0530 Subject: [PATCH 282/963] [REMOVE] remove invices filed form the view. bzr revid: nco@tinyerp.com-20121025073047-iyxwesct8ysuri53 --- addons/purchase/purchase_view.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 6c766e1d828..21f5c3423d3 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -264,7 +264,7 @@
    From 975a32ff1135ab5e8df457a1d123d8495ae039d3 Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Thu, 25 Oct 2012 10:10:59 +0200 Subject: [PATCH 283/963] [MERGE]Lunch bzr revid: api@openerp.com-20121025081059-nvkq39dba86lfb2d --- addons/lunch/lunch.py | 124 ++++++++++++++++++++++++------------------ 1 file changed, 72 insertions(+), 52 deletions(-) diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py index 5c58801c353..c44c2de163c 100644 --- a/addons/lunch/lunch.py +++ b/addons/lunch/lunch.py @@ -75,46 +75,73 @@ class lunch_order(osv.Model): result[order.id]=alert_msg return result + def check_day(self,alert): + today = datetime.now().isoweekday() + if today == 1: + if alert.monday == True: + return True + if today == 2: + if alert.tuesday == True: + return True + if today == 3: + if alert.wednesday == True: + return True + if today == 4: + if alert.thursday == True: + return True + if today == 5: + if alert.friday == True: + return True + if today == 6: + if alert.saturday == True: + return True + if today == 7: + if alert.sunday == True: + return True + return False + def _default_alerts_get(self,cr,uid,arg,context=None): alert_ref = self.pool.get('lunch.alert') - alert_ids = alert_ref.search(cr,uid,[],context=context) + alert_ids = alert_ref.search(cr,uid,[('active','=',True)],context=context) alert_msg="" for alert in alert_ref.browse(cr,uid,alert_ids,context=context): if alert : #there are alerts - if alert.active==True: - #the alert is active - if alert.day=='specific': - #the alert is only activated a specific day - if alert.specific==fields.datetime.now().split(' ')[0]: - print alert.specific - elif alert.day=='week': - #the alert is activated during some days of the week - continue - elif alert.day=='days': - #the alert is activated everyday - if alert.active_from==alert.active_to: - #the alert is executing all the day - alert_msg+=" * " + display = False + if alert.day=='specific': + #the alert is only activated a specific day + if alert.specific==fields.datetime.now().split(' ')[0]: + display = True + elif alert.day=='week': + #the alert is activated during some days of the week + display = self.check_day(alert) + elif alert.day=='days': + #the alert is activated everyday + display = True + #Check if we can display the alert + if display == True: + if alert.active_from==alert.active_to: + #the alert is executing all the day + alert_msg+="* " + alert_msg+=alert.message + alert_msg+='\n' + elif alert.active_from=from_alert.time() and mynow.time()<=to_alert.time(): + alert_msg+="* " alert_msg+=alert.message alert_msg+='\n' - elif alert.active_from=from_alert.time() and mynow.time()<=to_alert.time(): - alert_msg+="* " - alert_msg+=alert.message - alert_msg+='\n' return alert_msg def onchange_price(self,cr,uid,ids,products,context=None): @@ -132,24 +159,6 @@ class lunch_order(osv.Model): res = {'value':{'total':tot}} return res - def _default_product_get(self,cr,uid,args,context=None): - cr.execute('''SELECT lol.id, lol.date, lol.user_id, lol.product, lol.note, lol.price, lol.write_date FROM lunch_order_line AS lol ORDER BY write_date''') - res = cr.dictfetchall() - result = [] - i=0 - pref_ref = self.pool.get('lunch.preference') - for temp in res: - if i==20: - break - if temp['user_id'] == uid: - prod = self.pool.get('lunch.product').browse(cr, uid, temp['product']) - temp['product_name'] = prod.name - temp['date'] = temp['write_date'] - new_id = pref_ref.create(cr,uid,temp) - result.append(new_id) - i+=1 - return result - def create(self, cr, uid, values, context=None): pref_ref = self.pool.get('lunch.preference') pref_ids = pref_ref.search(cr,uid,[],context=context) @@ -190,7 +199,19 @@ class lunch_order(osv.Model): text="" for pref in pref_ref.browse(cr,uid,pref_ids,context): if pref['user_id'].id == uid: - print "*************TEST***************" + function_name = "add_preference_"+str(pref.id) + price_text = "Price: "+str(pref['price']) + text += (''' + +

    ''')+pref['product_name']+('''

    +
    + ''')+price_text+(''' +
    + + + + + + ''' % (val['product_name'], val['price'] or 0.0, currency['name'], val['note'] or '', function_name, function_name) + text_xml+= ('''''') + text_xml+= ('''''') + # ADD into ARCH xml + doc = etree.XML(res['arch']) + node = doc.xpath("//div[@name='preferences']") + to_add = etree.fromstring(text_xml) + node[0].append(to_add) + res['arch'] = etree.tostring(doc) return res _columns = { @@ -285,108 +265,105 @@ class lunch_order(osv.Model): 'date': fields.date('Date', required=True,readonly=True, states={'new':[('readonly', False)]}), 'products' : fields.one2many('lunch.order.line','order_id','Products',ondelete="cascade",readonly=True,states={'new':[('readonly', False)]}), #TODO: a good naming convention is to finish your field names with `_ids´ for *2many fields. BTW, the field name should reflect more it's nature: `order_line_ids´ for example 'total' : fields.function(_price_get, string="Total",store=True), - 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled'), ('partially','Parcially Confirmed')], \ - 'Status', readonly=True, select=True), #TODO: parcially? #TODO: the labels are confusing. confirmed=='received' or 'delivered'... + 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled'), ('partially','Parcially Confirmed')],'Status', readonly=True, select=True), #TODO: parcially? #TODO: the labels are confusing. confirmed=='received' or 'delivered'... 'alerts': fields.function(_alerts_get, string="Alerts", type='text'), - 'preferences': fields.many2many("lunch.preference",'lunch_preference_rel','preferences','order_id','Preferences'), #TODO: preference_ids + 'preferences': fields.many2many("lunch.preference",'lunch_preference_rel','preferences','order_id','Preferences'), + 'company_id': fields.many2one('res.company', 'Company', required=True), + 'currency_id': fields.related('company_id','currency_id',string="Currency", readonly=True), } _defaults = { 'user_id': lambda self, cr, uid, context: uid, 'date': fields.date.context_today, - 'state': lambda self, cr, uid, context: 'new', #TODO: remove the lambda() + 'state': 'new', 'alerts': _default_alerts_get, 'preferences': _default_preference_get, + 'company_id': lambda self,cr,uid,context: self.pool.get('res.company')._company_default_get(cr, uid, 'lunch.order', context=context), } -class lunch_order_line(osv.Model): #define each product that will be in one ORDER.#TODO :D do not put comments because i said so, but because it's needed ^^ - """ lunch order line """ + +class lunch_order_line(osv.Model): + """ lunch order line : one lunch order can have many order lines""" _name = 'lunch.order.line' _description = 'lunch order line' def _price_get(self,cr,uid,ids,name,arg,context=None): - orderLines = self.browse(cr,uid,ids,context=context) + """ get the price of the product store in the order line """ result={} - for orderLine in orderLines: #TODO: get rid of `orderLines´ variable #TODO: usually, we don't use the CamelCase notation. For a better consistency you should use `order_line´ - result[orderLine.id]=orderLine.product.price + for order_line in self.browse(cr,uid,ids,context=context): + result[order_line.id]=order_line.product.price return result def onchange_price(self,cr,uid,ids,product,context=None): + """ Onchange methode to refresh the price """ if product: - price = self.pool.get('lunch.product').read(cr, uid, product, ['price'])['price']#TODO: pass `context´ in args or read() + price = self.pool.get('lunch.product').read(cr, uid, product, ['price'],context=context)['price'] return {'value': {'price': price}} return {'value': {'price': 0.0}} def confirm(self,cr,uid,ids,context=None): - #confirm one or more order.line, update order status and create new cashmove + """ confirm one or more order line, update order status and create new cashmove """ cashmove_ref = self.pool.get('lunch.cashmove') orders_ref = self.pool.get('lunch.order') - - for order in self.browse(cr,uid,ids,context=context): - if order.state!='confirmed': - new_id = cashmove_ref.create(cr,uid,{'user_id': order.user_id.id, 'amount':0 - order.price,'description':order.product.name, 'order_id':order.id, 'state':'order', 'date':order.date}) - self.write(cr,uid,[order.id],{'cashmove':[('0',new_id)], 'state':'confirmed'},context) - #TODO: how can this be working??? self is 'lunch.order.line' object, not 'lunch.order'... refactor - for order in self.browse(cr,uid,ids,context=context): + for order_line in self.browse(cr,uid,ids,context=context): + if order_line.state!='confirmed': + new_id = cashmove_ref.create(cr,uid,{'user_id': order_line.user_id.id, 'amount':0 - order_line.price,'description':order_line.product.name, 'order_id':order_line.id, 'state':'order', 'date':order_line.date}) + self.write(cr,uid,[order_line.id],{'cashmove':[('0',new_id)], 'state':'confirmed'},context) + for order_line in self.browse(cr,uid,ids,context=context): isconfirmed = True - for product in order.order_id.products: + for product in order_line.order_id.products: if product.state == 'new': isconfirmed = False if product.state == 'cancelled': isconfirmed = False - orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) + orders_ref.write(cr,uid,[order_line.order_id.id],{'state':'partially'},context=context) if isconfirmed == True: - orders_ref.write(cr,uid,[order.order_id.id],{'state':'confirmed'},context) #TODO: context is a kwarg + orders_ref.write(cr,uid,[order_line.order_id.id],{'state':'confirmed'},context=context) return {} def cancel(self,cr,uid,ids,context=None): - #confirm one or more order.line, update order status and create new cashmove + """ confirm one or more order.line, update order status and create new cashmove """ cashmove_ref = self.pool.get('lunch.cashmove') orders_ref = self.pool.get('lunch.order') - - #TODO: how can this be working??? self is 'lunch.order.line' object, not 'lunch.order'... refactor - for order in self.browse(cr,uid,ids,context=context): - self.write(cr,uid,[order.id],{'state':'cancelled'},context) - for cash in order.cashmove: + for order_line in self.browse(cr,uid,ids,context=context): + self.write(cr,uid,[order_line.id],{'state':'cancelled'},context) + for cash in order_line.cashmove: cashmove_ref.unlink(cr,uid,cash.id,context) - #TODO: how can this be working??? self is 'lunch.order.line' object, not 'lunch.order'... refactor - for order in self.browse(cr,uid,ids,context=context): + for order_line in self.browse(cr,uid,ids,context=context): hasconfirmed = False hasnew = False - for product in order.order_id.products: + for product in order_line.order_id.products: if product.state=='confirmed': hasconfirmed= True if product.state=='new': hasnew= True if hasnew == False: if hasconfirmed == False: - orders_ref.write(cr,uid,[order.order_id.id],{'state':'cancelled'},context) + orders_ref.write(cr,uid,[order_line.order_id.id],{'state':'cancelled'},context) return {} - orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) + orders_ref.write(cr,uid,[order_line.order_id.id],{'state':'partially'},context) return {} _columns = { - 'date' : fields.related('order_id','date',type='date', string="Date", readonly=True,store=True), #TODO: where is it used? - 'supplier' : fields.related('product','supplier',type='many2one',relation='res.partner',string="Supplier",readonly=True,store=True),#TODO: where is it used? - 'user_id' : fields.related('order_id', 'user_id', type='many2one', relation='res.users', string='User', readonly=True, store=True),#TODO: where is it used? - 'product' : fields.many2one('lunch.product','Product',required=True), #one offer can have more than one product and one product can be in more than one offer - #TODO remove wrong (what's an `offer´?) and useless comment (people knows what's a many2one) - 'note' : fields.text('Note',size=256,required=False),#TODO: required is False by default. Can be removed - 'order_id' : fields.many2one('lunch.order','Order',ondelete='cascade'), #TODO: this one should be required=True - 'price' : fields.function(_price_get, string="Price",store=True), #TODO: isn't it a fields.related? + 'date' : fields.related('order_id','date',type='date', string="Date", readonly=True,store=True), + 'supplier' : fields.related('product','supplier',type='many2one',relation='res.partner',string="Supplier",readonly=True,store=True), + 'user_id' : fields.related('order_id', 'user_id', type='many2one', relation='res.users', string='User', readonly=True, store=True), + 'product' : fields.many2one('lunch.product','Product',required=True), + 'note' : fields.text('Note',size=256,required=False), + 'order_id' : fields.many2one('lunch.order','Order',ondelete='cascade'), + 'price' : fields.related('product', 'price', type="float", readonly=True,store=True), 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled')], \ - 'Status', readonly=True, select=True), #TODO: labels are confusing. Should be: 'ordered', 'received' or 'not received' + 'Status', readonly=True, select=True), #new confirmed and cancelled are the convention 'cashmove': fields.one2many('lunch.cashmove','order_id','Cash Move',ondelete='cascade'), } _defaults = { - #TODO: remove lambda() - 'state': lambda self, cr, uid, context: 'new', + 'state': 'new', } class lunch_preference(osv.Model): -#TODO: class not reviewed yet + """ lunch preference (based on user previous order lines) """ _name = 'lunch.preference' _description= "user preferences" @@ -405,7 +382,6 @@ class lunch_preference(osv.Model): } class lunch_product(osv.Model): -#TODO: class not reviewed yet """ lunch product """ _name = 'lunch.product' _description = 'lunch product' @@ -419,7 +395,6 @@ class lunch_product(osv.Model): } class lunch_product_category(osv.Model): -#TODO: class not reviewed yet """ lunch product category """ _name = 'lunch.product.category' _description = 'lunch product category' @@ -428,7 +403,6 @@ class lunch_product_category(osv.Model): } class lunch_cashmove(osv.Model): -#TODO: class not reviewed yet """ lunch cashmove => order or payment """ _name = 'lunch.cashmove' _description = 'lunch cashmove' @@ -447,7 +421,6 @@ class lunch_cashmove(osv.Model): } class lunch_alert(osv.Model): -#TODO: class not reviewed yet """ lunch alert """ _name = 'lunch.alert' _description = 'lunch alert' @@ -468,7 +441,6 @@ class lunch_alert(osv.Model): } class lunch_cancel(osv.Model): -#TODO: class not reviewed yet """ lunch cancel """ _name = 'lunch.cancel' _description = 'cancel lunch order' @@ -500,7 +472,6 @@ class lunch_cancel(osv.Model): return {} class lunch_validation(osv.Model): -#TODO: class not reviewed yet """ lunch validation """ _name = 'lunch.validation' _description = 'lunch validation for order' diff --git a/addons/lunch/lunch_demo.xml b/addons/lunch/lunch_demo.xml index d789002f0ad..8b5b98b4960 100644 --- a/addons/lunch/lunch_demo.xml +++ b/addons/lunch/lunch_demo.xml @@ -112,6 +112,8 @@ new + 1 + 7.70
    @@ -119,6 +121,8 @@ confirmed + 1 + 7.40 @@ -126,6 +130,8 @@ cancelled + 1 + 2.50 @@ -136,6 +142,7 @@ +Emmental + 7.70 @@ -146,6 +153,7 @@ +Champignons + 7.40 @@ -156,6 +164,7 @@ +Salade +Tomates +Comcombres + 2.50 diff --git a/addons/lunch/static/src/css/lunch_style.css b/addons/lunch/static/src/css/lunch_style.css new file mode 100644 index 00000000000..eeb6ae3f754 --- /dev/null +++ b/addons/lunch/static/src/css/lunch_style.css @@ -0,0 +1,55 @@ + +.openerp .oe_lunch_view { +} + +.openerp .oe_lunch_30pc { + width: 33%; + display: inline-block; + vertical-align: top; +} +.openerp .oe_lunch_title { + font-weight: bold; + font-size: 17px; + margin-left: 10px; + color: #7C7BAD; +} + +.openerp .oe_lunch_vignette { + padding: 8px; + min-height: 50px; + border: 1px solid; + border-color: grey; + margin-right: 12px; + margin-bottom: 5px; + -moz-border-radius: 15px; + border-radius: 15px; + box-shadow: grey 1.5px 1.5px 1.5px; +} + +.openerp .oe_small_textarea>textarea { + min-height: 20px; + height: 20px; + color: red; +} + +.openerp .oe_lunch_button { + margin: 0px; + padding: 0px; + text-align: right; + width: 29%; + min-width: 55px; + max-width: 30%; + display: inline-block; +} + +.openerp .oe_lunch_note { + margin: 0px; + padding: 0px; + margin-top: 4px; + text-align: left; + font-style: italic; + color: #6374AB; + width: 69%; + max-width: 70%; + display: inline-block; +} diff --git a/addons/lunch/view/lunch_view.xml b/addons/lunch/view/lunch_view.xml index 91e09efb2ea..6bfa10898b0 100644 --- a/addons/lunch/view/lunch_view.xml +++ b/addons/lunch/view/lunch_view.xml @@ -279,6 +279,7 @@ + @@ -295,30 +296,29 @@ + + - -
    - + + +
    - -
    -
    - + - + - +

    From f670069ad94079a126614d68c542ea63ee015e79 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 26 Oct 2012 14:07:52 +0200 Subject: [PATCH 307/963] [WIP] lunch: code review bzr revid: qdp-launchpad@openerp.com-20121026120752-afcu5i2oiewb7emt --- addons/lunch/lunch.py | 9 +++++---- addons/lunch/partner.py | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py index a8c495d5dae..2094985f7b1 100644 --- a/addons/lunch/lunch.py +++ b/addons/lunch/lunch.py @@ -39,7 +39,7 @@ class lunch_order(osv.Model): value = 0.0 for product in order.products: #TODO: use meaningful variable names `for order_line in ...´ if product.state != 'cancelled': - value+=product.product.price + value += product.product.price result[order.id]=value return result @@ -51,7 +51,7 @@ class lunch_order(osv.Model): prod_ref = self.pool.get('lunch.product') order = self.browse(cr,uid,ids,context=context)[0] pref = pref_ref.browse(cr,uid,pref_id,context=context) - if pref.user_id.id == uid: + if pref.user_id.id == uid: new_order_line = { 'date': order["date"], 'user_id': uid, @@ -65,8 +65,9 @@ class lunch_order(osv.Model): order.products.append(new_id) #TODO: total is a computed field, so the write is useless, no? # ---> If I remove it, the total for order are not good (I try many times) + # use store = {...} total = self._price_get(cr,uid,ids," "," ",context=context) - self.write(cr,uid,ids,{'total':total},context) + self.write(cr,uid,ids,{},context) return True def _alerts_get(self, cr, uid, ids, name, arg, context=None): @@ -265,7 +266,7 @@ class lunch_order(osv.Model): 'date': fields.date('Date', required=True,readonly=True, states={'new':[('readonly', False)]}), 'products' : fields.one2many('lunch.order.line','order_id','Products',ondelete="cascade",readonly=True,states={'new':[('readonly', False)]}), #TODO: a good naming convention is to finish your field names with `_ids´ for *2many fields. BTW, the field name should reflect more it's nature: `order_line_ids´ for example 'total' : fields.function(_price_get, string="Total",store=True), - 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled'), ('partially','Parcially Confirmed')],'Status', readonly=True, select=True), #TODO: parcially? #TODO: the labels are confusing. confirmed=='received' or 'delivered'... + 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled'), ('partially','Partially Confirmed')],'Status', readonly=True, select=True), #TODO: parcially? #TODO: the labels are confusing. confirmed=='received' or 'delivered'... 'alerts': fields.function(_alerts_get, string="Alerts", type='text'), 'preferences': fields.many2many("lunch.preference",'lunch_preference_rel','preferences','order_id','Preferences'), 'company_id': fields.many2one('res.company', 'Company', required=True), diff --git a/addons/lunch/partner.py b/addons/lunch/partner.py index 5cdbd82230f..c6eb3d681a7 100644 --- a/addons/lunch/partner.py +++ b/addons/lunch/partner.py @@ -1,7 +1,7 @@ from osv import osv, fields class res_partner (osv.Model): - _inherit = 'res.partner' - _columns = { - 'supplier_lunch': fields.boolean('Lunch Supplier'), - } \ No newline at end of file + _inherit = 'res.partner' + _columns = { + 'supplier_lunch': fields.boolean('Lunch Supplier'), + } From 2cd1b9845c1cc6b1d7204592c54884f6a45c2894 Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Fri, 26 Oct 2012 14:58:08 +0200 Subject: [PATCH 308/963] [IMP]Lunch bzr revid: api@openerp.com-20121026125808-qkwdewnqhiutw5av --- addons/lunch/__init__.py | 4 +- addons/lunch/__openerp__.py | 3 +- addons/lunch/lunch.py | 104 +++++------------- addons/lunch/lunch_demo.xml | 14 +-- addons/lunch/{view => }/lunch_view.xml | 20 +++- addons/lunch/partner.py | 7 -- addons/lunch/view/partner_view.xml | 18 --- addons/lunch/wizard/__init__.py | 23 ++++ addons/lunch/wizard/lunch_cancel.py | 32 ++++++ .../{view => wizard}/lunch_cancel_view.xml | 0 addons/lunch/wizard/lunch_validation.py | 29 +++++ .../lunch_validation_view.xml | 0 12 files changed, 135 insertions(+), 119 deletions(-) rename addons/lunch/{view => }/lunch_view.xml (96%) delete mode 100644 addons/lunch/partner.py delete mode 100644 addons/lunch/view/partner_view.xml create mode 100644 addons/lunch/wizard/__init__.py create mode 100644 addons/lunch/wizard/lunch_cancel.py rename addons/lunch/{view => wizard}/lunch_cancel_view.xml (100%) create mode 100644 addons/lunch/wizard/lunch_validation.py rename addons/lunch/{view => wizard}/lunch_validation_view.xml (100%) diff --git a/addons/lunch/__init__.py b/addons/lunch/__init__.py index 14977cd974f..fb4acc9982e 100644 --- a/addons/lunch/__init__.py +++ b/addons/lunch/__init__.py @@ -20,5 +20,5 @@ ############################################################################## import lunch -import partner -import report \ No newline at end of file +import report +import wizard diff --git a/addons/lunch/__openerp__.py b/addons/lunch/__openerp__.py index f25e75028e0..c07f060b278 100644 --- a/addons/lunch/__openerp__.py +++ b/addons/lunch/__openerp__.py @@ -32,8 +32,7 @@ The base module to manage lunch. keep track for the Lunch Order, Cash Moves and Product. Apply Different Category for the product. """, - #TODO: remove `view´ folder. what's the use of partner_view.xml? what about lunch_validation_view.xml and lunch_cancel_view.xml? Couldn't that be merged in a single file? - 'data': ['security/groups.xml','view/lunch_view.xml','view/partner_view.xml','view/lunch_validation_view.xml','view/lunch_cancel_view.xml','lunch_report.xml', + 'data': ['security/groups.xml','lunch_view.xml','wizard/lunch_validation_view.xml','wizard/lunch_cancel_view.xml','lunch_report.xml', 'report/report_lunch_order_view.xml', 'security/ir.model.access.csv',], 'css':['static/src/css/lunch_style.css'], diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py index 2094985f7b1..b34bf52707c 100644 --- a/addons/lunch/lunch.py +++ b/addons/lunch/lunch.py @@ -37,12 +37,20 @@ class lunch_order(osv.Model): result={} for order in self.browse(cr, uid, ids, context=context): value = 0.0 - for product in order.products: #TODO: use meaningful variable names `for order_line in ...´ + for product in order.order_line_ids: #TODO: use meaningful variable names `for order_line in ...´ if product.state != 'cancelled': value += product.product.price result[order.id]=value return result + def _compute_total(self, cr, uid, ids, name, context=None): + """ compute total""" + result= {} + value = 0.0 + for order_line in self.browse(cr, uid, ids, context=context): + value+=order_line.price + result[order_line.order_id.id]=value + return result def add_preference(self, cr, uid, ids, pref_id, context=None): """ create a new order line based on the preference selected (pref_id)""" @@ -62,12 +70,7 @@ class lunch_order(osv.Model): 'supplier': prod_ref.browse(cr,uid,pref["product"].id,context=context)['supplier'].id } new_id = orderline_ref.create(cr,uid,new_order_line) - order.products.append(new_id) - #TODO: total is a computed field, so the write is useless, no? - # ---> If I remove it, the total for order are not good (I try many times) - # use store = {...} - total = self._price_get(cr,uid,ids," "," ",context=context) - self.write(cr,uid,ids,{},context) + order.order_line_ids.append(new_id) return True def _alerts_get(self, cr, uid, ids, name, arg, context=None): @@ -127,7 +130,7 @@ class lunch_order(osv.Model): def _default_alerts_get(self,cr,uid,arg,context=None): """ get the alerts to display on the order form """ alert_ref = self.pool.get('lunch.alert') - alert_ids = alert_ref.search(cr,uid,[('active','=',True)],context=context) #TODO: active=True is automatically added by orm, so this param can be removed + alert_ids = alert_ref.search(cr,uid,[('lunch_active','=',True)],context=context) alert_msg="" for alert in alert_ref.browse(cr,uid,alert_ids,context=context): if self.can_display_alert(alert): @@ -155,12 +158,12 @@ class lunch_order(osv.Model): alert_msg+='\n' return alert_msg - def onchange_price(self,cr,uid,ids,products,context=None): + def onchange_price(self,cr,uid,ids,order_line_ids,context=None): """ Onchange methode that refresh the total price of order""" res = {'value':{'total':0.0}} - if products: + if order_line_ids: tot = 0.0 - for prod in products: + for prod in order_line_ids: orderline = {} #TODO: that's weird. should truy to find another way to compute total on order lines when record is not saved... # or at least put some comments @@ -179,8 +182,8 @@ class lunch_order(osv.Model): prod_ref = self.pool.get('lunch.product') new_id = super(lunch_order, self).create(cr, uid, values, context=context) #When we create a new order we also create new preference - if len(values['products'])>0 and values['user_id']==uid: - for prods in values['products']: + if len(values['order_line_ids'])>0 and values['user_id']==uid: + for prods in values['order_line_ids']: already_exists = False #alreadyexist is used to check if a preferece already exists. for pref in pref_ref.browse(cr,uid,pref_ids,context=context): if pref['product'].id == prods[2]['product']: @@ -264,8 +267,10 @@ class lunch_order(osv.Model): _columns = { 'user_id' : fields.many2one('res.users','User Name',required=True,readonly=True, states={'new':[('readonly', False)]}), 'date': fields.date('Date', required=True,readonly=True, states={'new':[('readonly', False)]}), - 'products' : fields.one2many('lunch.order.line','order_id','Products',ondelete="cascade",readonly=True,states={'new':[('readonly', False)]}), #TODO: a good naming convention is to finish your field names with `_ids´ for *2many fields. BTW, the field name should reflect more it's nature: `order_line_ids´ for example - 'total' : fields.function(_price_get, string="Total",store=True), + 'order_line_ids' : fields.one2many('lunch.order.line','order_id','Products',ondelete="cascade",readonly=True,states={'new':[('readonly', False)]}), #TODO: a good naming convention is to finish your field names with `_ids´ for *2many fields. BTW, the field name should reflect more it's nature: `order_line_ids´ for example + 'total' : fields.function(_price_get, string="Total",store={ + 'lunch.order.line': (_compute_total, ['price'], 20), + }), 'state': fields.selection([('new', 'New'),('confirmed','Confirmed'), ('cancelled','Cancelled'), ('partially','Partially Confirmed')],'Status', readonly=True, select=True), #TODO: parcially? #TODO: the labels are confusing. confirmed=='received' or 'delivered'... 'alerts': fields.function(_alerts_get, string="Alerts", type='text'), 'preferences': fields.many2many("lunch.preference",'lunch_preference_rel','preferences','order_id','Preferences'), @@ -313,7 +318,7 @@ class lunch_order_line(osv.Model): self.write(cr,uid,[order_line.id],{'cashmove':[('0',new_id)], 'state':'confirmed'},context) for order_line in self.browse(cr,uid,ids,context=context): isconfirmed = True - for product in order_line.order_id.products: + for product in order_line.order_id.order_line_ids: if product.state == 'new': isconfirmed = False if product.state == 'cancelled': @@ -334,7 +339,7 @@ class lunch_order_line(osv.Model): for order_line in self.browse(cr,uid,ids,context=context): hasconfirmed = False hasnew = False - for product in order_line.order_id.products: + for product in order_line.order_id.order_line_ids: if product.state=='confirmed': hasconfirmed= True if product.state=='new': @@ -427,7 +432,7 @@ class lunch_alert(osv.Model): _description = 'lunch alert' _columns = { 'message' : fields.text('Message',size=256, required=True), - 'active' : fields.boolean('Active'), + 'lunch_active' : fields.boolean('Active'), 'day' : fields.selection([('specific','Specific day'), ('week','Every Week'), ('days','Every Day')], 'Recurrency'), 'specific' : fields.date('Day'), 'monday' : fields.boolean('Monday'), @@ -441,61 +446,8 @@ class lunch_alert(osv.Model): 'active_to': fields.float('And',required=True), } -class lunch_cancel(osv.Model): - """ lunch cancel """ - _name = 'lunch.cancel' - _description = 'cancel lunch order' - - def cancel(self,cr,uid,ids,context=None): - #confirm one or more order.line, update order status and create new cashmove - cashmove_ref = self.pool.get('lunch.cashmove') - order_lines_ref = self.pool.get('lunch.order.line') - orders_ref = self.pool.get('lunch.order') - order_ids = context.get('active_ids', []) - - for order in order_lines_ref.browse(cr,uid,order_ids,context=context): - order_lines_ref.write(cr,uid,[order.id],{'state':'cancelled'},context) - for cash in order.cashmove: - cashmove_ref.unlink(cr,uid,cash.id,context) - for order in order_lines_ref.browse(cr,uid,order_ids,context=context): - hasconfirmed = False - hasnew = False - for product in order.order_id.products: - if product.state=='confirmed': - hasconfirmed= True - if product.state=='new': - hasnew= True - if hasnew == False: - if hasconfirmed == False: - orders_ref.write(cr,uid,[order.order_id.id],{'state':'cancelled'},context) - return {} - orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) - return {} - -class lunch_validation(osv.Model): - """ lunch validation """ - _name = 'lunch.validation' - _description = 'lunch validation for order' - - def confirm(self,cr,uid,ids,context=None): - #confirm one or more order.line, update order status and create new cashmove - cashmove_ref = self.pool.get('lunch.cashmove') - order_lines_ref = self.pool.get('lunch.order.line') - orders_ref = self.pool.get('lunch.order') - order_ids = context.get('active_ids', []) - - for order in order_lines_ref.browse(cr,uid,order_ids,context=context): - if order.state!='confirmed': - new_id = cashmove_ref.create(cr,uid,{'user_id': order.user_id.id, 'amount':0 - order.price,'description':order.product.name, 'order_id':order.id, 'state':'order', 'date':order.date}) - order_lines_ref.write(cr,uid,[order.id],{'cashmove':[('0',new_id)], 'state':'confirmed'},context) - for order in order_lines_ref.browse(cr,uid,order_ids,context=context): - isconfirmed = True - for product in order.order_id.products: - if product.state == 'new': - isconfirmed = False - if product.state == 'cancelled': - isconfirmed = False - orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) - if isconfirmed == True: - orders_ref.write(cr,uid,[order.order_id.id],{'state':'confirmed'},context) - return {} +class res_partner (osv.Model): + _inherit = 'res.partner' + _columns = { + 'supplier_lunch': fields.boolean('Lunch Supplier'), + } diff --git a/addons/lunch/lunch_demo.xml b/addons/lunch/lunch_demo.xml index 8b5b98b4960..7bac4bb5dad 100644 --- a/addons/lunch/lunch_demo.xml +++ b/addons/lunch/lunch_demo.xml @@ -110,28 +110,25 @@ - + new 1 - 7.70 - + confirmed 1 - 7.40 - + cancelled 1 - 2.50 @@ -142,7 +139,6 @@ +Emmental - 7.70 @@ -153,7 +149,6 @@ +Champignons - 7.40 @@ -164,7 +159,6 @@ +Salade +Tomates +Comcombres - 2.50 @@ -217,7 +211,7 @@ Lunch must be ordered before 10h30 am days - t + t 0 0 diff --git a/addons/lunch/view/lunch_view.xml b/addons/lunch/lunch_view.xml similarity index 96% rename from addons/lunch/view/lunch_view.xml rename to addons/lunch/lunch_view.xml index 6bfa10898b0..c8f779ae182 100644 --- a/addons/lunch/view/lunch_view.xml +++ b/addons/lunch/lunch_view.xml @@ -275,7 +275,7 @@ - + @@ -308,7 +308,7 @@
    - + @@ -419,7 +419,7 @@ - +
    @@ -460,7 +460,7 @@ - + @@ -469,5 +469,17 @@
    + + + partner.supplier.name.form + res.partner + form + + + + + + + diff --git a/addons/lunch/partner.py b/addons/lunch/partner.py deleted file mode 100644 index c6eb3d681a7..00000000000 --- a/addons/lunch/partner.py +++ /dev/null @@ -1,7 +0,0 @@ -from osv import osv, fields - -class res_partner (osv.Model): - _inherit = 'res.partner' - _columns = { - 'supplier_lunch': fields.boolean('Lunch Supplier'), - } diff --git a/addons/lunch/view/partner_view.xml b/addons/lunch/view/partner_view.xml deleted file mode 100644 index c5cdb8c8995..00000000000 --- a/addons/lunch/view/partner_view.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - partner.supplier.name.form - res.partner - form - - - - - - - - - - - \ No newline at end of file diff --git a/addons/lunch/wizard/__init__.py b/addons/lunch/wizard/__init__.py new file mode 100644 index 00000000000..5761debe4f9 --- /dev/null +++ b/addons/lunch/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2012 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import lunch_validation +import lunch_cancel diff --git a/addons/lunch/wizard/lunch_cancel.py b/addons/lunch/wizard/lunch_cancel.py new file mode 100644 index 00000000000..4d7ff0336d1 --- /dev/null +++ b/addons/lunch/wizard/lunch_cancel.py @@ -0,0 +1,32 @@ +from osv import osv, fields + +class lunch_cancel(osv.Model): + """ lunch cancel """ + _name = 'lunch.cancel' + _description = 'cancel lunch order' + + def cancel(self,cr,uid,ids,context=None): + #confirm one or more order.line, update order status and create new cashmove + cashmove_ref = self.pool.get('lunch.cashmove') + order_lines_ref = self.pool.get('lunch.order.line') + orders_ref = self.pool.get('lunch.order') + order_ids = context.get('active_ids', []) + + for order in order_lines_ref.browse(cr,uid,order_ids,context=context): + order_lines_ref.write(cr,uid,[order.id],{'state':'cancelled'},context) + for cash in order.cashmove: + cashmove_ref.unlink(cr,uid,cash.id,context) + for order in order_lines_ref.browse(cr,uid,order_ids,context=context): + hasconfirmed = False + hasnew = False + for product in order.order_id.products: + if product.state=='confirmed': + hasconfirmed= True + if product.state=='new': + hasnew= True + if hasnew == False: + if hasconfirmed == False: + orders_ref.write(cr,uid,[order.order_id.id],{'state':'cancelled'},context) + return {} + orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) + return {} \ No newline at end of file diff --git a/addons/lunch/view/lunch_cancel_view.xml b/addons/lunch/wizard/lunch_cancel_view.xml similarity index 100% rename from addons/lunch/view/lunch_cancel_view.xml rename to addons/lunch/wizard/lunch_cancel_view.xml diff --git a/addons/lunch/wizard/lunch_validation.py b/addons/lunch/wizard/lunch_validation.py new file mode 100644 index 00000000000..b5b8610a534 --- /dev/null +++ b/addons/lunch/wizard/lunch_validation.py @@ -0,0 +1,29 @@ +from osv import osv, fields + +class lunch_validation(osv.Model): + """ lunch validation """ + _name = 'lunch.validation' + _description = 'lunch validation for order' + + def confirm(self,cr,uid,ids,context=None): + #confirm one or more order.line, update order status and create new cashmove + cashmove_ref = self.pool.get('lunch.cashmove') + order_lines_ref = self.pool.get('lunch.order.line') + orders_ref = self.pool.get('lunch.order') + order_ids = context.get('active_ids', []) + + for order in order_lines_ref.browse(cr,uid,order_ids,context=context): + if order.state!='confirmed': + new_id = cashmove_ref.create(cr,uid,{'user_id': order.user_id.id, 'amount':0 - order.price,'description':order.product.name, 'order_id':order.id, 'state':'order', 'date':order.date}) + order_lines_ref.write(cr,uid,[order.id],{'cashmove':[('0',new_id)], 'state':'confirmed'},context) + for order in order_lines_ref.browse(cr,uid,order_ids,context=context): + isconfirmed = True + for product in order.order_id.products: + if product.state == 'new': + isconfirmed = False + if product.state == 'cancelled': + isconfirmed = False + orders_ref.write(cr,uid,[order.order_id.id],{'state':'partially'},context) + if isconfirmed == True: + orders_ref.write(cr,uid,[order.order_id.id],{'state':'confirmed'},context) + return {} \ No newline at end of file diff --git a/addons/lunch/view/lunch_validation_view.xml b/addons/lunch/wizard/lunch_validation_view.xml similarity index 100% rename from addons/lunch/view/lunch_validation_view.xml rename to addons/lunch/wizard/lunch_validation_view.xml From 2e9ec07cbb9923afcdf30a558e8679053df4775d Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Fri, 26 Oct 2012 15:23:17 +0200 Subject: [PATCH 309/963] [IMP]Lunch bzr revid: api@openerp.com-20121026132317-i22zp1xdi0zpfqfx --- addons/crm/crm_lead_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index ce5f778c19e..a0dce6a7ea9 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -295,7 +295,7 @@ - < + From 9e758119b16eccd783030d13ea7300f29db54e6f Mon Sep 17 00:00:00 2001 From: "vta vta@openerp.com" <> Date: Fri, 26 Oct 2012 16:02:39 +0200 Subject: [PATCH 310/963] [IMP] Improved tracking code. bzr revid: vta@openerp.com-20121026140239-22pb87v79y015uy0 --- addons/web_analytics/__openerp__.py | 2 +- .../static/src/js/web_analytics.js | 140 ++++++++++++------ 2 files changed, 97 insertions(+), 45 deletions(-) diff --git a/addons/web_analytics/__openerp__.py b/addons/web_analytics/__openerp__.py index 2fa95c7398b..66ec959ac7b 100644 --- a/addons/web_analytics/__openerp__.py +++ b/addons/web_analytics/__openerp__.py @@ -31,7 +31,7 @@ Collects web application usage with Google Analytics. """, 'author': 'OpenERP SA', 'website': 'http://openerp.com', - 'depends': ['web'], + 'depends': ['web', 'auth_signup'], 'data': [], 'installable': True, 'active': False, diff --git a/addons/web_analytics/static/src/js/web_analytics.js b/addons/web_analytics/static/src/js/web_analytics.js index e9f83780a2d..e76488e4b45 100644 --- a/addons/web_analytics/static/src/js/web_analytics.js +++ b/addons/web_analytics/static/src/js/web_analytics.js @@ -4,32 +4,29 @@ var _gaq = _gaq || []; // asynchronous stack used by google analytics openerp.web_analytics = function(instance) { /** The Google Analytics Module inserts the Google Analytics JS Snippet - * at the top of the page, and sends to google a virtual url each time the - * openerp url is changed. Google needs a virtual url because it cannot - * handle sharps in the url. At this time the virtual url only handles the - * model and view parameters and is of the form /web_analytics/redirect/MODEL/VIEW - * - * The pushes of the virtual urls is made by adding a callback to the + * at the top of the page, and sends to google an url each time the + * openerp url is changed. + * The pushes of the urls is made by triggering the 'state_pushed' event in the * web_client.do_push_state() method which is responsible of changing the openerp current url */ + // Google Analytics Code snippet + (function() { + var ga = document.createElement('script'); + ga.type = 'text/javascript'; + ga.async = true + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(ga,s); + })(); + if (instance.webclient) { - // _gaq.push(['_setAccount', 'UA-25293939-2']); // fva@openerp.com localhost - // _gaq.push(['_setAccount', 'UA-28648768-1']); // fva@openerp.com runbot - // _gaq.push(['_setAccount', 'UA-28648768-1']); // fva@openerp.com - // _gaq.push(['_setAccount', 'UA-7333765-1']); // fp@openerp.com - // _gaq.push(['_setAccount', 'UA-7333765-1']); // fp@openerp.com - // _gaq.push(['_setDomainName', '.openerp.com']); + // Set the account and domain to start tracking _gaq.push(['_setAccount', 'UA-35793871-1']); // vta@openerp.com localhost - _gaq.push(['_setDomainName', 'none']); - _gaq.push(['_trackPageview']); - _gaq.push(['_deleteCustomVar', 1]); - _gaq.push(['_deleteCustomVar', 2]); - _gaq.push(['_deleteCustomVar', 3]); - _gaq.push(['_deleteCustomVar', 4]); - _gaq.push(['_deleteCustomVar', 5]); + _gaq.push(['_setDomainName', 'none']); // Change for the real domain + // Track user types if (instance.session.uid !== 1) { if ((/\.demo.openerp.com/).test(instance.session.server)) { _gaq.push(['_setCustomVar', 1, 'User Type', 'Demo User', 1]); @@ -40,43 +37,98 @@ openerp.web_analytics = function(instance) { _gaq.push(['_setCustomVar', 1, 'User Type', 'Admin User', 1]); } - // Google Analytics Code snippet - (function() { - var ga = document.createElement('script'); - ga.type = 'text/javascript'; - ga.async = true - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; - s.parentNode.insertBefore(ga,s); - })(); + // Track object usage + _gaq.push(['_setCustomVar', 2, 'Object', 'no_model', 3]); + // Tack view usage + _gaq.push(['_setCustomVar', 3, 'View Type', 'default', 3]); + + _gaq.push(['_trackPageview']); var self = this; instance.webclient.on('state_pushed', self, function(state) { - var url = '/' + window.location.hash; - _gaq.push(['_trackPageview', url]); - var model = state["model"] || "no_model"; - var view_type = state["view_type"] || "default"; - _gaq.push(['_setCustomVar', 2, 'Object', model, 3]); - _gaq.push(['_setCustomVar', 3, 'View Type', view_type, 3]); + // Track only pages corresponding to a 'normal' view of OpenERP, views + // related to client actions are tracked by the action manager + if (state.model && state.view_type) { + // Track object usage + _gaq.push(['_setCustomVar', 2, 'Object', state.model, 3]); + // Tack view usage + _gaq.push(['_setCustomVar', 3, 'View Type', state.view_type, 3]); + // Track the page + var url = instance.web_analytics.parseUrl({'model': state.model, 'view_type': state.view_type}); + _gaq.push(['_trackPageview', url]); + } }); } + // Track the events related with the creation and the modification of records instance.web.FormView = instance.web.FormView.extend({ - save: function(prepend_on_create) { - if (!this.datarecord.id) { - _gaq.push(['_trackEvent', this.model, 'on_button_save', 'Save']); - } else { - _gaq.push(['_trackEvent', this.model, 'on_button_edit', 'Save']); - } - return this._super.apply(this, arguments); + init: function(parent, dataset, view_id, options) { + this._super.apply(this, arguments); + var self = this; + this.on('record_created', self, function(r) { + var url = instance.web_analytics.parseUrl({'model': this.model, 'view_type': 'form'}); + _gaq.push(['_trackEvent', this.model, 'on_button_create_save', url]); + }); + this.on('record_saved', self, function(r) { + var url = instance.web_analytics.parseUrl({'model': this.model, 'view_type': 'form'}); + _gaq.push(['_trackEvent', this.model, 'on_button_edit_save', url]); + }); } }); - instance.web.form.WidgetButton = instance.web.form.WidgetButton.extend({ - on_confirmed: function() { - _gaq.push(['_trackEvent', this.view.model, this.node.attrs.name, this.node.attrs.string]); + // Track client actions + instance.web.ActionManager.include({ + ir_actions_client: function (action, options) { + var url = instance.web_analytics.parseUrl({'action': action.tag}); + _gaq.push(['_trackPageview', url]); return this._super.apply(this, arguments); }, }); + // Track button events + instance.web.View.include({ + do_execute_action: function(action_data, dataset, record_id, on_closed) { + console.log(action_data); + var category = this.model || dataset.model || ''; + var action; + if (action_data.name && _.isNaN(action_data.name-0)) { + action = action_data.name; + } else { + action = action_data.string || action_data.special || ''; + } + var label = instance.web_analytics.parseUrl({'model': category, 'view_type': this.view_type}); + _gaq.push(['_trackEvent', category, action, label]); + return this._super.apply(this, arguments); + }, + }); + + // Track error events + instance.web.CrashManager = instance.web.CrashManager.extend({ + show_error: function(error) { + var hash = window.location.hash; + var params = $.deparam(hash.substr(hash.indexOf('#')+1)); + var options = {}; + if (params.model && params.view_type) { + options = {'model': params.model, 'view_type': params.view_type}; + } else { + options = {'action': params.action}; + } + var label = instance.web_analytics.parseUrl(options); + if (error.code) { + _gaq.push(['_trackEvent', error.message, error.data.fault_code, label, ,true]); + } else { + _gaq.push(['_trackEvent', error.type, error.data.debug, label, ,true]); + } + this._super.apply(this, arguments); + }, + }); + + instance.web_analytics.parseUrl = function(options) { + var url = ''; + _.each(options, function(value, key) { + url += '/' + key + '=' + value; + }); + return url; + }; + }; \ No newline at end of file From 6a229f4385db0a2961116fcf599502288089cb38 Mon Sep 17 00:00:00 2001 From: "vta vta@openerp.com" <> Date: Fri, 26 Oct 2012 16:05:15 +0200 Subject: [PATCH 311/963] [ADD] Add trigger 'state_pushed', need in the module, bzr revid: vta@openerp.com-20121026140515-fjo4u05t0rdtehq6 --- addons/web/static/src/js/chrome.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 6cf35a14e92..81334cd6589 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1117,6 +1117,7 @@ instance.web.WebClient = instance.web.Client.extend({ var url = '#' + $.param(state); this._current_state = _.clone(state); $.bbq.pushState(url); + this.trigger('state_pushed', state); }, on_menu_action: function(options) { var self = this; From 7a905539ca9aac8e2fb5d0558d2d7ac6f010f0b5 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sun, 28 Oct 2012 10:06:12 +0100 Subject: [PATCH 312/963] [IMP] very small changes bzr revid: fp@openerp.com-20121028090612-sreo2sldddgngm23 --- addons/fleet/data.xml | 4 +-- addons/fleet/fleet_view.xml | 55 ++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 34 deletions(-) diff --git a/addons/fleet/data.xml b/addons/fleet/data.xml index 532e108b067..21aebab9174 100644 --- a/addons/fleet/data.xml +++ b/addons/fleet/data.xml @@ -412,7 +412,7 @@ - Leasing + Employee Car @@ -435,4 +435,4 @@ Break - \ No newline at end of file + diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 49ecb81bd21..cbc41d4f973 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -45,9 +45,7 @@

    Click to create a new model.

    - Specify the different model for a particular - brand of vehicle. For example Audi A3, - Audi A4, ... + You can define several models (e.g. A3, A4) for each brand (Audi).

    @@ -120,8 +118,6 @@

    Click to create a new brand. -

    - Here you can add vehicle's brands (BMW, Opel, ...)

    @@ -145,10 +141,10 @@ tree,form

    - Click to create a new state. + Click to create a vehicule status.

    - A state can help you knowing in what condition your - vehicle is. In reparation, Sold, Active, ... + You can customize available status to track the evolution of + each vehicule. Example: Active, Being Repaired, Sold.

    @@ -347,12 +343,12 @@

    Click to create a new vehicle.

    - OpenERP will help you manage your fleet by keeping - track of the contracts, services, costs, fuel logs associated - to a particular vehicle. + You will be able to manage your fleet by keeping track of the + contracts, services, fixed and recurring costs, odometers and + fuel logs associated to each vehicle.

    - When a contract arrives near expiration date, a visual warning - will show you that you need to renew that particular contract. + OpenERP will warn you when services or contract have to be + renewed.

    @@ -487,12 +483,12 @@

    Click to create a new contract.

    - OpenERP helps you managing all the contracts for your - vehicle, leasing, insurance, or any other type of contract. -

    - The contract form includes all sort of details, like the - activation cost, recurrent cost, the services included in - the contract, beginning and possibly ending date, etc. + Manage all your contracts (leasing, insurances, etc.) with + their related services, costs. OpenERP will automatically warn + you when some contracts have to be renewed. +

    + Each contract (e.g.: leasing) may include several services + (reparation, insurances, periodic maintenance).

    @@ -656,9 +652,9 @@

    Click to create a new fuel log.

    - Here you can add refuelling entries for all vehicles. - You can also show the log for a particular vehicle using - the search field. + Here you can add refuelling entries for all vehicles. You can + also filter logs of a particular vehicle using the search + field.

    @@ -749,7 +745,7 @@ Click to create a new service entry.

    OpenERP helps you keeping track of all the services done - on your vehicle. Services can be of many type, occasional + on your vehicle. Services can be of many type: occasional repair, fixed maintenance, etc.

    @@ -777,10 +773,7 @@

    Click to create a new type of service.

    - Each service belongs to a category.
    - - contract if this service is used in a contract (ie: leasing, ...).
    - - service if it is used as a service (ie: repair, change tire...).
    - - both if it is used in both case. + Each service can used in contracts, as a standalone service or both.

    @@ -869,11 +862,9 @@

    Click to create a new cost.

    - OpenERP helps you managing the costs for your different vehicles - Costs are generally created from services and contract and appears here. -

    - Thanks to the different filters, OpenERP can only print the effective - costs, sort them by type and by vehicle. + OpenERP helps you managing the costs for your different + vehicles. Costs are created automatically from services, + contracts (fixed or recurring) and fuel logs.

    From e48a9a3029b5d50a86e066f4f21c480adbe53983 Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Mon, 29 Oct 2012 11:59:03 +0530 Subject: [PATCH 313/963] [IMP]when sale order is cancelled,now it can be reset as draft bzr revid: kbh@tinyerp.com-20121029062903-13oxndmzs3r7ti2p --- addons/sale/sale.py | 5 +++++ addons/sale/sale_view.xml | 1 + 2 files changed, 6 insertions(+) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 7c77e239abb..ffd56b54218 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -580,6 +580,11 @@ class sale_order(osv.osv): self.write(cr, uid, ids, {'state': 'cancel'}) return True + def action_draft(self, cr, uid, ids, context=None): + """Resets Sale Order as draft. + """ + return self.write(cr, uid, ids, {'state':'draft'}, context=context) + def action_button_confirm(self, cr, uid, ids, context=None): assert len(ids) == 1, 'This option should only be used for a single id at a time.' wf_service = netsvc.LocalService('workflow') diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 3d1c84659a3..e6d974d670a 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -164,6 +164,7 @@
    +
    From c56368ee0c3db11069e1eecf3553a62147cb7d75 Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Mon, 29 Oct 2012 17:16:35 +0530 Subject: [PATCH 320/963] [IMP]improve code for getting reference of internal move bzr revid: pja@tinyerp.com-20121029114635-p960l6bsq9fo0035 --- addons/stock/stock.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index dffe1d69cc1..fb12bc40ce0 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -619,6 +619,9 @@ class stock_picking(osv.osv): def create(self, cr, user, vals, context=None): if ('name' not in vals) or (vals.get('name')=='/'): seq_obj_name = self._name + if seq_obj_name == 'stock.picking': + seq_obj_name = 'stock.picking.' + 'internal' + vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name) vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name) new_id = super(stock_picking, self).create(cr, user, vals, context) if new_id: From c3b4b18ad7b8adbfd61878c17a8e95e9872c1cab Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 29 Oct 2012 13:13:54 +0100 Subject: [PATCH 321/963] [FIX]Mail alert when contract to renew only once bzr revid: dle@openerp.com-20121029121354-9ebkqekbq50bewq3 --- addons/fleet/board_fleet_view.xml | 2 +- addons/fleet/fleet.py | 55 +++++++++++++++++++++---------- addons/fleet/fleet_view.xml | 3 ++ 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/addons/fleet/board_fleet_view.xml b/addons/fleet/board_fleet_view.xml index c69787a481f..aaf163abf72 100644 --- a/addons/fleet/board_fleet_view.xml +++ b/addons/fleet/board_fleet_view.xml @@ -57,7 +57,7 @@ form tree - {"search_default_parent_false" : True,"search_default_groupby_date" : True,"search_default_groupby_cost_type" : True,"search_default_groupby_cost_subtype" : True, "search_default_groupby_vehicle_id" : True,} + {"search_default_parent_false" : True,"search_default_groupby_year" : True,"search_default_groupby_cost_type" : True,"search_default_groupby_cost_subtype" : True, "search_default_groupby_vehicle_id" : True,}

    OpenERP helps you managing the costs for your different vehicles diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index eb8433d8cf6..c49627712a4 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -35,6 +35,21 @@ class fleet_vehicle_cost(osv.Model): res.append((record.id, name)) return res + def year_get(self, cr, uid, ids, context=None): + if context is None: + context = {} + if not ids: + return [] + reads = self.browse(cr, uid, ids, context=context) + res = [] + for record in reads: + res.append((record.id, str(record.date[:4]))) + return res + + def _year_get_fnc(self, cr, uid, ids, name, unknow_none, context=None): + res = self.year_get(cr, uid, ids, context=context) + return dict(res) + def _cost_name_get_fnc(self, cr, uid, ids, name, unknow_none, context=None): res = self.name_get(cr, uid, ids, context=context) return dict(res) @@ -52,7 +67,9 @@ class fleet_vehicle_cost(osv.Model): 'date' :fields.date('Date',help='Date when the cost has been executed'), 'contract_id' : fields.many2one('fleet.vehicle.log.contract', 'Contract', required=False, help='Contract attached to this cost'), - 'auto_generated' : fields.boolean('automatically generated',readonly=True,required=True) + 'auto_generated' : fields.boolean('automatically generated',readonly=True,required=True), + + 'year' : fields.function(_year_get_fnc, type="char", string='Year', store=True), } _defaults ={ @@ -331,7 +348,7 @@ class fleet_vehicle(osv.Model): overdue=0 if (record.log_contracts): for element in record.log_contracts: - if (element.state=='open' and element.expiration_date): + if ((element.state=='open' or element.state=='toclose') and element.expiration_date): current_date_str=time.strftime('%Y-%m-%d') due_time_str=element.expiration_date #due_time_str=element.browse() @@ -363,7 +380,7 @@ class fleet_vehicle(osv.Model): due_soon=0 if (record.log_contracts): for element in record.log_contracts: - if (element.state=='open' and element.expiration_date): + if ((element.state=='open' or element.state=='toclose') and element.expiration_date): current_date_str=time.strftime('%Y-%m-%d') due_time_str=element.expiration_date #due_time_str=element.browse() @@ -416,7 +433,7 @@ class fleet_vehicle(osv.Model): res=[] for record in reads: if (record.log_contracts): - ids = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),('state','=','open')],limit=1,order='expiration_date asc') + ids = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id','=',record.id),'|',('state','=','open'),('state','=','toclose')],limit=1,order='expiration_date asc') if len(ids) > 0: res.append((record.id,self.pool.get('fleet.vehicle.log.contract').browse(cr,uid,ids[0],context=context).cost_subtype.name)) else: @@ -435,7 +452,7 @@ class fleet_vehicle(osv.Model): due_soon=0 if (record.log_contracts): for element in record.log_contracts: - if (element.state=='open' and element.expiration_date): + if ((element.state=='open' or element.state=='toclose') and element.expiration_date): current_date_str=time.strftime('%Y-%m-%d') due_time_str=element.expiration_date @@ -454,16 +471,18 @@ class fleet_vehicle(osv.Model): return dict(res) def run_scheduler(self,cr,uid,context=None): - ids = self.pool.get('fleet.vehicle').search(cr, uid, [], offset=0, limit=None, order=None,context=None, count=False) - nexts = self.get_next_contract_reminder_fnc(cr,uid,ids,context=context) - overdues = self.get_overdue_contract_reminder_fnc(cr,uid,ids,context=context) - for key,value in nexts.items(): - if value > 0 and overdues[key] > 0: - self.message_post(cr, uid, [key], body=str(value) + ' contract(s) has to be renewed soon and '+str(overdues[key])+' contract(s) is (are) overdued', context=context) - elif value > 0: - self.message_post(cr, uid, [key], body=str(value) + ' contract(s) has to be renewed soon!', context=context) - elif overdues[key] > 0 : - self.message_post(cr, uid, [key], body=str(overdues[key]) + ' contract(s) is(are) overdued!', context=context) + ids = self.pool.get('fleet.vehicle.log.contract').search(cr, uid, ['&',('state','=','open'),('expiration_date','<',(datetime.date.today() + relativedelta(days=+15)).strftime('%Y-%m-%d'))], offset=0, limit=None, order=None,context=None, count=False) + res = {} + for contract in self.pool.get('fleet.vehicle.log.contract').browse(cr,uid,ids,context=context): + if contract.vehicle_id.id in res: + res[contract.vehicle_id.id] += 1 + else : + res[contract.vehicle_id.id] = 1 + + for vehicle,value in res.items(): + self.message_post(cr, uid, vehicle, body=str(value) + ' contract(s) need(s) to be renewed and/or closed!', context=context) + + self.pool.get('fleet.vehicle.log.contract').write(cr,uid,ids,{'state' : 'toclose'},context=context) return True def _get_default_state(self, cr, uid, context): @@ -889,7 +908,7 @@ class fleet_vehicle_log_contract(osv.Model): d = datetime.date.today() #d = datetime.datetime(2012, 12, 01) - contract_ids = self.pool.get('fleet.vehicle.log.contract').search(cr, uid, [('state','=','open')], offset=0, limit=None, order=None,context=None, count=False) + contract_ids = self.pool.get('fleet.vehicle.log.contract').search(cr, uid, [('state','!=','closed')], offset=0, limit=None, order=None,context=None, count=False) deltas = {'yearly' : relativedelta(years=+1),'monthly' : relativedelta(months=+1),'weekly' : relativedelta(weeks=+1),'daily' : relativedelta(days=+1)} for contract in self.pool.get('fleet.vehicle.log.contract').browse(cr,uid,contract_ids,context=context): if not contract.start_date or contract.cost_frequency == 'no': @@ -997,7 +1016,7 @@ class fleet_vehicle_log_contract(osv.Model): res=[] for record in reads: #if (record.reminder==True): - if (record.expiration_date and record.state=='open'): + if (record.expiration_date and (record.state=='open' or record.state=='toclose')): today=self.str_to_date(time.strftime('%Y-%m-%d')) renew_date = self.str_to_date(record.expiration_date) diff_time=int((renew_date-today).days) @@ -1078,7 +1097,7 @@ class fleet_vehicle_log_contract(osv.Model): 'insurer_id' :fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), 'purchaser_id' : fields.many2one('res.partner', 'Contractor',domain="['|',('customer','=',True),('employee','=',True)]",help='Person to which the contract is signed for'), 'ins_ref' : fields.char('Contract Reference', size=64), - 'state' : fields.selection([('open', 'In Progress'), ('closed', 'Terminated')], 'Status', readonly=True, help='Choose wheter the contract is still valid or not'), + 'state' : fields.selection([('open', 'In Progress'),('toclose','To Close'), ('closed', 'Terminated')], 'Status', readonly=True, help='Choose wheter the contract is still valid or not'), #'reminder' : fields.boolean('Renewal Reminder', help="Warn the user a few days before the expiration date of this contract"), 'notes' : fields.text('Terms and Conditions', help='Write here all supplementary informations relative to this contract'), 'odometer_id' : fields.many2one('fleet.vehicle.odometer', 'Odometer', required=False, help='Odometer measure of the vehicle at the moment of this log'), diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index cbc41d4f973..04dd87ee53f 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -792,6 +792,7 @@ + @@ -803,11 +804,13 @@ + + From 62a7cacdeb2e377a3417a9fc5f0166b0f4c3a01c Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 29 Oct 2012 14:21:35 +0100 Subject: [PATCH 322/963] [FIX]Mail post when vehicle edited, no post when vehicle updated but without changes bzr revid: dle@openerp.com-20121029132135-lsw8jx250cll7loh --- addons/fleet/fleet.py | 63 ++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index c49627712a4..2d4f8b89db2 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -581,38 +581,39 @@ class fleet_vehicle(osv.Model): return vehicle_id def write(self, cr, uid, ids, vals, context=None): - changes = [] - if 'driver' in vals: - value = self.pool.get('res.partner').browse(cr,uid,vals['driver'],context=context).name - olddriver = self.browse(cr, uid, ids, context)[0].driver - if olddriver: - olddriver = olddriver.name - else: - olddriver = 'None' - changes.append('Driver: from \'' + olddriver + '\' to \'' + value+'\'') - if 'state' in vals: - value = self.pool.get('fleet.vehicle.state').browse(cr,uid,vals['state'],context=context).name - oldstate = self.browse(cr, uid, ids, context)[0].state - if oldstate: - oldstate=oldstate.name - else: - oldstate = 'None' - changes.append('State: from \'' + oldstate + '\' to \'' + value+'\'') - if 'license_plate' in vals: - old_license_plate = self.browse(cr, uid, ids, context)[0].license_plate - if not old_license_plate: - old_license_plate = 'None' - changes.append('License Plate: from \'' + old_license_plate + '\' to \'' + vals['license_plate']+'\'') - - vehicle_id = super(fleet_vehicle,self).write(cr, uid, ids, vals, context) + for vehicle in self.browse(cr, uid, ids, context): + changes = [] + if 'driver' in vals and vehicle.driver.id != vals['driver']: + value = self.pool.get('res.partner').browse(cr,uid,vals['driver'],context=context).name + olddriver = vehicle.driver + if olddriver: + olddriver = olddriver.name + else: + olddriver = 'None' + changes.append('Driver: from \'' + olddriver + '\' to \'' + value+'\'') + if 'state' in vals and vehicle.state.id != vals['state']: + value = self.pool.get('fleet.vehicle.state').browse(cr,uid,vals['state'],context=context).name + oldstate = vehicle.state + if oldstate: + oldstate=oldstate.name + else: + oldstate = 'None' + changes.append('State: from \'' + oldstate + '\' to \'' + value+'\'') + if 'license_plate' in vals and vehicle.license_plate != vals['license_plate']: + old_license_plate = vehicle.license_plate + if not old_license_plate: + old_license_plate = 'None' + changes.append('License Plate: from \'' + old_license_plate + '\' to \'' + vals['license_plate']+'\'') + + vehicle_id = super(fleet_vehicle,self).write(cr, uid, ids, vals, context) - try: - if len(changes) > 0: - self.message_post(cr, uid, [self.browse(cr, uid, ids, context)[0].id], body=", ".join(changes), context=context) - except Exception as e: - print e - pass - return vehicle_id + try: + if len(changes) > 0: + self.message_post(cr, uid, [self.browse(cr, uid, ids, context)[0].id], body=", ".join(changes), context=context) + except Exception as e: + print e + pass + return True ############################ ############################ From 85e2cc3af41d28a5b8495e32fb4d6607873529ed Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Mon, 29 Oct 2012 14:35:34 +0100 Subject: [PATCH 323/963] [ADD]on change to compute indicative costs subtotal in contract view bzr revid: csn@openerp.com-20121029133534-i51j5h1ybpt1ljwd --- addons/fleet/fleet.py | 26 ++++++++++++++++++++++++++ addons/fleet/fleet_view.xml | 11 +++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 2d4f8b89db2..5abd03d3bc2 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -1086,6 +1086,31 @@ class fleet_vehicle_log_contract(osv.Model): model_id = False return model_id + def on_change_indic_cost(self,cr,uid,ids,cost_ids,context=None): + contracts = self.browse(cr,uid,ids,context=context) + totalsum=0 + for element in contracts: + for cost in element.cost_ids: + totalsum=totalsum+cost.amount + for element in cost_ids: + if element[1] is False and element[2] is not False: + totalsum = totalsum+element[2]['amount'] + return { + 'value' : { + 'sum_cost' : totalsum, + } + } + + def _get_sum_cost(self, cr, uid, ids, odometer_id, arg, context): + contracts = self.browse(cr,uid,ids,context=context) + totalsum=0 + res = [] + for element in contracts: + for cost in element.cost_ids: + totalsum=totalsum+cost.amount + res.append((element.id,totalsum)) + return dict(res) + _name = 'fleet.vehicle.log.contract' _order='state,expiration_date' _columns = { @@ -1108,6 +1133,7 @@ class fleet_vehicle_log_contract(osv.Model): 'cost_generated': fields.float('Recurring Cost Amount',help="Costs paid at regular intervals, depending on the cost frequency. If the cost frequency is set to unique, the cost will be logged at the start date"), 'cost_frequency': fields.selection([('no','No'),('daily', 'Daily'),('weekly','Weekly'),('monthly','Monthly'),('yearly','Yearly')], 'Recurring Cost Frequency', help='Frequency of the recuring cost',required=True), 'generated_cost_ids' : fields.one2many('fleet.vehicle.cost', 'contract_id', 'Generated Costs',ondelete='cascade'), + 'sum_cost' : fields.function(_get_sum_cost,type='float', string='Indicative Costs Total',readonly=True), } _defaults = { 'purchaser_id': lambda self, cr, uid, ctx: uid, diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 04dd87ee53f..48542e965b3 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -404,21 +404,24 @@ - + + +

    - - + + - + + From 0afc56c2f154219da54d1f0630e69461d406bf68 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Mon, 29 Oct 2012 14:38:14 +0100 Subject: [PATCH 324/963] [FIX]OnChange vehicle brand image not changing bzr revid: dle@openerp.com-20121029133814-ty2ja8t7oicmckyz --- addons/fleet/fleet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 5abd03d3bc2..d90fa19f157 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -159,7 +159,7 @@ class fleet_vehicle_model(osv.Model): return { 'value' : { - 'image' : brand.image, + 'image_medium' : brand.image, } } @@ -568,7 +568,7 @@ class fleet_vehicle(osv.Model): return { 'value' : { - 'image' : model.image, + 'image_medium' : model.image, } } def create(self, cr, uid, data, context=None): From a4b0b789dd2d648d0fe7c5e5526d404631025c0e Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Mon, 29 Oct 2012 19:18:45 +0530 Subject: [PATCH 325/963] [IMP] invoice control manual invisible button. bzr revid: nco@tinyerp.com-20121029134845-wl1sr4mn9a4g4iud --- addons/purchase/purchase.py | 2 +- addons/purchase/stock_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 991a60ef835..973ba90fca9 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -534,7 +534,7 @@ class purchase_order(osv.osv): 'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none', 'type': 'in', 'partner_id': order.dest_address_id.id or order.partner_id.id, - 'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none', + 'invoice_state': '2binvoiced' if order.invoice_method in ('picking', 'order') else 'none', 'purchase_id': order.id, 'company_id': order.company_id.id, 'move_lines' : [], diff --git a/addons/purchase/stock_view.xml b/addons/purchase/stock_view.xml index c78439e98f6..1e73a7898d2 100644 --- a/addons/purchase/stock_view.xml +++ b/addons/purchase/stock_view.xml @@ -43,7 +43,7 @@ - ').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.17",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.17"})})(jQuery);/* - * jQuery UI Tabs 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.17"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a'))}$.extend($.ui,{datepicker:{version:"1.8.17"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
    ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
    '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
    ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
    '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
    '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
    "+(j?""+(g[0]>0&&N==g[1]-1?'
    ':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""),a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this -._get(a,"showMonthAfterYear"),l='
    ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
    ";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.17",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* - * jQuery UI Progressbar 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
    ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.17"})})(jQuery);/* - * jQuery UI Effects 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/ - */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.17",save:function(a,b){for(var c=0;c").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/* - * jQuery UI Effects Fade 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fade - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* - * jQuery UI Effects Fold 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* - * jQuery UI Effects Highlight 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* - * jQuery UI Effects Pulsate 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file diff --git a/addons/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js b/addons/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js new file mode 100644 index 00000000000..8ff02b23145 --- /dev/null +++ b/addons/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js @@ -0,0 +1,14823 @@ +/*! jQuery UI - v1.9.1 - 2012-10-29 +* http://jqueryui.com +* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js +* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */ + +(function( $, undefined ) { + +var uuid = 0, + runiqueId = /^ui-id-\d+$/; + +// prevent duplicate loading +// this is only a problem because we proxy existing functions +// and we don't want to double proxy them +$.ui = $.ui || {}; +if ( $.ui.version ) { + return; +} + +$.extend( $.ui, { + version: "1.9.1", + + keyCode: { + BACKSPACE: 8, + COMMA: 188, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + LEFT: 37, + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SPACE: 32, + TAB: 9, + UP: 38 + } +}); + +// plugins +$.fn.extend({ + _focus: $.fn.focus, + focus: function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + this._focus.apply( this, arguments ); + }, + + scrollParent: function() { + var scrollParent; + if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x')); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x')); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + //
    + value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + }, + + uniqueId: function() { + return this.each(function() { + if ( !this.id ) { + this.id = "ui-id-" + (++uuid); + } + }); + }, + + removeUniqueId: function() { + return this.each(function() { + if ( runiqueId.test( this.id ) ) { + $( this ).removeAttr( "id" ); + } + }); + } +}); + +// support: jQuery <1.8 +if ( !$( "" ).outerWidth( 1 ).jquery ) { + $.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; + if ( border ) { + size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; + }); +} + +// selectors +function focusable( element, isTabIndexNotNaN ) { + var map, mapName, img, + nodeName = element.nodeName.toLowerCase(); + if ( "area" === nodeName ) { + map = element.parentNode; + mapName = map.name; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) ? + !element.disabled : + "a" === nodeName ? + element.href || isTabIndexNotNaN : + isTabIndexNotNaN) && + // the element and all of its ancestors must be visible + visible( element ); +} + +function visible( element ) { + return $.expr.filters.visible( element ) && + !$( element ).parents().andSelf().filter(function() { + return $.css( this, "visibility" ) === "hidden"; + }).length; +} + +$.extend( $.expr[ ":" ], { + data: $.expr.createPseudo ? + $.expr.createPseudo(function( dataName ) { + return function( elem ) { + return !!$.data( elem, dataName ); + }; + }) : + // support: jQuery <1.8 + function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ), + isTabIndexNaN = isNaN( tabIndex ); + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); + } +}); + +// support +$(function() { + var body = document.body, + div = body.appendChild( div = document.createElement( "div" ) ); + + // access offsetHeight before setting the style to prevent a layout bug + // in IE 9 which causes the element to continue to take up space even + // after it is removed from the DOM (#8026) + div.offsetHeight; + + $.extend( div.style, { + minHeight: "100px", + height: "auto", + padding: 0, + borderWidth: 0 + }); + + $.support.minHeight = div.offsetHeight === 100; + $.support.selectstart = "onselectstart" in div; + + // set display to none to avoid a layout bug in IE + // http://dev.jquery.com/ticket/4014 + body.removeChild( div ).style.display = "none"; +}); + + + + + +// deprecated + +(function() { + var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || []; + $.ui.ie = uaMatch.length ? true : false; + $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6; +})(); + +$.fn.extend({ + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + } +}); + +$.extend( $.ui, { + // $.ui.plugin is deprecated. Use the proxy pattern instead. + plugin: { + add: function( module, option, set ) { + var i, + proto = $.ui[ module ].prototype; + for ( i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var i, + set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) { + return; + } + + for ( i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + contains: $.contains, + + // only used by resizable + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + }, + + // these are odd functions, fix the API or move into individual plugins + isOverAxis: function( x, reference, size ) { + //Determines when x coordinate is over "b" element axis + return ( x > reference ) && ( x < ( reference + size ) ); + }, + isOver: function( y, x, top, left, height, width ) { + //Determines when x, y coordinates is over "b" element + return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); + } +}); + +})( jQuery ); +(function( $, undefined ) { + +var uuid = 0, + slice = Array.prototype.slice, + _cleanData = $.cleanData; +$.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + _cleanData( elems ); +}; + +$.widget = function( name, base, prototype ) { + var fullName, existingConstructor, constructor, basePrototype, + namespace = name.split( "." )[ 0 ]; + + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { + return !!$.data( elem, fullName ); + }; + + $[ namespace ] = $[ namespace ] || {}; + existingConstructor = $[ namespace ][ name ]; + constructor = $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without "new" keyword + if ( !this._createWidget ) { + return new constructor( options, element ); + } + + // allow instantiation without initializing for simple inheritance + // must use "new" keyword (the code above always passes args) + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + // extend with the existing constructor to carry over any static properties + $.extend( constructor, existingConstructor, { + version: prototype.version, + // copy the object used to create the prototype in case we need to + // redefine the widget later + _proto: $.extend( {}, prototype ), + // track widgets that inherit from this widget in case this widget is + // redefined after a widget inherits from it + _childConstructors: [] + }); + + basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from + basePrototype.options = $.widget.extend( {}, basePrototype.options ); + $.each( prototype, function( prop, value ) { + if ( $.isFunction( value ) ) { + prototype[ prop ] = (function() { + var _super = function() { + return base.prototype[ prop ].apply( this, arguments ); + }, + _superApply = function( args ) { + return base.prototype[ prop ].apply( this, args ); + }; + return function() { + var __super = this._super, + __superApply = this._superApply, + returnValue; + + this._super = _super; + this._superApply = _superApply; + + returnValue = value.apply( this, arguments ); + + this._super = __super; + this._superApply = __superApply; + + return returnValue; + }; + })(); + } + }); + constructor.prototype = $.widget.extend( basePrototype, { + // TODO: remove support for widgetEventPrefix + // always use the name + a colon as the prefix, e.g., draggable:start + // don't prefix for widgets that aren't DOM-based + widgetEventPrefix: basePrototype.widgetEventPrefix || name + }, prototype, { + constructor: constructor, + namespace: namespace, + widgetName: name, + // TODO remove widgetBaseClass, see #8155 + widgetBaseClass: fullName, + widgetFullName: fullName + }); + + // If this widget is being redefined then we need to find all widgets that + // are inheriting from it and redefine all of them so that they inherit from + // the new version of this widget. We're essentially trying to replace one + // level in the prototype chain. + if ( existingConstructor ) { + $.each( existingConstructor._childConstructors, function( i, child ) { + var childPrototype = child.prototype; + + // redefine the child widget using the same prototype that was + // originally used, but inherit from the new version of the base + $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); + }); + // remove the list of existing child constructors from the old constructor + // so the old child constructors can be garbage collected + delete existingConstructor._childConstructors; + } else { + base._childConstructors.push( constructor ); + } + + $.widget.bridge( name, constructor ); +}; + +$.widget.extend = function( target ) { + var input = slice.call( arguments, 1 ), + inputIndex = 0, + inputLength = input.length, + key, + value; + for ( ; inputIndex < inputLength; inputIndex++ ) { + for ( key in input[ inputIndex ] ) { + value = input[ inputIndex ][ key ]; + if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { + // Clone objects + if ( $.isPlainObject( value ) ) { + target[ key ] = $.isPlainObject( target[ key ] ) ? + $.widget.extend( {}, target[ key ], value ) : + // Don't extend strings, arrays, etc. with objects + $.widget.extend( {}, value ); + // Copy everything else by reference + } else { + target[ key ] = value; + } + } + } + } + return target; +}; + +$.widget.bridge = function( name, object ) { + var fullName = object.prototype.widgetFullName; + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.widget.extend.apply( null, [ options ].concat(args) ) : + options; + + if ( isMethodCall ) { + this.each(function() { + var methodValue, + instance = $.data( this, fullName ); + if ( !instance ) { + return $.error( "cannot call methods on " + name + " prior to initialization; " + + "attempted to call method '" + options + "'" ); + } + if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { + return $.error( "no such method '" + options + "' for " + name + " widget instance" ); + } + methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue && methodValue.jquery ? + returnValue.pushStack( methodValue.get() ) : + methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, fullName ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + new object( options, this ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( /* options, element */ ) {}; +$.Widget._childConstructors = []; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + defaultElement: "
    ", + options: { + disabled: false, + + // callbacks + create: null + }, + _createWidget: function( options, element ) { + element = $( element || this.defaultElement || this )[ 0 ]; + this.element = $( element ); + this.uuid = uuid++; + this.eventNamespace = "." + this.widgetName + this.uuid; + this.options = $.widget.extend( {}, + this.options, + this._getCreateOptions(), + options ); + + this.bindings = $(); + this.hoverable = $(); + this.focusable = $(); + + if ( element !== this ) { + // 1.9 BC for #7810 + // TODO remove dual storage + $.data( element, this.widgetName, this ); + $.data( element, this.widgetFullName, this ); + this._on( this.element, { + remove: function( event ) { + if ( event.target === element ) { + this.destroy(); + } + } + }); + this.document = $( element.style ? + // element within the document + element.ownerDocument : + // element is window or document + element.document || element ); + this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); + } + + this._create(); + this._trigger( "create", null, this._getCreateEventData() ); + this._init(); + }, + _getCreateOptions: $.noop, + _getCreateEventData: $.noop, + _create: $.noop, + _init: $.noop, + + destroy: function() { + this._destroy(); + // we can probably remove the unbind calls in 2.0 + // all event bindings should go through this._on() + this.element + .unbind( this.eventNamespace ) + // 1.9 BC for #7810 + // TODO remove dual storage + .removeData( this.widgetName ) + .removeData( this.widgetFullName ) + // support: jquery <1.6.3 + // http://bugs.jquery.com/ticket/9413 + .removeData( $.camelCase( this.widgetFullName ) ); + this.widget() + .unbind( this.eventNamespace ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetFullName + "-disabled " + + "ui-state-disabled" ); + + // clean up events and states + this.bindings.unbind( this.eventNamespace ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + }, + _destroy: $.noop, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key, + parts, + curOption, + i; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.widget.extend( {}, this.options ); + } + + if ( typeof key === "string" ) { + // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } + options = {}; + parts = key.split( "." ); + key = parts.shift(); + if ( parts.length ) { + curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); + for ( i = 0; i < parts.length - 1; i++ ) { + curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; + curOption = curOption[ parts[ i ] ]; + } + key = parts.pop(); + if ( value === undefined ) { + return curOption[ key ] === undefined ? null : curOption[ key ]; + } + curOption[ key ] = value; + } else { + if ( value === undefined ) { + return this.options[ key ] === undefined ? null : this.options[ key ]; + } + options[ key ] = value; + } + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var key; + + for ( key in options ) { + this._setOption( key, options[ key ] ); + } + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value ) + .attr( "aria-disabled", value ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _on: function( element, handlers ) { + var delegateElement, + instance = this; + // no element argument, shuffle and use this.element + if ( !handlers ) { + handlers = element; + element = this.element; + delegateElement = this.widget(); + } else { + // accept selectors, DOM elements + element = delegateElement = $( element ); + this.bindings = this.bindings.add( element ); + } + + $.each( handlers, function( event, handler ) { + function handlerProxy() { + // allow widgets to customize the disabled handling + // - disabled as an array instead of boolean + // - disabled class as method for disabling individual parts + if ( instance.options.disabled === true || + $( this ).hasClass( "ui-state-disabled" ) ) { + return; + } + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + + // copy the guid so direct unbinding works + if ( typeof handler !== "string" ) { + handlerProxy.guid = handler.guid = + handler.guid || handlerProxy.guid || $.guid++; + } + + var match = event.match( /^(\w+)\s*(.*)$/ ), + eventName = match[1] + instance.eventNamespace, + selector = match[2]; + if ( selector ) { + delegateElement.delegate( selector, eventName, handlerProxy ); + } else { + element.bind( eventName, handlerProxy ); + } + }); + }, + + _off: function( element, eventName ) { + eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; + element.unbind( eventName ).undelegate( eventName ); + }, + + _delay: function( handler, delay ) { + function handlerProxy() { + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + var instance = this; + return setTimeout( handlerProxy, delay || 0 ); + }, + + _hoverable: function( element ) { + this.hoverable = this.hoverable.add( element ); + this._on( element, { + mouseenter: function( event ) { + $( event.currentTarget ).addClass( "ui-state-hover" ); + }, + mouseleave: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-hover" ); + } + }); + }, + + _focusable: function( element ) { + this.focusable = this.focusable.add( element ); + this._on( element, { + focusin: function( event ) { + $( event.currentTarget ).addClass( "ui-state-focus" ); + }, + focusout: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-focus" ); + } + }); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + return !( $.isFunction( callback ) && + callback.apply( this.element[0], [ event ].concat( data ) ) === false || + event.isDefaultPrevented() ); + } +}; + +$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { + $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { + if ( typeof options === "string" ) { + options = { effect: options }; + } + var hasOptions, + effectName = !options ? + method : + options === true || typeof options === "number" ? + defaultEffect : + options.effect || defaultEffect; + options = options || {}; + if ( typeof options === "number" ) { + options = { duration: options }; + } + hasOptions = !$.isEmptyObject( options ); + options.complete = callback; + if ( options.delay ) { + element.delay( options.delay ); + } + if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) { + element[ method ]( options ); + } else if ( effectName !== method && element[ effectName ] ) { + element[ effectName ]( options.duration, options.easing, callback ); + } else { + element.queue(function( next ) { + $( this )[ method ](); + if ( callback ) { + callback.call( element[ 0 ] ); + } + next(); + }); + } + }; +}); + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + $.Widget.prototype._getCreateOptions = function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }; +} + +})( jQuery ); +(function( $, undefined ) { + +var mouseHandled = false; +$( document ).mouseup( function( e ) { + mouseHandled = false; +}); + +$.widget("ui.mouse", { + version: "1.9.1", + options: { + cancel: 'input,textarea,button,select,option', + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var that = this; + + this.element + .bind('mousedown.'+this.widgetName, function(event) { + return that._mouseDown(event); + }) + .bind('click.'+this.widgetName, function(event) { + if (true === $.data(event.target, that.widgetName + '.preventClickEvent')) { + $.removeData(event.target, that.widgetName + '.preventClickEvent'); + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + if ( this._mouseMoveDelegate ) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + } + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + if( mouseHandled ) { return; } + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var that = this, + btnIsLeft = (event.which === 1), + // event.target.nodeName works around a bug in IE 8 with + // disabled inputs (#7620) + elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + that.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // Click event may never have fired (Gecko & Opera) + if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) { + $.removeData(event.target, this.widgetName + '.preventClickEvent'); + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return that._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return that._mouseUp(event); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + event.preventDefault(); + + mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.ui.ie && !(document.documentMode >= 9) && !event.button) { + return this._mouseUp(event); + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + + if (event.target === this._mouseDownEvent.target) { + $.data(event.target, this.widgetName + '.preventClickEvent', true); + } + + this._mouseStop(event); + } + + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(event) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(event) {}, + _mouseDrag: function(event) {}, + _mouseStop: function(event) {}, + _mouseCapture: function(event) { return true; } +}); + +})(jQuery); +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var cachedScrollbarWidth, + max = Math.max, + abs = Math.abs, + round = Math.round, + rhorizontal = /left|center|right/, + rvertical = /top|center|bottom/, + roffset = /[\+\-]\d+%?/, + rposition = /^\w+/, + rpercent = /%$/, + _position = $.fn.position; + +function getOffsets( offsets, width, height ) { + return [ + parseInt( offsets[ 0 ], 10 ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), + parseInt( offsets[ 1 ], 10 ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) + ]; +} +function parseCss( element, property ) { + return parseInt( $.css( element, property ), 10 ) || 0; +} + +$.position = { + scrollbarWidth: function() { + if ( cachedScrollbarWidth !== undefined ) { + return cachedScrollbarWidth; + } + var w1, w2, + div = $( "
    " ), + innerDiv = div.children()[0]; + + $( "body" ).append( div ); + w1 = innerDiv.offsetWidth; + div.css( "overflow", "scroll" ); + + w2 = innerDiv.offsetWidth; + + if ( w1 === w2 ) { + w2 = div[0].clientWidth; + } + + div.remove(); + + return (cachedScrollbarWidth = w1 - w2); + }, + getScrollInfo: function( within ) { + var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ), + overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ), + hasOverflowX = overflowX === "scroll" || + ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), + hasOverflowY = overflowY === "scroll" || + ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); + return { + width: hasOverflowX ? $.position.scrollbarWidth() : 0, + height: hasOverflowY ? $.position.scrollbarWidth() : 0 + }; + }, + getWithinInfo: function( element ) { + var withinElement = $( element || window ), + isWindow = $.isWindow( withinElement[0] ); + return { + element: withinElement, + isWindow: isWindow, + offset: withinElement.offset() || { left: 0, top: 0 }, + scrollLeft: withinElement.scrollLeft(), + scrollTop: withinElement.scrollTop(), + width: isWindow ? withinElement.width() : withinElement.outerWidth(), + height: isWindow ? withinElement.height() : withinElement.outerHeight() + }; + } +}; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var atOffset, targetWidth, targetHeight, targetOffset, basePosition, + target = $( options.of ), + within = $.position.getWithinInfo( options.within ), + scrollInfo = $.position.getScrollInfo( within ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offsets = {}; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + targetOffset = { top: 0, left: 0 }; + } else if ( $.isWindow( targetElem ) ) { + targetWidth = target.width(); + targetHeight = target.height(); + targetOffset = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + targetOffset = { top: targetElem.pageY, left: targetElem.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + targetOffset = target.offset(); + } + // clone to reuse original targetOffset later + basePosition = $.extend( {}, targetOffset ); + + // force my and at to have valid horizontal and vertical positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[ this ] || "" ).split( " " ), + horizontalOffset, + verticalOffset; + + if ( pos.length === 1) { + pos = rhorizontal.test( pos[ 0 ] ) ? + pos.concat( [ "center" ] ) : + rvertical.test( pos[ 0 ] ) ? + [ "center" ].concat( pos ) : + [ "center", "center" ]; + } + pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; + pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; + + // calculate offsets + horizontalOffset = roffset.exec( pos[ 0 ] ); + verticalOffset = roffset.exec( pos[ 1 ] ); + offsets[ this ] = [ + horizontalOffset ? horizontalOffset[ 0 ] : 0, + verticalOffset ? verticalOffset[ 0 ] : 0 + ]; + + // reduce to just the positions without the offsets + options[ this ] = [ + rposition.exec( pos[ 0 ] )[ 0 ], + rposition.exec( pos[ 1 ] )[ 0 ] + ]; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + if ( options.at[ 0 ] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[ 0 ] === "center" ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[ 1 ] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[ 1 ] === "center" ) { + basePosition.top += targetHeight / 2; + } + + atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); + basePosition.left += atOffset[ 0 ]; + basePosition.top += atOffset[ 1 ]; + + return this.each(function() { + var collisionPosition, using, + elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseCss( this, "marginLeft" ), + marginTop = parseCss( this, "marginTop" ), + collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, + collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, + position = $.extend( {}, basePosition ), + myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); + + if ( options.my[ 0 ] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[ 0 ] === "center" ) { + position.left -= elemWidth / 2; + } + + if ( options.my[ 1 ] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[ 1 ] === "center" ) { + position.top -= elemHeight / 2; + } + + position.left += myOffset[ 0 ]; + position.top += myOffset[ 1 ]; + + // if the browser doesn't support fractions, then round for consistent results + if ( !$.support.offsetFractions ) { + position.left = round( position.left ); + position.top = round( position.top ); + } + + collisionPosition = { + marginLeft: marginLeft, + marginTop: marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[ i ] ] ) { + $.ui.position[ collision[ i ] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], + my: options.my, + at: options.at, + within: within, + elem : elem + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + + if ( options.using ) { + // adds feedback as second argument to using callback, if present + using = function( props ) { + var left = targetOffset.left - position.left, + right = left + targetWidth - elemWidth, + top = targetOffset.top - position.top, + bottom = top + targetHeight - elemHeight, + feedback = { + target: { + element: target, + left: targetOffset.left, + top: targetOffset.top, + width: targetWidth, + height: targetHeight + }, + element: { + element: elem, + left: position.left, + top: position.top, + width: elemWidth, + height: elemHeight + }, + horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", + vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" + }; + if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { + feedback.horizontal = "center"; + } + if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { + feedback.vertical = "middle"; + } + if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { + feedback.important = "horizontal"; + } else { + feedback.important = "vertical"; + } + options.using.call( this, props, feedback ); + }; + } + + elem.offset( $.extend( position, { using: using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, + outerWidth = within.width, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = withinOffset - collisionPosLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, + newOverRight; + + // element is wider than within + if ( data.collisionWidth > outerWidth ) { + // element is initially over the left side of within + if ( overLeft > 0 && overRight <= 0 ) { + newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; + position.left += overLeft - newOverRight; + // element is initially over right side of within + } else if ( overRight > 0 && overLeft <= 0 ) { + position.left = withinOffset; + // element is initially over both left and right sides of within + } else { + if ( overLeft > overRight ) { + position.left = withinOffset + outerWidth - data.collisionWidth; + } else { + position.left = withinOffset; + } + } + // too far left -> align with left edge + } else if ( overLeft > 0 ) { + position.left += overLeft; + // too far right -> align with right edge + } else if ( overRight > 0 ) { + position.left -= overRight; + // adjust based on position and margin + } else { + position.left = max( position.left - collisionPosLeft, position.left ); + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollTop : within.offset.top, + outerHeight = data.within.height, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = withinOffset - collisionPosTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, + newOverBottom; + + // element is taller than within + if ( data.collisionHeight > outerHeight ) { + // element is initially over the top of within + if ( overTop > 0 && overBottom <= 0 ) { + newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; + position.top += overTop - newOverBottom; + // element is initially over bottom of within + } else if ( overBottom > 0 && overTop <= 0 ) { + position.top = withinOffset; + // element is initially over both top and bottom of within + } else { + if ( overTop > overBottom ) { + position.top = withinOffset + outerHeight - data.collisionHeight; + } else { + position.top = withinOffset; + } + } + // too far up -> align with top + } else if ( overTop > 0 ) { + position.top += overTop; + // too far down -> align with bottom edge + } else if ( overBottom > 0 ) { + position.top -= overBottom; + // adjust based on position and margin + } else { + position.top = max( position.top - collisionPosTop, position.top ); + } + } + }, + flip: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.offset.left + within.scrollLeft, + outerWidth = within.width, + offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = collisionPosLeft - offsetLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + data.at[ 0 ] === "right" ? + -data.targetWidth : + 0, + offset = -2 * data.offset[ 0 ], + newOverRight, + newOverLeft; + + if ( overLeft < 0 ) { + newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; + if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { + position.left += myOffset + atOffset + offset; + } + } + else if ( overRight > 0 ) { + newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; + if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { + position.left += myOffset + atOffset + offset; + } + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.offset.top + within.scrollTop, + outerHeight = within.height, + offsetTop = within.isWindow ? within.scrollTop : within.offset.top, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = collisionPosTop - offsetTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, + top = data.my[ 1 ] === "top", + myOffset = top ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + data.at[ 1 ] === "bottom" ? + -data.targetHeight : + 0, + offset = -2 * data.offset[ 1 ], + newOverTop, + newOverBottom; + if ( overTop < 0 ) { + newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; + if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) { + position.top += myOffset + atOffset + offset; + } + } + else if ( overBottom > 0 ) { + newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; + if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) { + position.top += myOffset + atOffset + offset; + } + } + } + }, + flipfit: { + left: function() { + $.ui.position.flip.left.apply( this, arguments ); + $.ui.position.fit.left.apply( this, arguments ); + }, + top: function() { + $.ui.position.flip.top.apply( this, arguments ); + $.ui.position.fit.top.apply( this, arguments ); + } + } +}; + +// fraction support test +(function () { + var testElement, testElementParent, testElementStyle, offsetLeft, i, + body = document.getElementsByTagName( "body" )[ 0 ], + div = document.createElement( "div" ); + + //Create a "fake body" for testing based on method used in jQuery.support + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + $.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || document.documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + div.style.cssText = "position: absolute; left: 10.7432222px;"; + + offsetLeft = $( div ).offset().left; + $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11; + + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); +})(); + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + // offset option + (function( $ ) { + var _position = $.fn.position; + $.fn.position = function( options ) { + if ( !options || !options.offset ) { + return _position.call( this, options ); + } + var offset = options.offset.split( " " ), + at = options.at.split( " " ); + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + if ( /^\d/.test( offset[ 0 ] ) ) { + offset[ 0 ] = "+" + offset[ 0 ]; + } + if ( /^\d/.test( offset[ 1 ] ) ) { + offset[ 1 ] = "+" + offset[ 1 ]; + } + if ( at.length === 1 ) { + if ( /left|center|right/.test( at[ 0 ] ) ) { + at[ 1 ] = "center"; + } else { + at[ 1 ] = at[ 0 ]; + at[ 0 ] = "center"; + } + } + return _position.call( this, $.extend( options, { + at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ], + offset: undefined + } ) ); + }; + }( jQuery ) ); +} + +}( jQuery ) ); +(function( $, undefined ) { + +$.widget("ui.draggable", $.ui.mouse, { + version: "1.9.1", + widgetEventPrefix: "drag", + options: { + addClasses: true, + appendTo: "parent", + axis: false, + connectToSortable: false, + containment: false, + cursor: "auto", + cursorAt: false, + grid: false, + handle: false, + helper: "original", + iframeFix: false, + opacity: false, + refreshPositions: false, + revert: false, + revertDuration: 500, + scope: "default", + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + snap: false, + snapMode: "both", + snapTolerance: 20, + stack: false, + zIndex: false + }, + _create: function() { + + if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) + this.element[0].style.position = 'relative'; + + (this.options.addClasses && this.element.addClass("ui-draggable")); + (this.options.disabled && this.element.addClass("ui-draggable-disabled")); + + this._mouseInit(); + + }, + + _destroy: function() { + this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); + this._mouseDestroy(); + }, + + _mouseCapture: function(event) { + + var o = this.options; + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) + return false; + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) + return false; + + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('
    ') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + + return true; + + }, + + _mouseStart: function(event) { + + var o = this.options; + + //Create and append the visible helper + this.helper = this._createHelper(event); + + this.helper.addClass("ui-draggable-dragging"); + + //Cache the helper size + this._cacheHelperProportions(); + + //If ddmanager is used for droppables, set the global draggable + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Store the helper's css position + this.cssPosition = this.helper.css("position"); + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.positionAbs = this.element.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this.position = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + //Trigger event + callbacks + if(this._trigger("start", event) === false) { + this._clear(); + return false; + } + + //Recache the helper size + this._cacheHelperProportions(); + + //Prepare the droppable offsets + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position + + //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) + if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event); + + return true; + }, + + _mouseDrag: function(event, noPropagation) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + if (!noPropagation) { + var ui = this._uiHash(); + if(this._trigger('drag', event, ui) === false) { + this._mouseUp({}); + return false; + } + this.position = ui.position; + } + + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + return false; + }, + + _mouseStop: function(event) { + + //If we are using droppables, inform the manager about the drop + var dropped = false; + if ($.ui.ddmanager && !this.options.dropBehaviour) + dropped = $.ui.ddmanager.drop(this, event); + + //if a drop comes from outside (a sortable) + if(this.dropped) { + dropped = this.dropped; + this.dropped = false; + } + + //if the original element is no longer in the DOM don't bother to continue (see #8269) + var element = this.element[0], elementInDom = false; + while ( element && (element = element.parentNode) ) { + if (element == document ) { + elementInDom = true; + } + } + if ( !elementInDom && this.options.helper === "original" ) + return false; + + if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { + var that = this; + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { + if(that._trigger("stop", event) !== false) { + that._clear(); + } + }); + } else { + if(this._trigger("stop", event) !== false) { + this._clear(); + } + } + + return false; + }, + + _mouseUp: function(event) { + //Remove frame helpers + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); + }); + + //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) + if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event); + + return $.ui.mouse.prototype._mouseUp.call(this, event); + }, + + cancel: function() { + + if(this.helper.is(".ui-draggable-dragging")) { + this._mouseUp({}); + } else { + this._clear(); + } + + return this; + + }, + + _getHandle: function(event) { + + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; + $(this.options.handle, this.element) + .find("*") + .andSelf() + .each(function() { + if(this == event.target) handle = true; + }); + + return handle; + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element); + + if(!helper.parents('body').length) + helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); + + if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) + helper.css("position", "absolute"); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.element.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.element.css("marginLeft"),10) || 0), + top: (parseInt(this.element.css("marginTop"),10) || 0), + right: (parseInt(this.element.css("marginRight"),10) || 0), + bottom: (parseInt(this.element.css("marginBottom"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, + o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, + (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { + var c = $(o.containment); + var ce = c[0]; if(!ce) return; + var co = c.offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0), + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0), + (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, + (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom + ]; + this.relative_container = c; + + } else if(o.containment.constructor == Array) { + this.containment = o.containment; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + var containment; + if(this.containment) { + if (this.relative_container){ + var co = this.relative_container.offset(); + containment = [ this.containment[0] + co.left, + this.containment[1] + co.top, + this.containment[2] + co.left, + this.containment[3] + co.top ]; + } + else { + containment = this.containment; + } + + if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top; + } + + if(o.grid) { + //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950) + var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; + pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; + pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); + //if($.ui.ddmanager) $.ui.ddmanager.current = null; + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + + _trigger: function(type, event, ui) { + ui = ui || this._uiHash(); + $.ui.plugin.call(this, type, [event, ui]); + if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins + return $.Widget.prototype._trigger.call(this, type, event, ui); + }, + + plugins: {}, + + _uiHash: function(event) { + return { + helper: this.helper, + position: this.position, + originalPosition: this.originalPosition, + offset: this.positionAbs + }; + } + +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options, + uiSortable = $.extend({}, ui, { item: inst.element }); + inst.sortables = []; + $(o.connectToSortable).each(function() { + var sortable = $.data(this, 'sortable'); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page). + sortable._trigger("activate", event, uiSortable); + } + }); + + }, + stop: function(event, ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("draggable"), + uiSortable = $.extend({}, ui, { item: inst.element }); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + + this.instance.isOver = 0; + + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' + if(this.shouldRevert) this.instance.options.revert = true; + + //Trigger the stop of the sortable + this.instance._mouseStop(event); + + this.instance.options.helper = this.instance.options._helper; + + //If the helper has been the original item, restore properties in the sortable + if(inst.options.helper == 'original') + this.instance.currentItem.css({ top: 'auto', left: 'auto' }); + + } else { + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance + this.instance._trigger("deactivate", event, uiSortable); + } + + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), that = this; + + var checkPos = function(o) { + var dyClick = this.offset.click.top, dxClick = this.offset.click.left; + var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; + var itemHeight = o.height, itemWidth = o.width; + var itemTop = o.top, itemLeft = o.left; + + return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); + }; + + $.each(inst.sortables, function(i) { + + var innermostIntersecting = false; + var thisSortable = this; + //Copy over some variables to allow calling the sortable's native _intersectsWith + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + + if(this.instance._intersectsWith(this.instance.containerCache)) { + innermostIntersecting = true; + $.each(inst.sortables, function () { + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + if (this != thisSortable + && this.instance._intersectsWith(this.instance.containerCache) + && $.ui.contains(thisSortable.instance.element[0], this.instance.element[0])) + innermostIntersecting = false; + return innermostIntersecting; + }); + } + + + if(innermostIntersecting) { + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + + this.instance.isOver = 1; + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(that).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + event.target = this.instance.currentItem[0]; + this.instance._mouseCapture(event, true); + this.instance._mouseStart(event, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst._trigger("toSortable", event); + inst.dropped = this.instance.element; //draggable revert needs that + //hack so receive/update callbacks work (mostly) + inst.currentItem = inst.element; + this.instance.fromOutside = inst; + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) this.instance._mouseDrag(event); + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + + //Prevent reverting on this forced stop + this.instance.options.revert = false; + + // The out event needs to be triggered independently + this.instance._trigger('out', event, this.instance._uiHash(this.instance)); + + this.instance._mouseStop(event, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + if(this.instance.placeholder) this.instance.placeholder.remove(); + + inst._trigger("fromSortable", event); + inst.dropped = false; //draggable revert needs that + } + + }; + + }); + + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function(event, ui) { + var t = $('body'), o = $(this).data('draggable').options; + if (t.css("cursor")) o._cursor = t.css("cursor"); + t.css("cursor", o.cursor); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if (o._cursor) $('body').css("cursor", o._cursor); + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data('draggable').options; + if(t.css("opacity")) o._opacity = t.css("opacity"); + t.css('opacity', o.opacity); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if(o._opacity) $(ui.helper).css('opacity', o._opacity); + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function(event, ui) { + var i = $(this).data("draggable"); + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); + }, + drag: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options, scrolled = false; + + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { + + if(!o.axis || o.axis != 'x') { + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; + } + + if(!o.axis || o.axis != 'y') { + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; + } + + } else { + + if(!o.axis || o.axis != 'x') { + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(!o.axis || o.axis != 'y') { + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(i, event); + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options; + i.snapElements = []; + + $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { + var $t = $(this); var $o = $t.offset(); + if(this != i.element[0]) i.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options; + var d = o.snapTolerance; + + var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; + + for (var i = inst.snapElements.length - 1; i >= 0; i--){ + + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; + + //Yes, I know, this is insane ;) + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { + if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = false; + continue; + } + + if(o.snapMode != 'inner') { + var ts = Math.abs(t - y2) <= d; + var bs = Math.abs(b - y1) <= d; + var ls = Math.abs(l - x2) <= d; + var rs = Math.abs(r - x1) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; + } + + var first = (ts || bs || ls || rs); + + if(o.snapMode != 'outer') { + var ts = Math.abs(t - y1) <= d; + var bs = Math.abs(b - y2) <= d; + var ls = Math.abs(l - x1) <= d; + var rs = Math.abs(r - x2) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; + } + + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); + + }; + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function(event, ui) { + + var o = $(this).data("draggable").options; + + var group = $.makeArray($(o.stack)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); + }); + if (!group.length) { return; } + + var min = parseInt(group[0].style.zIndex) || 0; + $(group).each(function(i) { + this.style.zIndex = min + i; + }); + + this[0].style.zIndex = min + group.length; + + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("draggable").options; + if(t.css("zIndex")) o._zIndex = t.css("zIndex"); + t.css('zIndex', o.zIndex); + }, + stop: function(event, ui) { + var o = $(this).data("draggable").options; + if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); + } +}); + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.droppable", { + version: "1.9.1", + widgetEventPrefix: "drop", + options: { + accept: '*', + activeClass: false, + addClasses: true, + greedy: false, + hoverClass: false, + scope: 'default', + tolerance: 'intersect' + }, + _create: function() { + + var o = this.options, accept = o.accept; + this.isover = 0; this.isout = 1; + + this.accept = $.isFunction(accept) ? accept : function(d) { + return d.is(accept); + }; + + //Store the droppable's proportions + this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; + + // Add the reference and positions to the manager + $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; + $.ui.ddmanager.droppables[o.scope].push(this); + + (o.addClasses && this.element.addClass("ui-droppable")); + + }, + + _destroy: function() { + var drop = $.ui.ddmanager.droppables[this.options.scope]; + for ( var i = 0; i < drop.length; i++ ) + if ( drop[i] == this ) + drop.splice(i, 1); + + this.element.removeClass("ui-droppable ui-droppable-disabled"); + }, + + _setOption: function(key, value) { + + if(key == 'accept') { + this.accept = $.isFunction(value) ? value : function(d) { + return d.is(value); + }; + } + $.Widget.prototype._setOption.apply(this, arguments); + }, + + _activate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.addClass(this.options.activeClass); + (draggable && this._trigger('activate', event, this.ui(draggable))); + }, + + _deactivate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + (draggable && this._trigger('deactivate', event, this.ui(draggable))); + }, + + _over: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.addClass(this.options.hoverClass); + this._trigger('over', event, this.ui(draggable)); + } + + }, + + _out: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('out', event, this.ui(draggable)); + } + + }, + + _drop: function(event,custom) { + + var draggable = custom || $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element + + var childrenIntersection = false; + this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, 'droppable'); + if( + inst.options.greedy + && !inst.options.disabled + && inst.options.scope == draggable.options.scope + && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) + && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance) + ) { childrenIntersection = true; return false; } + }); + if(childrenIntersection) return false; + + if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('drop', event, this.ui(draggable)); + return this.element; + } + + return false; + + }, + + ui: function(c) { + return { + draggable: (c.currentItem || c.element), + helper: c.helper, + position: c.position, + offset: c.positionAbs + }; + } + +}); + +$.ui.intersect = function(draggable, droppable, toleranceMode) { + + if (!droppable.offset) return false; + + var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, + y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height; + var l = droppable.offset.left, r = l + droppable.proportions.width, + t = droppable.offset.top, b = t + droppable.proportions.height; + + switch (toleranceMode) { + case 'fit': + return (l <= x1 && x2 <= r + && t <= y1 && y2 <= b); + break; + case 'intersect': + return (l < x1 + (draggable.helperProportions.width / 2) // Right Half + && x2 - (draggable.helperProportions.width / 2) < r // Left Half + && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half + && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half + break; + case 'pointer': + var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left), + draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top), + isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width); + return isOver; + break; + case 'touch': + return ( + (y1 >= t && y1 <= b) || // Top edge touching + (y2 >= t && y2 <= b) || // Bottom edge touching + (y1 < t && y2 > b) // Surrounded vertically + ) && ( + (x1 >= l && x1 <= r) || // Left edge touching + (x2 >= l && x2 <= r) || // Right edge touching + (x1 < l && x2 > r) // Surrounded horizontally + ); + break; + default: + return false; + break; + } + +}; + +/* + This manager tracks offsets of draggables and droppables +*/ +$.ui.ddmanager = { + current: null, + droppables: { 'default': [] }, + prepareOffsets: function(t, event) { + + var m = $.ui.ddmanager.droppables[t.options.scope] || []; + var type = event ? event.type : null; // workaround for #2317 + var list = (t.currentItem || t.element).find(":data(droppable)").andSelf(); + + droppablesLoop: for (var i = 0; i < m.length; i++) { + + if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted + for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item + m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue + + if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables + + m[i].offset = m[i].element.offset(); + m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight }; + + } + + }, + drop: function(draggable, event) { + + var dropped = false; + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(!this.options) return; + if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) + dropped = this._drop.call(this, event) || dropped; + + if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + this.isout = 1; this.isover = 0; + this._deactivate.call(this, event); + } + + }); + return dropped; + + }, + dragStart: function( draggable, event ) { + //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) + draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() { + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + }); + }, + drag: function(draggable, event) { + + //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. + if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event); + + //Run through all droppables and check their positions based on specific tolerance options + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(this.options.disabled || this.greedyChild || !this.visible) return; + var intersects = $.ui.intersect(draggable, this, this.options.tolerance); + + var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null); + if(!c) return; + + var parentInstance; + if (this.options.greedy) { + // find droppable parents with same scope + var scope = this.options.scope; + var parent = this.element.parents(':data(droppable)').filter(function () { + return $.data(this, 'droppable').options.scope === scope; + }); + + if (parent.length) { + parentInstance = $.data(parent[0], 'droppable'); + parentInstance.greedyChild = (c == 'isover' ? 1 : 0); + } + } + + // we just moved into a greedy child + if (parentInstance && c == 'isover') { + parentInstance['isover'] = 0; + parentInstance['isout'] = 1; + parentInstance._out.call(parentInstance, event); + } + + this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0; + this[c == "isover" ? "_over" : "_out"].call(this, event); + + // we just moved out of a greedy child + if (parentInstance && c == 'isout') { + parentInstance['isout'] = 0; + parentInstance['isover'] = 1; + parentInstance._over.call(parentInstance, event); + } + }); + + }, + dragStop: function( draggable, event ) { + draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" ); + //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + } +}; + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.resizable", $.ui.mouse, { + version: "1.9.1", + widgetEventPrefix: "resize", + options: { + alsoResize: false, + animate: false, + animateDuration: "slow", + animateEasing: "swing", + aspectRatio: false, + autoHide: false, + containment: false, + ghost: false, + grid: false, + handles: "e,s,se", + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + zIndex: 1000 + }, + _create: function() { + + var that = this, o = this.options; + this.element.addClass("ui-resizable"); + + $.extend(this, { + _aspectRatio: !!(o.aspectRatio), + aspectRatio: o.aspectRatio, + originalElement: this.element, + _proportionallyResizeElements: [], + _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null + }); + + //Wrap the element if it cannot hold child nodes + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { + + //Create a wrapper element and set the wrapper to the new current internal element + this.element.wrap( + $('
    ').css({ + position: this.element.css('position'), + width: this.element.outerWidth(), + height: this.element.outerHeight(), + top: this.element.css('top'), + left: this.element.css('left') + }) + ); + + //Overwrite the original this.element + this.element = this.element.parent().data( + "resizable", this.element.data('resizable') + ); + + this.elementIsWrapper = true; + + //Move margins to the wrapper + this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); + this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); + + //Prevent Safari textarea resize + this.originalResizeStyle = this.originalElement.css('resize'); + this.originalElement.css('resize', 'none'); + + //Push the actual element to our proportionallyResize internal array + this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); + + // avoid IE jump (hard set the margin) + this.originalElement.css({ margin: this.originalElement.css('margin') }); + + // fix handlers offset + this._proportionallyResize(); + + } + + this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); + if(this.handles.constructor == String) { + + if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; + var n = this.handles.split(","); this.handles = {}; + + for(var i = 0; i < n.length; i++) { + + var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; + var axis = $('
    '); + + // Apply zIndex to all handles - see #7960 + axis.css({ zIndex: o.zIndex }); + + //TODO : What's going on here? + if ('se' == handle) { + axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); + }; + + //Insert into internal handles object and append to element + this.handles[handle] = '.ui-resizable-'+handle; + this.element.append(axis); + } + + } + + this._renderAxis = function(target) { + + target = target || this.element; + + for(var i in this.handles) { + + if(this.handles[i].constructor == String) + this.handles[i] = $(this.handles[i], this.element).show(); + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { + + var axis = $(this.handles[i], this.element), padWrapper = 0; + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + var padPos = [ 'padding', + /ne|nw|n/.test(i) ? 'Top' : + /se|sw|s/.test(i) ? 'Bottom' : + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); + + target.css(padPos, padWrapper); + + this._proportionallyResize(); + + } + + //TODO: What's that good for? There's not anything to be executed left + if(!$(this.handles[i]).length) + continue; + + } + }; + + //TODO: make renderAxis a prototype function + this._renderAxis(this.element); + + this._handles = $('.ui-resizable-handle', this.element) + .disableSelection(); + + //Matching axis name + this._handles.mouseover(function() { + if (!that.resizing) { + if (this.className) + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + //Axis, default = se + that.axis = axis && axis[1] ? axis[1] : 'se'; + } + }); + + //If we want to auto hide the elements + if (o.autoHide) { + this._handles.hide(); + $(this.element) + .addClass("ui-resizable-autohide") + .mouseenter(function() { + if (o.disabled) return; + $(this).removeClass("ui-resizable-autohide"); + that._handles.show(); + }) + .mouseleave(function(){ + if (o.disabled) return; + if (!that.resizing) { + $(this).addClass("ui-resizable-autohide"); + that._handles.hide(); + } + }); + } + + //Initialize the mouse interaction + this._mouseInit(); + + }, + + _destroy: function() { + + this._mouseDestroy(); + + var _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") + .removeData("resizable").removeData("ui-resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); + }; + + //TODO: Unwrap at same DOM position + if (this.elementIsWrapper) { + _destroy(this.element); + var wrapper = this.element; + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }).insertAfter( wrapper ); + wrapper.remove(); + } + + this.originalElement.css('resize', this.originalResizeStyle); + _destroy(this.originalElement); + + return this; + }, + + _mouseCapture: function(event) { + var handle = false; + for (var i in this.handles) { + if ($(this.handles[i])[0] == event.target) { + handle = true; + } + } + + return !this.options.disabled && handle; + }, + + _mouseStart: function(event) { + + var o = this.options, iniPos = this.element.position(), el = this.element; + + this.resizing = true; + this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; + + // bugfix for http://dev.jquery.com/ticket/1749 + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { + el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); + } + + this._renderProxy(); + + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); + + if (o.containment) { + curleft += $(o.containment).scrollLeft() || 0; + curtop += $(o.containment).scrollTop() || 0; + } + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: event.pageX, top: event.pageY }; + + //Aspect Ratio + this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); + + var cursor = $('.ui-resizable-' + this.axis).css('cursor'); + $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); + + el.addClass("ui-resizable-resizing"); + this._propagate("start", event); + return true; + }, + + _mouseDrag: function(event) { + + //Increase performance, avoid regex + var el = this.helper, o = this.options, props = {}, + that = this, smp = this.originalMousePosition, a = this.axis; + + var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; + var trigger = this._change[a]; + if (!trigger) return false; + + // Calculate the attrs that will be change + var data = trigger.apply(this, [event, dx, dy]); + + // Put this in the mouseDrag handler since the user can start pressing shift while resizing + this._updateVirtualBoundaries(event.shiftKey); + if (this._aspectRatio || event.shiftKey) + data = this._updateRatio(data, event); + + data = this._respectSize(data, event); + + // plugins callbacks need to be called first + this._propagate("resize", event); + + el.css({ + top: this.position.top + "px", left: this.position.left + "px", + width: this.size.width + "px", height: this.size.height + "px" + }); + + if (!this._helper && this._proportionallyResizeElements.length) + this._proportionallyResize(); + + this._updateCache(data); + + // calling the user callback at the end + this._trigger('resize', event, this.ui()); + + return false; + }, + + _mouseStop: function(event) { + + this.resizing = false; + var o = this.options, that = this; + + if(this._helper) { + var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height, + soffsetw = ista ? 0 : that.sizeDiff.width; + + var s = { width: (that.helper.width() - soffsetw), height: (that.helper.height() - soffseth) }, + left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null, + top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null; + + if (!o.animate) + this.element.css($.extend(s, { top: top, left: left })); + + that.helper.height(that.size.height); + that.helper.width(that.size.width); + + if (this._helper && !o.animate) this._proportionallyResize(); + } + + $('body').css('cursor', 'auto'); + + this.element.removeClass("ui-resizable-resizing"); + + this._propagate("stop", event); + + if (this._helper) this.helper.remove(); + return false; + + }, + + _updateVirtualBoundaries: function(forceAspectRatio) { + var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b; + + b = { + minWidth: isNumber(o.minWidth) ? o.minWidth : 0, + maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity, + minHeight: isNumber(o.minHeight) ? o.minHeight : 0, + maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity + }; + + if(this._aspectRatio || forceAspectRatio) { + // We want to create an enclosing box whose aspect ration is the requested one + // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension + pMinWidth = b.minHeight * this.aspectRatio; + pMinHeight = b.minWidth / this.aspectRatio; + pMaxWidth = b.maxHeight * this.aspectRatio; + pMaxHeight = b.maxWidth / this.aspectRatio; + + if(pMinWidth > b.minWidth) b.minWidth = pMinWidth; + if(pMinHeight > b.minHeight) b.minHeight = pMinHeight; + if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth; + if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight; + } + this._vBoundaries = b; + }, + + _updateCache: function(data) { + var o = this.options; + this.offset = this.helper.offset(); + if (isNumber(data.left)) this.position.left = data.left; + if (isNumber(data.top)) this.position.top = data.top; + if (isNumber(data.height)) this.size.height = data.height; + if (isNumber(data.width)) this.size.width = data.width; + }, + + _updateRatio: function(data, event) { + + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + + if (isNumber(data.height)) data.width = (data.height * this.aspectRatio); + else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio); + + if (a == 'sw') { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a == 'nw') { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + + _respectSize: function(data, event) { + + var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + + if (isminw) data.width = o.minWidth; + if (isminh) data.height = o.minHeight; + if (ismaxw) data.width = o.maxWidth; + if (ismaxh) data.height = o.maxHeight; + + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + + if (isminw && cw) data.left = dw - o.minWidth; + if (ismaxw && cw) data.left = dw - o.maxWidth; + if (isminh && ch) data.top = dh - o.minHeight; + if (ismaxh && ch) data.top = dh - o.maxHeight; + + // fixing jump error on top/left - bug #2330 + var isNotwh = !data.width && !data.height; + if (isNotwh && !data.left && data.top) data.top = null; + else if (isNotwh && !data.top && data.left) data.left = null; + + return data; + }, + + _proportionallyResize: function() { + + var o = this.options; + if (!this._proportionallyResizeElements.length) return; + var element = this.helper || this.element; + + for (var i=0; i < this._proportionallyResizeElements.length; i++) { + + var prel = this._proportionallyResizeElements[i]; + + if (!this.borderDif) { + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; + + this.borderDif = $.map(b, function(v, i) { + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; + return border + padding; + }); + } + + prel.css({ + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 + }); + + }; + + }, + + _renderProxy: function() { + + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(this._helper) { + + this.helper = this.helper || $('
    '); + + // fix ie6 offset TODO: This seems broken + var ie6offset = ($.ui.ie6 ? 1 : 0), + pxyoffset = ( $.ui.ie6 ? 2 : -1 ); + + this.helper.addClass(this._helper).css({ + width: this.element.outerWidth() + pxyoffset, + height: this.element.outerHeight() + pxyoffset, + position: 'absolute', + left: this.elementOffset.left - ie6offset +'px', + top: this.elementOffset.top - ie6offset +'px', + zIndex: ++o.zIndex //TODO: Don't modify option + }); + + this.helper + .appendTo("body") + .disableSelection(); + + } else { + this.helper = this.element; + } + + }, + + _change: { + e: function(event, dx, dy) { + return { width: this.originalSize.width + dx }; + }, + w: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(event, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + sw: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + }, + ne: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + nw: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + } + }, + + _propagate: function(n, event) { + $.ui.plugin.call(this, n, [event, this.ui()]); + (n != "resize" && this._trigger(n, event, this.ui())); + }, + + plugins: {}, + + ui: function() { + return { + originalElement: this.originalElement, + element: this.element, + helper: this.helper, + position: this.position, + size: this.size, + originalSize: this.originalSize, + originalPosition: this.originalPosition + }; + } + +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function (event, ui) { + var that = $(this).data("resizable"), o = that.options; + + var _store = function (exp) { + $(exp).each(function() { + var el = $(this); + el.data("resizable-alsoresize", { + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), + left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10) + }); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } + else { $.each(o.alsoResize, function (exp) { _store(exp); }); } + }else{ + _store(o.alsoResize); + } + }, + + resize: function (event, ui) { + var that = $(this).data("resizable"), o = that.options, os = that.originalSize, op = that.originalPosition; + + var delta = { + height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0, + top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0 + }, + + _alsoResize = function (exp, c) { + $(exp).each(function() { + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; + + $.each(css, function (i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) + style[prop] = sum || null; + }); + + el.css(style); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function (event, ui) { + $(this).removeData("resizable-alsoresize"); + } +}); + +$.ui.plugin.add("resizable", "animate", { + + stop: function(event, ui) { + var that = $(this).data("resizable"), o = that.options; + + var pr = that._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height, + soffsetw = ista ? 0 : that.sizeDiff.width; + + var style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) }, + left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null, + top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null; + + that.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration, + easing: o.animateEasing, + step: function() { + + var data = { + width: parseInt(that.element.css('width'), 10), + height: parseInt(that.element.css('height'), 10), + top: parseInt(that.element.css('top'), 10), + left: parseInt(that.element.css('left'), 10) + }; + + if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); + + // propagating resize, and updating values for each animation step + that._updateCache(data); + that._propagate("resize", event); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "containment", { + + start: function(event, ui) { + var that = $(this).data("resizable"), o = that.options, el = that.element; + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + if (!ce) return; + + that.containerElement = $(ce); + + if (/document/.test(oc) || oc == document) { + that.containerOffset = { left: 0, top: 0 }; + that.containerPosition = { left: 0, top: 0 }; + + that.parentData = { + element: $(document), left: 0, top: 0, + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else { + var element = $(ce), p = []; + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); + + that.containerOffset = element.offset(); + that.containerPosition = element.position(); + that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; + + var co = that.containerOffset, ch = that.containerSize.height, cw = that.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + that.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function(event, ui) { + var that = $(this).data("resizable"), o = that.options, + ps = that.containerSize, co = that.containerOffset, cs = that.size, cp = that.position, + pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement; + + if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; + + if (cp.left < (that._helper ? co.left : 0)) { + that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left)); + if (pRatio) that.size.height = that.size.width / that.aspectRatio; + that.position.left = o.helper ? co.left : 0; + } + + if (cp.top < (that._helper ? co.top : 0)) { + that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top); + if (pRatio) that.size.width = that.size.height * that.aspectRatio; + that.position.top = that._helper ? co.top : 0; + } + + that.offset.left = that.parentData.left+that.position.left; + that.offset.top = that.parentData.top+that.position.top; + + var woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width ), + hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height ); + + var isParent = that.containerElement.get(0) == that.element.parent().get(0), + isOffsetRelative = /relative|absolute/.test(that.containerElement.css('position')); + + if(isParent && isOffsetRelative) woset -= that.parentData.left; + + if (woset + that.size.width >= that.parentData.width) { + that.size.width = that.parentData.width - woset; + if (pRatio) that.size.height = that.size.width / that.aspectRatio; + } + + if (hoset + that.size.height >= that.parentData.height) { + that.size.height = that.parentData.height - hoset; + if (pRatio) that.size.width = that.size.height * that.aspectRatio; + } + }, + + stop: function(event, ui){ + var that = $(this).data("resizable"), o = that.options, cp = that.position, + co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement; + + var helper = $(that.helper), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height; + + if (that._helper && !o.animate && (/relative/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + if (that._helper && !o.animate && (/static/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + } +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function(event, ui) { + + var that = $(this).data("resizable"), o = that.options, cs = that.size; + + that.ghost = that.originalElement.clone(); + that.ghost + .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .addClass('ui-resizable-ghost') + .addClass(typeof o.ghost == 'string' ? o.ghost : ''); + + that.ghost.appendTo(that.helper); + + }, + + resize: function(event, ui){ + var that = $(this).data("resizable"), o = that.options; + if (that.ghost) that.ghost.css({ position: 'relative', height: that.size.height, width: that.size.width }); + }, + + stop: function(event, ui){ + var that = $(this).data("resizable"), o = that.options; + if (that.ghost && that.helper) that.helper.get(0).removeChild(that.ghost.get(0)); + } + +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function(event, ui) { + var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, ratio = o._aspectRatio || event.shiftKey; + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + + if (/^(se|s|e)$/.test(a)) { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + } + else if (/^(ne)$/.test(a)) { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + that.position.top = op.top - oy; + } + else if (/^(sw)$/.test(a)) { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + that.position.left = op.left - ox; + } + else { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + that.position.top = op.top - oy; + that.position.left = op.left - ox; + } + } + +}); + +var num = function(v) { + return parseInt(v, 10) || 0; +}; + +var isNumber = function(value) { + return !isNaN(parseInt(value, 10)); +}; + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.selectable", $.ui.mouse, { + version: "1.9.1", + options: { + appendTo: 'body', + autoRefresh: true, + distance: 0, + filter: '*', + tolerance: 'touch' + }, + _create: function() { + var that = this; + + this.element.addClass("ui-selectable"); + + this.dragged = false; + + // cache selectee children based on filter + var selectees; + this.refresh = function() { + selectees = $(that.options.filter, that.element[0]); + selectees.addClass("ui-selectee"); + selectees.each(function() { + var $this = $(this); + var pos = $this.offset(); + $.data(this, "selectable-item", { + element: this, + $element: $this, + left: pos.left, + top: pos.top, + right: pos.left + $this.outerWidth(), + bottom: pos.top + $this.outerHeight(), + startselected: false, + selected: $this.hasClass('ui-selected'), + selecting: $this.hasClass('ui-selecting'), + unselecting: $this.hasClass('ui-unselecting') + }); + }); + }; + this.refresh(); + + this.selectees = selectees.addClass("ui-selectee"); + + this._mouseInit(); + + this.helper = $("
    "); + }, + + _destroy: function() { + this.selectees + .removeClass("ui-selectee") + .removeData("selectable-item"); + this.element + .removeClass("ui-selectable ui-selectable-disabled"); + this._mouseDestroy(); + }, + + _mouseStart: function(event) { + var that = this; + + this.opos = [event.pageX, event.pageY]; + + if (this.options.disabled) + return; + + var options = this.options; + + this.selectees = $(options.filter, this.element[0]); + + this._trigger("start", event); + + $(options.appendTo).append(this.helper); + // position helper (lasso) + this.helper.css({ + "left": event.clientX, + "top": event.clientY, + "width": 0, + "height": 0 + }); + + if (options.autoRefresh) { + this.refresh(); + } + + this.selectees.filter('.ui-selected').each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.startselected = true; + if (!event.metaKey && !event.ctrlKey) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + }); + + $(event.target).parents().andSelf().each(function() { + var selectee = $.data(this, "selectable-item"); + if (selectee) { + var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); + selectee.$element + .removeClass(doSelect ? "ui-unselecting" : "ui-selected") + .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); + selectee.unselecting = !doSelect; + selectee.selecting = doSelect; + selectee.selected = doSelect; + // selectable (UN)SELECTING callback + if (doSelect) { + that._trigger("selecting", event, { + selecting: selectee.element + }); + } else { + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + return false; + } + }); + + }, + + _mouseDrag: function(event) { + var that = this; + this.dragged = true; + + if (this.options.disabled) + return; + + var options = this.options; + + var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; + if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } + this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); + + this.selectees.each(function() { + var selectee = $.data(this, "selectable-item"); + //prevent helper from being selected if appendTo: selectable + if (!selectee || selectee.element == that.element[0]) + return; + var hit = false; + if (options.tolerance == 'touch') { + hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); + } else if (options.tolerance == 'fit') { + hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); + } + + if (hit) { + // SELECT + if (selectee.selected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + } + if (selectee.unselecting) { + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + } + if (!selectee.selecting) { + selectee.$element.addClass('ui-selecting'); + selectee.selecting = true; + // selectable SELECTING callback + that._trigger("selecting", event, { + selecting: selectee.element + }); + } + } else { + // UNSELECT + if (selectee.selecting) { + if ((event.metaKey || event.ctrlKey) && selectee.startselected) { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + selectee.$element.addClass('ui-selected'); + selectee.selected = true; + } else { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + if (selectee.startselected) { + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + } + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + if (selectee.selected) { + if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + } + }); + + return false; + }, + + _mouseStop: function(event) { + var that = this; + + this.dragged = false; + + var options = this.options; + + $('.ui-unselecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + selectee.startselected = false; + that._trigger("unselected", event, { + unselected: selectee.element + }); + }); + $('.ui-selecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); + selectee.selecting = false; + selectee.selected = true; + selectee.startselected = true; + that._trigger("selected", event, { + selected: selectee.element + }); + }); + this._trigger("stop", event); + + this.helper.remove(); + + return false; + } + +}); + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.sortable", $.ui.mouse, { + version: "1.9.1", + widgetEventPrefix: "sort", + ready: false, + options: { + appendTo: "parent", + axis: false, + connectWith: false, + containment: false, + cursor: 'auto', + cursorAt: false, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: '> *', + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000 + }, + _create: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are being displayed horizontally + this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false; + + //Let's determine the parent's offset + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this._mouseInit(); + + //We're ready to go + this.ready = true + + }, + + _destroy: function() { + this.element + .removeClass("ui-sortable ui-sortable-disabled"); + this._mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData(this.widgetName + "-item"); + + return this; + }, + + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget().toggleClass( "ui-sortable-disabled", !!value ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + + _mouseCapture: function(event, overrideHandle) { + var that = this; + + if (this.reverting) { + return false; + } + + if(this.options.disabled || this.options.type == 'static') return false; + + //We have to refresh the items data once first + this._refreshItems(event); + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, nodes = $(event.target).parents().each(function() { + if($.data(this, that.widgetName + '-item') == that) { + currentItem = $(this); + return false; + } + }); + if($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target); + + if(!currentItem) return false; + if(this.options.handle && !overrideHandle) { + var validHandle = false; + + $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + this._removeCurrentsFromItems(); + return true; + + }, + + _mouseStart: function(event, overrideHandle, noActivation) { + + var o = this.options; + this.currentContainer = this; + + //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture + this.refreshPositions(); + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Get the next scrolling parent + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.currentItem.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + // Only after we got the offset, we can change the helper's position to absolute + // TODO: Still need to figure out a way to make relative sorting possible + this.helper.css("position", "absolute"); + this.cssPosition = this.helper.css("position"); + + //Generate the original position + this.originalPosition = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; + + //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way + if(this.helper[0] != this.currentItem[0]) { + this.currentItem.hide(); + } + + //Create the placeholder + this._createPlaceholder(); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + if(o.cursor) { // cursor option + if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); + $('body').css("cursor", o.cursor); + } + + if(o.opacity) { // opacity option + if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); + this.helper.css("opacity", o.opacity); + } + + if(o.zIndex) { // zIndex option + if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); + this.helper.css("zIndex", o.zIndex); + } + + //Prepare scrolling + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') + this.overflowOffset = this.scrollParent.offset(); + + //Call callbacks + this._trigger("start", event, this._uiHash()); + + //Recache the helper size + if(!this._preserveHelperProportions) + this._cacheHelperProportions(); + + + //Post 'activate' events to possible containers + if(!noActivation) { + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, this._uiHash(this)); } + } + + //Prepare possible droppables + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.dragging = true; + + this.helper.addClass("ui-sortable-helper"); + this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + }, + + _mouseDrag: function(event) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if(this.options.scroll) { + var o = this.options, scrolled = false; + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { + + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + + } else { + + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper position + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); + if (!intersection) continue; + + // Only put the placeholder inside the current Container, skip all + // items form other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this moving items in "sub-sortables" can cause the placeholder to jitter + // beetween the outer and inner container. + if (item.instance !== this.currentContainer) continue; + + if (itemElement != this.currentItem[0] //cannot intersect with itself + && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before + && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true) + //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container + ) { + + this.direction = intersection == 1 ? "down" : "up"; + + if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { + this._rearrange(event, item); + } else { + break; + } + + this._trigger("change", event, this._uiHash()); + break; + } + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + //Call callbacks + this._trigger('sort', event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event, noPropagation) { + + if(!event) return; + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, event); + + if(this.options.revert) { + var that = this; + var cur = this.placeholder.offset(); + + this.reverting = true; + + $(this.helper).animate({ + left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), + top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) + }, parseInt(this.options.revert, 10) || 500, function() { + that._clear(event); + }); + } else { + this._clear(event, noPropagation); + } + + return false; + + }, + + cancel: function() { + + if(this.dragging) { + + this._mouseUp({ target: null }); + + if(this.options.helper == "original") + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + else + this.currentItem.show(); + + //Post deactivating events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i]._trigger("deactivate", null, this._uiHash(this)); + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", null, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + if (this.placeholder) { + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); + + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } + } + + return this; + + }, + + serialize: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var str = []; o = o || {}; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); + }); + + if(!str.length && o.key) { + str.push(o.key + '='); + } + + return str.join('&'); + + }, + + toArray: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var ret = []; o = o || {}; + + items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); }); + return ret; + + }, + + /* Be careful with the following core functions */ + _intersectsWith: function(item) { + + var x1 = this.positionAbs.left, + x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, + y2 = y1 + this.helperProportions.height; + + var l = item.left, + r = l + item.width, + t = item.top, + b = t + item.height; + + var dyClick = this.offset.click.top, + dxClick = this.offset.click.left; + + var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; + + if( this.options.tolerance == "pointer" + || this.options.forcePointerForContainers + || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) + ) { + return isOverElement; + } else { + + return (l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b ); // Top Half + + } + }, + + _intersectsWithPointer: function(item) { + + var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), + isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), + isOverElement = isOverElementHeight && isOverElementWidth, + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (!isOverElement) + return false; + + return this.floating ? + ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 ) + : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) ); + + }, + + _intersectsWithSides: function(item) { + + var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), + isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf)); + } else { + return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf)); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta != 0 && (delta > 0 ? "down" : "up"); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta != 0 && (delta > 0 ? "right" : "left"); + }, + + refresh: function(event) { + this._refreshItems(event); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor == String + ? [options.connectWith] + : options.connectWith; + }, + + _getItemsAsjQuery: function(connected) { + + var items = []; + var queries = []; + var connectWith = this._connectWith(); + + if(connectWith && connected) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); + } + }; + }; + } + + queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i][0].each(function() { + items.push(this); + }); + }; + + return $(items); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); + + this.items = $.grep(this.items, function (item) { + for (var j=0; j < list.length; j++) { + if(list[j] == item.item[0]) + return false; + }; + return true; + }); + + }, + + _refreshItems: function(event) { + + this.items = []; + this.containers = [this]; + var items = this.items; + var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; + var connectWith = this._connectWith(); + + if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--) { + var targetData = queries[i][1]; + var _queries = queries[i][0]; + + for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { + var item = $(_queries[j]); + + item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager) + + items.push({ + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + }); + }; + }; + + }, + + refreshPositions: function(fast) { + + //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change + if(this.offsetParent && this.helper) { + this.offset.parent = this._getParentOffset(); + } + + for (var i = this.items.length - 1; i >= 0; i--){ + var item = this.items[i]; + + //We ignore calculating positions of all connected containers when we're not over them + if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0]) + continue; + + var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; + + if (!fast) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + var p = t.offset(); + item.left = p.left; + item.top = p.top; + }; + + if(this.options.custom && this.options.custom.refreshContainers) { + this.options.custom.refreshContainers.call(this); + } else { + for (var i = this.containers.length - 1; i >= 0; i--){ + var p = this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + }; + } + + return this; + }, + + _createPlaceholder: function(that) { + that = that || this; + var o = that.options; + + if(!o.placeholder || o.placeholder.constructor == String) { + var className = o.placeholder; + o.placeholder = { + element: function() { + + var el = $(document.createElement(that.currentItem[0].nodeName)) + .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper")[0]; + + if(!className) + el.style.visibility = "hidden"; + + return el; + }, + update: function(container, p) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified + if(className && !o.forcePlaceholderSize) return; + + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item + if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); }; + if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); }; + } + }; + } + + //Create the placeholder + that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); + + //Append it after the actual current item + that.currentItem.after(that.placeholder); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update(that, that.placeholder); + + }, + + _contactContainers: function(event) { + + // get innermost container that intersects with item + var innermostContainer = null, innermostIndex = null; + + + for (var i = this.containers.length - 1; i >= 0; i--){ + + // never consider a container that's located within the item itself + if($.contains(this.currentItem[0], this.containers[i].element[0])) + continue; + + if(this._intersectsWith(this.containers[i].containerCache)) { + + // if we've already found a container and it's more "inner" than this, then continue + if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) + continue; + + innermostContainer = this.containers[i]; + innermostIndex = i; + + } else { + // container doesn't intersect. trigger "out" event if necessary + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", event, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + // if no intersecting containers found, return + if(!innermostContainer) return; + + // move the item into the container if it's not there already + if(this.containers.length === 1) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } else { + + //When entering a new container, we will find the item with the least distance and append our item near it + var dist = 10000; var itemWithLeastDistance = null; + var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top'; + var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height'; + var base = this.positionAbs[posProperty] + this.offset.click[posProperty]; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; + if(this.items[j].item[0] == this.currentItem[0]) continue; + var cur = this.items[j].item.offset()[posProperty]; + var nearBottom = false; + if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){ + nearBottom = true; + cur += this.items[j][sizeProperty]; + } + + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + this.direction = nearBottom ? "up": "down"; + } + } + + if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled + return; + + this.currentContainer = this.containers[innermostIndex]; + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); + this._trigger("change", event, this._uiHash()); + this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + + //Update the placeholder + this.options.placeholder.update(this.currentContainer, this.placeholder); + + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem); + + if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already + $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); + + if(helper[0] == this.currentItem[0]) + this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; + + if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); + if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.currentItem.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { + this.offset.relative = this._getRelativeOffset(); + } + + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _rearrange: function(event, i, a, hardRefresh) { + + a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var counter = this.counter; + + this._delay(function() { + if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove + }); + + }, + + _clear: function(event, noPropagation) { + + this.reverting = false; + // We delay all events that have to be triggered to after the point where the placeholder has been removed and + // everything else normalized again + var delayedTriggers = []; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) + if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem); + this._noFinalSort = null; + + if(this.helper[0] == this.currentItem[0]) { + for(var i in this._storedCSS) { + if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = ''; + } + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); + if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed + + // Check if the items Container has Changed and trigger appropriate + // events. + if (this !== this.currentContainer) { + if(!noPropagation) { + delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + } + } + + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + if(this.containers[i].containerCache.over) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + this.containers[i].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor + if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity + if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index + + this.dragging = false; + if(this.cancelHelperRemoval) { + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return false; + } + + if(!noPropagation) this._trigger("beforeStop", event, this._uiHash()); + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + + if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; + + if(!noPropagation) { + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return true; + + }, + + _trigger: function() { + if ($.Widget.prototype._trigger.apply(this, arguments) === false) { + this.cancel(); + } + }, + + _uiHash: function(_inst) { + var inst = _inst || this; + return { + helper: inst.helper, + placeholder: inst.placeholder || $([]), + position: inst.position, + originalPosition: inst.originalPosition, + offset: inst.positionAbs, + item: inst.currentItem, + sender: _inst ? _inst.element : null + }; + } + +}); + +})(jQuery); +(function( $, undefined ) { + +var uid = 0, + hideProps = {}, + showProps = {}; + +hideProps.height = hideProps.paddingTop = hideProps.paddingBottom = + hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide"; +showProps.height = showProps.paddingTop = showProps.paddingBottom = + showProps.borderTopWidth = showProps.borderBottomWidth = "show"; + +$.widget( "ui.accordion", { + version: "1.9.1", + options: { + active: 0, + animate: {}, + collapsible: false, + event: "click", + header: "> li > :first-child,> :not(li):even", + heightStyle: "auto", + icons: { + activeHeader: "ui-icon-triangle-1-s", + header: "ui-icon-triangle-1-e" + }, + + // callbacks + activate: null, + beforeActivate: null + }, + + _create: function() { + var accordionId = this.accordionId = "ui-accordion-" + + (this.element.attr( "id" ) || ++uid), + options = this.options; + + this.prevShow = this.prevHide = $(); + this.element.addClass( "ui-accordion ui-widget ui-helper-reset" ); + + this.headers = this.element.find( options.header ) + .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" ); + this._hoverable( this.headers ); + this._focusable( this.headers ); + + this.headers.next() + .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ) + .hide(); + + // don't allow collapsible: false and active: false / null + if ( !options.collapsible && (options.active === false || options.active == null) ) { + options.active = 0; + } + // handle negative values + if ( options.active < 0 ) { + options.active += this.headers.length; + } + this.active = this._findActive( options.active ) + .addClass( "ui-accordion-header-active ui-state-active" ) + .toggleClass( "ui-corner-all ui-corner-top" ); + this.active.next() + .addClass( "ui-accordion-content-active" ) + .show(); + + this._createIcons(); + this.refresh(); + + // ARIA + this.element.attr( "role", "tablist" ); + + this.headers + .attr( "role", "tab" ) + .each(function( i ) { + var header = $( this ), + headerId = header.attr( "id" ), + panel = header.next(), + panelId = panel.attr( "id" ); + if ( !headerId ) { + headerId = accordionId + "-header-" + i; + header.attr( "id", headerId ); + } + if ( !panelId ) { + panelId = accordionId + "-panel-" + i; + panel.attr( "id", panelId ); + } + header.attr( "aria-controls", panelId ); + panel.attr( "aria-labelledby", headerId ); + }) + .next() + .attr( "role", "tabpanel" ); + + this.headers + .not( this.active ) + .attr({ + "aria-selected": "false", + tabIndex: -1 + }) + .next() + .attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }) + .hide(); + + // make sure at least one header is in the tab order + if ( !this.active.length ) { + this.headers.eq( 0 ).attr( "tabIndex", 0 ); + } else { + this.active.attr({ + "aria-selected": "true", + tabIndex: 0 + }) + .next() + .attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }); + } + + this._on( this.headers, { keydown: "_keydown" }); + this._on( this.headers.next(), { keydown: "_panelKeyDown" }); + this._setupEvents( options.event ); + }, + + _getCreateEventData: function() { + return { + header: this.active, + content: !this.active.length ? $() : this.active.next() + }; + }, + + _createIcons: function() { + var icons = this.options.icons; + if ( icons ) { + $( "" ) + .addClass( "ui-accordion-header-icon ui-icon " + icons.header ) + .prependTo( this.headers ); + this.active.children( ".ui-accordion-header-icon" ) + .removeClass( icons.header ) + .addClass( icons.activeHeader ); + this.headers.addClass( "ui-accordion-icons" ); + } + }, + + _destroyIcons: function() { + this.headers + .removeClass( "ui-accordion-icons" ) + .children( ".ui-accordion-header-icon" ) + .remove(); + }, + + _destroy: function() { + var contents; + + // clean up main element + this.element + .removeClass( "ui-accordion ui-widget ui-helper-reset" ) + .removeAttr( "role" ); + + // clean up headers + this.headers + .removeClass( "ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) + .removeAttr( "role" ) + .removeAttr( "aria-selected" ) + .removeAttr( "aria-controls" ) + .removeAttr( "tabIndex" ) + .each(function() { + if ( /^ui-accordion/.test( this.id ) ) { + this.removeAttribute( "id" ); + } + }); + this._destroyIcons(); + + // clean up content panels + contents = this.headers.next() + .css( "display", "" ) + .removeAttr( "role" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-labelledby" ) + .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled" ) + .each(function() { + if ( /^ui-accordion/.test( this.id ) ) { + this.removeAttribute( "id" ); + } + }); + if ( this.options.heightStyle !== "content" ) { + contents.css( "height", "" ); + } + }, + + _setOption: function( key, value ) { + if ( key === "active" ) { + // _activate() will handle invalid values and update this.options + this._activate( value ); + return; + } + + if ( key === "event" ) { + if ( this.options.event ) { + this._off( this.headers, this.options.event ); + } + this._setupEvents( value ); + } + + this._super( key, value ); + + // setting collapsible: false while collapsed; open first panel + if ( key === "collapsible" && !value && this.options.active === false ) { + this._activate( 0 ); + } + + if ( key === "icons" ) { + this._destroyIcons(); + if ( value ) { + this._createIcons(); + } + } + + // #5332 - opacity doesn't cascade to positioned elements in IE + // so we need to add the disabled class to the headers and panels + if ( key === "disabled" ) { + this.headers.add( this.headers.next() ) + .toggleClass( "ui-state-disabled", !!value ); + } + }, + + _keydown: function( event ) { + if ( event.altKey || event.ctrlKey ) { + return; + } + + var keyCode = $.ui.keyCode, + length = this.headers.length, + currentIndex = this.headers.index( event.target ), + toFocus = false; + + switch ( event.keyCode ) { + case keyCode.RIGHT: + case keyCode.DOWN: + toFocus = this.headers[ ( currentIndex + 1 ) % length ]; + break; + case keyCode.LEFT: + case keyCode.UP: + toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; + break; + case keyCode.SPACE: + case keyCode.ENTER: + this._eventHandler( event ); + break; + case keyCode.HOME: + toFocus = this.headers[ 0 ]; + break; + case keyCode.END: + toFocus = this.headers[ length - 1 ]; + break; + } + + if ( toFocus ) { + $( event.target ).attr( "tabIndex", -1 ); + $( toFocus ).attr( "tabIndex", 0 ); + toFocus.focus(); + event.preventDefault(); + } + }, + + _panelKeyDown : function( event ) { + if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { + $( event.currentTarget ).prev().focus(); + } + }, + + refresh: function() { + var maxHeight, overflow, + heightStyle = this.options.heightStyle, + parent = this.element.parent(); + + + if ( heightStyle === "fill" ) { + // IE 6 treats height like minHeight, so we need to turn off overflow + // in order to get a reliable height + // we use the minHeight support test because we assume that only + // browsers that don't support minHeight will treat height as minHeight + if ( !$.support.minHeight ) { + overflow = parent.css( "overflow" ); + parent.css( "overflow", "hidden"); + } + maxHeight = parent.height(); + this.element.siblings( ":visible" ).each(function() { + var elem = $( this ), + position = elem.css( "position" ); + + if ( position === "absolute" || position === "fixed" ) { + return; + } + maxHeight -= elem.outerHeight( true ); + }); + if ( overflow ) { + parent.css( "overflow", overflow ); + } + + this.headers.each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.headers.next() + .each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( heightStyle === "auto" ) { + maxHeight = 0; + this.headers.next() + .each(function() { + maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); + }) + .height( maxHeight ); + } + }, + + _activate: function( index ) { + var active = this._findActive( index )[ 0 ]; + + // trying to activate the already active panel + if ( active === this.active[ 0 ] ) { + return; + } + + // trying to collapse, simulate a click on the currently active header + active = active || this.active[ 0 ]; + + this._eventHandler({ + target: active, + currentTarget: active, + preventDefault: $.noop + }); + }, + + _findActive: function( selector ) { + return typeof selector === "number" ? this.headers.eq( selector ) : $(); + }, + + _setupEvents: function( event ) { + var events = {}; + if ( !event ) { + return; + } + $.each( event.split(" "), function( index, eventName ) { + events[ eventName ] = "_eventHandler"; + }); + this._on( this.headers, events ); + }, + + _eventHandler: function( event ) { + var options = this.options, + active = this.active, + clicked = $( event.currentTarget ), + clickedIsActive = clicked[ 0 ] === active[ 0 ], + collapsing = clickedIsActive && options.collapsible, + toShow = collapsing ? $() : clicked.next(), + toHide = active.next(), + eventData = { + oldHeader: active, + oldPanel: toHide, + newHeader: collapsing ? $() : clicked, + newPanel: toShow + }; + + event.preventDefault(); + + if ( + // click on active header, but not collapsible + ( clickedIsActive && !options.collapsible ) || + // allow canceling activation + ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { + return; + } + + options.active = collapsing ? false : this.headers.index( clicked ); + + // when the call to ._toggle() comes after the class changes + // it causes a very odd bug in IE 8 (see #6720) + this.active = clickedIsActive ? $() : clicked; + this._toggle( eventData ); + + // switch classes + // corner classes on the previously active header stay after the animation + active.removeClass( "ui-accordion-header-active ui-state-active" ); + if ( options.icons ) { + active.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.activeHeader ) + .addClass( options.icons.header ); + } + + if ( !clickedIsActive ) { + clicked + .removeClass( "ui-corner-all" ) + .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ); + if ( options.icons ) { + clicked.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.header ) + .addClass( options.icons.activeHeader ); + } + + clicked + .next() + .addClass( "ui-accordion-content-active" ); + } + }, + + _toggle: function( data ) { + var toShow = data.newPanel, + toHide = this.prevShow.length ? this.prevShow : data.oldPanel; + + // handle activating a panel during the animation for another activation + this.prevShow.add( this.prevHide ).stop( true, true ); + this.prevShow = toShow; + this.prevHide = toHide; + + if ( this.options.animate ) { + this._animate( toShow, toHide, data ); + } else { + toHide.hide(); + toShow.show(); + this._toggleComplete( data ); + } + + toHide.attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }); + toHide.prev().attr( "aria-selected", "false" ); + // if we're switching panels, remove the old header from the tab order + // if we're opening from collapsed state, remove the previous header from the tab order + // if we're collapsing, then keep the collapsing header in the tab order + if ( toShow.length && toHide.length ) { + toHide.prev().attr( "tabIndex", -1 ); + } else if ( toShow.length ) { + this.headers.filter(function() { + return $( this ).attr( "tabIndex" ) === 0; + }) + .attr( "tabIndex", -1 ); + } + + toShow + .attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }) + .prev() + .attr({ + "aria-selected": "true", + tabIndex: 0 + }); + }, + + _animate: function( toShow, toHide, data ) { + var total, easing, duration, + that = this, + adjust = 0, + down = toShow.length && + ( !toHide.length || ( toShow.index() < toHide.index() ) ), + animate = this.options.animate || {}, + options = down && animate.down || animate, + complete = function() { + that._toggleComplete( data ); + }; + + if ( typeof options === "number" ) { + duration = options; + } + if ( typeof options === "string" ) { + easing = options; + } + // fall back from options to animation in case of partial down settings + easing = easing || options.easing || animate.easing; + duration = duration || options.duration || animate.duration; + + if ( !toHide.length ) { + return toShow.animate( showProps, duration, easing, complete ); + } + if ( !toShow.length ) { + return toHide.animate( hideProps, duration, easing, complete ); + } + + total = toShow.show().outerHeight(); + toHide.animate( hideProps, { + duration: duration, + easing: easing, + step: function( now, fx ) { + fx.now = Math.round( now ); + } + }); + toShow + .hide() + .animate( showProps, { + duration: duration, + easing: easing, + complete: complete, + step: function( now, fx ) { + fx.now = Math.round( now ); + if ( fx.prop !== "height" ) { + adjust += fx.now; + } else if ( that.options.heightStyle !== "content" ) { + fx.now = Math.round( total - toHide.outerHeight() - adjust ); + adjust = 0; + } + } + }); + }, + + _toggleComplete: function( data ) { + var toHide = data.oldPanel; + + toHide + .removeClass( "ui-accordion-content-active" ) + .prev() + .removeClass( "ui-corner-top" ) + .addClass( "ui-corner-all" ); + + // Work around for rendering bug in IE (#5421) + if ( toHide.length ) { + toHide.parent()[0].className = toHide.parent()[0].className; + } + + this._trigger( "activate", null, data ); + } +}); + + + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + // navigation options + (function( $, prototype ) { + $.extend( prototype.options, { + navigation: false, + navigationFilter: function() { + return this.href.toLowerCase() === location.href.toLowerCase(); + } + }); + + var _create = prototype._create; + prototype._create = function() { + if ( this.options.navigation ) { + var that = this, + headers = this.element.find( this.options.header ), + content = headers.next(), + current = headers.add( content ) + .find( "a" ) + .filter( this.options.navigationFilter ) + [ 0 ]; + if ( current ) { + headers.add( content ).each( function( index ) { + if ( $.contains( this, current ) ) { + that.options.active = Math.floor( index / 2 ); + return false; + } + }); + } + } + _create.call( this ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // height options + (function( $, prototype ) { + $.extend( prototype.options, { + heightStyle: null, // remove default so we fall back to old values + autoHeight: true, // use heightStyle: "auto" + clearStyle: false, // use heightStyle: "content" + fillSpace: false // use heightStyle: "fill" + }); + + var _create = prototype._create, + _setOption = prototype._setOption; + + $.extend( prototype, { + _create: function() { + this.options.heightStyle = this.options.heightStyle || + this._mergeHeightStyle(); + + _create.call( this ); + }, + + _setOption: function( key ) { + if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) { + this.options.heightStyle = this._mergeHeightStyle(); + } + _setOption.apply( this, arguments ); + }, + + _mergeHeightStyle: function() { + var options = this.options; + + if ( options.fillSpace ) { + return "fill"; + } + + if ( options.clearStyle ) { + return "content"; + } + + if ( options.autoHeight ) { + return "auto"; + } + } + }); + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // icon options + (function( $, prototype ) { + $.extend( prototype.options.icons, { + activeHeader: null, // remove default so we fall back to old values + headerSelected: "ui-icon-triangle-1-s" + }); + + var _createIcons = prototype._createIcons; + prototype._createIcons = function() { + if ( this.options.icons ) { + this.options.icons.activeHeader = this.options.icons.activeHeader || + this.options.icons.headerSelected; + } + _createIcons.call( this ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // expanded active option, activate method + (function( $, prototype ) { + prototype.activate = prototype._activate; + + var _findActive = prototype._findActive; + prototype._findActive = function( index ) { + if ( index === -1 ) { + index = false; + } + if ( index && typeof index !== "number" ) { + index = this.headers.index( this.headers.filter( index ) ); + if ( index === -1 ) { + index = false; + } + } + return _findActive.call( this, index ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // resize method + jQuery.ui.accordion.prototype.resize = jQuery.ui.accordion.prototype.refresh; + + // change events + (function( $, prototype ) { + $.extend( prototype.options, { + change: null, + changestart: null + }); + + var _trigger = prototype._trigger; + prototype._trigger = function( type, event, data ) { + var ret = _trigger.apply( this, arguments ); + if ( !ret ) { + return false; + } + + if ( type === "beforeActivate" ) { + ret = _trigger.call( this, "changestart", event, { + oldHeader: data.oldHeader, + oldContent: data.oldPanel, + newHeader: data.newHeader, + newContent: data.newPanel + }); + } else if ( type === "activate" ) { + ret = _trigger.call( this, "change", event, { + oldHeader: data.oldHeader, + oldContent: data.oldPanel, + newHeader: data.newHeader, + newContent: data.newPanel + }); + } + return ret; + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // animated option + // NOTE: this only provides support for "slide", "bounceslide", and easings + // not the full $.ui.accordion.animations API + (function( $, prototype ) { + $.extend( prototype.options, { + animate: null, + animated: "slide" + }); + + var _create = prototype._create; + prototype._create = function() { + var options = this.options; + if ( options.animate === null ) { + if ( !options.animated ) { + options.animate = false; + } else if ( options.animated === "slide" ) { + options.animate = 300; + } else if ( options.animated === "bounceslide" ) { + options.animate = { + duration: 200, + down: { + easing: "easeOutBounce", + duration: 1000 + } + }; + } else { + options.animate = options.animated; + } + } + + _create.call( this ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); +} + +})( jQuery ); +(function( $, undefined ) { + +// used to prevent race conditions with remote data sources +var requestIndex = 0; + +$.widget( "ui.autocomplete", { + version: "1.9.1", + defaultElement: "", + options: { + appendTo: "body", + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null, + + // callbacks + change: null, + close: null, + focus: null, + open: null, + response: null, + search: null, + select: null + }, + + pending: 0, + + _create: function() { + // Some browsers only repeat keydown events, not keypress events, + // so we use the suppressKeyPress flag to determine if we've already + // handled the keydown event. #7269 + // Unfortunately the code for & in keypress is the same as the up arrow, + // so we use the suppressKeyPressRepeat flag to avoid handling keypress + // events when we know the keydown event was used to modify the + // search term. #7799 + var suppressKeyPress, suppressKeyPressRepeat, suppressInput; + + this.isMultiLine = this._isMultiLine(); + this.valueMethod = this.element[ this.element.is( "input,textarea" ) ? "val" : "text" ]; + this.isNewMenu = true; + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ); + + this._on( this.element, { + keydown: function( event ) { + if ( this.element.prop( "readOnly" ) ) { + suppressKeyPress = true; + suppressInput = true; + suppressKeyPressRepeat = true; + return; + } + + suppressKeyPress = false; + suppressInput = false; + suppressKeyPressRepeat = false; + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + suppressKeyPress = true; + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + suppressKeyPress = true; + this._move( "nextPage", event ); + break; + case keyCode.UP: + suppressKeyPress = true; + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + suppressKeyPress = true; + this._keyEvent( "next", event ); + break; + case keyCode.ENTER: + case keyCode.NUMPAD_ENTER: + // when menu is open and has focus + if ( this.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + this.menu.select( event ); + } + break; + case keyCode.TAB: + if ( this.menu.active ) { + this.menu.select( event ); + } + break; + case keyCode.ESCAPE: + if ( this.menu.element.is( ":visible" ) ) { + this._value( this.term ); + this.close( event ); + // Different browsers have different default behavior for escape + // Single press can mean undo or clear + // Double press in IE means clear the whole form + event.preventDefault(); + } + break; + default: + suppressKeyPressRepeat = true; + // search timeout should be triggered before the input value is changed + this._searchTimeout( event ); + break; + } + }, + keypress: function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + event.preventDefault(); + return; + } + if ( suppressKeyPressRepeat ) { + return; + } + + // replicate some key handlers to allow them to repeat in Firefox and Opera + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + this._move( "nextPage", event ); + break; + case keyCode.UP: + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + this._keyEvent( "next", event ); + break; + } + }, + input: function( event ) { + if ( suppressInput ) { + suppressInput = false; + event.preventDefault(); + return; + } + this._searchTimeout( event ); + }, + focus: function() { + this.selectedItem = null; + this.previous = this._value(); + }, + blur: function( event ) { + if ( this.cancelBlur ) { + delete this.cancelBlur; + return; + } + + clearTimeout( this.searching ); + this.close( event ); + this._change( event ); + } + }); + + this._initSource(); + this.menu = $( "
      " ) + .addClass( "ui-autocomplete" ) + .appendTo( this.document.find( this.options.appendTo || "body" )[ 0 ] ) + .menu({ + // custom key handling for now + input: $(), + // disable ARIA support, the live region takes care of that + role: null + }) + .zIndex( this.element.zIndex() + 1 ) + .hide() + .data( "menu" ); + + this._on( this.menu.element, { + mousedown: function( event ) { + // prevent moving focus out of the text field + event.preventDefault(); + + // IE doesn't prevent moving focus even with event.preventDefault() + // so we set a flag to know when we should ignore the blur event + this.cancelBlur = true; + this._delay(function() { + delete this.cancelBlur; + }); + + // clicking on the scrollbar causes focus to shift to the body + // but we can't detect a mouseup or a click immediately afterward + // so we have to track the next mousedown and close the menu if + // the user clicks somewhere outside of the autocomplete + var menuElement = this.menu.element[ 0 ]; + if ( !$( event.target ).closest( ".ui-menu-item" ).length ) { + this._delay(function() { + var that = this; + this.document.one( "mousedown", function( event ) { + if ( event.target !== that.element[ 0 ] && + event.target !== menuElement && + !$.contains( menuElement, event.target ) ) { + that.close(); + } + }); + }); + } + }, + menufocus: function( event, ui ) { + // #7024 - Prevent accidental activation of menu items in Firefox + if ( this.isNewMenu ) { + this.isNewMenu = false; + if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) { + this.menu.blur(); + + this.document.one( "mousemove", function() { + $( event.target ).trigger( event.originalEvent ); + }); + + return; + } + } + + // back compat for _renderItem using item.autocomplete, via #7810 + // TODO remove the fallback, see #8156 + var item = ui.item.data( "ui-autocomplete-item" ) || ui.item.data( "item.autocomplete" ); + if ( false !== this._trigger( "focus", event, { item: item } ) ) { + // use value to match what will end up in the input, if it was a key event + if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) { + this._value( item.value ); + } + } else { + // Normally the input is populated with the item's value as the + // menu is navigated, causing screen readers to notice a change and + // announce the item. Since the focus event was canceled, this doesn't + // happen, so we update the live region so that screen readers can + // still notice the change and announce it. + this.liveRegion.text( item.value ); + } + }, + menuselect: function( event, ui ) { + // back compat for _renderItem using item.autocomplete, via #7810 + // TODO remove the fallback, see #8156 + var item = ui.item.data( "ui-autocomplete-item" ) || ui.item.data( "item.autocomplete" ), + previous = this.previous; + + // only trigger when focus was lost (click on menu) + if ( this.element[0] !== this.document[0].activeElement ) { + this.element.focus(); + this.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + this._delay(function() { + this.previous = previous; + this.selectedItem = item; + }); + } + + if ( false !== this._trigger( "select", event, { item: item } ) ) { + this._value( item.value ); + } + // reset the term after the select event + // this allows custom select handling to work properly + this.term = this._value(); + + this.close( event ); + this.selectedItem = item; + } + }); + + this.liveRegion = $( "", { + role: "status", + "aria-live": "polite" + }) + .addClass( "ui-helper-hidden-accessible" ) + .insertAfter( this.element ); + + if ( $.fn.bgiframe ) { + this.menu.element.bgiframe(); + } + + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + this._on( this.window, { + beforeunload: function() { + this.element.removeAttr( "autocomplete" ); + } + }); + }, + + _destroy: function() { + clearTimeout( this.searching ); + this.element + .removeClass( "ui-autocomplete-input" ) + .removeAttr( "autocomplete" ); + this.menu.element.remove(); + this.liveRegion.remove(); + }, + + _setOption: function( key, value ) { + this._super( key, value ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( this.document.find( value || "body" )[0] ); + } + if ( key === "disabled" && value && this.xhr ) { + this.xhr.abort(); + } + }, + + _isMultiLine: function() { + // Textareas are always multi-line + if ( this.element.is( "textarea" ) ) { + return true; + } + // Inputs are always single-line, even if inside a contentEditable element + // IE also treats inputs as contentEditable + if ( this.element.is( "input" ) ) { + return false; + } + // All other element types are determined by whether or not they're contentEditable + return this.element.prop( "isContentEditable" ); + }, + + _initSource: function() { + var array, url, + that = this; + if ( $.isArray(this.options.source) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter( array, request.term ) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if ( that.xhr ) { + that.xhr.abort(); + } + that.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data ) { + response( data ); + }, + error: function() { + response( [] ); + } + }); + }; + } else { + this.source = this.options.source; + } + }, + + _searchTimeout: function( event ) { + clearTimeout( this.searching ); + this.searching = this._delay(function() { + // only search if the value has changed + if ( this.term !== this._value() ) { + this.selectedItem = null; + this.search( null, event ); + } + }, this.options.delay ); + }, + + search: function( value, event ) { + value = value != null ? value : this._value(); + + // always save the actual value, not the one passed as an argument + this.term = this._value(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.pending++; + this.element.addClass( "ui-autocomplete-loading" ); + this.cancelSearch = false; + + this.source( { term: value }, this._response() ); + }, + + _response: function() { + var that = this, + index = ++requestIndex; + + return function( content ) { + if ( index === requestIndex ) { + that.__response( content ); + } + + that.pending--; + if ( !that.pending ) { + that.element.removeClass( "ui-autocomplete-loading" ); + } + }; + }, + + __response: function( content ) { + if ( content ) { + content = this._normalize( content ); + } + this._trigger( "response", null, { content: content } ); + if ( !this.options.disabled && content && content.length && !this.cancelSearch ) { + this._suggest( content ); + this._trigger( "open" ); + } else { + // use ._close() instead of .close() so we don't cancel future searches + this._close(); + } + }, + + close: function( event ) { + this.cancelSearch = true; + this._close( event ); + }, + + _close: function( event ) { + if ( this.menu.element.is( ":visible" ) ) { + this.menu.element.hide(); + this.menu.blur(); + this.isNewMenu = true; + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this._value() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + // assume all items have the right format when the first item is complete + if ( items.length && items[0].label && items[0].value ) { + return items; + } + return $.map( items, function( item ) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend({ + label: item.label || item.value, + value: item.value || item.label + }, item ); + }); + }, + + _suggest: function( items ) { + var ul = this.menu.element + .empty() + .zIndex( this.element.zIndex() + 1 ); + this._renderMenu( ul, items ); + this.menu.refresh(); + + // size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend({ + of: this.element + }, this.options.position )); + + if ( this.options.autoFocus ) { + this.menu.next(); + } + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + // Firefox wraps long text (possibly a rounding bug) + // so we add 1px to avoid the wrapping (#7513) + ul.width( "" ).outerWidth() + 1, + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var that = this; + $.each( items, function( index, item ) { + that._renderItemData( ul, item ); + }); + }, + + _renderItemData: function( ul, item ) { + return this._renderItem( ul, item ).data( "ui-autocomplete-item", item ); + }, + + _renderItem: function( ul, item ) { + return $( "
    • " ) + .append( $( "" ).text( item.label ) ) + .appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is( ":visible" ) ) { + this.search( null, event ); + return; + } + if ( this.menu.isFirstItem() && /^previous/.test( direction ) || + this.menu.isLastItem() && /^next/.test( direction ) ) { + this._value( this.term ); + this.menu.blur(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + }, + + _value: function() { + return this.valueMethod.apply( this.element, arguments ); + }, + + _keyEvent: function( keyEvent, event ) { + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + this._move( keyEvent, event ); + + // prevents moving cursor to beginning/end of the text field in some browsers + event.preventDefault(); + } + } +}); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); + }, + filter: function(array, term) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + return $.grep( array, function(value) { + return matcher.test( value.label || value.value || value ); + }); + } +}); + + +// live region extension, adding a `messages` option +// NOTE: This is an experimental API. We are still investigating +// a full solution for string manipulation and internationalization. +$.widget( "ui.autocomplete", $.ui.autocomplete, { + options: { + messages: { + noResults: "No search results.", + results: function( amount ) { + return amount + ( amount > 1 ? " results are" : " result is" ) + + " available, use up and down arrow keys to navigate."; + } + } + }, + + __response: function( content ) { + var message; + this._superApply( arguments ); + if ( this.options.disabled || this.cancelSearch ) { + return; + } + if ( content && content.length ) { + message = this.options.messages.results( content.length ); + } else { + message = this.options.messages.noResults; + } + this.liveRegion.text( message ); + } +}); + + +}( jQuery )); +(function( $, undefined ) { + +var lastActive, startXPos, startYPos, clickDragged, + baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", + stateClasses = "ui-state-hover ui-state-active ", + typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", + formResetHandler = function() { + var buttons = $( this ).find( ":ui-button" ); + setTimeout(function() { + buttons.button( "refresh" ); + }, 1 ); + }, + radioGroup = function( radio ) { + var name = radio.name, + form = radio.form, + radios = $( [] ); + if ( name ) { + if ( form ) { + radios = $( form ).find( "[name='" + name + "']" ); + } else { + radios = $( "[name='" + name + "']", radio.ownerDocument ) + .filter(function() { + return !this.form; + }); + } + } + return radios; + }; + +$.widget( "ui.button", { + version: "1.9.1", + defaultElement: "').addClass(this._triggerClass). + html(buttonImage == '' ? buttonText : $('').attr( + { src:buttonImage, alt:buttonText, title:buttonText }))); + input[isRTL ? 'before' : 'after'](inst.trigger); + inst.trigger.click(function() { + if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) + $.datepicker._hideDatepicker(); + else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) { + $.datepicker._hideDatepicker(); + $.datepicker._showDatepicker(input[0]); + } else + $.datepicker._showDatepicker(input[0]); + return false; + }); + } + }, + + /* Apply the maximum length for the date format. */ + _autoSize: function(inst) { + if (this._get(inst, 'autoSize') && !inst.inline) { + var date = new Date(2009, 12 - 1, 20); // Ensure double digits + var dateFormat = this._get(inst, 'dateFormat'); + if (dateFormat.match(/[DM]/)) { + var findMax = function(names) { + var max = 0; + var maxI = 0; + for (var i = 0; i < names.length; i++) { + if (names[i].length > max) { + max = names[i].length; + maxI = i; + } + } + return maxI; + }; + date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? + 'monthNames' : 'monthNamesShort')))); + date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? + 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); + } + inst.input.attr('size', this._formatDate(inst, date).length); + } + }, + + /* Attach an inline date picker to a div. */ + _inlineDatepicker: function(target, inst) { + var divSpan = $(target); + if (divSpan.hasClass(this.markerClassName)) + return; + divSpan.addClass(this.markerClassName).append(inst.dpDiv). + bind("setData.datepicker", function(event, key, value){ + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key){ + return this._get(inst, key); + }); + $.data(target, PROP_NAME, inst); + this._setDate(inst, this._getDefaultDate(inst), true); + this._updateDatepicker(inst); + this._updateAlternate(inst); + //If disabled option is true, disable the datepicker before showing it (see ticket #5665) + if( inst.settings.disabled ) { + this._disableDatepicker( target ); + } + // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements + // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height + inst.dpDiv.css( "display", "block" ); + }, + + /* Pop-up the date picker in a "dialog" box. + @param input element - ignored + @param date string or Date - the initial date to display + @param onSelect function - the function to call when a date is selected + @param settings object - update the dialog date picker instance's settings (anonymous object) + @param pos int[2] - coordinates for the dialog's position within the screen or + event - with x/y coordinates or + leave empty for default (screen centre) + @return the manager object */ + _dialogDatepicker: function(input, date, onSelect, settings, pos) { + var inst = this._dialogInst; // internal instance + if (!inst) { + this.uuid += 1; + var id = 'dp' + this.uuid; + this._dialogInput = $(''); + this._dialogInput.keydown(this._doKeyDown); + $('body').append(this._dialogInput); + inst = this._dialogInst = this._newInst(this._dialogInput, false); + inst.settings = {}; + $.data(this._dialogInput[0], PROP_NAME, inst); + } + extendRemove(inst.settings, settings || {}); + date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); + this._dialogInput.val(date); + + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); + if (!this._pos) { + var browserWidth = document.documentElement.clientWidth; + var browserHeight = document.documentElement.clientHeight; + var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; + var scrollY = document.documentElement.scrollTop || document.body.scrollTop; + this._pos = // should use actual width/height below + [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; + } + + // move input on screen for focus, but hidden behind dialog + this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px'); + inst.settings.onSelect = onSelect; + this._inDialog = true; + this.dpDiv.addClass(this._dialogClass); + this._showDatepicker(this._dialogInput[0]); + if ($.blockUI) + $.blockUI(this.dpDiv); + $.data(this._dialogInput[0], PROP_NAME, inst); + return this; + }, + + /* Detach a datepicker from its control. + @param target element - the target input field or division or span */ + _destroyDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + $.removeData(target, PROP_NAME); + if (nodeName == 'input') { + inst.append.remove(); + inst.trigger.remove(); + $target.removeClass(this.markerClassName). + unbind('focus', this._showDatepicker). + unbind('keydown', this._doKeyDown). + unbind('keypress', this._doKeyPress). + unbind('keyup', this._doKeyUp); + } else if (nodeName == 'div' || nodeName == 'span') + $target.removeClass(this.markerClassName).empty(); + }, + + /* Enable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _enableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = false; + inst.trigger.filter('button'). + each(function() { this.disabled = false; }).end(). + filter('img').css({opacity: '1.0', cursor: ''}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().removeClass('ui-state-disabled'); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + prop("disabled", false); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + }, + + /* Disable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _disableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = true; + inst.trigger.filter('button'). + each(function() { this.disabled = true; }).end(). + filter('img').css({opacity: '0.5', cursor: 'default'}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().addClass('ui-state-disabled'); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + prop("disabled", true); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + this._disabledInputs[this._disabledInputs.length] = target; + }, + + /* Is the first field in a jQuery collection disabled as a datepicker? + @param target element - the target input field or division or span + @return boolean - true if disabled, false if enabled */ + _isDisabledDatepicker: function(target) { + if (!target) { + return false; + } + for (var i = 0; i < this._disabledInputs.length; i++) { + if (this._disabledInputs[i] == target) + return true; + } + return false; + }, + + /* Retrieve the instance data for the target control. + @param target element - the target input field or division or span + @return object - the associated instance data + @throws error if a jQuery problem getting data */ + _getInst: function(target) { + try { + return $.data(target, PROP_NAME); + } + catch (err) { + throw 'Missing instance data for this datepicker'; + } + }, + + /* Update or retrieve the settings for a date picker attached to an input field or division. + @param target element - the target input field or division or span + @param name object - the new settings to update or + string - the name of the setting to change or retrieve, + when retrieving also 'all' for all instance settings or + 'defaults' for all global defaults + @param value any - the new value for the setting + (omit if above is an object or to retrieve a value) */ + _optionDatepicker: function(target, name, value) { + var inst = this._getInst(target); + if (arguments.length == 2 && typeof name == 'string') { + return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : + (inst ? (name == 'all' ? $.extend({}, inst.settings) : + this._get(inst, name)) : null)); + } + var settings = name || {}; + if (typeof name == 'string') { + settings = {}; + settings[name] = value; + } + if (inst) { + if (this._curInst == inst) { + this._hideDatepicker(); + } + var date = this._getDateDatepicker(target, true); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + extendRemove(inst.settings, settings); + // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided + if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined) + inst.settings.minDate = this._formatDate(inst, minDate); + if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined) + inst.settings.maxDate = this._formatDate(inst, maxDate); + this._attachments($(target), inst); + this._autoSize(inst); + this._setDate(inst, date); + this._updateAlternate(inst); + this._updateDatepicker(inst); + } + }, + + // change method deprecated + _changeDatepicker: function(target, name, value) { + this._optionDatepicker(target, name, value); + }, + + /* Redraw the date picker attached to an input field or division. + @param target element - the target input field or division or span */ + _refreshDatepicker: function(target) { + var inst = this._getInst(target); + if (inst) { + this._updateDatepicker(inst); + } + }, + + /* Set the dates for a jQuery selection. + @param target element - the target input field or division or span + @param date Date - the new date */ + _setDateDatepicker: function(target, date) { + var inst = this._getInst(target); + if (inst) { + this._setDate(inst, date); + this._updateDatepicker(inst); + this._updateAlternate(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. + @param target element - the target input field or division or span + @param noDefault boolean - true if no default date is to be used + @return Date - the current date */ + _getDateDatepicker: function(target, noDefault) { + var inst = this._getInst(target); + if (inst && !inst.inline) + this._setDateFromField(inst, noDefault); + return (inst ? this._getDate(inst) : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(event) { + var inst = $.datepicker._getInst(event.target); + var handled = true; + var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); + inst._keyEvent = true; + if ($.datepicker._datepickerShowing) + switch (event.keyCode) { + case 9: $.datepicker._hideDatepicker(); + handled = false; + break; // hide on tab out + case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' + + $.datepicker._currentClass + ')', inst.dpDiv); + if (sel[0]) + $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); + var onSelect = $.datepicker._get(inst, 'onSelect'); + if (onSelect) { + var dateStr = $.datepicker._formatDate(inst); + + // trigger custom callback + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); + } + else + $.datepicker._hideDatepicker(); + return false; // don't submit the form + break; // select the value on enter + case 27: $.datepicker._hideDatepicker(); + break; // hide on escape + case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // previous month/year on page up/+ ctrl + case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // next month/year on page down/+ ctrl + case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); + handled = event.ctrlKey || event.metaKey; + break; // clear on ctrl or command +end + case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); + handled = event.ctrlKey || event.metaKey; + break; // current on ctrl or command +home + case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); + handled = event.ctrlKey || event.metaKey; + // -1 day on ctrl or command +left + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +left on Mac + break; + case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // -1 week on ctrl or command +up + case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); + handled = event.ctrlKey || event.metaKey; + // +1 day on ctrl or command +right + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +right + break; + case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // +1 week on ctrl or command +down + default: handled = false; + } + else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + else { + handled = false; + } + if (handled) { + event.preventDefault(); + event.stopPropagation(); + } + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(event) { + var inst = $.datepicker._getInst(event.target); + if ($.datepicker._get(inst, 'constrainInput')) { + var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); + var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); + return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); + } + }, + + /* Synchronise manual entry and field/alternate field. */ + _doKeyUp: function(event) { + var inst = $.datepicker._getInst(event.target); + if (inst.input.val() != inst.lastVal) { + try { + var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + (inst.input ? inst.input.val() : null), + $.datepicker._getFormatConfig(inst)); + if (date) { // only if valid + $.datepicker._setDateFromField(inst); + $.datepicker._updateAlternate(inst); + $.datepicker._updateDatepicker(inst); + } + } + catch (err) { + $.datepicker.log(err); + } + } + return true; + }, + + /* Pop-up the date picker for a given input field. + If false returned from beforeShow event handler do not show. + @param input element - the input field attached to the date picker or + event - if triggered by focus */ + _showDatepicker: function(input) { + input = input.target || input; + if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger + input = $('input', input.parentNode)[0]; + if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here + return; + var inst = $.datepicker._getInst(input); + if ($.datepicker._curInst && $.datepicker._curInst != inst) { + $.datepicker._curInst.dpDiv.stop(true, true); + if ( inst && $.datepicker._datepickerShowing ) { + $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] ); + } + } + var beforeShow = $.datepicker._get(inst, 'beforeShow'); + var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; + if(beforeShowSettings === false){ + //false + return; + } + extendRemove(inst.settings, beforeShowSettings); + inst.lastVal = null; + $.datepicker._lastInput = input; + $.datepicker._setDateFromField(inst); + if ($.datepicker._inDialog) // hide cursor + input.value = ''; + if (!$.datepicker._pos) { // position below input + $.datepicker._pos = $.datepicker._findPos(input); + $.datepicker._pos[1] += input.offsetHeight; // add the height + } + var isFixed = false; + $(input).parents().each(function() { + isFixed |= $(this).css('position') == 'fixed'; + return !isFixed; + }); + var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; + $.datepicker._pos = null; + //to avoid flashes on Firefox + inst.dpDiv.empty(); + // determine sizing offscreen + inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); + $.datepicker._updateDatepicker(inst); + // fix width for dynamic number of date pickers + // and adjust position before showing + offset = $.datepicker._checkOffset(inst, offset, isFixed); + inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? + 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', + left: offset.left + 'px', top: offset.top + 'px'}); + if (!inst.inline) { + var showAnim = $.datepicker._get(inst, 'showAnim'); + var duration = $.datepicker._get(inst, 'duration'); + var postProcess = function() { + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !! cover.length ){ + var borders = $.datepicker._getBorders(inst.dpDiv); + cover.css({left: -borders[0], top: -borders[1], + width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); + } + }; + inst.dpDiv.zIndex($(input).zIndex()+1); + $.datepicker._datepickerShowing = true; + + // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed + if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) + inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); + if (!showAnim || !duration) + postProcess(); + if (inst.input.is(':visible') && !inst.input.is(':disabled')) + inst.input.focus(); + $.datepicker._curInst = inst; + } + }, + + /* Generate the date picker content. */ + _updateDatepicker: function(inst) { + this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) + var borders = $.datepicker._getBorders(inst.dpDiv); + instActive = inst; // for delegate hover events + inst.dpDiv.empty().append(this._generateHTML(inst)); + this._attachHandlers(inst); + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6 + cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) + } + inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover(); + var numMonths = this._getNumberOfMonths(inst); + var cols = numMonths[1]; + var width = 17; + inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); + if (cols > 1) + inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); + inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + + 'Class']('ui-datepicker-multi'); + inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + + 'Class']('ui-datepicker-rtl'); + if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && + // #6694 - don't focus the input if it's already focused + // this breaks the change event in IE + inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement) + inst.input.focus(); + // deffered render of the years select (to avoid flashes on Firefox) + if( inst.yearshtml ){ + var origyearshtml = inst.yearshtml; + setTimeout(function(){ + //assure that inst.yearshtml didn't change. + if( origyearshtml === inst.yearshtml && inst.yearshtml ){ + inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml); + } + origyearshtml = inst.yearshtml = null; + }, 0); + } + }, + + /* Retrieve the size of left and top borders for an element. + @param elem (jQuery object) the element of interest + @return (number[2]) the left and top borders */ + _getBorders: function(elem) { + var convert = function(value) { + return {thin: 1, medium: 2, thick: 3}[value] || value; + }; + return [parseFloat(convert(elem.css('border-left-width'))), + parseFloat(convert(elem.css('border-top-width')))]; + }, + + /* Check positioning to remain on screen. */ + _checkOffset: function(inst, offset, isFixed) { + var dpWidth = inst.dpDiv.outerWidth(); + var dpHeight = inst.dpDiv.outerHeight(); + var inputWidth = inst.input ? inst.input.outerWidth() : 0; + var inputHeight = inst.input ? inst.input.outerHeight() : 0; + var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()); + var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop()); + + offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); + offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; + offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; + + // now check if datepicker is showing outside window viewport - move to a better place if so. + offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight) : 0); + + return offset; + }, + + /* Find an object's position on the screen. */ + _findPos: function(obj) { + var inst = this._getInst(obj); + var isRTL = this._get(inst, 'isRTL'); + while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) { + obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; + } + var position = $(obj).offset(); + return [position.left, position.top]; + }, + + /* Hide the date picker from view. + @param input element - the input field attached to the date picker */ + _hideDatepicker: function(input) { + var inst = this._curInst; + if (!inst || (input && inst != $.data(input, PROP_NAME))) + return; + if (this._datepickerShowing) { + var showAnim = this._get(inst, 'showAnim'); + var duration = this._get(inst, 'duration'); + var postProcess = function() { + $.datepicker._tidyDialog(inst); + }; + + // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed + if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : + (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); + if (!showAnim) + postProcess(); + this._datepickerShowing = false; + var onClose = this._get(inst, 'onClose'); + if (onClose) + onClose.apply((inst.input ? inst.input[0] : null), + [(inst.input ? inst.input.val() : ''), inst]); + this._lastInput = null; + if (this._inDialog) { + this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); + if ($.blockUI) { + $.unblockUI(); + $('body').append(this.dpDiv); + } + } + this._inDialog = false; + } + }, + + /* Tidy up after a dialog display. */ + _tidyDialog: function(inst) { + inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); + }, + + /* Close date picker if clicked elsewhere. */ + _checkExternalClick: function(event) { + if (!$.datepicker._curInst) + return; + + var $target = $(event.target), + inst = $.datepicker._getInst($target[0]); + + if ( ( ( $target[0].id != $.datepicker._mainDivId && + $target.parents('#' + $.datepicker._mainDivId).length == 0 && + !$target.hasClass($.datepicker.markerClassName) && + !$target.closest("." + $.datepicker._triggerClass).length && + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) || + ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) ) + $.datepicker._hideDatepicker(); + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(id, offset, period) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._isDisabledDatepicker(target[0])) { + return; + } + this._adjustInstDate(inst, offset + + (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning + period); + this._updateDatepicker(inst); + }, + + /* Action for current link. */ + _gotoToday: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._get(inst, 'gotoCurrent') && inst.currentDay) { + inst.selectedDay = inst.currentDay; + inst.drawMonth = inst.selectedMonth = inst.currentMonth; + inst.drawYear = inst.selectedYear = inst.currentYear; + } + else { + var date = new Date(); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + } + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a new month/year. */ + _selectMonthYear: function(id, select, period) { + var target = $(id); + var inst = this._getInst(target[0]); + inst['selected' + (period == 'M' ? 'Month' : 'Year')] = + inst['draw' + (period == 'M' ? 'Month' : 'Year')] = + parseInt(select.options[select.selectedIndex].value,10); + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a day. */ + _selectDay: function(id, month, year, td) { + var target = $(id); + if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { + return; + } + var inst = this._getInst(target[0]); + inst.selectedDay = inst.currentDay = $('a', td).html(); + inst.selectedMonth = inst.currentMonth = month; + inst.selectedYear = inst.currentYear = year; + this._selectDate(id, this._formatDate(inst, + inst.currentDay, inst.currentMonth, inst.currentYear)); + }, + + /* Erase the input field and hide the date picker. */ + _clearDate: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + this._selectDate(target, ''); + }, + + /* Update the input field with the selected date. */ + _selectDate: function(id, dateStr) { + var target = $(id); + var inst = this._getInst(target[0]); + dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); + if (inst.input) + inst.input.val(dateStr); + this._updateAlternate(inst); + var onSelect = this._get(inst, 'onSelect'); + if (onSelect) + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback + else if (inst.input) + inst.input.trigger('change'); // fire the change event + if (inst.inline) + this._updateDatepicker(inst); + else { + this._hideDatepicker(); + this._lastInput = inst.input[0]; + if (typeof(inst.input[0]) != 'object') + inst.input.focus(); // restore focus + this._lastInput = null; + } + }, + + /* Update any alternate field to synchronise with the main field. */ + _updateAlternate: function(inst) { + var altField = this._get(inst, 'altField'); + if (altField) { // update alternate field too + var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); + var date = this._getDate(inst); + var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); + $(altField).each(function() { $(this).val(dateStr); }); + } + }, + + /* Set as beforeShowDay function to prevent selection of weekends. + @param date Date - the date to customise + @return [boolean, string] - is this date selectable?, what is its CSS class? */ + noWeekends: function(date) { + var day = date.getDay(); + return [(day > 0 && day < 6), '']; + }, + + /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. + @param date Date - the date to get the week for + @return number - the number of the week within the year that contains this date */ + iso8601Week: function(date) { + var checkDate = new Date(date.getTime()); + // Find Thursday of this week starting on Monday + checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); + var time = checkDate.getTime(); + checkDate.setMonth(0); // Compare with Jan 1 + checkDate.setDate(1); + return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; + }, + + /* Parse a string value into a date object. + See formatDate below for the possible formats. + + @param format string - the expected format of the date + @param value string - the date in the above format + @param settings Object - attributes include: + shortYearCutoff number - the cutoff year for determining the century (optional) + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + dayNames string[7] - names of the days from Sunday (optional) + monthNamesShort string[12] - abbreviated names of the months (optional) + monthNames string[12] - names of the months (optional) + @return Date - the extracted date value or null if value is blank */ + parseDate: function (format, value, settings) { + if (format == null || value == null) + throw 'Invalid arguments'; + value = (typeof value == 'object' ? value.toString() : value + ''); + if (value == '') + return null; + var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + var year = -1; + var month = -1; + var day = -1; + var doy = -1; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Extract a number from the string value + var getNumber = function(match) { + var isDoubled = lookAhead(match); + var size = (match == '@' ? 14 : (match == '!' ? 20 : + (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2)))); + var digits = new RegExp('^\\d{1,' + size + '}'); + var num = value.substring(iValue).match(digits); + if (!num) + throw 'Missing number at position ' + iValue; + iValue += num[0].length; + return parseInt(num[0], 10); + }; + // Extract a name from the string value and convert to an index + var getName = function(match, shortNames, longNames) { + var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { + return [ [k, v] ]; + }).sort(function (a, b) { + return -(a[1].length - b[1].length); + }); + var index = -1; + $.each(names, function (i, pair) { + var name = pair[1]; + if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) { + index = pair[0]; + iValue += name.length; + return false; + } + }); + if (index != -1) + return index + 1; + else + throw 'Unknown name at position ' + iValue; + }; + // Confirm that a literal character matches the string value + var checkLiteral = function() { + if (value.charAt(iValue) != format.charAt(iFormat)) + throw 'Unexpected literal at position ' + iValue; + iValue++; + }; + var iValue = 0; + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + checkLiteral(); + else + switch (format.charAt(iFormat)) { + case 'd': + day = getNumber('d'); + break; + case 'D': + getName('D', dayNamesShort, dayNames); + break; + case 'o': + doy = getNumber('o'); + break; + case 'm': + month = getNumber('m'); + break; + case 'M': + month = getName('M', monthNamesShort, monthNames); + break; + case 'y': + year = getNumber('y'); + break; + case '@': + var date = new Date(getNumber('@')); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case '!': + var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "'": + if (lookAhead("'")) + checkLiteral(); + else + literal = true; + break; + default: + checkLiteral(); + } + } + if (iValue < value.length){ + var extra = value.substr(iValue); + if (!/^\s+/.test(extra)) { + throw "Extra/unparsed characters found in date: " + extra; + } + } + if (year == -1) + year = new Date().getFullYear(); + else if (year < 100) + year += new Date().getFullYear() - new Date().getFullYear() % 100 + + (year <= shortYearCutoff ? 0 : -100); + if (doy > -1) { + month = 1; + day = doy; + do { + var dim = this._getDaysInMonth(year, month - 1); + if (day <= dim) + break; + month++; + day -= dim; + } while (true); + } + var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); + if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) + throw 'Invalid date'; // E.g. 31/02/00 + return date; + }, + + /* Standard date formats. */ + ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) + COOKIE: 'D, dd M yy', + ISO_8601: 'yy-mm-dd', + RFC_822: 'D, d M y', + RFC_850: 'DD, dd-M-y', + RFC_1036: 'D, d M y', + RFC_1123: 'D, d M yy', + RFC_2822: 'D, d M yy', + RSS: 'D, d M y', // RFC 822 + TICKS: '!', + TIMESTAMP: '@', + W3C: 'yy-mm-dd', // ISO 8601 + + _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), + + /* Format a date object into a string value. + The format can be combinations of the following: + d - day of month (no leading zero) + dd - day of month (two digit) + o - day of year (no leading zeros) + oo - day of year (three digit) + D - day name short + DD - day name long + m - month of year (no leading zero) + mm - month of year (two digit) + M - month name short + MM - month name long + y - year (two digit) + yy - year (four digit) + @ - Unix timestamp (ms since 01/01/1970) + ! - Windows ticks (100ns since 01/01/0001) + '...' - literal text + '' - single quote + + @param format string - the desired format of the date + @param date Date - the date value to format + @param settings Object - attributes include: + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + dayNames string[7] - names of the days from Sunday (optional) + monthNamesShort string[12] - abbreviated names of the months (optional) + monthNames string[12] - names of the months (optional) + @return string - the date in the above format */ + formatDate: function (format, date, settings) { + if (!date) + return ''; + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Format a number, with leading zero if necessary + var formatNumber = function(match, value, len) { + var num = '' + value; + if (lookAhead(match)) + while (num.length < len) + num = '0' + num; + return num; + }; + // Format a name, short or long as requested + var formatName = function(match, value, shortNames, longNames) { + return (lookAhead(match) ? longNames[value] : shortNames[value]); + }; + var output = ''; + var literal = false; + if (date) + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + output += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': + output += formatNumber('d', date.getDate(), 2); + break; + case 'D': + output += formatName('D', date.getDay(), dayNamesShort, dayNames); + break; + case 'o': + output += formatNumber('o', + Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); + break; + case 'm': + output += formatNumber('m', date.getMonth() + 1, 2); + break; + case 'M': + output += formatName('M', date.getMonth(), monthNamesShort, monthNames); + break; + case 'y': + output += (lookAhead('y') ? date.getFullYear() : + (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); + break; + case '@': + output += date.getTime(); + break; + case '!': + output += date.getTime() * 10000 + this._ticksTo1970; + break; + case "'": + if (lookAhead("'")) + output += "'"; + else + literal = true; + break; + default: + output += format.charAt(iFormat); + } + } + return output; + }, + + /* Extract all possible characters from the date format. */ + _possibleChars: function (format) { + var chars = ''; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + for (var iFormat = 0; iFormat < format.length; iFormat++) + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + chars += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': case 'm': case 'y': case '@': + chars += '0123456789'; + break; + case 'D': case 'M': + return null; // Accept anything + case "'": + if (lookAhead("'")) + chars += "'"; + else + literal = true; + break; + default: + chars += format.charAt(iFormat); + } + return chars; + }, + + /* Get a setting value, defaulting if necessary. */ + _get: function(inst, name) { + return inst.settings[name] !== undefined ? + inst.settings[name] : this._defaults[name]; + }, + + /* Parse existing date and initialise date picker. */ + _setDateFromField: function(inst, noDefault) { + if (inst.input.val() == inst.lastVal) { + return; + } + var dateFormat = this._get(inst, 'dateFormat'); + var dates = inst.lastVal = inst.input ? inst.input.val() : null; + var date, defaultDate; + date = defaultDate = this._getDefaultDate(inst); + var settings = this._getFormatConfig(inst); + try { + date = this.parseDate(dateFormat, dates, settings) || defaultDate; + } catch (event) { + this.log(event); + dates = (noDefault ? '' : dates); + } + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + inst.currentDay = (dates ? date.getDate() : 0); + inst.currentMonth = (dates ? date.getMonth() : 0); + inst.currentYear = (dates ? date.getFullYear() : 0); + this._adjustInstDate(inst); + }, + + /* Retrieve the default date shown on opening. */ + _getDefaultDate: function(inst) { + return this._restrictMinMax(inst, + this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); + }, + + /* A date may be specified as an exact value or a relative one. */ + _determineDate: function(inst, date, defaultDate) { + var offsetNumeric = function(offset) { + var date = new Date(); + date.setDate(date.getDate() + offset); + return date; + }; + var offsetString = function(offset) { + try { + return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + offset, $.datepicker._getFormatConfig(inst)); + } + catch (e) { + // Ignore + } + var date = (offset.toLowerCase().match(/^c/) ? + $.datepicker._getDate(inst) : null) || new Date(); + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; + var matches = pattern.exec(offset); + while (matches) { + switch (matches[2] || 'd') { + case 'd' : case 'D' : + day += parseInt(matches[1],10); break; + case 'w' : case 'W' : + day += parseInt(matches[1],10) * 7; break; + case 'm' : case 'M' : + month += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + case 'y': case 'Y' : + year += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + } + matches = pattern.exec(offset); + } + return new Date(year, month, day); + }; + var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) : + (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); + newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate); + if (newDate) { + newDate.setHours(0); + newDate.setMinutes(0); + newDate.setSeconds(0); + newDate.setMilliseconds(0); + } + return this._daylightSavingAdjust(newDate); + }, + + /* Handle switch to/from daylight saving. + Hours may be non-zero on daylight saving cut-over: + > 12 when midnight changeover, but then cannot generate + midnight datetime, so jump to 1AM, otherwise reset. + @param date (Date) the date to check + @return (Date) the corrected date */ + _daylightSavingAdjust: function(date) { + if (!date) return null; + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); + return date; + }, + + /* Set the date(s) directly. */ + _setDate: function(inst, date, noChange) { + var clear = !date; + var origMonth = inst.selectedMonth; + var origYear = inst.selectedYear; + var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); + inst.selectedDay = inst.currentDay = newDate.getDate(); + inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); + inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); + if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) + this._notifyChange(inst); + this._adjustInstDate(inst); + if (inst.input) { + inst.input.val(clear ? '' : this._formatDate(inst)); + } + }, + + /* Retrieve the date(s) directly. */ + _getDate: function(inst) { + var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : + this._daylightSavingAdjust(new Date( + inst.currentYear, inst.currentMonth, inst.currentDay))); + return startDate; + }, + + /* Attach the onxxx handlers. These are declared statically so + * they work with static code transformers like Caja. + */ + _attachHandlers: function(inst) { + var stepMonths = this._get(inst, 'stepMonths'); + var id = '#' + inst.id.replace( /\\\\/g, "\\" ); + inst.dpDiv.find('[data-handler]').map(function () { + var handler = { + prev: function () { + window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, -stepMonths, 'M'); + }, + next: function () { + window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, +stepMonths, 'M'); + }, + hide: function () { + window['DP_jQuery_' + dpuuid].datepicker._hideDatepicker(); + }, + today: function () { + window['DP_jQuery_' + dpuuid].datepicker._gotoToday(id); + }, + selectDay: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectDay(id, +this.getAttribute('data-month'), +this.getAttribute('data-year'), this); + return false; + }, + selectMonth: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'M'); + return false; + }, + selectYear: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'Y'); + return false; + } + }; + $(this).bind(this.getAttribute('data-event'), handler[this.getAttribute('data-handler')]); + }); + }, + + /* Generate the HTML for the current state of the date picker. */ + _generateHTML: function(inst) { + var today = new Date(); + today = this._daylightSavingAdjust( + new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time + var isRTL = this._get(inst, 'isRTL'); + var showButtonPanel = this._get(inst, 'showButtonPanel'); + var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); + var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); + var numMonths = this._getNumberOfMonths(inst); + var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); + var stepMonths = this._get(inst, 'stepMonths'); + var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); + var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : + new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var drawMonth = inst.drawMonth - showCurrentAtPos; + var drawYear = inst.drawYear; + if (drawMonth < 0) { + drawMonth += 12; + drawYear--; + } + if (maxDate) { + var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), + maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); + while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { + drawMonth--; + if (drawMonth < 0) { + drawMonth = 11; + drawYear--; + } + } + } + inst.drawMonth = drawMonth; + inst.drawYear = drawYear; + var prevText = this._get(inst, 'prevText'); + prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), + this._getFormatConfig(inst))); + var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? + '' + prevText + '' : + (hideIfNoPrevNext ? '' : '' + prevText + '')); + var nextText = this._get(inst, 'nextText'); + nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), + this._getFormatConfig(inst))); + var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? + '' + nextText + '' : + (hideIfNoPrevNext ? '' : '' + nextText + '')); + var currentText = this._get(inst, 'currentText'); + var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); + currentText = (!navigationAsDateFormat ? currentText : + this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); + var controls = (!inst.inline ? '' : ''); + var buttonPanel = (showButtonPanel) ? '
      ' + (isRTL ? controls : '') + + (this._isInRange(inst, gotoDate) ? '' : '') + (isRTL ? '' : controls) + '
      ' : ''; + var firstDay = parseInt(this._get(inst, 'firstDay'),10); + firstDay = (isNaN(firstDay) ? 0 : firstDay); + var showWeek = this._get(inst, 'showWeek'); + var dayNames = this._get(inst, 'dayNames'); + var dayNamesShort = this._get(inst, 'dayNamesShort'); + var dayNamesMin = this._get(inst, 'dayNamesMin'); + var monthNames = this._get(inst, 'monthNames'); + var monthNamesShort = this._get(inst, 'monthNamesShort'); + var beforeShowDay = this._get(inst, 'beforeShowDay'); + var showOtherMonths = this._get(inst, 'showOtherMonths'); + var selectOtherMonths = this._get(inst, 'selectOtherMonths'); + var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; + var defaultDate = this._getDefaultDate(inst); + var html = ''; + for (var row = 0; row < numMonths[0]; row++) { + var group = ''; + this.maxRows = 4; + for (var col = 0; col < numMonths[1]; col++) { + var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); + var cornerClass = ' ui-corner-all'; + var calender = ''; + if (isMultiMonth) { + calender += '
      '; + } + calender += '
      ' + + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, + row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers + '
      ' + + ''; + var thead = (showWeek ? '' : ''); + for (var dow = 0; dow < 7; dow++) { // days of the week + var day = (dow + firstDay) % 7; + thead += '= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + + '' + dayNamesMin[day] + ''; + } + calender += thead + ''; + var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); + if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) + inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); + var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; + var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate + var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) + this.maxRows = numRows; + var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); + for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows + calender += ''; + var tbody = (!showWeek ? '' : ''); + for (var dow = 0; dow < 7; dow++) { // create date picker days + var daySettings = (beforeShowDay ? + beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); + var otherMonth = (printDate.getMonth() != drawMonth); + var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); + tbody += ''; // display selectable date + printDate.setDate(printDate.getDate() + 1); + printDate = this._daylightSavingAdjust(printDate); + } + calender += tbody + ''; + } + drawMonth++; + if (drawMonth > 11) { + drawMonth = 0; + drawYear++; + } + calender += '
      ' + this._get(inst, 'weekHeader') + '
      ' + + this._get(inst, 'calculateWeek')(printDate) + '' + // actions + (otherMonth && !showOtherMonths ? ' ' : // display for other months + (unselectable ? '' + printDate.getDate() + '' : '' + printDate.getDate() + '')) + '
      ' + (isMultiMonth ? '
      ' + + ((numMonths[0] > 0 && col == numMonths[1]-1) ? '
      ' : '') : ''); + group += calender; + } + html += group; + } + html += buttonPanel + ($.ui.ie6 && !inst.inline ? + '' : ''); + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + var changeMonth = this._get(inst, 'changeMonth'); + var changeYear = this._get(inst, 'changeYear'); + var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); + var html = '
      '; + var monthHtml = ''; + // month selection + if (secondary || !changeMonth) + monthHtml += '' + monthNames[drawMonth] + ''; + else { + var inMinYear = (minDate && minDate.getFullYear() == drawYear); + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); + monthHtml += ''; + } + if (!showMonthAfterYear) + html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); + // year selection + if ( !inst.yearshtml ) { + inst.yearshtml = ''; + if (secondary || !changeYear) + html += '' + drawYear + ''; + else { + // determine range of years to display + var years = this._get(inst, 'yearRange').split(':'); + var thisYear = new Date().getFullYear(); + var determineYear = function(value) { + var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + var year = determineYear(years[0]); + var endYear = Math.max(year, determineYear(years[1] || '')); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + inst.yearshtml += ''; + + html += inst.yearshtml; + inst.yearshtml = null; + } + } + html += this._get(inst, 'yearSuffix'); + if (showMonthAfterYear) + html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; + html += '
      '; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period == 'Y' ? offset : 0); + var month = inst.drawMonth + (period == 'M' ? offset : 0); + var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + + (period == 'D' ? offset : 0); + var date = this._restrictMinMax(inst, + this._daylightSavingAdjust(new Date(year, month, day))); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period == 'M' || period == 'Y') + this._notifyChange(inst); + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var newDate = (minDate && date < minDate ? minDate : date); + newDate = (maxDate && newDate > maxDate ? maxDate : newDate); + return newDate; + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, 'onChangeMonthYear'); + if (onChange) + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, 'numberOfMonths'); + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst); + var date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + if (offset < 0) + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime())); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, 'shortYearCutoff'); + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), + monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day == 'object' ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); + } +}); + +/* + * Bind hover events for datepicker elements. + * Done via delegate so the binding only occurs once in the lifetime of the parent div. + * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. + */ +function bindHover(dpDiv) { + var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; + return dpDiv.delegate(selector, 'mouseout', function() { + $(this).removeClass('ui-state-hover'); + if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); + if (this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); + }) + .delegate(selector, 'mouseover', function(){ + if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { + $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); + $(this).addClass('ui-state-hover'); + if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); + if (this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); + } + }); +} + +/* jQuery extend now ignores nulls! */ +function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) + if (props[name] == null || props[name] == undefined) + target[name] = props[name]; + return target; +}; + +/* Invoke the datepicker functionality. + @param options string - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function(options){ + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick). + find(document.body).append($.datepicker.dpDiv); + $.datepicker.initialized = true; + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + return this.each(function() { + typeof options == 'string' ? + $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); +}; + +$.datepicker = new Datepicker(); // singleton instance +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.9.1"; + +// Workaround for #4055 +// Add another global to avoid noConflict issues with inline event handlers +window['DP_jQuery_' + dpuuid] = $; + +})(jQuery); +(function( $, undefined ) { + +var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ", + sizeRelatedOptions = { + buttons: true, + height: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + width: true + }, + resizableRelatedOptions = { + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true + }; + +$.widget("ui.dialog", { + version: "1.9.1", + options: { + autoOpen: true, + buttons: {}, + closeOnEscape: true, + closeText: "close", + dialogClass: "", + draggable: true, + hide: null, + height: "auto", + maxHeight: false, + maxWidth: false, + minHeight: 150, + minWidth: 150, + modal: false, + position: { + my: "center", + at: "center", + of: window, + collision: "fit", + // ensure that the titlebar is never outside the document + using: function( pos ) { + var topOffset = $( this ).css( pos ).offset().top; + if ( topOffset < 0 ) { + $( this ).css( "top", pos.top - topOffset ); + } + } + }, + resizable: true, + show: null, + stack: true, + title: "", + width: 300, + zIndex: 1000 + }, + + _create: function() { + this.originalTitle = this.element.attr( "title" ); + // #5742 - .attr() might return a DOMElement + if ( typeof this.originalTitle !== "string" ) { + this.originalTitle = ""; + } + this.oldPosition = { + parent: this.element.parent(), + index: this.element.parent().children().index( this.element ) + }; + this.options.title = this.options.title || this.originalTitle; + var that = this, + options = this.options, + + title = options.title || " ", + uiDialog, + uiDialogTitlebar, + uiDialogTitlebarClose, + uiDialogTitle, + uiDialogButtonPane; + + uiDialog = ( this.uiDialog = $( "
      " ) ) + .addClass( uiDialogClasses + options.dialogClass ) + .css({ + display: "none", + outline: 0, // TODO: move to stylesheet + zIndex: options.zIndex + }) + // setting tabIndex makes the div focusable + .attr( "tabIndex", -1) + .keydown(function( event ) { + if ( options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE ) { + that.close( event ); + event.preventDefault(); + } + }) + .mousedown(function( event ) { + that.moveToTop( false, event ); + }) + .appendTo( "body" ); + + this.element + .show() + .removeAttr( "title" ) + .addClass( "ui-dialog-content ui-widget-content" ) + .appendTo( uiDialog ); + + uiDialogTitlebar = ( this.uiDialogTitlebar = $( "
      " ) ) + .addClass( "ui-dialog-titlebar ui-widget-header " + + "ui-corner-all ui-helper-clearfix" ) + .bind( "mousedown", function() { + // Dialog isn't getting focus when dragging (#8063) + uiDialog.focus(); + }) + .prependTo( uiDialog ); + + uiDialogTitlebarClose = $( "" ) + .addClass( "ui-dialog-titlebar-close ui-corner-all" ) + .attr( "role", "button" ) + .click(function( event ) { + event.preventDefault(); + that.close( event ); + }) + .appendTo( uiDialogTitlebar ); + + ( this.uiDialogTitlebarCloseText = $( "" ) ) + .addClass( "ui-icon ui-icon-closethick" ) + .text( options.closeText ) + .appendTo( uiDialogTitlebarClose ); + + uiDialogTitle = $( "" ) + .uniqueId() + .addClass( "ui-dialog-title" ) + .html( title ) + .prependTo( uiDialogTitlebar ); + + uiDialogButtonPane = ( this.uiDialogButtonPane = $( "
      " ) ) + .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ); + + ( this.uiButtonSet = $( "
      " ) ) + .addClass( "ui-dialog-buttonset" ) + .appendTo( uiDialogButtonPane ); + + uiDialog.attr({ + role: "dialog", + "aria-labelledby": uiDialogTitle.attr( "id" ) + }); + + uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection(); + this._hoverable( uiDialogTitlebarClose ); + this._focusable( uiDialogTitlebarClose ); + + if ( options.draggable && $.fn.draggable ) { + this._makeDraggable(); + } + if ( options.resizable && $.fn.resizable ) { + this._makeResizable(); + } + + this._createButtons( options.buttons ); + this._isOpen = false; + + if ( $.fn.bgiframe ) { + uiDialog.bgiframe(); + } + + // prevent tabbing out of modal dialogs + this._on( uiDialog, { keydown: function( event ) { + if ( !options.modal || event.keyCode !== $.ui.keyCode.TAB ) { + return; + } + + var tabbables = $( ":tabbable", uiDialog ), + first = tabbables.filter( ":first" ), + last = tabbables.filter( ":last" ); + + if ( event.target === last[0] && !event.shiftKey ) { + first.focus( 1 ); + return false; + } else if ( event.target === first[0] && event.shiftKey ) { + last.focus( 1 ); + return false; + } + }}); + }, + + _init: function() { + if ( this.options.autoOpen ) { + this.open(); + } + }, + + _destroy: function() { + var next, + oldPosition = this.oldPosition; + + if ( this.overlay ) { + this.overlay.destroy(); + } + this.uiDialog.hide(); + this.element + .removeClass( "ui-dialog-content ui-widget-content" ) + .hide() + .appendTo( "body" ); + this.uiDialog.remove(); + + if ( this.originalTitle ) { + this.element.attr( "title", this.originalTitle ); + } + + next = oldPosition.parent.children().eq( oldPosition.index ); + // Don't try to place the dialog next to itself (#8613) + if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { + next.before( this.element ); + } else { + oldPosition.parent.append( this.element ); + } + }, + + widget: function() { + return this.uiDialog; + }, + + close: function( event ) { + var that = this, + maxZ, thisZ; + + if ( !this._isOpen ) { + return; + } + + if ( false === this._trigger( "beforeClose", event ) ) { + return; + } + + this._isOpen = false; + + if ( this.overlay ) { + this.overlay.destroy(); + } + + if ( this.options.hide ) { + this._hide( this.uiDialog, this.options.hide, function() { + that._trigger( "close", event ); + }); + } else { + this.uiDialog.hide(); + this._trigger( "close", event ); + } + + $.ui.dialog.overlay.resize(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + if ( this.options.modal ) { + maxZ = 0; + $( ".ui-dialog" ).each(function() { + if ( this !== that.uiDialog[0] ) { + thisZ = $( this ).css( "z-index" ); + if ( !isNaN( thisZ ) ) { + maxZ = Math.max( maxZ, thisZ ); + } + } + }); + $.ui.dialog.maxZ = maxZ; + } + + return this; + }, + + isOpen: function() { + return this._isOpen; + }, + + // the force parameter allows us to move modal dialogs to their correct + // position on open + moveToTop: function( force, event ) { + var options = this.options, + saveScroll; + + if ( ( options.modal && !force ) || + ( !options.stack && !options.modal ) ) { + return this._trigger( "focus", event ); + } + + if ( options.zIndex > $.ui.dialog.maxZ ) { + $.ui.dialog.maxZ = options.zIndex; + } + if ( this.overlay ) { + $.ui.dialog.maxZ += 1; + $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ; + this.overlay.$el.css( "z-index", $.ui.dialog.overlay.maxZ ); + } + + // Save and then restore scroll + // Opera 9.5+ resets when parent z-index is changed. + // http://bugs.jqueryui.com/ticket/3193 + saveScroll = { + scrollTop: this.element.scrollTop(), + scrollLeft: this.element.scrollLeft() + }; + $.ui.dialog.maxZ += 1; + this.uiDialog.css( "z-index", $.ui.dialog.maxZ ); + this.element.attr( saveScroll ); + this._trigger( "focus", event ); + + return this; + }, + + open: function() { + if ( this._isOpen ) { + return; + } + + var hasFocus, + options = this.options, + uiDialog = this.uiDialog; + + this._size(); + this._position( options.position ); + uiDialog.show( options.show ); + this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null; + this.moveToTop( true ); + + // set focus to the first tabbable element in the content area or the first button + // if there are no tabbable elements, set focus on the dialog itself + hasFocus = this.element.find( ":tabbable" ); + if ( !hasFocus.length ) { + hasFocus = this.uiDialogButtonPane.find( ":tabbable" ); + if ( !hasFocus.length ) { + hasFocus = uiDialog; + } + } + hasFocus.eq( 0 ).focus(); + + this._isOpen = true; + this._trigger( "open" ); + + return this; + }, + + _createButtons: function( buttons ) { + var that = this, + hasButtons = false; + + // if we already have a button pane, remove it + this.uiDialogButtonPane.remove(); + this.uiButtonSet.empty(); + + if ( typeof buttons === "object" && buttons !== null ) { + $.each( buttons, function() { + return !(hasButtons = true); + }); + } + if ( hasButtons ) { + $.each( buttons, function( name, props ) { + props = $.isFunction( props ) ? + { click: props, text: name } : + props; + var button = $( "" ) + .attr( props, true ) + .unbind( "click" ) + .click(function() { + props.click.apply( that.element[0], arguments ); + }) + .appendTo( that.uiButtonSet ); + if ( $.fn.button ) { + button.button(); + } + }); + this.uiDialog.addClass( "ui-dialog-buttons" ); + this.uiDialogButtonPane.appendTo( this.uiDialog ); + } else { + this.uiDialog.removeClass( "ui-dialog-buttons" ); + } + }, + + _makeDraggable: function() { + var that = this, + options = this.options; + + function filteredUi( ui ) { + return { + position: ui.position, + offset: ui.offset + }; + } + + this.uiDialog.draggable({ + cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", + handle: ".ui-dialog-titlebar", + containment: "document", + start: function( event, ui ) { + $( this ) + .addClass( "ui-dialog-dragging" ); + that._trigger( "dragStart", event, filteredUi( ui ) ); + }, + drag: function( event, ui ) { + that._trigger( "drag", event, filteredUi( ui ) ); + }, + stop: function( event, ui ) { + options.position = [ + ui.position.left - that.document.scrollLeft(), + ui.position.top - that.document.scrollTop() + ]; + $( this ) + .removeClass( "ui-dialog-dragging" ); + that._trigger( "dragStop", event, filteredUi( ui ) ); + $.ui.dialog.overlay.resize(); + } + }); + }, + + _makeResizable: function( handles ) { + handles = (handles === undefined ? this.options.resizable : handles); + var that = this, + options = this.options, + // .ui-resizable has position: relative defined in the stylesheet + // but dialogs have to use absolute or fixed positioning + position = this.uiDialog.css( "position" ), + resizeHandles = typeof handles === 'string' ? + handles : + "n,e,s,w,se,sw,ne,nw"; + + function filteredUi( ui ) { + return { + originalPosition: ui.originalPosition, + originalSize: ui.originalSize, + position: ui.position, + size: ui.size + }; + } + + this.uiDialog.resizable({ + cancel: ".ui-dialog-content", + containment: "document", + alsoResize: this.element, + maxWidth: options.maxWidth, + maxHeight: options.maxHeight, + minWidth: options.minWidth, + minHeight: this._minHeight(), + handles: resizeHandles, + start: function( event, ui ) { + $( this ).addClass( "ui-dialog-resizing" ); + that._trigger( "resizeStart", event, filteredUi( ui ) ); + }, + resize: function( event, ui ) { + that._trigger( "resize", event, filteredUi( ui ) ); + }, + stop: function( event, ui ) { + $( this ).removeClass( "ui-dialog-resizing" ); + options.height = $( this ).height(); + options.width = $( this ).width(); + that._trigger( "resizeStop", event, filteredUi( ui ) ); + $.ui.dialog.overlay.resize(); + } + }) + .css( "position", position ) + .find( ".ui-resizable-se" ) + .addClass( "ui-icon ui-icon-grip-diagonal-se" ); + }, + + _minHeight: function() { + var options = this.options; + + if ( options.height === "auto" ) { + return options.minHeight; + } else { + return Math.min( options.minHeight, options.height ); + } + }, + + _position: function( position ) { + var myAt = [], + offset = [ 0, 0 ], + isVisible; + + if ( position ) { + // deep extending converts arrays to objects in jQuery <= 1.3.2 :-( + // if (typeof position == 'string' || $.isArray(position)) { + // myAt = $.isArray(position) ? position : position.split(' '); + + if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) { + myAt = position.split ? position.split( " " ) : [ position[ 0 ], position[ 1 ] ]; + if ( myAt.length === 1 ) { + myAt[ 1 ] = myAt[ 0 ]; + } + + $.each( [ "left", "top" ], function( i, offsetPosition ) { + if ( +myAt[ i ] === myAt[ i ] ) { + offset[ i ] = myAt[ i ]; + myAt[ i ] = offsetPosition; + } + }); + + position = { + my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " + + myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]), + at: myAt.join( " " ) + }; + } + + position = $.extend( {}, $.ui.dialog.prototype.options.position, position ); + } else { + position = $.ui.dialog.prototype.options.position; + } + + // need to show the dialog to get the actual offset in the position plugin + isVisible = this.uiDialog.is( ":visible" ); + if ( !isVisible ) { + this.uiDialog.show(); + } + this.uiDialog.position( position ); + if ( !isVisible ) { + this.uiDialog.hide(); + } + }, + + _setOptions: function( options ) { + var that = this, + resizableOptions = {}, + resize = false; + + $.each( options, function( key, value ) { + that._setOption( key, value ); + + if ( key in sizeRelatedOptions ) { + resize = true; + } + if ( key in resizableRelatedOptions ) { + resizableOptions[ key ] = value; + } + }); + + if ( resize ) { + this._size(); + } + if ( this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", resizableOptions ); + } + }, + + _setOption: function( key, value ) { + var isDraggable, isResizable, + uiDialog = this.uiDialog; + + switch ( key ) { + case "buttons": + this._createButtons( value ); + break; + case "closeText": + // ensure that we always pass a string + this.uiDialogTitlebarCloseText.text( "" + value ); + break; + case "dialogClass": + uiDialog + .removeClass( this.options.dialogClass ) + .addClass( uiDialogClasses + value ); + break; + case "disabled": + if ( value ) { + uiDialog.addClass( "ui-dialog-disabled" ); + } else { + uiDialog.removeClass( "ui-dialog-disabled" ); + } + break; + case "draggable": + isDraggable = uiDialog.is( ":data(draggable)" ); + if ( isDraggable && !value ) { + uiDialog.draggable( "destroy" ); + } + + if ( !isDraggable && value ) { + this._makeDraggable(); + } + break; + case "position": + this._position( value ); + break; + case "resizable": + // currently resizable, becoming non-resizable + isResizable = uiDialog.is( ":data(resizable)" ); + if ( isResizable && !value ) { + uiDialog.resizable( "destroy" ); + } + + // currently resizable, changing handles + if ( isResizable && typeof value === "string" ) { + uiDialog.resizable( "option", "handles", value ); + } + + // currently non-resizable, becoming resizable + if ( !isResizable && value !== false ) { + this._makeResizable( value ); + } + break; + case "title": + // convert whatever was passed in o a string, for html() to not throw up + $( ".ui-dialog-title", this.uiDialogTitlebar ) + .html( "" + ( value || " " ) ); + break; + } + + this._super( key, value ); + }, + + _size: function() { + /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content + * divs will both have width and height set, so we need to reset them + */ + var nonContentHeight, minContentHeight, autoHeight, + options = this.options, + isVisible = this.uiDialog.is( ":visible" ); + + // reset content sizing + this.element.show().css({ + width: "auto", + minHeight: 0, + height: 0 + }); + + if ( options.minWidth > options.width ) { + options.width = options.minWidth; + } + + // reset wrapper sizing + // determine the height of all the non-content elements + nonContentHeight = this.uiDialog.css({ + height: "auto", + width: options.width + }) + .outerHeight(); + minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); + + if ( options.height === "auto" ) { + // only needed for IE6 support + if ( $.support.minHeight ) { + this.element.css({ + minHeight: minContentHeight, + height: "auto" + }); + } else { + this.uiDialog.show(); + autoHeight = this.element.css( "height", "auto" ).height(); + if ( !isVisible ) { + this.uiDialog.hide(); + } + this.element.height( Math.max( autoHeight, minContentHeight ) ); + } + } else { + this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); + } + + if (this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); + } + } +}); + +$.extend($.ui.dialog, { + uuid: 0, + maxZ: 0, + + getTitleId: function($el) { + var id = $el.attr( "id" ); + if ( !id ) { + this.uuid += 1; + id = this.uuid; + } + return "ui-dialog-title-" + id; + }, + + overlay: function( dialog ) { + this.$el = $.ui.dialog.overlay.create( dialog ); + } +}); + +$.extend( $.ui.dialog.overlay, { + instances: [], + // reuse old instances due to IE memory leak with alpha transparency (see #5185) + oldInstances: [], + maxZ: 0, + events: $.map( + "focus,mousedown,mouseup,keydown,keypress,click".split( "," ), + function( event ) { + return event + ".dialog-overlay"; + } + ).join( " " ), + create: function( dialog ) { + if ( this.instances.length === 0 ) { + // prevent use of anchors and inputs + // we use a setTimeout in case the overlay is created from an + // event that we're going to be cancelling (see #2804) + setTimeout(function() { + // handle $(el).dialog().dialog('close') (see #4065) + if ( $.ui.dialog.overlay.instances.length ) { + $( document ).bind( $.ui.dialog.overlay.events, function( event ) { + // stop events if the z-index of the target is < the z-index of the overlay + // we cannot return true when we don't want to cancel the event (#3523) + if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) { + return false; + } + }); + } + }, 1 ); + + // handle window resize + $( window ).bind( "resize.dialog-overlay", $.ui.dialog.overlay.resize ); + } + + var $el = ( this.oldInstances.pop() || $( "
      " ).addClass( "ui-widget-overlay" ) ); + + // allow closing by pressing the escape key + $( document ).bind( "keydown.dialog-overlay", function( event ) { + var instances = $.ui.dialog.overlay.instances; + // only react to the event if we're the top overlay + if ( instances.length !== 0 && instances[ instances.length - 1 ] === $el && + dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE ) { + + dialog.close( event ); + event.preventDefault(); + } + }); + + $el.appendTo( document.body ).css({ + width: this.width(), + height: this.height() + }); + + if ( $.fn.bgiframe ) { + $el.bgiframe(); + } + + this.instances.push( $el ); + return $el; + }, + + destroy: function( $el ) { + var indexOf = $.inArray( $el, this.instances ), + maxZ = 0; + + if ( indexOf !== -1 ) { + this.oldInstances.push( this.instances.splice( indexOf, 1 )[ 0 ] ); + } + + if ( this.instances.length === 0 ) { + $( [ document, window ] ).unbind( ".dialog-overlay" ); + } + + $el.height( 0 ).width( 0 ).remove(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + $.each( this.instances, function() { + maxZ = Math.max( maxZ, this.css( "z-index" ) ); + }); + this.maxZ = maxZ; + }, + + height: function() { + var scrollHeight, + offsetHeight; + // handle IE + if ( $.ui.ie ) { + scrollHeight = Math.max( + document.documentElement.scrollHeight, + document.body.scrollHeight + ); + offsetHeight = Math.max( + document.documentElement.offsetHeight, + document.body.offsetHeight + ); + + if ( scrollHeight < offsetHeight ) { + return $( window ).height() + "px"; + } else { + return scrollHeight + "px"; + } + // handle "good" browsers + } else { + return $( document ).height() + "px"; + } + }, + + width: function() { + var scrollWidth, + offsetWidth; + // handle IE + if ( $.ui.ie ) { + scrollWidth = Math.max( + document.documentElement.scrollWidth, + document.body.scrollWidth + ); + offsetWidth = Math.max( + document.documentElement.offsetWidth, + document.body.offsetWidth + ); + + if ( scrollWidth < offsetWidth ) { + return $( window ).width() + "px"; + } else { + return scrollWidth + "px"; + } + // handle "good" browsers + } else { + return $( document ).width() + "px"; + } + }, + + resize: function() { + /* If the dialog is draggable and the user drags it past the + * right edge of the window, the document becomes wider so we + * need to stretch the overlay. If the user then drags the + * dialog back to the left, the document will become narrower, + * so we need to shrink the overlay to the appropriate size. + * This is handled by shrinking the overlay before setting it + * to the full document size. + */ + var $overlays = $( [] ); + $.each( $.ui.dialog.overlay.instances, function() { + $overlays = $overlays.add( this ); + }); + + $overlays.css({ + width: 0, + height: 0 + }).css({ + width: $.ui.dialog.overlay.width(), + height: $.ui.dialog.overlay.height() + }); + } +}); + +$.extend( $.ui.dialog.overlay.prototype, { + destroy: function() { + $.ui.dialog.overlay.destroy( this.$el ); + } +}); + +}( jQuery ) ); +(function( $, undefined ) { + +var mouseHandled = false; + +$.widget( "ui.menu", { + version: "1.9.1", + defaultElement: "
      "+(o[0]>0&&I==o[1]-1?'
      ':""):""),F+=U}B+=F}return B+=x+($.ui.ie6&&!e.inline?'':""),e._keyEvent=!1,B},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),c='
      ',h="";if(s||!a)h+=''+o[t]+"";else{var p=r&&r.getFullYear()==n,d=i&&i.getFullYear()==n;h+='"}l||(c+=h+(s||!a||!f?" ":""));if(!e.yearshtml){e.yearshtml="";if(s||!f)c+=''+n+"";else{var m=this._get(e,"yearRange").split(":"),g=(new Date).getFullYear(),y=function(e){var t=e.match(/c[+-].*/)?n+parseInt(e.substring(1),10):e.match(/[+-].*/)?g+parseInt(e,10):parseInt(e,10);return isNaN(t)?g:t},b=y(m[0]),w=Math.max(b,y(m[1]||""));b=r?Math.max(b,r.getFullYear()):b,w=i?Math.min(w,i.getFullYear()):w,e.yearshtml+='",c+=e.yearshtml,e.yearshtml=null}}return c+=this._get(e,"yearSuffix"),l&&(c+=(s||!a||!f?" ":"")+h),c+="
      ",c},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n=="Y"?t:0),i=e.drawMonth+(n=="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n=="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n=="M"||n=="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&tr?r:i,i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max");return(!n||t.getTime()>=n.getTime())&&(!r||t.getTime()<=r.getTime())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),$.fn.datepicker=function(e){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return typeof e!="string"||e!="isDisabled"&&e!="getDate"&&e!="widget"?e=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){typeof e=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.1",window["DP_jQuery_"+dpuuid]=$})(jQuery);(function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.1",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||" ",s,o,u,a,f;s=(this.uiDialog=e("
      ")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("
      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("
      ")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("
      ")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){r=e.isFunction(r)?{click:r,text:t}:r;var i=e("").attr(r,!0).unbind("click").click(function(){r.click.apply(n.element[0],arguments)}).appendTo(n.uiButtonSet);e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||" "))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus+":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"});t=r.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),r.each(function(){var t=e(this),r=t.prev("a"),i=e("").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()
      ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})})(jQuery);(function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.1",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="",u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("
      ").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;tn&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})})(jQuery);(function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.1",defaultElement:"",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""+""+""+""+""},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e1&&e.href.replace(r,"")===location.href.replace(r,"")}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.9.1",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,n=this.options,r=n.active,i=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs();if(r===null){i&&this.tabs.each(function(t,n){if(e(n).attr("aria-controls")===i)return r=t,!1}),r===null&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(r===null||r===-1)r=this.tabs.length?0:!1}r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=n.collapsible?!1:0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("
      ").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r,i=this.element.parent();t==="fill"?(e.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n):t.removeAttr("aria-controls")}),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&(e.ui.tabs.prototype._ui=function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},e.widget("ui.tabs",e.ui.tabs,{url:function(e,t){this.anchors.eq(e).attr("href",t)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var t=this;this._on({tabsbeforeload:function(n,r){if(e.data(r.tab[0],"cache.tabs")){n.preventDefault();return}r.jqXHR.success(function(){t.options.cache&&e.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(t,n,r){var i=this.options.ajaxOptions;return e.extend({},i,{error:function(e,t){try{i.error(e,t,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(e,t){e==="cache"&&t===!1&&this.anchors.removeData("cache.tabs"),this._super(e,t)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(e){this.anchors.eq(e).removeData("cache.tabs"),this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"Loading…"},_create:function(){this._super(),this._on({tabsbeforeload:function(e,t){if(e.target!==this.element[0]||!this.options.spinner)return;var n=t.tab.find("span"),r=n.html();n.html(this.options.spinner),t.jqXHR.complete(function(){n.html(r)})}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(t){var n=this.options,r;if(t&&n.disabled===!0||e.isArray(n.disabled)&&e.inArray(t,n.disabled)!==-1)r=!0;this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t]))},disable:function(t){var n=this.options,r;if(t&&n.disabled===!1||e.isArray(n.disabled)&&e.inArray(t,n.disabled)===-1)r=!0;this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[t],this.panels[t]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"
    • #{label}
    • "},add:function(n,r,i){i===t&&(i=this.anchors.length);var s,o,u=this.options,a=e(u.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),f=n.indexOf("#")?this._tabId(a):n.replace("#","");return a.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),a.attr("aria-controls",f),s=i>=this.tabs.length,o=this.element.find("#"+f),o.length||(o=this._createPanel(f),s?i>0?o.insertAfter(this.panels.eq(-1)):o.appendTo(this.element):o.insertBefore(this.panels[i])),o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),s?a.appendTo(this.tablist):a.insertBefore(this.tabs[i]),u.disabled=e.map(u.disabled,function(e){return e>=i?++e:e}),this.refresh(),this.tabs.length===1&&u.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.tabs.eq(t).remove(),i=this._getPanelForTab(r).remove();return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(t+(t+1=t?--e:e}),this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(t){var n=t.is("li")?t.find("a[href]"):t;return n=n[0],e(n).closest("li").attr("aria-controls")||n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"
      "},_createPanel:function(t){return e(this.options.panelTemplate).attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var e=this.options;e.active===null&&e.selected!==t&&(e.active=e.selected===-1?!1:e.selected),this._super(),e.selected=e.active,e.selected===!1&&(e.selected=-1)},_setOption:function(e,t){if(e!=="selected")return this._super(e,t);var n=this.options;this._super("active",t===-1?!1:t),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(e,t,n){var r=this._superApply(arguments);return r?(e==="beforeActivate"&&n.newTab.length?r=this._super("select",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()}):e==="activate"&&n.newTab.length&&(r=this._super("show",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),r):!1}}),e.widget("ui.tabs",e.ui.tabs,{select:function(e){e=this._getIndex(e);if(e===-1){if(!this.options.collapsible||this.options.selected===-1)return;e=this.options.selected}this.anchors.eq(e).trigger(this.options.event+this.eventNamespace)}}),function(){var t=0;e.widget("ui.tabs",e.ui.tabs,{options:{cookie:null},_create:function(){var e=this.options,t;e.active==null&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++t)];return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),e.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(t,n,r){var i=e.extend({},r);return t==="load"&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(t,n,i)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var t,n,r=this.options.fx;return r&&(e.isArray(r)?(t=r[0],n=r[1]):t=n=r),r?{show:n,hide:t}:null},_toggle:function(e,t){function o(){n.running=!1,n._trigger("activate",e,t)}function u(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&s.show?r.animate(s.show,s.show.duration,function(){o()}):(r.show(),o())}var n=this,r=t.newPanel,i=t.oldPanel,s=this._getFx();if(!s)return this._super(e,t);n.running=!0,i.length&&s.hide?i.animate(s.hide,s.hide.duration,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i.hide(),u())}}))})(jQuery);(function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.9.1",options:{content:function(){return e(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flipfit"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length)return;if(this.options.track&&r.data("ui-tooltip-id")){this._find(r).position(e.extend({of:r},this.options.position)),this._off(this.document,"mousemove");return}r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t;e(this).data("tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,n.close(t,!0)),this.title&&(e(this).uniqueId(),n.parents[this.id]={element:this,title:this.title},this.title="")}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("tooltip-open"))return;i._delay(function(){this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.originalEvent.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(e,t){t.element.title=t.title,delete n.parents[e]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("
      ").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("
      ").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),e.fn.bgiframe&&i.bgiframe(),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})})(jQuery);jQuery.effects||function(e,t){var n=e.uiBackCompat!==!1,r="ui-effects-";e.effects={effect:{}},function(t,n){function p(e,t,n){var r=a[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.1",save:function(e,t){for(var n=0;n
      ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery);(function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}})(jQuery);(function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h
      ").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}})(jQuery);(function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}})(jQuery);(function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}})(jQuery);(function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}})(jQuery);(function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}})(jQuery);(function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e('
      ').appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}})(jQuery); \ No newline at end of file diff --git a/addons/web/static/lib/jquery/jquery-1.7.2.js b/addons/web/static/lib/jquery/jquery-1.8.2.js similarity index 57% rename from addons/web/static/lib/jquery/jquery-1.7.2.js rename to addons/web/static/lib/jquery/jquery-1.8.2.js index 3774ff98613..d4f3bb38cda 100644 --- a/addons/web/static/lib/jquery/jquery-1.7.2.js +++ b/addons/web/static/lib/jquery/jquery-1.8.2.js @@ -1,31 +1,28 @@ /*! - * jQuery JavaScript Library v1.7.2 + * jQuery JavaScript Library v1.8.2 * http://jquery.com/ * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * * Includes Sizzle.js * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. * - * Date: Wed Mar 21 12:46:34 2012 -0700 + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time) */ (function( window, undefined ) { +var + // A central reference to the root jQuery(document) + rootjQuery, -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, + // The deferred used on DOM ready + readyList, + + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + location = window.location, navigator = window.navigator, - location = window.location; -var jQuery = (function() { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, // Map over jQuery in case of overwrite _jQuery = window.jQuery, @@ -33,63 +30,64 @@ var jQuery = function( selector, context ) { // Map over the $ in case of overwrite _$ = window.$, - // A central reference to the root jQuery(document) - rootjQuery, + // Save a reference to some core methods + core_push = Array.prototype.push, + core_slice = Array.prototype.slice, + core_indexOf = Array.prototype.indexOf, + core_toString = Object.prototype.toString, + core_hasOwn = Object.prototype.hasOwnProperty, + core_trim = String.prototype.trim, - // A simple way to check for HTML strings or ID strings + // Define a local copy of jQuery + jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Used for matching numbers + core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, + + // Used for detecting and trimming whitespace + core_rnotwhite = /\S/, + core_rspace = /\s+/, + + // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // A simple way to check for HTML strings // Prioritize #id over to avoid XSS via location.hash (#9521) - quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, + rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, + rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g, // Matches dashed string for camelizing - rdashAlpha = /-([a-z]|[0-9])/ig, rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return ( letter + "" ).toUpperCase(); }, - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // The deferred used on DOM ready - readyList, - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, + // The ready event handler and self cleanup method + DOMContentLoaded = function() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + } else if ( document.readyState === "complete" ) { + // we're here because readyState === "complete" in oldIE + // which is good enough for us to call the dom ready! + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }, // [[Class]] -> type pairs class2type = {}; @@ -99,7 +97,7 @@ jQuery.fn = jQuery.prototype = { init: function( selector, context, rootjQuery ) { var match, elem, ret, doc; - // Handle $(""), $(null), or $(undefined) + // Handle $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } @@ -111,55 +109,33 @@ jQuery.fn = jQuery.prototype = { return this; } - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = selector; - this.length = 1; - return this; - } - // Handle HTML strings if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { - match = quickExpr.exec( selector ); + match = rquickExpr.exec( selector ); } - // Verify a match, and that no context was specified for #id + // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; - doc = ( context ? context.ownerDocument || context : document ); + doc = ( context && context.nodeType ? context.ownerDocument || context : document ); - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; + // scripts is true for back-compat + selector = jQuery.parseHTML( match[1], doc, true ); + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + this.attr.call( selector, context, true ); } return jQuery.merge( this, selector ); - // HANDLE: $("#id") + // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); @@ -210,7 +186,7 @@ jQuery.fn = jQuery.prototype = { selector: "", // The current version of jQuery being used - jquery: "1.7.2", + jquery: "1.8.2", // The default length of a jQuery object is 0 length: 0, @@ -221,7 +197,7 @@ jQuery.fn = jQuery.prototype = { }, toArray: function() { - return slice.call( this, 0 ); + return core_slice.call( this ); }, // Get the Nth element in the matched element set OR @@ -239,15 +215,9 @@ jQuery.fn = jQuery.prototype = { // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set - var ret = this.constructor(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - - } else { - jQuery.merge( ret, elems ); - } + var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; @@ -272,11 +242,8 @@ jQuery.fn = jQuery.prototype = { }, ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - // Add the callback - readyList.add( fn ); + jQuery.ready.promise().done( fn ); return this; }, @@ -297,8 +264,8 @@ jQuery.fn = jQuery.prototype = { }, slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); + return this.pushStack( core_slice.apply( this, arguments ), + "slice", core_slice.call(arguments).join(",") ); }, map: function( callback ) { @@ -313,7 +280,7 @@ jQuery.fn = jQuery.prototype = { // For internal use only. // Behaves like an Array's method, not like a jQuery method. - push: push, + push: core_push, sort: [].sort, splice: [].splice }; @@ -416,73 +383,31 @@ jQuery.extend({ // Handle when the DOM is ready ready: function( wait ) { - // Either a released hold or an DOMready/load event and not yet ready - if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.fireWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).off( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyList ) { + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } - readyList = jQuery.Callbacks( "once memory" ); - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { return setTimeout( jQuery.ready, 1 ); } - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + // Remember that the DOM is ready + jQuery.isReady = true; - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger("ready").off("ready"); } }, @@ -508,7 +433,7 @@ jQuery.extend({ type: function( obj ) { return obj == null ? String( obj ) : - class2type[ toString.call(obj) ] || "object"; + class2type[ core_toString.call(obj) ] || "object"; }, isPlainObject: function( obj ) { @@ -522,8 +447,8 @@ jQuery.extend({ try { // Not own constructor property must be Object if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + !core_hasOwn.call(obj, "constructor") && + !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { @@ -537,11 +462,12 @@ jQuery.extend({ var key; for ( key in obj ) {} - return key === undefined || hasOwn.call( obj, key ); + return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { - for ( var name in obj ) { + var name; + for ( name in obj ) { return false; } return true; @@ -551,8 +477,32 @@ jQuery.extend({ throw new Error( msg ); }, + // data: string of html + // context (optional): If specified, the fragment will be created in this context, defaults to document + // scripts (optional): If true, will include scripts passed in the html string + parseHTML: function( data, context, scripts ) { + var parsed; + if ( !data || typeof data !== "string" ) { + return null; + } + if ( typeof context === "boolean" ) { + scripts = context; + context = 0; + } + context = context || document; + + // Single tag + if ( (parsed = rsingleTag.exec( data )) ) { + return [ context.createElement( parsed[1] ) ]; + } + + parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] ); + return jQuery.merge( [], + (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes ); + }, + parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { + if ( !data || typeof data !== "string") { return null; } @@ -578,10 +528,10 @@ jQuery.extend({ // Cross-browser xml parsing parseXML: function( data ) { - if ( typeof data !== "string" || !data ) { + var xml, tmp; + if ( !data || typeof data !== "string" ) { return null; } - var xml, tmp; try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); @@ -606,7 +556,7 @@ jQuery.extend({ // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { - if ( data && rnotwhite.test( data ) ) { + if ( data && core_rnotwhite.test( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox @@ -623,25 +573,26 @@ jQuery.extend({ }, nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction( object ); + each: function( obj, callback, args ) { + var name, + i = 0, + length = obj.length, + isObj = length === undefined || jQuery.isFunction( obj ); if ( args ) { if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { + for ( name in obj ) { + if ( callback.apply( obj[ name ], args ) === false ) { break; } } } else { for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { + if ( callback.apply( obj[ i++ ], args ) === false ) { break; } } @@ -650,71 +601,72 @@ jQuery.extend({ // A special, fast, case for the most common use of each } else { if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + for ( name in obj ) { + if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) { break; } } } else { for ( ; i < length; ) { - if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { + if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) { break; } } } } - return object; + return obj; }, // Use native String.trim function wherever possible - trim: trim ? + trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : - trim.call( text ); + core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; + makeArray: function( arr, results ) { + var type, + ret = results || []; - if ( array != null ) { + if ( arr != null ) { // The window, strings (and functions) also have 'length' // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type( array ); + type = jQuery.type( arr ); - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); + if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) { + core_push.call( ret, arr ); } else { - jQuery.merge( ret, array ); + jQuery.merge( ret, arr ); } } return ret; }, - inArray: function( elem, array, i ) { + inArray: function( elem, arr, i ) { var len; - if ( array ) { - if ( indexOf ) { - return indexOf.call( array, elem, i ); + if ( arr ) { + if ( core_indexOf ) { + return core_indexOf.call( arr, elem, i ); } - len = array.length; + len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays - if ( i in array && array[ i ] === elem ) { + if ( i in arr && arr[ i ] === elem ) { return i; } } @@ -724,11 +676,12 @@ jQuery.extend({ }, merge: function( first, second ) { - var i = first.length, + var l = second.length, + i = first.length, j = 0; - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { + if ( typeof l === "number" ) { + for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } @@ -744,12 +697,15 @@ jQuery.extend({ }, grep: function( elems, callback, inv ) { - var ret = [], retVal; + var retVal, + ret = [], + i = 0, + length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { + for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); @@ -761,7 +717,8 @@ jQuery.extend({ // arg is for internal usage only map: function( elems, callback, arg ) { - var value, key, ret = [], + var value, key, + ret = [], i = 0, length = elems.length, // jquery objects are treated as arrays @@ -798,8 +755,10 @@ jQuery.extend({ // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { + var tmp, args, proxy; + if ( typeof context === "string" ) { - var tmp = fn[ context ]; + tmp = fn[ context ]; context = fn; fn = tmp; } @@ -811,18 +770,18 @@ jQuery.extend({ } // Simulated bind - var args = slice.call( arguments, 2 ), - proxy = function() { - return fn.apply( context, args.concat( slice.call( arguments ) ) ); - }; + args = core_slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context, args.concat( core_slice.call( arguments ) ) ); + }; // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, - // Mutifunctional method to get and set values to a collection + // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, pass ) { var exec, @@ -877,136 +836,96 @@ jQuery.extend({ now: function() { return ( new Date() ).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - sub: function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; - }, - - browser: {} + } }); +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // we once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( jQuery.ready, 1 ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else { + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch(e) {} + + if ( top && top.doScroll ) { + (function doScrollCheck() { + if ( !jQuery.isReady ) { + + try { + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll("left"); + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + } + + // and execute any waiting functions + jQuery.ready(); + } + })(); + } + } + } + return readyList.promise( obj ); +}; + // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -// IE doesn't match non-breaking spaces with \s -if ( rnotwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} - // All jQuery objects should point back to these rootjQuery = jQuery(document); +// String to Object options format cache +var optionsCache = {}; -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -return jQuery; - -})(); - - -// String to Object flags format cache -var flagsCache = {}; - -// Convert String-formatted flags into Object-formatted ones and store in cache -function createFlags( flags ) { - var object = flagsCache[ flags ] = {}, - i, length; - flags = flags.split( /\s+/ ); - for ( i = 0, length = flags.length; i < length; i++ ) { - object[ flags[i] ] = true; - } +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + jQuery.each( options.split( core_rspace ), function( _, flag ) { + object[ flag ] = true; + }); return object; } /* * Create a callback list using the following parameters: * - * flags: an optional list of space-separated flags that will change how - * the callback list behaves + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * - * Possible flags: + * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * @@ -1019,17 +938,15 @@ function createFlags( flags ) { * stopOnFalse: interrupt callings when a callback returns false * */ -jQuery.Callbacks = function( flags ) { +jQuery.Callbacks = function( options ) { - // Convert flags from String-formatted to Object-formatted + // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) - flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + jQuery.extend( {}, options ); - var // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = [], - // Last fire value (for non-forgettable lists) + var // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, @@ -1041,53 +958,34 @@ jQuery.Callbacks = function( flags ) { firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, - // Add one or several callbacks to the list - add = function( args ) { - var i, - length, - elem, - type, - actual; - for ( i = 0, length = args.length; i < length; i++ ) { - elem = args[ i ]; - type = jQuery.type( elem ); - if ( type === "array" ) { - // Inspect recursively - add( elem ); - } else if ( type === "function" ) { - // Add if not in unique mode and callback is not in - if ( !flags.unique || !self.has( elem ) ) { - list.push( elem ); - } - } - } - }, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], // Fire callbacks - fire = function( context, args ) { - args = args || []; - memory = !flags.memory || [ context, args ]; + fire = function( data ) { + memory = options.memory && data; fired = true; - firing = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; + firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { - memory = true; // Mark as halted + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { - if ( !flags.once ) { - if ( stack && stack.length ) { - memory = stack.shift(); - self.fireWith( memory[ 0 ], memory[ 1 ] ); + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); } - } else if ( memory === true ) { - self.disable(); - } else { + } else if ( memory ) { list = []; + } else { + self.disable(); } } }, @@ -1096,18 +994,28 @@ jQuery.Callbacks = function( flags ) { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { - var length = list.length; - add( arguments ); + // First, we save the current length + var start = list.length; + (function add( args ) { + jQuery.each( args, function( _, arg ) { + var type = jQuery.type( arg ); + if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) { + list.push( arg ); + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then - // we should call right away, unless previous - // firing was halted (stopOnFalse) - } else if ( memory && memory !== true ) { - firingStart = length; - fire( memory[ 0 ], memory[ 1 ] ); + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); } } return this; @@ -1115,46 +1023,27 @@ jQuery.Callbacks = function( flags ) { // Remove a callback from the list remove: function() { if ( list ) { - var args = arguments, - argIndex = 0, - argLength = args.length; - for ( ; argIndex < argLength ; argIndex++ ) { - for ( var i = 0; i < list.length; i++ ) { - if ( args[ argIndex ] === list[ i ] ) { - // Handle firingIndex and firingLength - if ( firing ) { - if ( i <= firingLength ) { - firingLength--; - if ( i <= firingIndex ) { - firingIndex--; - } - } + jQuery.each( arguments, function( _, arg ) { + var index; + while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; } - // Remove the element - list.splice( i--, 1 ); - // If we have some unicity property then - // we only need to do this once - if ( flags.unique ) { - break; + if ( index <= firingIndex ) { + firingIndex--; } } } - } + }); } return this; }, // Control if a given callback is in the list has: function( fn ) { - if ( list ) { - var i = 0, - length = list.length; - for ( ; i < length; i++ ) { - if ( fn === list[ i ] ) { - return true; - } - } - } - return false; + return jQuery.inArray( fn, list ) > -1; }, // Remove all callbacks from the list empty: function() { @@ -1173,7 +1062,7 @@ jQuery.Callbacks = function( flags ) { // Lock the list in its current state lock: function() { stack = undefined; - if ( !memory || memory === true ) { + if ( !memory ) { self.disable(); } return this; @@ -1184,13 +1073,13 @@ jQuery.Callbacks = function( flags ) { }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { - if ( stack ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( list && ( !fired || stack ) ) { if ( firing ) { - if ( !flags.once ) { - stack.push( [ context, args ] ); - } - } else if ( !( flags.once && memory ) ) { - fire( context, args ); + stack.push( args ); + } else { + fire( args ); } } return this; @@ -1208,98 +1097,85 @@ jQuery.Callbacks = function( flags ) { return self; }; - - - - -var // Static reference to slice - sliceDeferred = [].slice; - jQuery.extend({ Deferred: function( func ) { - var doneList = jQuery.Callbacks( "once memory" ), - failList = jQuery.Callbacks( "once memory" ), - progressList = jQuery.Callbacks( "memory" ), + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory") ] + ], state = "pending", - lists = { - resolve: doneList, - reject: failList, - notify: progressList - }, promise = { - done: doneList.add, - fail: failList.add, - progress: progressList.add, - state: function() { return state; }, - - // Deprecated - isResolved: doneList.fired, - isRejected: failList.fired, - - then: function( doneCallbacks, failCallbacks, progressCallbacks ) { - deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); - return this; - }, always: function() { - deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); + deferred.done( arguments ).fail( arguments ); return this; }, - pipe: function( fnDone, fnFail, fnProgress ) { + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; return jQuery.Deferred(function( newDefer ) { - jQuery.each( { - done: [ fnDone, "resolve" ], - fail: [ fnFail, "reject" ], - progress: [ fnProgress, "notify" ] - }, function( handler, data ) { - var fn = data[ 0 ], - action = data[ 1 ], - returned; - if ( jQuery.isFunction( fn ) ) { - deferred[ handler ](function() { - returned = fn.apply( this, arguments ); + jQuery.each( tuples, function( i, tuple ) { + var action = tuple[ 0 ], + fn = fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ]( jQuery.isFunction( fn ) ? + function() { + var returned = fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); } - }); - } else { - deferred[ handler ]( newDefer[ action ] ); - } + } : + newDefer[ action ] + ); }); + fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { - if ( obj == null ) { - obj = promise; - } else { - for ( var key in promise ) { - obj[ key ] = promise[ key ]; - } - } - return obj; + return obj != null ? jQuery.extend( obj, promise ) : promise; } }, - deferred = promise.promise({}), - key; + deferred = {}; - for ( key in lists ) { - deferred[ key ] = lists[ key ].fire; - deferred[ key + "With" ] = lists[ key ].fireWith; - } + // Keep pipe for back-compat + promise.pipe = promise.then; - // Handle state - deferred.done( function() { - state = "resolved"; - }, failList.disable, progressList.lock ).fail( function() { - state = "rejected"; - }, doneList.disable, progressList.lock ); + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; + + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] = list.fire + deferred[ tuple[0] ] = list.fire; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); // Call given func if any if ( func ) { @@ -1311,52 +1187,57 @@ jQuery.extend({ }, // Deferred helper - when: function( firstParam ) { - var args = sliceDeferred.call( arguments, 0 ), - i = 0, - length = args.length, - pValues = new Array( length ), - count = length, - pCount = length, - deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? - firstParam : - jQuery.Deferred(), - promise = deferred.promise(); - function resolveFunc( i ) { - return function( value ) { - args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - if ( !( --count ) ) { - deferred.resolveWith( deferred, args ); - } - }; - } - function progressFunc( i ) { - return function( value ) { - pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - deferred.notifyWith( promise, pValues ); - }; - } + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = core_slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; + if( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); for ( ; i < length; i++ ) { - if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { - args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); } else { - --count; + --remaining; } } - if ( !count ) { - deferred.resolveWith( deferred, args ); - } - } else if ( deferred !== firstParam ) { - deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); } - return promise; + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); } }); - - - - jQuery.support = (function() { var support, @@ -1366,30 +1247,29 @@ jQuery.support = (function() { opt, input, fragment, - tds, - events, eventName, i, isSupported, - div = document.createElement( "div" ), - documentElement = document.documentElement; + clickFn, + div = document.createElement("div"); // Preliminary tests - div.setAttribute("className", "t"); - div.innerHTML = "
      a"; + div.setAttribute( "className", "t" ); + div.innerHTML = "
      a"; - all = div.getElementsByTagName( "*" ); - a = div.getElementsByTagName( "a" )[ 0 ]; + all = div.getElementsByTagName("*"); + a = div.getElementsByTagName("a")[ 0 ]; + a.style.cssText = "top:1px;float:left;opacity:.5"; // Can't get basic test support - if ( !all || !all.length || !a ) { + if ( !all || !all.length ) { return {}; } // First batch of supports tests - select = document.createElement( "select" ); + select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName( "input" )[ 0 ]; + input = div.getElementsByTagName("input")[ 0 ]; support = { // IE strips leading whitespace when .innerHTML is used @@ -1414,7 +1294,7 @@ jQuery.support = (function() { // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55/.test( a.style.opacity ), + opacity: /^0.5/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) @@ -1439,6 +1319,9 @@ jQuery.support = (function() { // Where outerHTML is undefined, this still works html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", + // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode + boxModel: ( document.compatMode === "CSS1Compat" ), + // Will be defined later submitBubbles: true, changeBubbles: true, @@ -1448,12 +1331,10 @@ jQuery.support = (function() { inlineBlockNeedsLayout: false, shrinkWrapBlocks: false, reliableMarginRight: true, - pixelMargin: true + boxSizingReliable: true, + pixelPosition: false }; - // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead - jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat"); - // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; @@ -1472,22 +1353,23 @@ jQuery.support = (function() { } if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", function() { + div.attachEvent( "onclick", clickFn = function() { // Cloning a node shouldn't copy over any // bound event handlers (IE does this) support.noCloneEvent = false; }); - div.cloneNode( true ).fireEvent( "onclick" ); + div.cloneNode( true ).fireEvent("onclick"); + div.detachEvent( "onclick", clickFn ); } // Check if a radio maintains its value // after being appended to the DOM input = document.createElement("input"); input.value = "t"; - input.setAttribute("type", "radio"); + input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; - input.setAttribute("checked", "checked"); + input.setAttribute( "checked", "checked" ); // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "name", "t" ); @@ -1514,9 +1396,9 @@ jQuery.support = (function() { // to go haywire. See: https://developer.mozilla.org/en/Security/CSP if ( div.attachEvent ) { for ( i in { - submit: 1, - change: 1, - focusin: 1 + submit: true, + change: true, + focusin: true }) { eventName = "on" + i; isSupported = ( eventName in div ); @@ -1528,16 +1410,10 @@ jQuery.support = (function() { } } - fragment.removeChild( div ); - - // Null elements to avoid leaks in IE - fragment = select = opt = div = input = null; - // Run tests that need a body at doc ready jQuery(function() { - var container, outer, inner, table, td, offsetSupport, - marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight, - paddingMarginBorderVisibility, paddingMarginBorder, + var container, div, tds, marginDiv, + divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;", body = document.getElementsByTagName("body")[0]; if ( !body ) { @@ -1545,17 +1421,8 @@ jQuery.support = (function() { return; } - conMarginTop = 1; - paddingMarginBorder = "padding:0;margin:0;border:"; - positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;"; - paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;"; - style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;"; - html = "
      " + - "" + - "
      "; - container = document.createElement("div"); - container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; + container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px"; body.insertBefore( container, body.firstChild ); // Construct the test element @@ -1569,8 +1436,9 @@ jQuery.support = (function() { // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). // (only IE 8 fails this test) - div.innerHTML = "
      t
      "; - tds = div.getElementsByTagName( "td" ); + div.innerHTML = "
      t
      "; + tds = div.getElementsByTagName("td"); + tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; @@ -1580,20 +1448,30 @@ jQuery.support = (function() { // (IE <= 8 fail this test) support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + // Check box-sizing and margin behavior + div.innerHTML = ""; + div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; + support.boxSizing = ( div.offsetWidth === 4 ); + support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); + + // NOTE: To any future maintainer, we've window.getComputedStyle + // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { - div.innerHTML = ""; - marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; - marginDiv.style.marginRight = "0"; - div.style.width = "2px"; + support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; + support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + marginDiv = document.createElement("div"); + marginDiv.style.cssText = div.style.cssText = divReset; + marginDiv.style.marginRight = marginDiv.style.width = "0"; + div.style.width = "1px"; div.appendChild( marginDiv ); support.reliableMarginRight = - ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; + !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== "undefined" ) { @@ -1602,74 +1480,40 @@ jQuery.support = (function() { // them layout // (IE < 8 does this) div.innerHTML = ""; - div.style.width = div.style.padding = "1px"; - div.style.border = 0; - div.style.overflow = "hidden"; - div.style.display = "inline"; - div.style.zoom = 1; + div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Check if elements with layout shrink-wrap their children // (IE 6 does this) div.style.display = "block"; div.style.overflow = "visible"; - div.innerHTML = "
      "; + div.innerHTML = "
      "; + div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); - } - div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility; - div.innerHTML = html; - - outer = div.firstChild; - inner = outer.firstChild; - td = outer.nextSibling.firstChild.firstChild; - - offsetSupport = { - doesNotAddBorder: ( inner.offsetTop !== 5 ), - doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) - }; - - inner.style.position = "fixed"; - inner.style.top = "20px"; - - // safari subtracts parent border width here which is 5px - offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); - inner.style.position = inner.style.top = ""; - - outer.style.overflow = "hidden"; - outer.style.position = "relative"; - - offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); - offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); - - if ( window.getComputedStyle ) { - div.style.marginTop = "1%"; - support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%"; - } - - if ( typeof container.style.zoom !== "undefined" ) { container.style.zoom = 1; } + // Null elements to avoid leaks in IE body.removeChild( container ); - marginDiv = div = container = null; - - jQuery.extend( support, offsetSupport ); + container = div = tds = marginDiv = null; }); + // Null elements to avoid leaks in IE + fragment.removeChild( div ); + all = a = select = opt = input = fragment = div = null; + return support; })(); - - - - -var rbrace = /^(?:\{.*\}|\[.*\])$/, +var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; jQuery.extend({ cache: {}, - // Please use with caution + deletedIds: [], + + // Remove at next major release (1.9/2.0) uuid: 0, // Unique for each copy of jQuery on the page @@ -1695,7 +1539,7 @@ jQuery.extend({ return; } - var privateCache, thisCache, ret, + var thisCache, ret, internalKey = jQuery.expando, getByName = typeof name === "string", @@ -1709,12 +1553,11 @@ jQuery.extend({ // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, - isEvents = name === "events"; + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all - if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { + if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { return; } @@ -1722,7 +1565,7 @@ jQuery.extend({ // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { - elem[ internalKey ] = id = ++jQuery.uuid; + elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } @@ -1748,7 +1591,7 @@ jQuery.extend({ } } - privateCache = thisCache = cache[ id ]; + thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined @@ -1765,12 +1608,6 @@ jQuery.extend({ thisCache[ jQuery.camelCase( name ) ] = data; } - // Users should not attempt to inspect the internal events object using jQuery.data, - // it is undocumented and subject to change. But does anyone listen? No. - if ( isEvents && !thisCache[ name ] ) { - return privateCache.events; - } - // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( getByName ) { @@ -1798,16 +1635,11 @@ jQuery.extend({ var thisCache, i, l, - // Reference to internal data cache key - internalKey = jQuery.expando, - isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, - - // See jQuery.data for more information - id = isNode ? elem[ internalKey ] : internalKey; + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing @@ -1834,7 +1666,7 @@ jQuery.extend({ if ( name in thisCache ) { name = [ name ]; } else { - name = name.split( " " ); + name = name.split(" "); } } } @@ -1857,35 +1689,23 @@ jQuery.extend({ // Don't destroy the parent cache unless the internal data object // had been the only thing left in it - if ( !isEmptyDataObject(cache[ id ]) ) { + if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } - // Browsers that fail expando deletion also refuse to delete expandos on - // the window, but it will allow it on all other JS objects; other browsers - // don't care - // Ensure that `cache` is not a window object #10080 - if ( jQuery.support.deleteExpando || !cache.setInterval ) { + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + } else if ( jQuery.support.deleteExpando || cache != cache.window ) { delete cache[ id ]; + + // When all else fails, null } else { cache[ id ] = null; } - - // We destroyed the cache and need to eliminate the expando on the node to avoid - // false lookups in the cache for entries that no longer exist - if ( isNode ) { - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( jQuery.support.deleteExpando ) { - delete elem[ internalKey ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( internalKey ); - } else { - elem[ internalKey ] = null; - } - } }, // For internal use only. @@ -1895,15 +1715,10 @@ jQuery.extend({ // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; + // nodes accept data unless otherwise specified; rejection can be conditional + return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); @@ -1924,7 +1739,7 @@ jQuery.fn.extend({ for ( l = attr.length; i < l; i++ ) { name = attr[i].name; - if ( name.indexOf( "data-" ) === 0 ) { + if ( !name.indexOf( "data-" ) ) { name = jQuery.camelCase( name.substring(5) ); dataAttr( elem, name, data[ name ] ); @@ -1996,8 +1811,9 @@ function dataAttr( elem, key, data ) { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : - jQuery.isNumeric( data ) ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} @@ -2014,7 +1830,8 @@ function dataAttr( elem, key, data ) { // checks a cache object for emptiness function isEmptyDataObject( obj ) { - for ( var name in obj ) { + var name; + for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { @@ -2027,73 +1844,23 @@ function isEmptyDataObject( obj ) { return true; } - - - - -function handleQueueMarkDefer( elem, type, src ) { - var deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - defer = jQuery._data( elem, deferDataKey ); - if ( defer && - ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && - ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { - // Give room for hard-coded callbacks to fire first - // and eventually mark/queue something else on the element - setTimeout( function() { - if ( !jQuery._data( elem, queueDataKey ) && - !jQuery._data( elem, markDataKey ) ) { - jQuery.removeData( elem, deferDataKey, true ); - defer.fire(); - } - }, 0 ); - } -} - jQuery.extend({ - - _mark: function( elem, type ) { - if ( elem ) { - type = ( type || "fx" ) + "mark"; - jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); - } - }, - - _unmark: function( force, elem, type ) { - if ( force !== true ) { - type = elem; - elem = force; - force = false; - } - if ( elem ) { - type = type || "fx"; - var key = type + "mark", - count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); - if ( count ) { - jQuery._data( elem, key, count ); - } else { - jQuery.removeData( elem, key, true ); - handleQueueMarkDefer( elem, type, "mark" ); - } - } - }, - queue: function( elem, type, data ) { - var q; + var queue; + if ( elem ) { type = ( type || "fx" ) + "queue"; - q = jQuery._data( elem, type ); + queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { - if ( !q || jQuery.isArray(data) ) { - q = jQuery._data( elem, type, jQuery.makeArray(data) ); + if ( !queue || jQuery.isArray(data) ) { + queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { - q.push( data ); + queue.push( data ); } } - return q || []; + return queue || []; } }, @@ -2101,31 +1868,46 @@ jQuery.extend({ type = type || "fx"; var queue = jQuery.queue( elem, type ), + startLength = queue.length, fn = queue.shift(), - hooks = {}; + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); + startLength--; } if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } - jQuery._data( elem, type + ".run", hooks ); - fn.call( elem, function() { - jQuery.dequeue( elem, type ); - }, hooks ); + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); } - if ( !queue.length ) { - jQuery.removeData( elem, type + "queue " + type + ".run", true ); - handleQueueMarkDefer( elem, type, "queue" ); + if ( !startLength && hooks ) { + hooks.empty.fire(); } + }, + + // not intended for public consumption - generates a queueHooks object, or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks("once memory").add(function() { + jQuery.removeData( elem, type + "queue", true ); + jQuery.removeData( elem, key, true ); + }) + }); } }); @@ -2148,6 +1930,9 @@ jQuery.fn.extend({ this.each(function() { var queue = jQuery.queue( this, type, data ); + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } @@ -2176,51 +1961,43 @@ jQuery.fn.extend({ }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) - promise: function( type, object ) { + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + if ( typeof type !== "string" ) { - object = type; + obj = type; type = undefined; } type = type || "fx"; - var defer = jQuery.Deferred(), - elements = this, - i = elements.length, - count = 1, - deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - tmp; - function resolve() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - } + while( i-- ) { - if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || - ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || - jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && - jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { count++; - tmp.add( resolve ); + tmp.empty.add( resolve ); } } resolve(); - return defer.promise( object ); + return defer.promise( obj ); } }); - - - - -var rclass = /[\n\t\r]/g, - rspace = /\s+/, +var nodeHook, boolHook, fixSpecified, + rclass = /[\t\r\n]/g, rreturn = /\r/g, rtype = /^(?:button|input)$/i, rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, + rclickable = /^a(?:rea|)$/i, rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - nodeHook, boolHook, fixSpecified; + getSetAttribute = jQuery.support.getSetAttribute; jQuery.fn.extend({ attr: function( name, value ) { @@ -2259,7 +2036,7 @@ jQuery.fn.extend({ } if ( value && typeof value === "string" ) { - classNames = value.split( rspace ); + classNames = value.split( core_rspace ); for ( i = 0, l = this.length; i < l; i++ ) { elem = this[ i ]; @@ -2272,7 +2049,7 @@ jQuery.fn.extend({ setClass = " " + elem.className + " "; for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { + if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) { setClass += classNames[ c ] + " "; } } @@ -2286,31 +2063,30 @@ jQuery.fn.extend({ }, removeClass: function( value ) { - var classNames, i, l, elem, className, c, cl; + var removes, className, elem, c, cl, i, l; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call(this, j, this.className) ); }); } - if ( (value && typeof value === "string") || value === undefined ) { - classNames = ( value || "" ).split( rspace ); + removes = ( value || "" ).split( core_rspace ); for ( i = 0, l = this.length; i < l; i++ ) { elem = this[ i ]; - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - className = (" " + elem.className + " ").replace( rclass, " " ); - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[ c ] + " ", " "); - } - elem.className = jQuery.trim( className ); - } else { - elem.className = ""; + className = (" " + elem.className + " ").replace( rclass, " " ); + + // loop over each item in the removal list + for ( c = 0, cl = removes.length; c < cl; c++ ) { + // Remove until there is nothing to remove, + while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) { + className = className.replace( " " + removes[ c ] + " " , " " ); + } } + elem.className = value ? jQuery.trim( className ) : ""; } } } @@ -2335,10 +2111,10 @@ jQuery.fn.extend({ i = 0, self = jQuery( this ), state = stateVal, - classNames = value.split( rspace ); + classNames = value.split( core_rspace ); while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list + // check each className given, space separated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } @@ -2360,7 +2136,7 @@ jQuery.fn.extend({ i = 0, l = this.length; for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } @@ -2395,7 +2171,8 @@ jQuery.fn.extend({ isFunction = jQuery.isFunction( value ); return this.each(function( i ) { - var self = jQuery(this), val; + var val, + self = jQuery(this); if ( this.nodeType !== 1 ) { return; @@ -2497,16 +2274,8 @@ jQuery.extend({ } }, - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, + // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9 + attrFn: {}, attr: function( elem, name, value, pass ) { var ret, hooks, notxml, @@ -2517,7 +2286,7 @@ jQuery.extend({ return; } - if ( pass && name in jQuery.attrFn ) { + if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) { return jQuery( elem )[ name ]( value ); } @@ -2545,7 +2314,7 @@ jQuery.extend({ return ret; } else { - elem.setAttribute( name, "" + value ); + elem.setAttribute( name, value + "" ); return value; } @@ -2564,14 +2333,14 @@ jQuery.extend({ }, removeAttr: function( elem, value ) { - var propName, attrNames, name, l, isBool, + var propName, attrNames, name, isBool, i = 0; if ( value && elem.nodeType === 1 ) { - attrNames = value.toLowerCase().split( rspace ); - l = attrNames.length; - for ( ; i < l; i++ ) { + attrNames = value.split( core_rspace ); + + for ( ; i < attrNames.length; i++ ) { name = attrNames[ i ]; if ( name ) { @@ -2701,9 +2470,6 @@ jQuery.extend({ } }); -// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) -jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; - // Hook for boolean attributes boolHook = { get: function( elem, name ) { @@ -2750,8 +2516,8 @@ if ( !getSetAttribute ) { get: function( elem, name ) { var ret; ret = elem.getAttributeNode( name ); - return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? - ret.nodeValue : + return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ? + ret.value : undefined; }, set: function( elem, value, name ) { @@ -2761,13 +2527,10 @@ if ( !getSetAttribute ) { ret = document.createAttribute( name ); elem.setAttributeNode( ret ); } - return ( ret.nodeValue = value + "" ); + return ( ret.value = value + "" ); } }; - // Apply the nodeHook to tabindex - jQuery.attrHooks.tabindex.set = nodeHook.set; - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { @@ -2815,7 +2578,7 @@ if ( !jQuery.support.style ) { return elem.style.cssText.toLowerCase() || undefined; }, set: function( elem, value ) { - return ( elem.style.cssText = "" + value ); + return ( elem.style.cssText = value + "" ); } }; } @@ -2865,35 +2628,12 @@ jQuery.each([ "radio", "checkbox" ], function() { } }); }); - - - - var rformElems = /^(?:textarea|input|select)$/i, - rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, - rhoverHack = /(?:^|\s)hover(\.\S+)?\b/, + rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/, + rhoverHack = /(?:^|\s)hover(\.\S+|)\b/, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, - quickParse = function( selector ) { - var quick = rquickIs.exec( selector ); - if ( quick ) { - // 0 1 2 3 - // [ _, tag, id, class ] - quick[1] = ( quick[1] || "" ).toLowerCase(); - quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); - } - return quick; - }, - quickIs = function( elem, m ) { - var attrs = elem.attributes || {}; - return ( - (!m[1] || elem.nodeName.toLowerCase() === m[1]) && - (!m[2] || (attrs.id || {}).value === m[2]) && - (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) - ); - }, hoverHack = function( events ) { return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); }; @@ -2908,7 +2648,7 @@ jQuery.event = { var elemData, eventHandle, events, t, tns, type, namespaces, handleObj, - handleObjIn, quick, handlers, special; + handleObjIn, handlers, special; // Don't attach events to noData or text/comment nodes (allow plain objects tho) if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { @@ -2971,7 +2711,7 @@ jQuery.event = { handler: handler, guid: handler.guid, selector: selector, - quick: selector && quickParse( selector ), + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); @@ -3021,9 +2761,9 @@ jQuery.event = { // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { - var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), - t, tns, type, origType, namespaces, origCount, - j, events, special, handle, eventType, handleObj; + var t, tns, type, origType, namespaces, origCount, + j, events, special, eventType, handleObj, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; @@ -3048,7 +2788,7 @@ jQuery.event = { type = ( selector? special.delegateType : special.bindType ) || type; eventType = events[ type ] || []; origCount = eventType.length; - namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null; // Remove matching events for ( j = 0; j < eventType.length; j++ ) { @@ -3072,7 +2812,7 @@ jQuery.event = { // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( eventType.length === 0 && origCount !== eventType.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } @@ -3082,14 +2822,11 @@ jQuery.event = { // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { - handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } + delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete - jQuery.removeData( elem, [ "events", "handle" ], true ); + jQuery.removeData( elem, "events", true ); } }, @@ -3108,9 +2845,9 @@ jQuery.event = { } // Event object or event type - var type = event.type || event, - namespaces = [], - cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; + var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType, + type = event.type || event, + namespaces = []; // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { @@ -3148,7 +2885,7 @@ jQuery.event = { event.isTrigger = true; event.exclusive = exclusive; event.namespace = namespaces.join( "." ); - event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; // Handle a global trigger @@ -3187,14 +2924,13 @@ jQuery.event = { bubbleType = special.delegateType || type; cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; - old = null; - for ( ; cur; cur = cur.parentNode ) { + for ( old = elem; cur; cur = cur.parentNode ) { eventPath.push([ cur, bubbleType ]); old = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( old && old === elem.ownerDocument ) { + if ( old === (elem.ownerDocument || document) ) { eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); } } @@ -3211,7 +2947,7 @@ jQuery.event = { } // Note that this is a bare JS function and not a jQuery handler handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { + if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } @@ -3256,13 +2992,13 @@ jQuery.event = { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event || window.event ); - var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), + var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related, + handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), delegateCount = handlers.delegateCount, - args = [].slice.call( arguments, 0 ), + args = core_slice.call( arguments ), run_all = !event.exclusive && !event.namespace, special = jQuery.event.special[ event.type ] || {}, - handlerQueue = [], - i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; + handlerQueue = []; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; @@ -3277,25 +3013,20 @@ jQuery.event = { // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && !(event.button && event.type === "click") ) { - // Pregenerate a single jQuery object for reuse with .is() - jqcur = jQuery(this); - jqcur.context = this.ownerDocument || this; - for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { - // Don't process events on disabled elements (#6911, #8165) - if ( cur.disabled !== true ) { + // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.disabled !== true || event.type !== "click" ) { selMatch = {}; matches = []; - jqcur[0] = cur; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; sel = handleObj.selector; if ( selMatch[ sel ] === undefined ) { - selMatch[ sel ] = ( - handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) - ); + selMatch[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) >= 0 : + jQuery.find( sel, this, null, [ cur ] ).length; } if ( selMatch[ sel ] ) { matches.push( handleObj ); @@ -3429,20 +3160,13 @@ jQuery.event = { event.target = event.target.parentNode; } - // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) - if ( event.metaKey === undefined ) { - event.metaKey = event.ctrlKey; - } + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8) + event.metaKey = !!event.metaKey; return fixHook.filter? fixHook.filter( event, originalEvent ) : event; }, special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady - }, - load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true @@ -3505,8 +3229,17 @@ jQuery.removeEvent = document.removeEventListener ? } } : function( elem, type, handle ) { + var name = "on" + type; + if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 – + // detachEvent needed property on element, by name of that event, to properly expose it to GC + if ( typeof elem[ name ] === "undefined" ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); } }; @@ -3603,11 +3336,11 @@ jQuery.each({ bindType: fix, handle: function( event ) { - var target = this, + var ret, + target = this, related = event.relatedTarget, handleObj = event.handleObj, - selector = handleObj.selector, - ret; + selector = handleObj.selector; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window @@ -3636,16 +3369,16 @@ if ( !jQuery.support.submitBubbles ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !form._submit_attached ) { + if ( form && !jQuery._data( form, "_submit_attached" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); - form._submit_attached = true; + jQuery._data( form, "_submit_attached", true ); } }); // return undefined since we don't need an event listener }, - + postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { @@ -3688,8 +3421,9 @@ if ( !jQuery.support.changeBubbles ) { jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; - jQuery.event.simulate( "change", this, event, true ); } + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event, true ); }); } return false; @@ -3698,13 +3432,13 @@ if ( !jQuery.support.changeBubbles ) { jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; - if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); - elem._change_attached = true; + jQuery._data( elem, "_change_attached", true ); } }); }, @@ -3721,7 +3455,7 @@ if ( !jQuery.support.changeBubbles ) { teardown: function() { jQuery.event.remove( this, "._change" ); - return rformElems.test( this.nodeName ); + return !rformElems.test( this.nodeName ); } }; } @@ -3810,9 +3544,10 @@ jQuery.fn.extend({ return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { + var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event - var handleObj = types.handleObj; + handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, @@ -3822,7 +3557,7 @@ jQuery.fn.extend({ } if ( typeof types === "object" ) { // ( types-object [, selector] ) - for ( var type in types ) { + for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; @@ -3861,7 +3596,7 @@ jQuery.fn.extend({ }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) - return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); + return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); }, trigger: function( type, data ) { @@ -3922,10 +3657,6 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl this.trigger( name ); }; - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } - if ( rkeyEvent.test( name ) ) { jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; } @@ -3934,1472 +3665,1683 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; } }); - - - -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - expando = "sizcache" + (Math.random() + '').replace('.', ''), - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true, - rBackslash = /\\/g, - rReturn = /\r\n/g, - rNonWord = /\W/; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context, seed ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set, seed ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set, i, len, match, type, left; - - if ( !expr ) { - return []; - } - - for ( i = 0, len = Expr.order.length; i < len; i++ ) { - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace( rBackslash, "" ); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( "*" ) : - []; - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - type, found, item, filter, left, - i, pass, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - filter = Expr.filter[ type ]; - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - pass = not ^ found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Utility function for retreiving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -var getText = Sizzle.getText = function( elem ) { - var i, node, - nodeType = elem.nodeType, - ret = ""; - - if ( nodeType ) { - if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent || innerText for elements - if ( typeof elem.textContent === 'string' ) { - return elem.textContent; - } else if ( typeof elem.innerText === 'string' ) { - // Replace IE's carriage returns - return elem.innerText.replace( rReturn, '' ); - } else { - // Traverse it's children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - } else { - - // If no nodeType, this is expected to be an array - for ( i = 0; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - if ( node.nodeType !== 8 ) { - ret += getText( node ); - } - } - } - return ret; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - }, - type: function( elem ) { - return elem.getAttribute( "type" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !rNonWord.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( match[1] ); - } - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace( rBackslash, "" ) + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace( rBackslash, "" ); - }, - - TAG: function( match, curLoop ) { - return match[1].replace( rBackslash, "" ).toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - match[2] = match[2].replace(/^\+|\s*/g, ''); - - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1] = match[1].replace( rBackslash, "" ); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - // Handle if an un-quoted value was used - match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); - }, - - radio: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; - }, - - checkbox: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; - }, - - file: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; - }, - - password: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; - }, - - submit: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "submit" === elem.type; - }, - - image: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; - }, - - reset: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "reset" === elem.type; - }, - - button: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && "button" === elem.type || name === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - }, - - focus: function( elem ) { - return elem === elem.ownerDocument.activeElement; - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( name ); - } - }, - - CHILD: function( elem, match ) { - var first, last, - doneName, parent, cache, - count, diff, - type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - /* falls through */ - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - first = match[2]; - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - doneName = match[0]; - parent = elem.parentNode; - - if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { - count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent[ expando ] = doneName; - } - - diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Sizzle.attr ? - Sizzle.attr( elem, name ) : - Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - !type && Sizzle.attr ? - result != null : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} -// Expose origPOS -// "global" as in regardless of relation to brackets/parens -Expr.match.globalPOS = origPOS; - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = ""; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = ""; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "

      "; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - // See if we find a selector to speed up - var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - - if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { - // Speed-up: Sizzle("TAG") - if ( match[1] ) { - return makeArray( context.getElementsByTagName( query ), extra ); - - // Speed-up: Sizzle(".CLASS") - } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { - return makeArray( context.getElementsByClassName( match[2] ), extra ); - } - } - - if ( context.nodeType === 9 ) { - // Speed-up: Sizzle("body") - // The body element only exists once, optimize finding it - if ( query === "body" && context.body ) { - return makeArray( [ context.body ], extra ); - - // Speed-up: Sizzle("#ID") - } else if ( match && match[3] ) { - var elem = context.getElementById( match[3] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id === match[3] ) { - return makeArray( [ elem ], extra ); - } - - } else { - return makeArray( [], extra ); - } - } - - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var oldContext = context, - old = context.getAttribute( "id" ), - nid = old || id, - hasParent = context.parentNode, - relativeHierarchySelector = /^\s*[+~]/.test( query ); - - if ( !old ) { - context.setAttribute( "id", nid ); - } else { - nid = nid.replace( /'/g, "\\$&" ); - } - if ( relativeHierarchySelector && hasParent ) { - context = context.parentNode; - } - - try { - if ( !relativeHierarchySelector || hasParent ) { - return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); - } - - } catch(pseudoError) { - } finally { - if ( !old ) { - oldContext.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; - - if ( matches ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9 fails this) - var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - var ret = matches.call( node, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || !disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9, so check for that - node.document && node.document.nodeType !== 11 ) { - return ret; - } - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
      "; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context, seed ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet, seed ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE +/*! + * Sizzle CSS Selector Engine + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://sizzlejs.com/ + */ +(function( window, undefined ) { + +var cachedruns, + assertGetIdNotName, + Expr, + getText, + isXML, + contains, + compile, + sortOrder, + hasDuplicate, + outermostContext, + + baseHasDuplicate = true, + strundefined = "undefined", + + expando = ( "sizcache" + Math.random() ).replace( ".", "" ), + + Token = String, + document = window.document, + docElem = document.documentElement, + dirruns = 0, + done = 0, + pop = [].pop, + push = [].push, + slice = [].slice, + // Use a stripped-down indexOf if a native one is unavailable + indexOf = [].indexOf || function( elem ) { + var i = 0, + len = this.length; + for ( ; i < len; i++ ) { + if ( this[i] === elem ) { + return i; + } + } + return -1; + }, + + // Augment a function for special use by Sizzle + markFunction = function( fn, value ) { + fn[ expando ] = value == null || value; + return fn; + }, + + createCache = function() { + var cache = {}, + keys = []; + + return markFunction(function( key, value ) { + // Only keep the most recent entries + if ( keys.push( key ) > Expr.cacheLength ) { + delete cache[ keys.shift() ]; + } + + return (cache[ key ] = value); + }, cache ); + }, + + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + + // Regex + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors) + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + operators = "([*^$|!~]?=)", + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", + + // Prefer arguments not in parens/brackets, + // then attribute selectors and non-pseudos (denoted by :), + // then anything else + // These preferences are here to reduce the number of selectors + // needing tokenize in the PSEUDO preFilter + pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)", + + // For matchExpr.POS and matchExpr.needsContext + pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), + rpseudo = new RegExp( pseudos ), + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, + + rnot = /^:not/, + rsibling = /[\x20\t\r\n\f]*[+~]/, + rendsWithNot = /:not\($/, + + rheader = /h\d/i, + rinputs = /input|select|textarea|button/i, + + rbackslash = /\\(?!\\)/g, + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "POS": new RegExp( pos, "i" ), + "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + // For use in libraries implementing .is() + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" ) + }, + + // Support + + // Used for testing something on an element + assert = function( fn ) { + var div = document.createElement("div"); + + try { + return fn( div ); + } catch (e) { + return false; + } finally { + // release memory in IE + div = null; + } + }, + + // Check if getElementsByTagName("*") returns only elements + assertTagNameNoComments = assert(function( div ) { + div.appendChild( document.createComment("") ); + return !div.getElementsByTagName("*").length; + }), + + // Check if getAttribute returns normalized href attributes + assertHrefNotNormalized = assert(function( div ) { + div.innerHTML = ""; + return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && + div.firstChild.getAttribute("href") === "#"; + }), + + // Check if attributes should be retrieved by attribute nodes + assertAttributes = assert(function( div ) { + div.innerHTML = ""; + var type = typeof div.lastChild.getAttribute("multiple"); + // IE8 returns a string for some attributes even when not present + return type !== "boolean" && type !== "string"; + }), + + // Check if getElementsByClassName can be trusted + assertUsableClassName = assert(function( div ) { + // Opera can't find a second classname (in 9.6) + div.innerHTML = ""; + if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { + return false; + } + + // Safari 3.2 caches class attributes and doesn't catch changes + div.lastChild.className = "e"; + return div.getElementsByClassName("e").length === 2; + }), + + // Check if getElementById returns elements by name + // Check if getElementsByName privileges form controls or returns elements by ID + assertUsableName = assert(function( div ) { + // Inject content + div.id = expando + 0; + div.innerHTML = "
      "; + docElem.insertBefore( div, docElem.firstChild ); + + // Test + var pass = document.getElementsByName && + // buggy browsers will return fewer than the correct 2 + document.getElementsByName( expando ).length === 2 + + // buggy browsers will return more than the correct 0 + document.getElementsByName( expando + 0 ).length; + assertGetIdNotName = !document.getElementById( expando ); + + // Cleanup + docElem.removeChild( div ); + + return pass; + }); + +// If slice is not available, provide a backup +try { + slice.call( docElem.childNodes, 0 )[0].nodeType; +} catch ( e ) { + slice = function( i ) { + var elem, + results = []; + for ( ; (elem = this[i]); i++ ) { + results.push( elem ); + } + return results; + }; +} + +function Sizzle( selector, context, results, seed ) { + results = results || []; + context = context || document; + var match, elem, xml, m, + nodeType = context.nodeType; + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + if ( nodeType !== 1 && nodeType !== 9 ) { + return []; + } + + xml = isXML( context ); + + if ( !xml && !seed ) { + if ( (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) { + push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); + return results; + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed, xml ); +} + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + return Sizzle( expr, null, null, [ elem ] ).length > 0; +}; + +// Returns a function to use in pseudos for input types +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +// Returns a function to use in pseudos for buttons +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +// Returns a function to use in pseudos for positionals +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( nodeType ) { + if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (see #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + } else { + + // If no nodeType, this is expected to be an array + for ( ; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } + return ret; +}; + +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +// Element contains another +contains = Sizzle.contains = docElem.contains ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) ); + } : + docElem.compareDocumentPosition ? + function( a, b ) { + return b && !!( a.compareDocumentPosition( b ) & 16 ); + } : + function( a, b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + return false; + }; + +Sizzle.attr = function( elem, name ) { + var val, + xml = isXML( elem ); + + if ( !xml ) { + name = name.toLowerCase(); + } + if ( (val = Expr.attrHandle[ name ]) ) { + return val( elem ); + } + if ( xml || assertAttributes ) { + return elem.getAttribute( name ); + } + val = elem.getAttributeNode( name ); + return val ? + typeof elem[ name ] === "boolean" ? + elem[ name ] ? name : null : + val.specified ? val.value : null : + null; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + // IE6/7 return a modified href + attrHandle: assertHrefNotNormalized ? + {} : + { + "href": function( elem ) { + return elem.getAttribute( "href", 2 ); + }, + "type": function( elem ) { + return elem.getAttribute("type"); + } + }, + + find: { + "ID": assertGetIdNotName ? + function( id, context, xml ) { + if ( typeof context.getElementById !== strundefined && !xml ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + } : + function( id, context, xml ) { + if ( typeof context.getElementById !== strundefined && !xml ) { + var m = context.getElementById( id ); + + return m ? + m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? + [m] : + undefined : + []; + } + }, + + "TAG": assertTagNameNoComments ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== strundefined ) { + return context.getElementsByTagName( tag ); + } + } : + function( tag, context ) { + var results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + var elem, + tmp = [], + i = 0; + + for ( ; (elem = results[i]); i++ ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }, + + "NAME": assertUsableName && function( tag, context ) { + if ( typeof context.getElementsByName !== strundefined ) { + return context.getElementsByName( name ); + } + }, + + "CLASS": assertUsableClassName && function( className, context, xml ) { + if ( typeof context.getElementsByClassName !== strundefined && !xml ) { + return context.getElementsByClassName( className ); + } + } + }, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( rbackslash, "" ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 3 xn-component of xn+y argument ([+-]?\d*n|) + 4 sign of xn-component + 5 x of xn-component + 6 sign of y-component + 7 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1] === "nth" ) { + // nth-child requires argument + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) ); + match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" ); + + // other types prohibit arguments + } else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var unquoted, excess; + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + if ( match[3] ) { + match[2] = match[3]; + } else if ( (unquoted = match[4]) ) { + // Only check arguments that contain a pseudo + if ( rpseudo.test(unquoted) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + unquoted = unquoted.slice( 0, excess ); + match[0] = match[0].slice( 0, excess ); + } + match[2] = unquoted; + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + "ID": assertGetIdNotName ? + function( id ) { + id = id.replace( rbackslash, "" ); + return function( elem ) { + return elem.getAttribute("id") === id; + }; + } : + function( id ) { + id = id.replace( rbackslash, "" ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + return node && node.value === id; + }; + }, + + "TAG": function( nodeName ) { + if ( nodeName === "*" ) { + return function() { return true; }; + } + nodeName = nodeName.replace( rbackslash, "" ).toLowerCase(); + + return function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ expando ][ className ]; + if ( !pattern ) { + pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") ); + } + return function( elem ) { + return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); + }; + }, + + "ATTR": function( name, operator, check ) { + return function( elem, context ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.substr( result.length - check.length ) === check : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, argument, first, last ) { + + if ( type === "nth" ) { + return function( elem ) { + var node, diff, + parent = elem.parentNode; + + if ( first === 1 && last === 0 ) { + return true; + } + + if ( parent ) { + diff = 0; + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + diff++; + if ( elem === node ) { + break; + } + } + } + } + + // Incorporate the offset (or cast to NaN), then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + }; + } + + return function( elem ) { + var node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + /* falls through */ + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf.call( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), + // not comment, processing instructions, or others + // Thanks to Diego Perini for the nodeName shortcut + // Greater than "@" means alpha characters (specifically not starting with "#" or "?") + var nodeType; + elem = elem.firstChild; + while ( elem ) { + if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) { + return false; + } + elem = elem.nextSibling; + } + return true; + }, + + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "text": function( elem ) { + var type, attr; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && + (type = elem.type) === "text" && + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type ); + }, + + // Input types + "radio": createInputPseudo("radio"), + "checkbox": createInputPseudo("checkbox"), + "file": createInputPseudo("file"), + "password": createInputPseudo("password"), + "image": createInputPseudo("image"), + + "submit": createButtonPseudo("submit"), + "reset": createButtonPseudo("reset"), + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "focus": function( elem ) { + var doc = elem.ownerDocument; + return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href); + }, + + "active": function( elem ) { + return elem === elem.ownerDocument.activeElement; + }, + + // Positional types + "first": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = 0; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = 1; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +function siblingCheck( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; +} + +sortOrder = docElem.compareDocumentPosition ? + function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + return ( !a.compareDocumentPosition || !b.compareDocumentPosition ? + a.compareDocumentPosition : + a.compareDocumentPosition(b) & 4 + ) ? -1 : 1; + } : + function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + +// Always assume the presence of duplicates if sort doesn't +// pass them to our comparison function (as in Google Chrome). +[0, 0].sort( sortOrder ); +baseHasDuplicate = !hasDuplicate; + +// Document sorting and removing duplicates +Sizzle.uniqueSort = function( results ) { + var elem, + i = 1; + + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( ; (elem = results[i]); i++ ) { + if ( elem === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + + return results; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +function tokenize( selector, parseOnly ) { + var matched, match, tokens, type, soFar, groups, preFilters, + cached = tokenCache[ expando ][ selector ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + soFar = soFar.slice( match[0].length ); + } + groups.push( tokens = [] ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + tokens.push( matched = new Token( match.shift() ) ); + soFar = soFar.slice( matched.length ); + + // Cast descendant combinators to space + matched.type = match[0].replace( rtrim, " " ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + // The last two arguments here are (context, xml) for backCompat + (match = preFilters[ type ]( match, document, true ))) ) { + + tokens.push( matched = new Token( match.shift() ) ); + soFar = soFar.slice( matched.length ); + matched.type = type; + matched.matches = match; + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && combinator.dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( checkNonElements || elem.nodeType === 1 ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( !xml ) { + var cache, + dirkey = dirruns + " " + doneName + " ", + cachedkey = dirkey + cachedruns; + while ( (elem = elem[ dir ]) ) { + if ( checkNonElements || elem.nodeType === 1 ) { + if ( (cache = elem[ expando ]) === cachedkey ) { + return elem.sizset; + } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) { + if ( elem.sizset ) { + return elem; + } + } else { + elem[ expando ] = cachedkey; + if ( matcher( elem, context, xml ) ) { + elem.sizset = true; + return elem; + } + elem.sizset = false; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( checkNonElements || elem.nodeType === 1 ) { + if ( matcher( elem, context, xml ) ) { + return elem; + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones + if ( seed && postFinder ) { + return; + } + + var i, elem, postFilterIn, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + postFilterIn = condense( matcherOut, postMap ); + postFilter( postFilterIn, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = postFilterIn.length; + while ( i-- ) { + if ( (elem = postFilterIn[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + // Keep seed and results synchronized + if ( seed ) { + // Ignore postFinder because it can't coexist with seed + i = preFilter && matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + seed[ preMap[i] ] = !(results[ preMap[i] ] = elem); + } + } + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf.call( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; + } else { + // The concatenated values are (context, xml) for backCompat + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && tokens.join("") + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, expandContext ) { + var elem, j, matcher, + setMatched = [], + matchedCount = 0, + i = "0", + unmatched = seed && [], + outermost = expandContext != null, + contextBackup = outermostContext, + // We must always have either seed elements or context + elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), + // Nested matchers should use non-integer dirruns + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E); + + if ( outermost ) { + outermostContext = context !== document && context; + cachedruns = superMatcher.el; + } + + // Add elements passing elementMatchers directly to results + for ( ; (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + for ( j = 0; (matcher = elementMatchers[j]); j++ ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + cachedruns = ++superMatcher.el; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + for ( j = 0; (matcher = setMatchers[j]); j++ ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + superMatcher.el = 0; + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ expando ][ selector ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !group ) { + group = tokenize( selector ); + } + i = group.length; + while ( i-- ) { + cached = matcherFromTokens( group[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + } + return cached; +}; + +function multipleContexts( selector, contexts, results, seed ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results, seed ); + } + return results; +} + +function select( selector, context, results, seed, xml ) { + var i, tokens, token, type, find, + match = tokenize( selector ), + j = match.length; + + if ( !seed ) { + // Try to minimize operations if there is only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && !xml && + Expr.relative[ tokens[1].type ] ) { + + context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0]; + if ( !context ) { + return results; + } + + selector = selector.slice( tokens.shift().length ); + } + + // Fetch a seed set for right-to-left matching + for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( rbackslash, "" ), + rsibling.test( tokens[0].type ) && context.parentNode || context, + xml + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && tokens.join(""); + if ( !selector ) { + push.apply( results, slice.call( seed, 0 ) ); + return results; + } + + break; + } + } + } + } + } + + // Compile and execute a filtering function + // Provide `match` to avoid retokenization if we modified the selector above + compile( selector, match )( + seed, + context, + xml, + results, + rsibling.test( selector ) + ); + return results; +} + +if ( document.querySelectorAll ) { + (function() { + var disconnectedMatch, + oldSelect = select, + rescape = /'|\\/g, + rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, + + // qSa(:focus) reports false when true (Chrome 21), + // A support test would require too much code (would include document ready) + rbuggyQSA = [":focus"], + + // matchesSelector(:focus) reports false when true (Chrome 21), + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + // A support test would require too much code (would include document ready) + // just skip matchesSelector for :active + rbuggyMatches = [ ":active", ":focus" ], + matches = docElem.matchesSelector || + docElem.mozMatchesSelector || + docElem.webkitMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector; + + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explictly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + div.innerHTML = ""; + + // IE8 - Some boolean attributes are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here (do not put tests after this one) + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + }); + + assert(function( div ) { + + // Opera 10-12/IE9 - ^= $= *= and empty values + // Should not select anything + div.innerHTML = "

      "; + if ( div.querySelectorAll("[test^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here (do not put tests after this one) + div.innerHTML = ""; + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push(":enabled", ":disabled"); + } + }); + + // rbuggyQSA always contains :focus, so no need for a length check + rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") ); + + select = function( selector, context, results, seed, xml ) { + // Only use querySelectorAll when not filtering, + // when this is not xml, + // and when no QSA bugs apply + if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + var groups, i, + old = true, + nid = expando, + newContext = context, + newSelector = context.nodeType === 9 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + groups[i].join(""); + } + newContext = rsibling.test( selector ) && context.parentNode || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, slice.call( newContext.querySelectorAll( + newSelector + ), 0 ) ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + + return oldSelect( selector, context, results, seed, xml ); + }; + + if ( matches ) { + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + try { + matches.call( div, "[test!='']:sizzle" ); + rbuggyMatches.push( "!=", pseudos ); + } catch ( e ) {} + }); + + // rbuggyMatches always contains :active and :focus, so no need for a length check + rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") ); + + Sizzle.matchesSelector = function( elem, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + // rbuggyMatches always contains :active, so no need for an existence check + if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) { + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch(e) {} + } + + return Sizzle( expr, null, null, [ elem ] ).length > 0; + }; + } + })(); +} + +// Deprecated +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Back-compat +function setFilters() {} +Expr.filters = setFilters.prototype = Expr.pseudos; +Expr.setFilters = new setFilters(); + // Override sizzle attribute retrieval Sizzle.attr = jQuery.attr; -Sizzle.selectors.attrMap = {}; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; +jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; - - -})(); - - + + +})( window ); var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, + rparentsprev = /^(?:parents|prev(?:Until|All))/, isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.globalPOS, + rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, @@ -5410,8 +5352,8 @@ var runtil = /Until$/, jQuery.fn.extend({ find: function( selector ) { - var self = this, - i, l; + var i, l, length, n, r, ret, + self = this; if ( typeof selector !== "string" ) { return jQuery( selector ).filter(function() { @@ -5423,8 +5365,7 @@ jQuery.fn.extend({ }); } - var ret = this.pushStack( "", "find", selector ), - length, n, r; + ret = this.pushStack( "", "find", selector ); for ( i = 0, l = this.length; i < l; i++ ) { length = ret.length; @@ -5447,9 +5388,12 @@ jQuery.fn.extend({ }, has: function( target ) { - var targets = jQuery( target ); + var i, + targets = jQuery( target, this ), + len = targets.length; + return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { + for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } @@ -5468,55 +5412,32 @@ jQuery.fn.extend({ is: function( selector ) { return !!selector && ( typeof selector === "string" ? - // If this is a positional selector, check membership in the returned set + // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". - POS.test( selector ) ? + rneedsContext.test( selector ) ? jQuery( selector, this.context ).index( this[0] ) >= 0 : jQuery.filter( selector, this ).length > 0 : this.filter( selector ).length > 0 ); }, closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - // Array (deprecated as of jQuery 1.7) - if ( jQuery.isArray( selectors ) ) { - var level = 1; - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( i = 0; i < selectors.length; i++ ) { - - if ( jQuery( cur ).is( selectors[ i ] ) ) { - ret.push({ selector: selectors[ i ], elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - - return ret; - } - - // String - var pos = POS.test( selectors ) || typeof selectors !== "string" ? + var cur, + i = 0, + l = this.length, + ret = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; - for ( i = 0, l = this.length; i < l; i++ ) { + for ( ; i < l; i++ ) { cur = this[i]; - while ( cur ) { + while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { ret.push( cur ); break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { - break; - } } + cur = cur.parentNode; } } @@ -5556,17 +5477,29 @@ jQuery.fn.extend({ jQuery.unique( all ) ); }, - andSelf: function() { - return this.add( this.prevObject ); + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); } }); +jQuery.fn.andSelf = jQuery.fn.addBack; + // A painfully simple check to see if an element is disconnected // from a document (should be improved, where feasible). function isDisconnected( node ) { return !node || !node.parentNode || node.parentNode.nodeType === 11; } +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; @@ -5579,10 +5512,10 @@ jQuery.each({ return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); + return sibling( elem, "nextSibling" ); }, prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); + return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); @@ -5605,7 +5538,7 @@ jQuery.each({ contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); + jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { @@ -5621,11 +5554,11 @@ jQuery.each({ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + if ( this.length > 1 && rparentsprev.test( name ) ) { ret = ret.reverse(); } - return this.pushStack( ret, name, slice.call( arguments ).join(",") ); + return this.pushStack( ret, name, core_slice.call( arguments ).join(",") ); }; }); @@ -5653,19 +5586,6 @@ jQuery.extend({ return matched; }, - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - sibling: function( n, elem ) { var r = []; @@ -5713,10 +5633,6 @@ function winnow( elements, qualifier, keep ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); } - - - - function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); @@ -5733,19 +5649,20 @@ function createSafeFragment( document ) { var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /]", "i"), + rcheckableType = /^(?:checkbox|radio)$/, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /\/(java|ecma)script/i, - rcleanScript = /^\s*\s*$/g, wrapMap = { option: [ 1, "" ], legend: [ 1, "
      ", "
      " ], @@ -5756,15 +5673,17 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca area: [ 1, "", "" ], _default: [ 0, "", "" ] }, - safeFragment = createSafeFragment( document ); + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; -// IE can't serialize and - - + + From 136dbd950637581aea7a6821bfc5a4792483b9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Wed, 7 Nov 2012 14:17:01 +0100 Subject: [PATCH 634/963] [FIX] old attachments event was still here bzr revid: fva@openerp.com-20121107131701-oa0bs25ld0vr9b99 --- addons/mail/static/src/js/mail.js | 34 +++---------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 46f8553f666..a0a174214bc 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -693,50 +693,22 @@ openerp.mail = function (session) { this.ds_message = new session.web.DataSetSearch(this, 'mail.message'); }, - resize_img: function () { - var resize = function () { - var h = $(this).height(); - var w = $(this).width(); - if ( h > 100 || w >100 ) { - var ratio = 100 / (h > w ? h : w); - $(this).attr("width", parseInt( w*ratio )).attr("height", parseInt( h*ratio )); - } - }; - this.$("img").load(resize).each(resize); - }, - /** * Bind events in the widget. Each event is slightly described * in the function. */ bind_events: function () { var self = this; - // event: click on 'Attachment(s)' in msg - this.$('.oe_mail_msg_view_attachments').on('click', function (event) { - var attach = self.$('.oe_msg_attachments:first, .oe_msg_images:first'); - if ( self.$('.oe_msg_attachments:first').hasClass("oe_hidden") ) { - attach.removeClass("oe_hidden"); - } else { - attach.addClass("oe_hidden"); - } - self.resize_img(); - }); - // event: click on icone 'Read' in header + // header icons bindings this.$el.on('click', '.oe_read', this.on_message_read); - // event: click on icone 'UnRead' in header this.$el.on('click', '.oe_unread', this.on_message_unread); - // event: click on 'Delete' in msg side menu this.$el.on('click', '.oe_msg_delete', this.on_message_delete); - - // event: click on 'Reply' in msg this.$el.on('click', '.oe_reply', this.on_message_reply); - // event: click on 'Vote' button - this.$el.on('click', '.oe_msg_vote', this.on_vote); - // event: click on 'starred/favorite' button this.$el.on('click', '.oe_star', this.on_star); + this.$el.on('click', '.oe_msg_vote', this.on_vote); + this.$el.on('click', '.oe_view_attachments', function(){ - console.log('toggle'); self.$('.oe_msg_attachment_list').toggle(200); }); }, From bfad5ad032e68b4e753249ff14523d5156ce8cef Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 7 Nov 2012 14:21:52 +0100 Subject: [PATCH 635/963] [ADD] custom dimensioning of a bunch of form widget for better editable listview compat/styling bzr revid: xmo@openerp.com-20121107132152-9s6s1n4fn4bwjdm2 --- addons/web/static/src/css/base.css | 6 ++++-- addons/web/static/src/css/base.sass | 10 ++++++---- addons/web/static/src/js/view_form.js | 20 +++++++++++++++++++- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 30fe4d415cf..94d02758ad0 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -25,7 +25,6 @@ display: none !important; } } - .openerp.openerp_webclient_container { height: 100%; } @@ -2566,7 +2565,7 @@ background-color: #eeeeee; } .openerp .oe_list_editable .oe_list_content td.oe_list_field_cell { - padding: 4px 6px 3px 6px; + padding: 4px 6px 3px; } .openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell:not(.oe_readonly) { color: transparent; @@ -2647,6 +2646,9 @@ margin: 0 !important; padding: 0; } +.openerp .oe_list .oe_form .oe_form_field_boolean { + padding: 1px 6px 3px; +} .openerp .oe_list .oe_list_content .oe_group_header { background-color: #fcfcfc; background-image: -webkit-gradient(linear, left top, left bottom, from(#fcfcfc), to(#dedede)); diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index e388ad16727..f911929e159 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2030,10 +2030,8 @@ $sheet-padding: 16px background-color: #eee $row-height: 27px - .oe_list_editable - .oe_list_content - td.oe_list_field_cell - padding: 4px 6px 3px 6px + .oe_list_editable .oe_list_content td.oe_list_field_cell + padding: 4px 6px 3px .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell:not(.oe_readonly) * @@ -2106,6 +2104,10 @@ $sheet-padding: 16px position: absolute margin: 0 !important // dammit padding: 0 + .oe_form_field_boolean + // use padding similar to actual cell to correctly position the + // checkbox + padding: 1px 6px 3px .oe_list_content .oe_group_header @include vertical-gradient(#fcfcfc, #dedede) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index a3b9f5fae7d..07850d0ecaa 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2216,6 +2216,13 @@ instance.web.form.FieldChar = instance.web.form.AbstractField.extend(instance.we }, focus: function() { this.$('input:first').focus(); + }, + set_dimensions: function (height, width) { + this._super(height, width); + this.$('input').css({ + height: height, + width: width + }); } }); @@ -2502,7 +2509,7 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we this.$textarea.focus(); }, set_dimensions: function (height, width) { - this._super(); + this._super(height, width); this.$textarea.css({ width: width, minHeight: height @@ -2664,6 +2671,13 @@ instance.web.form.FieldSelection = instance.web.form.AbstractField.extend(instan }, focus: function() { this.$el.find('select:first').focus(); + }, + set_dimensions: function (height, width) { + this._super(height, width); + this.$('select').css({ + height: height, + width: width + }); } }); @@ -3146,6 +3160,10 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc this.ed_def.reject(); return instance.web.form.CompletionFieldMixin._search_create_popup.apply(this, arguments); }, + set_dimensions: function (height, width) { + this._super(height, width); + this.$input.css('height', height); + } }); /* From 57638a3657af3625ea20bc167280b01168a125a2 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 7 Nov 2012 14:28:39 +0100 Subject: [PATCH 636/963] [FIX] Fixed regression due to previous trunk merge bzr revid: fme@openerp.com-20121107132839-wwf3svdnmrfbj97u --- addons/web/static/src/js/search.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 4ef696cc840..e84ea66ff9a 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -271,15 +271,6 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea this.$('.oe_searchview_input:last').focus(); } }, - // when the completion list opens/refreshes, automatically select the - // first completion item so if the user just hits [RETURN] or [TAB] it - // automatically selects it - 'autocompleteopen': function () { - var menu = this.$el.data('autocomplete').menu; - menu.activate( - $.Event({ type: "mouseenter" }), - menu.element.children().first()); - }, // search button 'click button.oe_searchview_search': function (e) { e.stopImmediatePropagation(); From 47967fa1cc733f077507469a5e6fce6108f45416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Wed, 7 Nov 2012 14:28:57 +0100 Subject: [PATCH 637/963] [FIX] removed useless log bzr revid: fva@openerp.com-20121107132857-oj0zyo3y84agprdm --- addons/mail/static/src/js/mail.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index a0a174214bc..fea400af339 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -238,7 +238,6 @@ openerp.mail = function (session) { // returns the file type of a file based on its extension // As it only looks at the extension it is quite approximative. filetype: function(url){ - console.log(url); url = url.name || url.filename || url; var tokens = url.split('.'); if(tokens.length <= 1){ From 7bfc5c3fe4c1c7d88908d1b190ff29fbaed6b898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Wed, 7 Nov 2012 14:54:18 +0100 Subject: [PATCH 638/963] [FIX] forgot to remove a call to a removed method bzr revid: fva@openerp.com-20121107135418-xa74vzqvqlgt3469 --- addons/mail/static/src/js/mail.js | 2 +- addons/mail/static/src/xml/mail.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index fea400af339..45799959bcd 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -363,6 +363,7 @@ openerp.mail = function (session) { this.$(".oe_msg_attachment_list").html( session.web.qweb.render('mail.thread.message.attachments', {'widget': this}) ); // event: delete an attachment this.$(".oe_msg_attachment_list").on('click', '.oe_delete', this.on_attachment_delete); + console.log('display_attachments:',this.$('.oe_msg_attachment_list')); }, /* when a user click on the upload button, send file read on_attachment_loaded @@ -681,7 +682,6 @@ openerp.mail = function (session) { start: function () { this._super.apply(this, arguments); this.expender(); - this.resize_img(); this.bind_events(); if(this.thread_level < this.options.display_indented_thread) { this.create_thread(); diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 02c29a3f1c2..6805c3473c0 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -74,7 +74,7 @@
      -
      [
      +
      [
      uploading From 19f710b03aed69c67b61c5ce7a7d63e5354bc186 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 7 Nov 2012 15:20:44 +0100 Subject: [PATCH 639/963] [REF]some change to reduce further the code and improve readability bzr revid: csn@openerp.com-20121107142044-m807da3apljtl0z2 --- addons/fleet/fleet.py | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 9d7c0eb97d6..bf05aa7cad0 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -56,7 +56,7 @@ class fleet_vehicle_cost(osv.Model): def _year_get_fnc(self, cr, uid, ids, name, unknow_none, context=None): res = {} for record in self.browse(cr, uid, ids, context=context): - res[record.id] = str(time.strptime(record.date, tools.DEFAULT_SERVER_DATE_FORMAT).tm_year) #TODO: why is it a char? + res[record.id] = str(time.strptime(record.date, tools.DEFAULT_SERVER_DATE_FORMAT).tm_year) return res def _cost_name_get_fnc(self, cr, uid, ids, name, unknow_none, context=None): @@ -92,7 +92,6 @@ class fleet_vehicle_cost(osv.Model): } def create(self, cr, uid, data, context=None): - #TODO: should be managed by onchanges() rather by this if 'parent_id' in data and data['parent_id']: parent = self.browse(cr, uid, data['parent_id'], context=context) data['vehicle_id'] = parent.vehicle_id.id @@ -112,7 +111,6 @@ class fleet_vehicle_tag(osv.Model): 'name': fields.char('Name', required=True, translate=True), } - class fleet_vehicle_state(osv.Model): _name = 'fleet.vehicle.state' _order = 'sequence asc' @@ -395,45 +393,28 @@ class fleet_vehicle(osv.Model): return vehicle_id def write(self, cr, uid, ids, vals, context=None): - #TODO: put comments - #TODO: use _() to translate labels - #TODO: why is there a try..except? - #TODO: shorten the code (e.g: oldmodel = vehicle.model_id and olmodel.model_id.name or _('None') - #TODO: in PEP 8 standard, a coma should be followed by a space, '+' operator and equal sign should be in between 2 spaces - #TODO: you're looping on `ids´, and in this loop you're writing again and posting logs on `ids´. Use message_post only on vehicle.id and put super write() outside of the loop. + """ + This function write an entry in the openchatter whenever we change important information + on the vehicle like the model, the drive, the state of the vehicle or its license plate + """ for vehicle in self.browse(cr, uid, ids, context): changes = [] if 'model_id' in vals and vehicle.model_id.id != vals['model_id']: value = self.pool.get('fleet.vehicle.model').browse(cr,uid,vals['model_id'],context=context).name - oldmodel = vehicle.model_id - if oldmodel: - oldmodel = oldmodel.name - else: - oldmodel = 'None' + oldmodel = vehicle.model_id.name or _('None') changes.append(_('Model: from \' %s \' to \' %s \'') %(oldmodel, value)) if 'driver' in vals and vehicle.driver.id != vals['driver']: value = self.pool.get('res.partner').browse(cr,uid,vals['driver'],context=context).name - olddriver = vehicle.driver - if olddriver: - olddriver = olddriver.name - else: - olddriver = 'None' + olddriver = (vehicle.driver.name) or _('None') changes.append(_('Driver: from \' %s \' to \' %s \'') %(olddriver, value)) if 'state' in vals and vehicle.state.id != vals['state']: value = self.pool.get('fleet.vehicle.state').browse(cr,uid,vals['state'],context=context).name - oldstate = vehicle.state - if oldstate: - oldstate=oldstate.name - else: - oldstate = 'None' + oldstate = vehicle.state.name or _('None') changes.append(_('State: from \' %s \' to \' %s \'') %(oldstate, value)) if 'license_plate' in vals and vehicle.license_plate != vals['license_plate']: - old_license_plate = vehicle.license_plate - if not old_license_plate: - old_license_plate = 'None' + old_license_plate = vehicle.license_plate or _('None') changes.append(_('License Plate: from \' %s \' to \' %s \'') %(old_license_plate, vals['license_plate'])) - if len(changes) > 0: self.message_post(cr, uid, [vehicle.id], body=", ".join(changes), context=context) From da2bc197c482b67bc824f69538e875b90a9be0d8 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 7 Nov 2012 15:24:07 +0100 Subject: [PATCH 640/963] [FIX] mail: jquery event bzr revid: chm@openerp.com-20121107142407-zqnvehh0i7bx1v7k --- addons/mail/static/src/js/mail.js | 47 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 45799959bcd..0211d4a5e91 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -360,10 +360,8 @@ openerp.mail = function (session) { /* upload the file on the server, add in the attachments list and reload display */ display_attachments: function () { + //this.$(".oe_msg_attachment_list").off('click', '.oe_mail_attachment_delete') this.$(".oe_msg_attachment_list").html( session.web.qweb.render('mail.thread.message.attachments', {'widget': this}) ); - // event: delete an attachment - this.$(".oe_msg_attachment_list").on('click', '.oe_delete', this.on_attachment_delete); - console.log('display_attachments:',this.$('.oe_msg_attachment_list')); }, /* when a user click on the upload button, send file read on_attachment_loaded @@ -429,6 +427,7 @@ openerp.mail = function (session) { /* unlink the file on the server and reload display */ on_attachment_delete: function (event) { + console.log('delete'); event.stopPropagation(); var attachment_id=$(event.target).data("id"); if (attachment_id) { @@ -452,19 +451,22 @@ openerp.mail = function (session) { this.$('textarea.oe_compact').on('focus', _.bind( this.on_compose_expandable, this)); // set the function called when attachments are added - this.$el.on('change', 'input.oe_form_binary_file', _.bind( this.on_attachment_change, this) ); + this.$('input.oe_form_binary_file').on('change', _.bind( this.on_attachment_change, this) ); - this.$el.on('click', '.oe_cancel', _.bind( this.on_cancel, this) ); - this.$el.on('click', '.oe_post', _.bind( this.on_message_post, this) ); - this.$el.on('click', '.oe_full', _.bind( this.on_compose_fullmail, this, 'reply') ); + this.$('.oe_cancel').on('click', _.bind( this.on_cancel, this) ); + this.$('.oe_post').on('click', _.bind( this.on_message_post, this) ); + this.$('.oe_full').on('click', _.bind( this.on_compose_fullmail, this, 'reply') ); /* stack for don't close the compose form if the user click on a button */ - this.$el.on('mousedown', '.oe_msg_footer', _.bind( function () { this.stay_open = true; }, this)); - this.$('textarea:not(.oe_compact):first').on('focus, mouseup, keydown', _.bind( function () { this.stay_open = false; }, this)); - this.$('textarea:not(.oe_compact):first').autosize(); + this.$('.oe_msg_footer').on('mousedown', _.bind( function () { this.stay_open = true; }, this)); + this.$('textarea:not(.oe_compact)').on('focus, mouseup, keydown', _.bind( function () { this.stay_open = false; }, this)); + this.$('textarea:not(.oe_compact)').autosize(); // auto close - this.$el.on('blur', 'textarea:not(.oe_compact):first', _.bind( this.on_compose_expandable, this)); + this.$('textarea:not(.oe_compact)').on('blur', _.bind( this.on_compose_expandable, this)); + + // event: delete child attachments off the oe_msg_attachment_list box + this.$(".oe_msg_attachment_list").on('click', '.oe_mail_attachment_delete', this.on_attachment_delete); }, on_compose_fullmail: function (default_composition_mode) { @@ -640,7 +642,7 @@ openerp.mail = function (session) { * Bind events in the widget. Each event is slightly described * in the function. */ bind_events: function () { - this.$el.on('click', '.oe_msg_more_message', this.on_expandable); + this.$('.oe_msg_more_message').on('click', this.on_expandable); }, animated_destroy: function (fadeTime) { @@ -697,17 +699,16 @@ openerp.mail = function (session) { * in the function. */ bind_events: function () { var self = this; - // header icons bindings - this.$el.on('click', '.oe_read', this.on_message_read); - this.$el.on('click', '.oe_unread', this.on_message_unread); - this.$el.on('click', '.oe_msg_delete', this.on_message_delete); - this.$el.on('click', '.oe_reply', this.on_message_reply); - this.$el.on('click', '.oe_star', this.on_star); + this.$('.oe_read').on('click', this.on_message_read); + this.$('.oe_unread').on('click', this.on_message_unread); + this.$('.oe_msg_delete').on('click', this.on_message_delete); + this.$('.oe_reply').on('click', this.on_message_reply); + this.$('.oe_star').on('click', this.on_star); - this.$el.on('click', '.oe_msg_vote', this.on_vote); + this.$('.oe_msg_vote').on('click', this.on_vote); - this.$el.on('click', '.oe_view_attachments', function(){ + this.$('.oe_view_attachments').on('click', function(){ self.$('.oe_msg_attachment_list').toggle(200); }); }, @@ -1043,8 +1044,8 @@ openerp.mail = function (session) { * in the function. */ bind_events: function () { var self = this; - self.$el.on('click', '.oe_mail_list_recipients .oe_more', self.on_show_recipients); - self.$el.on('click', '.oe_mail_compose_textarea .oe_more_hidden', self.on_hide_recipients); + self.$('.oe_mail_list_recipients .oe_more').on('click', self.on_show_recipients); + self.$('.oe_mail_compose_textarea .oe_more_hidden').on('click', self.on_hide_recipients); }, /** @@ -1662,7 +1663,7 @@ openerp.mail = function (session) { template:'mail.ComposeMessageTopButton', start: function () { - this.$el.on('click', 'button', this.on_compose_message ); + this.$('button').on('click', this.on_compose_message ); this._super(); }, From 1b8a0e66eee009946caa8afeadc809cf1a7583bf Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 7 Nov 2012 15:37:40 +0100 Subject: [PATCH 641/963] [REV] nicolas.vanhoren@openerp.com-20120712074237-xugmbw19wjjoes9l eagerly loaded treeviews, making heavily loaded charts of accounts completely unusable bzr revid: xmo@openerp.com-20121107143740-31i16933dfg4t6xk --- addons/web/static/src/js/view_tree.js | 105 +++++++++++--------------- addons/web/static/src/xml/base.xml | 16 ++-- 2 files changed, 51 insertions(+), 70 deletions(-) diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js index 05760420ba8..3f1dfabe80a 100644 --- a/addons/web/static/src/js/view_tree.js +++ b/addons/web/static/src/js/view_tree.js @@ -45,7 +45,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie view_type: "tree", toolbar: this.view_manager ? !!this.view_manager.sidebar : false, context: this.dataset.get_context() - }).then(this.on_loaded); + }, this.on_loaded); }, /** * Returns the list of fields needed to correctly read objects. @@ -63,12 +63,6 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie } return fields; }, - store_record:function(records){ - var self = this; - _(records).each(function (record) { - self.records[record.id] = record; - }); - }, on_loaded: function (fields_view) { var self = this; var has_toolbar = !!fields_view.arch.attrs.toolbar; @@ -93,19 +87,17 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie this.$el.addClass(this.fields_view.arch.attrs['class']); this.dataset.read_slice(this.fields_list()).then(function(records) { - self.store_record(records); if (!has_toolbar) { // WARNING: will do a second read on the same ids, but only on // first load so not very important - self.render_data({'null':records}) - self.getdata(_.pluck(records,"id")); + self.getdata(null, _(records).pluck('id')); return; } var $select = self.$el.find('select') .change(function () { var $option = $(this).find(':selected'); - self.getdata($option.val()); + self.getdata($option.val(), $option.data('children')); }); _(records).each(function (record) { self.records[record.id] = record; @@ -120,12 +112,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie $select.change(); } }); - this.$el.find("#tree_view_expand").click(function(){ - self.expand_all(); - }); - this.$el.find("#tree_view_collapse").click(function(){ - self.collpase_all(); - }); + // TODO store open nodes in url ?... this.do_push_state({}); @@ -141,22 +128,6 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie return [color, py.parse(py.tokenize(expr)), expr]; }).value(); }, - expand_all: function(){ - var self = this; - var tr = this.$el.find(".oe-treeview-table tbody tr[id^='treerow_']"); - _.each(tr,function(rec){ - self.showcontent($(rec).attr('data-id'),true); - }); - }, - collpase_all: function(){ - var self = this; - var root_tr = this.$el.find(".oe-treeview-table tbody tr[data-level='"+1+"']"); - _.each(root_tr,function(rec){ - if($(rec).hasClass('oe_open')){ - self.showcontent($(rec).attr('data-id'),false); - } - }); - }, /** * Returns the color for the provided record in the current view (from the * ``@colors`` attribute) @@ -193,44 +164,50 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie }); this.$el.delegate('.treeview-tr', 'click', function () { - var $this = $(this), + var is_loaded = 0, + $this = $(this), record_id = $this.data('id'), - bool = $this.parent().hasClass('oe_open'); - self.showcontent(record_id, !bool); + record = self.records[record_id], + children_ids = record[self.children_field]; + + _(children_ids).each(function(childid) { + if (self.$el.find('#treerow_' + childid).length) { + if (self.$el.find('#treerow_' + childid).is(':hidden')) { + is_loaded = -1; + } else { + is_loaded++; + } + } + }); + if (is_loaded === 0) { + if (!$this.parent().hasClass('oe_open')) { + self.getdata(record_id, children_ids); + } + } else { + self.showcontent(record_id, is_loaded < 0); + } }); }, // get child data of selected value - getdata: function (id) { + getdata: function (id, children_ids) { var self = this; - var parent_child ={}; - id = _.isArray(id)?id:parseInt(id); - var ir_model_data = new instance.web.Model(this.model,self.dataset.get_context() || {},[['id','child_of',id]]).query(); - ir_model_data._execute().then(function(records){ - self.store_record(records); - _.each(records,function(rec){ - if(rec[self.children_field].length === 0)return; - parent_child[rec.id] = []; - _.each(rec[self.children_field],function(key){ - parent_child[rec.id].push(self.records[key]); - }); - }) - self.render_data(parent_child); - }); - }, - render_data: function(groupby){ - var self = this; - _.each(_.keys(groupby),function(key){ - var $curr_node = self.$el.find('#treerow_' + key); - var record = groupby[key]; + + self.dataset.read_ids(children_ids, this.fields_list()).then(function(records) { + _(records).each(function (record) { + self.records[record.id] = record; + }); + + var $curr_node = self.$el.find('#treerow_' + id); var children_rows = QWeb.render('TreeView.rows', { - 'records': record, + 'records': records, 'children_field': self.children_field, 'fields_view': self.fields_view.arch.children, 'fields': self.fields, - 'level': ($curr_node.data('level') || 0) + 1, + 'level': $curr_node.data('level') || 0, 'render': instance.web.format_value, 'color_for': self.color_for }); + if ($curr_node.length) { $curr_node.addClass('oe_open'); $curr_node.after(children_rows); @@ -238,10 +215,8 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie self.$el.find('tbody').html(children_rows); } }); - self.collpase_all(); }, - // Get details in listview activate: function(id) { var self = this; @@ -284,5 +259,13 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie }, this); }, + do_show: function () { + this.$el.show(); + }, + + do_hide: function () { + this.$el.hide(); + this.hidden = true; + } }); }; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 275d31a9fde..4118d3fc363 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -567,16 +567,14 @@ -
      - - - -
      - + +
      @@ -588,11 +586,11 @@ + t-att-data-id="record.id" t-att-data-level="level + 1"> - +
      + t-if="!field.attrs.modifiers.tree_invisible" + class="treeview-header">
      Date: Wed, 7 Nov 2012 15:42:32 +0100 Subject: [PATCH 642/963] [FIX] seupt.py zsi not needed anymore bzr revid: al@openerp.com-20121107144232-xf9qyo1rurwc0xnq --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 45f19ea7a7d..6efec4e6125 100755 --- a/setup.py +++ b/setup.py @@ -126,7 +126,6 @@ setuptools.setup( 'vobject', 'werkzeug', 'xlwt', - 'zsi', # optional ], extras_require = { 'SSL' : ['pyopenssl'], From 153ab3b020f26cc3d51db899d86486119fbc2032 Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Wed, 7 Nov 2012 15:48:45 +0100 Subject: [PATCH 643/963] [FIX] domain resolution for Document button in project FORM lp bug: https://launchpad.net/bugs/1075436 fixed bzr revid: api@openerp.com-20121107144845-yi437u8w9fbcgs3u --- addons/project/project.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 62c1b34dbf9..2811f638f73 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -203,11 +203,7 @@ class project(osv.osv): def attachment_tree_view(self, cr, uid, ids, context): task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)]) - domain = [ - ('|', - '&', 'res_model', '=', 'project.project'), ('res_id', 'in', ids), - '&', ('res_model', '=', 'project.task'), ('res_id', 'in', task_ids) - ] + domain = ['|', '&', ('res_model', '=', 'project.project'), ('res_id', 'in', ids), '&', ('res_model', '=', 'project.task'), ('res_id', 'in', task_ids)] res_id = ids and ids[0] or False return { 'name': _('Attachments'), From 2665f369346bd5073d6a1e2ff1ce55848d4278e7 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 7 Nov 2012 16:17:26 +0100 Subject: [PATCH 644/963] [FIX]correct a small bug when creating odometer with value zero bzr revid: csn@openerp.com-20121107151726-xr6754fd9t39k5zc --- addons/fleet/fleet.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index bf05aa7cad0..6a95ea6e856 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -102,6 +102,8 @@ class fleet_vehicle_cost(osv.Model): data['vehicle_id'] = contract.vehicle_id.id data['cost_subtype'] = contract.cost_subtype.id data['cost_type'] = contract.cost_type + if 'odometer' in data and not data['odometer']: + del(data['odometer']) return super(fleet_vehicle_cost, self).create(cr, uid, data, context=context) From 48cec81235101034eea33cfe92ce0812159bde32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 7 Nov 2012 16:21:26 +0100 Subject: [PATCH 645/963] [IMP] Chatter widget: display email icon only when sender is unknown. bzr revid: tde@openerp.com-20121107152126-71yzsy1nb0tj549w --- addons/mail/static/src/js/mail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index ece8e65144d..6be6693d8d8 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -590,7 +590,7 @@ openerp.mail = function (session) { //formating and add some fields for render this.date = session.web.format_value(this._date, {type:"datetime"}); this.timerelative = $.timeago(this.date); - if (this.type == 'email') { + if (this.type == 'email' && !this.author_id[0]) { this.avatar = ('/mail/static/src/img/email_icon.png'); } else { this.avatar = mail.ChatterUtils.get_image(this.session, 'res.partner', 'image_small', this.author_id[0]); From 2799ba172c260ce220e2e57ace2ed541e210c0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 7 Nov 2012 16:21:58 +0100 Subject: [PATCH 646/963] [FIX] portal: fixed class name and imports. bzr revid: tde@openerp.com-20121107152158-ze50vqj673nvavib --- addons/portal/tests/test_portal.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/portal/tests/test_portal.py b/addons/portal/tests/test_portal.py index 83b10b39c28..be32b015743 100644 --- a/addons/portal/tests/test_portal.py +++ b/addons/portal/tests/test_portal.py @@ -19,12 +19,11 @@ # ############################################################################## -from openerp.addons.mail.tests import test_mail -from openerp.tools import append_content_to_html +from openerp.addons.mail.tests import test_mail_mockup from osv.orm import except_orm -class test_portal(test_mail.TestMailMockups): +class test_portal(test_mail_mockup.TestMailMockups): def setUp(self): super(test_portal, self).setUp() From 4d56a3c591f3aa4659d498ef9daae042d288a1ff Mon Sep 17 00:00:00 2001 From: "vta vta@openerp.com" <> Date: Wed, 7 Nov 2012 16:22:20 +0100 Subject: [PATCH 647/963] [FIX] Remove icon in Import Invoice button, added Journal Entries button. bzr revid: vta@openerp.com-20121107152220-20k5s5i37bem6gug --- addons/account/account_view.xml | 12 ++++++++++++ addons/account_voucher/account_voucher_view.xml | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 8441c8dbfc9..7931668d6ef 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -680,6 +680,18 @@ + + account.bank.statement.journal.items.form.inherit + account.bank.statement + + + +