diff --git a/addons/account/wizard/account_invoice_state.py b/addons/account/wizard/account_invoice_state.py
index 6b1a41f49af..c3934e38db0 100644
--- a/addons/account/wizard/account_invoice_state.py
+++ b/addons/account/wizard/account_invoice_state.py
@@ -21,6 +21,7 @@
from osv import fields, osv
from tools.translate import _
import netsvc
+import pooler
class account_invoice_confirm(osv.osv_memory):
"""
@@ -34,7 +35,12 @@ class account_invoice_confirm(osv.osv_memory):
wf_service = netsvc.LocalService('workflow')
if context is None:
context = {}
- for id in context['active_ids']:
+ pool_obj = pooler.get_pool(cr.dbname)
+ data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context)
+
+ for record in data_inv:
+ if record['state'] not in ('draft','proforma','proforma2'):
+ raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be confirmed as they are not in 'Draft' or 'Pro-Forma' state!"))
wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_open', cr)
return {}
@@ -47,14 +53,19 @@ class account_invoice_cancel(osv.osv_memory):
"""
_name = "account.invoice.cancel"
- _description = "Cancel the selected invoices"
+ _description = "Cancel the Selected Invoices"
def invoice_cancel(self, cr, uid, ids, context=None):
- wf_service = netsvc.LocalService('workflow')
if context is None:
context = {}
- for id in context['active_ids']:
- wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr)
+ wf_service = netsvc.LocalService('workflow')
+ pool_obj = pooler.get_pool(cr.dbname)
+ data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context)
+
+ for record in data_inv:
+ if record['state'] in ('cancel','paid'):
+ raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be cancelled as they are already in 'Cancelled' or 'Done' state!"))
+ wf_service.trg_validate(uid, 'account.invoice', record['id'], 'invoice_cancel', cr)
return {}
account_invoice_cancel()
diff --git a/addons/account/wizard/account_invoice_state_view.xml b/addons/account/wizard/account_invoice_state_view.xml
index 8748edbb688..d83c0c6f2dc 100644
--- a/addons/account/wizard/account_invoice_state_view.xml
+++ b/addons/account/wizard/account_invoice_state_view.xml
@@ -6,10 +6,10 @@
account.invoice.confirm
form
-
@@ -17,7 +17,7 @@
- Confirm draft invoices
+ Confirm Draft Invoices
account.invoice.confirm
form
form
@@ -28,7 +28,7 @@
- Confirm draft invoices
+ Confirm Draft Invoices
client_action_multi
action
@@ -40,18 +40,18 @@
account.invoice.cancel
form
-
- Cancel selected invoices
+ Cancel Selected Invoices
account.invoice.cancel
form
form
@@ -62,7 +62,7 @@
- Cancel selected invoices
+ Cancel Selected Invoices
client_action_multi
action
diff --git a/addons/point_of_sale/__init__.py b/addons/point_of_sale/__init__.py
index ddd7dc3c01f..0baf4639019 100644
--- a/addons/point_of_sale/__init__.py
+++ b/addons/point_of_sale/__init__.py
@@ -27,7 +27,5 @@ import stock
import wizard
import report
-
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py
index 7c872bda845..0f83cefa852 100644
--- a/addons/point_of_sale/pos.py
+++ b/addons/point_of_sale/pos.py
@@ -287,7 +287,7 @@ class pos_order(osv.osv):
'date_payment': fields.function(_get_date_payment2, method=True, string='Payment Date', type='date', store=True),
'date_validity': fields.date('Validity Date', required=True),
'user_id': fields.many2one('res.users', 'Connected Salesman', readonly=True),
- 'user_saleman': fields.many2one('res.users', 'Salesman', required=True),
+ 'user_salesman_id': fields.many2one('res.users', 'Salesman', required=True),
'sale_manager': fields.many2one('res.users', 'Salesman Manager'),
'amount_tax': fields.function(_amount_all, method=True, string='Taxes',digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
'amount_total': fields.function(_amount_total, method=True, string='Total'),
@@ -703,7 +703,7 @@ class pos_order(osv.osv):
inv_ids = []
for order in self.browse(cr, uid, ids, context):
- curr_c = order.user_saleman.company_id
+ curr_c = order.user_salesman_id.company_id
if order.invoice_id:
inv_ids.append(order.invoice_id.id)
continue
@@ -980,8 +980,8 @@ class pos_order(osv.osv):
create_contract_nb = True
break
if create_contract_nb:
- seq = sequence_obj.get(cr, uid, 'pos.user_%s' % pos.user_saleman.login)
- vals['contract_number'] ='%s-%s' % (pos.user_saleman.login, seq)
+ seq = sequence_obj.get(cr, uid, 'pos.user_%s' % pos.user_salesman_id.login)
+ vals['contract_number'] ='%s-%s' % (pos.user_salesman_id.login, seq)
self.write(cr, uid, ids, vals)
def action_paid(self, cr, uid, ids, context=None):
@@ -1328,4 +1328,4 @@ class product_product(osv.osv):
'disc_controle': lambda *a: True,
}
product_product()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/pos_demo.xml b/addons/point_of_sale/pos_demo.xml
index f3573abc791..b75f4362578 100644
--- a/addons/point_of_sale/pos_demo.xml
+++ b/addons/point_of_sale/pos_demo.xml
@@ -57,7 +57,7 @@
-
+
@@ -93,7 +93,7 @@
-
+
@@ -135,7 +135,7 @@
-
+
diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml
index e9829addbda..637d37fa0b8 100644
--- a/addons/point_of_sale/pos_view.xml
+++ b/addons/point_of_sale/pos_view.xml
@@ -11,7 +11,7 @@
-
+
diff --git a/addons/point_of_sale/report/pos_receipt.rml b/addons/point_of_sale/report/pos_receipt.rml
index 807d9e497d6..d615fc74534 100644
--- a/addons/point_of_sale/report/pos_receipt.rml
+++ b/addons/point_of_sale/report/pos_receipt.rml
@@ -103,7 +103,7 @@
Tel : [[ address and address.phone ]]
E-mail : [[ address and address.email ]]
Shop : [[ o.shop_id.name ]]
- Vendeur : [[ o.user_saleman.name ]]
+ Vendeur : [[ o.user_salesman_id.name ]]
Date : [[ formatLang(o.date_order,date = True) ]]
diff --git a/addons/stock/report/__init__.py b/addons/stock/report/__init__.py
index 8fd64d9f112..a0a4bcb8ea5 100644
--- a/addons/stock/report/__init__.py
+++ b/addons/stock/report/__init__.py
@@ -29,7 +29,6 @@ import lot_overview_all
import report_stock
import report_stock_move
import report_stock_picking
-import report_stock_move
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index a4211f8f50d..3795351e03a 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -182,7 +182,7 @@ class stock_location(osv.osv):
'stock_real_value': fields.function(_product_value, method=True, type='float', string='Real Stock Value', multi="stock"),
'stock_virtual_value': fields.function(_product_value, method=True, type='float', string='Virtual Stock Value', multi="stock"),
'company_id': fields.many2one('res.company', 'Company', required=True,select=1),
- 'scraped': fields.boolean('Scraped'),
+ 'scrap_location': fields.boolean('Scrap Location', help='Check this box if the current location is a place for destroyed items'),
}
_defaults = {
'active': lambda *a: 1,
@@ -195,7 +195,7 @@ class stock_location(osv.osv):
'posy': lambda *a: 0,
'posz': lambda *a: 0,
'icon': lambda *a: False,
- 'scraped': lambda *a: False,
+ 'scrap_location': lambda *a: False,
}
def chained_location_get(self, cr, uid, location, partner=None, product=None, context={}):
@@ -1214,7 +1214,7 @@ class stock_move(osv.osv):
'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin"),
'move_stock_return_history': fields.many2many('stock.move', 'stock_move_return_history', 'move_id', 'return_move_id', 'Move Return History',readonly=True),
'delivered_id': fields.many2one('stock.delivery', 'Product delivered'),
- 'scraped': fields.related('location_dest_id','scraped',type='boolean',relation='stock.location',string='Scraped'),
+ 'scraped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scraped'),
}
_constraints = [
(_check_tracking,
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 5d2a83f695f..3c9f1d393ad 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -404,7 +404,7 @@
-
+
diff --git a/addons/stock/wizard/stock_move_view.xml b/addons/stock/wizard/stock_move_view.xml
index abf8afc0d95..5f58072f17a 100644
--- a/addons/stock/wizard/stock_move_view.xml
+++ b/addons/stock/wizard/stock_move_view.xml
@@ -73,7 +73,7 @@