[Merge] : branch merged with lp:~openerp-dev/openobject-addons/sbh-dev-addons1

bzr revid: mso@mso-20100525121845-ilhhhqhat20ma3ae
This commit is contained in:
mso
2010-05-25 17:48:45 +05:30
7 changed files with 21 additions and 47 deletions
-1
View File
@@ -23,7 +23,6 @@
import pos
import account_bank_statement
import pos_account_bank_statement
import stock
import wizard
import report
+9
View File
@@ -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:
+1 -1
View File
@@ -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>
-37
View File
@@ -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:
+6 -4
View File
@@ -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})
+4 -2
View File
@@ -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'),
+1 -2
View File
@@ -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"/>