Split funcionality into new module timesheet_cost

issue3258
review929002
This commit is contained in:
Sergi Almacellas Abellana committed 2013-07-14 10:43:42 +02:00
1 parent 5f9059f7d9
commit f54960734f
20 files changed
+4 -1074

No files matched your search

+1
View File
@@ -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/)
-4
View File
@@ -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')
-80
View File
@@ -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 "Разход"
-80
View File
@@ -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"
-80
View File
@@ -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 ""
-82
View File
@@ -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"
-80
View File
@@ -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"
-80
View File
@@ -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"
-80
View File
@@ -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"
-80
View File
@@ -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"
-87
View File
@@ -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 ""
-80
View File
@@ -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 "Себестоимость"
-140
View File
@@ -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
-25
View File
@@ -1,25 +0,0 @@
<?xml version="1.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. -->
<tryton>
<data>
<record model="ir.ui.view" id="cost_price_view_form">
<field name="model">company.employee_cost_price</field>
<field name="type">form</field>
<field name="name">employee_cost_price_form</field>
</record>
<record model="ir.ui.view" id="cost_price_view_tree">
<field name="model">company.employee_cost_price</field>
<field name="type">tree</field>
<field name="name">employee_cost_price_tree</field>
</record>
<record model="ir.ui.view" id="employee_view_form">
<field name="model">company.employee</field>
<field name="inherit" ref="company.employee_view_form"/>
<field name="name">employee_form</field>
</record>
</data>
</tryton>
+1 -46
View File
@@ -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
+1 -1
View File
@@ -4,8 +4,8 @@ depends:
ir
project
timesheet
timesheet_cost
company
product
xml:
service.xml
work.xml
-11
View File
@@ -1,11 +0,0 @@
<?xml version="1.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. -->
<form string="Cost Prices">
<label name="date"/>
<field name="date"/>
<label name="cost_price"/>
<field name="cost_price"/>
<label name="employee"/>
<field name="employee"/>
</form>
-7
View File
@@ -1,7 +0,0 @@
<?xml version="1.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. -->
<tree string="Cost Prices">
<field name="date"/>
<field name="cost_price"/>
</tree>
-11
View File
@@ -1,11 +0,0 @@
<?xml version="1.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. -->
<data>
<xpath expr="/form/field[@name='company']" position="after">
<separator string="Cost" id="cost_prices" colspan="4"/>
<label name="cost_price"/>
<field name="cost_price"/>
<field name="cost_prices" colspan="4"/>
</xpath>
</data>
+1 -20
View File
@@ -6,29 +6,10 @@ from trytond.pyson import Eval, Id
from trytond.transaction import Transaction
from trytond.pool import Pool, PoolMeta
__all__ = ['TimesheetLine', 'Work']
__all__ = ['Work']
__metaclass__ = PoolMeta
class TimesheetLine:
__name__ = 'timesheet.line'
def compute_cost(self):
Currency = Pool().get('currency.currency')
cost_price = self.employee.compute_cost_price(date=self.date)
line_company = self.employee.company
work_company = self.work.company
if (line_company != work_company and
line_company.currency != work_company.currency):
with Transaction().set_context(date=self.date):
cost_price = Currency.compute(line_company.currency,
cost_price, work_company.currency)
return Decimal(str(self.hours)) * cost_price
class Work:
__name__ = 'project.work'
product = fields.Many2One('product.product', 'Product',