From eb389dcdff816670fe5d49c6b2e9d2adb99b4e1e Mon Sep 17 00:00:00 2001
From: "Ferdinand @ Camptocamp" <>
Date: Tue, 26 Apr 2011 12:12:46 +0530
Subject: [PATCH 1/4] [FIX] account: invoices - missing field in tree view
bzr revid: ara@tinyerp.com-20110426064246-30f8pgfpwjlhxj2y
---
addons/account/account_invoice_view.xml | 1 +
addons/account_payment/account_payment_view.xml | 2 ++
2 files changed, 3 insertions(+)
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 43f09bebc49..fa8517a9a8c 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -123,6 +123,7 @@
+
diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml
index 6f7acc7a367..76197140b49 100644
--- a/addons/account_payment/account_payment_view.xml
+++ b/addons/account_payment/account_payment_view.xml
@@ -150,6 +150,7 @@
+
@@ -291,6 +292,7 @@
+
From 2a0be4932f52ef868ccd042d85ac69a3ee4ac451 Mon Sep 17 00:00:00 2001
From: "ARA (OpenERP)"
Date: Fri, 29 Apr 2011 10:31:18 +0530
Subject: [PATCH 2/4] [FIX] account: invoices - missing field in tree view
lp bug: https://launchpad.net/bugs/767590 fixed
bzr revid: ara@tinyerp.com-20110429050118-34p90naeqjj4d9cf
---
addons/account/account_invoice_view.xml | 6 ++++-
addons/account/invoice.py | 30 +++++++++++++++----------
2 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index fa8517a9a8c..ede327f3884 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -123,7 +123,7 @@
-
+
@@ -378,6 +378,10 @@
+
+
+
+
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index e14a41ce448..a8fe0baeecc 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -312,15 +312,21 @@ class account_invoice(osv.osv):
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
res['fields'][field]['selection'] = journal_select
+ doc = etree.XML(res['arch'])
+ if view_type == 'search':
+ if context.get('type', 'in_invoice') in ('out_invoice', 'out_refund'):
+ for node in doc.xpath("//group[@name='extended filter']"):
+ doc.remove(node)
+
if view_type == 'tree':
- doc = etree.XML(res['arch'])
- nodes = doc.xpath("//field[@name='partner_id']")
- partner_string = _('Customer')
- if context.get('type', 'out_invoice') in ('in_invoice', 'in_refund'):
- partner_string = _('Supplier')
- for node in nodes:
+ partner_string = _('Supplier')
+ if context.get('type', 'in_invoice') in ('out_invoice', 'out_refund'):
+ partner_string = _('Customer')
+ for node in doc.xpath("//field[@name='reference']"):
+ doc.remove(node)
+ for node in doc.xpath("//field[@name='partner_id']"):
node.set('string', partner_string)
- res['arch'] = etree.tostring(doc)
+ res['arch'] = etree.tostring(doc)
return res
def get_log_context(self, cr, uid, context=None):
@@ -1609,17 +1615,17 @@ class res_partner(osv.osv):
_columns = {
'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices', readonly=True),
}
-
+
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
-
+
if context is None:
- context = {}
-
+ context = {}
+
default.update({'invoice_ids' : []})
return super(res_partner, self).copy(cr, uid, id, default, context)
-
+
res_partner()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
From 864cdd87f1dc68d7c46533bdfe06719bb98ac4d8 Mon Sep 17 00:00:00 2001
From: "ARA (OpenERP)"
Date: Fri, 29 Apr 2011 14:23:55 +0530
Subject: [PATCH 3/4] [FIX] account: invoices - missing field in tree view
bzr revid: ara@tinyerp.com-20110429085355-uysrsn2scz8dsctt
---
addons/account/account_invoice_view.xml | 2 +-
addons/account/invoice.py | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index ede327f3884..ed45c705674 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -123,7 +123,7 @@
-
+
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index a8fe0baeecc..679799f2cc1 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -319,11 +319,11 @@ class account_invoice(osv.osv):
doc.remove(node)
if view_type == 'tree':
- partner_string = _('Supplier')
- if context.get('type', 'in_invoice') in ('out_invoice', 'out_refund'):
- partner_string = _('Customer')
+ partner_string = _('Customer')
+ if context.get('type', 'out_invoice') in ('in_invoice', 'in_refund'):
+ partner_string = _('Supplier')
for node in doc.xpath("//field[@name='reference']"):
- doc.remove(node)
+ node.set('invisible', '0')
for node in doc.xpath("//field[@name='partner_id']"):
node.set('string', partner_string)
res['arch'] = etree.tostring(doc)
From 05774dec14c58955dc8a45091ea7ddf25a2847a5 Mon Sep 17 00:00:00 2001
From: "ARA (OpenERP)"
Date: Fri, 29 Apr 2011 18:33:53 +0530
Subject: [PATCH 4/4] [FIX] account: invoices - missing field in tree view
bzr revid: ara@tinyerp.com-20110429130353-m2ton27ddvq92c6y
---
addons/account/invoice.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 679799f2cc1..8c4f8806de4 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -317,6 +317,7 @@ class account_invoice(osv.osv):
if context.get('type', 'in_invoice') in ('out_invoice', 'out_refund'):
for node in doc.xpath("//group[@name='extended filter']"):
doc.remove(node)
+ res['arch'] = etree.tostring(doc)
if view_type == 'tree':
partner_string = _('Customer')
@@ -326,7 +327,7 @@ class account_invoice(osv.osv):
node.set('invisible', '0')
for node in doc.xpath("//field[@name='partner_id']"):
node.set('string', partner_string)
- res['arch'] = etree.tostring(doc)
+ res['arch'] = etree.tostring(doc)
return res
def get_log_context(self, cr, uid, context=None):