Skip to content

Commit 22d1c09

Browse files
committedApr 28, 2014
[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: [email protected]
2 parents 886c827 + a2536d5 commit 22d1c09

File tree

6 files changed

+319
-35
lines changed

6 files changed

+319
-35
lines changed
 

‎addons/account_anglo_saxon/i18n/sk.po

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Slovak translation for openobject-addons
2+
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
3+
# This file is distributed under the same license as the openobject-addons package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
5+
#
6+
msgid ""
7+
msgstr ""
8+
"Project-Id-Version: openobject-addons\n"
9+
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10+
"POT-Creation-Date: 2013-06-07 19:36+0000\n"
11+
"PO-Revision-Date: 2014-04-26 16:04+0000\n"
12+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13+
"Language-Team: Slovak <sk@li.org>\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"X-Launchpad-Export-Date: 2014-04-27 06:18+0000\n"
18+
"X-Generator: Launchpad (build 16985)\n"
19+
20+
#. module: account_anglo_saxon
21+
#: model:ir.model,name:account_anglo_saxon.model_product_category
22+
msgid "Product Category"
23+
msgstr ""
24+
25+
#. module: account_anglo_saxon
26+
#: model:ir.model,name:account_anglo_saxon.model_account_invoice_line
27+
msgid "Invoice Line"
28+
msgstr ""
29+
30+
#. module: account_anglo_saxon
31+
#: model:ir.model,name:account_anglo_saxon.model_purchase_order
32+
msgid "Purchase Order"
33+
msgstr ""
34+
35+
#. module: account_anglo_saxon
36+
#: model:ir.model,name:account_anglo_saxon.model_product_template
37+
msgid "Product Template"
38+
msgstr ""
39+
40+
#. module: account_anglo_saxon
41+
#: field:product.category,property_account_creditor_price_difference_categ:0
42+
#: field:product.template,property_account_creditor_price_difference:0
43+
msgid "Price Difference Account"
44+
msgstr ""
45+
46+
#. module: account_anglo_saxon
47+
#: model:ir.model,name:account_anglo_saxon.model_account_invoice
48+
msgid "Invoice"
49+
msgstr ""
50+
51+
#. module: account_anglo_saxon
52+
#: model:ir.model,name:account_anglo_saxon.model_stock_picking
53+
msgid "Picking List"
54+
msgstr ""
55+
56+
#. module: account_anglo_saxon
57+
#: help:product.category,property_account_creditor_price_difference_categ:0
58+
#: help:product.template,property_account_creditor_price_difference:0
59+
msgid ""
60+
"This account will be used to value price difference between purchase price "
61+
"and cost price."
62+
msgstr ""
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Macedonian translation for openobject-addons
2+
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
3+
# This file is distributed under the same license as the openobject-addons package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
5+
#
6+
msgid ""
7+
msgstr ""
8+
"Project-Id-Version: openobject-addons\n"
9+
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10+
"POT-Creation-Date: 2013-06-07 19:36+0000\n"
11+
"PO-Revision-Date: 2014-04-26 12:11+0000\n"
12+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13+
"Language-Team: Macedonian <mk@li.org>\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"X-Launchpad-Export-Date: 2014-04-27 06:18+0000\n"
18+
"X-Generator: Launchpad (build 16985)\n"
19+
20+
#. module: account_report_company
21+
#: field:res.partner,display_name:0
22+
msgid "Name"
23+
msgstr ""
24+
25+
#. module: account_report_company
26+
#: field:account.invoice,commercial_partner_id:0
27+
#: help:account.invoice.report,commercial_partner_id:0
28+
msgid "Commercial Entity"
29+
msgstr ""
30+
31+
#. module: account_report_company
32+
#: field:account.invoice.report,commercial_partner_id:0
33+
msgid "Partner Company"
34+
msgstr ""
35+
36+
#. module: account_report_company
37+
#: model:ir.model,name:account_report_company.model_account_invoice
38+
msgid "Invoice"
39+
msgstr ""
40+
41+
#. module: account_report_company
42+
#: view:account.invoice:0
43+
#: view:account.invoice.report:0
44+
#: model:ir.model,name:account_report_company.model_res_partner
45+
msgid "Partner"
46+
msgstr ""
47+
48+
#. module: account_report_company
49+
#: model:ir.model,name:account_report_company.model_account_invoice_report
50+
msgid "Invoices Statistics"
51+
msgstr ""
52+
53+
#. module: account_report_company
54+
#: view:res.partner:0
55+
msgid "True"
56+
msgstr ""
57+
58+
#. module: account_report_company
59+
#: help:account.invoice,commercial_partner_id:0
60+
msgid ""
61+
"The commercial entity that will be used on Journal Entries for this invoice"
62+
msgstr ""

‎addons/association/i18n/sk.po

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Slovak translation for openobject-addons
2+
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
3+
# This file is distributed under the same license as the openobject-addons package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
5+
#
6+
msgid ""
7+
msgstr ""
8+
"Project-Id-Version: openobject-addons\n"
9+
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10+
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
11+
"PO-Revision-Date: 2014-04-26 16:22+0000\n"
12+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13+
"Language-Team: Slovak <sk@li.org>\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"X-Launchpad-Export-Date: 2014-04-27 06:18+0000\n"
18+
"X-Generator: Launchpad (build 16985)\n"
19+
20+
#. module: association
21+
#: field:profile.association.config.install_modules_wizard,wiki:0
22+
msgid "Wiki"
23+
msgstr ""
24+
25+
#. module: association
26+
#: view:profile.association.config.install_modules_wizard:0
27+
msgid "Event Management"
28+
msgstr ""
29+
30+
#. module: association
31+
#: field:profile.association.config.install_modules_wizard,project_gtd:0
32+
msgid "Getting Things Done"
33+
msgstr ""
34+
35+
#. module: association
36+
#: model:ir.module.module,description:association.module_meta_information
37+
msgid "This module is to create Profile for Associates"
38+
msgstr ""
39+
40+
#. module: association
41+
#: field:profile.association.config.install_modules_wizard,progress:0
42+
msgid "Configuration Progress"
43+
msgstr ""
44+
45+
#. module: association
46+
#: view:profile.association.config.install_modules_wizard:0
47+
msgid ""
48+
"Here are specific applications related to the Association Profile you "
49+
"selected."
50+
msgstr ""
51+
52+
#. module: association
53+
#: view:profile.association.config.install_modules_wizard:0
54+
msgid "title"
55+
msgstr ""
56+
57+
#. module: association
58+
#: help:profile.association.config.install_modules_wizard,event_project:0
59+
msgid "Helps you to manage and organize your events."
60+
msgstr ""
61+
62+
#. module: association
63+
#: field:profile.association.config.install_modules_wizard,config_logo:0
64+
msgid "Image"
65+
msgstr ""
66+
67+
#. module: association
68+
#: help:profile.association.config.install_modules_wizard,hr_expense:0
69+
msgid ""
70+
"Tracks and manages employee expenses, and can automatically re-invoice "
71+
"clients if the expenses are project-related."
72+
msgstr ""
73+
74+
#. module: association
75+
#: help:profile.association.config.install_modules_wizard,project_gtd:0
76+
msgid ""
77+
"GTD is a methodology to efficiently organise yourself and your tasks. This "
78+
"module fully integrates GTD principle with OpenERP's project management."
79+
msgstr ""
80+
81+
#. module: association
82+
#: view:profile.association.config.install_modules_wizard:0
83+
msgid "Resources Management"
84+
msgstr ""
85+
86+
#. module: association
87+
#: model:ir.module.module,shortdesc:association.module_meta_information
88+
msgid "Association profile"
89+
msgstr ""
90+
91+
#. module: association
92+
#: field:profile.association.config.install_modules_wizard,hr_expense:0
93+
msgid "Expenses Tracking"
94+
msgstr ""
95+
96+
#. module: association
97+
#: model:ir.actions.act_window,name:association.action_config_install_module
98+
#: view:profile.association.config.install_modules_wizard:0
99+
msgid "Association Application Configuration"
100+
msgstr ""
101+
102+
#. module: association
103+
#: help:profile.association.config.install_modules_wizard,wiki:0
104+
msgid ""
105+
"Lets you create wiki pages and page groups in order to keep track of "
106+
"business knowledge and share it with and between your employees."
107+
msgstr ""
108+
109+
#. module: association
110+
#: help:profile.association.config.install_modules_wizard,project:0
111+
msgid ""
112+
"Helps you manage your projects and tasks by tracking them, generating "
113+
"plannings, etc..."
114+
msgstr ""
115+
116+
#. module: association
117+
#: model:ir.model,name:association.model_profile_association_config_install_modules_wizard
118+
msgid "profile.association.config.install_modules_wizard"
119+
msgstr ""
120+
121+
#. module: association
122+
#: field:profile.association.config.install_modules_wizard,event_project:0
123+
msgid "Events"
124+
msgstr ""
125+
126+
#. module: association
127+
#: view:profile.association.config.install_modules_wizard:0
128+
#: field:profile.association.config.install_modules_wizard,project:0
129+
msgid "Project Management"
130+
msgstr ""
131+
132+
#. module: association
133+
#: view:profile.association.config.install_modules_wizard:0
134+
msgid "Configure"
135+
msgstr ""

‎addons/hr_timesheet_sheet/hr_timesheet_sheet.py

+56-31
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
import pytz
2727

2828
from openerp.osv import fields, osv
29+
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
2930
from openerp.tools.translate import _
3031
from openerp import netsvc
31-
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
3232

3333
class hr_timesheet_sheet(osv.osv):
3434
_name = "hr_timesheet_sheet.sheet"
@@ -393,29 +393,53 @@ def _get_hr_timesheet_sheet(self, cr, uid, ids, context=None):
393393
attendance_ids.extend([row[0] for row in cr.fetchall()])
394394
return attendance_ids
395395

396+
def _get_attendance_employee_tz(self, cr, uid, employee_id, date, context=None):
397+
""" Simulate timesheet in employee timezone
398+
399+
Return the attendance datetime as date in string format in employee
400+
tz converted from utc timezone as we consider date of employee
401+
timesheet is in employee timezone
402+
"""
403+
employee_obj = self.pool['hr.employee']
404+
405+
tz = False
406+
if employee_id:
407+
employee = employee_obj.browse(cr, uid, employee_id, context=context)
408+
tz = employee.user_id.partner_id.tz
409+
410+
att_tz = timezone(tz or 'utc')
411+
412+
attendance_dt = datetime.strptime(date, DEFAULT_SERVER_DATETIME_FORMAT)
413+
att_tz_dt = pytz.utc.localize(attendance_dt)
414+
att_tz_dt = att_tz_dt.astimezone(att_tz)
415+
# We take only the date omiting the hours as we compare with timesheet
416+
# date_from which is a date format thus using hours would lead to
417+
# be out of scope of timesheet
418+
att_tz_date_str = datetime.strftime(att_tz_dt, DEFAULT_SERVER_DATE_FORMAT)
419+
return att_tz_date_str
420+
421+
def _get_current_sheet(self, cr, uid, employee_id, date=False, context=None):
422+
423+
sheet_obj = self.pool['hr_timesheet_sheet.sheet']
424+
if not date:
425+
date = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
426+
427+
att_tz_date_str = self._get_attendance_employee_tz(
428+
cr, uid, employee_id,
429+
date=date, context=context)
430+
sheet_ids = sheet_obj.search(cr, uid,
431+
[('date_from', '<=', att_tz_date_str),
432+
('date_to', '>=', att_tz_date_str),
433+
('employee_id', '=', employee_id)],
434+
context=context)
435+
return sheet_ids and sheet_ids[0] or False
436+
396437
def _sheet(self, cursor, user, ids, name, args, context=None):
397-
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
398438
res = {}.fromkeys(ids, False)
399439
for attendance in self.browse(cursor, user, ids, context=context):
400-
401-
# Simulate timesheet in employee timezone
402-
att_tz = timezone(attendance.employee_id.user_id.partner_id.tz or 'utc')
403-
404-
attendance_dt = datetime.strptime(attendance.name, DEFAULT_SERVER_DATETIME_FORMAT)
405-
att_tz_dt = pytz.utc.localize(attendance_dt)
406-
att_tz_dt = att_tz_dt.astimezone(att_tz)
407-
# We take only the date omiting the hours as we compare with timesheet
408-
# date_from which is a date format thus using hours would lead to
409-
# be out of scope of timesheet
410-
att_tz_date_str = datetime.strftime(att_tz_dt, DEFAULT_SERVER_DATE_FORMAT)
411-
sheet_ids = sheet_obj.search(cursor, user,
412-
[('date_from', '<=', att_tz_date_str),
413-
('date_to', '>=', att_tz_date_str),
414-
('employee_id', '=', attendance.employee_id.id)],
415-
context=context)
416-
if sheet_ids:
417-
# [0] because only one sheet possible for an employee between 2 dates
418-
res[attendance.id] = sheet_obj.name_get(cursor, user, sheet_ids, context=context)[0]
440+
res[attendance.id] = self._get_current_sheet(
441+
cursor, user, attendance.employee_id.id, attendance.name,
442+
context=context)
419443
return res
420444

421445
_columns = {
@@ -434,16 +458,18 @@ def _sheet(self, cursor, user, ids, name, args, context=None):
434458
def create(self, cr, uid, vals, context=None):
435459
if context is None:
436460
context = {}
437-
if 'sheet_id' in context:
438-
ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id'], context=context)
461+
462+
sheet_id = context.get('sheet_id') or self._get_current_sheet(cr, uid, vals.get('employee_id'), vals.get('name'), context=context)
463+
if sheet_id:
464+
att_tz_date_str = self._get_attendance_employee_tz(
465+
cr, uid, vals.get('employee_id'),
466+
date=vals.get('name'), context=context)
467+
ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, sheet_id, context=context)
439468
if ts.state not in ('draft', 'new'):
440-
raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet.'))
441-
res = super(hr_attendance,self).create(cr, uid, vals, context=context)
442-
if 'sheet_id' in context:
443-
if context['sheet_id'] != self.browse(cr, uid, res, context=context).sheet_id.id:
444-
raise osv.except_osv(_('User Error!'), _('You cannot enter an attendance ' \
445-
'date outside the current timesheet dates.'))
446-
return res
469+
raise osv.except_osv(_('Error!'), _('You can not enter an attendance in a submitted timesheet. Ask your manager to reset it before adding attendance.'))
470+
elif ts.date_from > att_tz_date_str or ts.date_to < att_tz_date_str:
471+
raise osv.except_osv(_('User Error!'), _('You can not enter an attendance date outside the current timesheet dates.'))
472+
return super(hr_attendance,self).create(cr, uid, vals, context=context)
447473

448474
def unlink(self, cr, uid, ids, *args, **kwargs):
449475
if isinstance(ids, (int, long)):
@@ -597,4 +623,3 @@ class res_company(osv.osv):
597623
res_company()
598624

599625
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
600-

‎addons/multi_company/multi_company_demo.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<record id="res_company_oerp_us" model="res.company">
2929
<field name="partner_id" ref="res_partner_oerp_us"/>
3030
<field name="parent_id" ref="res_company_oerp_editor"/>
31-
<field name="currency_id" ref="base.EUR"/>
31+
<field name="currency_id" ref="base.USD"/>
3232
<field name="name">OpenERP US</field>
3333
</record>
3434
<record id="res_company_oerp_be" model="res.company">
@@ -450,7 +450,7 @@
450450
</record>
451451
<record id="project.project_project_3" model="project.project">
452452
<field name="company_id" ref="res_company_oerp_us"/>
453-
<field name="currency_id" ref="base.EUR"/>
453+
<field name="currency_id" ref="base.USD"/>
454454
</record>
455455
<record id="project.project_project_4" model="project.project">
456456
<field name="company_id" ref="res_company_oerp_be"/>

‎addons/product/product.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from _common import ceiling
2626

27-
from openerp import tools
27+
from openerp import tools, SUPERUSER_ID
2828
from openerp.osv import osv, fields
2929
from openerp.tools.translate import _
3030

@@ -703,7 +703,7 @@ def price_get(self, cr, uid, ids, ptype='list_price', context=None):
703703

704704
res = {}
705705
product_uom_obj = self.pool.get('product.uom')
706-
for product in self.browse(cr, uid, ids, context=context):
706+
for product in self.browse(cr, SUPERUSER_ID, ids, context=context):
707707
res[product.id] = product[ptype] or 0.0
708708
if ptype == 'list_price':
709709
res[product.id] = (res[product.id] * (product.price_margin or 1.0)) + \

0 commit comments

Comments
 (0)
Please sign in to comment.