hunk.code_window:                             move_qty -= qty
           for move in todo_moves:
               if move.linked_move_operation_ids:
                   continue
               #then if the move isn't totally assigned, try to find quants without any specific domain
               if move.state != 'assigned':
                   qty_already_assigned = move.reserved_availability
                   qty = move.product_qty - qty_already_assigned
  
hunk.labels: keep keep keep replace replace keep keep keep keep
hunk.file_path: addons/stock/stock.py
hunk.type: replace
file: <?xml version="1.0" encoding="utf-8"?>
  <openerp>
      <data>
  
          <!-- Example employee -->
  
          <record id="timesheet_group1" model="resource.calendar">
              <field name="name">45 Hours/Week</field>
          </record>
  
          <record model="resource.calendar.attendance" id="calendar_attendance_mon1">
              <field name="name">Monday morning</field>
              <field name="dayofweek">0</field>
              <field name="hour_from">08</field>
              <field name="hour_to">12</field>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
          <record model="resource.calendar.attendance" id="calendar_attendance_mon2">
              <field name="name">Monday evening</field>
              <field name="dayofweek">0</field>
              <field name="hour_from">13</field>
              <field name="hour_to">18</field>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
          <record model="resource.calendar.attendance" id="calendar_attendance_tue1">
              <field name="name">Tuesday morning</field>
              <field name="dayofweek">1</field>
              <field name="hour_from">08</field>
              <field name="hour_to">12</field>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
          <record model="resource.calendar.attendance" id="calendar_attendance_tue2">
              <field name="name">Tuesday evening</field>
              <field name="dayofweek">1</field>
              <field name="hour_from">13</field>
              <field name="hour_to">18</field>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
          <record model="resource.calendar.attendance" id="calendar_attendance_wed1">
              <field name="name">Wednesday morning</field>
              <field name="dayofweek">2</field>
              <field name="hour_from">08</field>
              <field name="hour_to">12</field>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
          <record model="resource.calendar.attendance" id="calendar_attendance_wed2">
              <field name="name">Wednesday evening</field>
              <field name="dayofweek">2</field>
              <field name="hour_from">13</field>
              <field name="hour_to">18</field>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
          <record model="resource.calendar.attendance" id="calendar_attendance_thu1">
              <field name="name">Thursday morning</field>
              <field name="dayofweek">3</field>
              <field name="hour_from">08</field>
              <field name="hour_to">12</field>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
          <record model="resource.calendar.attendance" id="calendar_attendance_thu2">
              <field name="name">Thursday evening</field>
              <field name="hour_from">13</field>
              <field name="hour_to">18</field>
              <field name="dayofweek">3</field>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
          <record model="resource.calendar.attendance" id="calendar_attendance_fri1">
              <field name="name">Friday morning</field>
              <field name="dayofweek">4</field>
              <field name="hour_from">08</field>
              <field name="hour_to">12</field>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
          <record model="resource.calendar.attendance" id="calendar_attendance_fri2">
              <field name="name">Friday evening</field>
              <field name="dayofweek">4</field>
              <field name="hour_from">13</field>
              <field name="hour_to">18</field>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
  
          <record id="resource_analyst" model="resource.resource">
              <field eval="1.0" name="time_efficiency"/>
              <field name="user_id" ref="base.user_root"/>
              <field name="name">Analyst</field>
              <field eval="1" name="active"/>
              <field name="calendar_id" ref="timesheet_group1"/>
              <field name="resource_type">user</field>
          </record>
  
          <record id="resource_designer" model="resource.resource">
              <field eval="1.0" name="time_efficiency"/>
              <field name="user_id" ref="base.user_demo"/>
              <field name="name">Designer</field>
              <field eval="1" name="active"/>
              <field name="calendar_id" ref="timesheet_group1"/>
              <field name="resource_type">user</field>
          </record>
  
          <record id="resource_developer" model="resource.resource">
              <field eval="1.0" name="time_efficiency"/>
              <field name="user_id" ref="base.user_demo"/>
              <field name="name">Developer</field>
              <field eval="1" name="active"/>
              <field name="calendar_id" ref="timesheet_group1"/>
              <field name="resource_type">user</field>
          </record>
  
          <record id="resource_analyst_leaves_demoleave1" model="resource.calendar.leaves">
              <field name="name">2 Hours On Leave</field>
              <field name="resource_id" ref="resource_analyst"/>
              <field name="date_from" eval="time.strftime('%Y-%m-%d 08:00:00')"/>
              <field name="date_to" eval="time.strftime('%Y-%m-%d 11:00:00')"/>
              <field name="calendar_id" ref="timesheet_group1"/>
          </record>
          
          <record id="resource_dummyleave" model="resource.calendar.leaves">
              <field name="name">Dummy Resource Leave</field>
              <field name="resource_id" ref="resource_analyst"/>
              <field name="date_from" eval="time.strftime('%Y-%m-%d 08:00:00')"/>
              <field name="date_to" eval="time.strftime('%Y-%m-%d 11:00:00')"/>
          </record>
  
      </data>
  </openerp>
  