[REF]
bzr revid: mra@mra-laptop-20100809060304-06n2fpy70xpq06m7
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,9 +15,10 @@
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import sale_journal
|
||||
import report
|
||||
|
||||
|
||||
@@ -167,19 +167,19 @@ class picking_journal(osv.osv):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'stock.picking', pickid, 'button_cancel', cr)
|
||||
return True
|
||||
|
||||
|
||||
def button_open(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'open'})
|
||||
return True
|
||||
|
||||
|
||||
def button_draft(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
return True
|
||||
|
||||
|
||||
def button_close(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'close', 'date_close':time.strftime('%Y-%m-%d')})
|
||||
return True
|
||||
|
||||
|
||||
def button_reset(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state': 'draft'})
|
||||
for (id,name) in self.name_get(cr, uid, ids):
|
||||
@@ -188,15 +188,15 @@ class picking_journal(osv.osv):
|
||||
return True
|
||||
|
||||
def button_picking_confirm(self, cr, uid, ids, context={}):
|
||||
|
||||
|
||||
self.write(cr, uid, ids, {'state':'confirm'})
|
||||
for id in ids:
|
||||
pick_ids = self.pool.get('stock.picking').search(cr, uid, [('journal_id','=',id)])
|
||||
for pickid in pick_ids:
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'stock.picking', pickid, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'stock.picking', pickid, 'button_confirm', cr)
|
||||
return True
|
||||
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
"""Overrides orm copy method
|
||||
@param self: The object pointer
|
||||
@@ -211,7 +211,7 @@ class picking_journal(osv.osv):
|
||||
default = {}
|
||||
default.update({'picking_stats_ids': []})
|
||||
return super(picking_journal, self).copy(cr, uid, id, default=default, context=context)
|
||||
|
||||
|
||||
picking_journal()
|
||||
|
||||
#==============================================
|
||||
@@ -264,5 +264,7 @@ class sale(osv.osv):
|
||||
itype = self.pool.get('res.partner').browse(cr, uid, part).property_invoice_type.id
|
||||
result['value']['invoice_type_id'] = itype
|
||||
return result
|
||||
|
||||
sale()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
@@ -19,12 +19,14 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields,osv
|
||||
from tools import config
|
||||
import decimal_precision as dp
|
||||
from tools.translate import _
|
||||
|
||||
class sale_order_line(osv.osv):
|
||||
|
||||
|
||||
def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
@@ -84,7 +86,7 @@ class sale_order_line(osv.osv):
|
||||
if vals['layout_type'] == 'break':
|
||||
vals['name'] = ' '
|
||||
if vals['layout_type'] != 'article':
|
||||
vals['product_uom_qty']= 0
|
||||
vals['product_uom_qty']= 0
|
||||
return super(sale_order_line, self).create(cr, user, vals, context)
|
||||
|
||||
def write(self, cr, user, ids, vals, context=None):
|
||||
@@ -100,7 +102,7 @@ class sale_order_line(osv.osv):
|
||||
default = {}
|
||||
default['layout_type'] = self.browse(cr, uid, id).layout_type
|
||||
return super(sale_order_line, self).copy(cr, uid, id, default, context)
|
||||
|
||||
|
||||
|
||||
_name = "sale.order.line"
|
||||
_order = "order_id, sequence asc"
|
||||
@@ -115,17 +117,17 @@ class sale_order_line(osv.osv):
|
||||
('line','Separator Line'),
|
||||
('break','Page Break'),]
|
||||
,'Layout Type', select=True, required=True),
|
||||
'sequence': fields.integer('Sequence Number'),
|
||||
'sequence': fields.integer('Sequence Number'),
|
||||
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price'), readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'product_uom_qty': fields.float('Quantity (UoM)', digits=(16,2)),
|
||||
'product_uom': fields.many2one('product.uom', 'Product UoM'),
|
||||
}
|
||||
'product_uom': fields.many2one('product.uom', 'Product UoM'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'layout_type': lambda *a: 'article',
|
||||
}
|
||||
sale_order_line()
|
||||
|
||||
sale_order_line()
|
||||
|
||||
class one2many_mod2(fields.one2many):
|
||||
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
|
||||
@@ -155,6 +157,7 @@ class sale_order(osv.osv):
|
||||
'abstract_line_ids': fields.one2many('sale.order.line', 'order_id', 'Order Lines',readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'order_line': one2many_mod2('sale.order.line', 'order_id', 'Order Lines',readonly=True, states={'draft':[('readonly',False)]}),
|
||||
}
|
||||
sale_order()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
sale_order()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
Reference in New Issue
Block a user