@@ -1392,13 +1392,17 @@ class account_tax(osv.osv):
|
||||
|
||||
res = []
|
||||
taxes.reverse()
|
||||
cur_price_unit=price_unit
|
||||
cur_price_unit = price_unit
|
||||
|
||||
tax_parent_tot = 0.0
|
||||
for tax in taxes:
|
||||
if (tax.type=='percent') and not tax.include_base_amount:
|
||||
tax_parent_tot+=tax.amount
|
||||
|
||||
tax_parent_tot += tax.amount
|
||||
|
||||
for tax in taxes:
|
||||
if (tax.type=='fixed') and not tax.include_base_amount:
|
||||
cur_price_unit -= tax.amount
|
||||
|
||||
for tax in taxes:
|
||||
if tax.type=='percent':
|
||||
if tax.include_base_amount:
|
||||
|
||||
@@ -567,7 +567,7 @@ class abstracted_fs:
|
||||
val['partner_id']=dst_basedir.object2.id
|
||||
else:
|
||||
obj2=pool.get(dst_basedir.object2._name)
|
||||
val['partner_id']= obj2.fields_get(cr,uid,['partner_id']) and dst_basedir.object2.partner_id.id or False
|
||||
val['partner_id']= obj2.fields_get(src.cr, src.uid,['partner_id']) and dst_basedir.object2.partner_id.id or False
|
||||
elif src.object.res_id:
|
||||
# I had to do that because writing False to an integer writes 0 instead of NULL
|
||||
# change if one day we decide to improve osv/fields.py
|
||||
|
||||
@@ -1031,6 +1031,8 @@ class mrp_procurement(osv.osv):
|
||||
[produce_id], properties=[x.id for x in procurement.property_ids])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production', produce_id, 'button_confirm', cr)
|
||||
self.pool.get('stock.move').write(cr, uid, [res_id],
|
||||
{'location_id':procurement.location_id.id})
|
||||
return produce_id
|
||||
|
||||
def action_po_assign(self, cr, uid, ids, context={}):
|
||||
@@ -1053,6 +1055,8 @@ class mrp_procurement(osv.osv):
|
||||
|
||||
newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S')
|
||||
newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
|
||||
newdate = newdate - procurement.product_id.seller_ids[0].delay
|
||||
|
||||
context.update({'lang':partner.lang})
|
||||
product=self.pool.get('product.product').browse(cr,uid,procurement.product_id.id,context=context)
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ class purchase_order(osv.osv):
|
||||
help="Reference of the document that generated this purchase order request."
|
||||
),
|
||||
'partner_ref': fields.char('Partner Ref.', size=64),
|
||||
'date_order':fields.date('Date Ordered', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}),
|
||||
'date_order':fields.date('Date', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}, help="Date on which this document has been created."),
|
||||
'date_approve':fields.date('Date Approved', readonly=1),
|
||||
'partner_id':fields.many2one('res.partner', 'Supplier', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}, change_default=True),
|
||||
'partner_address_id':fields.many2one('res.partner.address', 'Address', required=True, states={'posted':[('readonly',True)]}),
|
||||
|
||||
@@ -764,6 +764,7 @@ class sale_order_line(osv.osv):
|
||||
line.procurement_id.id, context)
|
||||
|
||||
create_ids = []
|
||||
sales = {}
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
if not line.invoiced:
|
||||
if line.product_id:
|
||||
@@ -802,7 +803,14 @@ class sale_order_line(osv.osv):
|
||||
})
|
||||
cr.execute('insert into sale_order_line_invoice_rel (order_line_id,invoice_id) values (%s,%s)', (line.id, inv_id))
|
||||
self.write(cr, uid, [line.id], {'invoiced':True})
|
||||
|
||||
sales[line.order_id.id] = True
|
||||
create_ids.append(inv_id)
|
||||
|
||||
# Trigger workflow events
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for sid in sales.keys():
|
||||
wf_service.trg_write(uid, 'sale.order', sid, cr)
|
||||
return create_ids
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context={}):
|
||||
|
||||
@@ -891,7 +891,7 @@ class stock_move(osv.osv):
|
||||
'priority': fields.selection([('0','Not urgent'),('1','Urgent')], 'Priority'),
|
||||
|
||||
'date': fields.datetime('Date Created'),
|
||||
'date_planned': fields.datetime('Scheduled Date', required=True),
|
||||
'date_planned': fields.datetime('Date', required=True, help="Scheduled date for the movement of the products or real date if the move is done."),
|
||||
|
||||
'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
|
||||
|
||||
@@ -1142,7 +1142,6 @@ class stock_move(osv.osv):
|
||||
track_flag=False
|
||||
for move in self.browse(cr, uid, ids):
|
||||
if move.move_dest_id.id and (move.state != 'done'):
|
||||
mid = move.move_dest_id.id
|
||||
cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id))
|
||||
if move.move_dest_id.state in ('waiting','confirmed'):
|
||||
self.write(cr, uid, [move.move_dest_id.id], {'state':'assigned'})
|
||||
|
||||
Reference in New Issue
Block a user