Although they can see which items are and are not available to deliver, they have asked for a warning at the top of the Delivery Order to make it absolutely clear.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Python:
from openerp.osv import fields,osv
class stock_picking(osv.osv):
_inherit = 'stock.picking'def _available_status(self, cr, uid, ids, name, args, context=None):
res = {}
for picking in self.browse(cr, uid, ids, context=context):
available_status = Truefor move in picking.move_lines:
if move.state == 'waiting' or move.state == 'confirmed':
available_status = Falseres[picking.id] = available_status
return res
_columns = {
'available_status': fields.function(_available_status, type='boolean', string='Completely Available', store=False,),}
# https://bugs.launchpad.net/openobject-addons/+bug/1169998
class stock_picking_out(osv.osv):
_inherit = 'stock.picking.out'def __init__(self, pool, cr):
super(stock_picking_out, self).__init__(pool, cr)
self._columns['available_status'] = self.pool['stock.picking']._columns['available_status']
XML:
<record model="ir.ui.view" id="stock_picking_out_form">
<field name="name">stock.picking.out.form</field>
<field name="type">form</field>
<field name="model">stock.picking.out</field>
<field name="inherit_id" ref="stock.view_picking_out_form"/>
<field name="arch" type="xml">
<data>
<h1 position="before">
<field name="available_status" invisible="1"/>
<h2>
<label name="do_warning" string="WARNING: This Delivery Order is not completely ready to deliver."
attrs="{'invisible':[('available_status','=',True)]}" style="background-color: red; color: yellow;"/>
</h2>
</h1>
</data>
</field>
</record>
Result:
good presentation for a warning vote +1
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
3
thg 10 22
|
6634 | ||
|
0
thg 12 20
|
5211 | ||
500 Internal Server Error
Đã xử lý
|
|
4
thg 9 16
|
51609 | |
|
0
thg 7 15
|
4232 | ||
|
0
thg 3 15
|
3410 |