summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormso <mso@mso>2010-05-25 17:48:45 +0530
committermso <mso@mso>2010-05-25 17:48:45 +0530
commitc8aa1db184fa49e53c76fa54adeeaee6ca6d113d (patch)
tree8677025f53fc54826144c1bb6e498c94d2fc7ca8
parent8edb95a72879b3553ec4882a4078869a0156540c (diff)
parent541dd7a0d0bb22d829170aec92fa13dcdacdd9ba (diff)
[Merge] : branch merged with lp:~openerp-dev/openobject-addons/sbh-dev-addons1
bzr revid: mso@mso-20100525121845-ilhhhqhat20ma3ae
-rw-r--r--addons/point_of_sale/__init__.py1
-rw-r--r--addons/point_of_sale/pos.py9
-rw-r--r--addons/point_of_sale/pos_view.xml2
-rw-r--r--addons/point_of_sale/stock.py37
-rw-r--r--addons/point_of_sale/wizard/pos_payment.py10
-rw-r--r--addons/point_of_sale/wizard/pos_return.py6
-rw-r--r--addons/product/product_view.xml3
7 files changed, 21 insertions, 47 deletions
diff --git a/addons/point_of_sale/__init__.py b/addons/point_of_sale/__init__.py
index 0baf4639019..2d195b3d4a5 100644
--- a/addons/point_of_sale/__init__.py
+++ b/addons/point_of_sale/__init__.py
@@ -23,7 +23,6 @@
import pos
import account_bank_statement
import pos_account_bank_statement
-import stock
import wizard
import report
diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py
index 597be8eaea7..5d4df5a5f10 100644
--- a/addons/point_of_sale/pos.py
+++ b/addons/point_of_sale/pos.py
@@ -1331,4 +1331,13 @@ class product_product(osv.osv):
'disc_controle': lambda *a: True,
}
product_product()
+
+class stock_picking(osv.osv):
+
+ _inherit = 'stock.picking'
+ _columns = {
+ 'pos_order': fields.many2one('pos.order', 'Pos order'),
+ }
+stock_picking()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml
index d2cc102a047..0089d6369f6 100644
--- a/addons/point_of_sale/pos_view.xml
+++ b/addons/point_of_sale/pos_view.xml
@@ -66,7 +66,7 @@
<button name="%(action_report_pos_receipt)d" string="_Reprint" icon="gtk-print" type="action" states="paid,done,invoiced"/>
<button name="set_to_draft" string="Set to draft" states="paid" icon="gtk-execute" type="object" />
<button name="%(action_view_pos_return)d" string="Return Picking" type="action" icon="gtk-ok" states="paid"
- attrs="{'invisible':[('state','!=','paid'),('state','!=','invoiced')]}"/>
+ attrs="{'invisible':[('state','!=','paid'),('state','!=','invoiced')]}" context="{'return':'return'}" />
</group>
</page>
diff --git a/addons/point_of_sale/stock.py b/addons/point_of_sale/stock.py
deleted file mode 100644
index 9d2b24d69b8..00000000000
--- a/addons/point_of_sale/stock.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-from osv import osv, fields
-import time
-import netsvc
-
-
-class stock_picking(osv.osv):
-
- _inherit = 'stock.picking'
- _columns = {
- 'pos_order': fields.many2one('pos.order', 'Pos order'),
- }
-stock_picking()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py
index d7cb3414814..565ae257180 100644
--- a/addons/point_of_sale/wizard/pos_payment.py
+++ b/addons/point_of_sale/wizard/pos_payment.py
@@ -123,8 +123,7 @@ class pos_make_payment(osv.osv_memory):
"""
return result
- def check(self, cr, uid, ids, context=None):
-
+ def check(self, cr, uid, ids, context):
"""Check the order:
if the order is not paid: continue payment,
if the order is paid print invoice (if wanted) or ticket.
@@ -153,8 +152,11 @@ class pos_make_payment(osv.osv_memory):
return self.create_invoice(cr,uid,ids,context)
else:
context.update({'flag': True})
- order_obj.action_paid(cr,uid,[active_id],context)
- order_obj.write(cr, uid, [active_id],{'state':'paid'})
+ order_obj.action_paid(cr,uid,[active_id],context)
+ if context.get('return'):
+ order_obj.write(cr, uid, [active_id],{'state':'done'})
+ else:
+ order_obj.write(cr, uid, [active_id],{'state':'paid'})
return self.print_report(cr, uid, ids, context)
if order.amount_paid > 0.0:
context.update({'flag': True})
diff --git a/addons/point_of_sale/wizard/pos_return.py b/addons/point_of_sale/wizard/pos_return.py
index 31d18ef09a5..91a063df9a9 100644
--- a/addons/point_of_sale/wizard/pos_return.py
+++ b/addons/point_of_sale/wizard/pos_return.py
@@ -186,6 +186,7 @@ class pos_return(osv.osv_memory):
line_obj.copy(cr,uid,line.id,{'qty':-qty ,
'order_id': new_order,
})
+ order_obj.write(cr,uid, active_id, {'state':'done'})
order_obj.write(cr,uid, new_order, {'state':'done'})
wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
picking_obj.force_assign(cr, uid, [new_picking], context)
@@ -334,8 +335,9 @@ class add_product(osv.osv_memory):
})
wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
picking_obj.force_assign(cr, uid, [new_picking], context)
- obj=order_obj.browse(cr,uid, active_ids[0])
-
+ obj=order_obj.browse(cr,uid, active_ids[0])
+ context.update({'return':'return'})
+
if obj.amount_total != obj.amount_paid:
return {
'name': _('Make Payment'),
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 9bfcb33b050..fefdbe2ce88 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -465,8 +465,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Product Variant">
- <separator colspan="4" string="Description"/>
- <field name="product_tmpl_id" select="1"/>
+ <field name="product_tmpl_id" select="1"/>
<field name="active" select="1"/>
<field name="variants" select="1"/>
<field name="default_code" select="1"/>