Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How can I provide an additional warning to users when a Delivery Order is only partially available to deliver?

Ray Carnes
on 3/12/15, 1:34 PM 489 views

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.


Ray Carnes

--Ray Carnes--
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 3/12/15, 1:38 PM


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 = True

            for move in picking.move_lines:
                if move.state == 'waiting' or move.state == 'confirmed':
                    available_status = False

            res[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']


<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">
      <h1 position="before">
        <field name="available_status" invisible="1"/>
          <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;"/>


good presentation for a warning vote +1

Cyril Gaspard (GEM)
on 3/14/15, 5:42 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 3/12/15, 1:34 PM
Seen: 489 times
Last updated: 3/16/15, 8:10 AM