diff --git a/addons/account_analytic_analysis/test/account_analytic_analysis.yml b/addons/account_analytic_analysis/test/account_analytic_analysis.yml
index 49668a2b781..4f594b6bed3 100644
--- a/addons/account_analytic_analysis/test/account_analytic_analysis.yml
+++ b/addons/account_analytic_analysis/test/account_analytic_analysis.yml
@@ -20,6 +20,7 @@
!record {model: account.analytic.account, id: contract_main}:
partner_id: base.main_partner
template_id: account_analytic_analysis.contract_template
+ type: contract
-
I check that the contract inherited from data of the template
-
@@ -32,7 +33,7 @@
I generate all invoices from contracts having recurring invoicing
-
!python {model: account.analytic.account}: |
- self.recurring_create_invoice(cr, uid)
+ self.recurring_create_invoice(cr, uid, [])
-
I test the generated invoice
-
diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py
index 4cf12098fff..23a309c1dda 100644
--- a/addons/account_analytic_plans/account_analytic_plans.py
+++ b/addons/account_analytic_plans/account_analytic_plans.py
@@ -454,15 +454,10 @@ class account_bank_statement(osv.osv):
_inherit = "account.bank.statement"
_name = "account.bank.statement"
- def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None):
- account_move_line_pool = self.pool.get('account.move.line')
- account_bank_statement_line_pool = self.pool.get('account.bank.statement.line')
- st_line = account_bank_statement_line_pool.browse(cr, uid, st_line_id, context=context)
- result = super(account_bank_statement,self).create_move_from_st_line(cr, uid, st_line_id, company_currency_id, st_line_number, context=context)
- move = st_line.move_ids and st_line.move_ids[0] or False
- if move:
- for line in move.line_id:
- account_move_line_pool.write(cr, uid, [line.id], {'analytics_id':st_line.analytics_id.id}, context=context)
+ def _prepare_bank_move_line(self, cr, uid, st_line, move_id, amount, company_currency_id, context=None):
+ result = super(account_bank_statement,self)._prepare_bank_move_line(cr, uid, st_line,
+ move_id, amount, company_currency_id, context=context)
+ result['analytics_id'] = st_line.analytics_id.id
return result
def button_confirm_bank(self, cr, uid, ids, context=None):
diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py
index 81394bc926e..8ef17fa886c 100644
--- a/addons/account_anglo_saxon/invoice.py
+++ b/addons/account_anglo_saxon/invoice.py
@@ -123,6 +123,8 @@ class account_invoice_line(osv.osv):
if a == line['account_id'] and i_line.product_id.id == line['product_id']:
uom = i_line.product_id.uos_id or i_line.product_id.uom_id
valuation_price_unit = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.standard_price, i_line.uos_id.id)
+ if inv.currency_id.id != company_currency:
+ standard_price = self.pool.get('res.currency').compute(cr, uid, company_currency, inv.currency_id.id, standard_price, context={'date': inv.date_invoice})
if i_line.product_id.cost_method != 'standard' and i_line.purchase_line_id:
#for average/fifo/lifo costing method, fetch real cost price from incomming moves
stock_move_obj = self.pool.get('stock.move')
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index 771c6e15bd8..a70684df1ad 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -783,6 +783,7 @@ class account_voucher(osv.osv):
total_credit += line.credit and line.amount_currency or 0.0
total_debit += line.debit and line.amount_currency or 0.0
+ remaining_amount = price
#voucher line creation
for line in account_move_lines:
@@ -803,13 +804,13 @@ class account_voucher(osv.osv):
'move_line_id':line.id,
'account_id':line.account_id.id,
'amount_original': amount_original,
- 'amount': (line.id in move_lines_found) and min(abs(price), amount_unreconciled) or 0.0,
+ 'amount': (line.id in move_lines_found) and min(abs(remaining_amount), amount_unreconciled) or 0.0,
'date_original':line.date,
'date_due':line.date_maturity,
'amount_unreconciled': amount_unreconciled,
'currency_id': line_currency_id,
}
- price -= rs['amount']
+ remaining_amount -= rs['amount']
#in case a corresponding move_line hasn't been found, we now try to assign the voucher amount
#on existing invoices: we split voucher amount by most old first, but only for lines in the same currency
if not move_lines_found:
@@ -937,19 +938,17 @@ class account_voucher(osv.osv):
def cancel_voucher(self, cr, uid, ids, context=None):
reconcile_pool = self.pool.get('account.move.reconcile')
move_pool = self.pool.get('account.move')
-
+ move_line_pool = self.pool.get('account.move.line')
for voucher in self.browse(cr, uid, ids, context=context):
# refresh to make sure you don't unlink an already removed move
voucher.refresh()
- recs = []
for line in voucher.move_ids:
if line.reconcile_id:
- recs += [line.reconcile_id.id]
- if line.reconcile_partial_id:
- recs += [line.reconcile_partial_id.id]
-
- reconcile_pool.unlink(cr, uid, recs)
-
+ move_lines = [move_line.id for move_line in line.reconcile_id.line_id]
+ move_lines.remove(line.id)
+ reconcile_pool.unlink(cr, uid, [line.reconcile_id.id])
+ if len(move_lines) >= 2:
+ move_line_pool.reconcile_partial(cr, uid, move_lines, 'auto',context=context)
if voucher.move_id:
move_pool.button_cancel(cr, uid, [voucher.move_id.id])
move_pool.unlink(cr, uid, [voucher.move_id.id])
diff --git a/addons/account_voucher/test/sales_payment.yml b/addons/account_voucher/test/sales_payment.yml
index 3679c34dc52..ed9305a320c 100644
--- a/addons/account_voucher/test/sales_payment.yml
+++ b/addons/account_voucher/test/sales_payment.yml
@@ -44,6 +44,8 @@
!python {model: account.voucher}: |
vals = {}
journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None)
+ voucher = self.recompute_voucher_lines(cr, uid, [], ref("base.res_partner_19"), journal_id, 450.0, ref('base.EUR'), 'receipt', False)
+ assert (voucher['value'].get('writeoff_amount') == 0.0), "Writeoff amount calculated by recompute_voucher_lines() is not 0.0"
res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_19"), journal_id, 0.0, 1, ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
@@ -64,6 +66,7 @@
vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
id = self.create(cr, uid, vals)
voucher_id = self.browse(cr, uid, id)
+ assert (voucher_id.writeoff_amount == 0.0), "Writeoff amount is not 0.0"
assert (voucher_id.state=='draft'), "Voucher is not in draft state"
self.signal_proforma_voucher(cr, uid, [voucher_id.id])
diff --git a/addons/base_geolocalize/views/res_partner_view.xml b/addons/base_geolocalize/views/res_partner_view.xml
index 24cc8d2d21d..1bd537ae3ff 100644
--- a/addons/base_geolocalize/views/res_partner_view.xml
+++ b/addons/base_geolocalize/views/res_partner_view.xml
@@ -8,7 +8,7 @@
-
+
-
+
diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py
index dd9ed49d3ef..7321d9dca08 100644
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -431,7 +431,7 @@ class email_template(osv.osv):
is taken from template definition)
:returns: a dict containing all relevant fields for creating a new
mail.mail entry, with one extra key ``attachments``, in the
- format expected by :py:meth:`mail_thread.message_post`.
+ format [(report_name, data)] where data is base64 encoded.
"""
if context is None:
context = {}
@@ -492,7 +492,8 @@ class email_template(osv.osv):
result, format = self.pool['report'].get_pdf(cr, uid, [res_id], report_service, context=ctx), 'pdf'
else:
result, format = openerp.report.render_report(cr, uid, [res_id], report_service, {'model': template.model}, ctx)
-
+
+ # TODO in trunk, change return format to binary to match message_post expected format
result = base64.b64encode(result)
if not report_name:
report_name = 'report.' + report_service
diff --git a/addons/email_template/tests/test_mail.py b/addons/email_template/tests/test_mail.py
index 8bc6d62017c..beda74d0853 100644
--- a/addons/email_template/tests/test_mail.py
+++ b/addons/email_template/tests/test_mail.py
@@ -62,7 +62,7 @@ class test_message_compose(TestMail):
'name': 'Pigs Template',
'subject': '${object.name}',
'body_html': '${object.description}',
- 'user_signature': True,
+ 'user_signature': False,
'attachment_ids': [(0, 0, _attachments[0]), (0, 0, _attachments[1])],
'email_to': 'b@b.b, c@c.c',
'email_cc': 'd@d.d'
@@ -157,7 +157,7 @@ class test_message_compose(TestMail):
message_pids = [partner.id for partner in compose.partner_ids]
partner_ids = [p_a_id]
self.assertEqual(compose.subject, '${object.name}', 'mail.compose.message subject incorrect')
- self.assertEqual(compose.body, '
${object.description}
', 'mail.compose.message body incorrect')
+ self.assertEqual(compose.body, '
${object.description}
', 'mail.compose.message body incorrect') # todo: check signature
self.assertEqual(set(message_pids), set(partner_ids), 'mail.compose.message partner_ids incorrect')
# 2. Post the comment, get created message
diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py
index 676f11b23e3..7d148c87e3c 100644
--- a/addons/email_template/wizard/mail_compose_message.py
+++ b/addons/email_template/wizard/mail_compose_message.py
@@ -87,9 +87,16 @@ class mail_compose_message(osv.TransientModel):
""" - mass_mailing: we cannot render, so return the template values
- normal mode: return rendered values """
if template_id and composition_mode == 'mass_mail':
- fields = ['subject', 'body_html', 'email_from', 'reply_to', 'attachment_ids', 'mail_server_id']
- template_values = self.pool.get('email.template').read(cr, uid, template_id, fields, context)
- values = dict((field, template_values[field]) for field in fields if template_values.get(field))
+ fields = ['subject', 'body_html', 'email_from', 'reply_to', 'mail_server_id']
+ template = self.pool['email.template'].browse(cr, uid, template_id, context=context)
+ values = dict((field, getattr(template, field)) for field in fields if getattr(template, field))
+ if template.attachment_ids:
+ values['attachment_ids'] = [att.id for att in template.attachment_ids]
+ if template.mail_server_id:
+ values['mail_server_id'] = template.mail_server_id.id
+ if template.user_signature and 'body_html' in values:
+ signature = self.pool.get('res.users').browse(cr, uid, uid, context).signature
+ values['body_html'] = tools.append_content_to_html(values['body_html'], signature)
elif template_id:
values = self.generate_email_for_composer_batch(cr, uid, template_id, [res_id], context=context)[res_id]
# transform attachments into attachment_ids; not attached to the document because this will
diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py
index 8b9352cb91b..b7cb37571a4 100644
--- a/addons/event_sale/event_sale.py
+++ b/addons/event_sale/event_sale.py
@@ -167,12 +167,23 @@ class event_ticket(osv.osv):
if ticket.seats_max > 0 else None
return res
+ def _is_expired(self, cr, uid, ids, field_name, args, context=None):
+ # FIXME: A ticket is considered expired when the deadline is passed. The deadline should
+ # be considered in the timezone of the event, not the timezone of the user!
+ # Until we add a TZ on the event we'll use the context's current date, more accurate
+ # than using UTC all the time.
+ current_date = fields.date.context_today(self, cr, uid, context=context)
+ return {ticket.id: ticket.deadline and ticket.deadline < current_date
+ for ticket in self.browse(cr, uid, ids, context=context)}
+
+
_columns = {
'name': fields.char('Name', size=64, required=True, translate=True),
'event_id': fields.many2one('event.event', "Event", required=True, ondelete='cascade'),
'product_id': fields.many2one('product.product', 'Product', required=True, domain=[("event_type_id", "!=", False)]),
'registration_ids': fields.one2many('event.registration', 'event_ticket_id', 'Registrations'),
'deadline': fields.date("Sales End"),
+ 'is_expired': fields.function(_is_expired, type='boolean', string='Is Expired'),
'price': fields.float('Price'),
'seats_max': fields.integer('Maximum Avalaible Seats', oldname='register_max', help="You can for each event define a maximum registration level. If you have too much registrations you are not able to confirm your event. (put 0 to ignore this rule )"),
'seats_reserved': fields.function(_get_seats, string='Reserved Seats', type='integer', multi='seats_reserved'),
diff --git a/addons/gamification/data/badge.xml b/addons/gamification/data/badge.xml
index 33d02bf016e..cc9df921309 100644
--- a/addons/gamification/data/badge.xml
+++ b/addons/gamification/data/badge.xml
@@ -41,10 +41,6 @@
Badge Granted
-
-
-
-
Received Badge
diff --git a/addons/gamification/data/cron.xml b/addons/gamification/data/cron.xml
index 8585771c97d..105f7d25681 100644
--- a/addons/gamification/data/cron.xml
+++ b/addons/gamification/data/cron.xml
@@ -1,6 +1,6 @@
-
+
Run Goal Challenge Checker
diff --git a/addons/gamification/data/goal_base.xml b/addons/gamification/data/goal_base.xml
index c12763025f6..f249e566b9f 100644
--- a/addons/gamification/data/goal_base.xml
+++ b/addons/gamification/data/goal_base.xml
@@ -90,10 +90,6 @@
]]>
-
-
-
-
Set your Timezone
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py
index a0c4b638ae3..ecb4c495d94 100644
--- a/addons/gamification/models/challenge.py
+++ b/addons/gamification/models/challenge.py
@@ -200,7 +200,6 @@ class gamification_challenge(osv.Model):
'visibility_mode': 'personal',
'report_message_frequency': 'never',
'last_report_date': fields.date.today,
- 'start_date': fields.date.today,
'manager_id': lambda s, cr, uid, c: uid,
'category': 'hr',
'reward_failure': False,
@@ -269,13 +268,15 @@ class gamification_challenge(osv.Model):
planned_challenge_ids = self.search(cr, uid, [
('state', '=', 'draft'),
('start_date', '<=', fields.date.today())])
- self.write(cr, uid, planned_challenge_ids, {'state': 'inprogress'}, context=context)
+ if planned_challenge_ids:
+ self.write(cr, uid, planned_challenge_ids, {'state': 'inprogress'}, context=context)
# close scheduled challenges
planned_challenge_ids = self.search(cr, uid, [
('state', '=', 'inprogress'),
('end_date', '>=', fields.date.today())])
- self.write(cr, uid, planned_challenge_ids, {'state': 'done'}, context=context)
+ if planned_challenge_ids:
+ self.write(cr, uid, planned_challenge_ids, {'state': 'done'}, context=context)
if not ids:
ids = self.search(cr, uid, [('state', '=', 'inprogress')], context=context)
diff --git a/addons/gamification/security/gamification_security.xml b/addons/gamification/security/gamification_security.xml
index 904ba50721e..5339b400061 100644
--- a/addons/gamification/security/gamification_security.xml
+++ b/addons/gamification/security/gamification_security.xml
@@ -39,5 +39,12 @@
[(1, '=', 1)]
+
+ User can only see his/her goals or goal from the same challenge in board visibility
+
+ [('user_id.company_id', 'child_of', [user.company_id.id])]
+
+
+
diff --git a/addons/gamification_sale_crm/sale_crm_goals.xml b/addons/gamification_sale_crm/sale_crm_goals.xml
index ffb3a24318a..f42585fe59a 100644
--- a/addons/gamification_sale_crm/sale_crm_goals.xml
+++ b/addons/gamification_sale_crm/sale_crm_goals.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/hr/static/description/index.html b/addons/hr/static/description/index.html
index f97cb462fe3..55e54aa92fb 100644
--- a/addons/hr/static/description/index.html
+++ b/addons/hr/static/description/index.html
@@ -28,7 +28,7 @@ Get all your HR operations managed easily: knowledge sharing, recruitments, appr
Manage Your Employees
-Oversee all important information in your company address book. Some information are restricted to HR managers, others are public to easily find colleagues.
+Oversee all important information in your company address book. Some information are restricted to HR managers, others are public to easily look colleagues.
Record employee contracts and get alerts when they have to be renewed.
@@ -154,7 +154,7 @@ Inspire achievement with challenges, goals and rewards. Define clear objectives
-
Personnal Objectives
+
Personal Objectives
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index e8349f68a58..6c9156f6be0 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -62,28 +62,56 @@ class hr_timesheet_sheet(osv.osv):
def copy(self, cr, uid, ids, *args, **argv):
raise osv.except_osv(_('Error!'), _('You cannot duplicate a timesheet.'))
- def create(self, cr, uid, vals, *args, **argv):
+ def create(self, cr, uid, vals, context=None):
if 'employee_id' in vals:
- if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id:
+ if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id'], context=context).user_id:
raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign it to a user.'))
- if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id:
+ if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id'], context=context).product_id:
raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product, like \'Consultant\'.'))
- if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id:
+ if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id'], context=context).journal_id:
raise osv.except_osv(_('Configuration Error!'), _('In order to create a timesheet for this employee, you must assign an analytic journal to the employee, like \'Timesheet Journal\'.'))
- return super(hr_timesheet_sheet, self).create(cr, uid, vals, *args, **argv)
+ if vals.get('attendances_ids'):
+ # If attendances, we sort them by date asc before writing them, to satisfy the alternance constraint
+ vals['attendances_ids'] = self.sort_attendances(cr, uid, vals['attendances_ids'], context=context)
+ return super(hr_timesheet_sheet, self).create(cr, uid, vals, context=context)
- def write(self, cr, uid, ids, vals, *args, **argv):
+ def write(self, cr, uid, ids, vals, context=None):
if 'employee_id' in vals:
- new_user_id = self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id.id or False
+ new_user_id = self.pool.get('hr.employee').browse(cr, uid, vals['employee_id'], context=context).user_id.id or False
if not new_user_id:
raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign it to a user.'))
- if not self._sheet_date(cr, uid, ids, forced_user_id=new_user_id):
+ if not self._sheet_date(cr, uid, ids, forced_user_id=new_user_id, context=context):
raise osv.except_osv(_('Error!'), _('You cannot have 2 timesheets that overlap!\nYou should use the menu \'My Timesheet\' to avoid this problem.'))
- if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id:
+ if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id'], context=context).product_id:
raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product.'))
- if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id:
+ if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id'], context=context).journal_id:
raise osv.except_osv(_('Configuration Error!'), _('In order to create a timesheet for this employee, you must assign an analytic journal to the employee, like \'Timesheet Journal\'.'))
- return super(hr_timesheet_sheet, self).write(cr, uid, ids, vals, *args, **argv)
+ if vals.get('attendances_ids'):
+ # If attendances, we sort them by date asc before writing them, to satisfy the alternance constraint
+ # In addition to the date order, deleting attendances are done before inserting attendances
+ vals['attendances_ids'] = self.sort_attendances(cr, uid, vals['attendances_ids'], context=context)
+ res = super(hr_timesheet_sheet, self).write(cr, uid, ids, vals, context=context)
+ if vals.get('attendances_ids'):
+ for timesheet in self.browse(cr, uid, ids):
+ if not self.pool['hr.attendance']._altern_si_so(cr, uid, [att.id for att in timesheet.attendances_ids]):
+ raise osv.except_osv(_('Warning !'), _('Error ! Sign in (resp. Sign out) must follow Sign out (resp. Sign in)'))
+ return res
+
+ def sort_attendances(self, cr, uid, attendance_tuples, context=None):
+ date_attendances = []
+ for att_tuple in attendance_tuples:
+ if att_tuple[0] in [0,1,4]:
+ if att_tuple[0] in [0,1]:
+ name = att_tuple[2]['name']
+ else:
+ name = self.pool['hr.attendance'].browse(cr, uid, att_tuple[1]).name
+ date_attendances.append((1, name, att_tuple))
+ elif att_tuple[0] in [2,3]:
+ date_attendances.append((0, self.pool['hr.attendance'].browse(cr, uid, att_tuple[1]).name, att_tuple))
+ else:
+ date_attendances.append((0, False, att_tuple))
+ date_attendances.sort()
+ return [att[2] for att in date_attendances]
def button_confirm(self, cr, uid, ids, context=None):
for sheet in self.browse(cr, uid, ids, context=context):
diff --git a/addons/mail/mail_mail_view.xml b/addons/mail/mail_mail_view.xml
index e259d28a2b7..52a8d2beadf 100644
--- a/addons/mail/mail_mail_view.xml
+++ b/addons/mail/mail_mail_view.xml
@@ -92,7 +92,7 @@
mail.mail
-
+
diff --git a/addons/mrp/static/description/index.html b/addons/mrp/static/description/index.html
index d44da3f37b1..d6524b6e554 100644
--- a/addons/mrp/static/description/index.html
+++ b/addons/mrp/static/description/index.html
@@ -63,7 +63,7 @@ manufacturing orders.
-
Get Flexibility In All Opertions
+
Get Flexibility In All Operations
Edit manually all proposed operations at any level of the progress.
@@ -110,7 +110,7 @@ meets your delivery schedule dates.
Organize manufacturing orders and work orders the way you like it. Process next
-orders from the list view, control inthe calendar view and edit the proposed
+orders from the list view, control in the calendar view and edit the proposed
schedule in the Gantt view.
diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py
index 2653c558923..e94a5f60181 100644
--- a/addons/note/__openerp__.py
+++ b/addons/note/__openerp__.py
@@ -27,8 +27,8 @@
This module allows users to create their own notes inside OpenERP
=================================================================
-Use notes to write meeting minutes, organize ideas, organize personnal todo
-lists, etc. Each user manages his own personnal Notes. Notes are available to
+Use notes to write meeting minutes, organize ideas, organize personal todo
+lists, etc. Each user manages his own personal Notes. Notes are available to
their authors only, but they can share notes to others users so that several
people can work on the same note in real time. It's very efficient to share
meeting minutes.
diff --git a/addons/note/note.py b/addons/note/note.py
index 38b2395a852..2d6e5f8c098 100644
--- a/addons/note/note.py
+++ b/addons/note/note.py
@@ -123,16 +123,15 @@ class note_note(osv.osv):
current_stage_ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)], context=context)
if current_stage_ids: #if the user have some stages
-
- #dict of stages: map les ids sur les noms
- stage_name = dict(self.pool.get('note.stage').name_get(cr, uid, current_stage_ids, context=context))
+ stages = self.pool['note.stage'].browse(cr, uid, current_stage_ids, context=context)
result = [{ #notes by stage for stages user
'__context': {'group_by': groupby[1:]},
- '__domain': domain + [('stage_ids.id', '=', current_stage_id)],
- 'stage_id': (current_stage_id, stage_name[current_stage_id]),
- 'stage_id_count': self.search(cr,uid, domain+[('stage_ids', '=', current_stage_id)], context=context, count=True)
- } for current_stage_id in current_stage_ids]
+ '__domain': domain + [('stage_ids.id', '=', stage.id)],
+ 'stage_id': (stage.id, stage.name),
+ 'stage_id_count': self.search(cr,uid, domain+[('stage_ids', '=', stage.id)], context=context, count=True),
+ '__fold': stage.fold,
+ } for stage in stages]
#note without user's stage
nb_notes_ws = self.search(cr,uid, domain+[('stage_ids', 'not in', current_stage_ids)], context=context, count=True)
@@ -148,8 +147,9 @@ class note_note(osv.osv):
result = [{
'__context': {'group_by': groupby[1:]},
'__domain': domain + [dom_not_in],
- 'stage_id': (current_stage_ids[0], stage_name[current_stage_ids[0]]),
- 'stage_id_count':nb_notes_ws
+ 'stage_id': (stages[0].id, stages[0].name),
+ 'stage_id_count':nb_notes_ws,
+ '__fold': stages[0].name,
}] + result
else: # if stage_ids is empty
diff --git a/addons/note/static/description/index.html b/addons/note/static/description/index.html
index dc688859334..b9a60d3735d 100644
--- a/addons/note/static/description/index.html
+++ b/addons/note/static/description/index.html
@@ -12,7 +12,7 @@
-Organize yourself with efficient todo lists and notes. From personnal tasks to collaborative meeting minutes, increase your user's productivity by giving them the tools to prioritize their work, share their ideas and collaborate on documents.
+Organize yourself with efficient todo lists and notes. From personal tasks to collaborative meeting minutes, increase your user's productivity by giving them the tools to prioritize their work, share their ideas and collaborate on documents.
Start your free trial
diff --git a/addons/point_of_sale/static/description/index.html b/addons/point_of_sale/static/description/index.html
index 7f1b7a5c097..cecafc69b68 100644
--- a/addons/point_of_sale/static/description/index.html
+++ b/addons/point_of_sale/static/description/index.html
@@ -117,9 +117,9 @@
-
Blasting fast search
+
Blazing fast search
- Scan products, browse through hyerarchical categories, or get quick
+ Scan products, browse through hierarchical categories, or get quick
information about products with the blasting fast filter accross
all your products.
@@ -135,7 +135,7 @@
- Consolidate all your sales channel in real time: stores, ecommerce, sales teams.
+ Consolidate all your sales channels in real time: stores, ecommerce, sales teams.
Get real time control of the inventory and accurate forecasts to manage procurements.
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index 1e7076d9c8f..e7a2e6a1c86 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -558,14 +558,14 @@ class stock_warehouse_orderpoint(osv.osv):
]
def default_get(self, cr, uid, fields, context=None):
+ warehouse_obj = self.pool.get('stock.warehouse')
res = super(stock_warehouse_orderpoint, self).default_get(cr, uid, fields, context)
# default 'warehouse_id' and 'location_id'
if 'warehouse_id' not in res:
- warehouse = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'warehouse0', context)
- res['warehouse_id'] = warehouse.id
+ warehouse_ids = res.get('company_id') and warehouse_obj.search(cr, uid, [('company_id', '=', res['company_id'])], limit=1, context=context) or []
+ res['warehouse_id'] = warehouse_ids and warehouse_ids[0] or False
if 'location_id' not in res:
- warehouse = self.pool.get('stock.warehouse').browse(cr, uid, res['warehouse_id'], context)
- res['location_id'] = warehouse.lot_stock_id.id
+ res['location_id'] = res.get('warehouse_id') and warehouse_obj.browse(cr, uid, res['warehouse_id'], context).lot_stock_id.id or False
return res
def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context=None):
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index 3af9ee608d6..46dd2a0babf 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -142,7 +142,7 @@
-
+
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 209bad47495..9b43b2cdc12 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -273,7 +273,7 @@
-
+
@@ -300,7 +300,7 @@
-
+
diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml
index 4653058c7bd..0c6e92e86ff 100644
--- a/addons/sale/sale_demo.xml
+++ b/addons/sale/sale_demo.xml
@@ -324,7 +324,6 @@ Thanks!
service150.0100.0
- produce
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index c9ffb94b985..afb320001a9 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -253,7 +253,7 @@
-
+
@@ -421,7 +421,7 @@
-
+
@@ -447,7 +447,7 @@
-
+
diff --git a/addons/sale_stock/sale_stock_demo.xml b/addons/sale_stock/sale_stock_demo.xml
index 2e7b641659d..42c09b7e9f0 100644
--- a/addons/sale_stock/sale_stock_demo.xml
+++ b/addons/sale_stock/sale_stock_demo.xml
@@ -54,6 +54,10 @@
make_to_order
+
+ produce
+
+
diff --git a/addons/stock/static/description/index.html b/addons/stock/static/description/index.html
index dd7fbe568f7..1ee9047db42 100644
--- a/addons/stock/static/description/index.html
+++ b/addons/stock/static/description/index.html
@@ -69,7 +69,7 @@ planning and jobs with the scheduler to reduce your process time.
Get your pickings, packings, receptions and internal moves scheduled
automatically by OpenERP using your own routing rules. Define push and pull
-rules to organize a warehouse or to manage produts's moves between several
+rules to organize a warehouse or to manage products moves between several
warehouses.
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 7e73d7fcd53..5276e7f21e5 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -718,7 +718,6 @@ class stock_picking(osv.osv):
default = {}
default = default.copy()
picking_obj = self.browse(cr, uid, id, context=context)
- move_obj = self.pool.get('stock.move')
if ('name' not in default) or (picking_obj.name == '/'):
seq_obj_name = 'stock.picking.' + picking_obj.type
default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name)
@@ -727,10 +726,6 @@ class stock_picking(osv.osv):
if 'invoice_state' not in default and picking_obj.invoice_state == 'invoiced':
default['invoice_state'] = '2binvoiced'
res = super(stock_picking, self).copy(cr, uid, id, default, context)
- if res:
- picking_obj = self.browse(cr, uid, res, context=context)
- for move in picking_obj.move_lines:
- move_obj.write(cr, uid, [move.id], {'tracking_id': False, 'prodlot_id': False, 'move_history_ids2': [(6, 0, [])], 'move_history_ids': [(6, 0, [])]})
return res
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
@@ -1797,12 +1792,15 @@ class stock_move(osv.osv):
_('Quantities, Units of Measure, Products and Locations cannot be modified on stock moves that have already been processed (except by the Administrator).'))
return super(stock_move, self).write(cr, uid, ids, vals, context=context)
- def copy(self, cr, uid, id, default=None, context=None):
+ def copy_data(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
default = default.copy()
- default.update({'move_history_ids2': [], 'move_history_ids': []})
- return super(stock_move, self).copy(cr, uid, id, default, context=context)
+ default.setdefault('tracking_id', False)
+ default.setdefault('prodlot_id', False)
+ default.setdefault('move_history_ids', [])
+ default.setdefault('move_history_ids2', [])
+ return super(stock_move, self).copy_data(cr, uid, id, default, context=context)
def _auto_init(self, cursor, context=None):
res = super(stock_move, self)._auto_init(cursor, context=context)
@@ -2072,41 +2070,46 @@ class stock_move(osv.osv):
if context is None:
context = {}
seq_obj = self.pool.get('ir.sequence')
- for picking, todo in self._chain_compute(cr, uid, moves, context=context).items():
- ptype = todo[0][1][5] and todo[0][1][5] or location_obj.picking_type_get(cr, uid, todo[0][0].location_dest_id, todo[0][1][0])
- if picking:
- # name of new picking according to its type
- if ptype == 'internal':
- new_pick_name = seq_obj.get(cr, uid,'stock.picking')
- else :
- new_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + ptype)
- pickid = self._create_chained_picking(cr, uid, new_pick_name, picking, ptype, todo, context=context)
- # Need to check name of old picking because it always considers picking as "OUT" when created from Sales Order
- old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id)
- if old_ptype != picking.type:
- old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype)
- self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name, 'type': old_ptype}, context=context)
- else:
- pickid = False
- for move, (loc, dummy, delay, dummy, company_id, ptype, invoice_state) in todo:
- new_id = move_obj.copy(cr, uid, move.id, {
- 'location_id': move.location_dest_id.id,
- 'location_dest_id': loc.id,
- 'date': time.strftime('%Y-%m-%d'),
- 'picking_id': pickid,
- 'state': 'waiting',
- 'company_id': company_id or res_obj._company_default_get(cr, uid, 'stock.company', context=context) ,
- 'move_history_ids': [],
- 'date_expected': (datetime.strptime(move.date, '%Y-%m-%d %H:%M:%S') + relativedelta(days=delay or 0)).strftime('%Y-%m-%d'),
- 'move_history_ids2': []}
- )
- move_obj.write(cr, uid, [move.id], {
- 'move_dest_id': new_id,
- 'move_history_ids': [(4, new_id)]
- })
- new_moves.append(self.browse(cr, uid, [new_id])[0])
- if pickid:
- self.pool.get('stock.picking').signal_button_confirm(cr, uid, [pickid])
+ for picking, chained_moves in self._chain_compute(cr, uid, moves, context=context).items():
+ # We group the moves by automatic move type, so it creates different pickings for different types
+ moves_by_type = {}
+ for move in chained_moves:
+ moves_by_type.setdefault(move[1][1], []).append(move)
+ for todo in moves_by_type.values():
+ ptype = todo[0][1][5] and todo[0][1][5] or location_obj.picking_type_get(cr, uid, todo[0][0].location_dest_id, todo[0][1][0])
+ if picking:
+ # name of new picking according to its type
+ if ptype == 'internal':
+ new_pick_name = seq_obj.get(cr, uid,'stock.picking')
+ else :
+ new_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + ptype)
+ pickid = self._create_chained_picking(cr, uid, new_pick_name, picking, ptype, todo, context=context)
+ # Need to check name of old picking because it always considers picking as "OUT" when created from Sales Order
+ old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id)
+ if old_ptype != picking.type:
+ old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype)
+ self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name, 'type': old_ptype}, context=context)
+ else:
+ pickid = False
+ for move, (loc, dummy, delay, dummy, company_id, ptype, invoice_state) in todo:
+ new_id = move_obj.copy(cr, uid, move.id, {
+ 'location_id': move.location_dest_id.id,
+ 'location_dest_id': loc.id,
+ 'date': time.strftime('%Y-%m-%d'),
+ 'picking_id': pickid,
+ 'state': 'waiting',
+ 'company_id': company_id or res_obj._company_default_get(cr, uid, 'stock.company', context=context) ,
+ 'move_history_ids': [],
+ 'date_expected': (datetime.strptime(move.date, '%Y-%m-%d %H:%M:%S') + relativedelta(days=delay or 0)).strftime('%Y-%m-%d'),
+ 'move_history_ids2': []}
+ )
+ move_obj.write(cr, uid, [move.id], {
+ 'move_dest_id': new_id,
+ 'move_history_ids': [(4, new_id)]
+ })
+ new_moves.append(self.browse(cr, uid, [new_id])[0])
+ if pickid:
+ self.pool.get('stock.picking').signal_button_confirm(cr, uid, [pickid])
if new_moves:
new_moves += self.create_chained_picking(cr, uid, new_moves, context)
return new_moves
@@ -2996,6 +2999,9 @@ class stock_picking_in(osv.osv):
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
return self.pool.get('stock.picking').read(cr, uid, ids, fields=fields, context=context, load=load)
+ def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
+ return self.pool['stock.picking'].read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
+
def check_access_rights(self, cr, uid, operation, raise_exception=True):
#override in order to redirect the check of acces rights on the stock.picking object
return self.pool.get('stock.picking').check_access_rights(cr, uid, operation, raise_exception=raise_exception)
@@ -3076,6 +3082,9 @@ class stock_picking_out(osv.osv):
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
return self.pool.get('stock.picking').read(cr, uid, ids, fields=fields, context=context, load=load)
+ def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
+ return self.pool['stock.picking'].read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
+
def check_access_rights(self, cr, uid, operation, raise_exception=True):
#override in order to redirect the check of acces rights on the stock.picking object
return self.pool.get('stock.picking').check_access_rights(cr, uid, operation, raise_exception=raise_exception)
diff --git a/addons/stock/wizard/stock_location_product.py b/addons/stock/wizard/stock_location_product.py
index ef7c9848160..62f80edcb57 100644
--- a/addons/stock/wizard/stock_location_product.py
+++ b/addons/stock/wizard/stock_location_product.py
@@ -28,8 +28,8 @@ class stock_location_product(osv.osv_memory):
_columns = {
'from_date': fields.datetime('From'),
'to_date': fields.datetime('To'),
- 'type': fields.selection([('inventory','Analyse Current Inventory'),
- ('period','Analyse a Period')], 'Analyse Type', required=True),
+ 'type': fields.selection([('inventory','Analyze current inventory'),
+ ('period','Analyze period')], 'Analysis Type', required=True),
}
def action_open_window(self, cr, uid, ids, context=None):
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js
index 251f1977332..832faa4ca62 100644
--- a/addons/web/static/src/js/search.js
+++ b/addons/web/static/src/js/search.js
@@ -1609,8 +1609,11 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({
return facetValue.get('label');
},
make_domain: function (name, operator, facetValue) {
- if (operator === this.default_operator) {
+ switch(operator){
+ case this.default_operator:
return [[name, '=', facetValue.get('value')]];
+ case 'child_of':
+ return [[name, 'child_of', facetValue.get('value')]];
}
return this._super(name, operator, facetValue);
},
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 13a357a1d82..2a495c397e0 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -3471,7 +3471,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
self.display_value_backup = {};
self.render_value();
self.focus();
- self.view.do_onchange(self);
+ self.trigger('changed_value');
});
});
});
diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml
index 324ae70f9e6..de31f13bd66 100644
--- a/addons/website/views/website_templates.xml
+++ b/addons/website/views/website_templates.xml
@@ -43,7 +43,7 @@
t-att-data-view-xmlid="xmlid if editable else None"
t-att-data-main-object="repr(main_object) if editable else None">
-
+
diff --git a/addons/website_event_sale/views/website_event_sale.xml b/addons/website_event_sale/views/website_event_sale.xml
index 98f505581d3..f8f3436f17e 100644
--- a/addons/website_event_sale/views/website_event_sale.xml
+++ b/addons/website_event_sale/views/website_event_sale.xml
@@ -40,8 +40,9 @@
-