@@ -2002,12 +2002,12 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
'python_compute_inv': tax.python_compute_inv,
|
||||
'python_applicable': tax.python_applicable,
|
||||
'tax_group':tax.tax_group,
|
||||
'base_code_id': tax.base_code_id and tax_code_template_ref[tax.base_code_id.id] or False,
|
||||
'tax_code_id': tax.tax_code_id and tax_code_template_ref[tax.tax_code_id.id] or False,
|
||||
'base_code_id': tax.base_code_id and ((tax.base_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.base_code_id.id]) or False,
|
||||
'tax_code_id': tax.tax_code_id and ((tax.tax_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.tax_code_id.id]) or False,
|
||||
'base_sign': tax.base_sign,
|
||||
'tax_sign': tax.tax_sign,
|
||||
'ref_base_code_id': tax.ref_base_code_id and tax_code_template_ref[tax.ref_base_code_id.id] or False,
|
||||
'ref_tax_code_id': tax.ref_tax_code_id and tax_code_template_ref[tax.ref_tax_code_id.id] or False,
|
||||
'ref_base_code_id': tax.ref_base_code_id and ((tax.ref_base_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.ref_base_code_id.id]) or False,
|
||||
'ref_tax_code_id': tax.ref_tax_code_id and ((tax.ref_tax_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.ref_tax_code_id.id]) or False,
|
||||
'ref_base_sign': tax.ref_base_sign,
|
||||
'ref_tax_sign': tax.ref_tax_sign,
|
||||
'include_base_amount': tax.include_base_amount,
|
||||
|
||||
@@ -499,7 +499,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
||||
}
|
||||
}
|
||||
stock_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Stock')])[0]
|
||||
produc_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Default Production')])[0]
|
||||
produc_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Production')])[0]
|
||||
to_invoice=False
|
||||
if guarantee_limit and today() > mx.DateTime.strptime(guarantee_limit, '%Y-%m-%d'):
|
||||
to_invoice=True
|
||||
|
||||
+31
-5
@@ -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$
|
||||
#
|
||||
@@ -261,9 +261,9 @@ class sale_order(osv.osv):
|
||||
unlink_ids.append(s['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sale Order(s) which are already confirmed !'))
|
||||
return osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||
|
||||
|
||||
return osv.osv.unlink(self, cr, uid, unlink_ids)
|
||||
|
||||
|
||||
def onchange_shop_id(self, cr, uid, ids, shop_id):
|
||||
v={}
|
||||
if shop_id:
|
||||
@@ -296,6 +296,32 @@ class sale_order(osv.osv):
|
||||
payment_term = part.property_payment_term and part.property_payment_term.id or False
|
||||
return {'value':{'partner_invoice_id': addr['invoice'], 'partner_order_id':addr['contact'], 'partner_shipping_id':addr['delivery'], 'pricelist_id': pricelist, 'payment_term' : payment_term}}
|
||||
|
||||
def shipping_policy_change(self, cr, uid, ids, policy, context={}):
|
||||
if not policy:
|
||||
return {}
|
||||
inv_qty = 'order'
|
||||
if policy=='prepaid':
|
||||
inv_qty = 'order'
|
||||
elif policy=='picking':
|
||||
inv_qty = 'procurement'
|
||||
return {'value':{'invoice_quantity':inv_qty}}
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if vals.has_key('order_policy'):
|
||||
if vals['order_policy']=='prepaid':
|
||||
vals.update({'invoice_quantity':'order'})
|
||||
elif vals['order_policy']=='picking':
|
||||
vals.update({'invoice_quantity':'procurement'})
|
||||
return super(sale_order, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
if vals.has_key('order_policy'):
|
||||
if vals['order_policy']=='prepaid':
|
||||
vals.update({'invoice_quantity':'order'})
|
||||
if vals['order_policy']=='picking':
|
||||
vals.update({'invoice_quantity':'procurement'})
|
||||
return super(sale_order, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def button_dummy(self, cr, uid, ids, context={}):
|
||||
return True
|
||||
|
||||
@@ -453,7 +479,7 @@ class sale_order(osv.osv):
|
||||
def test_state(self, cr, uid, ids, mode, *args):
|
||||
assert mode in ('finished', 'canceled'), _("invalid mode for test_state")
|
||||
finished = True
|
||||
canceled = False
|
||||
canceled = False
|
||||
notcanceled = False
|
||||
write_done_ids = []
|
||||
write_cancel_ids = []
|
||||
|
||||
@@ -202,9 +202,9 @@
|
||||
<field groups="base.group_extended" name="incoterm"/>
|
||||
<field groups="base.group_extended" name="picking_policy" required="True"/>
|
||||
<field name="user_id"/>
|
||||
<field name="order_policy"/>
|
||||
<field name="order_policy" on_change="shipping_policy_change(order_policy)"/>
|
||||
<field groups="base.group_extended" name="origin"/>
|
||||
<field groups="base.group_extended" name="invoice_quantity" attrs="{'readonly':[('order_policy','=','prepaid')]}"/>
|
||||
<field groups="base.group_extended" name="invoice_quantity" attrs="{'readonly':[('order_policy','=','prepaid'),('order_policy','=','picking')]}"/>
|
||||
<field name="payment_term"/>
|
||||
<separator colspan="4" string="Notes"/>
|
||||
<field colspan="4" name="note" nolabel="1"/>
|
||||
|
||||
Reference in New Issue
Block a user