diff --git a/addons/account/account.py b/addons/account/account.py
index 8681ec3506c..237969d18f5 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -629,8 +629,8 @@ class account_journal(osv.osv):
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want new account moves to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation.'),
'company_id': fields.many2one('res.company', 'Company', required=True, select=1, help="Company related to this journal"),
-# 'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \
-# help="The sequence used for invoice numbers in this journal."),
+ 'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \
+ help="The sequence used for invoice numbers in this journal."),
'allow_date':fields.boolean('Check Date not in the Period', help= 'If set to True then do not accept the entry if the entry date is not into the period dates'),
}
@@ -695,13 +695,13 @@ class account_journal(osv.osv):
'sequence_id':seq_id
})
-# if journal.type in journal_type and not journal.invoice_sequence_id:
-# res_ids = date_pool.search(cr, uid, [('model','=','ir.sequence'), ('name','=',journal_seq.get(journal.type, 'sale'))])
-# inv_seq_id = date_pool.browse(cr, uid, res_ids[0]).res_id
-# inv_seq_id
-# res.update({
-# 'invoice_sequence_id':inv_seq_id
-# })
+ if journal.type in journal_type and not journal.invoice_sequence_id:
+ res_ids = date_pool.search(cr, uid, [('model','=','ir.sequence'), ('name','=',journal_seq.get(journal.type, 'sale'))])
+ inv_seq_id = date_pool.browse(cr, uid, res_ids[0]).res_id
+ inv_seq_id
+ res.update({
+ 'invoice_sequence_id':inv_seq_id
+ })
result = self.write(cr, uid, [journal.id], res)
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index e5581f3f05d..52e1b20a744 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -49,9 +49,16 @@ class account_bank_statement(osv.osv):
}
def _default_journal_id(self, cr, uid, context={}):
- if context.get('journal_id', False):
- return context['journal_id']
- return False
+ journal_pool = self.pool.get('account.journal')
+ journal_type = context.get('journal_type', False)
+ journal_id = False
+
+ if journal_type:
+ ids = journal_pool.search(cr, uid, [('type', '=', journal_type)])
+ if ids:
+ journal_id = ids[0]
+
+ return journal_id
def _default_balance_start(self, cr, uid, context={}):
cr.execute('select id from account_bank_statement where journal_id=%s order by date desc limit 1', (1,))
@@ -128,7 +135,7 @@ class account_bank_statement(osv.osv):
'date': fields.date('Date', required=True,
states={'confirm': [('readonly', True)]}),
'journal_id': fields.many2one('account.journal', 'Journal', required=True,
- states={'confirm': [('readonly', True)]}, domain=[('type', '=', 'cash')]),
+ states={'confirm': [('readonly', True)]}, domain=[('type', '=', 'bank')]),
'period_id': fields.many2one('account.period', 'Period', required=True,
states={'confirm':[('readonly', True)]}),
'balance_start': fields.float('Starting Balance', digits_compute=dp.get_precision('Account'),
diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py
index af92d59b89b..f618bcfeefd 100644
--- a/addons/account/account_cash_statement.py
+++ b/addons/account/account_cash_statement.py
@@ -118,18 +118,18 @@ class account_cash_statement(osv.osv):
res2[statement.id]=encoding_total
return res2
- def _default_journal_id(self, cr, uid, context={}):
+# def _default_journal_id(self, cr, uid, context={}):
- """ To get default journal for the object"
- @param name: Names of fields.
- @return: journal
- """
- company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
- journal = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)])
- if journal:
- return journal[0]
- else:
- return False
+# """ To get default journal for the object"
+# @param name: Names of fields.
+# @return: journal
+# """
+# company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
+# journal = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)])
+# if journal:
+# return journal[0]
+# else:
+# return False
def _end_balance(self, cursor, user, ids, name, attr, context=None):
res_currency_obj = self.pool.get('res.currency')
@@ -174,7 +174,7 @@ class account_cash_statement(osv.osv):
return company_id
- def _get_cash_box_lines(self, cr, uid, ids, context={}):
+ def _get_cash_open_box_lines(self, cr, uid, ids, context={}):
res = []
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
@@ -182,12 +182,23 @@ class account_cash_statement(osv.osv):
'pieces':rs,
'number':0
}
- res.append((0,0,dct))
+ res.append(dct)
return res
-
+
+ def _get_cash_close_box_lines(self, cr, uid, ids, context={}):
+ res = []
+ curr = [1, 2, 5, 10, 20, 50, 100, 500]
+ for rs in curr:
+ dct = {
+ 'pieces':rs,
+ 'number':0
+ }
+ res.append((0, 0, dct))
+ return res
+
_columns = {
'company_id':fields.many2one('res.company', 'Company', required=False),
- 'journal_id': fields.many2one('account.journal', 'Journal', required=True),
+ 'journal_id': fields.many2one('account.journal', 'Journal', required=True, domain=[('type', '=', 'cash')]),
'balance_end_real': fields.float('Closing Balance', digits_compute=dp.get_precision('Account'), states={'confirm':[('readonly', True)]}, help="closing balance entered by the cashbox verifier"),
'state': fields.selection(
[('draft', 'Draft'),
@@ -206,11 +217,10 @@ class account_cash_statement(osv.osv):
'state': lambda *a: 'draft',
'name': lambda *a: '/',
'date': lambda *a:time.strftime("%Y-%m-%d %H:%M:%S"),
- 'journal_id': _default_journal_id,
'user_id': lambda self, cr, uid, context=None: uid,
'company_id': _get_company,
- 'starting_details_ids':_get_cash_box_lines,
- 'ending_details_ids':_get_cash_box_lines
+ 'starting_details_ids':_get_cash_open_box_lines,
+ 'ending_details_ids':_get_cash_open_box_lines
}
def create(self, cr, uid, vals, context=None):
@@ -224,7 +234,19 @@ class account_cash_statement(osv.osv):
open_jrnl = self.search(cr, uid, sql)
if open_jrnl:
raise osv.except_osv('Error', _('You can not have two open register for the same journal'))
+
+ if self.pool.get('account.journal').browse(cr, uid, vals['journal_id']).type == 'cash':
+ lines = end_lines = self._get_cash_close_box_lines(cr, uid, [], context)
+ vals.update({
+ 'ending_details_ids':lines
+ })
+ else:
+ vals.update({
+ 'ending_details_ids':False,
+ 'starting_details_ids':False
+ })
res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context)
+ self.write(cr, uid, [res_id], {})
return res_id
def write(self, cr, uid, ids, vals, context=None):
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 99c29ef18b9..d1cb2558f38 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -388,14 +388,15 @@
+
+
+
+
+
-
-
-
-
@@ -530,9 +531,13 @@
-
+
+
+
+
@@ -546,6 +551,7 @@
form
tree,form,graph
[('journal_id.type', '=', 'bank')]
+ {'journal_type':'bank'}
@@ -2563,6 +2569,7 @@
[('journal_id.type', '=', 'cash')]
+ {'journal_type':'cash'}
diff --git a/addons/account/installer.py b/addons/account/installer.py
index 4dd01f9ec8b..03cd2787923 100644
--- a/addons/account/installer.py
+++ b/addons/account/installer.py
@@ -298,8 +298,8 @@ class account_installer(osv.osv_memory):
# Creating Journals Sales and Purchase
vals_journal={}
- data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')])
- data = data_pool.browse(cr, uid, data_id[0])
+ data_id = mod_obj.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')])
+ data = mod_obj.browse(cr, uid, data_id[0])
view_id = data.res_id
seq_id = obj_sequence.search(cr,uid,[('name','=','Account Journal')])[0]
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index b15c8667972..1816f4c31bf 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -231,8 +231,8 @@ class account_invoice(osv.osv):
('in_refund','Supplier Refund'),
],'Type', readonly=True, select=True, change_default=True),
- 'number': fields.related('move_id','name', type='char', readonly=True, size=64, relation='account.move', store=True, string='Number'),
- #'number': fields.char('Invoice Number', size=32, readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."),
+# 'number': fields.related('move_id','name', type='char', readonly=True, size=64, relation='account.move', store=True, string='Number'),
+ 'number': fields.char('Invoice Number', size=32, readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."),
'reference': fields.char('Invoice Reference', size=64, help="The partner reference of this invoice."),
'reference_type': fields.selection(_get_reference_type, 'Reference Type',
required=True, readonly=True, states={'draft':[('readonly',False)]}),
@@ -769,7 +769,7 @@ class account_invoice(osv.osv):
cur_obj = self.pool.get('res.currency')
context = {}
for inv in self.browse(cr, uid, ids):
- if not inv.journal_id.sequence_id:
+ if not inv.journal_id.invoice_sequence_id:
raise osv.except_osv(_('Error !'), _('Please define sequence on invoice journal'))
if not inv.invoice_line:
raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.'))
@@ -927,35 +927,45 @@ class account_invoice(osv.osv):
}
def action_number(self, cr, uid, ids, *args):
- #TODO: not correct fix but required a frech values before reading it.
- self.write(cr, uid, ids, {})
+# #TODO: not correct fix but required a frech values before reading it.
+# self.write(cr, uid, ids, {})
+#
+ cr.execute('SELECT id, type, number, move_id, reference ' \
+ 'FROM account_invoice ' \
+ 'WHERE id IN ('+','.join(map(str,ids))+')')
+ obj_inv = self.browse(cr, uid, ids)[0]
- for obj_inv in self.browse(cr, uid, ids):
- id = obj_inv.id
- invtype = obj_inv.type
- number = obj_inv.number
- move_id = obj_inv.move_id and obj_inv.move_id.id or False
- reference = obj_inv.reference or ''
-
- if invtype in ('in_invoice', 'in_refund'):
- ref = reference
- else:
- ref = self._convert_ref(cr, uid, number)
-
- cr.execute('UPDATE account_move SET ref=%s ' \
- 'WHERE id=%s AND (ref is null OR ref = \'\')',
- (ref, move_id))
- cr.execute('UPDATE account_move_line SET ref=%s ' \
- 'WHERE move_id=%s AND (ref is null OR ref = \'\')',
- (ref, move_id))
- cr.execute('UPDATE account_analytic_line SET ref=%s ' \
- 'FROM account_move_line ' \
- 'WHERE account_move_line.move_id = %s ' \
- 'AND account_analytic_line.move_id = account_move_line.id',
+ for (id, invtype, number, move_id, reference) in cr.fetchall():
+ if not number:
+ if obj_inv.journal_id.invoice_sequence_id:
+ sid = obj_inv.journal_id.invoice_sequence_id.id
+ number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id', {'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id})
+ else:
+ number = self.pool.get('ir.sequence').get(cr, uid, 'account.invoice.' + invtype)
+
+ if invtype in ('in_invoice', 'in_refund'):
+ ref = reference
+ else:
+ ref = self._convert_ref(cr, uid, number)
+
+ cr.execute('UPDATE account_invoice SET number=%s ' \
+ 'WHERE id=%s', (number, id))
+ cr.execute('UPDATE account_move SET ref=%s ' \
+ 'WHERE id=%s AND (ref is null OR ref = \'\')',
(ref, move_id))
+ cr.execute('UPDATE account_move_line SET ref=%s ' \
+ 'WHERE move_id=%s AND (ref is null OR ref = \'\')',
+ (ref, move_id))
+ cr.execute('UPDATE account_analytic_line SET ref=%s ' \
+ 'FROM account_move_line ' \
+ 'WHERE account_move_line.move_id = %s ' \
+ 'AND account_analytic_line.move_id = account_move_line.id',
+ (ref, move_id))
+
for inv_id, name in self.name_get(cr, uid, [id]):
message = _('Invoice ') + " '" + name + "' "+ _("is validated.")
self.log(cr, uid, inv_id, message)
+
return True
def action_cancel(self, cr, uid, ids, *args):
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index ade9452e135..da0269c227f 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -71,7 +71,7 @@
-
+
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index fbeb14aaa57..c5c3b623999 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -100,7 +100,7 @@
-
+
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 49d2080d56c..2bd3018ff7c 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -113,7 +113,7 @@
-
+
diff --git a/addons/account/wizard/account_reconcile_view.xml b/addons/account/wizard/account_reconcile_view.xml
index 1bed69d45fe..7b5f5e48f66 100644
--- a/addons/account/wizard/account_reconcile_view.xml
+++ b/addons/account/wizard/account_reconcile_view.xml
@@ -2,30 +2,75 @@
-
- account.move.line.reconcile.prompt.form
- account.move.line.reconcile.prompt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ account.move.line.reconcile.full.form
+ account.move.line.reconcile
form
-
- Reconcile Entries
- account.move.line.reconcile.prompt
+
+ Reconcile Entries
+ account.move.line.reconcile
form
tree,form
-
- new
+
+ new
@@ -36,73 +81,72 @@
action
account.move.line
-
-
-
- account.move.line.reconcile.full.form
- account.move.line.reconcile
- form
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- account.move.line.reconcile.partial.form
- account.move.line.reconcile
- form
-
-
-
-
-
-
+
account.move.line.reconcile.writeoff.form
account.move.line.reconcile.writeoff
form
-
+
diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py
index 0b170a85924..16306abfb44 100644
--- a/addons/crm/__openerp__.py
+++ b/addons/crm/__openerp__.py
@@ -124,7 +124,7 @@ Create dashboard for CRM that includes:
],
'test': [
'test/test_crm_lead.yml',
- #'test/test_crm_meeting.yml',
+ 'test/test_crm_meeting.yml',
'test/test_crm_opportunity.yml',
'test/test_crm_phonecall.yml',
],
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 56a30c4791a..6606dfdef4a 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -163,12 +163,6 @@ class crm_lead(osv.osv, crm_case):
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
}
- def create(self, cr, uid, vals, context=None):
-# FIXME: Do we really need this? if yes, this is not a correct way to check for stage
-# if not vals.get('stage_id',False):
-# raise osv.except_osv('Error', _('There is no stage defined for this Sales Team'))
- return super(crm_lead, self).create(cr, uid, vals, context=context)
-
def onchange_partner_address_id(self, cr, uid, ids, add, email=False):
"""This function returns value of partner email based on Partner Address
@param self: The object pointer
@@ -182,7 +176,7 @@ class crm_lead(osv.osv, crm_case):
return {'value': {'email_from': False, 'country_id': False}}
address = self.pool.get('res.partner.address').browse(cr, uid, add)
return {'value': {'email_from': address.email, 'phone': address.phone, 'country_id': address.country_id.id}}
-
+
def case_open(self, cr, uid, ids, *args):
"""Overrides cancel for crm_case for setting Open Date
@param self: The object pointer
@@ -195,9 +189,10 @@ class crm_lead(osv.osv, crm_case):
res = super(crm_lead, self).case_open(cr, uid, ids, *args)
if old_state == 'draft':
stage_id = super(crm_lead, self).stage_next(cr, uid, ids, *args)
- if not stage_id:
- raise osv.except_osv(_('Warning !'), _('There is no stage defined for this Sale Team.'))
- value = self.onchange_stage_id(cr, uid, ids, stage_id, context={})['value']
+ if stage_id:
+ value = self.onchange_stage_id(cr, uid, ids, stage_id, context={})['value']
+ else:
+ value = {}
value.update({'date_open': time.strftime('%Y-%m-%d %H:%M:%S'), 'stage_id': stage_id})
self.write(cr, uid, ids, value)
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 14a23bd6a18..709178a2cc3 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -317,20 +317,6 @@
help="Show Sales Team"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -343,6 +329,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index 0ab4529b75f..ca094469c69 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -309,20 +309,6 @@
help="Show Sales Team"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -345,6 +331,20 @@
help="Expected Closing" domain="[]"
context="{'group_by':'date_deadline'}" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 9006fda66cb..36e0633cfe9 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -131,7 +131,7 @@
domain="[]" context="{'group_by':'name'}" />
-
+
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index dabacecd978..120bc9f859d 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -145,7 +145,7 @@
-
+
diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml
index 6365c913b1f..ef86261f091 100644
--- a/addons/crm/test/test_crm_meeting.yml
+++ b/addons/crm/test/test_crm_meeting.yml
@@ -55,8 +55,8 @@
I will search for one of the recurrent event and count the number of meeting.
-
!python {model: crm.meeting}: |
- ids = self.search(cr, uid, [('date', '>=', '2010-05-21 00:00:00'), ('date', '<=', '2010-04-21 00:00:00')] )
- assert len(ids) == 9
+ ids = self.search(cr, uid, [('date', '>=', '2010-04-21 00:00:00'), ('date', '<=', '2010-05-21 00:00:00')] )
+ assert len(ids) == 10
- |
Now If I want to edit meetings information for all occurence I click on "Edit All" button.
@@ -81,11 +81,6 @@
partner_id: base.res_partner_9
user_ids:
- base.user_demo
-- |
- If I set Send mail boolean as True I can see that an email is send to
- specified email address with proper meeting information.
--
- #This is not working for send mail boolean as True.
-
I click on "Invite" button of "Invite attendee" wizard.
-
diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml
index af28c19a10e..1351ba88199 100644
--- a/addons/crm/test/test_crm_phonecall.yml
+++ b/addons/crm/test/test_crm_phonecall.yml
@@ -72,7 +72,6 @@
partner_address_id: base.res_partner_address_1
partner_id: base.res_partner_9
phonecall_id: 'crm_phonecall_interviewcall0'
- rrule_type: weekly
state: open
- |
diff --git a/addons/crm_claim/report/crm_claim_report_view.xml b/addons/crm_claim/report/crm_claim_report_view.xml
index 7bde655a980..37fd3ec015a 100644
--- a/addons/crm_claim/report/crm_claim_report_view.xml
+++ b/addons/crm_claim/report/crm_claim_report_view.xml
@@ -162,7 +162,7 @@
domain="[]" context="{'group_by':'name'}" />
-
+
diff --git a/addons/crm_fundraising/report/crm_fundraising_report_view.xml b/addons/crm_fundraising/report/crm_fundraising_report_view.xml
index 8029a5574d3..a0fd2e35583 100644
--- a/addons/crm_fundraising/report/crm_fundraising_report_view.xml
+++ b/addons/crm_fundraising/report/crm_fundraising_report_view.xml
@@ -153,7 +153,7 @@
-
+
diff --git a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
index ee7b74c7191..2544a506fd5 100644
--- a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
+++ b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
@@ -144,7 +144,7 @@
-
+
diff --git a/addons/document_ics/document_ics_config_wizard.xml b/addons/document_ics/document_ics_config_wizard.xml
index 39ec392d3f9..d19951deb38 100644
--- a/addons/document_ics/document_ics_config_wizard.xml
+++ b/addons/document_ics/document_ics_config_wizard.xml
@@ -23,6 +23,9 @@
15
+
+ Configure
+
diff --git a/addons/hr_evaluation/report/hr_evaluation_report_view.xml b/addons/hr_evaluation/report/hr_evaluation_report_view.xml
index c18a385ea11..b4ab2743c0b 100644
--- a/addons/hr_evaluation/report/hr_evaluation_report_view.xml
+++ b/addons/hr_evaluation/report/hr_evaluation_report_view.xml
@@ -74,7 +74,7 @@
-
+
diff --git a/addons/hr_holidays/report/available_holidays_view.xml b/addons/hr_holidays/report/available_holidays_view.xml
index a172e7eb0ea..205e8ce31ed 100644
--- a/addons/hr_holidays/report/available_holidays_view.xml
+++ b/addons/hr_holidays/report/available_holidays_view.xml
@@ -71,7 +71,7 @@
-
+
diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml
index a2a7b104ea6..e25a7487e51 100644
--- a/addons/hr_holidays/report/hr_holidays_report_view.xml
+++ b/addons/hr_holidays/report/hr_holidays_report_view.xml
@@ -80,7 +80,7 @@
-
+
diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
index 3ebdfdf8a0f..a6cc5830de8 100644
--- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml
+++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
@@ -101,7 +101,7 @@
-
+
diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
index 58215a087b7..cbdef2a28ba 100644
--- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
+++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
@@ -81,7 +81,7 @@
-
+
diff --git a/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml
index 9dadb599ba7..8ab227a1870 100644
--- a/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml
+++ b/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml
@@ -72,7 +72,7 @@
-
+
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
index eae573f89bc..0a4aaf1dbf3 100644
--- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
+++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
@@ -96,7 +96,7 @@
-
+
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 813133385be..4f33b0c1558 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -60,7 +60,8 @@ class mrp_workcenter(osv.osv):
'resource_id': fields.many2one('resource.resource','Resource',ondelete='cascade'),
}
_defaults = {
- 'capacity_per_cycle': lambda *a: 1.0,
+ 'capacity_per_cycle': 1.0,
+ 'resource_type': 'material',
}
mrp_workcenter()
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index 18dc07e4b78..7617c8f55e4 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -86,7 +86,7 @@
-
+
diff --git a/addons/point_of_sale/report/report_pos_order_view.xml b/addons/point_of_sale/report/report_pos_order_view.xml
index e655633877a..6bd136426e1 100644
--- a/addons/point_of_sale/report/report_pos_order_view.xml
+++ b/addons/point_of_sale/report/report_pos_order_view.xml
@@ -86,7 +86,7 @@
-
+
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 7b95054a4b7..bd3becd3cdd 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -27,7 +27,7 @@
-
+
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index 442b4ea89c2..0292864397e 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -123,7 +123,7 @@
-
+
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index 7405026d05d..2389e65e1d7 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -130,7 +130,7 @@
-
+
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py
index 03b8ae8edc8..f4ae126ee67 100644
--- a/addons/project_long_term/project_long_term.py
+++ b/addons/project_long_term/project_long_term.py
@@ -190,6 +190,8 @@ class project_phase(osv.osv):
return super(project_phase, self).write(cr, uid, ids, vals, context=context)
# Consider calendar and efficiency if the phase is performed by a resource
# otherwise consider the project's working calendar
+ if isinstance(ids, (int, long)):
+ ids = [ids]
phase = self.browse(cr, uid, ids[0], context=context)
calendar_id = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False
resource_id = resource_obj.search(cr, uid, [('user_id', '=', phase.responsible_id.id)],context=context)
@@ -246,7 +248,7 @@ class project_resource_allocation(osv.osv):
_rec_name = 'resource_id'
_columns = {
'resource_id': fields.many2one('resource.resource', 'Resource', required=True),
- 'phase_id': fields.many2one('project.phase', 'Project Phase', required=True),
+ 'phase_id': fields.many2one('project.phase', 'Project Phase', ondelete='cascade', required=True),
'phase_id_date_start': fields.related('phase_id', 'date_start', type='date', string='Starting Date of the phase'),
'phase_id_date_end': fields.related('phase_id', 'date_end', type='date', string='Ending Date of the phase'),
'useability': fields.float('Usability', help="Usability of this resource for this project phase in percentage (=50%)"),
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index ec63f1079a1..ed11f80e3a0 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -104,7 +104,7 @@
-
+
diff --git a/addons/sale_margin/report/report_margin_view.xml b/addons/sale_margin/report/report_margin_view.xml
index b22c2e28801..1dcafe50de3 100644
--- a/addons/sale_margin/report/report_margin_view.xml
+++ b/addons/sale_margin/report/report_margin_view.xml
@@ -50,7 +50,7 @@
-
+
diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml
index 38466f14e71..9d269160fb9 100644
--- a/addons/stock/report/report_stock_move_view.xml
+++ b/addons/stock/report/report_stock_move_view.xml
@@ -103,7 +103,7 @@
-
+
@@ -201,7 +201,7 @@
-
+
diff --git a/addons/stock/report/report_stock_picking_view.xml b/addons/stock/report/report_stock_picking_view.xml
index 77910b29fdd..13cdd624cf2 100644
--- a/addons/stock/report/report_stock_picking_view.xml
+++ b/addons/stock/report/report_stock_picking_view.xml
@@ -90,7 +90,7 @@
-
+