diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 2710d061141..84cfc3e5ab0 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -182,8 +182,10 @@ + + on_change="onchange_journal_id(journal_id, context)" options="{'no_create': True}" + attrs="{'readonly':[('internal_number','!=',False)]}"/> @@ -328,8 +330,10 @@ + + on_change="onchange_journal_id(journal_id, context)" options="{'no_create': True}" + attrs="{'readonly':[('internal_number','!=',False)]}"/> diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 3adfe471d82..77b75ede513 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -439,7 +439,7 @@ class account_move_line(osv.osv): 'debit': fields.float('Debit', digits_compute=dp.get_precision('Account')), 'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')), 'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade", domain=[('type','<>','view'), ('type', '<>', 'closed')], select=2), - 'move_id': fields.many2one('account.move', 'Journal Entry', ondelete="cascade", help="The move of this entry line.", select=2, required=True), + 'move_id': fields.many2one('account.move', 'Journal Entry', ondelete="cascade", help="The move of this entry line.", select=2, required=True, auto_join=True), 'narration': fields.related('move_id','narration', type='text', relation='account.move', string='Internal Note'), 'ref': fields.related('move_id', 'ref', string='Reference', type='char', size=64, store=True), 'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1), diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index 2edb767cbbf..3eda1c45c85 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -315,6 +315,7 @@ class res_partner(osv.osv): ('reconcile_id', '=', False), ('state', '!=', 'draft'), ('company_id', '=', company_id), + ('date_maturity', '<=', fields.date.context_today(self,cr,uid)), ], context=context): raise osv.except_osv(_('Error!'),_("The partner does not have any accounting entries to print in the overdue report for the current company.")) self.message_post(cr, uid, [ids[0]], body=_('Printed overdue payments report'), context=context) diff --git a/addons/account_followup/report/account_followup_print.py b/addons/account_followup/report/account_followup_print.py index ffac09cc082..ffd96bd7c50 100644 --- a/addons/account_followup/report/account_followup_print.py +++ b/addons/account_followup/report/account_followup_print.py @@ -21,6 +21,7 @@ import time from collections import defaultdict +from openerp.osv import fields from openerp.report import report_sxw @@ -54,6 +55,7 @@ class report_rappel(report_sxw.rml_parse): ('reconcile_id', '=', False), ('state', '!=', 'draft'), ('company_id', '=', company_id), + ('date_maturity', '<=', fields.date.context_today(self,self.cr,self.uid)), ]) # lines_per_currency = {currency: [line data, ...], ...} diff --git a/addons/analytic/analytic_view.xml b/addons/analytic/analytic_view.xml index 9a99552be13..1a47240ab5e 100644 --- a/addons/analytic/analytic_view.xml +++ b/addons/analytic/analytic_view.xml @@ -29,7 +29,7 @@ - + diff --git a/addons/board/board.py b/addons/board/board.py index fafb0eae290..2bd2804356a 100644 --- a/addons/board/board.py +++ b/addons/board/board.py @@ -23,7 +23,7 @@ from operator import itemgetter from textwrap import dedent -from openerp import tools +from openerp import tools, SUPERUSER_ID from openerp.osv import fields, osv class board_board(osv.osv): @@ -144,7 +144,7 @@ class board_create(osv.osv_memory): ''') }, context=context) - menu_id = self.pool.get('ir.ui.menu').create(cr, uid, { + menu_id = self.pool.get('ir.ui.menu').create(cr, SUPERUSER_ID, { 'name': this.name, 'parent_id': this.menu_parent_id.id, 'action': 'ir.actions.act_window,%s' % (action_id,) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 772631b0cdd..c00df49bb20 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -328,6 +328,7 @@ class crm_lead(format_address, osv.osv): partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) values = { 'partner_name': partner.name, + 'title': partner.title and partner.title.id or False, 'street': partner.street, 'street2': partner.street2, 'city': partner.city, @@ -338,6 +339,7 @@ class crm_lead(format_address, osv.osv): 'mobile': partner.mobile, 'fax': partner.fax, 'zip': partner.zip, + 'function': partner.function, } return {'value': values} diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 1b9974d90fd..e4dd426c6c3 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -528,12 +528,13 @@ class hr_timesheet_sheet_sheet_day(osv.osv): MAX(id) as id, name, sheet_id, + timezone, SUM(total_timesheet) as total_timesheet, - CASE WHEN SUM(total_attendance) < 0 + CASE WHEN SUM(orphan_attendances) != 0 THEN (SUM(total_attendance) + CASE WHEN current_date <> name THEN 1440 - ELSE (EXTRACT(hour FROM current_time AT TIME ZONE 'UTC') * 60) + EXTRACT(minute FROM current_time AT TIME ZONE 'UTC') + ELSE (EXTRACT(hour FROM current_time AT TIME ZONE 'UTC' AT TIME ZONE coalesce(timezone, 'UTC')) * 60) + EXTRACT(minute FROM current_time AT TIME ZONE 'UTC' AT TIME ZONE coalesce(timezone, 'UTC')) END ) ELSE SUM(total_attendance) @@ -542,21 +543,25 @@ class hr_timesheet_sheet_sheet_day(osv.osv): (( select min(hrt.id) as id, + 'UTC' as timezone, l.date::date as name, s.id as sheet_id, sum(l.unit_amount) as total_timesheet, + 0 as orphan_attendances, 0.0 as total_attendance from hr_analytic_timesheet hrt JOIN account_analytic_line l ON l.id = hrt.line_id LEFT JOIN hr_timesheet_sheet_sheet s ON s.id = hrt.sheet_id - group by l.date::date, s.id + group by l.date::date, s.id, timezone ) union ( select -min(a.id) as id, + p.tz as timezone, (a.name AT TIME ZONE 'UTC' AT TIME ZONE coalesce(p.tz, 'UTC'))::date as name, s.id as sheet_id, 0.0 as total_timesheet, + SUM(CASE WHEN a.action = 'sign_in' THEN -1 ELSE 1 END) as orphan_attendances, SUM(((EXTRACT(hour FROM (a.name AT TIME ZONE 'UTC' AT TIME ZONE coalesce(p.tz, 'UTC'))) * 60) + EXTRACT(minute FROM (a.name AT TIME ZONE 'UTC' AT TIME ZONE coalesce(p.tz, 'UTC')))) * (CASE WHEN a.action = 'sign_in' THEN -1 ELSE 1 END)) as total_attendance from hr_attendance a @@ -571,9 +576,9 @@ class hr_timesheet_sheet_sheet_day(osv.osv): LEFT JOIN res_partner p ON u.partner_id = p.id WHERE action in ('sign_in', 'sign_out') - group by (a.name AT TIME ZONE 'UTC' AT TIME ZONE coalesce(p.tz, 'UTC'))::date, s.id + group by (a.name AT TIME ZONE 'UTC' AT TIME ZONE coalesce(p.tz, 'UTC'))::date, s.id, timezone )) AS foo - GROUP BY name, sheet_id + GROUP BY name, sheet_id, timezone )) AS bar""") diff --git a/addons/product/product_data.xml b/addons/product/product_data.xml index 66050115348..85f5f342d69 100644 --- a/addons/product/product_data.xml +++ b/addons/product/product_data.xml @@ -28,6 +28,35 @@ Volume + + + + Product Price + 2 + + + Discount + 2 + + + Account + 2 + + + Stock Weight + 2 + + + Product Unit of Measure + + + + Product UoS + + + @@ -163,30 +192,6 @@ parameter) will see those record just disappear. - - Product Price - 2 - - - Discount - 2 - - - Account - 2 - - - Stock Weight - 2 - - - Product Unit of Measure - - - - Product UoS - -