diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index b48e842caf5..446ebc83703 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -430,6 +430,19 @@ class account_move_line(osv.osv):
elif line.reconcile_partial_id:
res[line.id] = str(line.reconcile_partial_id.name)
return res
+
+ def _get_move_from_reconcile(self, cr, uid, ids, context=None):
+ move = {}
+ for r in self.pool.get('account.move.reconcile').browse(cr, uid, ids, context=context):
+ for line in r.line_partial_ids:
+ move[line.move_id.id] = True
+ for line in r.line_id:
+ move[line.move_id.id] = True
+ move_line_ids = []
+ if move:
+ move_line_ids = self.pool.get('account.move.line').search(cr, uid, [('journal_id','in',move.keys())], context=context)
+ return move_line_ids
+
_columns = {
'name': fields.char('Name', size=64, required=True),
@@ -445,7 +458,8 @@ class account_move_line(osv.osv):
'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1),
'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2),
'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2),
- 'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile Ref'),
+ 'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile Ref', store={
+ 'account.move.line': (lambda self, cr, uid, ids, c={}: ids, ['reconcile_id','reconcile_partial_id'], 50),'account.move.reconcile': (_get_move_from_reconcile, None, 50)}),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')),
'amount_residual_currency': fields.function(_amount_residual, string='Residual Amount in Currency', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."),
'amount_residual': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."),
@@ -628,7 +642,7 @@ class account_move_line(osv.osv):
(_check_date, 'The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal.', ['date']),
(_check_currency, 'The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal.', ['currency_id']),
(_check_currency_and_amount, "You cannot create journal items with a secondary currency without recording both 'currency' and 'amount currency' field.", ['currency_id','amount_currency']),
- (_check_currency_amount, 'The amount expressed in the secondary currency must be positive when the journal item is a debit and negative when if it is a credit.', ['amount_currency']),
+ (_check_currency_amount, 'The amount expressed in the secondary currency must be positive when account is debited and negative when account is credited.', ['amount_currency']),
(_check_currency_company, "You cannot provide a secondary currency if it is the same than the company one." , ['currency_id']),
]
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index c29371e4c44..8e2cc6452c0 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -384,6 +384,7 @@
+
@@ -881,6 +882,7 @@
+
@@ -891,6 +893,12 @@
+
+
+
+
+
+
diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml
index 6a58bc7f77e..a11b1089dec 100644
--- a/addons/account/partner_view.xml
+++ b/addons/account/partner_view.xml
@@ -97,7 +97,7 @@
-
+
@@ -127,7 +127,7 @@
-
+
Accounting-related settings are managed on
diff --git a/addons/account/res_config.py b/addons/account/res_config.py
index 8980a31927e..65f38d6e26b 100644
--- a/addons/account/res_config.py
+++ b/addons/account/res_config.py
@@ -259,6 +259,12 @@ class account_config_settings(osv.osv_memory):
def onchange_tax_rate(self, cr, uid, ids, rate, context=None):
return {'value': {'purchase_tax_rate': rate or False}}
+ def onchange_multi_currency(self, cr, uid, ids, group_multi_currency, context=None):
+ res = {}
+ if not group_multi_currency:
+ res['value'] = {'income_currency_exchange_account_id': False, 'expense_currency_exchange_account_id': False}
+ return res
+
def onchange_start_date(self, cr, uid, id, start_date):
if start_date:
start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d")
diff --git a/addons/account/res_config_view.xml b/addons/account/res_config_view.xml
index 8a5b1978ecb..115566e9ab5 100644
--- a/addons/account/res_config_view.xml
+++ b/addons/account/res_config_view.xml
@@ -122,7 +122,7 @@
-
+
diff --git a/addons/account_anglo_saxon/i18n/sk.po b/addons/account_anglo_saxon/i18n/sk.po
new file mode 100644
index 00000000000..ff14bd7feb4
--- /dev/null
+++ b/addons/account_anglo_saxon/i18n/sk.po
@@ -0,0 +1,62 @@
+# Slovak translation for openobject-addons
+# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2014.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-12-21 17:05+0000\n"
+"PO-Revision-Date: 2014-04-26 16:04+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Slovak \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2014-04-27 05:58+0000\n"
+"X-Generator: Launchpad (build 16985)\n"
+
+#. module: account_anglo_saxon
+#: model:ir.model,name:account_anglo_saxon.model_product_category
+msgid "Product Category"
+msgstr ""
+
+#. module: account_anglo_saxon
+#: model:ir.model,name:account_anglo_saxon.model_account_invoice_line
+msgid "Invoice Line"
+msgstr ""
+
+#. module: account_anglo_saxon
+#: model:ir.model,name:account_anglo_saxon.model_purchase_order
+msgid "Purchase Order"
+msgstr ""
+
+#. module: account_anglo_saxon
+#: model:ir.model,name:account_anglo_saxon.model_product_template
+msgid "Product Template"
+msgstr ""
+
+#. module: account_anglo_saxon
+#: field:product.category,property_account_creditor_price_difference_categ:0
+#: field:product.template,property_account_creditor_price_difference:0
+msgid "Price Difference Account"
+msgstr ""
+
+#. module: account_anglo_saxon
+#: model:ir.model,name:account_anglo_saxon.model_account_invoice
+msgid "Invoice"
+msgstr ""
+
+#. module: account_anglo_saxon
+#: model:ir.model,name:account_anglo_saxon.model_stock_picking
+msgid "Picking List"
+msgstr ""
+
+#. module: account_anglo_saxon
+#: help:product.category,property_account_creditor_price_difference_categ:0
+#: help:product.template,property_account_creditor_price_difference:0
+msgid ""
+"This account will be used to value price difference between purchase price "
+"and cost price."
+msgstr ""
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index 771c6e15bd8..982d53ef4e6 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -189,7 +189,7 @@ class account_voucher(osv.osv):
if not ids:
return []
if context is None: context = {}
- return [(r['id'], (str("%.2f" % r['amount']) or '')) for r in self.read(cr, uid, ids, ['amount'], context, load='_classic_write')]
+ return [(r['id'], (r['number'] or _('Voucher'))) for r in self.read(cr, uid, ids, ['number'], context, load='_classic_write')]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
mod_obj = self.pool.get('ir.model.data')
diff --git a/addons/association/i18n/sk.po b/addons/association/i18n/sk.po
new file mode 100644
index 00000000000..c1c16d88cd8
--- /dev/null
+++ b/addons/association/i18n/sk.po
@@ -0,0 +1,135 @@
+# Slovak translation for openobject-addons
+# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2014.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2011-01-11 11:14+0000\n"
+"PO-Revision-Date: 2014-04-26 16:22+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Slovak \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2014-04-27 05:58+0000\n"
+"X-Generator: Launchpad (build 16985)\n"
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,wiki:0
+msgid "Wiki"
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+msgid "Event Management"
+msgstr ""
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,project_gtd:0
+msgid "Getting Things Done"
+msgstr ""
+
+#. module: association
+#: model:ir.module.module,description:association.module_meta_information
+msgid "This module is to create Profile for Associates"
+msgstr ""
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,progress:0
+msgid "Configuration Progress"
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+msgid ""
+"Here are specific applications related to the Association Profile you "
+"selected."
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+msgid "title"
+msgstr ""
+
+#. module: association
+#: help:profile.association.config.install_modules_wizard,event_project:0
+msgid "Helps you to manage and organize your events."
+msgstr ""
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,config_logo:0
+msgid "Image"
+msgstr ""
+
+#. module: association
+#: help:profile.association.config.install_modules_wizard,hr_expense:0
+msgid ""
+"Tracks and manages employee expenses, and can automatically re-invoice "
+"clients if the expenses are project-related."
+msgstr ""
+
+#. module: association
+#: help:profile.association.config.install_modules_wizard,project_gtd:0
+msgid ""
+"GTD is a methodology to efficiently organise yourself and your tasks. This "
+"module fully integrates GTD principle with OpenERP's project management."
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+msgid "Resources Management"
+msgstr ""
+
+#. module: association
+#: model:ir.module.module,shortdesc:association.module_meta_information
+msgid "Association profile"
+msgstr ""
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,hr_expense:0
+msgid "Expenses Tracking"
+msgstr ""
+
+#. module: association
+#: model:ir.actions.act_window,name:association.action_config_install_module
+#: view:profile.association.config.install_modules_wizard:0
+msgid "Association Application Configuration"
+msgstr ""
+
+#. module: association
+#: help:profile.association.config.install_modules_wizard,wiki:0
+msgid ""
+"Lets you create wiki pages and page groups in order to keep track of "
+"business knowledge and share it with and between your employees."
+msgstr ""
+
+#. module: association
+#: help:profile.association.config.install_modules_wizard,project:0
+msgid ""
+"Helps you manage your projects and tasks by tracking them, generating "
+"plannings, etc..."
+msgstr ""
+
+#. module: association
+#: model:ir.model,name:association.model_profile_association_config_install_modules_wizard
+msgid "profile.association.config.install_modules_wizard"
+msgstr ""
+
+#. module: association
+#: field:profile.association.config.install_modules_wizard,event_project:0
+msgid "Events"
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+#: field:profile.association.config.install_modules_wizard,project:0
+msgid "Project Management"
+msgstr ""
+
+#. module: association
+#: view:profile.association.config.install_modules_wizard:0
+msgid "Configure"
+msgstr ""
diff --git a/addons/audittrail/__init__.py b/addons/audittrail/__init__.py
deleted file mode 100644
index cdaa3fd4181..00000000000
--- a/addons/audittrail/__init__.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- 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 audittrail
-import wizard
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/audittrail/__openerp__.py b/addons/audittrail/__openerp__.py
deleted file mode 100644
index 41958c84f66..00000000000
--- a/addons/audittrail/__openerp__.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# -*- 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': 'Audit Trail',
- 'version': '1.0',
- 'category': 'Tools',
- 'description': """
-This module lets administrator track every user operation on all the objects of the system.
-===========================================================================================
-
-The administrator can subscribe to rules for read, write and delete on objects
-and can check logs.
- """,
- 'author': 'OpenERP SA',
- 'website': 'http://www.openerp.com',
- 'depends': ['base'],
- 'data': [
- 'wizard/audittrail_view_log_view.xml',
- 'audittrail_view.xml',
- 'security/ir.model.access.csv',
- ],
- 'demo': ['audittrail_demo.xml'],
- 'installable': True,
- 'auto_install': False,
- 'images': ['images/audittrail1.jpeg','images/audittrail2.jpeg','images/audittrail3.jpeg'],
-}
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py
deleted file mode 100644
index 71008e0855b..00000000000
--- a/addons/audittrail/audittrail.py
+++ /dev/null
@@ -1,538 +0,0 @@
-# -*- 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 openerp
-from openerp.osv import fields, osv
-import openerp.service.model
-from openerp.tools.translate import _
-import time
-from openerp import tools
-from openerp import SUPERUSER_ID
-
-class audittrail_rule(osv.osv):
- """
- For Auddittrail Rule
- """
- _name = 'audittrail.rule'
- _description = "Audittrail Rule"
- _columns = {
- "name": fields.char("Rule Name", size=32, required=True),
- "object_id": fields.many2one('ir.model', 'Object', required=True, help="Select object for which you want to generate log."),
- "user_id": fields.many2many('res.users', 'audittail_rules_users',
- 'user_id', 'rule_id', 'Users', help="if User is not added then it will applicable for all users"),
- "log_read": fields.boolean("Log Reads", help="Select this if you want to keep track of read/open on any record of the object of this rule"),
- "log_write": fields.boolean("Log Writes", help="Select this if you want to keep track of modification on any record of the object of this rule"),
- "log_unlink": fields.boolean("Log Deletes", help="Select this if you want to keep track of deletion on any record of the object of this rule"),
- "log_create": fields.boolean("Log Creates",help="Select this if you want to keep track of creation on any record of the object of this rule"),
- "log_action": fields.boolean("Log Action",help="Select this if you want to keep track of actions on the object of this rule"),
- "log_workflow": fields.boolean("Log Workflow",help="Select this if you want to keep track of workflow on any record of the object of this rule"),
- "state": fields.selection((("draft", "Draft"), ("subscribed", "Subscribed")), "Status", required=True),
- "action_id": fields.many2one('ir.actions.act_window', "Action ID"),
- }
- _defaults = {
- 'state': 'draft',
- 'log_create': 1,
- 'log_unlink': 1,
- 'log_write': 1,
- }
- _sql_constraints = [
- ('model_uniq', 'unique (object_id)', """There is already a rule defined on this object\n You cannot define another: please edit the existing one.""")
- ]
- __functions = {}
-
- def subscribe(self, cr, uid, ids, *args):
- """
- Subscribe Rule for auditing changes on object and apply shortcut for logs on that object.
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Auddittrail Rule’s IDs.
- @return: True
- """
- obj_action = self.pool.get('ir.actions.act_window')
- obj_model = self.pool.get('ir.model.data')
- #start Loop
- for thisrule in self.browse(cr, uid, ids):
- if thisrule.object_id.model not in self.pool:
- raise osv.except_osv(
- _('WARNING: audittrail is not part of the pool'),
- _('Change audittrail depends -- Setting rule as DRAFT'))
- self.write(cr, uid, [thisrule.id], {"state": "draft"})
- val = {
- "name": 'View Log',
- "res_model": 'audittrail.log',
- "src_model": thisrule.object_id.model,
- "domain": "[('object_id','=', " + str(thisrule.object_id.id) + "), ('res_id', '=', active_id)]"
-
- }
- action_id = obj_action.create(cr, SUPERUSER_ID, val)
- self.write(cr, uid, [thisrule.id], {"state": "subscribed", "action_id": action_id})
- keyword = 'client_action_relate'
- value = 'ir.actions.act_window,' + str(action_id)
- res = obj_model.ir_set(cr, SUPERUSER_ID, 'action', keyword, 'View_log_' + thisrule.object_id.model, [thisrule.object_id.model], value, replace=True, isobject=True, xml_id=False)
- #End Loop
- return True
-
- def unsubscribe(self, cr, uid, ids, *args):
- """
- Unsubscribe Auditing Rule on object
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Auddittrail Rule’s IDs.
- @return: True
- """
- obj_action = self.pool.get('ir.actions.act_window')
- ir_values_obj = self.pool.get('ir.values')
- value=''
- #start Loop
- for thisrule in self.browse(cr, uid, ids):
- if thisrule.id in self.__functions:
- for function in self.__functions[thisrule.id]:
- setattr(function[0], function[1], function[2])
- w_id = obj_action.search(cr, uid, [('name', '=', 'View Log'), ('res_model', '=', 'audittrail.log'), ('src_model', '=', thisrule.object_id.model)])
- if w_id:
- obj_action.unlink(cr, SUPERUSER_ID, w_id)
- value = "ir.actions.act_window" + ',' + str(w_id[0])
- val_id = ir_values_obj.search(cr, uid, [('model', '=', thisrule.object_id.model), ('value', '=', value)])
- if val_id:
- res = ir_values_obj.unlink(cr, uid, [val_id[0]])
- self.write(cr, uid, [thisrule.id], {"state": "draft"})
- #End Loop
- return True
-
-class audittrail_log(osv.osv):
- """
- For Audittrail Log
- """
- _name = 'audittrail.log'
- _description = "Audittrail Log"
-
- def _name_get_resname(self, cr, uid, ids, *args):
- data = {}
- for resname in self.browse(cr, uid, ids,[]):
- model_object = resname.object_id
- res_id = resname.res_id
- if model_object and res_id:
- model_pool = self.pool[model_object.model]
- res = model_pool.read(cr, uid, res_id, ['name'])
- data[resname.id] = res['name']
- else:
- data[resname.id] = False
- return data
-
- _columns = {
- "name": fields.char("Resource Name",size=64),
- "object_id": fields.many2one('ir.model', 'Object'),
- "user_id": fields.many2one('res.users', 'User'),
- "method": fields.char("Method", size=64),
- "timestamp": fields.datetime("Date"),
- "res_id": fields.integer('Resource Id'),
- "line_ids": fields.one2many('audittrail.log.line', 'log_id', 'Log lines'),
- }
-
- _defaults = {
- "timestamp": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S")
- }
- _order = "timestamp desc"
-
-class audittrail_log_line(osv.osv):
- """
- Audittrail Log Line.
- """
- _name = 'audittrail.log.line'
- _description = "Log Line"
- _columns = {
- 'field_id': fields.many2one('ir.model.fields', 'Fields', required=True),
- 'log_id': fields.many2one('audittrail.log', 'Log'),
- 'log': fields.integer("Log ID"),
- 'old_value': fields.text("Old Value"),
- 'new_value': fields.text("New Value"),
- 'old_value_text': fields.text('Old value Text'),
- 'new_value_text': fields.text('New value Text'),
- 'field_description': fields.char('Field Description', size=64),
- }
-
-# Monkeypatch the model RPC endpoint for auditing changes.
-
-def get_value_text(cr, uid, pool, resource_pool, method, field, value):
- """
- Gets textual values for the fields.
- If the field is a many2one, it returns the name.
- If it's a one2many or a many2many, it returns a list of name.
- In other cases, it just returns the value.
- :param cr: the current row, from the database cursor,
- :param uid: the current user’s ID for security checks,
- :param pool: current db's pooler object.
- :param resource_pool: pooler object of the model which values are being changed.
- :param field: for which the text value is to be returned.
- :param value: value of the field.
- :param recursive: True or False, True will repeat the process recursively
- :return: string value or a list of values(for O2M/M2M)
- """
-
- field_obj = (resource_pool._all_columns.get(field)).column
- if field_obj._type in ('one2many','many2many'):
- data = pool[field_obj._obj].name_get(cr, uid, value)
- #return the modifications on x2many fields as a list of names
- res = map(lambda x:x[1], data)
- elif field_obj._type == 'many2one':
- #return the modifications on a many2one field as its value returned by name_get()
- res = value and value[1] or value
- else:
- res = value
- return res
-
-def create_log_line(cr, uid, log_id, model, lines=None):
- """
- Creates lines for changed fields with its old and new values
-
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param model: Object which values are being changed
- @param lines: List of values for line is to be created
- """
- if lines is None:
- lines = []
- pool = openerp.registry(cr.dbname)
- obj_pool = pool[model.model]
- model_pool = pool.get('ir.model')
- field_pool = pool.get('ir.model.fields')
- log_line_pool = pool.get('audittrail.log.line')
- for line in lines:
- field_obj = obj_pool._all_columns.get(line['name'])
- assert field_obj, _("'%s' field does not exist in '%s' model" %(line['name'], model.model))
- field_obj = field_obj.column
- old_value = line.get('old_value', '')
- new_value = line.get('new_value', '')
- search_models = [model.id]
- if obj_pool._inherits:
- search_models += model_pool.search(cr, uid, [('model', 'in', obj_pool._inherits.keys())])
- field_id = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', search_models)])
- if field_obj._type == 'many2one':
- old_value = old_value and old_value[0] or old_value
- new_value = new_value and new_value[0] or new_value
- vals = {
- "log_id": log_id,
- "field_id": field_id and field_id[0] or False,
- "old_value": old_value,
- "new_value": new_value,
- "old_value_text": line.get('old_value_text', ''),
- "new_value_text": line.get('new_value_text', ''),
- "field_description": field_obj.string
- }
- line_id = log_line_pool.create(cr, uid, vals)
- return True
-
-def log_fct(cr, uid_orig, model, method, fct_src, *args, **kw):
- """
- Logging function: This function is performing the logging operation
- @param model: Object whose values are being changed
- @param method: method to log: create, read, write, unlink, action or workflow action
- @param fct_src: execute method of Object proxy
-
- @return: Returns result as per method of Object proxy
- """
- pool = openerp.registry(cr.dbname)
- resource_pool = pool[model]
- model_pool = pool.get('ir.model')
- model_ids = model_pool.search(cr, SUPERUSER_ID, [('model', '=', model)])
- model_id = model_ids and model_ids[0] or False
- assert model_id, _("'%s' Model does not exist..." %(model))
- model = model_pool.browse(cr, SUPERUSER_ID, model_id)
-
- # fields to log. currently only used by log on read()
- field_list = []
- old_values = new_values = {}
-
- if method == 'create':
- res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
- if res:
- res_ids = [res]
- new_values = get_data(cr, uid_orig, pool, res_ids, model, method)
- elif method == 'read':
- res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
- if isinstance(res, dict):
- records = [res]
- else:
- records = res
- # build the res_ids and the old_values dict. Here we don't use get_data() to
- # avoid performing an additional read()
- res_ids = []
- for record in records:
- res_ids.append(record['id'])
- old_values[(model.id, record['id'])] = {'value': record, 'text': record}
- # log only the fields read
- field_list = args[1]
- elif method == 'unlink':
- res_ids = args[0]
- old_values = get_data(cr, uid_orig, pool, res_ids, model, method)
- # process_data first as fct_src will unlink the record
- self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
- return fct_src(cr, uid_orig, model.model, method, *args, **kw)
- else: # method is write, action or workflow action
- res_ids = []
- if args:
- res_ids = args[0]
- if isinstance(res_ids, (long, int)):
- res_ids = [res_ids]
- if res_ids:
- # store the old values into a dictionary
- old_values = get_data(cr, uid_orig, pool, res_ids, model, method)
- # process the original function, workflow trigger...
- res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
- if method == 'copy':
- res_ids = [res]
- if res_ids:
- # check the new values and store them into a dictionary
- new_values = get_data(cr, uid_orig, pool, res_ids, model, method)
- # compare the old and new values and create audittrail log if needed
- process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
- return res
-
-def get_data(cr, uid, pool, res_ids, model, method):
- """
- This function simply read all the fields of the given res_ids, and also recurisvely on
- all records of a x2m fields read that need to be logged. Then it returns the result in
- convenient structure that will be used as comparison basis.
-
- :param cr: the current row, from the database cursor,
- :param uid: the current user’s ID. This parameter is currently not used as every
- operation to get data is made as super admin. Though, it could be usefull later.
- :param pool: current db's pooler object.
- :param res_ids: Id's of resource to be logged/compared.
- :param model: Object whose values are being changed
- :param method: method to log: create, read, unlink, write, actions, workflow actions
- :return: dict mapping a tuple (model_id, resource_id) with its value and textual value
- { (model_id, resource_id): { 'value': ...
- 'textual_value': ...
- },
- }
- """
- data = {}
- resource_pool = pool[model.model]
- # read all the fields of the given resources in super admin mode
- for resource in resource_pool.read(cr, SUPERUSER_ID, res_ids, resource_pool._all_columns):
- values = {}
- values_text = {}
- resource_id = resource['id']
- # loop on each field on the res_ids we just have read
- for field in resource:
- if field in ('__last_update', 'id'):
- continue
- values[field] = resource[field]
- # get the textual value of that field for this record
- values_text[field] = get_value_text(cr, SUPERUSER_ID, pool, resource_pool, method, field, resource[field])
-
- field_obj = resource_pool._all_columns.get(field).column
- if field_obj._type in ('one2many','many2many'):
- # check if an audittrail rule apply in super admin mode
- if check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
- # check if the model associated to a *2m field exists, in super admin mode
- x2m_model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', field_obj._obj)])
- x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
- assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
- x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
- field_resource_ids = list(set(resource[field]))
- if model.model == x2m_model.model:
- # we need to remove current resource_id from the many2many to prevent an infinit loop
- if resource_id in field_resource_ids:
- field_resource_ids.remove(resource_id)
- data.update(get_data(cr, SUPERUSER_ID, pool, field_resource_ids, x2m_model, method))
-
- data[(model.id, resource_id)] = {'text':values_text, 'value': values}
- return data
-
-def prepare_audittrail_log_line(cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=None):
- """
- This function compares the old data (i.e before the method was executed) and the new data
- (after the method was executed) and returns a structure with all the needed information to
- log those differences.
-
- :param cr: the current row, from the database cursor,
- :param uid: the current user’s ID. This parameter is currently not used as every
- operation to get data is made as super admin. Though, it could be usefull later.
- :param pool: current db's pooler object.
- :param model: model object which values are being changed
- :param resource_id: ID of record to which values are being changed
- :param method: method to log: create, read, unlink, write, actions, workflow actions
- :param old_values: dict of values read before execution of the method
- :param new_values: dict of values read after execution of the method
- :param field_list: optional argument containing the list of fields to log. Currently only
- used when performing a read, it could be usefull later on if we want to log the write
- on specific fields only.
-
- :return: dictionary with
- * keys: tuples build as ID of model object to log and ID of resource to log
- * values: list of all the changes in field values for this couple (model, resource)
- return {
- (model.id, resource_id): []
- }
-
- The reason why the structure returned is build as above is because when modifying an existing
- record, we may have to log a change done in a x2many field of that object
- """
- if field_list is None:
- field_list = []
- key = (model.id, resource_id)
- lines = {
- key: []
- }
- # loop on all the fields
- for field_name, field_definition in pool[model.model]._all_columns.items():
- if field_name in ('__last_update', 'id'):
- continue
- #if the field_list param is given, skip all the fields not in that list
- if field_list and field_name not in field_list:
- continue
- field_obj = field_definition.column
- if field_obj._type in ('one2many','many2many'):
- # checking if an audittrail rule apply in super admin mode
- if check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
- # checking if the model associated to a *2m field exists, in super admin mode
- x2m_model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', field_obj._obj)])
- x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
- assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
- x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
- # the resource_ids that need to be checked are the sum of both old and previous values (because we
- # need to log also creation or deletion in those lists).
- x2m_old_values_ids = old_values.get(key, {'value': {}})['value'].get(field_name, [])
- x2m_new_values_ids = new_values.get(key, {'value': {}})['value'].get(field_name, [])
- # We use list(set(...)) to remove duplicates.
- res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids))
- if model.model == x2m_model.model:
- # we need to remove current resource_id from the many2many to prevent an infinit loop
- if resource_id in res_ids:
- res_ids.remove(resource_id)
- for res_id in res_ids:
- lines.update(prepare_audittrail_log_line(cr, SUPERUSER_ID, pool, x2m_model, res_id, method, old_values, new_values, field_list))
- # if the value value is different than the old value: record the change
- if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:
- data = {
- 'name': field_name,
- 'new_value': key in new_values and new_values[key]['value'].get(field_name),
- 'old_value': key in old_values and old_values[key]['value'].get(field_name),
- 'new_value_text': key in new_values and new_values[key]['text'].get(field_name),
- 'old_value_text': key in old_values and old_values[key]['text'].get(field_name)
- }
- lines[key].append(data)
- return lines
-
-def process_data(cr, uid, pool, res_ids, model, method, old_values=None, new_values=None, field_list=None):
- """
- This function processes and iterates recursively to log the difference between the old
- data (i.e before the method was executed) and the new data and creates audittrail log
- accordingly.
-
- :param cr: the current row, from the database cursor,
- :param uid: the current user’s ID,
- :param pool: current db's pooler object.
- :param res_ids: Id's of resource to be logged/compared.
- :param model: model object which values are being changed
- :param method: method to log: create, read, unlink, write, actions, workflow actions
- :param old_values: dict of values read before execution of the method
- :param new_values: dict of values read after execution of the method
- :param field_list: optional argument containing the list of fields to log. Currently only
- used when performing a read, it could be usefull later on if we want to log the write
- on specific fields only.
- :return: True
- """
- if field_list is None:
- field_list = []
- # loop on all the given ids
- for res_id in res_ids:
- # compare old and new values and get audittrail log lines accordingly
- lines = prepare_audittrail_log_line(cr, uid, pool, model, res_id, method, old_values, new_values, field_list)
-
- # if at least one modification has been found
- for model_id, resource_id in lines:
- line_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, model_id).model
-
- vals = {
- 'method': method,
- 'object_id': model_id,
- 'user_id': uid,
- 'res_id': resource_id,
- }
- if (model_id, resource_id) not in old_values and method not in ('copy', 'read'):
- # the resource was not existing so we are forcing the method to 'create'
- # (because it could also come with the value 'write' if we are creating
- # new record through a one2many field)
- vals.update({'method': 'create'})
- if (model_id, resource_id) not in new_values and method not in ('copy', 'read'):
- # the resource is not existing anymore so we are forcing the method to 'unlink'
- # (because it could also come with the value 'write' if we are deleting the
- # record through a one2many field)
- name = old_values[(model_id, resource_id)]['value'].get('name',False)
- vals.update({'method': 'unlink'})
- else :
- name = pool[line_model].name_get(cr, uid, [resource_id])[0][1]
- vals.update({'name': name})
- # create the audittrail log in super admin mode, only if a change has been detected
- if lines[(model_id, resource_id)]:
- log_id = pool.get('audittrail.log').create(cr, SUPERUSER_ID, vals)
- model = pool.get('ir.model').browse(cr, uid, model_id)
- create_log_line(cr, SUPERUSER_ID, log_id, model, lines[(model_id, resource_id)])
- return True
-
-def check_rules(cr, uid, model, method):
- """
- Checks if auditrails is installed for that db and then if one rule match
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID,
- @param model: value of _name of the object which values are being changed
- @param method: method to log: create, read, unlink,write,actions,workflow actions
- @return: True or False
- """
- pool = openerp.registry(cr.dbname)
- if 'audittrail.rule' in pool.models:
- model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', model)])
- model_id = model_ids and model_ids[0] or False
- if model_id:
- rule_ids = pool.get('audittrail.rule').search(cr, SUPERUSER_ID, [('object_id', '=', model_id), ('state', '=', 'subscribed')])
- for rule in pool.get('audittrail.rule').read(cr, SUPERUSER_ID, rule_ids, ['user_id','log_read','log_write','log_create','log_unlink','log_action','log_workflow']):
- if len(rule['user_id']) == 0 or uid in rule['user_id']:
- if rule.get('log_'+method,0):
- return True
- elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create', 'read_group', 'import_data'):
- if rule['log_action']:
- return True
-
-# Replace the openerp.service.model functions.
-
-original_execute_cr = openerp.service.model.execute_cr
-original_exec_workflow_cr = openerp.service.model.exec_workflow_cr
-
-def execute_cr(cr, uid, model, method, *args, **kw):
- fct_src = original_execute_cr
- if check_rules(cr,uid,model,method):
- return log_fct(cr, uid, model, method, fct_src, *args, **kw)
- return fct_src(cr, uid, model, method, *args, **kw)
-
-def exec_workflow_cr(cr, uid, model, method, *args, **kw):
- fct_src = original_exec_workflow_cr
- if check_rules(cr,uid,model,'workflow'):
- return log_fct(cr, uid, model, method, fct_src, *args, **kw)
- return fct_src(cr, uid, model, method, *args, **kw)
-
-openerp.service.model.execute_cr = execute_cr
-openerp.service.model.exec_workflow_cr = exec_workflow_cr
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/audittrail/audittrail_demo.xml b/addons/audittrail/audittrail_demo.xml
deleted file mode 100644
index fbf925fb239..00000000000
--- a/addons/audittrail/audittrail_demo.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Audit on Partners
-
-
-
-
-
diff --git a/addons/audittrail/audittrail_view.xml b/addons/audittrail/audittrail_view.xml
deleted file mode 100644
index 5ea15ab557b..00000000000
--- a/addons/audittrail/audittrail_view.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-
-
-
-
-
-
-
-
-
- audittrail.rule.form
- audittrail.rule
-
-
-
-
-
-
- audittrail.rule.tree
- audittrail.rule
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- audittrail.rule.search
- audittrail.rule
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Audit Rules
- audittrail.rule
- ir.actions.act_window
- form
- tree,form
- {'search_default_draft': 1}
-
-
-
-
-
-
-
-
- audittrail.log.form
- audittrail.log
-
-
-
-
-
-
- audittrail.log.tree
- audittrail.log
-
-
-
-
-
-
-
-
-
-
-
-
- audittrail.log.search
- audittrail.log
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Audit Logs
- audittrail.log
- form
-
-
-
-
-
-
-
diff --git a/addons/audittrail/security/ir.model.access.csv b/addons/audittrail/security/ir.model.access.csv
deleted file mode 100644
index 1d2198fd661..00000000000
--- a/addons/audittrail/security/ir.model.access.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_audittrail_rule_all_users,audittrail rule all,model_audittrail_rule,base.group_system,1,1,1,0
-access_audittrail_rule_all_access,audittrail rule all,model_audittrail_rule,base.group_erp_manager,1,1,1,0
-access_audittrail_log_all_users,audittrail log all,model_audittrail_log,base.group_user,1,0,1,0
-access_audittrail_log_line_all_users,audittrail log line all,model_audittrail_log_line,base.group_user,1,0,1,0
diff --git a/addons/audittrail/wizard/audittrail_view_log.py b/addons/audittrail/wizard/audittrail_view_log.py
deleted file mode 100644
index 4385970f8d9..00000000000
--- a/addons/audittrail/wizard/audittrail_view_log.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# -*- 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 .
-#
-##############################################################################
-
-from openerp.osv import fields, osv
-import time
-
-class audittrail_view_log(osv.osv_memory):
-
- _name = "audittrail.view.log"
- _description = "View Log"
- _columns = {
- 'from':fields.datetime('Log From'),
- 'to':fields.datetime('Log To', required = True)
- }
- _defaults = {
- 'to': lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
- }
-
- def log_open_window(self, cr, uid, ids, context=None):
- """
- Open Log form from given date range..
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of audittrail view log’s IDs.
- @return: Dictionary of audittrail log form on given date range.
- """
-
- mod_obj = self.pool.get('ir.model.data')
- act_obj = self.pool.get('ir.actions.act_window')
- result = mod_obj._get_id(cr, uid, 'audittrail', 'action_audittrail_log_tree')
- id = mod_obj.read(cr, uid, [result], ['res_id'], context=context)[0]['res_id']
- result = act_obj.read(cr, uid, [id], context=context)[0]
-
- #start Loop
- for datas in self.read(cr, uid, ids, context=context):
- if not datas.get('from', None):
- if datas.get('to') <> time.strftime("%Y-%m-%d %H:%M:%S"):
- result['domain'] = str([('timestamp', '<', datas.get('to'))])
- else:
- pass
- else:
- result['domain'] = str([('timestamp', '>', datas.get('from', None)), ('timestamp', '<', datas.get('to'))])
- #End Loop
- return result
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/audittrail/wizard/audittrail_view_log_view.xml b/addons/audittrail/wizard/audittrail_view_log_view.xml
deleted file mode 100644
index 414527bdbb0..00000000000
--- a/addons/audittrail/wizard/audittrail_view_log_view.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
- audittrail.view.log.form
- audittrail.view.log
-
-
\n"
+" Click to add a new contribution register.\n"
+"
\n"
+" A contribution register is a third party involved in the "
+"salary\n"
+" payment of the employees. It can be the social security, "
+"the\n"
+" estate or anyone that collect or inject money on payslips.\n"
+"
\n"
+" "
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.line,condition_range_max:0
+#: help:hr.salary.rule,condition_range_max:0
+msgid "The maximum amount, applied for this rule."
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.line,condition_python:0
+#: help:hr.salary.rule,condition_python:0
+msgid ""
+"Applied this rule for calculation if condition is true. You can specify "
+"condition like basic > 1000."
+msgstr ""
+
+#. module: hr_payroll
+#: report:contribution.register.lines:0
+#: report:paylip.details:0
+msgid "Register Name"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.employees:0
+msgid "Payslips by Employees"
+msgstr ""
+
+#. module: hr_payroll
+#: selection:hr.contract,schedule_pay:0
+msgid "Quarterly"
+msgstr ""
+
+#. module: hr_payroll
+#: selection:hr.payslip,state:0
+msgid "Waiting"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.salary.rule,quantity:0
+msgid ""
+"It is used in computation for percentage and fixed amount.For e.g. A rule "
+"for Meal Voucher having fixed amount of 1€ per worked day can have its "
+"quantity defined in expression like worked_days.WORK100.number_of_days."
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.salary.rule:0
+msgid "Search Salary Rule"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip,employee_id:0
+#: field:hr.payslip.line,employee_id:0
+#: model:ir.model,name:hr_payroll.model_hr_employee
+msgid "Employee"
+msgstr ""
+
+#. module: hr_payroll
+#: selection:hr.contract,schedule_pay:0
+msgid "Semi-annually"
+msgstr ""
+
+#. module: hr_payroll
+#: report:paylip.details:0
+#: report:payslip:0
+msgid "Email"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.run:0
+msgid "Search Payslip Batches"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,amount_percentage_base:0
+#: field:hr.salary.rule,amount_percentage_base:0
+msgid "Percentage based on"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:90
+#, python-format
+msgid "%s (copy)"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.config.settings,module_hr_payroll_account:0
+msgid "Create journal entries from payslips"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip,paid:0
+msgid "Made Payment Order ? "
+msgstr ""
+
+#. module: hr_payroll
+#: report:contribution.register.lines:0
+msgid "PaySlip Lines by Contribution Register"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+#: field:hr.payslip,line_ids:0
+#: view:hr.payslip.line:0
+#: model:ir.actions.act_window,name:hr_payroll.act_contribution_reg_payslip_lines
+msgid "Payslip Lines"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Miscellaneous"
+msgstr ""
+
+#. module: hr_payroll
+#: selection:hr.payslip,state:0
+msgid "Rejected"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payroll.structure:0
+#: field:hr.payroll.structure,rule_ids:0
+#: view:hr.salary.rule:0
+#: model:ir.actions.act_window,name:hr_payroll.action_salary_rule_form
+#: model:ir.ui.menu,name:hr_payroll.menu_action_hr_salary_rule_form
+msgid "Salary Rules"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:341
+#, python-format
+msgid "Refund: "
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.model,name:hr_payroll.model_payslip_lines_contribution_register
+msgid "PaySlip Lines by Contribution Registers"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+#: selection:hr.payslip,state:0
+#: view:hr.payslip.run:0
+msgid "Done"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,appears_on_payslip:0
+#: field:hr.salary.rule,appears_on_payslip:0
+msgid "Appears on Payslip"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,amount_fix:0
+#: selection:hr.payslip.line,amount_select:0
+#: field:hr.salary.rule,amount_fix:0
+#: selection:hr.salary.rule,amount_select:0
+msgid "Fixed Amount"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:370
+#, python-format
+msgid "Warning!"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.line,active:0
+#: help:hr.salary.rule,active:0
+msgid ""
+"If the active field is set to false, it will allow you to hide the salary "
+"rule without removing it."
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip,state:0
+#: field:hr.payslip.run,state:0
+msgid "Status"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Worked Days & Inputs"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip,details_by_salary_rule_category:0
+msgid "Details by Salary Rule Category"
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.actions.act_window,name:hr_payroll.action_payslip_lines_contribution_register
+msgid "PaySlip Lines"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.line,register_id:0
+#: help:hr.salary.rule,register_id:0
+msgid "Eventual third party involved in the salary payment of the employees."
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.worked_days,number_of_hours:0
+msgid "Number of Hours"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "PaySlip Batch"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,condition_range_min:0
+#: field:hr.salary.rule,condition_range_min:0
+msgid "Minimum Range"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,child_ids:0
+#: field:hr.salary.rule,child_ids:0
+msgid "Child Salary Rule"
+msgstr ""
+
+#. module: hr_payroll
+#: report:contribution.register.lines:0
+#: field:hr.payslip,date_to:0
+#: field:hr.payslip.run,date_end:0
+#: report:paylip.details:0
+#: report:payslip:0
+#: field:payslip.lines.contribution.register,date_to:0
+msgid "Date To"
+msgstr ""
+
+#. module: hr_payroll
+#: selection:hr.payslip.line,condition_select:0
+#: selection:hr.salary.rule,condition_select:0
+msgid "Range"
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.actions.act_window,name:hr_payroll.action_view_hr_payroll_structure_tree
+#: model:ir.ui.menu,name:hr_payroll.menu_hr_payroll_structure_tree
+msgid "Salary Structures Hierarchy"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.employee,total_wage:0
+msgid "Sum of all current contract's wage of employee."
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Payslip"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip,credit_note:0
+#: field:hr.payslip.run,credit_note:0
+msgid "Credit Note"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+#: model:ir.actions.act_window,name:hr_payroll.act_payslip_lines
+msgid "Payslip Computation Details"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.line,appears_on_payslip:0
+#: help:hr.salary.rule,appears_on_payslip:0
+msgid "Used to display the salary rule on payslip."
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.model,name:hr_payroll.model_hr_payslip_input
+msgid "Payslip Input"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.salary.rule.category:0
+#: model:ir.actions.act_window,name:hr_payroll.action_hr_salary_rule_category
+#: model:ir.ui.menu,name:hr_payroll.menu_hr_salary_rule_category
+msgid "Salary Rule Categories"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.input,contract_id:0
+#: help:hr.payslip.worked_days,contract_id:0
+msgid "The contract for which applied this input"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.salary.rule:0
+msgid "Computation"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:899
+#, python-format
+msgid "Wrong range condition defined for salary rule %s (%s)."
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.input,amount:0
+msgid ""
+"It is used in computation. For e.g. A rule for sales having 1% commission of "
+"basic salary for per product can defined in expression like result = "
+"inputs.SALEURO.amount * contract.wage*0.01."
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.line:0
+#: field:hr.payslip.line,amount_select:0
+#: field:hr.salary.rule,amount_select:0
+msgid "Amount Type"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,category_id:0
+#: view:hr.salary.rule:0
+#: field:hr.salary.rule,category_id:0
+msgid "Category"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.salary.rule:0
+msgid "Company Contribution"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.run,credit_note:0
+msgid ""
+"If its checked, indicates that all payslips generated from here are refund "
+"payslips."
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:876
+#, python-format
+msgid "Wrong percentage base or quantity defined for salary rule %s (%s)."
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.actions.act_window,name:hr_payroll.action_view_hr_payroll_structure_list_form
+#: model:ir.ui.menu,name:hr_payroll.menu_hr_payroll_structure_view
+msgid "Salary Structures"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.run:0
+msgid "Draft Payslip Batches"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+#: selection:hr.payslip,state:0
+#: view:hr.payslip.run:0
+#: selection:hr.payslip.run,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: hr_payroll
+#: report:contribution.register.lines:0
+#: field:hr.payslip,date_from:0
+#: field:hr.payslip.run,date_start:0
+#: report:paylip.details:0
+#: report:payslip:0
+#: field:payslip.lines.contribution.register,date_from:0
+msgid "Date From"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.run:0
+msgid "Done Payslip Batches"
+msgstr ""
+
+#. module: hr_payroll
+#: report:paylip.details:0
+msgid "Payslip Lines by Contribution Register:"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.salary.rule:0
+msgid "Conditions"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,amount_percentage:0
+#: selection:hr.payslip.line,amount_select:0
+#: field:hr.salary.rule,amount_percentage:0
+#: selection:hr.salary.rule,amount_select:0
+msgid "Percentage (%)"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:871
+#, python-format
+msgid "Wrong quantity defined for salary rule %s (%s)."
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Worked Day"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payroll.structure:0
+msgid "Employee Function"
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.actions.report.xml,name:hr_payroll.payslip_report
+msgid "Employee PaySlip"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,salary_rule_id:0
+msgid "Rule"
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.actions.report.xml,name:hr_payroll.payslip_details_report
+msgid "PaySlip Details"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Compute Sheet"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,active:0
+#: field:hr.salary.rule,active:0
+msgid "Active"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.salary.rule:0
+msgid "Child Rules"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.line,condition_range_min:0
+#: help:hr.salary.rule,condition_range_min:0
+msgid "The minimum amount, applied for this rule."
+msgstr ""
+
+#. module: hr_payroll
+#: selection:hr.payslip.line,condition_select:0
+#: selection:hr.salary.rule,condition_select:0
+msgid "Python Expression"
+msgstr ""
+
+#. module: hr_payroll
+#: report:paylip.details:0
+#: report:payslip:0
+msgid "Designation"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Companies"
+msgstr ""
+
+#. module: hr_payroll
+#: report:paylip.details:0
+#: report:payslip:0
+msgid "Authorized Signature"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip,contract_id:0
+#: field:hr.payslip.input,contract_id:0
+#: field:hr.payslip.line,contract_id:0
+#: field:hr.payslip.worked_days,contract_id:0
+#: model:ir.model,name:hr_payroll.model_hr_contract
+msgid "Contract"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py:52
+#, python-format
+msgid "You must select employee(s) to generate payslip(s)."
+msgstr ""
+
+#. module: hr_payroll
+#: report:paylip.details:0
+#: report:payslip:0
+msgid "Credit"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.contract,schedule_pay:0
+msgid "Scheduled Pay"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,condition_python:0
+#: field:hr.salary.rule,condition_python:0
+msgid "Python Condition"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.contribution.register:0
+msgid "Contribution"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:351
+#, python-format
+msgid "Refund Payslip"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.rule.input,input_id:0
+#: model:ir.model,name:hr_payroll.model_hr_rule_input
+msgid "Salary Rule Input"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,quantity:0
+#: field:hr.salary.rule,quantity:0
+msgid "Quantity"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Refund"
+msgstr ""
+
+#. module: hr_payroll
+#: report:contribution.register.lines:0
+#: field:hr.payslip.input,code:0
+#: field:hr.payslip.line,code:0
+#: field:hr.payslip.worked_days,code:0
+#: field:hr.rule.input,code:0
+#: field:hr.salary.rule,code:0
+#: field:hr.salary.rule.category,code:0
+#: report:paylip.details:0
+#: report:payslip:0
+msgid "Code"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,amount_python_compute:0
+#: selection:hr.payslip.line,amount_select:0
+#: field:hr.salary.rule,amount_python_compute:0
+#: selection:hr.salary.rule,amount_select:0
+msgid "Python Code"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.input,sequence:0
+#: field:hr.payslip.line,sequence:0
+#: field:hr.payslip.worked_days,sequence:0
+#: field:hr.salary.rule,sequence:0
+msgid "Sequence"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Period"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.run:0
+msgid "Period from"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.salary.rule:0
+msgid "General"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:674
+#, python-format
+msgid "Salary Slip of %s for %s"
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.model,name:hr_payroll.model_hr_payslip_employees
+msgid "Generate payslips for all selected employees"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.contract,struct_id:0
+#: view:hr.payroll.structure:0
+#: view:hr.payslip:0
+#: view:hr.payslip.line:0
+#: model:ir.model,name:hr_payroll.model_hr_payroll_structure
+msgid "Salary Structure"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.contribution.register,register_line_ids:0
+msgid "Register Line"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Cancel"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.run:0
+#: selection:hr.payslip.run,state:0
+msgid "Close"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip,struct_id:0
+msgid ""
+"Defines the rules that have to be applied to this payslip, accordingly to "
+"the contract chosen. If you let empty the field contract, this field isn't "
+"mandatory anymore and thus the rules applied will be all the rules set on "
+"the structure of all contracts of the employee valid for the chosen period"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payroll.structure,children_ids:0
+#: field:hr.salary.rule.category,children_ids:0
+msgid "Children"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip,credit_note:0
+msgid "Indicates this payslip has a refund of another"
+msgstr ""
+
+#. module: hr_payroll
+#: selection:hr.contract,schedule_pay:0
+msgid "Bi-monthly"
+msgstr ""
+
+#. module: hr_payroll
+#: report:paylip.details:0
+msgid "Pay Slip Details"
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.actions.act_window,name:hr_payroll.action_view_hr_payslip_form
+#: model:ir.ui.menu,name:hr_payroll.menu_department_tree
+msgid "Employee Payslips"
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.model,name:hr_payroll.model_hr_config_settings
+msgid "hr.config.settings"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.line:0
+#: field:hr.payslip.line,register_id:0
+#: field:hr.salary.rule,register_id:0
+#: model:ir.model,name:hr_payroll.model_hr_contribution_register
+msgid "Contribution Register"
+msgstr ""
+
+#. module: hr_payroll
+#: view:payslip.lines.contribution.register:0
+msgid "Print"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.line:0
+msgid "Calculations"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Worked Days"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Search Payslips"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.run:0
+#: model:ir.actions.act_window,name:hr_payroll.action_hr_payslip_run_tree
+#: model:ir.ui.menu,name:hr_payroll.menu_hr_payslip_run
+msgid "Payslips Batches"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.contribution.register:0
+#: field:hr.contribution.register,note:0
+#: field:hr.payroll.structure,note:0
+#: field:hr.payslip,name:0
+#: field:hr.payslip,note:0
+#: field:hr.payslip.input,name:0
+#: field:hr.payslip.line,note:0
+#: field:hr.payslip.worked_days,name:0
+#: field:hr.rule.input,name:0
+#: view:hr.salary.rule:0
+#: field:hr.salary.rule,note:0
+#: field:hr.salary.rule.category,note:0
+msgid "Description"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.employee,total_wage:0
+msgid "Total Basic Salary"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.contribution.register:0
+#: model:ir.actions.act_window,name:hr_payroll.action_contribution_register_form
+#: model:ir.ui.menu,name:hr_payroll.menu_action_hr_contribution_register_form
+msgid "Contribution Registers"
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.ui.menu,name:hr_payroll.menu_hr_payroll_reporting
+#: model:ir.ui.menu,name:hr_payroll.menu_hr_root_payroll
+#: model:ir.ui.menu,name:hr_payroll.payroll_configure
+msgid "Payroll"
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.actions.report.xml,name:hr_payroll.contribution_register
+msgid "PaySlip Lines By Conribution Register"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:370
+#, python-format
+msgid "You cannot delete a payslip which is not draft or cancelled!"
+msgstr ""
+
+#. module: hr_payroll
+#: report:paylip.details:0
+#: report:payslip:0
+msgid "Address"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip,worked_days_line_ids:0
+#: model:ir.model,name:hr_payroll.model_hr_payslip_worked_days
+msgid "Payslip Worked Days"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.salary.rule.category:0
+msgid "Salary Categories"
+msgstr ""
+
+#. module: hr_payroll
+#: report:contribution.register.lines:0
+#: field:hr.contribution.register,name:0
+#: field:hr.payroll.structure,name:0
+#: field:hr.payslip.line,name:0
+#: field:hr.payslip.run,name:0
+#: field:hr.salary.rule,name:0
+#: field:hr.salary.rule.category,name:0
+#: report:paylip.details:0
+#: report:payslip:0
+msgid "Name"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.line,amount_percentage:0
+#: help:hr.salary.rule,amount_percentage:0
+msgid "For example, enter 50.0 to apply a percentage of 50%"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payroll.structure:0
+msgid "Payroll Structures"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+#: view:hr.payslip.employees:0
+#: field:hr.payslip.employees,employee_ids:0
+#: view:hr.payslip.line:0
+msgid "Employees"
+msgstr ""
+
+#. module: hr_payroll
+#: report:paylip.details:0
+#: report:payslip:0
+msgid "Bank Account"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.line,sequence:0
+#: help:hr.salary.rule,sequence:0
+msgid "Use to arrange calculation sequence"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip,state:0
+msgid ""
+"* When the payslip is created the status is 'Draft'. \n"
+"* If the payslip is under verification, the status is 'Waiting'. "
+"\n"
+"* If the payslip is confirmed then status is set to 'Done'. \n"
+"* When user cancel payslip the status is 'Rejected'."
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.line,condition_range:0
+#: help:hr.salary.rule,condition_range:0
+msgid ""
+"This will be used to compute the % fields values; in general it is on basic, "
+"but you can also use categories code fields in lowercase as a variable names "
+"(hra, ma, lta, etc.) and the variable basic."
+msgstr ""
+
+#. module: hr_payroll
+#: selection:hr.contract,schedule_pay:0
+msgid "Annually"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip,input_line_ids:0
+msgid "Payslip Inputs"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Other Inputs"
+msgstr ""
+
+#. module: hr_payroll
+#: model:ir.actions.act_window,name:hr_payroll.action_hr_salary_rule_category_tree_view
+#: model:ir.ui.menu,name:hr_payroll.menu_hr_salary_rule_category_tree_view
+msgid "Salary Rule Categories Hierarchy"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:882
+#, python-format
+msgid "Wrong python code defined for salary rule %s (%s)."
+msgstr ""
+
+#. module: hr_payroll
+#: report:contribution.register.lines:0
+#: field:hr.payslip.line,total:0
+#: report:paylip.details:0
+#: report:payslip:0
+msgid "Total"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Salary Computation"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Details By Salary Rule Category"
+msgstr ""
+
+#. module: hr_payroll
+#: help:hr.payslip.input,code:0
+#: help:hr.payslip.worked_days,code:0
+#: help:hr.rule.input,code:0
+msgid "The code that can be used in the salary rules"
+msgstr ""
+
+#. module: hr_payroll
+#: code:addons/hr_payroll/hr_payroll.py:905
+#, python-format
+msgid "Wrong python condition defined for salary rule %s (%s)."
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.run:0
+#: model:ir.actions.act_window,name:hr_payroll.action_hr_payslip_by_employees
+msgid "Generate Payslips"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip.line:0
+msgid "Search Payslip Lines"
+msgstr ""
+
+#. module: hr_payroll
+#: selection:hr.contract,schedule_pay:0
+msgid "Bi-weekly"
+msgstr ""
+
+#. module: hr_payroll
+#: selection:hr.payslip.line,condition_select:0
+#: selection:hr.salary.rule,condition_select:0
+msgid "Always True"
+msgstr ""
+
+#. module: hr_payroll
+#: report:contribution.register.lines:0
+msgid "PaySlip Name"
+msgstr ""
+
+#. module: hr_payroll
+#: view:hr.payslip:0
+msgid "Accounting"
+msgstr ""
+
+#. module: hr_payroll
+#: field:hr.payslip.line,condition_range:0
+#: field:hr.salary.rule,condition_range:0
+msgid "Range Based on"
+msgstr ""
diff --git a/addons/hw_proxy/controllers/main.py b/addons/hw_proxy/controllers/main.py
index ea9b45c1b35..c65c7966b7c 100644
--- a/addons/hw_proxy/controllers/main.py
+++ b/addons/hw_proxy/controllers/main.py
@@ -24,9 +24,6 @@ from openerp.addons.web.controllers.main import manifest_list, module_boot, html
drivers = {}
class Proxy(http.Controller):
- def __init__(self):
- self.scale = 'closed'
- self.scale_weight = 0.0
def get_status(self):
statuses = {}
@@ -154,40 +151,6 @@ class Proxy(http.Controller):
"""
print "help_canceled"
- @http.route('/hw_proxy/weighting_start', type='json', auth='none', cors='*')
- def weighting_start(self):
- if self.scale == 'closed':
- print "Opening (Fake) Connection to Scale..."
- self.scale = 'open'
- self.scale_weight = 0.0
- time.sleep(0.1)
- print "... Scale Open."
- else:
- print "WARNING: Scale already Connected !!!"
-
- @http.route('/hw_proxy/weighting_read_kg', type='json', auth='none', cors='*')
- def weighting_read_kg(self):
- if self.scale == 'open':
- print "Reading Scale..."
- time.sleep(0.025)
- self.scale_weight += 0.01
- print "... Done."
- return self.scale_weight
- else:
- print "WARNING: Reading closed scale !!!"
- return 0.0
-
- @http.route('/hw_proxy/weighting_end', type='json', auth='none', cors='*')
- def weighting_end(self):
- if self.scale == 'open':
- print "Closing Connection to Scale ..."
- self.scale = 'closed'
- self.scale_weight = 0.0
- time.sleep(0.1)
- print "... Scale Closed."
- else:
- print "WARNING: Scale already Closed !!!"
-
@http.route('/hw_proxy/payment_request', type='json', auth='none', cors='*')
def payment_request(self, price):
"""
diff --git a/addons/audittrail/wizard/__init__.py b/addons/hw_scale/__init__.py
similarity index 97%
rename from addons/audittrail/wizard/__init__.py
rename to addons/hw_scale/__init__.py
index 9b2af466a01..a208bc1c551 100644
--- a/addons/audittrail/wizard/__init__.py
+++ b/addons/hw_scale/__init__.py
@@ -19,6 +19,7 @@
#
##############################################################################
-import audittrail_view_log
+import controllers
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/portal_project_long_term/__openerp__.py b/addons/hw_scale/__openerp__.py
similarity index 66%
rename from addons/portal_project_long_term/__openerp__.py
rename to addons/hw_scale/__openerp__.py
index 44156afbc06..c986d88e44c 100644
--- a/addons/portal_project_long_term/__openerp__.py
+++ b/addons/hw_scale/__openerp__.py
@@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2010-Today OpenERP S.A. ().
+# 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
@@ -21,22 +21,25 @@
{
- 'name': 'Portal Project Long Term',
+ 'name': 'Weighting Scale Hardware Driver',
'version': '1.0',
- 'category': 'Tools',
- 'complexity': 'easy',
+ 'category': 'Hardware Drivers',
+ 'sequence': 6,
+ 'summary': 'Hardware Driver for Weighting Scales',
'description': """
-This module adds necessary security rules and access rights for project long term and portal.
-=============================================================================================
- """,
+Barcode Scanner Hardware Driver
+================================
+
+This module allows the point of sale to connect to a scale using a USB HSM Serial Scale Interface,
+such as the Mettler Toledo Ariva.
+
+""",
'author': 'OpenERP SA',
- 'depends': ['project_long_term', 'portal'],
- 'data': [
- 'security/portal_security.xml',
- 'security/ir.model.access.csv',
+ 'depends': ['hw_proxy'],
+ 'test': [
],
'installable': True,
- 'auto_install': True,
- 'category': 'Hidden',
+ 'auto_install': False,
}
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hw_scale/controllers/__init__.py b/addons/hw_scale/controllers/__init__.py
new file mode 100644
index 00000000000..b5f0bcc9ec6
--- /dev/null
+++ b/addons/hw_scale/controllers/__init__.py
@@ -0,0 +1,3 @@
+import main
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/hw_scale/controllers/main.py b/addons/hw_scale/controllers/main.py
new file mode 100644
index 00000000000..161a7896b38
--- /dev/null
+++ b/addons/hw_scale/controllers/main.py
@@ -0,0 +1,205 @@
+# -*- coding: utf-8 -*-
+import logging
+import os
+import time
+from os import listdir
+from os.path import join
+from threading import Thread, Lock
+from select import select
+from Queue import Queue, Empty
+
+import openerp
+import openerp.addons.hw_proxy.controllers.main as hw_proxy
+from openerp import http
+from openerp.http import request
+from openerp.tools.translate import _
+
+_logger = logging.getLogger(__name__)
+
+try:
+ import serial
+except ImportError:
+ _logger.error('OpenERP module hw_scale depends on the pyserial python module')
+ serial = None
+
+
+class Scale(Thread):
+ def __init__(self):
+ Thread.__init__(self)
+ self.lock = Lock()
+ self.scalelock = Lock()
+ self.status = {'status':'connecting', 'messages':[]}
+ self.input_dir = '/dev/serial/by-id/'
+ self.weight = 0
+ self.weight_info = 'ok'
+ self.device = None
+
+ def lockedstart(self):
+ with self.lock:
+ if not self.isAlive():
+ self.daemon = True
+ self.start()
+
+ def set_status(self, status, message = None):
+ if status == self.status['status']:
+ if message != None and message != self.status['messages'][-1]:
+ self.status['messages'].append(message)
+ else:
+ self.status['status'] = status
+ if message:
+ self.status['messages'] = [message]
+ else:
+ self.status['messages'] = []
+
+ if status == 'error' and message:
+ _logger.error('Scale Error: '+message)
+ elif status == 'disconnected' and message:
+ _logger.warning('Disconnected Scale: '+message)
+
+ def get_device(self):
+ try:
+ devices = [ device for device in listdir(self.input_dir)]
+ scales = [ device for device in devices if ('mettler' in device.lower()) or ('toledo' in device.lower()) ]
+ if len(scales) > 0:
+ print join(self.input_dir,scales[0])
+ self.set_status('connected','Connected to '+scales[0])
+ return serial.Serial(join(self.input_dir,scales[0]),
+ baudrate = 9600,
+ bytesize = serial.SEVENBITS,
+ stopbits = serial.STOPBITS_ONE,
+ parity = serial.PARITY_EVEN,
+ #xonxoff = serial.XON,
+ timeout = 0.01,
+ writeTimeout= 0.01)
+ else:
+ self.set_status('disconnected','Scale Not Found')
+ return None
+ except Exception as e:
+ self.set_status('error',str(e))
+ return None
+
+ def get_weight(self):
+ self.lockedstart()
+ return self.weight
+
+ def get_weight_info(self):
+ self.lockedstart()
+ return self.weight_info
+
+ def get_status(self):
+ self.lockedstart()
+ return self.status
+
+ def read_weight(self):
+ with self.scalelock:
+ if self.device:
+ try:
+ self.device.write('W')
+ time.sleep(0.1)
+ answer = []
+
+ while True:
+ char = self.device.read(1)
+ if not char:
+ break
+ else:
+ answer.append(char)
+
+ if '?' in answer:
+ stat = ord(answer[answer.index('?')+1])
+ if stat == 0:
+ self.weight_info = 'ok'
+ else:
+ self.weight_info = []
+ if stat & 1 :
+ self.weight_info.append('moving')
+ if stat & 1 << 1:
+ self.weight_info.append('over_capacity')
+ if stat & 1 << 2:
+ self.weight_info.append('negative')
+ self.weight = 0.0
+ if stat & 1 << 3:
+ self.weight_info.append('outside_zero_capture_range')
+ if stat & 1 << 4:
+ self.weight_info.append('center_of_zero')
+ if stat & 1 << 5:
+ self.weight_info.append('net_weight')
+ else:
+ answer = answer[1:-1]
+ if 'N' in answer:
+ answer = answer[0:-1]
+ try:
+ self.weight = float(''.join(answer))
+ except ValueError as v:
+ self.set_status('error','No data Received, please power-cycle the scale');
+ self.device = None
+
+ except Exception as e:
+ self.set_status('error',str(e))
+ self.device = None
+
+ def set_zero(self):
+ with self.scalelock:
+ if self.device:
+ try:
+ self.device.write('Z')
+ except Exception as e:
+ self.set_status('error',str(e))
+ self.device = None
+
+ def set_tare(self):
+ with self.scalelock:
+ if self.device:
+ try:
+ self.device.write('T')
+ except Exception as e:
+ self.set_status('error',str(e))
+ self.device = None
+
+ def clear_tare(self):
+ with self.scalelock:
+ if self.device:
+ try:
+ self.device.write('C')
+ except Exception as e:
+ self.set_status('error',str(e))
+ self.device = None
+
+ def run(self):
+ self.device = None
+
+ while True:
+ if self.device:
+ self.read_weight()
+ time.sleep(0.05)
+ else:
+ with self.scalelock:
+ self.device = self.get_device()
+ if not self.device:
+ time.sleep(5)
+
+s = Scale()
+
+hw_proxy.drivers['scale'] = s
+
+class ScaleDriver(hw_proxy.Proxy):
+ @http.route('/hw_proxy/scale_read/', type='json', auth='none', cors='*')
+ def scale_read(self):
+ return {'weight':s.get_weight(), 'unit':'kg', 'info':s.get_weight_info()}
+
+ @http.route('/hw_proxy/scale_zero/', type='json', auth='none', cors='*')
+ def scale_zero(self):
+ s.set_zero()
+ return True
+
+ @http.route('/hw_proxy/scale_tare/', type='json', auth='none', cors='*')
+ def scale_tare(self):
+ s.set_tare()
+ return True
+
+ @http.route('/hw_proxy/scale_clear_tare/', type='json', auth='none', cors='*')
+ def scale_clear_tare(self):
+ s.clear_tare()
+ return True
+
+
diff --git a/addons/mail/data/mail_demo.xml b/addons/mail/data/mail_demo.xml
index 09415ba89e0..d9f8ea33d28 100644
--- a/addons/mail/data/mail_demo.xml
+++ b/addons/mail/data/mail_demo.xml
@@ -259,7 +259,7 @@
Feedback about our On Site Assistance
- Hi Virginie,
I writing to you about our On Site Assistance Service that we delivered to Agrolait last week. Do you have any feedback or remark about our service? I noticed you requested new IP phones. Will it be used for new employees, or did you have any issue with the ones we provided? Best regards,
]]>
+ Hi Virginie,
I wrote to you about our On Site Assistance Service that we delivered to Agrolait last week. Do you have any feedback or remark about our service? I noticed you requested new IP phones. Will it be used for new employees, or did you have any issue with the ones we provided? Best regards,
diff --git a/addons/portal_project_long_term/__init__.py b/addons/portal_project_long_term/__init__.py
deleted file mode 100644
index c8d82ed19bd..00000000000
--- a/addons/portal_project_long_term/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2010-Today 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 .
-#
-##############################################################################
diff --git a/addons/portal_project_long_term/security/ir.model.access.csv b/addons/portal_project_long_term/security/ir.model.access.csv
deleted file mode 100644
index 0cc108be689..00000000000
--- a/addons/portal_project_long_term/security/ir.model.access.csv
+++ /dev/null
@@ -1,3 +0,0 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_issues,project_phase,project_long_term.model_project_phase,base.group_portal,1,0,0,0
-access_issues_public,project_phase_public,project_long_term.model_project_phase,base.group_public,1,0,0,0
diff --git a/addons/portal_project_long_term/security/portal_security.xml b/addons/portal_project_long_term/security/portal_security.xml
deleted file mode 100644
index 642855c2386..00000000000
--- a/addons/portal_project_long_term/security/portal_security.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- Project/Phase: portal users: public or (portal and colleagues following) or (followers and following)
-
- [('project_id.privacy_visibility', 'in', ['public', 'portal'])]
-
-
-
-
- Project/Phase: public users: public only
-
- [('project_id.privacy_visibility', '=', 'public')]
-
-
-
-
-
diff --git a/addons/project_gtd/__init__.py b/addons/project_gtd/__init__.py
deleted file mode 100644
index cb17064b6b8..00000000000
--- a/addons/project_gtd/__init__.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- 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 project_gtd
-import wizard
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_gtd/__openerp__.py b/addons/project_gtd/__openerp__.py
deleted file mode 100644
index ee14df38101..00000000000
--- a/addons/project_gtd/__openerp__.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# -*- 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': 'Todo Lists',
- 'version': '1.0',
- 'category': 'Project Management',
- 'sequence': 100,
- 'summary': 'Personal Tasks, Contexts, Timeboxes',
- 'description': """
-Implement concepts of the "Getting Things Done" methodology
-===========================================================
-
-This module implements a simple personal to-do list based on tasks. It adds an editable list of tasks simplified to the minimum required fields in the project application.
-
-The to-do list is based on the GTD methodology. This world-wide used methodology is used for personal time management improvement.
-
-Getting Things Done (commonly abbreviated as GTD) is an action management method created by David Allen, and described in a book of the same name.
-
-GTD rests on the principle that a person needs to move tasks out of the mind by recording them externally. That way, the mind is freed from the job of remembering everything that needs to be done, and can concentrate on actually performing those tasks.
- """,
- 'author': 'OpenERP SA',
- 'images': ['images/project_gtd.jpeg'],
- 'depends': ['project'],
- 'data': [
- 'project_gtd_data.xml',
- 'project_gtd_view.xml',
- 'security/ir.model.access.csv',
- 'wizard/project_gtd_empty_view.xml',
- 'wizard/project_gtd_fill_view.xml',
- ],
- 'demo': ['project_gtd_demo.xml'],
- 'test':['test/task_timebox.yml'],
- 'installable': True,
- 'auto_install': False,
-}
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_gtd/project_gtd.py b/addons/project_gtd/project_gtd.py
deleted file mode 100644
index 47569e863aa..00000000000
--- a/addons/project_gtd/project_gtd.py
+++ /dev/null
@@ -1,122 +0,0 @@
-# -*- 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 sys
-
-from openerp.osv import fields, osv
-from openerp import tools
-from openerp.tools.translate import _
-
-class project_gtd_context(osv.osv):
- _name = "project.gtd.context"
- _description = "Context"
- _columns = {
- 'name': fields.char('Context', size=64, required=True, select=1, translate=1),
- 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of contexts."),
- }
- _defaults = {
- 'sequence': 1
- }
- _order = "sequence, name"
-
-
-
-class project_gtd_timebox(osv.osv):
- _name = "project.gtd.timebox"
- _order = "sequence"
- _columns = {
- 'name': fields.char('Timebox', size=64, required=True, select=1, translate=1),
- 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of timebox."),
- 'icon': fields.selection(tools.icons, 'Icon', size=64),
- }
-
-
-class project_task(osv.osv):
- _inherit = "project.task"
- _columns = {
- 'timebox_id': fields.many2one('project.gtd.timebox', "Timebox",help="Time-laps during which task has to be treated"),
- 'context_id': fields.many2one('project.gtd.context', "Context",help="The context place where user has to treat task"),
- }
-
- def copy_data(self, cr, uid, id, default=None, context=None):
- if context is None:
- context = {}
- if not default:
- default = {}
- default['timebox_id'] = False
- default['context_id'] = False
- return super(project_task,self).copy_data(cr, uid, id, default, context)
-
- def _get_context(self, cr, uid, context=None):
- ids = self.pool.get('project.gtd.context').search(cr, uid, [], context=context)
- return ids and ids[0] or False
-
- _defaults = {
- 'context_id': _get_context
- }
- def next_timebox(self, cr, uid, ids, *args):
- timebox_obj = self.pool.get('project.gtd.timebox')
- timebox_ids = timebox_obj.search(cr,uid,[])
- if not timebox_ids: return True
- for task in self.browse(cr,uid,ids):
- timebox = task.timebox_id.id
- if not timebox:
- self.write(cr, uid, task.id, {'timebox_id': timebox_ids[0]})
- elif timebox_ids.index(timebox) != len(timebox_ids)-1:
- index = timebox_ids.index(timebox)
- self.write(cr, uid, task.id, {'timebox_id': timebox_ids[index+1]})
- return True
-
- def prev_timebox(self, cr, uid, ids, *args):
- timebox_obj = self.pool.get('project.gtd.timebox')
- timebox_ids = timebox_obj.search(cr,uid,[])
- for task in self.browse(cr,uid,ids):
- timebox = task.timebox_id.id
- if timebox:
- if timebox_ids.index(timebox):
- index = timebox_ids.index(timebox)
- self.write(cr, uid, task.id, {'timebox_id': timebox_ids[index - 1]})
- else:
- self.write(cr, uid, task.id, {'timebox_id': False})
- return True
-
- def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- if not context: context = {}
- res = super(project_task,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
- search_extended = False
- timebox_obj = self.pool.get('project.gtd.timebox')
- if (res['type'] == 'search') and context.get('gtd', False):
- tt = timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[]), context=context)
- search_extended =''
- for time in tt:
- if time.icon:
- icon = time.icon
- else :
- icon=""
- search_extended += '''\n'''
- search_extended +=''''''
-
- res['arch'] = tools.ustr(res['arch']).replace('', search_extended)
-
- return res
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_gtd/project_gtd_data.xml b/addons/project_gtd/project_gtd_data.xml
deleted file mode 100644
index 9d8c99f23ff..00000000000
--- a/addons/project_gtd/project_gtd_data.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
- Office
- 0
-
-
- Travel
- 2
-
-
-
- Today
- terp-go-today
-
-
- This Week
- terp-go-week
-
-
- Long Term
- terp-project
-
-
-
-
-
-
- mail.group
-
- notification
-
- Todo Lists application installed!
- Add todo items on project tasks, to help you organize your work.
-This application supports the Getting Things Done (GTD) methodology, based on David Allen's book.
-
-
-
-
- Contexts
- project.gtd.context
- Contexts are defined in the "Getting Things Done" methodology. It allows you to categorize your tasks according to the context in which they have to be done: at the office, at home, when I take my car, etc.
-
-
-
-
-
- project.gtd.timebox.tree
- project.gtd.timebox
-
-
-
-
-
-
-
-
-
-
- project.gtd.timebox.form
- project.gtd.timebox
-
-
-
-
-
-
-
-
-
-
-
-
- Timeboxes
- project.gtd.timebox
- form
- tree,form
-
- Timeboxes are defined in the "Getting Things Done" methodology. A timebox defines a period of time in order to categorize your tasks: today, this week, this month, long term.
-
-
-
-
-
- project.task.tree.timebox
- project.task
-
-
-
-
-
-
-
-
-
-
- project.task.form.timebox
- project.task
-
-
-
-
-
-
-
-
-
-
- project.task.gtd.search
- project.task
- 50
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- My Tasks
- project.task
-
- {'set_editable':True,'set_visible':True,'gtd':True,'user_invisible':True, "search_default_open": 1}
- [('user_id','=',uid)]
- form
- kanban,tree,form,calendar,gantt,graph
-
-
-
-
-
-
diff --git a/addons/project_gtd/security/ir.model.access.csv b/addons/project_gtd/security/ir.model.access.csv
deleted file mode 100644
index d85ac8a5d0c..00000000000
--- a/addons/project_gtd/security/ir.model.access.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_project_gtd_context_user,project.gtd.context project user,model_project_gtd_context,project.group_project_user,1,0,0,0
-access_project_gtd_timebox_user,project.gtd.timebox project user,model_project_gtd_timebox,project.group_project_user,1,0,0,0
-access_project_gtd_context_manager,project.gtd.context project manager,model_project_gtd_context,project.group_project_manager,1,1,1,1
-access_project_gtd_timebox_manager,project.gtd.timebox project manager,model_project_gtd_timebox,project.group_project_manager,1,1,1,1
diff --git a/addons/project_gtd/static/description/icon.png b/addons/project_gtd/static/description/icon.png
deleted file mode 100644
index 2f888a90a60..00000000000
Binary files a/addons/project_gtd/static/description/icon.png and /dev/null differ
diff --git a/addons/project_gtd/test/task_timebox.yml b/addons/project_gtd/test/task_timebox.yml
deleted file mode 100644
index 8efa7219b21..00000000000
--- a/addons/project_gtd/test/task_timebox.yml
+++ /dev/null
@@ -1,45 +0,0 @@
--
- In order to test the process of Timebox in Project Management module,
- I set my task from Daily to Weekly Timebox through Plannify Timebox
--
- !record {model: project.timebox.fill.plan, id: plan_id}:
- task_ids: [project.project_task_10]
- timebox_id: timebox_daily
- timebox_to_id: timebox_weekly
--
- I set the task from Daily Timebox to Weekly Timebox
--
- !python {model: project.timebox.fill.plan}: |
- self.process(cr, uid, [ref("plan_id")])
--
- I check task is set to Weekly Timebox
--
- !assert {model: project.task, id: project.project_task_10, string: Task should be set to weekly timebox}:
- - timebox_id.id == ref("timebox_weekly")
--
- I Empty the Weekly Timebox
--
- !python {model: project.timebox.empty}: |
- self._empty(cr, uid, {"active_model": "project.gtd.timebox",
- "active_ids":[ref("timebox_weekly")],
- "active_id": ref("timebox_weekly"),
- })
--
- I check task 'Develop Module in Sale Management' is no more in Weekly Timebox
--
- !assert {model: project.task, id: project.project_task_10 , string: Task is not in Weekly Timebox }:
- - timebox_id.id != ref("timebox_weekly")
--
- I set Previous Timebox on task
--
- !python {model: project.task}: |
- previous_timebox = self.prev_timebox(cr, uid, [ref("project.project_task_10")],
- {'active_ids': [ref("project_gtd.menu_open_gtd_timebox_tree")],})
- assert previous_timebox == True, "I set Previous Timebox on task"
--
- I set Next Timebox on task
--
- !python {model: project.task}: |
- next_timebox = self.next_timebox(cr, uid, [ref("project.project_task_10")],
- {'active_ids': [ref("project_gtd.menu_open_gtd_timebox_tree")],})
- assert next_timebox == True, "I set Next Timebox on task"
\ No newline at end of file
diff --git a/addons/project_gtd/wizard/__init__.py b/addons/project_gtd/wizard/__init__.py
deleted file mode 100644
index aa2bbc22c45..00000000000
--- a/addons/project_gtd/wizard/__init__.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- 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 project_gtd_empty
-import project_gtd_fill
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_gtd/wizard/project_gtd_empty.py b/addons/project_gtd/wizard/project_gtd_empty.py
deleted file mode 100644
index b477c12567a..00000000000
--- a/addons/project_gtd/wizard/project_gtd_empty.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# -*- 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 .
-#
-##############################################################################
-
-from openerp.osv import fields, osv
-from openerp.tools.translate import _
-
-class project_timebox_empty(osv.osv_memory):
-
- _name = 'project.timebox.empty'
- _description = 'Project Timebox Empty'
- _columns = {
- 'name': fields.char('Name', size=32)
- }
-
- def view_init(self, cr, uid, fields_list, context=None):
- if context is None:
- context = {}
- self._empty(cr, uid, context=context)
- pass
-
- def _empty(self, cr, uid, context=None):
- close = []
- up = []
- obj_tb = self.pool.get('project.gtd.timebox')
- obj_task = self.pool.get('project.task')
-
- if context is None:
- context = {}
- if not 'active_id' in context:
- return {}
-
- ids = obj_tb.search(cr, uid, [], context=context)
- if not len(ids):
- raise osv.except_osv(_('Error!'), _('No timebox child of this one!'))
- tids = obj_task.search(cr, uid, [('timebox_id', '=', context['active_id'])])
- for task in obj_task.browse(cr, uid, tids, context):
- if (task.stage_id and task.stage_id.fold) or (task.user_id.id <> uid):
- close.append(task.id)
- else:
- up.append(task.id)
- if up:
- obj_task.write(cr, uid, up, {'timebox_id':ids[0]})
- if close:
- obj_task.write(cr, uid, close, {'timebox_id':False})
- return {}
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_gtd/wizard/project_gtd_empty_view.xml b/addons/project_gtd/wizard/project_gtd_empty_view.xml
deleted file mode 100644
index 053c0013e73..00000000000
--- a/addons/project_gtd/wizard/project_gtd_empty_view.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
- Empty Timebox
- project.timebox.empty
-
-
-
-
-
-
-
-
- Empty Timebox
- ir.actions.act_window
- project.timebox.empty
- form
- form
-
- {'record_id' : active_id}
- new
-
-
-
-
- Empty Timebox
- client_action_multi
-
- action
- project.gtd.timebox
-
-
-
-
-
diff --git a/addons/project_gtd/wizard/project_gtd_fill.py b/addons/project_gtd/wizard/project_gtd_fill.py
deleted file mode 100644
index 121bd7efdac..00000000000
--- a/addons/project_gtd/wizard/project_gtd_fill.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# -*- 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 .
-#
-##############################################################################
-
-from openerp.osv import fields, osv
-
-class project_timebox_fill(osv.osv_memory):
-
- _name = 'project.timebox.fill.plan'
- _description = 'Project Timebox Fill'
- _columns = {
- 'timebox_id': fields.many2one('project.gtd.timebox', 'Get from Timebox', required=True),
- 'timebox_to_id': fields.many2one('project.gtd.timebox', 'Set to Timebox', required=True),
- 'task_ids': fields.many2many('project.task', 'project_task_rel', 'task_id', 'fill_id', 'Tasks selection')
- }
-
- def _get_from_tb(self, cr, uid, context=None):
- ids = self.pool.get('project.gtd.timebox').search(cr, uid, [], context=context)
- return ids and ids[0] or False
-
- def _get_to_tb(self, cr, uid, context=None):
- if context is None:
- context = {}
- if 'active_id' in context:
- return context['active_id']
- return False
-
- _defaults = {
- 'timebox_id': _get_from_tb,
- 'timebox_to_id': _get_to_tb,
- }
-
- def process(self, cr, uid, ids, context=None):
- if not ids:
- return {}
- data = self.read(cr, uid, ids, [], context=context)
- if not data[0]['task_ids']:
- return {}
- self.pool.get('project.task').write(cr, uid, data[0]['task_ids'], {'timebox_id':data[0]['timebox_to_id'][0]})
- return {'type': 'ir.actions.act_window_close'}
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_gtd/wizard/project_gtd_fill_view.xml b/addons/project_gtd/wizard/project_gtd_fill_view.xml
deleted file mode 100644
index 626dfb699b8..00000000000
--- a/addons/project_gtd/wizard/project_gtd_fill_view.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
- Plannify Timebox
- project.timebox.fill.plan
-
-
-
-
-
-
-
-
-
-
-
-
-
- Plannify Timebox
- ir.actions.act_window
- project.timebox.fill.plan
- form
- form
-
- {'record_id' : active_id}
- new
-
-
-
-
- Plannify Timebox
- client_action_multi
-
- action
- project.gtd.timebox
-
-
-
-
-
diff --git a/addons/project_long_term/__init__.py b/addons/project_long_term/__init__.py
deleted file mode 100644
index 6b9b2613f3f..00000000000
--- a/addons/project_long_term/__init__.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: 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 project_long_term
-import wizard
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_long_term/__openerp__.py b/addons/project_long_term/__openerp__.py
deleted file mode 100644
index 3a3307d2898..00000000000
--- a/addons/project_long_term/__openerp__.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: 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 .
-#
-##############################################################################
-
-{
- 'name': 'Long Term Projects',
- 'version': '1.1',
- 'author': 'OpenERP SA',
- 'website': 'http://www.openerp.com',
- 'category': 'Project Management',
- 'images': ['images/project_phase_form.jpeg','images/project_phases.jpeg', 'images/resources_allocation.jpeg'],
- 'depends': ['project'],
- 'description': """
-Long Term Project management module that tracks planning, scheduling, resources allocation.
-===========================================================================================
-
-Features:
----------
- * Manage Big project
- * Define various Phases of Project
- * Compute Phase Scheduling: Compute start date and end date of the phases
- which are in draft, open and pending state of the project given. If no
- project given then all the draft, open and pending state phases will be taken.
- * Compute Task Scheduling: This works same as the scheduler button on
- project.phase. It takes the project as argument and computes all the open,
- draft and pending tasks.
- * Schedule Tasks: All the tasks which are in draft, pending and open state
- are scheduled with taking the phase's start date.
- """,
- 'demo': ['project_long_term_demo.xml'],
- 'test': [
- 'test/phase_process.yml',
- 'test/task_process.yml',
- ],
- 'data': [
- 'security/ir.model.access.csv',
- 'project_long_term_view.xml',
- 'project_long_term_workflow.xml',
- 'wizard/project_compute_phases_view.xml',
- 'wizard/project_compute_tasks_view.xml',
- ],
- 'installable': True,
- 'auto_install': False,
-}
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py
deleted file mode 100644
index 29e94591094..00000000000
--- a/addons/project_long_term/project_long_term.py
+++ /dev/null
@@ -1,296 +0,0 @@
-# -*- coding: 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 datetime import datetime
-from openerp.tools.translate import _
-from openerp.osv import fields, osv
-from openerp.addons.resource.faces import task as Task
-
-class project_phase(osv.osv):
- _name = "project.phase"
- _description = "Project Phase"
-
- def _check_recursion(self, cr, uid, ids, context=None):
- if context is None:
- context = {}
-
- data_phase = self.browse(cr, uid, ids[0], context=context)
- prev_ids = data_phase.previous_phase_ids
- next_ids = data_phase.next_phase_ids
- # it should neither be in prev_ids nor in next_ids
- if (data_phase in prev_ids) or (data_phase in next_ids):
- return False
- ids = [id for id in prev_ids if id in next_ids]
- # both prev_ids and next_ids must be unique
- if ids:
- return False
- # unrelated project
- prev_ids = [rec.id for rec in prev_ids]
- next_ids = [rec.id for rec in next_ids]
- # iter prev_ids
- while prev_ids:
- cr.execute('SELECT distinct prv_phase_id FROM project_phase_rel WHERE next_phase_id IN %s', (tuple(prev_ids),))
- prv_phase_ids = filter(None, map(lambda x: x[0], cr.fetchall()))
- if data_phase.id in prv_phase_ids:
- return False
- ids = [id for id in prv_phase_ids if id in next_ids]
- if ids:
- return False
- prev_ids = prv_phase_ids
- # iter next_ids
- while next_ids:
- cr.execute('SELECT distinct next_phase_id FROM project_phase_rel WHERE prv_phase_id IN %s', (tuple(next_ids),))
- next_phase_ids = filter(None, map(lambda x: x[0], cr.fetchall()))
- if data_phase.id in next_phase_ids:
- return False
- ids = [id for id in next_phase_ids if id in prev_ids]
- if ids:
- return False
- next_ids = next_phase_ids
- return True
-
- def _check_dates(self, cr, uid, ids, context=None):
- for phase in self.read(cr, uid, ids, ['date_start', 'date_end'], context=context):
- if phase['date_start'] and phase['date_end'] and phase['date_start'] > phase['date_end']:
- return False
- return True
-
- def _compute_progress(self, cr, uid, ids, field_name, arg, context=None):
- res = {}
- if not ids:
- return res
- for phase in self.browse(cr, uid, ids, context=context):
- if phase.state=='done':
- res[phase.id] = 100.0
- continue
- elif phase.state=="cancelled":
- res[phase.id] = 0.0
- continue
- elif not phase.task_ids:
- res[phase.id] = 0.0
- continue
-
- tot = done = 0.0
- for task in phase.task_ids:
- tot += task.total_hours
- done += min(task.effective_hours, task.total_hours)
-
- if not tot:
- res[phase.id] = 0.0
- else:
- res[phase.id] = round(100.0 * done / tot, 2)
- return res
-
- _columns = {
- 'name': fields.char("Name", size=64, required=True),
- 'date_start': fields.datetime('Start Date', select=True, help="It's computed by the scheduler according the project date or the end date of the previous phase.", states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
- 'date_end': fields.datetime('End Date', help=" It's computed by the scheduler according to the start date and the duration.", states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
- 'constraint_date_start': fields.datetime('Minimum Start Date', help='force the phase to start after this date', states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
- 'constraint_date_end': fields.datetime('Deadline', help='force the phase to finish before this date', states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
- 'project_id': fields.many2one('project.project', 'Project', required=True, select=True),
- 'next_phase_ids': fields.many2many('project.phase', 'project_phase_rel', 'prv_phase_id', 'next_phase_id', 'Next Phases', states={'cancelled':[('readonly',True)]}),
- 'previous_phase_ids': fields.many2many('project.phase', 'project_phase_rel', 'next_phase_id', 'prv_phase_id', 'Previous Phases', states={'cancelled':[('readonly',True)]}),
- 'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of phases."),
- 'duration': fields.float('Duration', required=True, help="By default in days", states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
- 'product_uom': fields.many2one('product.uom', 'Duration Unit of Measure', required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for Duration", states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
- 'task_ids': fields.one2many('project.task', 'phase_id', "Project Tasks", states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
- 'user_force_ids': fields.many2many('res.users', string='Force Assigned Users'),
- 'user_ids': fields.one2many('project.user.allocation', 'phase_id', "Assigned Users",states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]},
- help="The resources on the project can be computed automatically by the scheduler."),
- 'state': fields.selection([('draft', 'New'), ('cancelled', 'Cancelled'),('open', 'In Progress'), ('pending', 'Pending'), ('done', 'Done')], 'Status', readonly=True, required=True,
- help='If the phase is created the status \'Draft\'.\n If the phase is started, the status becomes \'In Progress\'.\n If review is needed the phase is in \'Pending\' status.\
- \n If the phase is over, the status is set to \'Done\'.'),
- 'progress': fields.function(_compute_progress, string='Progress', help="Computed based on related tasks"),
- }
- _defaults = {
- 'state': 'draft',
- 'sequence': 10,
- }
- _order = "project_id, date_start, sequence"
- _constraints = [
- (_check_recursion,'Loops in phases not allowed',['next_phase_ids', 'previous_phase_ids']),
- (_check_dates, 'Phase start-date must be lower than phase end-date.', ['date_start', 'date_end']),
- ]
-
- def onchange_project(self, cr, uid, ids, project, context=None):
- return {}
-
- def copy(self, cr, uid, id, default=None, context=None):
- if default is None:
- default = {}
- if not default.get('name', False):
- default.update(name=_('%s (copy)') % (self.browse(cr, uid, id, context=context).name))
- return super(project_phase, self).copy(cr, uid, id, default, context)
-
- def set_draft(self, cr, uid, ids, *args):
- self.write(cr, uid, ids, {'state': 'draft'})
- return True
-
- def set_open(self, cr, uid, ids, *args):
- self.write(cr, uid, ids, {'state': 'open'})
- return True
-
- def set_pending(self, cr, uid, ids, *args):
- self.write(cr, uid, ids, {'state': 'pending'})
- return True
-
- def set_cancel(self, cr, uid, ids, *args):
- self.write(cr, uid, ids, {'state': 'cancelled'})
- return True
-
- def set_done(self, cr, uid, ids, *args):
- self.write(cr, uid, ids, {'state': 'done'})
- return True
-
- def generate_phase(self, cr, uid, phases, context=None):
- context = context or {}
- result = ""
-
- task_pool = self.pool.get('project.task')
- for phase in phases:
- if phase.state in ('done','cancelled'):
- continue
- # FIXME: brittle and not working if context['lang'] != 'en_US'
- duration_uom = {
- 'day(s)': 'd', 'days': 'd', 'day': 'd', 'd':'d',
- 'month(s)': 'm', 'months': 'm', 'month':'month', 'm':'m',
- 'week(s)': 'w', 'weeks': 'w', 'week': 'w', 'w':'w',
- 'hour(s)': 'H', 'hours': 'H', 'hour': 'H', 'h':'H',
- }.get(phase.product_uom.name.lower(), "H")
- duration = str(phase.duration) + duration_uom
- result += '''
- def Phase_%s():
- effort = \"%s\"''' % (phase.id, duration)
- start = []
- if phase.constraint_date_start:
- start.append('datetime.datetime.strptime("'+str(phase.constraint_date_start)+'", "%Y-%m-%d %H:%M:%S")')
- for previous_phase in phase.previous_phase_ids:
- start.append("up.Phase_%s.end" % (previous_phase.id,))
- if start:
- result += '''
- start = max(%s)
-''' % (','.join(start))
-
- if phase.user_force_ids:
- result += '''
- resource = %s
-''' % '|'.join(map(lambda x: 'User_'+str(x.id), phase.user_force_ids))
-
- result += task_pool._generate_task(cr, uid, phase.task_ids, ident=8, context=context)
- result += "\n"
-
- return result
-
-class project_user_allocation(osv.osv):
- _name = 'project.user.allocation'
- _description = 'Phase User Allocation'
- _rec_name = 'user_id'
- _columns = {
- 'user_id': fields.many2one('res.users', 'User', required=True),
- 'phase_id': fields.many2one('project.phase', 'Project Phase', ondelete='cascade', required=True),
- 'project_id': fields.related('phase_id', 'project_id', type='many2one', relation="project.project", string='Project', store=True),
- 'date_start': fields.datetime('Start Date', help="Starting Date"),
- 'date_end': fields.datetime('End Date', help="Ending Date"),
- }
-
-class project(osv.osv):
- _inherit = "project.project"
-
- def _phase_count(self, cr, uid, ids, field_name, arg, context=None):
- res = dict.fromkeys(ids, 0)
- phase_ids = self.pool.get('project.phase').search(cr, uid, [('project_id', 'in', ids)])
- for phase in self.pool.get('project.phase').browse(cr, uid, phase_ids, context):
- res[phase.project_id.id] += 1
- return res
-
- _columns = {
- 'phase_ids': fields.one2many('project.phase', 'project_id', "Project Phases"),
- 'phase_count': fields.function(_phase_count, type='integer', string="Open Phases"),
- }
-
- def schedule_phases(self, cr, uid, ids, context=None):
- context = context or {}
- if type(ids) in (long, int,):
- ids = [ids]
- projects = self.browse(cr, uid, ids, context=context)
- result = self._schedule_header(cr, uid, ids, context=context)
- for project in projects:
- result += self._schedule_project(cr, uid, project, context=context)
- result += self.pool.get('project.phase').generate_phase(cr, uid, project.phase_ids, context=context)
-
- local_dict = {}
- exec result in local_dict
- projects_gantt = Task.BalancedProject(local_dict['Project'])
-
- for project in projects:
- project_gantt = getattr(projects_gantt, 'Project_%d' % (project.id,))
- for phase in project.phase_ids:
- if phase.state in ('done','cancelled'):
- continue
- # Maybe it's better to update than unlink/create if it already exists ?
- p = getattr(project_gantt, 'Phase_%d' % (phase.id,))
-
- self.pool.get('project.user.allocation').unlink(cr, uid,
- [x.id for x in phase.user_ids],
- context=context
- )
-
- for r in p.booked_resource:
- self.pool.get('project.user.allocation').create(cr, uid, {
- 'user_id': int(r.name[5:]),
- 'phase_id': phase.id,
- 'date_start': p.start.strftime('%Y-%m-%d %H:%M:%S'),
- 'date_end': p.end.strftime('%Y-%m-%d %H:%M:%S')
- }, context=context)
- self.pool.get('project.phase').write(cr, uid, [phase.id], {
- 'date_start': p.start.strftime('%Y-%m-%d %H:%M:%S'),
- 'date_end': p.end.strftime('%Y-%m-%d %H:%M:%S')
- }, context=context)
- return True
-
-class account_analytic_account(osv.osv):
- _inherit = 'account.analytic.account'
- _description = 'Analytic Account'
- _columns = {
- 'use_phases': fields.boolean('Phases', help="Check this field if you plan to use phase-based scheduling"),
- }
-
- def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None):
- res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context)
- if template_id and 'value' in res:
- template = self.browse(cr, uid, template_id, context=context)
- res['value']['use_phases'] = template.use_phases
- return res
-
-
- def _trigger_project_creation(self, cr, uid, vals, context=None):
- if context is None: context = {}
- res = super(account_analytic_account, self)._trigger_project_creation(cr, uid, vals, context=context)
- return res or (vals.get('use_phases') and not 'project_creation_in_progress' in context)
-
-
-class project_task(osv.osv):
- _inherit = "project.task"
- _columns = {
- 'phase_id': fields.many2one('project.phase', 'Project Phase', domain="[('project_id', '=', project_id)]"),
- }
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_long_term/project_long_term_data.xml b/addons/project_long_term/project_long_term_data.xml
deleted file mode 100644
index ebc084668b7..00000000000
--- a/addons/project_long_term/project_long_term_data.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/addons/project_long_term/project_long_term_demo.xml b/addons/project_long_term/project_long_term_demo.xml
deleted file mode 100644
index fda481d5a11..00000000000
--- a/addons/project_long_term/project_long_term_demo.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Collect Requirement and Make SRS
-
-
- 30
-
-
-
-
-
-
-
-
- Design Model
-
-
- 20
-
-
-
-
-
-
- Planning and compute Risk analysis, Time chart
-
-
- 20
-
-
-
-
-
-
- Development and Integration
-
-
- 90
-
-
-
-
-
- Review and Testing
-
-
- 30
-
-
-
-
-
- Deployement and Training
-
-
- 10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/project_long_term/project_long_term_report.xml b/addons/project_long_term/project_long_term_report.xml
deleted file mode 100644
index d8fe2a4fa6e..00000000000
--- a/addons/project_long_term/project_long_term_report.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml
deleted file mode 100644
index 36fb83000ce..00000000000
--- a/addons/project_long_term/project_long_term_view.xml
+++ /dev/null
@@ -1,387 +0,0 @@
-
-
-
-
-
-
-
-
- project.user.allocation.gantt
- project.user.allocation
-
-
-
-
-
-
-
- project.user.allocation.calendar
- project.user.allocation
-
-
-
-
-
-
-
-
-
-
-
- project.user.allocation.form
- project.user.allocation
-
-
-
-
-
-
- project.phase.list
- project.phase
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- project.phase.calendar
- project.phase
-
-
-
-
-
-
-
-
-
- project.phase.gantt
- project.phase
-
-
-
-
-
-
-
-
- project.phase.search
- project.phase
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Project Phases
- project.phase
- form
- gantt,tree,form,calendar
- {}
-
- A project can be split into the different phases. For each phase, you can define your users allocation, describe different tasks and link your phase to previous and next phases, add date constraints for the automated scheduling. Use the long term planning in order to planify your available users, convert your phases into a series of tasks when you start working on the project.
-
-
-
- Project Phases
- project.phase
- form
- tree,form,calendar
- {}
-
-
-
-
-
-
- phase.task.form2
- project.task
-
-
-
-
-
-
-
-
- phase.task.search.form
- project.task
-
-
-
-
-
-
-
-
-
- phase.task.search.form.group
- project.task
-
-
-
-
-
-
-
-
-
- phase.task.search.form.tree
- project.task
-
-
-
-
-
-
-
-
-
- account.analytic.account.phase.form.inherit
- account.analytic.account
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/project_long_term/project_long_term_workflow.xml b/addons/project_long_term/project_long_term_workflow.xml
deleted file mode 100644
index 317f98d9a35..00000000000
--- a/addons/project_long_term/project_long_term_workflow.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
- project.phase.wkf
- project.phase
- True
-
-
-
-
- True
- set_draft
- function
- set_draft()
-
-
-
-
- set_open
- function
- set_open()
-
-
-
-
- set_cancel
- True
- function
- set_cancel()
-
-
-
-
- set_pending
- function
- set_pending()
-
-
-
-
- set_done
- True
- function
- set_done()
-
-
-
-
-
- set_open
-
-
-
-
-
- set_cancel
-
-
-
-
-
- set_done
-
-
-
-
-
- set_pending
-
-
-
-
-
- set_cancel
-
-
-
-
-
- set_draft
-
-
-
-
-
- set_open
-
-
-
-
-
- set_cancel
-
-
-
-
-
- set_done
-
-
-
-
-
- set_draft
-
-
-
-
diff --git a/addons/project_long_term/security/ir.model.access.csv b/addons/project_long_term/security/ir.model.access.csv
deleted file mode 100644
index 82bfab460cb..00000000000
--- a/addons/project_long_term/security/ir.model.access.csv
+++ /dev/null
@@ -1,9 +0,0 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_project_phase,project.phase,model_project_phase,project.group_project_user,1,1,1,0
-access_project_user_allocation,project.user.allocation,model_project_user_allocation,project.group_project_user,1,0,0,0
-access_project_phase_manager,project.phase manager,model_project_phase,project.group_project_manager,1,1,1,1
-access_project_user_allocation_manager,project.user.allocation manager,model_project_user_allocation,project.group_project_manager,1,1,1,1
-access_resource_resource_user,user.user user,resource.model_resource_resource,project.group_project_user,1,0,0,0
-access_resource_resource_manager,user.user manager,resource.model_resource_resource,project.group_project_manager,1,1,1,1
-access_project_user_allocation_manager,project.user.allocation.manager,model_project_user_allocation,project.group_project_manager,1,1,1,1
-access_project_resource_calendar_attendance,resource.calendar.attendance,resource.model_resource_calendar_attendance,project.group_project_manager,1,0,0,0
diff --git a/addons/project_long_term/test/phase_process.yml b/addons/project_long_term/test/phase_process.yml
deleted file mode 100644
index 8738834b103..00000000000
--- a/addons/project_long_term/test/phase_process.yml
+++ /dev/null
@@ -1,79 +0,0 @@
--
- In order to test process of Phases,
--
- I create a record to schedule the phase of project.
--
- !record {model: project.compute.phases, id: project_compute_phases01}:
- target_project: 'one'
- project_id: project.project_project_1
--
- I schedule the phases.
--
- !python {model: project.compute.phases}: |
- self.check_selection(cr, uid, [ref("project_compute_phases01")])
--
- I check the starting date and ending date on the phases after scheduling.
--
- !python {model: project.project}: |
- project = self.browse(cr, uid, ref("project.project_project_1"), context=context)
- def _convert(date):
- import time
- return time.strptime(date, '%Y-%m-%d %H:%M:%S')
- def _check(phase, _convert, _check): #TOFIX: why need to pass function ?
- for next_phase in phase.next_phase_ids:
- assert _convert(next_phase.date_start) >= _convert(phase.date_end), "Phase does not start in proper date."
- _check(next_phase, _convert, _check)
- return True
-
- for phase in project.phase_ids:
-
- assert phase.date_start, "Start date should be computed."
- assert phase.date_end, "End date should be computed."
- if not phase.previous_phase_ids and phase.constraint_date_start:
- assert _convert(phase.date_start) >= _convert(phase.constraint_date_start), "Phase does not start in proper date."
- _check(phase, _convert, _check)
--
- I open phase.
--
- !python {model: project.phase}: |
- self.set_open(cr, uid, [ref("project_phase_1")])
--
- I check state of phase after opened.
--
- !assert {model: project.phase, id: project_phase_1, severity: error, string: Phase should be in open state}:
- - state == "open"
--
- I put phase in pending state.
--
- !python {model: project.phase}: |
- self.set_pending(cr, uid, [ref("project_phase_1")])
--
- I check state of phase after put in pending.
--
- !assert {model: project.phase, id: project_phase_1, severity: error, string: Phase should be in pending state}:
- - state == "pending"
--
- I make Phase in cancel state.
--
- !python {model: project.phase}: |
- self.set_cancel(cr, uid, [ref("project_phase_1")])
--
- I check state of phase after cancelled.
--
- !assert {model: project.phase, id: project_phase_1, severity: error, string: Phase should be in cancel state}:
- - state == "cancelled"
--
- I put again in draft phase.
--
- !python {model: project.phase}: |
- self.set_draft(cr, uid, [ref("project_phase_1")])
--
- I close phase.
--
- !python {model: project.phase}: |
- self.set_done(cr, uid, [ref("project_phase_1")])
--
- I check state of phase after closed.
--
- !assert {model: project.phase, id: project_phase_1, severity: error, string: Phase should be in done state}:
- - state == "done"
diff --git a/addons/project_long_term/test/task_process.yml b/addons/project_long_term/test/task_process.yml
deleted file mode 100644
index 060abcf43f3..00000000000
--- a/addons/project_long_term/test/task_process.yml
+++ /dev/null
@@ -1,19 +0,0 @@
--
- I create a record to compute the tasks of project.
--
- !record {model: project.compute.tasks, id: project_compute_tasks0}:
- project_id: project.project_project_1
--
- I compute and shedule the tasks.
--
- !python {model: project.compute.tasks}: |
- self.compute_date(cr, uid, [ref("project_compute_tasks0")])
--
- Check if tasks scheduled, check that either of task's start_date, end_date and user_id is not null
--
- !python {model: project.project}: |
- prj = self.browse(cr, uid, [ref("project.project_project_1")])[0]
- for task in prj.tasks:
- if task.stage_id and task.stage_id.fold:
- continue
- assert task.user_id and task.date_start and task.date_end, "Project tasks not scheduled"
diff --git a/addons/project_long_term/wizard/__init__.py b/addons/project_long_term/wizard/__init__.py
deleted file mode 100644
index 4536f4a3cbb..00000000000
--- a/addons/project_long_term/wizard/__init__.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-s
-##############################################################################
-#
-# 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 project_compute_phases
-import project_compute_tasks
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_long_term/wizard/project_compute_phases.py b/addons/project_long_term/wizard/project_compute_phases.py
deleted file mode 100644
index 751265d5eba..00000000000
--- a/addons/project_long_term/wizard/project_compute_phases.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# -*- coding: 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 openerp.tools.translate import _
-from openerp.osv import fields, osv
-
-class project_compute_phases(osv.osv_memory):
- _name = 'project.compute.phases'
- _description = 'Project Compute Phases'
- _columns = {
- 'target_project': fields.selection([
- ('all', 'Compute All My Projects'),
- ('one', 'Compute a Single Project'),
- ], 'Action', required=True),
- 'project_id': fields.many2one('project.project', 'Project')
- }
- _defaults = {
- 'target_project': 'one'
- }
-
- def check_selection(self, cr, uid, ids, context=None):
- return self.compute_date(cr, uid, ids, context=context)
-
- def compute_date(self, cr, uid, ids, context=None):
- """
- Compute the phases for scheduling.
- """
- project_pool = self.pool.get('project.project')
- data = self.read(cr, uid, ids, [], context=context)[0]
- if not data['project_id'] and data['target_project'] == 'one':
- raise osv.except_osv(_('Error!'), _('Please specify a project to schedule.'))
-
- if data['target_project'] == 'one':
- project_ids = [data['project_id'][0]]
- else:
- project_ids = project_pool.search(cr, uid, [('user_id','=',uid)], context=context)
-
- if project_ids:
- project_pool.schedule_phases(cr, uid, project_ids, context=context)
- return self._open_phases_list(cr, uid, data, context=context)
-
- def _open_phases_list(self, cr, uid, data, context=None):
- """
- Return the scheduled phases list.
- """
- if context is None:
- context = {}
- mod_obj = self.pool.get('ir.model.data')
- act_obj = self.pool.get('ir.actions.act_window')
- result = mod_obj._get_id(cr, uid, 'project_long_term', 'act_project_phase')
- id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
- result = act_obj.read(cr, uid, [id], context=context)[0]
- result['target'] = 'current'
- project_id = data.get('project_id') and data.get('project_id')[0] or False
- result['context'] = {"search_default_project_id":project_id, "default_project_id":project_id, "search_default_current": 1}
- return result
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_long_term/wizard/project_compute_phases_view.xml b/addons/project_long_term/wizard/project_compute_phases_view.xml
deleted file mode 100644
index c9fcf5aca70..00000000000
--- a/addons/project_long_term/wizard/project_compute_phases_view.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
- Schedule Phases
- project.compute.phases
-
-
-
-
-
-
-
-
-
-
-
-
- Schedule Phases
- ir.actions.act_window
- project.compute.phases
- form
- form
-
- new
- To schedule phases of all or a specified project. It then open a gantt view.
-
-
-
-
-
-
-
diff --git a/addons/project_long_term/wizard/project_compute_tasks.py b/addons/project_long_term/wizard/project_compute_tasks.py
deleted file mode 100644
index d442aee7790..00000000000
--- a/addons/project_long_term/wizard/project_compute_tasks.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# -*- coding: 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 openerp.osv import fields, osv
-
-class project_compute_tasks(osv.osv_memory):
- _name = 'project.compute.tasks'
- _description = 'Project Compute Tasks'
- _columns = {
- 'project_id': fields.many2one('project.project', 'Project', required=True)
- }
-
- def compute_date(self, cr, uid, ids, context=None):
- """
- Schedule the tasks according to users and priority.
- """
- project_pool = self.pool.get('project.project')
- task_pool = self.pool.get('project.task')
- if context is None:
- context = {}
- context['compute_by'] = 'project'
- data = self.read(cr, uid, ids, [])[0]
- project_id = data['project_id'][0]
- project_pool.schedule_tasks(cr, uid, [project_id], context=context)
- return self._open_task_list(cr, uid, data, context=context)
-
- def _open_task_list(self, cr, uid, data, context=None):
- """
- Return the scheduled task list.
- """
- if context is None:
- context = {}
- mod_obj = self.pool.get('ir.model.data')
- act_obj = self.pool.get('ir.actions.act_window')
- result = mod_obj._get_id(cr, uid, 'project_long_term', 'act_resouce_allocation')
- id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
- result = {}
- if not id:
- return result
- result = act_obj.read(cr, uid, [id], context=context)[0]
- result['target'] = 'current'
- return result
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_long_term/wizard/project_compute_tasks_view.xml b/addons/project_long_term/wizard/project_compute_tasks_view.xml
deleted file mode 100644
index 8b807806cde..00000000000
--- a/addons/project_long_term/wizard/project_compute_tasks_view.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- Schedule Tasks
- project.compute.tasks
-
-