diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 6a0a29cb2fe..b1c5db23df6 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -306,7 +306,7 @@ class account_invoice(osv.osv):
if view_type == 'form':
if partner['supplier'] and not partner['customer']:
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.supplier.form')])
- else:
+ elif partner['customer'] and not partner['supplier']:
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.form')])
if view_id and isinstance(view_id, (list, tuple)):
view_id = view_id[0]
diff --git a/addons/purchase/partner.py b/addons/purchase/partner.py
index 86cce749a21..2edcf5ec0d8 100644
--- a/addons/purchase/partner.py
+++ b/addons/purchase/partner.py
@@ -24,6 +24,21 @@ from osv import fields, osv
class res_partner(osv.osv):
_name = 'res.partner'
_inherit = 'res.partner'
+
+ def _purchase_order_count(self, cr, uid, ids, field_name, arg, context=None):
+ res = {}
+ for partner in self.browse(cr, uid, ids, context=context):
+ res[partner.id] = len(partner.purchase_order_ids)
+ return res
+
+ def copy(self, cr, uid, id, default=None, context=None):
+ if default is None:
+ default = {}
+
+ default.update({'purchase_order_ids': []})
+
+ super(res_partner, self).copy(cr, uid, id, default=default, context=context)
+
_columns = {
'property_product_pricelist_purchase': fields.property(
'product.pricelist',
@@ -33,6 +48,8 @@ class res_partner(osv.osv):
string="Purchase Pricelist",
view_load=True,
help="This pricelist will be used, instead of the default one, for purchases from the current partner"),
+ 'purchase_order_count': fields.function(_purchase_order_count, string='# of Purchase Order', type='integer'),
+ 'purchase_order_ids': fields.one2many('purchase.order','partner_id','Purchase Order')
}
res_partner()
diff --git a/addons/purchase/partner_view.xml b/addons/purchase/partner_view.xml
index 5a9a731358c..81eaac92827 100644
--- a/addons/purchase/partner_view.xml
+++ b/addons/purchase/partner_view.xml
@@ -16,6 +16,73 @@
+
+
+ RFQs and Purchases
+ purchase.order
+ form
+ tree,form,graph
+ {'search_default_partner_id': active_id}
+
+
+ This supplier has no RFQ or Purchase Order. Click here to create a new RFQ.
+ <p>
+ The "Quotation" is the first step of the Purchases flow. Manage your purchases from quotation to invoice.
+ <p>
+ You will be able to buy products (manage receptions) as well as services (create projects).
+
+
+
+
+
+ res.partner.kanban.purchaseorder.inherit
+ res.partner
+ kanban
+
+
+
+
+
+
+
+ Purchases
+
+
+
+
+
+
+ Supplier Invoices
+ account.invoice
+ form
+ tree,form,graph
+ [('type','=','in_invoice')]
+ {'search_default_partner_id': active_id, 'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}
+
+ Click here to create Supplier invoice.
+ <p>
+ You can control the invoice from your supplier according to what you purchased or received.
+ <p>
+ OpenERP can also generate draft invoices automatically from purchase orders or receipts.
+
+
+
+
+ res.partner.view.purchase.buttons
+ res.partner
+ form
+
+
+
+
+
+
+
+
+
diff --git a/addons/purchase/purchase_data.xml b/addons/purchase/purchase_data.xml
index 9d7399abab0..977b1e12d19 100644
--- a/addons/purchase/purchase_data.xml
+++ b/addons/purchase/purchase_data.xml
@@ -6,12 +6,10 @@
Module Purchase Management has been installed
- From the top menu Purchases, create purchase orders to buy
- products from your suppliers, encode supplier invoices and
- manage your payments.
+ You can <b>click on the top menu Purchases</b> to manage your
+ suppliers, request for quotations and control supplier invoices.
- You can also manage purchase requisitions, see the Purchase
- Settings.
+ To configure your purchase application, you can add purchase's options in settings menu.
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 313df25a563..1c4bb9f8e1a 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -491,14 +491,6 @@
-
-
{'search_default_purchase_id': active_id,'default_type': 'in'}
+
+
+
+ tree
+
+
+
+
+
+
+ form
+
+
+
+
+
+
+ calendar
+
+
+
Purchase Picking Inherited
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index ddd9c2f6ebc..14e40e8120c 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -914,6 +914,20 @@
+
+ stock.picking.out.calendar
+ stock.picking.out
+ calendar
+
+
+
+
+
+
+
+
+
+
stock.picking.out.tree
stock.picking
@@ -1017,11 +1031,26 @@
calendar
+
+
+ stock.picking.in.calendar
+ stock.picking.in
+ calendar
+
+
+
+
+
+
+
+
+
+
stock.picking.in.tree
stock.picking.in
@@ -1119,6 +1148,7 @@
calendar
+
@@ -1221,7 +1251,7 @@
+ groups="stock.group_tracking_lot">