[MERGE]: Merged with lp:~openerp-dev/openobject-addons/ron-dev-addons2
bzr revid: rpa@tinyerp.com-20110105062012-3inccz5v5zsl28t5
This commit is contained in:
commit
a1a9308685
|
@ -361,17 +361,23 @@ class procurement_order(osv.osv):
|
|||
"""
|
||||
ok = True
|
||||
if procurement.move_id:
|
||||
message = False
|
||||
id = procurement.move_id.id
|
||||
if not (procurement.move_id.state in ('done','assigned','cancel')):
|
||||
ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id])
|
||||
cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,))
|
||||
if not cr.fetchone()[0]:
|
||||
cr.execute('update procurement_order set message=%s where id=%s',
|
||||
(_('Not enough stock and no minimum orderpoint rule defined.'),
|
||||
procurement.id))
|
||||
message = _("Procurement '%s' is in exception: not enough stock.") % \
|
||||
(procurement.name,)
|
||||
self.log(cr, uid, procurement.id, message)
|
||||
res = cr.fetchone()[0]
|
||||
if not res and not ok:
|
||||
message = _("Not enough stock and no minimum orderpoint rule defined.")
|
||||
elif not res:
|
||||
message = _("No minimum orderpoint rule defined for '%s'.") % \
|
||||
(procurement.move_id.product_id.name,)
|
||||
elif not ok:
|
||||
message = _("Not enough stock for '%s'.") % (procurement.move_id.product_id.name,)
|
||||
|
||||
if message:
|
||||
self.log(cr, uid, procurement.id, _("Procurement '%s' is in exception: ") % (procurement.name) + message)
|
||||
cr.execute('update procurement_order set message=%s where id=%s', (message, procurement.id))
|
||||
return ok
|
||||
|
||||
def action_produce_assign_service(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -166,10 +166,9 @@ class product_pricelist(osv.osv):
|
|||
pricelist_version_ids = pricelist_ids
|
||||
else:
|
||||
# all pricelists:
|
||||
pricelist_version_ids = product_pricelist_version_obj.search(cr, uid, [])
|
||||
pricelist_version_ids = self.pool.get('product.pricelist').search(cr, uid, [], context=context)
|
||||
|
||||
pricelist_version_ids = list(set(pricelist_version_ids))
|
||||
|
||||
plversions_search_args = [
|
||||
('pricelist_id', 'in', pricelist_version_ids),
|
||||
'|',
|
||||
|
|
|
@ -171,7 +171,8 @@
|
|||
</record>
|
||||
|
||||
|
||||
<menuitem id="base.next_id_73" name="Reporting" parent="base.menu_purchase_root" sequence="8"/>
|
||||
<menuitem id="base.next_id_73" name="Reporting" parent="base.menu_purchase_root" sequence="8"
|
||||
groups="purchase.group_purchase_manager"/>
|
||||
<menuitem action="action_purchase_order_report_all" id="menu_action_purchase_order_report_all" parent="base.next_id_73" sequence="3"/>
|
||||
|
||||
<record id="action_stock_move_report_po" model="ir.actions.act_window">
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/search/group/filter[@string='To be Invoiced']" position="after">
|
||||
<filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]" separator="1"/>
|
||||
<xpath expr="/search/group/filter[@string='Not Invoiced']" position="after">
|
||||
<filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]" separator="1" help="Purchase Orders with requisition"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -739,12 +739,13 @@ class sale_order(osv.osv):
|
|||
proc_obj.write(cr, uid, [proc_id], {'product_qty': mov.product_qty, 'product_uos_qty': mov.product_uos_qty})
|
||||
|
||||
val = {}
|
||||
for proc_id in proc_ids:
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
|
||||
if picking_id:
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
|
||||
|
||||
for proc_id in proc_ids:
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
|
||||
if order.state == 'shipping_except':
|
||||
val['state'] = 'progress'
|
||||
val['shipped'] = False
|
||||
|
|
|
@ -1775,7 +1775,7 @@ class stock_move(osv.osv):
|
|||
picking_obj = self.pool.get('stock.picking')
|
||||
pick_id= picking_obj.create(cr, uid, {
|
||||
'name': pick_name,
|
||||
'origin': str(picking.origin or ''),
|
||||
'origin': tools.ustr(picking.origin or ''),
|
||||
'type': ptype,
|
||||
'note': picking.note,
|
||||
'move_type': picking.move_type,
|
||||
|
|
Loading…
Reference in New Issue