diff --git a/addons/account/account.py b/addons/account/account.py index c2e6f3d1221..fbbbfd64537 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -31,7 +31,7 @@ import decimal_precision as dp from tools.translate import _ from tools.float_utils import float_round from openerp import SUPERUSER_ID - +import tools _logger = logging.getLogger(__name__) @@ -227,7 +227,7 @@ class account_account(osv.osv): while pos < len(args): if args[pos][0] == 'code' and args[pos][1] in ('like', 'ilike') and args[pos][2]: - args[pos] = ('code', '=like', str(args[pos][2].replace('%', ''))+'%') + args[pos] = ('code', '=like', tools.ustr(args[pos][2].replace('%', ''))+'%') if args[pos][0] == 'journal_id': if not args[pos][2]: del args[pos] @@ -682,7 +682,7 @@ class account_journal_view(osv.osv): _name = "account.journal.view" _description = "Journal View" _columns = { - 'name': fields.char('Journal View', size=64, required=True), + 'name': fields.char('Journal View', size=64, required=True, translate=True), 'columns_id': fields.one2many('account.journal.column', 'view_id', 'Columns') } _order = "name" @@ -1908,7 +1908,7 @@ class account_tax(osv.osv): 'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."), 'include_base_amount': fields.boolean('Included in base amount', help="Indicates if the amount of tax must be included in the base amount for the computation of the next taxes"), 'company_id': fields.many2one('res.company', 'Company', required=True), - 'description': fields.char('Tax Code',size=32), + 'description': fields.char('Tax Code'), 'price_include': fields.boolean('Tax Included in Price', help="Check this if the price you use on the product and invoices includes this tax."), 'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Application', required=True) @@ -2518,7 +2518,7 @@ class account_account_template(osv.osv): 'reconcile': fields.boolean('Allow Reconciliation', help="Check this option if you want the user to reconcile entries in this account."), 'shortcut': fields.char('Shortcut', size=12), 'note': fields.text('Note'), - 'parent_id': fields.many2one('account.account.template', 'Parent Account Template', ondelete='cascade'), + 'parent_id': fields.many2one('account.account.template', 'Parent Account Template', ondelete='cascade', domain=[('type','=','view')]), 'child_parent_ids':fields.one2many('account.account.template', 'parent_id', 'Children'), 'tax_ids': fields.many2many('account.tax.template', 'account_account_template_tax_rel', 'account_id', 'tax_id', 'Default Taxes'), 'nocreate': fields.boolean('Optional create', help="If checked, the new chart of accounts will not contain this by default."), @@ -2536,20 +2536,6 @@ class account_account_template(osv.osv): (_check_recursion, 'Error!\nYou cannot create recursive account templates.', ['parent_id']), ] - def create(self, cr, uid, vals, context=None): - if 'parent_id' in vals: - parent = self.read(cr, uid, [vals['parent_id']], ['type']) - if parent and parent[0]['type'] != 'view': - raise osv.except_osv(_('Warning!'), _("You may only select a parent account of type 'View'.")) - return super(account_account_template, self).create(cr, uid, vals, context=context) - - def write(self, cr, uid, ids, vals, context=None): - if 'parent_id' in vals: - parent = self.read(cr, uid, [vals['parent_id']], ['type']) - if parent and parent[0]['type'] != 'view': - raise osv.except_osv(_('Warning!'), _("You may only select a parent account of type 'View'.")) - return super(account_account_template, self).write(cr, uid, ids, vals, context=context) - def name_get(self, cr, uid, ids, context=None): if not ids: return [] @@ -2828,7 +2814,7 @@ class account_tax_template(osv.osv): 'ref_base_sign': fields.float('Base Code Sign', help="Usually 1 or -1."), 'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."), 'include_base_amount': fields.boolean('Include in Base Amount', help="Set if the amount of tax must be included in the base amount before computing the next taxes."), - 'description': fields.char('Internal Name', size=32), + 'description': fields.char('Internal Name'), 'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Use In', required=True,), 'price_include': fields.boolean('Tax Included in Price', help="Check this if the price you use on the product and invoices includes this tax."), } diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 9889eadf387..b4fc2388a68 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -457,6 +457,8 @@ class account_bank_statement(osv.osv): return res and res[0] or 0.0 def onchange_journal_id(self, cr, uid, statement_id, journal_id, context=None): + if not journal_id: + return {} balance_start = self._compute_balance_end_real(cr, uid, journal_id, context=context) journal_data = self.pool.get('account.journal').read(cr, uid, journal_id, ['default_debit_account_id', 'company_id'], context=context) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index aff38d71cfe..a1c53eff4b1 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -508,8 +508,10 @@ class account_invoice(osv.osv): if journal_id: journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context) currency_id = journal.currency and journal.currency.id or journal.company_id.currency_id.id + company_id = journal.company_id.id result = {'value': { 'currency_id': currency_id, + 'company_id': company_id, } } return result @@ -1371,7 +1373,10 @@ class account_invoice_line(osv.osv): 'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True) } - def _default_account_id(self, cr, uid, ids, context=None): + def _default_account_id(self, cr, uid, context=None): + # XXX this gets the default account for the user's company, + # it should get the default account for the invoice's company + # however, the invoice's company does not reach this point prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context) return prop and prop.id or False @@ -1401,7 +1406,7 @@ class account_invoice_line(osv.osv): context = {} company_id = company_id if company_id != None else context.get('company_id',False) context = dict(context) - context.update({'company_id': company_id}) + context.update({'company_id': company_id, 'force_company': company_id}) if not partner_id: raise osv.except_osv(_('No Partner Defined !'),_("You must first select a partner !") ) if not product: @@ -1556,16 +1561,19 @@ class account_invoice_line(osv.osv): def onchange_account_id(self, cr, uid, ids, product_id, partner_id, inv_type, fposition_id, account_id): if not account_id: return {} - taxes = self.pool.get('account.account').browse(cr, uid, account_id).tax_ids + unique_tax_ids = [] fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id) or False - tax_ids = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) - - product_change_result = self.product_id_change(cr, uid, ids, product_id, False, type=inv_type, - partner_id=partner_id, fposition_id=fposition_id) - unique_tax_ids = set(tax_ids) - if product_change_result and 'value' in product_change_result and 'invoice_line_tax_id' in product_change_result['value']: - unique_tax_ids |= set(product_change_result['value']['invoice_line_tax_id']) - return {'value':{'invoice_line_tax_id': list(unique_tax_ids)}} + account = self.pool.get('account.account').browse(cr, uid, account_id) + if not product_id: + taxes = account.tax_ids + unique_tax_ids = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) + else: + product_change_result = self.product_id_change(cr, uid, ids, product_id, False, type=inv_type, + partner_id=partner_id, fposition_id=fposition_id, + company_id=account.company_id.id) + if product_change_result and 'value' in product_change_result and 'invoice_line_tax_id' in product_change_result['value']: + unique_tax_ids = product_change_result['value']['invoice_line_tax_id'] + return {'value':{'invoice_line_tax_id': unique_tax_ids}} account_invoice_line() @@ -1650,14 +1658,13 @@ class account_invoice_tax(osv.osv): for line in inv.invoice_line: for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, (line.price_unit* (1-(line.discount or 0.0)/100.0)), line.quantity, line.product_id, inv.partner_id)['taxes']: - tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit']) val={} val['invoice_id'] = inv.id val['name'] = tax['name'] val['amount'] = tax['amount'] val['manual'] = False val['sequence'] = tax['sequence'] - val['base'] = tax['price_unit'] * line['quantity'] + val['base'] = cur_obj.round(cr, uid, cur, tax['price_unit'] * line['quantity']) if inv.type in ('out_invoice','in_invoice'): val['base_code_id'] = tax['base_code_id'] diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 1c4d83106ca..4a587eee6fe 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -278,6 +278,7 @@
+
@@ -299,8 +300,8 @@ + + @@ -479,6 +479,7 @@
+
diff --git a/addons/event/res_partner_view.xml b/addons/event/res_partner_view.xml index 8e5ff480c2c..c3e8073a7ae 100644 --- a/addons/event/res_partner_view.xml +++ b/addons/event/res_partner_view.xml @@ -16,7 +16,7 @@ False - + @@ -24,7 +24,7 @@ - + diff --git a/addons/event/security/event_security.xml b/addons/event/security/event_security.xml index f46bc5fff96..2cc749a1a40 100644 --- a/addons/event/security/event_security.xml +++ b/addons/event/security/event_security.xml @@ -3,7 +3,7 @@ - Event + Events Helps you manage your Events. 3 diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py index 70a05c6bd0e..e0023697594 100644 --- a/addons/fetchmail/fetchmail.py +++ b/addons/fetchmail/fetchmail.py @@ -195,7 +195,7 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS strip_attachments=(not server.attach), context=context) if res_id and server.action_id: - action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]}) + action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id], 'active_model': context.get("thread_model", False)}) imap_server.store(num, '+FLAGS', '\\Seen') cr.commit() count += 1 @@ -220,7 +220,7 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS strip_attachments=(not server.attach), context=context) if res_id and server.action_id: - action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]}) + action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id], 'active_model': context.get("thread_model", False)}) pop_server.dele(num) cr.commit() _logger.info("fetched/processed %s email(s) on %s server %s", numMsgs, server.type, server.name) diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 5d4c2ae9d45..6253205eb7e 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -205,25 +205,6 @@ - - - kanban - - - - - tree - - - - - - - form - - - - @@ -350,10 +331,8 @@
- -
@@ -374,14 +353,14 @@
- - - - +
+
+
+
diff --git a/addons/hr/res_config_view.xml b/addons/hr/res_config_view.xml index 7507665c96d..f370b26139d 100644 --- a/addons/hr/res_config_view.xml +++ b/addons/hr/res_config_view.xml @@ -69,7 +69,7 @@
- + @@ -92,14 +92,14 @@ -
-
- + @@ -134,14 +134,18 @@ - + - + +
+ + +
@@ -318,9 +322,9 @@ - + - + @@ -332,18 +336,23 @@ - + - + - + + hr_timesheet_sheet.sheet + form + Timesheets + tree,form + {'search_default_employee_id': [active_id], 'default_employee_id': active_id} + + hr.timesheet.sheet.employee.extd_form hr.employee diff --git a/addons/hr_timesheet_sheet/report/hr_timesheet_report.py b/addons/hr_timesheet_sheet/report/hr_timesheet_report.py index 49b18f75e4b..1fdcac9f7c6 100644 --- a/addons/hr_timesheet_sheet/report/hr_timesheet_report.py +++ b/addons/hr_timesheet_sheet/report/hr_timesheet_report.py @@ -43,7 +43,7 @@ class hr_timesheet_report(osv.osv): 'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True), 'company_id': fields.many2one('res.company', 'Company',readonly=True), 'cost': fields.float('Cost',readonly=True, digits_compute=dp.get_precision('Account')), - 'quantity': fields.float('Quantity',readonly=True), + 'quantity': fields.float('Time',readonly=True), } def init(self, cr): diff --git a/addons/hr_timesheet_sheet/report/timesheet_report.py b/addons/hr_timesheet_sheet/report/timesheet_report.py index 38e19d708d4..3db7ff8feb2 100644 --- a/addons/hr_timesheet_sheet/report/timesheet_report.py +++ b/addons/hr_timesheet_sheet/report/timesheet_report.py @@ -52,7 +52,7 @@ class timesheet_report(osv.osv): ('draft','Draft'), ('confirm','Confirmed'), ('done','Done')], 'Status', readonly=True), - 'quantity': fields.float('#Quantity',readonly=True), + 'quantity': fields.float('Time',readonly=True), 'cost': fields.float('#Cost',readonly=True), } diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml index eab3d03ceea..1b7cc5446b8 100644 --- a/addons/idea/idea_view.xml +++ b/addons/idea/idea_view.xml @@ -77,6 +77,7 @@
+
diff --git a/addons/import_google/wizard/google_import_message_view.xml b/addons/import_google/wizard/google_import_message_view.xml index 158aff29bf3..d44bd8e26ec 100644 --- a/addons/import_google/wizard/google_import_message_view.xml +++ b/addons/import_google/wizard/google_import_message_view.xml @@ -10,6 +10,9 @@ +
+
diff --git a/addons/import_google/wizard/import_google.py b/addons/import_google/wizard/import_google.py index d231c186321..f8fc8991975 100644 --- a/addons/import_google/wizard/import_google.py +++ b/addons/import_google/wizard/import_google.py @@ -27,6 +27,7 @@ from dateutil import * from pytz import timezone from datetime import datetime import time +import base64 from osv import * from tools.translate import _ @@ -282,7 +283,7 @@ class google_import(import_framework): self.contact = self.gd_client.GetContactsFeed() while self.contact: for entry in self.contact.entry: - data = {} + data = {} data['id'] = entry.id.text name = tools.ustr(entry.title.text) if name == "None": @@ -290,6 +291,8 @@ class google_import(import_framework): data['name'] = name or _('Unknown') emails = ','.join(email.address for email in entry.email) data['email'] = emails + if self.gd_client.GetPhoto(entry): + data['image'] = base64.encodestring(self.gd_client.GetPhoto(entry)) if table == 'Contact': data.update({'customer': str(self.context.get('customer')), 'supplier': str(self.context.get('supplier'))}) @@ -322,6 +325,12 @@ class google_import(import_framework): 'name': value('company', fallback='name'), 'customer': 'customer', 'supplier': 'supplier', + 'city': 'city', + 'phone': 'phone', + 'mobile': 'mobile', + 'email': 'email', + 'image': 'image', + 'fax': 'fax', 'child_ids/id': ref(self.TABLE_ADDRESS, 'id'), } } diff --git a/addons/import_google/wizard/import_google_data.py b/addons/import_google/wizard/import_google_data.py index 2132d141e29..5ce1d160f3e 100644 --- a/addons/import_google/wizard/import_google_data.py +++ b/addons/import_google/wizard/import_google_data.py @@ -104,7 +104,7 @@ class synchronize_google(osv.osv_memory): _columns = { 'customer': fields.boolean('Customer', help="Check this box to set newly created partner as Customer."), 'supplier': fields.boolean('Supplier', help="Check this box to set newly created partner as Supplier."), - 'group_name': fields.selection(_get_group, "Group Name",help="Choose which group to import, By default it takes all."), + 'group_name': fields.selection(_get_group, "Group Name", help="Choose which group to import, By default it takes all."), 'calendar_name': fields.selection(_get_calendars, "Calendar Name"), } diff --git a/addons/import_google/wizard/import_google_data_view.xml b/addons/import_google/wizard/import_google_data_view.xml index f8e110e6a5d..e11b5aa2d08 100644 --- a/addons/import_google/wizard/import_google_data_view.xml +++ b/addons/import_google/wizard/import_google_data_view.xml @@ -7,7 +7,7 @@
- + @@ -32,7 +32,7 @@ - +