diff --git a/addons/account/account.py b/addons/account/account.py
index e7db4271f1e..402340afc9a 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1082,7 +1082,7 @@ class account_move(osv.osv):
'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner"),
'amount': fields.function(_amount_compute, method=True, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount),
'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}),
- 'narration':fields.text('Narration', select=True),
+ 'narration':fields.text('Narration'),
'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company',store=True),
}
_defaults = {
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index ad48ea86c23..0cb9165490e 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -65,7 +65,7 @@
-
+
diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml
index f05198876b9..59342941829 100644
--- a/addons/account/report/invoice.rml
+++ b/addons/account/report/invoice.rml
@@ -239,8 +239,6 @@
- Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]]
- Fax : [[ o.address_invoice_id.fax or removeParentNode('para') ]]
VAT : [[ o.partner_id.vat or removeParentNode('para') ]]
diff --git a/addons/account/test/account_customer_invoice.yml b/addons/account/test/account_customer_invoice.yml
index 1084c76f4d2..0eaa3a688c6 100644
--- a/addons/account/test/account_customer_invoice.yml
+++ b/addons/account/test/account_customer_invoice.yml
@@ -37,7 +37,7 @@
-
!python {model: account.invoice}: |
acc_id=self.browse(cr, uid, ref("account_invoice_customer0"))
- assert acc_id.move_id, "Move not created"
+ assert (not acc_id.move_id), "Move falsely created at pro-forma"
-
I create invoice by clicking on Create button
-
@@ -53,4 +53,90 @@
-
!python {model: account.invoice}: |
acc_id=self.browse(cr, uid, ref("account_invoice_customer0"))
- assert acc_id.move_id, "Move created"
+ assert acc_id.move_id, "Move not created for open invoice"
+-
+ I create a record for partial payment of 1000 EUR.
+-
+ !record {model: account.invoice.pay, id: account_invoice_pay_first0}:
+ amount: 1000.0
+ date: '2010-05-26'
+ journal_id: account.sales_journal
+ name: First payment for [PC3] Medium PC to Distrib PC
+ period_id: account.period_5
+-
+ I make partial payment by clicking on Partial Payment button
+-
+ !python {model: account.invoice.pay}: |
+ self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_first0")], {"lang":
+ 'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
+ [ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
+ })
+-
+ I check that the invoice state is still open
+-
+ !assert {model: account.invoice, id: account_invoice_customer0}:
+ - state == 'open'
+-
+ I make second partial payment of 6000 EUR.
+-
+ !record {model: account.invoice.pay, id: account_invoice_pay_second0}:
+ amount: 6000.0
+ date: '2010-05-28'
+ journal_id: account.sales_journal
+ name: Second payment for [PC3] Medium PC to Distrib PC
+ period_id: account.period_5
+-
+ I make partial payment by clicking on Partial Payment button
+
+-
+ !python {model: account.invoice.pay}: |
+ self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_second0")], {"lang":
+ 'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
+ [ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
+ })
+-
+ I make final partial payment of 2000 EUR
+-
+ !record {model: account.invoice.pay, id: account_invoice_pay_final0}:
+ amount: 2000.0
+ date: '2010-05-30'
+ journal_id: account.sales_journal
+ name: Final payment for [PC3] Medium PC to Distrib PC
+ period_id: account.period_5
+
+-
+ I make partial payment by clicking on Partial Payment button
+
+-
+ !python {model: account.invoice.pay}: |
+ self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_final0")], {"lang":
+ 'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
+ [ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
+ })
+
+-
+ I check that the invoice state is now Done
+-
+ !assert {model: account.invoice, id: account_invoice_customer0}:
+ - state == 'paid'
+-
+ I check that an payment entry gets created in the account.move.line
+-
+ !python {model: account.invoice}: |
+ acc_id=self.browse(cr, uid, ref("account_invoice_customer0"))
+ assert(acc_id.move_id)
+-
+ I refund the invoice Using Refund Button
+-
+ !record {model: account.invoice.refund, id: account_invoice_refund_0}:
+ description: Refund To China Export
+ period: account.period_5
+-
+ I clicked on refund button
+-
+ !python {model: account.invoice.refund}: |
+ self.invoice_refund(cr, uid, [ref("account_invoice_refund_0")], {"lang": 'en_US', "tz": False, "active_model": "account.invoice", "active_ids": [ref("account.account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account.account_invoice_customer0"), })
+-
+ I checked that a new entry with state "Draft" created in account move line
+
+
diff --git a/addons/base_contact/base_contact_view.xml b/addons/base_contact/base_contact_view.xml
index e602968798f..1f22b550bdc 100644
--- a/addons/base_contact/base_contact_view.xml
+++ b/addons/base_contact/base_contact_view.xml
@@ -190,8 +190,6 @@
-
-
diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py
index 10c283213bd..9a4e948cbe1 100644
--- a/addons/caldav/calendar.py
+++ b/addons/caldav/calendar.py
@@ -598,7 +598,7 @@ class Calendar(CalDAV, osv.osv):
data_ids = mod_obj.search(cr, uid, line_domain, order="id", context=context)
for data in mod_obj.browse(cr, uid, data_ids, context):
ctx = parent and parent.context or None
- if data.recurrent_uid:
+ if hasattr(data, 'recurrent_uid') and data.recurrent_uid:
# Skip for event which is child of other event
continue
node = res_node_calendar('%s.ics' %data.id, parent, ctx, data, line.object_id.model, data.id)
diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py
index d8acbff7555..5fc98053046 100644
--- a/addons/crm/crm_meeting.py
+++ b/addons/crm/crm_meeting.py
@@ -25,6 +25,7 @@ from datetime import datetime, timedelta
from osv import fields, osv
from tools.translate import _
import time
+import logging
class crm_lead(crm_case, osv.osv):
""" CRM Leads """
@@ -178,13 +179,20 @@ class res_users(osv.osv):
_name = 'res.users'
_inherit = 'res.users'
- def create(self, cr, uid, data, context={}):
+ def create(self, cr, uid, data, context=None):
+ if context is None:
+ context = {}
user_id = super(res_users, self).create(cr, uid, data, context)
data_obj = self.pool.get('ir.model.data')
- data_id = data_obj._get_id(cr, uid, 'crm', 'ir_ui_view_sc_calendar0')
- view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
- copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
- 'user_id': user_id}, context=context)
+ try:
+ data_id = data_obj._get_id(cr, uid, 'crm', 'ir_ui_view_sc_calendar0')
+ view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
+ copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
+ 'user_id': user_id}, context=context)
+ except ValueError:
+ # Tolerate a missing shortcut. See product/product.py for similar code.
+ logging.getLogger('orm').warning('Skipped Products shortcut for user "%s"', data.get('name','
+