From f54960734fb2e92d350d503d22e8fba46c428e7e Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Sun, 14 Jul 2013 10:43:42 +0200 Subject: [PATCH] Split funcionality into new module timesheet_cost issue3258 review929002 --- INSTALL | 1 + __init__.py | 4 - locale/bg_BG.po | 80 ----------------- locale/ca_ES.po | 80 ----------------- locale/cs_CZ.po | 80 ----------------- locale/de_DE.po | 82 ----------------- locale/es_AR.po | 80 ----------------- locale/es_CO.po | 80 ----------------- locale/es_ES.po | 80 ----------------- locale/fr_FR.po | 80 ----------------- locale/nl_NL.po | 87 ------------------- locale/ru_RU.po | 80 ----------------- service.py | 140 ------------------------------ service.xml | 25 ------ tests/test_project_revenue.py | 47 +--------- tryton.cfg | 2 +- view/employee_cost_price_form.xml | 11 --- view/employee_cost_price_tree.xml | 7 -- view/employee_form.xml | 11 --- work.py | 21 +---- 20 files changed, 4 insertions(+), 1074 deletions(-) delete mode 100644 service.py delete mode 100644 service.xml delete mode 100644 view/employee_cost_price_form.xml delete mode 100644 view/employee_cost_price_tree.xml delete mode 100644 view/employee_form.xml diff --git a/INSTALL b/INSTALL index 0b61f09bec..f9df19bfbd 100644 --- a/INSTALL +++ b/INSTALL @@ -8,6 +8,7 @@ Prerequisites * trytond (http://www.tryton.org/) * trytond_project (http://www.tryton.org/) * trytond_timesheet (http://www.tryton.org/) + * trytond_timesheet_cost (http://www.tryton.org/) * trytond_company (http://www.tryton.org/) * trytond_product (http://www.tryton.org/) diff --git a/__init__.py b/__init__.py index ec6eaf44cb..587601fd96 100644 --- a/__init__.py +++ b/__init__.py @@ -2,14 +2,10 @@ #this repository contains the full copyright notices and license terms. from trytond.pool import Pool -from .service import * from .work import * def register(): Pool.register( - Employee, - EmployeeCostPrice, - TimesheetLine, Work, module='project_revenue', type_='model') diff --git a/locale/bg_BG.po b/locale/bg_BG.po index d2818a59a2..27cdbeb2a2 100644 --- a/locale/bg_BG.po +++ b/locale/bg_BG.po @@ -2,62 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "error:company.employee_cost_price:" -msgid "A employee can only have one cost price by date." -msgstr "" - -msgctxt "field:company.employee,cost_price:" -msgid "Cost Price" -msgstr "Фабрична цена" - -msgctxt "field:company.employee,cost_prices:" -msgid "Cost Prices" -msgstr "Себестойност" - -msgctxt "field:company.employee,currency_digits:" -msgid "Currency Digits" -msgstr "Цифри за валута" - -msgctxt "field:company.employee_cost_price,cost_price:" -msgid "Cost Price" -msgstr "Фабрична цена" - -msgctxt "field:company.employee_cost_price,create_date:" -msgid "Create Date" -msgstr "Създадено на" - -msgctxt "field:company.employee_cost_price,create_uid:" -msgid "Create User" -msgstr "Създадено от" - -msgctxt "field:company.employee_cost_price,currency_digits:" -msgid "Currency Digits" -msgstr "Цифри за валута" - -msgctxt "field:company.employee_cost_price,date:" -msgid "Date" -msgstr "Дата" - -msgctxt "field:company.employee_cost_price,employee:" -msgid "Employee" -msgstr "Служител" - -msgctxt "field:company.employee_cost_price,id:" -msgid "ID" -msgstr "ID" - -msgctxt "field:company.employee_cost_price,rec_name:" -msgid "Name" -msgstr "Име" - -msgctxt "field:company.employee_cost_price,write_date:" -msgid "Write Date" -msgstr "Променено на" - -msgctxt "field:company.employee_cost_price,write_uid:" -msgid "Write User" -msgstr "Променено от" - msgctxt "field:project.work,cost:" msgid "Cost" msgstr "Разход" @@ -78,30 +22,6 @@ msgctxt "field:project.work,revenue:" msgid "Revenue" msgstr "Приход" -msgctxt "help:company.employee,cost_price:" -msgid "Hourly cost price for this Employee" -msgstr "Себестойност за час за този служител" - -msgctxt "help:company.employee,cost_prices:" -msgid "List of hourly cost price over time" -msgstr "Списък на себестойност за час през времето" - -msgctxt "help:company.employee_cost_price,cost_price:" -msgid "Hourly cost price" -msgstr "Себестойност за час" - -msgctxt "model:company.employee_cost_price,name:" -msgid "Employee Cost Price" -msgstr "Себестойност на клиент" - -msgctxt "view:company.employee:" -msgid "Cost" -msgstr "Разход" - -msgctxt "view:company.employee_cost_price:" -msgid "Cost Prices" -msgstr "Себестойност" - msgctxt "view:project.work:" msgid "Cost" msgstr "Разход" diff --git a/locale/ca_ES.po b/locale/ca_ES.po index ee83412c28..5264e89cec 100644 --- a/locale/ca_ES.po +++ b/locale/ca_ES.po @@ -2,62 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "error:company.employee_cost_price:" -msgid "A employee can only have one cost price by date." -msgstr "Un empleat només pot tenir un preu de cost per data." - -msgctxt "field:company.employee,cost_price:" -msgid "Cost Price" -msgstr "Preu de cost" - -msgctxt "field:company.employee,cost_prices:" -msgid "Cost Prices" -msgstr "Preus de cost" - -msgctxt "field:company.employee,currency_digits:" -msgid "Currency Digits" -msgstr "Decimals de la moneda" - -msgctxt "field:company.employee_cost_price,cost_price:" -msgid "Cost Price" -msgstr "Preu de cost" - -msgctxt "field:company.employee_cost_price,create_date:" -msgid "Create Date" -msgstr "Data creació" - -msgctxt "field:company.employee_cost_price,create_uid:" -msgid "Create User" -msgstr "Usuari creació" - -msgctxt "field:company.employee_cost_price,currency_digits:" -msgid "Currency Digits" -msgstr "Decimals de la moneda" - -msgctxt "field:company.employee_cost_price,date:" -msgid "Date" -msgstr "Data" - -msgctxt "field:company.employee_cost_price,employee:" -msgid "Employee" -msgstr "Empleat" - -msgctxt "field:company.employee_cost_price,id:" -msgid "ID" -msgstr "ID" - -msgctxt "field:company.employee_cost_price,rec_name:" -msgid "Name" -msgstr "Nom" - -msgctxt "field:company.employee_cost_price,write_date:" -msgid "Write Date" -msgstr "Data modificació" - -msgctxt "field:company.employee_cost_price,write_uid:" -msgid "Write User" -msgstr "Usuari modificació" - msgctxt "field:project.work,cost:" msgid "Cost" msgstr "Cost" @@ -78,30 +22,6 @@ msgctxt "field:project.work,revenue:" msgid "Revenue" msgstr "Benefici" -msgctxt "help:company.employee,cost_price:" -msgid "Hourly cost price for this Employee" -msgstr "Preu de cost per hora per a aquest empleat" - -msgctxt "help:company.employee,cost_prices:" -msgid "List of hourly cost price over time" -msgstr "Llista de preu de cost per hora a través del temps" - -msgctxt "help:company.employee_cost_price,cost_price:" -msgid "Hourly cost price" -msgstr "Preu de cost per hora" - -msgctxt "model:company.employee_cost_price,name:" -msgid "Employee Cost Price" -msgstr "Preu de cost de l'empleat" - -msgctxt "view:company.employee:" -msgid "Cost" -msgstr "Cost" - -msgctxt "view:company.employee_cost_price:" -msgid "Cost Prices" -msgstr "Preus de cost" - msgctxt "view:project.work:" msgid "Cost" msgstr "Cost" diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po index 69b56c62a7..bfce1c1fa6 100644 --- a/locale/cs_CZ.po +++ b/locale/cs_CZ.po @@ -2,62 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "error:company.employee_cost_price:" -msgid "A employee can only have one cost price by date." -msgstr "" - -msgctxt "field:company.employee,cost_price:" -msgid "Cost Price" -msgstr "" - -msgctxt "field:company.employee,cost_prices:" -msgid "Cost Prices" -msgstr "" - -msgctxt "field:company.employee,currency_digits:" -msgid "Currency Digits" -msgstr "" - -msgctxt "field:company.employee_cost_price,cost_price:" -msgid "Cost Price" -msgstr "" - -msgctxt "field:company.employee_cost_price,create_date:" -msgid "Create Date" -msgstr "" - -msgctxt "field:company.employee_cost_price,create_uid:" -msgid "Create User" -msgstr "" - -msgctxt "field:company.employee_cost_price,currency_digits:" -msgid "Currency Digits" -msgstr "" - -msgctxt "field:company.employee_cost_price,date:" -msgid "Date" -msgstr "" - -msgctxt "field:company.employee_cost_price,employee:" -msgid "Employee" -msgstr "" - -msgctxt "field:company.employee_cost_price,id:" -msgid "ID" -msgstr "" - -msgctxt "field:company.employee_cost_price,rec_name:" -msgid "Name" -msgstr "" - -msgctxt "field:company.employee_cost_price,write_date:" -msgid "Write Date" -msgstr "" - -msgctxt "field:company.employee_cost_price,write_uid:" -msgid "Write User" -msgstr "" - msgctxt "field:project.work,cost:" msgid "Cost" msgstr "" @@ -77,27 +21,3 @@ msgstr "" msgctxt "field:project.work,revenue:" msgid "Revenue" msgstr "" - -msgctxt "help:company.employee,cost_price:" -msgid "Hourly cost price for this Employee" -msgstr "" - -msgctxt "help:company.employee,cost_prices:" -msgid "List of hourly cost price over time" -msgstr "" - -msgctxt "help:company.employee_cost_price,cost_price:" -msgid "Hourly cost price" -msgstr "" - -msgctxt "model:company.employee_cost_price,name:" -msgid "Employee Cost Price" -msgstr "" - -msgctxt "view:company.employee:" -msgid "Cost" -msgstr "" - -msgctxt "view:company.employee_cost_price:" -msgid "Cost Prices" -msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 1d38158dfe..4227c32553 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -2,64 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "error:company.employee_cost_price:" -msgid "A employee can only have one cost price by date." -msgstr "" -"Es kann nur ein Kostenpreis pro Datum für einen Mitarbeiter eingetragen " -"werden." - -msgctxt "field:company.employee,cost_price:" -msgid "Cost Price" -msgstr "Kostenpreis" - -msgctxt "field:company.employee,cost_prices:" -msgid "Cost Prices" -msgstr "Kostenpreise" - -msgctxt "field:company.employee,currency_digits:" -msgid "Currency Digits" -msgstr "Währung (signifikante Stellen)" - -msgctxt "field:company.employee_cost_price,cost_price:" -msgid "Cost Price" -msgstr "Einkaufspreis" - -msgctxt "field:company.employee_cost_price,create_date:" -msgid "Create Date" -msgstr "Erstellungsdatum" - -msgctxt "field:company.employee_cost_price,create_uid:" -msgid "Create User" -msgstr "Erstellt durch" - -msgctxt "field:company.employee_cost_price,currency_digits:" -msgid "Currency Digits" -msgstr "Währung (signifikante Stellen)" - -msgctxt "field:company.employee_cost_price,date:" -msgid "Date" -msgstr "Datum" - -msgctxt "field:company.employee_cost_price,employee:" -msgid "Employee" -msgstr "Mitarbeiter" - -msgctxt "field:company.employee_cost_price,id:" -msgid "ID" -msgstr "ID" - -msgctxt "field:company.employee_cost_price,rec_name:" -msgid "Name" -msgstr "Name" - -msgctxt "field:company.employee_cost_price,write_date:" -msgid "Write Date" -msgstr "Zuletzt geändert" - -msgctxt "field:company.employee_cost_price,write_uid:" -msgid "Write User" -msgstr "Letzte Änderung durch" - msgctxt "field:project.work,cost:" msgid "Cost" msgstr "Kosten" @@ -80,30 +22,6 @@ msgctxt "field:project.work,revenue:" msgid "Revenue" msgstr "Ertrag" -msgctxt "help:company.employee,cost_price:" -msgid "Hourly cost price for this Employee" -msgstr "Kostenpreis pro Stunde für diesen Mitarbeiter" - -msgctxt "help:company.employee,cost_prices:" -msgid "List of hourly cost price over time" -msgstr "Liste der Kostenpreise pro Stunde über die Zeit" - -msgctxt "help:company.employee_cost_price,cost_price:" -msgid "Hourly cost price" -msgstr "Kostenpreis pro Stunde" - -msgctxt "model:company.employee_cost_price,name:" -msgid "Employee Cost Price" -msgstr "Mitarbeiter Kostenpreis" - -msgctxt "view:company.employee:" -msgid "Cost" -msgstr "Kosten" - -msgctxt "view:company.employee_cost_price:" -msgid "Cost Prices" -msgstr "Kostenpreise" - msgctxt "view:project.work:" msgid "Cost" msgstr "Kosten" diff --git a/locale/es_AR.po b/locale/es_AR.po index 47ecc1f47d..6a819b5c20 100644 --- a/locale/es_AR.po +++ b/locale/es_AR.po @@ -2,62 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "error:company.employee_cost_price:" -msgid "A employee can only have one cost price by date." -msgstr "Un empleado sólo puede disponer de un precio de costo por fecha." - -msgctxt "field:company.employee,cost_price:" -msgid "Cost Price" -msgstr "Precio de costo" - -msgctxt "field:company.employee,cost_prices:" -msgid "Cost Prices" -msgstr "Precios de costo" - -msgctxt "field:company.employee,currency_digits:" -msgid "Currency Digits" -msgstr "Dígitos de divisa" - -msgctxt "field:company.employee_cost_price,cost_price:" -msgid "Cost Price" -msgstr "Precio de costo" - -msgctxt "field:company.employee_cost_price,create_date:" -msgid "Create Date" -msgstr "Fecha creación" - -msgctxt "field:company.employee_cost_price,create_uid:" -msgid "Create User" -msgstr "Usuario creación" - -msgctxt "field:company.employee_cost_price,currency_digits:" -msgid "Currency Digits" -msgstr "Dígitos de divisa" - -msgctxt "field:company.employee_cost_price,date:" -msgid "Date" -msgstr "Fecha" - -msgctxt "field:company.employee_cost_price,employee:" -msgid "Employee" -msgstr "Empleado" - -msgctxt "field:company.employee_cost_price,id:" -msgid "ID" -msgstr "ID" - -msgctxt "field:company.employee_cost_price,rec_name:" -msgid "Name" -msgstr "Nombre" - -msgctxt "field:company.employee_cost_price,write_date:" -msgid "Write Date" -msgstr "Fecha modificación" - -msgctxt "field:company.employee_cost_price,write_uid:" -msgid "Write User" -msgstr "Usuario modificación" - msgctxt "field:project.work,cost:" msgid "Cost" msgstr "Costo" @@ -78,30 +22,6 @@ msgctxt "field:project.work,revenue:" msgid "Revenue" msgstr "Ingresos" -msgctxt "help:company.employee,cost_price:" -msgid "Hourly cost price for this Employee" -msgstr "Precio de costo por hora para este empleado" - -msgctxt "help:company.employee,cost_prices:" -msgid "List of hourly cost price over time" -msgstr "Lista de precio de costo por hora a lo largo del tiempo" - -msgctxt "help:company.employee_cost_price,cost_price:" -msgid "Hourly cost price" -msgstr "Precio de costo por hora" - -msgctxt "model:company.employee_cost_price,name:" -msgid "Employee Cost Price" -msgstr "Precio de costo del empleado" - -msgctxt "view:company.employee:" -msgid "Cost" -msgstr "Costo" - -msgctxt "view:company.employee_cost_price:" -msgid "Cost Prices" -msgstr "Precios de costo" - msgctxt "view:project.work:" msgid "Cost" msgstr "Costo" diff --git a/locale/es_CO.po b/locale/es_CO.po index a7047eb212..f0912df7f7 100644 --- a/locale/es_CO.po +++ b/locale/es_CO.po @@ -2,62 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "error:company.employee_cost_price:" -msgid "A employee can only have one cost price by date." -msgstr "" - -msgctxt "field:company.employee,cost_price:" -msgid "Cost Price" -msgstr "Precio de Costo" - -msgctxt "field:company.employee,cost_prices:" -msgid "Cost Prices" -msgstr "Precios de Costo" - -msgctxt "field:company.employee,currency_digits:" -msgid "Currency Digits" -msgstr "Gestión de Moneda" - -msgctxt "field:company.employee_cost_price,cost_price:" -msgid "Cost Price" -msgstr "Precio de Costo" - -msgctxt "field:company.employee_cost_price,create_date:" -msgid "Create Date" -msgstr "Fecha de Creación" - -msgctxt "field:company.employee_cost_price,create_uid:" -msgid "Create User" -msgstr "Creado por Usuario" - -msgctxt "field:company.employee_cost_price,currency_digits:" -msgid "Currency Digits" -msgstr "Decimales de Moneda" - -msgctxt "field:company.employee_cost_price,date:" -msgid "Date" -msgstr "Fecha" - -msgctxt "field:company.employee_cost_price,employee:" -msgid "Employee" -msgstr "Empleado" - -msgctxt "field:company.employee_cost_price,id:" -msgid "ID" -msgstr "ID" - -msgctxt "field:company.employee_cost_price,rec_name:" -msgid "Name" -msgstr "Nombre de Contacto" - -msgctxt "field:company.employee_cost_price,write_date:" -msgid "Write Date" -msgstr "Fecha de Modificación" - -msgctxt "field:company.employee_cost_price,write_uid:" -msgid "Write User" -msgstr "Modificado por Usuario" - msgctxt "field:project.work,cost:" msgid "Cost" msgstr "Costo" @@ -78,30 +22,6 @@ msgctxt "field:project.work,revenue:" msgid "Revenue" msgstr "Ingresos" -msgctxt "help:company.employee,cost_price:" -msgid "Hourly cost price for this Employee" -msgstr "Costo por hora del empleado" - -msgctxt "help:company.employee,cost_prices:" -msgid "List of hourly cost price over time" -msgstr "Lista de costo por hora de tiempo extra" - -msgctxt "help:company.employee_cost_price,cost_price:" -msgid "Hourly cost price" -msgstr "Costo por hora" - -msgctxt "model:company.employee_cost_price,name:" -msgid "Employee Cost Price" -msgstr "Costo por Empleado" - -msgctxt "view:company.employee:" -msgid "Cost" -msgstr "Costo" - -msgctxt "view:company.employee_cost_price:" -msgid "Cost Prices" -msgstr "Precio de Costo" - msgctxt "view:project.work:" msgid "Cost" msgstr "Costo" diff --git a/locale/es_ES.po b/locale/es_ES.po index a866d37cde..e2e2fa1485 100644 --- a/locale/es_ES.po +++ b/locale/es_ES.po @@ -2,62 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "error:company.employee_cost_price:" -msgid "A employee can only have one cost price by date." -msgstr "Un empleado sólo puede disponer de un precio de coste por fecha." - -msgctxt "field:company.employee,cost_price:" -msgid "Cost Price" -msgstr "Precio de coste" - -msgctxt "field:company.employee,cost_prices:" -msgid "Cost Prices" -msgstr "Precios de coste" - -msgctxt "field:company.employee,currency_digits:" -msgid "Currency Digits" -msgstr "Decimales de la moneda" - -msgctxt "field:company.employee_cost_price,cost_price:" -msgid "Cost Price" -msgstr "Precio de coste" - -msgctxt "field:company.employee_cost_price,create_date:" -msgid "Create Date" -msgstr "Fecha creación" - -msgctxt "field:company.employee_cost_price,create_uid:" -msgid "Create User" -msgstr "Usuario creación" - -msgctxt "field:company.employee_cost_price,currency_digits:" -msgid "Currency Digits" -msgstr "Decimales de la moneda" - -msgctxt "field:company.employee_cost_price,date:" -msgid "Date" -msgstr "Fecha" - -msgctxt "field:company.employee_cost_price,employee:" -msgid "Employee" -msgstr "Empleado" - -msgctxt "field:company.employee_cost_price,id:" -msgid "ID" -msgstr "ID" - -msgctxt "field:company.employee_cost_price,rec_name:" -msgid "Name" -msgstr "Nombre" - -msgctxt "field:company.employee_cost_price,write_date:" -msgid "Write Date" -msgstr "Fecha modificación" - -msgctxt "field:company.employee_cost_price,write_uid:" -msgid "Write User" -msgstr "Usuario modificación" - msgctxt "field:project.work,cost:" msgid "Cost" msgstr "Coste" @@ -78,30 +22,6 @@ msgctxt "field:project.work,revenue:" msgid "Revenue" msgstr "Ingresos" -msgctxt "help:company.employee,cost_price:" -msgid "Hourly cost price for this Employee" -msgstr "Precio de coste por hora para este empleado." - -msgctxt "help:company.employee,cost_prices:" -msgid "List of hourly cost price over time" -msgstr "Lista de precio de coste por hora a lo largo del tiempo." - -msgctxt "help:company.employee_cost_price,cost_price:" -msgid "Hourly cost price" -msgstr "Precio de coste por hora." - -msgctxt "model:company.employee_cost_price,name:" -msgid "Employee Cost Price" -msgstr "Precio de coste del empleado" - -msgctxt "view:company.employee:" -msgid "Cost" -msgstr "Coste" - -msgctxt "view:company.employee_cost_price:" -msgid "Cost Prices" -msgstr "Precios de coste" - msgctxt "view:project.work:" msgid "Cost" msgstr "Coste" diff --git a/locale/fr_FR.po b/locale/fr_FR.po index ca5ff9dedd..7e1da76bbc 100644 --- a/locale/fr_FR.po +++ b/locale/fr_FR.po @@ -2,62 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "error:company.employee_cost_price:" -msgid "A employee can only have one cost price by date." -msgstr "Un employé ne peut avoir qu'un seul prix de revient par date." - -msgctxt "field:company.employee,cost_price:" -msgid "Cost Price" -msgstr "Prix de Revient" - -msgctxt "field:company.employee,cost_prices:" -msgid "Cost Prices" -msgstr "Prix de revient" - -msgctxt "field:company.employee,currency_digits:" -msgid "Currency Digits" -msgstr "Décimales de la devise" - -msgctxt "field:company.employee_cost_price,cost_price:" -msgid "Cost Price" -msgstr "Prix de Revient" - -msgctxt "field:company.employee_cost_price,create_date:" -msgid "Create Date" -msgstr "Date de création" - -msgctxt "field:company.employee_cost_price,create_uid:" -msgid "Create User" -msgstr "Créé par" - -msgctxt "field:company.employee_cost_price,currency_digits:" -msgid "Currency Digits" -msgstr "Décimales de la devise" - -msgctxt "field:company.employee_cost_price,date:" -msgid "Date" -msgstr "Date" - -msgctxt "field:company.employee_cost_price,employee:" -msgid "Employee" -msgstr "Employé" - -msgctxt "field:company.employee_cost_price,id:" -msgid "ID" -msgstr "ID" - -msgctxt "field:company.employee_cost_price,rec_name:" -msgid "Name" -msgstr "Nom" - -msgctxt "field:company.employee_cost_price,write_date:" -msgid "Write Date" -msgstr "Date de mise à jour" - -msgctxt "field:company.employee_cost_price,write_uid:" -msgid "Write User" -msgstr "Mis à jour par" - msgctxt "field:project.work,cost:" msgid "Cost" msgstr "Coût" @@ -78,30 +22,6 @@ msgctxt "field:project.work,revenue:" msgid "Revenue" msgstr "Revenu" -msgctxt "help:company.employee,cost_price:" -msgid "Hourly cost price for this Employee" -msgstr "Prix de revient horaire de cet employé" - -msgctxt "help:company.employee,cost_prices:" -msgid "List of hourly cost price over time" -msgstr "Liste du prix de revient horaire au cours du temps" - -msgctxt "help:company.employee_cost_price,cost_price:" -msgid "Hourly cost price" -msgstr "Prix de revient horaire" - -msgctxt "model:company.employee_cost_price,name:" -msgid "Employee Cost Price" -msgstr "Prix de revient de l'employé" - -msgctxt "view:company.employee:" -msgid "Cost" -msgstr "Coût" - -msgctxt "view:company.employee_cost_price:" -msgid "Cost Prices" -msgstr "Prix de revient" - msgctxt "view:project.work:" msgid "Cost" msgstr "Coût" diff --git a/locale/nl_NL.po b/locale/nl_NL.po index 65a3bc77e6..ff670b0db5 100644 --- a/locale/nl_NL.po +++ b/locale/nl_NL.po @@ -2,69 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "error:company.employee_cost_price:" -msgid "A employee can only have one cost price by date." -msgstr "" - -#, fuzzy -msgctxt "field:company.employee,cost_price:" -msgid "Cost Price" -msgstr "Kostprijs" - -msgctxt "field:company.employee,cost_prices:" -msgid "Cost Prices" -msgstr "" - -#, fuzzy -msgctxt "field:company.employee,currency_digits:" -msgid "Currency Digits" -msgstr "Valuta decimalen" - -#, fuzzy -msgctxt "field:company.employee_cost_price,cost_price:" -msgid "Cost Price" -msgstr "Kostprijs" - -msgctxt "field:company.employee_cost_price,create_date:" -msgid "Create Date" -msgstr "" - -msgctxt "field:company.employee_cost_price,create_uid:" -msgid "Create User" -msgstr "" - -#, fuzzy -msgctxt "field:company.employee_cost_price,currency_digits:" -msgid "Currency Digits" -msgstr "Valuta decimalen" - -#, fuzzy -msgctxt "field:company.employee_cost_price,date:" -msgid "Date" -msgstr "Vervaldatum" - -#, fuzzy -msgctxt "field:company.employee_cost_price,employee:" -msgid "Employee" -msgstr "Werknemer" - -msgctxt "field:company.employee_cost_price,id:" -msgid "ID" -msgstr "" - -#, fuzzy -msgctxt "field:company.employee_cost_price,rec_name:" -msgid "Name" -msgstr "Naam bijlage" - -msgctxt "field:company.employee_cost_price,write_date:" -msgid "Write Date" -msgstr "" - -msgctxt "field:company.employee_cost_price,write_uid:" -msgid "Write User" -msgstr "" - msgctxt "field:project.work,cost:" msgid "Cost" msgstr "" @@ -88,27 +25,3 @@ msgstr "Producten" msgctxt "field:project.work,revenue:" msgid "Revenue" msgstr "Opbrengst" - -msgctxt "help:company.employee,cost_price:" -msgid "Hourly cost price for this Employee" -msgstr "" - -msgctxt "help:company.employee,cost_prices:" -msgid "List of hourly cost price over time" -msgstr "" - -msgctxt "help:company.employee_cost_price,cost_price:" -msgid "Hourly cost price" -msgstr "" - -msgctxt "model:company.employee_cost_price,name:" -msgid "Employee Cost Price" -msgstr "" - -msgctxt "view:company.employee:" -msgid "Cost" -msgstr "" - -msgctxt "view:company.employee_cost_price:" -msgid "Cost Prices" -msgstr "" diff --git a/locale/ru_RU.po b/locale/ru_RU.po index 4470de98a7..37adc4fd53 100644 --- a/locale/ru_RU.po +++ b/locale/ru_RU.po @@ -2,62 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "error:company.employee_cost_price:" -msgid "A employee can only have one cost price by date." -msgstr "У сотрудника может быть только одна себестоимость за день." - -msgctxt "field:company.employee,cost_price:" -msgid "Cost Price" -msgstr "Себестоимость" - -msgctxt "field:company.employee,cost_prices:" -msgid "Cost Prices" -msgstr "Себестоимость" - -msgctxt "field:company.employee,currency_digits:" -msgid "Currency Digits" -msgstr "Кол-во цифр валюты" - -msgctxt "field:company.employee_cost_price,cost_price:" -msgid "Cost Price" -msgstr "Себестоимость" - -msgctxt "field:company.employee_cost_price,create_date:" -msgid "Create Date" -msgstr "Дата создания" - -msgctxt "field:company.employee_cost_price,create_uid:" -msgid "Create User" -msgstr "Создано пользователем" - -msgctxt "field:company.employee_cost_price,currency_digits:" -msgid "Currency Digits" -msgstr "Кол-во цифр валюты" - -msgctxt "field:company.employee_cost_price,date:" -msgid "Date" -msgstr "Дата" - -msgctxt "field:company.employee_cost_price,employee:" -msgid "Employee" -msgstr "Сотрудник" - -msgctxt "field:company.employee_cost_price,id:" -msgid "ID" -msgstr "ID" - -msgctxt "field:company.employee_cost_price,rec_name:" -msgid "Name" -msgstr "Наименование" - -msgctxt "field:company.employee_cost_price,write_date:" -msgid "Write Date" -msgstr "Дата изменения" - -msgctxt "field:company.employee_cost_price,write_uid:" -msgid "Write User" -msgstr "Изменено пользователем" - msgctxt "field:project.work,cost:" msgid "Cost" msgstr "Стоимость" @@ -77,27 +21,3 @@ msgstr "Продукт" msgctxt "field:project.work,revenue:" msgid "Revenue" msgstr "Доходы" - -msgctxt "help:company.employee,cost_price:" -msgid "Hourly cost price for this Employee" -msgstr "Часовая себестоимость для этого сотрудника" - -msgctxt "help:company.employee,cost_prices:" -msgid "List of hourly cost price over time" -msgstr "Список часовой себестоимости по времени" - -msgctxt "help:company.employee_cost_price,cost_price:" -msgid "Hourly cost price" -msgstr "Часовая себестоимость" - -msgctxt "model:company.employee_cost_price,name:" -msgid "Employee Cost Price" -msgstr "Себестоимость сотрудника" - -msgctxt "view:company.employee:" -msgid "Cost" -msgstr "Стоимость" - -msgctxt "view:company.employee_cost_price:" -msgid "Cost Prices" -msgstr "Себестоимость" diff --git a/service.py b/service.py deleted file mode 100644 index 8a80468359..0000000000 --- a/service.py +++ /dev/null @@ -1,140 +0,0 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. -from decimal import Decimal -from trytond.model import ModelView, ModelSQL, fields -from trytond.pyson import Eval -from trytond.cache import Cache -from trytond.transaction import Transaction -from trytond.pool import Pool, PoolMeta - -__all__ = ['Employee', 'EmployeeCostPrice'] -__metaclass__ = PoolMeta - - -class Employee: - __name__ = 'company.employee' - cost_price = fields.Function(fields.Numeric('Cost Price', - digits=(16, Eval('currency_digits', 2)), depends=['currency_digits'], - help="Hourly cost price for this Employee"), 'get_cost_price') - cost_prices = fields.One2Many('company.employee_cost_price', 'employee', - 'Cost Prices', help="List of hourly cost price over time") - currency_digits = fields.Function(fields.Integer('Currency Digits', - on_change_with=['company']), 'on_change_with_currency_digits') - _cost_prices_cache = Cache('company_employee.cost_prices') - - def get_cost_price(self, name): - ''' - Return the cost price at the date given in the context or the - current date - ''' - ctx_date = Transaction().context.get('date', None) - return self.compute_cost_price(ctx_date) - - def compute_cost_price(self, date=None): - pool = Pool() - Date = pool.get('ir.date') - CostPrice = pool.get('company.employee_cost_price') - - # Get from cache employee costs or fetch them from the db - employee_costs = self._cost_prices_cache.get(self.id) - if employee_costs is None: - cost_prices = CostPrice.search([ - ('employee', '=', self.id), - ], order=[('date', 'ASC')]) - - employee_costs = [] - for cost_price in cost_prices: - employee_costs.append( - (cost_price.date, cost_price.cost_price)) - self._cost_prices_cache.set(self.id, employee_costs) - - if date is None: - date = Date.today() - # compute the cost price for the given date - cost = 0 - if employee_costs and date >= employee_costs[0][0]: - for edate, ecost in employee_costs: - if date >= edate: - cost = ecost - else: - break - return cost - - def on_change_with_currency_digits(self, name=None): - if self.company: - return self.company.currency.digits - return 2 - - @staticmethod - def default_currency_digits(): - Company = Pool().get('company.company') - company = Transaction().context.get('company') - if company: - company = Company(company) - return company.currency.digits - return 2 - - -class EmployeeCostPrice(ModelSQL, ModelView): - 'Employee Cost Price' - __name__ = 'company.employee_cost_price' - _rec_name = 'date' - date = fields.Date('Date', required=True, select=True) - cost_price = fields.Numeric('Cost Price', - digits=(16, Eval('currency_digits', 2)), - required=True, depends=['currency_digits'], - help="Hourly cost price") - employee = fields.Many2One('company.employee', 'Employee') - currency_digits = fields.Function(fields.Integer('Currency Digits', - on_change_with=['employee']), 'on_change_with_currency_digits') - - @classmethod - def __setup__(cls): - super(EmployeeCostPrice, cls).__setup__() - cls._sql_constraints = [ - ('date_cost_price_uniq', 'UNIQUE(date, cost_price)', - 'A employee can only have one cost price by date.'), - ] - cls._order.insert(0, ('date', 'DESC')) - - @staticmethod - def default_cost_price(): - return Decimal(0) - - @staticmethod - def default_date(): - Date = Pool().get('ir.date') - return Date.today() - - @classmethod - def delete(cls, prices): - Employee = Pool().get('company.employee') - super(EmployeeCostPrice, cls).delete(prices) - Employee._cost_prices_cache.clear() - - @classmethod - def create(cls, vlist): - Employee = Pool().get('company.employee') - prices = super(EmployeeCostPrice, cls).create(vlist) - Employee._cost_prices_cache.clear() - return prices - - @classmethod - def write(cls, prices, vals): - Employee = Pool().get('company.employee') - super(EmployeeCostPrice, cls).write(prices, vals) - Employee._cost_prices_cache.clear() - - def on_change_with_currency_digits(self, name=None): - if self.employee: - return self.employee.company.currency.digits - return 2 - - @staticmethod - def default_currency_digits(): - Company = Pool().get('company.company') - company = Transaction().context.get('company') - if company: - company = Company(company) - return company.currency.digits - return 2 diff --git a/service.xml b/service.xml deleted file mode 100644 index 375e04f456..0000000000 --- a/service.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - company.employee_cost_price - form - employee_cost_price_form - - - - company.employee_cost_price - tree - employee_cost_price_tree - - - - - company.employee - - employee_form - - - diff --git a/tests/test_project_revenue.py b/tests/test_project_revenue.py index f29ad77c1f..94cdec1bc8 100644 --- a/tests/test_project_revenue.py +++ b/tests/test_project_revenue.py @@ -10,13 +10,9 @@ if os.path.isdir(DIR): sys.path.insert(0, os.path.dirname(DIR)) import unittest -import datetime -from decimal import Decimal import trytond.tests.test_tryton -from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view,\ - test_depends -from trytond.transaction import Transaction +from trytond.tests.test_tryton import test_view, test_depends class ProjectRevenueTestCase(unittest.TestCase): @@ -26,10 +22,6 @@ class ProjectRevenueTestCase(unittest.TestCase): def setUp(self): trytond.tests.test_tryton.install_module('project_revenue') - self.party = POOL.get('party.party') - self.employee = POOL.get('company.employee') - self.employee_cost_price = POOL.get('company.employee_cost_price') - self.company = POOL.get('company.company') def test0005views(self): ''' @@ -43,46 +35,9 @@ class ProjectRevenueTestCase(unittest.TestCase): ''' test_depends() - def test0010compute_cost_price(self): - ''' - Test compute_cost_price - ''' - cost_prices = [ - (datetime.date(2011, 1, 1), Decimal(10)), - (datetime.date(2012, 1, 1), Decimal(15)), - (datetime.date(2013, 1, 1), Decimal(20)), - ] - test_prices = [ - (datetime.date(2010, 1, 1), 0), - (datetime.date(2011, 1, 1), Decimal(10)), - (datetime.date(2011, 6, 1), Decimal(10)), - (datetime.date(2012, 1, 1), Decimal(15)), - (datetime.date(2012, 6, 1), Decimal(15)), - (datetime.date(2013, 1, 1), Decimal(20)), - (datetime.date(2013, 6, 1), Decimal(20)), - ] - with Transaction().start(DB_NAME, USER, context=CONTEXT): - company, = self.company.search([('rec_name', '=', 'B2CK')]) - party = self.party(name='Pam Beesly') - party.save() - employee = self.employee(party=party.id, - company=company) - employee.save() - for date, cost_price in cost_prices: - self.employee_cost_price( - employee=employee, - date=date, - cost_price=cost_price).save() - for date, cost_price in test_prices: - self.assertEqual(employee.compute_cost_price(date), cost_price) - def suite(): suite = trytond.tests.test_tryton.suite() - from trytond.modules.company.tests import test_company - for test in test_company.suite(): - if test not in suite: - suite.addTest(test) suite.addTests(unittest.TestLoader().loadTestsFromTestCase( ProjectRevenueTestCase)) return suite diff --git a/tryton.cfg b/tryton.cfg index 13845c1da8..d19311a5c2 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -4,8 +4,8 @@ depends: ir project timesheet + timesheet_cost company product xml: - service.xml work.xml diff --git a/view/employee_cost_price_form.xml b/view/employee_cost_price_form.xml deleted file mode 100644 index 7d670c90bf..0000000000 --- a/view/employee_cost_price_form.xml +++ /dev/null @@ -1,11 +0,0 @@ - - -
-