From cd489c156a0572a400b74e721a6be58c97cad8e0 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Fri, 30 Jan 2015 11:36:14 +0000 Subject: [PATCH] Remove files from deprecated project --- .coveragerc | 19 - .gitignore | 56 --- .travis.yml | 44 -- README.md | 2 +- .../__init__.py | 22 - .../__openerp__.py | 48 -- .../account_analytic_analysis_recurring.pot | 129 ----- .../account_analytic_analysis_recurring.py | 209 -------- ...count_analytic_analysis_recurring_cron.xml | 16 - ...count_analytic_analysis_recurring_view.xml | 44 -- __unported__/analytic_hours_block/__init__.py | 24 - .../analytic_hours_block/__openerp__.py | 59 --- .../analytic_hours_block/hours_block.py | 426 ---------------- .../analytic_hours_block/hours_block_data.xml | 24 - .../analytic_hours_block/hours_block_menu.xml | 25 - .../analytic_hours_block/hours_block_view.xml | 172 ------- .../i18n/analytic_hours_block.pot | 470 ------------------ __unported__/analytic_hours_block/product.py | 38 -- .../analytic_hours_block/product_view.xml | 18 - __unported__/analytic_hours_block/project.py | 33 -- .../analytic_hours_block/project_view.xml | 19 - __unported__/analytic_hours_block/report.xml | 12 - .../analytic_hours_block/report/__init__.py | 21 - .../report/hours_block.py | 53 -- .../report/hours_block.rml | 263 ---------- .../security/hours_block_security.xml | 11 - .../security/ir.model.access.csv | 3 - __unported__/project_sla/__init__.py | 5 - __unported__/project_sla/__openerp__.py | 132 ----- __unported__/project_sla/analytic_account.py | 69 --- .../project_sla/analytic_account_view.xml | 24 - __unported__/project_sla/i18n/project_sla.pot | 296 ----------- .../project_sla/images/10_sla_contract.png | Bin 18059 -> 0 bytes .../project_sla/images/20_sla_definition.png | Bin 19141 -> 0 bytes .../project_sla/images/30_sla_controlled.png | Bin 26418 -> 0 bytes __unported__/project_sla/m2m.py | 75 --- __unported__/project_sla/project_issue.py | 29 -- .../project_sla/project_issue_view.xml | 60 --- __unported__/project_sla/project_sla.py | 86 ---- .../project_sla/project_sla_control.py | 322 ------------ .../project_sla/project_sla_control_data.xml | 18 - .../project_sla/project_sla_control_view.xml | 25 - __unported__/project_sla/project_sla_demo.xml | 138 ----- __unported__/project_sla/project_sla_view.xml | 48 -- __unported__/project_sla/project_view.xml | 20 - .../project_sla/security/ir.model.access.csv | 8 - .../project_sla/static/src/img/icon.png | Bin 9545 -> 0 bytes __unported__/project_sla/test/project_sla.yml | 66 --- 48 files changed, 1 insertion(+), 3680 deletions(-) delete mode 100644 .coveragerc delete mode 100644 .gitignore delete mode 100644 .travis.yml delete mode 100644 __unported__/account_analytic_analysis_recurring/__init__.py delete mode 100644 __unported__/account_analytic_analysis_recurring/__openerp__.py delete mode 100644 __unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring.pot delete mode 100644 __unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring.py delete mode 100644 __unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring_cron.xml delete mode 100644 __unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring_view.xml delete mode 100644 __unported__/analytic_hours_block/__init__.py delete mode 100644 __unported__/analytic_hours_block/__openerp__.py delete mode 100644 __unported__/analytic_hours_block/hours_block.py delete mode 100644 __unported__/analytic_hours_block/hours_block_data.xml delete mode 100644 __unported__/analytic_hours_block/hours_block_menu.xml delete mode 100644 __unported__/analytic_hours_block/hours_block_view.xml delete mode 100644 __unported__/analytic_hours_block/i18n/analytic_hours_block.pot delete mode 100644 __unported__/analytic_hours_block/product.py delete mode 100644 __unported__/analytic_hours_block/product_view.xml delete mode 100644 __unported__/analytic_hours_block/project.py delete mode 100644 __unported__/analytic_hours_block/project_view.xml delete mode 100644 __unported__/analytic_hours_block/report.xml delete mode 100644 __unported__/analytic_hours_block/report/__init__.py delete mode 100644 __unported__/analytic_hours_block/report/hours_block.py delete mode 100644 __unported__/analytic_hours_block/report/hours_block.rml delete mode 100644 __unported__/analytic_hours_block/security/hours_block_security.xml delete mode 100644 __unported__/analytic_hours_block/security/ir.model.access.csv delete mode 100644 __unported__/project_sla/__init__.py delete mode 100644 __unported__/project_sla/__openerp__.py delete mode 100644 __unported__/project_sla/analytic_account.py delete mode 100644 __unported__/project_sla/analytic_account_view.xml delete mode 100644 __unported__/project_sla/i18n/project_sla.pot delete mode 100644 __unported__/project_sla/images/10_sla_contract.png delete mode 100644 __unported__/project_sla/images/20_sla_definition.png delete mode 100644 __unported__/project_sla/images/30_sla_controlled.png delete mode 100644 __unported__/project_sla/m2m.py delete mode 100644 __unported__/project_sla/project_issue.py delete mode 100644 __unported__/project_sla/project_issue_view.xml delete mode 100644 __unported__/project_sla/project_sla.py delete mode 100644 __unported__/project_sla/project_sla_control.py delete mode 100644 __unported__/project_sla/project_sla_control_data.xml delete mode 100644 __unported__/project_sla/project_sla_control_view.xml delete mode 100644 __unported__/project_sla/project_sla_demo.xml delete mode 100644 __unported__/project_sla/project_sla_view.xml delete mode 100644 __unported__/project_sla/project_view.xml delete mode 100644 __unported__/project_sla/security/ir.model.access.csv delete mode 100644 __unported__/project_sla/static/src/img/icon.png delete mode 100644 __unported__/project_sla/test/project_sla.yml diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index a06f8bfe..00000000 --- a/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Config file .coveragerc - -[report] -omit = - /usr/* - */bin/* - */lib/* - */odoo/* - */openerp/* - */tests/* - *__init__.py - -# Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about null context checking - if context is None: diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 890ff010..00000000 --- a/.gitignore +++ /dev/null @@ -1,56 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -bin/ -build/ -develop-eggs/ -dist/ -eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.cache -nosetests.xml -coverage.xml - -# Translations -*.mo - -# Pycharm -.idea - -# Mr Developer -.mr.developer.cfg -.project -.pydevproject - -# Rope -.ropeproject - -# Sphinx documentation -docs/_build/ - -# Backup files -*~ -*.swp diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 50be0b23..00000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -# Config file .travis.yml - -language: python - -python: -# - "pypy" # not supported by odoo 8 -# - "3.4" # not supported by odoo 8 -# - "3.3" # not supported by odoo 8 - - "2.7" -# - "2.6" # not supported by odoo 8 - -env: - - ODOO="https://github.com/savoirfairelinux/odoo/archive/setuptools-addons.tar.gz" # Temp until https://github.com/odoo/odoo/issues/185 or https://github.com/odoo/odoo/issues/441 is fixed -# - ODOO="https://github.com/odoo/odoo/archive/master.tar.gz" -# - ODOO="https://github.com/OCA/OCB/archive/master.zip" - -# Need coveralls for coverage reports -# Need flake8 for pep8 testing -# Manually get PyChart -# Install tested version of odoo (official or ocb) -# Get modules from other repos which have dependencies (in this case travel requires modules from lp:partner-contact-management and lp:openerp-hr -install: - - pip install coveralls flake8 - - pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz - - pip install ${ODOO} - -# Create databae -# Pre-install modules and dependencies -before_script: - - createdb test - -# Test with flake, ignore F401 for __init__.py files, use a max length of 120 -# Run tests with coverage -# Only test modules in repo (list populated by directories in repo) -# Preload modules before testing to only run tests of repo's modules -# Include current directory and dependent repos in addons-path as well as official addons -script: - - flake8 . --max-line-length=120 --exclude=__unported__ --filename=__init__.py --ignore=F401 - - flake8 . --max-line-length=120 --exclude=__unported__,__init__.py - - odoo.py -d test --stop-after-init --init=$(python -c 'import os; print(",".join(x for x in os.listdir(".") if os.path.isdir(x) and not x.startswith(".") and x != "__unported__"))') --addons-path=$(pwd),`python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"`/addons - - coverage run $(which odoo.py) -d test --test-enable --log-level=test --stop-after-init --init=$(python -c 'import os; print(",".join(x for x in os.listdir(".") if os.path.isdir(x) and not x.startswith(".") and x != "__unported__"))') --addons-path=$(pwd),`python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"`/addons - -after_success: - coveralls diff --git a/README.md b/README.md index 16fe614c..4113e615 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -**IMPORTANT** +# Warning: DEPRECATED! # These modules are now available from the [Project & Service Management](https://github.com/OCA/project-service) repository. diff --git a/__unported__/account_analytic_analysis_recurring/__init__.py b/__unported__/account_analytic_analysis_recurring/__init__.py deleted file mode 100644 index 7088b5aa..00000000 --- a/__unported__/account_analytic_analysis_recurring/__init__.py +++ /dev/null @@ -1,22 +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 account_analytic_analysis_recurring diff --git a/__unported__/account_analytic_analysis_recurring/__openerp__.py b/__unported__/account_analytic_analysis_recurring/__openerp__.py deleted file mode 100644 index 7b8ae639..00000000 --- a/__unported__/account_analytic_analysis_recurring/__openerp__.py +++ /dev/null @@ -1,48 +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': 'Contracts Management recurring', - 'version': '0.1', - 'category': 'Other', - 'description': """ -This module add a new feature in contracts to manage recurring invoice -======================================================================================= - -This is a backport of the new V8 feature available in trunk and saas. With the V8 release this module will be deprecated. -It also add a little feature, you can use #START# and #END# in the contract line to automatically insert the dates of the invoiced period. - -Backport done By Yannick Buron. -""", - 'author': 'OpenERP SA', - 'website': 'http://openerp.com', - 'depends': ['base', 'account_analytic_analysis'], - 'data': [ - 'account_analytic_analysis_recurring_cron.xml', - 'account_analytic_analysis_recurring_view.xml', - ], - 'demo': [''], - 'test':[], - 'installable': False, - 'images': [], -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring.pot b/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring.pot deleted file mode 100644 index 7d2f21f1..00000000 --- a/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring.pot +++ /dev/null @@ -1,129 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_analytic_analysis_recurring -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-21 11:41+0000\n" -"PO-Revision-Date: 2014-02-21 11:41+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.invoice.line,price_subtotal:0 -msgid "Sub Total" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.account,recurring_rule_type:0 -msgid "Recurrency" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.invoice.line,price_unit:0 -msgid "Unit Price" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: view:account.analytic.account:0 -msgid ". create invoices" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: view:account.analytic.account:0 -msgid "Account Analytic Lines" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.account,recurring_invoice_line_ids:0 -msgid "Invoice Lines" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.invoice.line,uom_id:0 -msgid "Unit of Measure" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: selection:account.analytic.account,recurring_rule_type:0 -msgid "Day(s)" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: help:account.analytic.account,recurring_rule_type:0 -msgid "Invoice automatically repeat at specified interval" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.invoice.line,product_id:0 -msgid "Product" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.invoice.line,name:0 -msgid "Description" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.account,recurring_interval:0 -msgid "Repeat Every" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: view:account.analytic.account:0 -msgid "Recurring Invoices" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.account,recurring_invoices:0 -msgid "Generate recurring invoices automatically" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: selection:account.analytic.account,recurring_rule_type:0 -msgid "Year(s)" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: selection:account.analytic.account,recurring_rule_type:0 -msgid "Week(s)" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.invoice.line,quantity:0 -msgid "Quantity" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: model:ir.model,name:account_analytic_analysis_recurring.model_account_analytic_invoice_line -msgid "account.analytic.invoice.line" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.account,recurring_next_date:0 -msgid "Date of Next Invoice" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: field:account.analytic.invoice.line,analytic_account_id:0 -#: model:ir.model,name:account_analytic_analysis_recurring.model_account_analytic_account -msgid "Analytic Account" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: selection:account.analytic.account,recurring_rule_type:0 -msgid "Month(s)" -msgstr "" - -#. module: account_analytic_analysis_recurring -#: help:account.analytic.account,recurring_interval:0 -msgid "Repeat every (Days/Week/Month/Year)" -msgstr "" - - diff --git a/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring.py b/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring.py deleted file mode 100644 index 2b85cce6..00000000 --- a/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring.py +++ /dev/null @@ -1,209 +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 dateutil.relativedelta import relativedelta -import datetime -import logging -import time - -from openerp.osv import osv, fields -from openerp.osv.orm import intersect, except_orm -import openerp.tools -from openerp.tools.translate import _ - -from openerp.addons.decimal_precision import decimal_precision as dp - -_logger = logging.getLogger(__name__) - -class account_analytic_invoice_line(osv.osv): - _name = "account.analytic.invoice.line" - - def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict, context=None): - res = {} - for line in self.browse(cr, uid, ids, context=context): - res[line.id] = line.quantity * line.price_unit - if line.analytic_account_id.pricelist_id: - cur = line.analytic_account_id.pricelist_id.currency_id - res[line.id] = self.pool.get('res.currency').round(cr, uid, cur, res[line.id]) - return res - - _columns = { - 'product_id': fields.many2one('product.product','Product',required=True), - 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account'), - 'name': fields.text('Description', required=True), - 'quantity': fields.float('Quantity', required=True), - 'uom_id': fields.many2one('product.uom', 'Unit of Measure',required=True), - 'price_unit': fields.float('Unit Price', required=True), - 'price_subtotal': fields.function(_amount_line, string='Sub Total', type="float",digits_compute= dp.get_precision('Account')), - } - _defaults = { - 'quantity' : 1, - } - - def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', partner_id=False, price_unit=False, pricelist_id=False, company_id=None, context=None): - context = context or {} - uom_obj = self.pool.get('product.uom') - company_id = company_id or False - context.update({'company_id': company_id, 'force_company': company_id, 'pricelist_id': pricelist_id}) - - if not product: - return {'value': {'price_unit': 0.0}, 'domain':{'product_uom':[]}} - if partner_id: - part = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) - if part.lang: - context.update({'lang': part.lang}) - - result = {} - res = self.pool.get('product.product').browse(cr, uid, product, context=context) - result.update({'name':res.partner_ref or False,'uom_id': uom_id or res.uom_id.id or False, 'price_unit': res.list_price or 0.0}) - if res.description: - result['name'] += '\n'+res.description - - res_final = {'value':result} - if result['uom_id'] != res.uom_id.id: - selected_uom = uom_obj.browse(cr, uid, result['uom_id'], context=context) - new_price = uom_obj._compute_price(cr, uid, res.uom_id.id, res_final['value']['price_unit'], result['uom_id']) - res_final['value']['price_unit'] = new_price - return res_final - - -class account_analytic_account(osv.osv): - _name = "account.analytic.account" - _inherit = "account.analytic.account" - - _columns = { - 'recurring_invoice_line_ids': fields.one2many('account.analytic.invoice.line', 'analytic_account_id', 'Invoice Lines'), - 'recurring_invoices' : fields.boolean('Generate recurring invoices automatically'), - 'recurring_rule_type': fields.selection([ - ('daily', 'Day(s)'), - ('weekly', 'Week(s)'), - ('monthly', 'Month(s)'), - ('yearly', 'Year(s)'), - ], 'Recurrency', help="Invoice automatically repeat at specified interval"), - 'recurring_interval': fields.integer('Repeat Every', help="Repeat every (Days/Week/Month/Year)"), - 'recurring_next_date': fields.date('Date of Next Invoice'), - } - - _defaults = { - 'recurring_interval': 1, - 'recurring_next_date': lambda *a: time.strftime('%Y-%m-%d'), - 'recurring_rule_type':'monthly' - } - - def onchange_recurring_invoices(self, cr, uid, ids, recurring_invoices, date_start=False, context=None): - value = {} - if date_start and recurring_invoices: - value = {'value': {'recurring_next_date': date_start}} - return value - - def _prepare_invoice(self, cr, uid, contract, context=None): - context = context or {} - - inv_obj = self.pool.get('account.invoice') - journal_obj = self.pool.get('account.journal') - fpos_obj = self.pool.get('account.fiscal.position') - lang_obj = self.pool.get('res.lang') - - if not contract.partner_id: - raise osv.except_osv(_('No Customer Defined!'),_("You must first select a Customer for Contract %s!") % contract.name ) - - fpos = contract.partner_id.property_account_position or False - journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', contract.company_id.id or False)], limit=1) - if not journal_ids: - raise osv.except_osv(_('Error!'), - _('Please define a sale journal for the company "%s".') % (contract.company_id.name or '', )) - - partner_payment_term = contract.partner_id.property_payment_term and contract.partner_id.property_payment_term.id or False - - - inv_data = { - 'reference': contract.code or False, - 'account_id': contract.partner_id.property_account_receivable.id, - 'type': 'out_invoice', - 'partner_id': contract.partner_id.id, - 'currency_id': contract.partner_id.property_product_pricelist.id or False, - 'journal_id': len(journal_ids) and journal_ids[0] or False, - 'date_invoice': contract.recurring_next_date, - 'origin': contract.name, - 'fiscal_position': fpos and fpos.id, - 'payment_term': partner_payment_term, - 'company_id': contract.company_id.id or False, - } - invoice_id = inv_obj.create(cr, uid, inv_data, context=context) - - for line in contract.recurring_invoice_line_ids: - - res = line.product_id - account_id = res.property_account_income.id - if not account_id: - account_id = res.categ_id.property_account_income_categ.id - account_id = fpos_obj.map_account(cr, uid, fpos, account_id) - - taxes = res.taxes_id or False - tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) - - if 'old_date' in context: - lang_ids = lang_obj.search(cr, uid, [('code', '=', contract.partner_id.lang)], context=context) - format = lang_obj.browse(cr, uid, lang_ids, context=context)[0].date_format - line.name = line.name.replace('#START#', context['old_date'].strftime(format)) - line.name = line.name.replace('#END#', context['next_date'].strftime(format)) - - invoice_line_vals = { - 'name': line.name, - 'account_id': account_id, - 'account_analytic_id': contract.id, - 'price_unit': line.price_unit or 0.0, - 'quantity': line.quantity, - 'uos_id': line.uom_id.id or False, - 'product_id': line.product_id.id or False, - 'invoice_id' : invoice_id, - 'invoice_line_tax_id': [(6, 0, tax_id)], - } - self.pool.get('account.invoice.line').create(cr, uid, invoice_line_vals, context=context) - - inv_obj.button_compute(cr, uid, [invoice_id], context=context) - return invoice_id - - def recurring_create_invoice(self, cr, uid, automatic=False, context=None): - context = context or {} - current_date = time.strftime('%Y-%m-%d') - - contract_ids = self.search(cr, uid, [('recurring_next_date','<=', current_date), ('state','=', 'open'), ('recurring_invoices','=', True)]) - for contract in self.browse(cr, uid, contract_ids, context=context): - - next_date = datetime.datetime.strptime(contract.recurring_next_date or current_date, "%Y-%m-%d") - interval = contract.recurring_interval - if contract.recurring_rule_type == 'daily': - old_date = next_date-relativedelta(days=+interval) - new_date = next_date+relativedelta(days=+interval) - elif contract.recurring_rule_type == 'weekly': - old_date = next_date-relativedelta(weeks=+interval) - new_date = next_date+relativedelta(weeks=+interval) - else: - old_date = next_date+relativedelta(months=+interval) - new_date = next_date+relativedelta(months=+interval) - - context['old_date'] = old_date - context['next_date'] = datetime.datetime.strptime(contract.recurring_next_date or current_date,"%Y-%m-%d") - invoice_id = self._prepare_invoice(cr, uid, contract, context=context) - - self.write(cr, uid, [contract.id], {'recurring_next_date': new_date.strftime('%Y-%m-%d')}, context=context) - return True - diff --git a/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring_cron.xml b/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring_cron.xml deleted file mode 100644 index 95ae54de..00000000 --- a/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring_cron.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Generate Recurring Invoices from Contracts - 1 - days - -1 - - - - - - - diff --git a/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring_view.xml b/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring_view.xml deleted file mode 100644 index e2893476..00000000 --- a/__unported__/account_analytic_analysis_recurring/account_analytic_analysis_recurring_view.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - account.analytic.account.invoice.recurring.form.inherit - account.analytic.account - - - - - -
- -
- - -
-
-
- -
-
diff --git a/__unported__/analytic_hours_block/__init__.py b/__unported__/analytic_hours_block/__init__.py deleted file mode 100644 index 81ba8d05..00000000 --- a/__unported__/analytic_hours_block/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Vincent Renaville, ported by Joel Grand-Guillaume -# Copyright 2010-2012 Camptocamp SA -# -# 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 hours_block -import report -import product -import project diff --git a/__unported__/analytic_hours_block/__openerp__.py b/__unported__/analytic_hours_block/__openerp__.py deleted file mode 100644 index 221561ea..00000000 --- a/__unported__/analytic_hours_block/__openerp__.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Vincent Renaville, ported by Joel Grand-Guillaume -# Copyright 2010-2012 Camptocamp SA -# -# 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": "Project Hours Blocks Management", - "version": "1.5", - "category": "Generic Modules/Projects & Services", - "description": """ -Project Hours Blocks Management -=============================== - -This module allows you to handle hours blocks, -to follow for example the user support contracts. -This means, you sell a product of type "hours block" -then you input the spent hours on the hours block and -you can track and follow how much has been used. - - """, - "author": "Camptocamp", - "license": 'AGPL-3', - "website": "http://www.camptocamp.com", - "depends": [ - "account", - "hr_timesheet_invoice", - "analytic", - "project", - ], - "data": [ - "report.xml", - "hours_block_view.xml", - "hours_block_data.xml", - "hours_block_menu.xml", - "product_view.xml", - "project_view.xml", - "report.xml", - "security/hours_block_security.xml", - "security/ir.model.access.csv", - ], - "active": False, - "installable": False -} diff --git a/__unported__/analytic_hours_block/hours_block.py b/__unported__/analytic_hours_block/hours_block.py deleted file mode 100644 index e29c5a6b..00000000 --- a/__unported__/analytic_hours_block/hours_block.py +++ /dev/null @@ -1,426 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Vincent Renaville, ported by Joel Grand-Guillaume -# Copyright 2010-2012 Camptocamp SA -# -# 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 orm, fields - - -class AccountHoursBlock(orm.Model): - _name = "account.hours.block" - _inherit = ['mail.thread'] - - def _get_last_action(self, cr, uid, ids, name, arg, context=None): - """ Return the last analytic line date for an invoice""" - res = {} - for block in self.browse(cr, uid, ids, context=context): - cr.execute("SELECT max(al.date) FROM account_analytic_line AS al" - " WHERE al.invoice_id = %s", (block.invoice_id.id,)) - fetch_res = cr.fetchone() - res[block.id] = fetch_res[0] if fetch_res else False - return res - - def _compute_hours(self, cr, uid, ids, fields, args, context=None): - """Return a dict of [id][fields]""" - if isinstance(ids, (int, long)): - ids = [ids] - result = {} - aal_obj = self.pool.get('account.analytic.line') - for block in self.browse(cr, uid, ids, context=context): - result[block.id] = {'amount_hours_block': 0.0, - 'amount_hours_block_done': 0.0} - # Compute hours bought - for line in block.invoice_id.invoice_line: - hours_bought = 0.0 - if line.product_id and line.product_id.is_in_hours_block: - # We will now calculate the product_quantity - factor = line.uos_id.factor - if factor == 0.0: - factor = 1.0 - amount = line.quantity - hours_bought += (amount / factor) - result[block.id]['amount_hours_block'] += hours_bought - - # Compute hours spent - hours_used = 0.0 - # Get ids of analytic line generated from - # timesheet associated to the current block - cr.execute("SELECT al.id " - "FROM account_analytic_line AS al, " - " account_analytic_journal AS aj " - "WHERE aj.id = al.journal_id " - "AND aj.type = 'general' " - "AND al.invoice_id = %s", (block.invoice_id.id,)) - res_line_ids = cr.fetchall() - line_ids = [l[0] for l in res_line_ids] if res_line_ids else [] - for line in aal_obj.browse(cr, uid, line_ids, context=context): - factor = 1.0 - if line.product_uom_id and line.product_uom_id.factor != 0.0: - factor = line.product_uom_id.factor - factor_invoicing = 1.0 - if line.to_invoice and line.to_invoice.factor != 0.0: - factor_invoicing = 1.0 - line.to_invoice.factor / 100 - hours_used += ((line.unit_amount / factor) * factor_invoicing) - result[block.id]['amount_hours_block_done'] = hours_used - return result - - def _compute_amount(self, cr, uid, ids, fields, args, context=None): - if context is None: - context = {} - result = {} - aal_obj = self.pool.get('account.analytic.line') - pricelist_obj = self.pool.get('product.pricelist') - for block in self.browse(cr, uid, ids, context=context): - result[block.id] = {'amount_hours_block': 0.0, - 'amount_hours_block_done': 0.0} - - # Compute amount bought - for line in block.invoice_id.invoice_line: - amount_bought = 0.0 - if line.product_id: - ## We will now calculate the product_quantity - factor = line.uos_id.factor - if factor == 0.0: - factor = 1.0 - amount = line.quantity * line.price_unit - amount_bought += (amount / factor) - result[block.id]['amount_hours_block'] += amount_bought - - # Compute total amount - # Get ids of analytic line generated from timesheet associated to current block - cr.execute("SELECT al.id FROM account_analytic_line AS al," - " account_analytic_journal AS aj" - " WHERE aj.id = al.journal_id" - " AND aj.type='general'" - " AND al.invoice_id = %s", (block.invoice_id.id,)) - res_line_ids = cr.fetchall() - line_ids = [l[0] for l in res_line_ids] if res_line_ids else [] - total_amount = 0.0 - for line in aal_obj.browse(cr, uid, line_ids, context=context): - factor_invoicing = 1.0 - if line.to_invoice and line.to_invoice.factor != 0.0: - factor_invoicing = 1.0 - line.to_invoice.factor / 100 - - ctx = dict(context, uom=line.product_uom_id.id) - amount = pricelist_obj.price_get( - cr, uid, - [line.account_id.pricelist_id.id], - line.product_id.id, - line.unit_amount or 1.0, - line.account_id.partner_id.id or False, - ctx)[line.account_id.pricelist_id.id] - total_amount += amount * line.unit_amount * factor_invoicing - result[block.id]['amount_hours_block_done'] += total_amount - - return result - - def _compute(self, cr, uid, ids, fields, args, context=None): - result = {} - block_per_types = {} - for block in self.browse(cr, uid, ids, context=context): - block_per_types.setdefault(block.type, []).append(block.id) - - for block_type in block_per_types: - if block_type: - func = getattr(self, "_compute_%s" % block_type) - result.update(func(cr, uid, ids, fields, args, context=context)) - - for block in result: - result[block]['amount_hours_block_delta'] = \ - result[block]['amount_hours_block'] - \ - result[block]['amount_hours_block_done'] - return result - - def _get_analytic_line(self, cr, uid, ids, context=None): - invoice_ids = [] - an_lines_obj = self.pool.get('account.analytic.line') - block_obj = self.pool.get('account.hours.block') - for line in an_lines_obj.browse(cr, uid, ids, context=context): - if line.invoice_id: - invoice_ids.append(line.invoice_id.id) - return block_obj.search( - cr, uid, [('invoice_id', 'in', invoice_ids)], context=context) - - def _get_invoice(self, cr, uid, ids, context=None): - block_ids = set() - inv_obj = self.pool.get('account.invoice') - for invoice in inv_obj.browse(cr, uid, ids, context=context): - block_ids.update([inv.id for inv in invoice.account_hours_block_ids]) - return list(block_ids) - - def action_send_block(self, cr, uid, ids, context=None): - """Open a form to send by email. Return an action dict.""" - - assert len(ids) == 1, '''\ - This option should only be used for a single ID at a time.''' - - ir_model_data = self.pool.get('ir.model.data') - - try: - template_id = ir_model_data.get_object_reference( - cr, uid, 'analytic_hours_block', 'email_template_hours_block' - )[1] - except ValueError: - template_id = False - - try: - compose_form_id = ir_model_data.get_object_reference( - cr, uid, 'mail', 'email_compose_message_wizard_form' - )[1] - except ValueError: - compose_form_id = False - - ctx = { - 'default_model': self._name, - 'default_res_id': ids[0], - 'default_use_template': bool(template_id), - 'default_template_id': template_id, - 'default_composition_mode': 'comment', - } - return { - 'type': 'ir.actions.act_window', - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'mail.compose.message', - 'views': [(compose_form_id, 'form')], - 'view_id': compose_form_id, - 'target': 'new', - 'context': ctx, - } - - _recompute_triggers = { - 'account.hours.block': (lambda self, cr, uid, ids, c=None: - ids, ['invoice_id', 'type'], 10), - 'account.invoice': (_get_invoice, ['analytic_line_ids'], 10), - 'account.analytic.line': ( - _get_analytic_line, - ['product_uom_id', 'unit_amount', 'to_invoice', 'invoice_id'], - 10), - } - - _columns = { - 'amount_hours_block': fields.function( - _compute, - type='float', - string='Quantity / Amount bought', - store=_recompute_triggers, - multi='amount_hours_block_delta', - help="Amount bought by the customer. " - "This amount is expressed in the base Unit of Measure " - "(factor=1.0)"), - 'amount_hours_block_done': fields.function( - _compute, - type='float', - string='Quantity / Amount used', - store=_recompute_triggers, - multi='amount_hours_block_delta', - help="Amount done by the staff. " - "This amount is expressed in the base Unit of Measure " - "(factor=1.0)"), - 'amount_hours_block_delta': fields.function( - _compute, - type='float', - string='Difference', - store=_recompute_triggers, - multi='amount_hours_block_delta', - help="Difference between bought and used. " - "This amount is expressed in the base Unit of Measure " - "(factor=1.0)"), - 'last_action_date': fields.function( - _get_last_action, - type='date', - string='Last action date', - help="Date of the last analytic line linked to the invoice " - "related to this block hours."), - 'close_date': fields.date('Closed Date'), - 'invoice_id': fields.many2one( - 'account.invoice', - 'Invoice', - ondelete='cascade', - required=True), - 'type': fields.selection( - [('hours', 'Hours'), - ('amount', 'Amount')], - string='Type of Block', - required=True, - help="The block is based on the quantity of hours " - "or on the amount."), - - # Invoices related infos - 'date_invoice': fields.related( - 'invoice_id', 'date_invoice', - type="date", - string="Invoice Date", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['date_invoice'], 10), - }, - readonly=True), - 'user_id': fields.related( - 'invoice_id', 'user_id', - type="many2one", - relation="res.users", - string="Salesman", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['user_id'], 10), - }, - readonly=True), - 'partner_id': fields.related( - 'invoice_id', 'partner_id', - type="many2one", - relation="res.partner", - string="Partner", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['partner_id'], 10), - }, - readonly=True), - 'name': fields.related( - 'invoice_id', 'name', - type="char", - string="Description", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['name'], 10), - }, - readonly=True), - 'number': fields.related( - 'invoice_id', 'number', - type="char", - string="Number", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['number'], 10), - }, - readonly=True), - 'journal_id': fields.related( - 'invoice_id', 'journal_id', - type="many2one", - relation="account.journal", - string="Journal", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['journal_id'], 10), - }, - readonly=True), - 'period_id': fields.related( - 'invoice_id', 'period_id', - type="many2one", - relation="account.period", - string="Period", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['period_id'], 10), - }, - readonly=True), - 'company_id': fields.related( - 'invoice_id', 'company_id', - type="many2one", - relation="res.company", - string="Company", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['company_id'], 10), - }, - readonly=True), - 'currency_id': fields.related( - 'invoice_id', 'currency_id', - type="many2one", - relation="res.currency", - string="Currency", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['currency_id'], 10), - }, - readonly=True), - 'residual': fields.related( - 'invoice_id', 'residual', - type="float", - string="Residual", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['residual'], 10), - }, - readonly=True), - 'amount_total': fields.related( - 'invoice_id', 'amount_total', - type="float", - string="Total", - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['amount_total'], 10), - }, - readonly=True), - 'department_id': fields.related( - 'invoice_id', 'department_id', - type='many2one', - relation='hr.department', - string='Department', - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['department_id'], 10), - }, - readonly=True), - - 'state': fields.related( - 'invoice_id', 'state', - type='selection', - selection=[ - ('draft', 'Draft'), - ('proforma', 'Pro-forma'), - ('proforma2', 'Pro-forma'), - ('open', 'Open'), - ('paid', 'Paid'), - ('cancel', 'Cancelled'), - ], - string='State', - readonly=True, - store={ - 'account.hours.block': (lambda self, cr, uid, ids, c=None: ids, - ['invoice_id'], 10), - 'account.invoice': (_get_invoice, ['state'], 10), - }), - } - - -############################################################################ -## Add hours blocks on invoice -############################################################################ -class AccountInvoice(orm.Model): - _inherit = 'account.invoice' - - _columns = { - 'account_hours_block_ids': fields.one2many( - 'account.hours.block', - 'invoice_id', - string='Hours Block') - } diff --git a/__unported__/analytic_hours_block/hours_block_data.xml b/__unported__/analytic_hours_block/hours_block_data.xml deleted file mode 100644 index dc5f9eaa..00000000 --- a/__unported__/analytic_hours_block/hours_block_data.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Hours Block - Send by Email - ${(object.user_id.email or object.company_id.email or 'noreply@localhost')|safe} - ${object.company_id.name} Hours Block (Ref ${object.number or 'n/a'}) - ${object.partner_id.id} - - - - Hours_Block_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''} - ${object.partner_id.lang} - Hello ${object.partner_id.name},

- -

Please find attached your Hours Block Report.

-

Best regards.

- ]]>
-
-
-
diff --git a/__unported__/analytic_hours_block/hours_block_menu.xml b/__unported__/analytic_hours_block/hours_block_menu.xml deleted file mode 100644 index 7b32b14b..00000000 --- a/__unported__/analytic_hours_block/hours_block_menu.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - {'search_default_running': 1, 'search_default_group_department_id': 1} - Hours Blocks - account.hours.block - form - tree,form - - - - - - - - diff --git a/__unported__/analytic_hours_block/hours_block_view.xml b/__unported__/analytic_hours_block/hours_block_view.xml deleted file mode 100644 index 118f914e..00000000 --- a/__unported__/analytic_hours_block/hours_block_view.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - account.hours.block.select - account.hours.block - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - account.hours.block.form - account.hours.block - -
-
-
- -

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
-
-
-
- - - account.hours.block.tree - account.hours.block - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
diff --git a/__unported__/analytic_hours_block/i18n/analytic_hours_block.pot b/__unported__/analytic_hours_block/i18n/analytic_hours_block.pot deleted file mode 100644 index e8597111..00000000 --- a/__unported__/analytic_hours_block/i18n/analytic_hours_block.pot +++ /dev/null @@ -1,470 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * analytic_hours_block -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-08 12:49+0000\n" -"PO-Revision-Date: 2014-01-08 12:49+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Maintenance And Support Summary" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Invoice Date:" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Group By..." -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Bought" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,close_date:0 -msgid "Closed Date" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,message_unread:0 -msgid "Unread Messages" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,company_id:0 -msgid "Company" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,date_invoice:0 -msgid "Invoice Date" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,residual:0 -msgid "Residual" -msgstr "" - -#. module: analytic_hours_block -#: help:account.hours.block,amount_hours_block:0 -msgid "Amount bought by the customer. This amount is expressed in the base Unit of Measure (factor=1.0)" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Based on:" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,message_ids:0 -msgid "Messages" -msgstr "" - -#. module: analytic_hours_block -#: selection:account.hours.block,type:0 -msgid "Amount" -msgstr "" - -#. module: analytic_hours_block -#: selection:account.hours.block,state:0 -msgid "Cancelled" -msgstr "" - -#. module: analytic_hours_block -#: help:account.hours.block,message_unread:0 -msgid "If checked new messages require your attention." -msgstr "" - -#. module: analytic_hours_block -#: model:email.template,body_html:analytic_hours_block.email_template_hours_block -msgid "\n" -" Here is your Hours Block Report\n" -" " -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Hours Quantity / Amount" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Remaining hours:" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Quantity of hours bought:" -msgstr "" - -#. module: analytic_hours_block -#: help:account.hours.block,message_summary:0 -msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views." -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Quantity of hours bought" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -#: field:account.hours.block,partner_id:0 -msgid "Partner" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Quantity of hours difference" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,period_id:0 -msgid "Period" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,state:0 -msgid "State" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,message_follower_ids:0 -msgid "Followers" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Send by Email" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "All Running Hours Block" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,last_action_date:0 -msgid "Last action date" -msgstr "" - -#. module: analytic_hours_block -#: selection:account.hours.block,type:0 -msgid "Hours" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Description:" -msgstr "" - -#. module: analytic_hours_block -#: help:account.hours.block,type:0 -msgid "The block is based on the quantity of hours or on the amount." -msgstr "" - -#. module: analytic_hours_block -#: model:email.template,report_name:analytic_hours_block.email_template_hours_block -msgid "Hours_Block_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Remaining amount:" -msgstr "" - -#. module: analytic_hours_block -#: model:ir.model,name:analytic_hours_block.model_account_hours_block -msgid "account.hours.block" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,amount_hours_block:0 -msgid "Quantity / Amount bought" -msgstr "" - -#. module: analytic_hours_block -#: model:ir.actions.report.xml,name:analytic_hours_block.block_hours_report -msgid "Block Hours State" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Choose an invoice..." -msgstr "" - -#. module: analytic_hours_block -#: selection:account.hours.block,state:0 -msgid "Open" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "My invoices" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Draft Hours Blocks" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,currency_id:0 -msgid "Currency" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -#: field:account.hours.block,user_id:0 -msgid "Salesman" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Quantity of hours used" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -#: selection:account.hours.block,state:0 -msgid "Draft" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -#: model:ir.actions.act_window,name:analytic_hours_block.action_all_block_hour -msgid "Hours Blocks" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,type:0 -msgid "Type of Block" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Used" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Total Amount" -msgstr "" - -#. module: analytic_hours_block -#: selection:account.hours.block,state:0 -msgid "Paid" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Page" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,message_is_follower:0 -msgid "Is a Follower" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Date" -msgstr "" - -#. module: analytic_hours_block -#: field:account.invoice,account_hours_block_ids:0 -#: model:ir.actions.act_window,name:analytic_hours_block.act_hours_block_from_invoice -#: model:ir.ui.menu,name:analytic_hours_block.action_all_block_hour_account -msgid "Hours Block" -msgstr "" - -#. module: analytic_hours_block -#: help:account.hours.block,last_action_date:0 -msgid "Date of the last analytic line linked to the invoice related to this block hours." -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Report Date:" -msgstr "" - -#. module: analytic_hours_block -#: model:email.template,subject:analytic_hours_block.email_template_hours_block -msgid "${object.company_id.name} Hours Block (Ref ${object.number or 'n/a'})" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Invoice's related information" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Search Invoice" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Quantity" -msgstr "" - -#. module: analytic_hours_block -#: help:account.hours.block,amount_hours_block_delta:0 -msgid "Difference between bought and used. This amount is expressed in the base Unit of Measure (factor=1.0)" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "0.6cm 27.9cm 20.3cm 27.9cm" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Residual Amount" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Overdue Hours Block" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Amount used:" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,number:0 -msgid "Number" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -#: field:account.hours.block,invoice_id:0 -#: model:ir.actions.act_window,name:analytic_hours_block.act_invoice_from_hours_block -#: model:ir.model,name:analytic_hours_block.model_account_invoice -msgid "Invoice" -msgstr "" - -#. module: analytic_hours_block -#: selection:account.hours.block,state:0 -msgid "Pro-forma" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Responsible" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -#: field:account.hours.block,name:0 -msgid "Description" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Amount bought:" -msgstr "" - -#. module: analytic_hours_block -#: help:account.hours.block,amount_hours_block_done:0 -msgid "Amount done by the staff. This amount is expressed in the base Unit of Measure (factor=1.0)" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Quantity of hours used:" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Invoicing" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,amount_hours_block_done:0 -msgid "Quantity / Amount used" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,journal_id:0 -msgid "Journal" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Running" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -#: field:account.hours.block,amount_hours_block_delta:0 -msgid "Difference" -msgstr "" - -#. module: analytic_hours_block -#: model:ir.actions.act_window,name:analytic_hours_block.act_block_hour_from_partner -msgid "All blocks hours" -msgstr "" - -#. module: analytic_hours_block -#: report:account.hours.block:0 -msgid "Deduced" -msgstr "" - -#. module: analytic_hours_block -#: model:ir.actions.act_window,name:analytic_hours_block.act_analytic_lines_from_hours_block -msgid "Analytic Lines" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Invoice State" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,message_summary:0 -msgid "Summary" -msgstr "" - -#. module: analytic_hours_block -#: help:account.hours.block,message_ids:0 -msgid "Messages and communication history" -msgstr "" - -#. module: analytic_hours_block -#: view:account.hours.block:0 -msgid "Overdue" -msgstr "" - -#. module: analytic_hours_block -#: field:account.hours.block,amount_total:0 -msgid "Total" -msgstr "" - -#. module: analytic_hours_block -#: field:product.product,is_in_hours_block:0 -msgid "Accounted for hours block?" -msgstr "" - -#. module: analytic_hours_block -#: help:product.product,is_in_hours_block:0 -msgid "Specify if you want to have invoice lines containing this product to be considered for hours blocks." -msgstr "" - diff --git a/__unported__/analytic_hours_block/product.py b/__unported__/analytic_hours_block/product.py deleted file mode 100644 index 3835799a..00000000 --- a/__unported__/analytic_hours_block/product.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Matthieu Dietrich -# Copyright 2014 Camptocamp SA -# -# 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 orm, fields - - -class Product(orm.Model): - _name = "product.product" - _inherit = 'product.product' - - _columns = { - 'is_in_hours_block': fields.boolean( - 'Accounted for hours block?', - help="Specify if you want to have invoice lines " - "containing this product to be considered for hours blocks.") - } - - _defaults = { - 'is_in_hours_block': False - } diff --git a/__unported__/analytic_hours_block/product_view.xml b/__unported__/analytic_hours_block/product_view.xml deleted file mode 100644 index c43fd0b3..00000000 --- a/__unported__/analytic_hours_block/product_view.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - product.product.block.form - product.product - - -
- -
-
-
- -
-
diff --git a/__unported__/analytic_hours_block/project.py b/__unported__/analytic_hours_block/project.py deleted file mode 100644 index 8c014ca5..00000000 --- a/__unported__/analytic_hours_block/project.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -from osv import orm -from openerp.tools.translate import _ - - -class project_project(orm.Model): - _inherit = 'project.project' - - def hours_block_tree_view(self, cr, uid, ids, context): - invoice_line_obj = self.pool.get('account.invoice.line') - hours_block_obj = self.pool.get('account.hours.block') - project = self.browse(cr, uid , ids)[0] - invoice_line_ids = invoice_line_obj.search(cr, uid, [('account_analytic_id', '=', project.analytic_account_id.id)]) - invoice_lines = invoice_line_obj.browse(cr, uid, invoice_line_ids) - invoice_ids = [x.invoice_id.id for x in invoice_lines] - res_ids = hours_block_obj.search(cr, uid, [('invoice_id','in',invoice_ids)]) - domain=False - if res_ids: - domain = [('id', 'in', res_ids)] - else: - raise orm.except_orm(_('Warning'), _("No Hours Block for this project")) - - return { - 'name': _('Hours Blocks'), - 'domain': domain, - 'res_model': 'account.hours.block', - 'type': 'ir.actions.act_window', - 'view_id': False, - 'view_mode': 'tree,form', - 'view_type': 'form', - 'limit': 80, - 'res_id' : res_ids or False, - } diff --git a/__unported__/analytic_hours_block/project_view.xml b/__unported__/analytic_hours_block/project_view.xml deleted file mode 100644 index 0b503a84..00000000 --- a/__unported__/analytic_hours_block/project_view.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - project.project.form.hours.block.link - project.project - - form - - -