diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml
index 7394b15f0be..dd577f98458 100644
--- a/addons/account/account_menuitem.xml
+++ b/addons/account/account_menuitem.xml
@@ -2,7 +2,7 @@
-
+
@@ -26,7 +26,6 @@
-
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index c2323c54839..206e0b4f6ba 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -31,8 +31,8 @@
-
-
+
+
@@ -202,14 +202,15 @@
-
-
-
-
+
+
+
+
+
@@ -236,6 +237,8 @@
+
+
@@ -313,6 +316,8 @@
+
+
@@ -696,7 +701,8 @@
-
+
+
@@ -724,6 +730,7 @@
+
@@ -742,7 +749,7 @@
-
+
@@ -1796,6 +1803,8 @@
+
+
@@ -1896,6 +1905,10 @@
+
+
+
+
@@ -2015,6 +2028,7 @@
+
@@ -2026,9 +2040,9 @@
-
-
-
+
+
+
diff --git a/addons/account/product_view.xml b/addons/account/product_view.xml
index 0095cb1505c..97b99084a44 100644
--- a/addons/account/product_view.xml
+++ b/addons/account/product_view.xml
@@ -35,8 +35,8 @@
-
+
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index b5a01c62847..53ba5453742 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -61,6 +61,10 @@
+
+
+
+
@@ -293,7 +297,7 @@
-
+
account.analytic.journal.search
account.analytic.journal
@@ -306,7 +310,7 @@
-
+
account.analytic.journal.form
account.analytic.journal
@@ -350,7 +354,7 @@
-->
-
-
-
-
-
-
diff --git a/addons/email_template/email_template_mailbox_view.xml b/addons/email_template/email_template_mailbox_view.xml
index 93a1a9958d4..a49fabbd523 100644
--- a/addons/email_template/email_template_mailbox_view.xml
+++ b/addons/email_template/email_template_mailbox_view.xml
@@ -111,10 +111,8 @@
-
-
-
-
+
+
diff --git a/addons/sale/company.py b/addons/sale/company.py
index 401a1a9c1d8..a4262cbfec6 100644
--- a/addons/sale/company.py
+++ b/addons/sale/company.py
@@ -33,5 +33,4 @@ class company(osv.osv):
}
company()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 14282ecf355..9fbdac14a23 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -20,10 +20,11 @@
##############################################################################
import time
-import netsvc
-from osv import fields, osv
from datetime import datetime
from dateutil.relativedelta import relativedelta
+
+import netsvc
+from osv import fields, osv
from tools import config
from tools.translate import _
@@ -41,8 +42,8 @@ class sale_shop(osv.osv):
'project_id': fields.many2one('account.analytic.account', 'Analytic Account'),
'company_id': fields.many2one('res.company', 'Company'),
}
-sale_shop()
+sale_shop()
def _incoterm_get(self, cr, uid, context=None):
if context is None:
@@ -77,11 +78,11 @@ class sale_order(osv.osv):
return val
def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
+ cur_obj = self.pool.get('res.currency')
if context is None:
context = {}
res = {}
- cur_obj = self.pool.get('res.currency')
- for order in self.browse(cr, uid, ids, context):
+ for order in self.browse(cr, uid, ids, context=context):
res[order.id] = {
'amount_untaxed': 0.0,
'amount_tax': 0.0,
@@ -281,13 +282,13 @@ class sale_order(osv.osv):
}
_defaults = {
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'sale.order', context=c),
- 'picking_policy': lambda *a: 'direct',
- 'date_order': lambda *a: time.strftime('%Y-%m-%d'),
- 'order_policy': lambda *a: 'manual',
- 'state': lambda *a: 'draft',
+ 'picking_policy': 'direct',
+ 'date_order': time.strftime('%Y-%m-%d'),
+ 'order_policy': 'manual',
+ 'state': 'draft',
'user_id': lambda obj, cr, uid, context: uid,
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'sale.order'),
- 'invoice_quantity': lambda *a: 'order',
+ 'invoice_quantity': 'order',
'partner_invoice_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['invoice'])['invoice'],
'partner_order_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['contact'])['contact'],
'partner_shipping_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['delivery'])['delivery'],
@@ -333,7 +334,7 @@ class sale_order(osv.osv):
wf_service.trg_create(uid, 'sale.order', inv_id, cr)
for (id,name) in self.name_get(cr, uid, ids):
message = _('Sale order ') + " '" + name + "' "+ _("is in draft state")
- self.log(cr, uid, id, message)
+ self.log(cr, uid, id, message)
return True
def onchange_partner_id(self, cr, uid, ids, part):
@@ -408,8 +409,16 @@ class sale_order(osv.osv):
return {}
def _make_invoice(self, cr, uid, order, lines, context=None):
+ journal_obj = self.pool.get('account.journal')
+ inv_obj = self.pool.get('account.invoice')
+
if context is None:
context = {}
+
+ journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', order.company_id.id)], limit=1)
+ if not journal_ids:
+ raise osv.except_osv(_('Error !'),
+ _('There is no sale journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
a = order.partner_id.property_account_receivable.id
if order.payment_term:
pay_term = order.payment_term.id
@@ -420,11 +429,6 @@ class sale_order(osv.osv):
for preline in preinv.invoice_line:
inv_line_id = self.pool.get('account.invoice.line').copy(cr, uid, preline.id, {'invoice_id': False, 'price_unit': -preline.price_unit})
lines.append(inv_line_id)
- journal_obj = self.pool.get('account.journal')
- journal_ids = journal_obj.search(cr, uid, [('type', '=','sale'),('company_id', '=', order.company_id.id)], limit=1)
- if not journal_ids:
- raise osv.except_osv(_('Error !'),
- _('There is no sale journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
inv = {
'name': order.client_order_ref or order.name,
@@ -445,7 +449,6 @@ class sale_order(osv.osv):
'company_id' : order.company_id.id,
'user_id':order.user_id and order.user_id.id or False
}
- inv_obj = self.pool.get('account.invoice')
inv.update(self._inv_get(cr, uid, order))
inv_id = inv_obj.create(cr, uid, inv, context=context)
data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id], pay_term, time.strftime('%Y-%m-%d'))
@@ -454,12 +457,14 @@ class sale_order(osv.osv):
inv_obj.button_compute(cr, uid, [inv_id])
return inv_id
- def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False):
+ def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None):
res = False
invoices = {}
invoice_ids = []
+ picking_obj = self.pool.get('stock.picking')
- context = {}
+ if context is None:
+ context = {}
# If date was specified, use it as date invoiced, usefull when invoices are generated this month and put the
# last day of the last month as invoice date
if date_inv:
@@ -478,7 +483,6 @@ class sale_order(osv.osv):
for i in o.invoice_ids:
if i.state == 'draft':
return i.id
- picking_obj = self.pool.get('stock.picking')
for val in invoices.values():
if grouped:
res = self._make_invoice(cr, uid, val[0][0], reduce(lambda x,y: x + y, [l for o,l in val], []), context=context)
@@ -559,19 +563,19 @@ class sale_order(osv.osv):
def action_wait(self, cr, uid, ids, *args):
product=[]
- product_obj=self.pool.get('product.product')
+ product_obj = self.pool.get('product.product')
for o in self.browse(cr, uid, ids):
if (o.order_policy == 'manual'):
self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': time.strftime('%Y-%m-%d')})
else:
self.write(cr, uid, [o.id], {'state': 'progress', 'date_confirm': time.strftime('%Y-%m-%d')})
self.pool.get('sale.order.line').button_confirm(cr, uid, [x.id for x in o.order_line])
- for line in o.order_line:
+ for line in o.order_line:
product.append(line.product_id.default_code)
params = ', '.join(map(lambda x : str(x),product))
message = _('Sale order ') + " '" + o.name + "' "+ _("created on")+" '" +o.create_date + "' "+_("for")+" '" +params + "' "+_("is confirmed")
self.log(cr, uid, id, message)
-
+ return True
def procurement_lines_get(self, cr, uid, ids, *args):
res = []
@@ -773,10 +777,10 @@ sale_order()
# - use it in report if there is a uos
class sale_order_line(osv.osv):
def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
- res = {}
- context = context or {}
tax_obj = self.pool.get('account.tax')
cur_obj = self.pool.get('res.currency')
+ res = {}
+ context = context or {}
for line in self.browse(cr, uid, ids, context=context):
price = line.price_unit * line.product_uom_qty * (1 - (line.discount or 0.0) / 100.0)
taxes = tax_obj.compute_all(cr, uid, line.tax_id, price, line.product_uom_qty)
@@ -834,15 +838,15 @@ class sale_order_line(osv.osv):
}
_order = 'sequence, id'
_defaults = {
- 'discount': lambda *a: 0.0,
- 'delay': lambda *a: 0.0,
- 'product_uom_qty': lambda *a: 1,
- 'product_uos_qty': lambda *a: 1,
- 'sequence': lambda *a: 10,
- 'invoiced': lambda *a: 0,
- 'state': lambda *a: 'draft',
- 'type': lambda *a: 'make_to_stock',
- 'product_packaging': lambda *a: False
+ 'discount': 0.0,
+ 'delay': 0.0,
+ 'product_uom_qty': 1,
+ 'product_uos_qty': 1,
+ 'sequence': 10,
+ 'invoiced': 0,
+ 'state': 'draft',
+ 'type': 'make_to_stock',
+ 'product_packaging': False
}
def invoice_line_create(self, cr, uid, ids, context=None):
@@ -934,7 +938,7 @@ class sale_order_line(osv.osv):
context = {}
for (id,name) in self.name_get(cr, uid, ids):
message = _('Sale order line') + " '" + name + "' "+ _("is confirmed")
- self.log(cr, uid, id, message)
+ self.log(cr, uid, id, message)
return self.write(cr, uid, ids, {'state': 'confirmed'})
def button_done(self, cr, uid, ids, context=None):
@@ -1177,3 +1181,4 @@ class sale_config_picking_policy(osv.osv_memory):
self.pool.get('stock.location').write(cr, uid, [location_id], {'chained_auto_packing': 'transparent'})
sale_config_picking_policy()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/sale/stock.py b/addons/sale/stock.py
index 48c00d8afba..b908c440b1d 100644
--- a/addons/sale/stock.py
+++ b/addons/sale/stock.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -27,7 +27,7 @@ class stock_move(osv.osv):
'sale_line_id': fields.many2one('sale.order.line', 'Sale Order Line', ondelete='set null', select=True, readonly=True),
}
_defaults = {
- 'sale_line_id': lambda *a:False
+ 'sale_line_id': False
}
stock_move()
@@ -37,7 +37,7 @@ class stock_picking(osv.osv):
'sale_id': fields.many2one('sale.order', 'Sale Order', ondelete='set null', select=True, readonly=True),
}
_defaults = {
- 'sale_id': lambda *a: False
+ 'sale_id': False
}
def get_currency_id(self, cursor, user, picking):
@@ -127,7 +127,7 @@ class stock_picking(osv.osv):
for invoice in invoice_obj.browse(cursor, user, invoice_ids,
context=context):
invoices[invoice.id] = invoice
-
+
for picking in picking_obj.browse(cursor, user, picking_ids,
context=context):
@@ -135,15 +135,15 @@ class stock_picking(osv.osv):
continue
sale_lines = picking.sale_id.order_line
invoice_created = invoices[result[picking.id]]
-
+
for inv in invoice_obj.browse(cursor, user, [invoice_created.id], context=context):
if not inv.fiscal_position:
invoice_obj.write(cursor, user, [inv.id], {'fiscal_position': picking.sale_id.fiscal_position.id}, context=context)
-
+
if picking.sale_id.client_order_ref:
inv_name = picking.sale_id.client_order_ref + " : " + invoice_created.name
invoice_obj.write(cursor, user, [invoice_created.id], {'name': inv_name}, context=context)
-
+
for sale_line in sale_lines:
if sale_line.product_id.type == 'service' and sale_line.invoiced == False:
if group:
@@ -189,7 +189,7 @@ class stock_picking(osv.osv):
})
return result
-
+
def action_cancel(self, cr, uid, ids, context={}):
res = super(stock_picking, self).action_cancel(cr, uid, ids, context=context)
for pick in self.browse(cr, uid, ids, context):
@@ -200,13 +200,9 @@ class stock_picking(osv.osv):
call_ship_end = False
break
if call_ship_end:
- self.pool.get('sale.order').action_ship_end(cr, uid, [pick.sale_id.id], context)
+ self.pool.get('sale.order').action_ship_end(cr, uid, [pick.sale_id.id], context)
return res
-
stock_picking()
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/stock/stock_data.xml b/addons/stock/stock_data.xml
index 9b3bf1fb9d5..205e4a44396 100644
--- a/addons/stock/stock_data.xml
+++ b/addons/stock/stock_data.xml
@@ -12,16 +12,16 @@
+ Request link
+ -->
Production Lot
stock.production.lot
+ Resource: stock.location
+ -->
Physical Locations
view
@@ -41,6 +41,7 @@
Scraped
True
+ inventory
@@ -85,8 +86,8 @@
+ Properties
+ -->
property_stock_supplier
@@ -115,8 +116,8 @@
+ Resource: stock.warehouse
+ -->