[UPD] resolve conflicts with main branch and fix bug introduced in rev 10015 lp:1313622

lp bug: https://launchpad.net/bugs/1313622 fixed

bzr revid: yannick.vaucher@camptocamp.com-20140428142017-3warx1ai72cfetj1
This commit is contained in:
Yannick Vaucher 2014-04-28 16:20:17 +02:00
commit 22d1c0956f
6 changed files with 319 additions and 35 deletions

View File

@ -0,0 +1,62 @@
# Slovak translation for openobject-addons
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-06-07 19:36+0000\n"
"PO-Revision-Date: 2014-04-26 16:04+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Slovak <sk@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-27 06:18+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_product_category
msgid "Product Category"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_account_invoice_line
msgid "Invoice Line"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_purchase_order
msgid "Purchase Order"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_product_template
msgid "Product Template"
msgstr ""
#. module: account_anglo_saxon
#: field:product.category,property_account_creditor_price_difference_categ:0
#: field:product.template,property_account_creditor_price_difference:0
msgid "Price Difference Account"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_stock_picking
msgid "Picking List"
msgstr ""
#. module: account_anglo_saxon
#: help:product.category,property_account_creditor_price_difference_categ:0
#: help:product.template,property_account_creditor_price_difference:0
msgid ""
"This account will be used to value price difference between purchase price "
"and cost price."
msgstr ""

View File

@ -0,0 +1,62 @@
# Macedonian translation for openobject-addons
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-06-07 19:36+0000\n"
"PO-Revision-Date: 2014-04-26 12:11+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Macedonian <mk@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-27 06:18+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_report_company
#: field:res.partner,display_name:0
msgid "Name"
msgstr ""
#. module: account_report_company
#: field:account.invoice,commercial_partner_id:0
#: help:account.invoice.report,commercial_partner_id:0
msgid "Commercial Entity"
msgstr ""
#. module: account_report_company
#: field:account.invoice.report,commercial_partner_id:0
msgid "Partner Company"
msgstr ""
#. module: account_report_company
#: model:ir.model,name:account_report_company.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: account_report_company
#: view:account.invoice:0
#: view:account.invoice.report:0
#: model:ir.model,name:account_report_company.model_res_partner
msgid "Partner"
msgstr ""
#. module: account_report_company
#: model:ir.model,name:account_report_company.model_account_invoice_report
msgid "Invoices Statistics"
msgstr ""
#. module: account_report_company
#: view:res.partner:0
msgid "True"
msgstr ""
#. module: account_report_company
#: help:account.invoice,commercial_partner_id:0
msgid ""
"The commercial entity that will be used on Journal Entries for this invoice"
msgstr ""

View File

@ -0,0 +1,135 @@
# Slovak translation for openobject-addons
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2014-04-26 16:22+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Slovak <sk@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-27 06:18+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: association
#: field:profile.association.config.install_modules_wizard,wiki:0
msgid "Wiki"
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
msgid "Event Management"
msgstr ""
#. module: association
#: field:profile.association.config.install_modules_wizard,project_gtd:0
msgid "Getting Things Done"
msgstr ""
#. module: association
#: model:ir.module.module,description:association.module_meta_information
msgid "This module is to create Profile for Associates"
msgstr ""
#. module: association
#: field:profile.association.config.install_modules_wizard,progress:0
msgid "Configuration Progress"
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
msgid ""
"Here are specific applications related to the Association Profile you "
"selected."
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
msgid "title"
msgstr ""
#. module: association
#: help:profile.association.config.install_modules_wizard,event_project:0
msgid "Helps you to manage and organize your events."
msgstr ""
#. module: association
#: field:profile.association.config.install_modules_wizard,config_logo:0
msgid "Image"
msgstr ""
#. module: association
#: help:profile.association.config.install_modules_wizard,hr_expense:0
msgid ""
"Tracks and manages employee expenses, and can automatically re-invoice "
"clients if the expenses are project-related."
msgstr ""
#. module: association
#: help:profile.association.config.install_modules_wizard,project_gtd:0
msgid ""
"GTD is a methodology to efficiently organise yourself and your tasks. This "
"module fully integrates GTD principle with OpenERP's project management."
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
msgid "Resources Management"
msgstr ""
#. module: association
#: model:ir.module.module,shortdesc:association.module_meta_information
msgid "Association profile"
msgstr ""
#. module: association
#: field:profile.association.config.install_modules_wizard,hr_expense:0
msgid "Expenses Tracking"
msgstr ""
#. module: association
#: model:ir.actions.act_window,name:association.action_config_install_module
#: view:profile.association.config.install_modules_wizard:0
msgid "Association Application Configuration"
msgstr ""
#. module: association
#: help:profile.association.config.install_modules_wizard,wiki:0
msgid ""
"Lets you create wiki pages and page groups in order to keep track of "
"business knowledge and share it with and between your employees."
msgstr ""
#. module: association
#: help:profile.association.config.install_modules_wizard,project:0
msgid ""
"Helps you manage your projects and tasks by tracking them, generating "
"plannings, etc..."
msgstr ""
#. module: association
#: model:ir.model,name:association.model_profile_association_config_install_modules_wizard
msgid "profile.association.config.install_modules_wizard"
msgstr ""
#. module: association
#: field:profile.association.config.install_modules_wizard,event_project:0
msgid "Events"
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
#: field:profile.association.config.install_modules_wizard,project:0
msgid "Project Management"
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
msgid "Configure"
msgstr ""

View File

