diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py
index 7a66dd4f175..bb13f1a5776 100644
--- a/addons/account/account_analytic_line.py
+++ b/addons/account/account_analytic_line.py
@@ -75,6 +75,9 @@ class account_analytic_line(osv.osv):
unit=False, journal_id=False, context=None):
if context==None:
context={}
+ if not journal_id:
+ j_ids = self.pool.get('account.analytic.journal').search(cr, uid, [('type','=','purchase')])
+ j_id = j_ids and j_ids[0] or False
if not journal_id or not prod_id:
return {}
product_obj = self.pool.get('product.product')
@@ -86,7 +89,7 @@ class account_analytic_line(osv.osv):
result = 0.0
is_purchase = False
- if j_id.type == 'purchase':
+ if j_id.type <> 'sale':
a = prod.product_tmpl_id.property_account_expense.id
if not a:
a = prod.categ_id.property_account_expense_categ.id
diff --git a/addons/account/project/project.py b/addons/account/project/project.py
index 431d486592b..f082672310e 100644
--- a/addons/account/project/project.py
+++ b/addons/account/project/project.py
@@ -28,8 +28,8 @@ from osv import osv
class account_analytic_journal(osv.osv):
_name = 'account.analytic.journal'
_columns = {
- 'name' : fields.char('Journal name', size=64, required=True),
- 'code' : fields.char('Journal code', size=8),
+ 'name' : fields.char('Journal Name', size=64, required=True),
+ 'code' : fields.char('Journal Code', size=8),
'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic journal without removing it."),
'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
'line_ids' : fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 0d335118d3b..fd52619fb10 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -172,19 +172,16 @@
tree
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -195,22 +192,24 @@
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
+
-
+
diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py
index 0bb9afc3386..21fe0a7da29 100644
--- a/addons/analytic_user_function/analytic_user_function.py
+++ b/addons/analytic_user_function/analytic_user_function.py
@@ -99,7 +99,7 @@ class hr_analytic_timesheet(osv.osv):
(r.product_id.name, r.product_id.id,))
# Compute based on pricetype
amount_unit = self.on_change_unit_amount(cr, uid, ids,
- r.product_id.id, unit_amount, r.product_id.uom_id.id)['value']['amount']
+ r.product_id.id, unit_amount, False, r.product_id.uom_id.id)['value']['amount']
amount = unit_amount * amount_unit
res ['value']['amount']= - round(amount, 2)
@@ -134,7 +134,7 @@ class hr_analytic_timesheet(osv.osv):
(r.product_id.name, r.product_id.id,))
# Compute based on pricetype
amount_unit = self.on_change_unit_amount(cr, uid, ids,
- r.product_id.id, unit_amount, r.product_id.uom_id.id)['value']['amount']
+ r.product_id.id, unit_amount, False, r.product_id.uom_id.id)['value']['amount']
amount = unit_amount * amount_unit
res ['value']['amount']= - round(amount, 2)
diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py
index ee4abdb35c4..75ad6101e11 100644
--- a/addons/hr_timesheet/hr_timesheet.py
+++ b/addons/hr_timesheet/hr_timesheet.py
@@ -57,14 +57,14 @@ class hr_analytic_timesheet(osv.osv):
return super(hr_analytic_timesheet, self).unlink(cr, uid, ids, context=context)
- def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, unit, context=None):
+ def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, company_id, unit=False, journal_id=False, context=None):
if context is None:
context = {}
res = {'value':{}}
if prod_id and unit_amount:
# find company
company_id = self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=context)
- res.update(self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount, company_id, unit, context=context))
+ res.update(self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount, company_id, unit, journal_id, context=context))
# update unit of measurement
if prod_id:
uom = self.pool.get('product.product').browse(cr, uid, prod_id, context=context)
diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml
index 4165f71d73f..a47fbf24685 100644
--- a/addons/hr_timesheet/hr_timesheet_view.xml
+++ b/addons/hr_timesheet/hr_timesheet_view.xml
@@ -12,16 +12,17 @@
tree
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -40,9 +41,9 @@
-
-
-
+
+
+
@@ -67,7 +68,7 @@
-
+
@@ -81,32 +82,20 @@
-
-
+
+
-
- My Working Hours
- ir.actions.act_window
- hr.analytic.timesheet
- form
- tree,form
- [('user_id','=',uid)]
-
- {"search_default_user_id":uid, "search_default_my": 1}
-
-
-
Working Hours
ir.actions.act_window
hr.analytic.timesheet
form
tree,form
- {"search_default_user_id":uid}
+ {"search_default_user_id":uid, "search_default_today":1}
This functionality gives you a list of work done by user, product and analytic account (or project). A search tool allows you to make fine-grained analysis.
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
index 9b990556218..88b094f97cc 100644
--- a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
+++ b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
@@ -81,7 +81,7 @@ class hr_so_project(osv.osv_memory):
if not res['product_uom_id']:
raise osv.except_osv(_('UserError'), _('No cost unit defined for this employee !'))
- up = timesheet_obj.on_change_unit_amount(cr, uid, False, res['product_id'], hour, res['product_uom_id'])['value']
+ up = timesheet_obj.on_change_unit_amount(cr, uid, False, res['product_id'], hour,False, res['product_uom_id'])['value']
res['name'] = data['info']
res['account_id'] = data['account_id'].id
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
index c7435127466..4beda0999d0 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml
@@ -21,17 +21,6 @@
-
hr.analytic.timesheet.form
hr.analytic.timesheet
@@ -83,13 +72,26 @@
+
+ account.analytic.line.search.to_invoice
+ account.analytic.line
+ search
+
+
+
+
+
+
+
+
+
account.analytic.line.tree.to_invoice
account.analytic.line
tree
-
+
@@ -103,18 +105,19 @@
+
- Entries to invoice
+ Costs to Invoice
account.analytic.line
form
tree,form
- [('to_invoice','<>',False)]
- {"search_default_user_id":uid}
+ []
+ {'search_default_to_invoice': 1}
OpenERP automatically group the entries to be invoiced so you can keep an eye on them on real time in one glance.
-
- Uninvoiced Entries
- account.analytic.line
- form
- tree,form
- [('invoice_id','=',False),('to_invoice','!=',False)]
-
-
-
-
- Open Analytic Accounts
- account.analytic.account
- form
- tree,form
- [('state','<>','close'),('type','<>','view')]
-
-
-
- Unclosed Invoiceable Accounts
- account.analytic.account
- form
- tree,form
- [('state','<>','close'),('type','<>','view'),('pricelist_id','<>',False)]
-
-
hr_timesheet_invoice.factor.form
hr_timesheet_invoice.factor
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
index 4e1926fe069..1bb7765b372 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
@@ -38,7 +38,7 @@ class hr_timesheet_invoice_create(osv.osv_memory):
'accounts': fields.many2many('account.analytic.account', 'invoice_id', 'account_id', 'Analytic Accounts', required=True),
'date': fields.boolean('Date', help='The real date of each work will be displayed on the invoice'),
'time': fields.boolean('Time spent', help='The time of each work done will be displayed on the invoice'),
- 'name': fields.boolean('Name of entry', help='The detail of each work done will be displayed on the invoice'),
+ 'name': fields.boolean('Description', help='The detail of each work done will be displayed on the invoice'),
'price': fields.boolean('Cost', help='The cost of each work done will be displayed on the invoice. You probably don\'t want to check this'),
'product': fields.many2one('product.product', 'Product', help='Complete this field only if you want to force to use a specific product. Keep empty to use the real product that comes from the cost.'),
}
@@ -59,8 +59,10 @@ class hr_timesheet_invoice_create(osv.osv_memory):
return [x[0] for x in account_ids]
_defaults = {
- 'accounts': _get_accounts
- }
+ 'accounts': _get_accounts,
+ 'date': lambda *args: 1,
+ 'name': lambda *args: 1
+ }
def do_create(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml
index a0b20e5ff97..fc6d6da911e 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml
@@ -2,37 +2,33 @@
-
+
hr.timesheet.invoice.create.form
hr.timesheet.invoice.create
form
-
+
@@ -45,7 +41,7 @@
new
-
+
Invoice analytic lines
@@ -55,5 +51,5 @@
account.analytic.line
-
-
\ No newline at end of file
+
+
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 42f09e22648..06d8d6c3b06 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -104,11 +104,11 @@
-
+
-
-
+
+
@@ -117,11 +117,11 @@
-
+
-
-
+
+
@@ -201,8 +201,7 @@
id="base.menu_project_management_time_tracking"
name="Time Tracking"
parent="base.menu_main_pm" sequence="5"/>
-
+
diff --git a/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml
index 19eacdae472..f9944d0949f 100644
--- a/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml
+++ b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml
@@ -6,7 +6,7 @@
hr.timesheet.current.open
form
-
- Current Timesheet
+ My Timesheet
hr.timesheet.current.open
form
tree,form
@@ -25,7 +25,11 @@
new
-
+
+
+
diff --git a/addons/point_of_sale/report/account_statement.py b/addons/point_of_sale/report/account_statement.py
index 391adb7569f..dc492651bb2 100644
--- a/addons/point_of_sale/report/account_statement.py
+++ b/addons/point_of_sale/report/account_statement.py
@@ -31,10 +31,21 @@ class account_statement(report_sxw.rml_parse):
self.localcontext.update({
'time': time,
'get_total':self._get_total,
+ 'get_data':self._get_data,
})
+
+ def _get_data(self, statement):
+ lines = []
+ for line in statement.line_ids:
+ lines.append(line)
+
+ return lines
+
def _get_total(self, statement_line_ids):
total = 0.0
for line in statement_line_ids:
total += line.amount
return total
+
report_sxw.report_sxw('report.account.statement', 'account.bank.statement', 'addons/statement/report/account_statement.rml', parser=account_statement,header='internal')
+
diff --git a/addons/point_of_sale/report/account_statement.rml b/addons/point_of_sale/report/account_statement.rml
index e4c3b99b6ee..ed26143aa4e 100644
--- a/addons/point_of_sale/report/account_statement.rml
+++ b/addons/point_of_sale/report/account_statement.rml
@@ -216,10 +216,10 @@
[[ formatLang(statement.closing_date,date=True) ]]
- [[ formatLang(statement.balance_start) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(statement.balance_start, digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]]
|
- [[ formatLang(statement.balance_end_real) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(statement.balance_end_real, digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]]
|
@@ -247,13 +247,14 @@
[[ repeatIn(statement.line_ids,'line_ids') and ' ' or removeParentNode('blockTable') ]]
[[ repeatIn(get_data(statement), 'line_ids')]]
- [[ line_ids.name ]]
+
+ [[ line_ids['name'] ]]
|
[[ line_ids.partner_id.name ]]
|
- [[ formatLang(line_ids.amount) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(line_ids.amount, digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]]
|
@@ -268,7 +269,7 @@
Total :
- [[ formatLang(get_total(statement.line_ids)) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(get_total(statement.line_ids), digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]]
|
@@ -282,4 +283,4 @@
-
\ No newline at end of file
+
diff --git a/addons/project/project.py b/addons/project/project.py
index 996e79a1f8b..27bbb2f8c7f 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -190,7 +190,6 @@ class project(osv.osv):
'active': True,
'priority': 1,
'sequence': 10,
- 'warn_manager': True,
}
def _check_dates(self, cr, uid, ids):
@@ -373,6 +372,11 @@ class task(osv.osv):
return res
+ def onchange_remaining(self, cr, uid, ids, remaining=0.0, planned = 0.0):
+ if remaining and not planned:
+ return {'value':{'planned_hours': remaining}}
+ return {}
+
def onchange_planned(self, cr, uid, ids, planned = 0.0, effective = 0.0):
return {'value':{'remaining_hours': planned - effective}}
@@ -482,7 +486,6 @@ class task(osv.osv):
return True
_constraints = [
- (_check_dates, 'Error! Task start-date must be lower then task end-date.', ['date_start', 'date_end']),
(_check_recursion, _('Error ! You cannot create recursive tasks.'), ['parent_ids'])
]
#
@@ -615,7 +618,10 @@ class task(osv.osv):
def do_open(self, cr, uid, ids, *args):
tasks= self.browse(cr,uid,ids)
for t in tasks:
- self.write(cr, uid, [t.id], {'state': 'open', 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'),})
+ data = {'state': 'open'}
+ if not t.date_start:
+ data['date_start'] = time.strftime('%Y-%m-%d %H:%M:%S')
+ self.write(cr, uid, [t.id], data)
message = _('Task ') + " '" + t.name + "' "+ _("is Open.")
self.log(cr, uid, t.id, message)
return True
@@ -680,7 +686,7 @@ class task(osv.osv):
def prev_type(self, cr, uid, ids, *args):
for task in self.browse(cr, uid, ids):
typeid = task.type_id.id
- types = map(lambda x:x.id, task.project_id.type_ids)
+ types = map(lambda x:x.id, task.project_id and task.project_id.type_ids or [])
if types:
if typeid and typeid in types:
index = types.index(typeid)
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 6efc64dd494..5e5be5ee4b0 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -207,7 +207,7 @@