@ -26,9 +26,9 @@ from pytz import timezone
import pytz
from openerp.osv import fields, osv
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
from openerp.tools.translate import _
from openerp import netsvc
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
class hr_timesheet_sheet(osv.osv):
_name = "hr_timesheet_sheet.sheet"
@ -393,29 +393,53 @@ class hr_attendance(osv.osv):
attendance_ids.extend([row[0] for row in cr.fetchall()])
return attendance_ids
def _sheet(self, cursor, user, ids, name, args, context=None):
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
res = {}.fromkeys(ids, False)
for attendance in self.browse(cursor, user, ids, context=context):
def _get_attendance_employee_tz(self, cr, uid, employee_id, date, context=None):
""" Simulate timesheet in employee timezone
# Simulate timesheet in employee timezone
att_tz = timezone(attendance.employee_id.user_id.partner_id.tz or 'utc')
Return the attendance datetime as date in string format in employee
tz converted from utc timezone as we consider date of employee
timesheet is in employee timezone
"""
employee_obj = self.pool['hr.employee']
attendance_dt = datetime.strptime(attendance.name, DEFAULT_SERVER_DATETIME_FORMAT)
tz = False
if employee_id:
employee = employee_obj.browse(cr, uid, employee_id, context=context)
tz = employee.user_id.partner_id.tz
att_tz = timezone(tz or 'utc')
attendance_dt = datetime.strptime(date, DEFAULT_SERVER_DATETIME_FORMAT)
att_tz_dt = pytz.utc.localize(attendance_dt)
att_tz_dt = att_tz_dt.astimezone(att_tz)
# We take only the date omiting the hours as we compare with timesheet
# date_from which is a date format thus using hours would lead to
# be out of scope of timesheet
att_tz_date_str = datetime.strftime(att_tz_dt, DEFAULT_SERVER_DATE_FORMAT)
sheet_ids = sheet_obj.search(cursor, user,
return att_tz_date_str
def _get_current_sheet(self, cr, uid, employee_id, date=False, context=None):
sheet_obj = self.pool['hr_timesheet_sheet.sheet']
if not date:
date = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
att_tz_date_str = self._get_attendance_employee_tz(
cr, uid, employee_id,
date=date, context=context)
sheet_ids = sheet_obj.search(cr, uid,
[('date_from', '<=', att_tz_date_str),
('date_to', '>=', att_tz_date_str),
('employee_id', '=', attendance.employee_id.id)],
('employee_id', '=', employee_id)],
context=context)
return sheet_ids and sheet_ids[0] or False
def _sheet(self, cursor, user, ids, name, args, context=None):
res = {}.fromkeys(ids, False)
for attendance in self.browse(cursor, user, ids, context=context):
res[attendance.id] = self._get_current_sheet(
cursor, user, attendance.employee_id.id, attendance.name,
context=context)
if sheet_ids:
# [0] because only one sheet possible for an employee between 2 dates
res[attendance.id] = sheet_obj.name_get(cursor, user, sheet_ids, context=context)[0]
return res
_columns = {
@ -434,16 +458,18 @@ class hr_attendance(osv.osv):
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
if 'sheet_id' in context:
ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id'], context=context)
sheet_id = context.get('sheet_id') or self._get_current_sheet(cr, uid, vals.get('employee_id'), vals.get('name'), context=context)
if sheet_id:
att_tz_date_str = self._get_attendance_employee_tz(
cr, uid, vals.get('employee_id'),
date=vals.get('name'), context=context)
ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, sheet_id, context=context)
if ts.state not in ('draft', 'new'):
raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet.'))
res = super(hr_attendance,self).create(cr, uid, vals, context=context)
if 'sheet_id' in context:
if context['sheet_id'] != self.browse(cr, uid, res, context=context).sheet_id.id:
raise osv.except_osv(_('User Error!'), _('You cannot enter an attendance ' \
'date outside the current timesheet dates.'))
return res
raise osv.except_osv(_('Error!'), _('You can not enter an attendance in a submitted timesheet. Ask your manager to reset it before adding attendance.'))
elif ts.date_from > att_tz_date_str or ts.date_to < att_tz_date_str:
raise osv.except_osv(_('User Error!'), _('You can not enter an attendance date outside the current timesheet dates.'))
return super(hr_attendance,self).create(cr, uid, vals, context=context)
def unlink(self, cr, uid, ids, *args, **kwargs):
if isinstance(ids, (int, long)):
@ -597,4 +623,3 @@ class res_company(osv.osv):
res_company()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -28,7 +28,7 @@
<record id="res_company_oerp_us" model="res.company">
<field name="partner_id" ref="res_partner_oerp_us"/>
<field name="parent_id" ref="res_company_oerp_editor"/>
<field name="currency_id" ref="base.EUR"/>
<field name="currency_id" ref="base.USD"/>
<field name="name">OpenERP US</field>
</record>
<record id="res_company_oerp_be" model="res.company">
@ -450,7 +450,7 @@
</record>
<record id="project.project_project_3" model="project.project">
<field name="company_id" ref="res_company_oerp_us"/>
<field name="currency_id" ref="base.EUR"/>
<field name="currency_id" ref="base.USD"/>
</record>
<record id="project.project_project_4" model="project.project">
<field name="company_id" ref="res_company_oerp_be"/>

View File

@ -24,7 +24,7 @@ import re
from _common import ceiling
from openerp import tools
from openerp import tools, SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools.translate import _
@ -703,7 +703,7 @@ class product_product(osv.osv):
res = {}
product_uom_obj = self.pool.get('product.uom')
for product in self.browse(cr, uid, ids, context=context):
for product in self.browse(cr, SUPERUSER_ID, ids, context=context):
res[product.id] = product[ptype] or 0.0
if ptype == 'list_price':
res[product.id] = (res[product.id] * (product.price_margin or 1.0)) + \