[MERGE] main trunk
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>
Mon, 3 Feb 2014 17:30:00 +0000 (18:30 +0100)
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>
Mon, 3 Feb 2014 17:30:00 +0000 (18:30 +0100)
bzr revid: qdp-launchpad@openerp.com-20140203173000-mk092iw2wz3y0e3e

32 files changed:
1  2 
addons/delivery/delivery_demo.xml
addons/delivery/sale.py
addons/event_sale/event_sale_view.xml
addons/mrp/mrp.py
addons/mrp/mrp_view.xml
addons/mrp/security/ir.model.access.csv
addons/multi_company/multi_company_demo.xml
addons/point_of_sale/point_of_sale.py
addons/point_of_sale/point_of_sale_view.xml
addons/point_of_sale/security/ir.model.access.csv
addons/portal_stock/security/ir.model.access.csv
addons/portal_stock/security/portal_security.xml
addons/product/product.py
addons/product/product_view.xml
addons/product/security/ir.model.access.csv
addons/purchase/board_purchase_view.xml
addons/purchase/purchase.py
addons/purchase/purchase_view.xml
addons/purchase/report/purchase_report.py
addons/purchase/report/purchase_report_view.xml
addons/purchase/test/process/run_scheduler.yml
addons/purchase_requisition/wizard/purchase_requisition_partner.py
addons/sale/sale.py
addons/sale/sale_view.xml
addons/sale_stock/res_config.py
addons/sale_stock/res_config_view.xml
addons/sale_stock/sale_stock.py
addons/sale_stock/sale_stock_view.xml
addons/stock/product_view.xml
addons/stock/stock_demo.xml
addons/stock/stock_view.xml
addons/stock_account/product_view.xml

Simple merge
@@@ -69,12 -92,7 +92,6 @@@ class sale_order(osv.Model)
                  'product_uom': grid.carrier_id.product_id.uom_id.id,
                  'product_id': grid.carrier_id.product_id.id,
                  'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context),
-                 'tax_id': [(6,0,taxes_ids)],
+                 'tax_id': [(6, 0, taxes_ids)],
 -                'type': 'make_to_stock',
+                 'is_delivery': True
              })
-         #remove the value of the carrier_id field on the sale order
-         return self.write(cr, uid, ids, {'carrier_id': False}, context=context)
-         #return {'type': 'ir.actions.act_window_close'} action reload?
- # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@@ -7,11 -6,27 +6,27 @@@
               <field name="inherit_id" ref="product.product_normal_form_view" />
               <field name="arch" type="xml">
                  <div name="options" position="inside">
-                     <field name="event_ok" on_change="onchange_event_ok(event_ok, context)"/>
+                     <field name="event_ok" on_change="onchange_event_ok(type, event_ok, context)"
+                            attrs="{'readonly': [('is_only_child', '=', False)]}"/>
                      <label for="event_ok"/>
                  </div>
 -                <div name='ean' position="after">
 +                <field name='type' position="after">
-                     <field name="event_type_id" attrs="{'readonly': [('event_ok', '=', False)], 'invisible': [('type', '!=', 'service')]}"/>
+                     <field name="event_type_id" attrs="{'invisible': [('event_ok', '=', False)],
+                                                         'readonly': [('is_only_child', '=', False)]}"/>
+                 </div>
+              </field>
+         </record>
+         <record model="ir.ui.view" id="event_sale_product_template_form">
+              <field name="model">product.template</field>
+              <field name="inherit_id" ref="product.product_template_form_view" />
+              <field name="arch" type="xml">
+                 <div name="options" position="inside">
+                     <field name="event_ok" on_change="onchange_event_ok(type, event_ok, context)"/>
+                     <label for="event_ok"/>
+                 </div>
+                 <field name='company_id' position="after">
+                     <field name="event_type_id" attrs="{'invisible': [('event_ok', '=', False)]}"/>
                  </field>
               </field>
          </record>
Simple merge
Simple merge
@@@ -1,76 -1,81 +1,77 @@@
 -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink\r
 -access_mrp_workcenter,mrp.workcenter,model_mrp_workcenter,mrp.group_mrp_user,1,0,0,0\r
 -access_mrp_routing,mrp.routing,model_mrp_routing,mrp.group_mrp_user,1,0,0,0\r
 -access_mrp_routing_workcenter,mrp.routing.workcenter,model_mrp_routing_workcenter,mrp.group_mrp_user,1,0,0,0\r
 -access_mrp_bom,mrp.bom,model_mrp_bom,group_mrp_user,1,0,0,0\r
 -access_mrp_production,mrp.production user,model_mrp_production,mrp.group_mrp_user,1,1,1,1\r
 -access_mrp_production_salesman,mrp.production salesman,model_mrp_production,base.group_sale_salesman,1,1,1,0\r
 -access_mrp_production_product_line_salesman,mrp.production.product.line salesman,model_mrp_production_product_line,base.group_sale_salesman,1,0,1,0\r
 -access_mrp_production_workcenter_line_salesman,mrp.production.workcenter.line salesman,model_mrp_production_workcenter_line,base.group_sale_salesman,1,0,1,0\r
 -access_mrp_property_group,mrp.property.group,procurement.model_mrp_property_group,mrp.group_mrp_manager,1,1,1,1\r
 -access_mrp_property,mrp.property,procurement.model_mrp_property,mrp.group_mrp_manager,1,1,1,1\r
 -access_mrp_production_product_line,mrp.production.product.line,model_mrp_production_product_line,mrp.group_mrp_user,1,1,1,1\r
 -access_procurement,procurement.order,model_procurement_order,mrp.group_mrp_user,1,1,1,1\r
 -access_mrp_workcenter_manager,mrp.workcenter.manager,model_mrp_workcenter,mrp.group_mrp_manager,1,1,1,1\r
 -access_mrp_routing_manager,mrp.routing.manager,model_mrp_routing,mrp.group_mrp_manager,1,1,1,1\r
 -access_mrp_routing_workcenter_manager,mrp.routing.workcenter.manager,model_mrp_routing_workcenter,mrp.group_mrp_manager,1,1,1,1\r
 -access_mrp_bom_manager,mrp.bom.manager,model_mrp_bom,mrp.group_mrp_manager,1,1,1,1\r
 -access_stock_location_mrp_worker,stock.location mrp_worker,stock.model_stock_location,mrp.group_mrp_user,1,0,0,0\r
 -access_stock_move_mrp_worker,stock.move mrp_worker,stock.model_stock_move,mrp.group_mrp_user,1,1,1,0\r
 -access_stock_picking_mrp_worker,stock.picking mrp_worker,stock.model_stock_picking,mrp.group_mrp_user,1,1,1,1\r
 -access_stock_warehouse,stock.warehouse mrp_worker,stock.model_stock_warehouse,mrp.group_mrp_user,1,0,0,0\r
 -access_account_analytic_journal_mrp_worker,account.analytic.journal mrp_worker,account.model_account_analytic_journal,mrp.group_mrp_user,1,0,0,0\r
 -access_account_account,account.account mrp_worker,account.model_account_account,mrp.group_mrp_user,1,0,0,0\r
 -access_purchase_order_mrp_worker,purchase.order mrp_worker,purchase.model_purchase_order,mrp.group_mrp_user,1,0,0,0\r
 -access_purchase_order_line_mrp_worker,purchase.order.line mrp_worker,purchase.model_purchase_order_line,mrp.group_mrp_user,1,0,0,0\r
 -access_hr_timesheet_group_mrp_worker,resource.calendar mrp_manager,resource.model_resource_calendar,mrp.group_mrp_manager,1,1,1,1\r
 -access_procurement_user,procurement.order.user,model_procurement_order,base.group_user,1,1,1,1\r
 -access_mrp_production_stock_worker,mrp.production stock_worker,model_mrp_production,stock.group_stock_user,1,0,0,0\r
 -access_report_workcenter_load,report.workcenter.load,model_report_workcenter_load,mrp.group_mrp_manager,1,1,1,1\r
 -access_report_mrp_inout,report.mrp.inout,model_report_mrp_inout,mrp.group_mrp_manager,1,1,1,1\r
 -access_ir_property_manager,ir.property manager,base.model_ir_property,mrp.group_mrp_manager,1,1,1,1\r
 -access_account_sequence_fiscalyear,account.sequence.fiscalyear,account.model_account_sequence_fiscalyear,mrp.group_mrp_user,1,1,1,1\r
 -access_product_product_user,product.product user,product.model_product_product,mrp.group_mrp_user,1,0,0,0\r
 -access_product_template_user,product.template user,product.model_product_template,mrp.group_mrp_user,1,0,0,0\r
 -access_product_uom_user,product.uom user,product.model_product_uom,mrp.group_mrp_user,1,0,0,0\r
 -access_product_supplierinfo_user,product.supplierinfo user,product.model_product_supplierinfo,mrp.group_mrp_user,1,1,1,1\r
 -access_stock_tracking,stock.tracking,stock.model_stock_tracking,mrp.group_mrp_user,1,1,1,0\r
 -access_res_partner,res.partner,base.model_res_partner,mrp.group_mrp_user,1,0,0,0\r
 -access_workcenter_user,mrp.production.workcenter.line.user,model_mrp_production_workcenter_line,mrp.group_mrp_user,1,1,1,1\r
 -access_resource_calendar_leaves_user,mrp.resource.calendar.leaves.user,resource.model_resource_calendar_leaves,mrp.group_mrp_user,1,1,1,1\r
 -access_resource_calendar_leaves_manager,mrp.resource.calendar.leaves.manager,resource.model_resource_calendar_leaves,mrp.group_mrp_manager,1,0,0,0\r
 -access_resource_calendar_attendance_mrp_user,mrp.resource.calendar.attendance.mrp.user,resource.model_resource_calendar_attendance,mrp.group_mrp_user,1,1,1,1\r
 -access_resource_calendar_attendance_manager,mrp.resource.calendar.attendance.manager,resource.model_resource_calendar_attendance,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_puom_categ,product.uom.categ,product.model_product_uom_categ,mrp.group_mrp_user,1,0,0,0\r
 -access_resource_resource,resource.resource,resource.model_resource_resource,mrp.group_mrp_user,1,0,0,0\r
 -access_board_board_user,mrp.board.board,board.model_board_board,mrp.group_mrp_user,1,0,0,0\r
 -access_account_sequence_fiscalyear_manager,account.sequence.fiscalyear,account.model_account_sequence_fiscalyear,mrp.group_mrp_manager,1,0,0,0\r
 -access_product_supplierinfo_manager,product.supplierinfo user,product.model_product_supplierinfo,mrp.group_mrp_manager,1,0,0,0\r
 -access_stock_tracking_manager,stock.tracking,stock.model_stock_tracking,mrp.group_mrp_manager,1,0,0,0\r
 -access_mrp_production_manager,mrp.production manager,model_mrp_production,mrp.group_mrp_manager,1,0,0,0\r
 -access_procurement_manager,procurement.order,model_procurement_order,mrp.group_mrp_manager,1,0,0,0\r
 -access_workcenter_manager,mrp.production.workcenter.line,model_mrp_production_workcenter_line,mrp.group_mrp_manager,1,0,0,0\r
 -access_stock_move_mrp_manager,stock.move mrp_manager,stock.model_stock_move,mrp.group_mrp_manager,1,0,0,0\r
 -access_mrp_production_product_line_manager,mrp.production.product.line manager,model_mrp_production_product_line,mrp.group_mrp_manager,1,0,0,0\r
 -access_account_sequence_fiscalyear_system,account.sequence.fiscalyear.system,account.model_account_sequence_fiscalyear,mrp.group_mrp_manager,1,0,0,0\r
 -access_stock_production_lot_user,stock.production.lot,stock.model_stock_production_lot,mrp.group_mrp_user,1,1,1,1\r
 -access_stock_warehouse_orderpoint_user,stock.warehouse.orderpoint,procurement.model_stock_warehouse_orderpoint,mrp.group_mrp_user,1,0,0,0\r
 -access_stock_picking_mrp_manager,stock.picking mrp_manager,stock.model_stock_picking,mrp.group_mrp_manager,1,0,0,0\r
 -access_report_mrp_inout_user,report.mrp.inout user,model_report_mrp_inout,mrp.group_mrp_user,1,0,0,0\r
 -access_report_workcenter_load_user,report.workcenter.load.user,model_report_workcenter_load,mrp.group_mrp_user,1,0,0,0\r
 -access_mrp_bom_salesman,mrp.bom,model_mrp_bom,base.group_sale_salesman,1,0,0,0\r
 -access_mrp_bom_stockuser,mrp.bom,model_mrp_bom,stock.group_stock_user,1,0,0,0\r
 -access_product_uom_categ_mrp_manager,product.uom.categ mrp_manager,product.model_product_uom_categ,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_uom_mrp_manager,product.uom mrp_manager,product.model_product_uom,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_ul_mrp_manager,product.ul mrp_manager,product.model_product_ul,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_category_mrp_manager,product.category mrp_manager,product.model_product_category,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_template_mrp_manager,product.template mrp_manager,product.model_product_template,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_product_mrp_manager,product.product mrp_manager,product.model_product_product,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_packaging_mrp_manager,product.packaging mrp_manager,product.model_product_packaging,mrp.group_mrp_manager,1,1,1,1\r
 -access_pricelist_partnerinfo_mrp_manager,pricelist.partnerinfo mrp_manager,product.model_pricelist_partnerinfo,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_price_type_mrp_manager,product.price.type mrp_manager,product.model_product_price_type,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_pricelist_type_mrp_manager,product.pricelist.type mrp_manager,product.model_product_pricelist_type,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_pricelist_mrp_manager,product.pricelist mrp_manager,product.model_product_pricelist,mrp.group_mrp_manager,1,1,1,1\r
 -access_ir_property_group_product_mrp_manager,ir_property group_product_mrp_manager,base.model_ir_property,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_group_res_partner_mrp_manager,res_partner group_mrp_manager,base.model_res_partner,mrp.group_mrp_manager,1,1,1,0\r
 -access_product_pricelist_version_mrp_manager,product.pricelist.version mrp_manager,product.model_product_pricelist_version,mrp.group_mrp_manager,1,1,1,1\r
 -access_product_pricelist_item_mrp_manager,product.pricelist.item mrp_manager,product.model_product_pricelist_item,mrp.group_mrp_manager,1,1,1,1\r
 -access_resource_calendar_manufacturinguser,resource.calendar manufacturing.user,resource.model_resource_calendar,mrp.group_mrp_user,1,0,0,0\r
 -access_account_journal_mrp_manager,account.journal mrp manager,account.model_account_journal,mrp.group_mrp_manager,1,0,0,0\r
 -access_purchase_order_stock_user,purchase.order stock user,purchase.model_purchase_order,stock.group_stock_user,1,1,1,0\r
 -access_mrp_bom_purchase_manager,mrp.bom,model_mrp_bom,purchase.group_purchase_manager,1,0,0,0\r
 +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
 +access_mrp_workcenter,mrp.workcenter,model_mrp_workcenter,mrp.group_mrp_user,1,0,0,0
 +access_mrp_routing,mrp.routing,model_mrp_routing,mrp.group_mrp_user,1,0,0,0
 +access_mrp_routing_workcenter,mrp.routing.workcenter,model_mrp_routing_workcenter,mrp.group_mrp_user,1,0,0,0
 +access_mrp_bom,mrp.bom,model_mrp_bom,group_mrp_user,1,0,0,0
 +access_mrp_production,mrp.production user,model_mrp_production,mrp.group_mrp_user,1,1,1,1
 +access_mrp_production_salesman,mrp.production salesman,model_mrp_production,base.group_sale_salesman,1,1,1,0
 +access_mrp_production_product_line_salesman,mrp.production.product.line salesman,model_mrp_production_product_line,base.group_sale_salesman,1,0,1,0
 +access_mrp_production_workcenter_line_salesman,mrp.production.workcenter.line salesman,model_mrp_production_workcenter_line,base.group_sale_salesman,1,0,1,0
 +access_mrp_production_product_line,mrp.production.product.line,model_mrp_production_product_line,mrp.group_mrp_user,1,1,1,1
 +access_procurement,procurement.order,model_procurement_order,mrp.group_mrp_user,1,1,1,1
 +access_mrp_workcenter_manager,mrp.workcenter.manager,model_mrp_workcenter,mrp.group_mrp_manager,1,1,1,1
 +access_mrp_routing_manager,mrp.routing.manager,model_mrp_routing,mrp.group_mrp_manager,1,1,1,1
 +access_mrp_routing_workcenter_manager,mrp.routing.workcenter.manager,model_mrp_routing_workcenter,mrp.group_mrp_manager,1,1,1,1
 +access_mrp_bom_manager,mrp.bom.manager,model_mrp_bom,mrp.group_mrp_manager,1,1,1,1
 +access_stock_location_mrp_worker,stock.location mrp_worker,stock.model_stock_location,mrp.group_mrp_user,1,0,0,0
 +access_stock_move_mrp_worker,stock.move mrp_worker,stock.model_stock_move,mrp.group_mrp_user,1,1,1,0
 +access_stock_picking_mrp_worker,stock.picking mrp_worker,stock.model_stock_picking,mrp.group_mrp_user,1,1,1,1
 +access_stock_warehouse,stock.warehouse mrp_worker,stock.model_stock_warehouse,mrp.group_mrp_user,1,0,0,0
 +access_account_analytic_journal_mrp_worker,account.analytic.journal mrp_worker,account.model_account_analytic_journal,mrp.group_mrp_user,1,0,0,0
 +access_account_account,account.account mrp_worker,account.model_account_account,mrp.group_mrp_user,1,0,0,0
 +access_hr_timesheet_group_mrp_worker,resource.calendar mrp_manager,resource.model_resource_calendar,mrp.group_mrp_manager,1,1,1,1
 +access_procurement_user,procurement.order.user,model_procurement_order,base.group_user,1,1,1,1
 +access_mrp_production_stock_worker,mrp.production stock_worker,model_mrp_production,stock.group_stock_user,1,0,0,0
 +access_report_workcenter_load,report.workcenter.load,model_report_workcenter_load,mrp.group_mrp_manager,1,1,1,1
 +access_report_mrp_inout,report.mrp.inout,model_report_mrp_inout,mrp.group_mrp_manager,1,1,1,1
 +access_ir_property_manager,ir.property manager,base.model_ir_property,mrp.group_mrp_manager,1,1,1,1
 +access_account_sequence_fiscalyear,account.sequence.fiscalyear,account.model_account_sequence_fiscalyear,mrp.group_mrp_user,1,1,1,1
 +access_product_product_user,product.product user,product.model_product_product,mrp.group_mrp_user,1,0,0,0
 +access_product_template_user,product.template user,product.model_product_template,mrp.group_mrp_user,1,0,0,0
 +access_product_uom_user,product.uom user,product.model_product_uom,mrp.group_mrp_user,1,0,0,0
 +access_product_supplierinfo_user,product.supplierinfo user,product.model_product_supplierinfo,mrp.group_mrp_user,1,1,1,1
 +access_res_partner,res.partner,base.model_res_partner,mrp.group_mrp_user,1,0,0,0
 +access_workcenter_user,mrp.production.workcenter.line.user,model_mrp_production_workcenter_line,mrp.group_mrp_user,1,1,1,1
 +access_resource_calendar_leaves_user,mrp.resource.calendar.leaves.user,resource.model_resource_calendar_leaves,mrp.group_mrp_user,1,1,1,1
 +access_resource_calendar_leaves_manager,mrp.resource.calendar.leaves.manager,resource.model_resource_calendar_leaves,mrp.group_mrp_manager,1,0,0,0
++access_resource_calendar_attendance_mrp_user,mrp.resource.calendar.attendance.mrp.user,resource.model_resource_calendar_attendance,mrp.group_mrp_user,1,1,1,1
 +access_resource_calendar_attendance_manager,mrp.resource.calendar.attendance.manager,resource.model_resource_calendar_attendance,mrp.group_mrp_manager,1,1,1,1
 +access_product_puom_categ,product.uom.categ,product.model_product_uom_categ,mrp.group_mrp_user,1,0,0,0
 +access_resource_resource,resource.resource,resource.model_resource_resource,mrp.group_mrp_user,1,0,0,0
 +access_board_board_user,mrp.board.board,board.model_board_board,mrp.group_mrp_user,1,0,0,0
 +access_account_sequence_fiscalyear_manager,account.sequence.fiscalyear,account.model_account_sequence_fiscalyear,mrp.group_mrp_manager,1,0,0,0
 +access_product_supplierinfo_manager,product.supplierinfo user,product.model_product_supplierinfo,mrp.group_mrp_manager,1,0,0,0
 +access_mrp_production_manager,mrp.production manager,model_mrp_production,mrp.group_mrp_manager,1,0,0,0
 +access_procurement_manager,procurement.order,model_procurement_order,mrp.group_mrp_manager,1,0,0,0
 +access_workcenter_manager,mrp.production.workcenter.line,model_mrp_production_workcenter_line,mrp.group_mrp_manager,1,0,0,0
 +access_stock_move_mrp_manager,stock.move mrp_manager,stock.model_stock_move,mrp.group_mrp_manager,1,0,0,0
 +access_mrp_production_product_line_manager,mrp.production.product.line manager,model_mrp_production_product_line,mrp.group_mrp_manager,1,0,0,0
 +access_account_sequence_fiscalyear_system,account.sequence.fiscalyear.system,account.model_account_sequence_fiscalyear,mrp.group_mrp_manager,1,0,0,0
 +access_stock_production_lot_user,stock.production.lot,stock.model_stock_production_lot,mrp.group_mrp_user,1,1,1,1
 +access_stock_warehouse_orderpoint_user,stock.warehouse.orderpoint,stock.model_stock_warehouse_orderpoint,mrp.group_mrp_user,1,0,0,0
 +access_stock_picking_mrp_manager,stock.picking mrp_manager,stock.model_stock_picking,mrp.group_mrp_manager,1,0,0,0
 +access_report_mrp_inout_user,report.mrp.inout user,model_report_mrp_inout,mrp.group_mrp_user,1,0,0,0
 +access_report_workcenter_load_user,report.workcenter.load.user,model_report_workcenter_load,mrp.group_mrp_user,1,0,0,0
 +access_mrp_bom_salesman,mrp.bom,model_mrp_bom,base.group_sale_salesman,1,0,0,0
 +access_mrp_bom_stockuser,mrp.bom,model_mrp_bom,stock.group_stock_user,1,0,0,0
 +access_product_uom_categ_mrp_manager,product.uom.categ mrp_manager,product.model_product_uom_categ,mrp.group_mrp_manager,1,1,1,1
 +access_product_uom_mrp_manager,product.uom mrp_manager,product.model_product_uom,mrp.group_mrp_manager,1,1,1,1
 +access_product_ul_mrp_manager,product.ul mrp_manager,product.model_product_ul,mrp.group_mrp_manager,1,1,1,1
 +access_product_category_mrp_manager,product.category mrp_manager,product.model_product_category,mrp.group_mrp_manager,1,1,1,1
 +access_product_template_mrp_manager,product.template mrp_manager,product.model_product_template,mrp.group_mrp_manager,1,1,1,1
 +access_product_product_mrp_manager,product.product mrp_manager,product.model_product_product,mrp.group_mrp_manager,1,1,1,1
 +access_product_packaging_mrp_manager,product.packaging mrp_manager,product.model_product_packaging,mrp.group_mrp_manager,1,1,1,1
 +access_pricelist_partnerinfo_mrp_manager,pricelist.partnerinfo mrp_manager,product.model_pricelist_partnerinfo,mrp.group_mrp_manager,1,1,1,1
 +access_product_price_type_mrp_manager,product.price.type mrp_manager,product.model_product_price_type,mrp.group_mrp_manager,1,1,1,1
 +access_product_pricelist_type_mrp_manager,product.pricelist.type mrp_manager,product.model_product_pricelist_type,mrp.group_mrp_manager,1,1,1,1
 +access_product_pricelist_mrp_manager,product.pricelist mrp_manager,product.model_product_pricelist,mrp.group_mrp_manager,1,1,1,1
 +access_ir_property_group_product_mrp_manager,ir_property group_product_mrp_manager,base.model_ir_property,mrp.group_mrp_manager,1,1,1,1
 +access_product_group_res_partner_mrp_manager,res_partner group_mrp_manager,base.model_res_partner,mrp.group_mrp_manager,1,1,1,0
 +access_product_pricelist_version_mrp_manager,product.pricelist.version mrp_manager,product.model_product_pricelist_version,mrp.group_mrp_manager,1,1,1,1
 +access_product_pricelist_item_mrp_manager,product.pricelist.item mrp_manager,product.model_product_pricelist_item,mrp.group_mrp_manager,1,1,1,1
 +access_resource_calendar_manufacturinguser,resource.calendar manufacturing.user,resource.model_resource_calendar,mrp.group_mrp_user,1,0,0,0
 +access_account_journal_mrp_manager,account.journal mrp manager,account.model_account_journal,mrp.group_mrp_manager,1,0,0,0
 +access_mrp_property_group,mrp.property.group,model_mrp_property_group,stock.group_stock_manager,1,1,1,1
 +access_mrp_property,mrp.property,model_mrp_property,stock.group_stock_manager,1,1,1,1
 +access_mrp_property_group,mrp.property.group,model_mrp_property_group,base.group_user,1,0,0,0
 +access_mrp_property,mrp.property,model_mrp_property,base.group_user,1,0,0,0
Simple merge
@@@ -1,4 -1,5 +1,4 @@@
  id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
- access_stock_picking,stock.picking,stock.model_stock_picking,portal.group_portal,1,0,0,0
- access_stock_move,stock.move,stock.model_stock_move,portal.group_portal,1,0,0,0
- access_stock_warehouse_orderpoint,stock.warehouse.orderpoint,stock.model_stock_warehouse_orderpoint,portal.group_portal,1,0,0,0
+ access_stock_picking,stock.picking,stock.model_stock_picking,base.group_portal,1,0,0,0
 -access_stock_picking.out,stock.picking.out,stock.model_stock_picking_out,base.group_portal,1,0,0,0
+ access_stock_move,stock.move,stock.model_stock_move,base.group_portal,1,0,0,0
 -access_stock_warehouse_orderpoint,stock.warehouse.orderpoint,procurement.model_stock_warehouse_orderpoint,base.group_portal,1,0,0,0
++access_stock_warehouse_orderpoint,stock.warehouse.orderpoint,stock.model_stock_warehouse_orderpoint,base.group_portal,1,0,0,0
@@@ -7,7 -7,15 +7,7 @@@
              <field name="name">Portal Personal Pickings</field>
              <field name="model_id" ref="stock.model_stock_picking"/>
              <field name="domain_force">[('message_follower_ids','in',[user.partner_id.id])]</field>
-             <field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
+             <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
          </record>
 -
 -        <record id="portal_stock_picking_out_user_rule" model="ir.rule">
 -            <field name="name">Portal Personal Out Pickings</field>
 -            <field name="model_id" ref="stock.model_stock_picking_out"/>
 -            <field name="domain_force">[('message_follower_ids','in',[user.partner_id.id])]</field>
 -            <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
 -        </record>
 -
      </data>
  </openerp>
@@@ -166,12 -166,12 +167,12 @@@ class product_uom(osv.osv)
              from_unit, to_unit = uoms[0], uoms[-1]
          else:
              from_unit, to_unit = uoms[-1], uoms[0]
 -        return self._compute_qty_obj(cr, uid, from_unit, qty, to_unit)
 +        return self._compute_qty_obj(cr, uid, from_unit, qty, to_unit, round=round)
  
 -    def _compute_qty_obj(self, cr, uid, from_unit, qty, to_unit, context=None):
 +    def _compute_qty_obj(self, cr, uid, from_unit, qty, to_unit, round=True, context=None):
          if context is None:
              context = {}
-         if from_unit.category_id.id <> to_unit.category_id.id:
+         if from_unit.category_id.id != to_unit.category_id.id:
              if context.get('raise-exception', True):
                  raise osv.except_osv(_('Error!'), _('Conversion from Product UoM %s to Default UoM %s is not possible as they both belong to different Category!.') % (from_unit.name,to_unit.name,))
              else:
@@@ -280,52 -265,78 +281,107 @@@ class product_category(osv.osv)
      _parent_order = 'sequence, name'
      _order = 'parent_left'
  
-     def _check_recursion(self, cr, uid, ids, context=None):
-         level = 100
-         while len(ids):
-             cr.execute('select distinct parent_id from product_category where id IN %s',(tuple(ids),))
-             ids = filter(None, map(lambda x:x[0], cr.fetchall()))
-             if not level:
-                 return False
-             level -= 1
-         return True
      _constraints = [
-         (_check_recursion, 'Error ! You cannot create recursive categories.', ['parent_id'])
+         (osv.osv._check_recursion, 'Error ! You cannot create recursive categories.', ['parent_id'])
      ]
 -    def child_get(self, cr, uid, ids):
 -        return [ids]
 +
 +
 +class prices_history(osv.osv):
 +    """
 +    Keep track of the ``product.template`` standard prices as they are changed.
 +    """
 +
 +    _name = 'prices.history'
 +    _rec_name = 'datetime'
 +    _order = 'datetime desc'
 +
 +    _columns = {
 +        'company_id': fields.many2one('res.company', required=True),
 +        'product_template_id': fields.many2one('product.template', 'Product Template', required=True),
 +        'datetime': fields.datetime('Historization Time'),
 +        'cost': fields.float('Historized Cost'),
 +        'reason': fields.char('Reason'),
 +    }
 +
 +    def _get_default_company(self, cr, uid, context=None):
 +        if 'force_company' in context:
 +            return context['force_company']
 +        else:
 +            company = self.pool['res.users'].browse(cr, uid, uid,
 +                context=context).company_id
 +            return company.id if company else False
 +
 +    _defaults = {
 +        'datetime': fields.datetime.now,
 +        'company_id': _get_default_company,
 +    }
  
  
+ class product_public_category(osv.osv):
+     _name = "product.public.category"
+     _description = "Public Category"
+     _order = "sequence, name"
+     _constraints = [
+         (osv.osv._check_recursion, 'Error ! You cannot create recursive categories.', ['parent_id'])
+     ]
+     def name_get(self, cr, uid, ids, context=None):
+         if not len(ids):
+             return []
+         reads = self.read(cr, uid, ids, ['name','parent_id'], context=context)
+         res = []
+         for record in reads:
+             name = record['name']
+             if record['parent_id']:
+                 name = record['parent_id'][1]+' / '+name
+             res.append((record['id'], name))
+         return res
+     def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
+         res = self.name_get(cr, uid, ids, context=context)
+         return dict(res)
+     def _get_image(self, cr, uid, ids, name, args, context=None):
+         result = dict.fromkeys(ids, False)
+         for obj in self.browse(cr, uid, ids, context=context):
+             result[obj.id] = tools.image_get_resized_images(obj.image)
+         return result
+     
+     def _set_image(self, cr, uid, id, name, value, args, context=None):
+         return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
+     _columns = {
+         'name': fields.char('Name', required=True, translate=True),
+         'complete_name': fields.function(_name_get_fnc, type="char", string='Name'),
+         'parent_id': fields.many2one('product.public.category','Parent Category', select=True),
+         'child_id': fields.one2many('product.public.category', 'parent_id', string='Children Categories'),
+         'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of product categories."),
+         
+         # NOTE: there is no 'default image', because by default we don't show thumbnails for categories. However if we have a thumbnail
+         # for at least one category, then we display a default image on the other, so that the buttons have consistent styling.
+         # In this case, the default image is set by the js code.
+         # NOTE2: image: all image fields are base64 encoded and PIL-supported
+         'image': fields.binary("Image",
+             help="This field holds the image used as image for the cateogry, limited to 1024x1024px."),
+         'image_medium': fields.function(_get_image, fnct_inv=_set_image,
+             string="Medium-sized image", type="binary", multi="_get_image",
+             store={
+                 'product.public.category': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
+             },
+             help="Medium-sized image of the category. It is automatically "\
+                  "resized as a 128x128px image, with aspect ratio preserved. "\
+                  "Use this field in form views or some kanban views."),
+         'image_small': fields.function(_get_image, fnct_inv=_set_image,
+             string="Smal-sized image", type="binary", multi="_get_image",
+             store={
+                 'product.public.category': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
+             },
+             help="Small-sized image of the category. It is automatically "\
+                  "resized as a 64x64px image, with aspect ratio preserved. "\
+                  "Use this field anywhere a small image is required."),
+     }
  
  #----------------------------------------------------------
  # Products
@@@ -345,13 -366,13 +411,14 @@@ class product_template(osv.osv)
          'description_sale': fields.text('Sale Description',translate=True,
              help="A description of the Product that you want to communicate to your customers. "
                   "This description will be copied to every Sale Order, Delivery Order and Customer Invoice/Refund"),
 -        'type': fields.selection([('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Consumable are product where you don't manage stock, a service is a non-material product provided by a company or an individual."),
 -        'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. In the case of multi-level BOM, the manufacturing lead times of the components will be added."),
 +        'type': fields.selection([('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Consumable are product where you don't manage stock, a service is a non-material product provided by a company or an individual."),        
          'rental': fields.boolean('Can be Rent'),
          'categ_id': fields.many2one('product.category','Category', required=True, change_default=True, domain="[('type','=','normal')]" ,help="Select category for the current product"),
+         'public_categ_id': fields.many2one('product.public.category','Public Category', help="Those categories are used to group similar products for public sales (eg.: point of sale, e-commerce)."),
          'list_price': fields.float('Sale Price', digits_compute=dp.get_precision('Product Price'), help="Base price to compute the customer price. Sometimes called the catalog price."),
 -        'standard_price': fields.float('Cost Price', digits_compute=dp.get_precision('Product Price'), help="Cost price of the product template used for standard stock valuation in accounting and used as a base price on purchase orders.", groups="base.group_user"),
 +        'standard_price': fields.property(type = 'float', digits_compute=dp.get_precision('Product Price'), 
-                                           help="Cost price of the product used for standard stock valuation in accounting and used as a base price on purchase orders.", 
-                                           groups="base.group_user", string="Cost"),
++                                          help="Cost price of the product template used for standard stock valuation in accounting and used as a base price on purchase orders.", 
++                                          groups="base.group_user", string="Cost Price"),
          'volume': fields.float('Volume', help="The volume in m3."),
          'weight': fields.float('Gross Weight', digits_compute=dp.get_precision('Stock Weight'), help="The gross weight in Kg."),
          'weight_net': fields.float('Net Weight', digits_compute=dp.get_precision('Stock Weight'), help="The net weight in Kg."),
                  old_uom = product.uom_po_id
                  if old_uom.category_id.id != new_uom.category_id.id:
                      raise osv.except_osv(_('Unit of Measure categories Mismatch!'), _("New Unit of Measure '%s' must belong to same Unit of Measure category '%s' as of old Unit of Measure '%s'. If you need to change the unit of measure, you may deactivate this product from the 'Procurements' tab and create a new one.") % (new_uom.name, old_uom.category_id.name, old_uom.name,))
 +        if 'standard_price' in vals:
 +            price_history_obj = self.pool['prices.history']
 +            for prod_template_id in ids:
 +                price_history_obj.create(cr, uid, {
 +                    'product_template_id': prod_template_id,
 +                    'cost': vals['standard_price'],
 +                    'reason': _('standard price is changed.'),
 +                }, context=context)
          return super(product_template, self).write(cr, uid, ids, vals, context=context)
  
+     def copy(self, cr, uid, id, default=None, context=None):
+         if default is None:
+             default = {}
+         template = self.browse(cr, uid, id, context=context)
+         default['name'] = _("%s (copy)") % (template['name'])
+         return super(product_template, self).copy(cr, uid, id, default=default, context=context)
      _defaults = {
          'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'product.template', context=c),
          'list_price': 1,
@@@ -471,21 -509,11 +571,22 @@@ class product_product(osv.osv)
              context = {}
          res = super(product_product, self).view_header_get(cr, uid, view_id, view_type, context)
          if (context.get('categ_id', False)):
 -            return _('Products: ')+self.pool.get('product.category').browse(cr, uid, context['categ_id'], context=context).name
 +            return _('Products: ') + self.pool.get('product.category').browse(cr, uid, context['categ_id'], context=context).name
          return res
  
 +    def get_history_price(self, cr, uid, product_id, company_id, context=None):
 +        if context is None:
 +            context = {}
 +        product = self.browse(cr, uid, product_id, context=context)
 +        date = context.get('history_date', time.strftime('%Y-%m-%d %H:%M:%s'))
 +        prices_history_obj = self.pool.get('prices.history')
 +        history_ids = prices_history_obj.search(cr, uid, [('company_id', '=', company_id), ('product_template_id', '=', product.product_tmpl_id.id), ('datetime', '<=', date)], limit=1)
 +        if history_ids:
 +            return prices_history_obj.read(cr, uid, history_ids[0], ['cost'], context=context)['cost']
 +        raise osv.except_osv(_('Error!'), _("No standard price associated for product %s for the given date" % (product.name)))
 +
      def _product_price(self, cr, uid, ids, name, arg, context=None):
+         plobj = self.pool.get('product.pricelist')
          res = {}
          if context is None:
              context = {}
              res.setdefault(id, 0.0)
          return res
  
 -    def _get_product_available_func(states, what):
 -        def _product_available(self, cr, uid, ids, name, arg, context=None):
 -            return {}.fromkeys(ids, 0.0)
 -        return _product_available
 -
 -    _product_qty_available = _get_product_available_func(('done',), ('in', 'out'))
 -    _product_virtual_available = _get_product_available_func(('confirmed','waiting','assigned','done'), ('in', 'out'))
 -    _product_outgoing_qty = _get_product_available_func(('confirmed','waiting','assigned'), ('out',))
 -    _product_incoming_qty = _get_product_available_func(('confirmed','waiting','assigned'), ('in',))
 -
      def _product_lst_price(self, cr, uid, ids, name, arg, context=None):
-         res = {}
+         res = dict.fromkeys(ids, 0.0)
          product_uom_obj = self.pool.get('product.uom')
-         for id in ids:
-             res.setdefault(id, 0.0)
+         # retrieve pricelist
+         pricelist = None
+         if context.get('pricelist'):
+             pricelist = self.pool['product.pricelist'].browse(cr, uid, context.get('pricelist'), context=context)
+             base_currency = self.pool['res.users'].browse(cr, uid, uid, context=context).company_id.currency_id
          for product in self.browse(cr, uid, ids, context=context):
              if 'uom' in context:
                  uom = product.uos_id or product.uom_id
              result.add(el)
          return list(result)
  
-     _defaults = {
-         'active': lambda *a: 1,
-         'price_extra': lambda *a: 0.0,
-         'price_margin': lambda *a: 1.0,
-         'color': 0,
-     }
-     _name = "product.product"
-     _description = "Product"
-     _table = "product_product"
-     _inherits = {'product.template': 'product_tmpl_id'}
-     _inherit = ['mail.thread']
-     _order = 'default_code,name_template'
      _columns = {
-         'price': fields.function(_product_price, type='float', string='Price', digits_compute=dp.get_precision('Product Price')),
-         'lst_price': fields.function(_product_lst_price, type='float', string='Public Price', digits_compute=dp.get_precision('Product Price')),
 -        'qty_available': fields.function(_product_qty_available, type='float', string='Quantity On Hand'),
 -        'virtual_available': fields.function(_product_virtual_available, type='float', string='Quantity Available'),
 -        'incoming_qty': fields.function(_product_incoming_qty, type='float', string='Incoming'),
 -        'outgoing_qty': fields.function(_product_outgoing_qty, type='float', string='Outgoing'),
+         'price': fields.function(_product_price, fnct_inv=_save_product_lst_price, type='float', string='Price', digits_compute=dp.get_precision('Product Price')),
+         'lst_price' : fields.function(_product_lst_price, fnct_inv=_save_product_lst_price, type='float', string='Public Price', digits_compute=dp.get_precision('Product Price')),
          'code': fields.function(_product_code, type='char', string='Internal Reference'),
-         'partner_ref': fields.function(_product_partner_ref, type='char', string='Customer ref'),
-         'default_code': fields.char('Internal Reference', size=64, select=True),
+         'partner_ref' : fields.function(_product_partner_ref, type='char', string='Customer ref'),
+         'default_code' : fields.char('Internal Reference', select=True),
          'active': fields.boolean('Active', help="If unchecked, it will allow you to hide the product without removing it."),
-         'variants': fields.char('Variants', size=64),
+         'variants': fields.char('Variants', translate=True),
          'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade", select=True),
+         'is_only_child': fields.function(
+             _is_only_child, type='boolean', string='Sole child of the parent template'),
          'ean13': fields.char('EAN13 Barcode', size=13, help="International Article Number used for product identification."),
 -        'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
 +        'packaging': fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
-         'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Product Price')),
-         'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Product Price')),
+         'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Product Price'), help="Price Extra: Extra price for the variant on sale price. eg. 200 price extra, 1000 + 200 = 1200."),
+         'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Product Price'), help="Price Margin: Margin in percentage amount on sale price for the variant. eg. 10 price margin, 1000 * 1.1 = 1100."),
          'pricelist_id': fields.dummy(string='Pricelist', relation='product.pricelist', type='many2one'),
-         'name_template': fields.related('product_tmpl_id', 'name', string="Template Name", type='char', size=128, store={
+         'name_template': fields.related('product_tmpl_id', 'name', string="Template Name", type='char', store={
              'product.template': (_get_name_template_ids, ['name'], 10),
              'product.product': (lambda self, cr, uid, ids, c=None: ids, [], 10),
-             }, select=True),
+         }, select=True),
          'color': fields.integer('Color Index'),
-         # image: all image fields are base64 encoded and PIL-supported
-         'image': fields.binary("Image",
-             help="This field holds the image used as image for the product, limited to 1024x1024px."),
-         'image_medium': fields.function(_get_image, fnct_inv=_set_image,
-             string="Medium-sized image", type="binary", multi="_get_image",
-             store={
-                 'product.product': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
-             },
-             help="Medium-sized image of the product. It is automatically "\
-                  "resized as a 128x128px image, with aspect ratio preserved, "\
-                  "only when the image exceeds one of those sizes. Use this field in form views or some kanban views."),
-         'image_small': fields.function(_get_image, fnct_inv=_set_image,
-             string="Small-sized image", type="binary", multi="_get_image",
-             store={
-                 'product.product': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
-             },
-             help="Small-sized image of the product. It is automatically "\
-                  "resized as a 64x64px image, with aspect ratio preserved. "\
-                  "Use this field anywhere a small image is required."),
          'seller_info_id': fields.function(_calc_seller, type='many2one', relation="product.supplierinfo", string="Supplier Info", multi="seller_info"),
          'seller_delay': fields.function(_calc_seller, type='integer', string='Supplier Lead Time', multi="seller_info", help="This is the average delay in days between the purchase order confirmation and the reception of goods for this product and for the default supplier. It is used by the scheduler to order requests based on reordering delays."),
          'seller_qty': fields.function(_calc_seller, type='float', string='Supplier Quantity', multi="seller_info", help="This is minimum quantity to purchase from Main Supplier."),
              <field name="model">product.product</field>
              <field eval="7" name="priority"/>
              <field name="arch" type="xml">
 -                <tree colors="red:virtual_available&lt;0;blue:virtual_available&gt;=0 and state in ('draft', 'end', 'obsolete');black:virtual_available&gt;=0 and state not in ('draft', 'end', 'obsolete')" string="Products">
 +                <tree string="Products">
                      <field name="default_code"/>
                      <field name="name"/>
+                     <field name="variants" groups="product.group_product_variant"/>
                      <field name="categ_id" invisible="1"/>
                      <field name="type" invisible="1"/>
                      <field name="uom_id" string="Unit of Measure" groups="product.group_uom"/>
                              <page string="Procurements" groups="base.group_user">
                                  <group name="procurement">
                                      <group name="general">
 +                                        <field name="active"/>
-                                         <field name="standard_price"/>
+                                         <field name="cost_method" groups="product.group_costing_method"
+                                             attrs="{'readonly': [('is_only_child', '=', False)]}"/>
+                                         <field name="standard_price"
+                                             attrs="{'readonly': ['|', ('cost_method','=','average'), ('is_only_child', '=', False)]}"/>
                                      </group>
                                      <group name="procurement_uom" groups="product.group_uom" string="Purchase">
-                                         <field name="uom_po_id"/>
+                                         <field name="uom_po_id"
+                                             attrs="{'readonly': [('is_only_child', '=', False)]}"/>
                                      </group>
                                  </group>
                                  <separator string="Description for Suppliers"/>
@@@ -24,8 -23,7 +23,6 @@@
                      <field name="partner_id" invisible="1"/>
                      <field name="product_id" invisible="1"/>
                      <field name="product_uom" invisible="1"/>
-                     <field name="day" invisible="1"/>
-                     <field name="name" invisible="1"/>
 -                    <field name="warehouse_id" invisible="1"/>
                      <field name="validator" invisible="1"/>
                      <field name="company_id" invisible="1"/>
                      <field name="state" invisible="1"/>
@@@ -150,26 -150,11 +150,26 @@@ class purchase_order(osv.osv)
                                                  limit=1)
          return res and res[0] or False  
  
 +    def _get_picking_in(self, cr, uid, context=None):
 +        obj_data = self.pool.get('ir.model.data')
 +        return obj_data.get_object_reference(cr, uid, 'stock','picking_type_in') and obj_data.get_object_reference(cr, uid, 'stock','picking_type_in')[1] or False
 +
 +    def _get_picking_ids(self, cr, uid, ids, name, args, context=None):
 +        res = {}
 +        for purchase_id in ids:
 +            picking_ids = set()
 +            move_ids = self.pool.get('stock.move').search(cr, uid, [('purchase_line_id.order_id','=', purchase_id)] , context=context)
 +            for move in self.pool.get('stock.move').browse(cr, uid, move_ids, context=context):
 +                picking_ids.add(move.picking_id.id)
 +            res[purchase_id] = list(picking_ids)
 +        return res
-     
++
      STATE_SELECTION = [
          ('draft', 'Draft PO'),
--        ('sent', 'RFQ Sent'),
++        ('sent', 'RFQ'),
 +        ('bid', 'Bid Received'),
          ('confirmed', 'Waiting Approval'),
 -        ('approved', 'Purchase Order'),
 +        ('approved', 'Purchase Confirmed'),
          ('except_picking', 'Shipping Exception'),
          ('except_invoice', 'Invoice Exception'),
          ('done', 'Done'),
          for order_line in order_lines:
              if not order_line.product_id:
                  continue
 +
              if order_line.product_id.type in ('product', 'consu'):
 -                move = stock_move.create(cr, uid, self._prepare_order_line_move(cr, uid, order, order_line, picking_id, context=context))
 -                if order_line.move_dest_id and order_line.move_dest_id.state != 'done':
 -                    order_line.move_dest_id.write({'location_id': order.location_id.id})
 -                todo_moves.append(move)
 +                group_id = order_line.group_id and order_line.group_id.id or new_group
 +                for vals in self._prepare_order_line_move(cr, uid, order, order_line, picking_id, group_id, context=context):
 +                    move = stock_move.create(cr, uid, vals, context=context)
 +                    todo_moves.append(move)
-                 if order_line.move_dest_id:
-                     order_line.move_dest_id.write({'location_id': order.location_id.id})
 +
          stock_move.action_confirm(cr, uid, todo_moves)
          stock_move.force_assign(cr, uid, todo_moves)
 -        stock_picking.signal_button_confirm(cr, uid, [picking_id])
 -        return [picking_id]
 +
 +    def test_moves_done(self, cr, uid, ids, context=None):
 +        '''PO is done at the delivery side if all the incoming shipments are done'''
 +        for purchase in self.browse(cr, uid, ids, context=context):
 +            for picking in purchase.picking_ids:
 +                if picking.state != 'done':
 +                    return False
 +        return True
 +
 +    def test_moves_except(self, cr, uid, ids, context=None):
 +        ''' PO is in exception at the delivery side if one of the picking is canceled
 +            and the other pickings are completed (done or canceled)
 +        '''
 +        at_least_one_canceled = False
 +        alldoneorcancel = True
 +        for purchase in self.browse(cr, uid, ids, context=context):
 +            for picking in purchase.picking_ids:
 +                if picking.state == 'cancel':
 +                    at_least_one_canceled = True
 +                if picking.state not in ['done', 'cancel']:
 +                    alldoneorcancel = False
 +        return at_least_one_canceled and alldoneorcancel
 +
 +    def move_lines_get(self, cr, uid, ids, *args):
 +        res = []
 +        for order in self.browse(cr, uid, ids, context={}):
 +            for line in order.order_line:
 +                res += [x.id for x in line.move_ids]
 +        return res
  
      def action_picking_create(self, cr, uid, ids, context=None):
 -        picking_ids = []
          for order in self.browse(cr, uid, ids):
 -            picking_ids.extend(self._create_pickings(cr, uid, order, order.order_line, None, context=context))
 -
 -        # Must return one unique picking ID: the one to connect in the subflow of the purchase order.
 -        # In case of multiple (split) pickings, we should return the ID of the critical one, i.e. the
 -        # one that should trigger the advancement of the purchase workflow.
 -        # By default we will consider the first one as most important, but this behavior can be overridden.
 -        return picking_ids[0] if picking_ids else False
 +            self._create_stock_moves(cr, uid, order, order.order_line, None, context=context)
  
      def picking_done(self, cr, uid, ids, context=None):
          self.write(cr, uid, ids, {'shipped':1,'state':'approved'}, context=context)
@@@ -975,9 -909,18 +973,18 @@@ class purchase_order_line(osv.osv)
          default.update({'state':'draft', 'move_ids':[],'invoiced':0,'invoice_lines':[]})
          return super(purchase_order_line, self).copy_data(cr, uid, id, default, context)
  
+     def unlink(self, cr, uid, ids, context=None):
+         procurement_ids_to_cancel = []
+         for line in self.browse(cr, uid, ids, context=context):
+             if line.move_dest_id:
+                 procurement_ids_to_cancel.extend(procurement.id for procurement in line.move_dest_id.procurements)
+         if procurement_ids_to_cancel:
+             self.pool['procurement.order'].action_cancel(cr, uid, procurement_ids_to_cancel)
+         return super(purchase_order_line, self).unlink(cr, uid, ids, context=context)
      def onchange_product_uom(self, cr, uid, ids, pricelist_id, product_id, qty, uom_id,
              partner_id, date_order=False, fiscal_position_id=False, date_planned=False,
 -            name=False, price_unit=False, context=None):
 +            name=False, price_unit=False, state='draft', context=None):
          """
          onchange handler of product_uom.
          """
                          </group>
                      </group>
                      <notebook>
 -                        <page string="Purchase Order">
 +                        <page string="Products">
                              <field name="order_line">
-                                 <tree string="Purchase Order Lines" editable="bottom" colors="grey:state=='cancel'">
+                                 <tree string="Purchase Order Lines" editable="bottom">
 -                                    <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,False,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)"/>
 +                                    <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,parent.state,context)"/>
                                      <field name="name"/>
                                      <field name="date_planned"/>
                                      <field name="company_id" groups="base.group_multi_company" widget="selection"/>
@@@ -122,11 -114,8 +115,8 @@@ class purchase_report(osv.osv)
                      l.product_id,
                      t.categ_id,
                      s.date_order,
-                     to_char(s.date_order, 'YYYY'),
-                     to_char(s.date_order, 'MM'),
-                     to_char(s.date_order, 'YYYY-MM-DD'),
                      s.state,
 -                    s.warehouse_id,
 +                    s.picking_type_id,
                      u.uom_type,
                      u.category_id,
                      t.uom_id,
  -
    !python {model: procurement.order}: |
      procurement = self.browse(cr, uid, ref('procurement_order_testcase0'))
 -    assert procurement.purchase_id, 'RFQ should be generated!'
 +    assert procurement.purchase_line_id, 'RFQ should be generated!'
+ -
+   I delete the line from the purchase order and check that the move and the procurement are cancelled
+ -
+   !python {model: procurement.order}: |
+     procurement = self.browse(cr, uid, ref('procurement_order_testcase0'))
+     move = procurement.purchase_id.order_line[0].move_dest_id
+     procurement.purchase_id.order_line[0].unlink()
+     assert move.state == 'cancel', 'Move should be cancelled'
+     procurement.refresh()
+     assert procurement.state == 'cancel', 'Procurement should be cancelled'
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -343,44 -614,14 +343,43 @@@ class sale_order_line(osv.osv)
          res_packing = self.product_packaging_change(cr, uid, ids, pricelist, product, qty, uom, partner_id, packaging, context=context)
          res['value'].update(res_packing.get('value', {}))
          warning_msgs = res_packing.get('warning') and res_packing['warning']['message'] or ''
 -        compare_qty = float_compare(product_obj.virtual_available * uom2.factor, qty * product_obj.uom_id.factor, precision_rounding=product_obj.uom_id.rounding)
 -        if (product_obj.type=='product') and int(compare_qty) == -1 \
 -          and (product_obj.procure_method=='make_to_stock'):
 -            warn_msg = _('You plan to sell %.2f %s but you only have %.2f %s available !\nThe real stock is %.2f %s. (without reservations)') % \
 -                    (qty, uom2 and uom2.name or product_obj.uom_id.name,
 -                     max(0,product_obj.virtual_available), product_obj.uom_id.name,
 -                     max(0,product_obj.qty_available), product_obj.uom_id.name)
 -            warning_msgs += _("Not enough stock ! : ") + warn_msg + "\n\n"
 +
 +        #determine if the product is MTO or not (for a further check)
 +        isMto = False
 +        if warehouse_id:
 +            warehouse = self.pool.get('stock.warehouse').browse(cr, uid, warehouse_id, context=context)
 +            for product_route in product_obj.route_ids:
 +                if warehouse.mto_pull_id and warehouse.mto_pull_id.route_id and warehouse.mto_pull_id.route_id.id == product_route.id:
 +                    isMto = True
 +                    break
 +        else:
 +            try:
 +                mto_route_id = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'route_warehouse0_mto').id
 +            except:
 +                # if route MTO not found in ir_model_data, we treat the product as in MTS
 +                mto_route_id = False
 +            if mto_route_id:
 +                for product_route in product_obj.route_ids:
 +                    if product_route.id == mto_route_id:
 +                        isMto = True
 +                        break
 +
 +        #check if product is available, and if not: raise a warning, but do this only for products that aren't processed in MTO
 +        if not isMto:
 +            uom2 = False
 +            if uom:
 +                uom2 = product_uom_obj.browse(cr, uid, uom, context=context)
 +                if product_obj.uom_id.category_id.id != uom2.category_id.id:
 +                    uom = False
 +            if not uom2:
 +                uom2 = product_obj.uom_id
 +            compare_qty = float_compare(product_obj.virtual_available * uom2.factor, qty * product_obj.uom_id.factor, precision_rounding=product_obj.uom_id.rounding)
 +            if (product_obj.type=='product') and int(compare_qty) == -1:
-               #and (product_obj.procure_method=='make_to_stock'): --> need to find alternative for procure_method
 +                warn_msg = _('You plan to sell %.2f %s but you only have %.2f %s available !\nThe real stock is %.2f %s. (without reservations)') % \
 +                        (qty, uom2 and uom2.name or product_obj.uom_id.name,
 +                         max(0,product_obj.virtual_available), product_obj.uom_id.name,
 +                         max(0,product_obj.qty_available), product_obj.uom_id.name)
 +                warning_msgs += _("Not enough stock ! : ") + warn_msg + "\n\n"
  
          #update of warning messages
          if warning_msgs:
                         <field name="product_id"
                         context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
                         groups="base.group_user" 
-                        on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/>
 -                       on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, context)"/>
 -                   </field>
 -                   <field name="product_uom_qty" position="replace">
++                       on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/>
 +                   </xpath>
 +                   <xpath expr="//field[@name='order_line']/tree//field[@name='product_uom_qty']" position="replace">
 +                       <field context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
 +                             name="product_uom_qty" 
 +                       on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, context)"/>
 +                   </xpath>
 +                   <xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="replace">
 +                       <field name="product_id"
 +                       context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
 +                       groups="base.group_user" 
 +                       on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/>
 +                   </xpath>
 +                   <xpath expr="//field[@name='order_line']/form//field[@name='product_uom_qty']" position="replace">
                         <field context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
-                              name="product_uom_qty" 
+                              name="product_uom_qty" class="oe_inline"
 -                           on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, context)"/>
 -                   </field>
 +                       on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, context)"/>
 +                   </xpath>
  
                     <field name='invoiced' position="after">
                         <field name="shipped"/>
                          <field name="loc_row"/>
                          <field name="loc_case"/>
                      </group>
 -                </xpath>
 +                </group>
-                 <page position="after" string="Information">
-                     <page string="Properties" name="properties">
-                         <group string="Counter-Part Locations Properties" groups="stock.group_locations">
-                             <field name="property_stock_procurement" domain="[('usage','=','procurement')]"/>
-                             <field name="property_stock_production" domain="[('usage','=','production')]"/>
-                             <field name="property_stock_inventory" domain="[('usage','=','inventory')]"/>
-                         </group>
-                     </page>
-                 </page>
+                 <xpath expr="//group[@name='weight']" position="after">
 -                    <group string="Accounting Entries">
 -                        <field name="property_stock_account_input" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
 -                        <field name="property_stock_account_output" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
 -                    </group>
+                     <group string="Counter-Part Locations Properties" groups="stock.group_locations">
+                         <field name="property_stock_procurement" domain="[('usage','=','procurement')]"/>
+                         <field name="property_stock_production" domain="[('usage','=','production')]"/>
+                         <field name="property_stock_inventory" domain="[('usage','=','inventory')]"/>
+                     </group>
+                 </xpath>
                  <field name="product_manager" position="attributes" version="7.0">
                      <attribute name="context">{'default_groups_ref': ['base.group_user', 'base.group_sale_manager', 'stock.group_stock_manager']}</attribute>
                  </field>
              </field>
          </record>
  
 -        <record id="view_normal_procurement_locations_form" model="ir.ui.view">
 -            <field name="name">product.normal.procurement.locations.inherit</field>
 -            <field name="model">product.product</field>
 -            <field name="inherit_id" ref="product.product_normal_form_view"/>
 -            <field name="arch" type="xml">
 -                <xpath expr="//div[@name='buttons']" position="inside">
 -                   <button string="Inventory" name="%(action_product_location_tree)d" type="action"  attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_locations"/>
 -                   <button string="Moves" name= "%(act_product_stock_move_open)d" type="action" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_stock_user"/>
 -                </xpath>
 -                <group name="procurement_uom" position="before">
 -                    <group name="delay" string="Delays">
 -                        <label for="produce_delay" attrs="{'invisible':[('type','=','service')]}"/>
 -                        <div attrs="{'invisible':[('type','=','service')]}">
 -                            <field name="produce_delay" class="oe_inline"/> days
 -                        </div>
 -                        <field name="active"/>
 -                    </group>
 -                </group>
 -                <xpath expr="//group[@string='Sale Conditions']" position="inside">
 -                    <label for="sale_delay"/>
 -                        <div>
 -                            <field name="sale_delay" class="oe_inline"/> days
 -                        </div>
 -                </xpath>
 -                <group name="status" position="before" version="7.0">
 -                    <group string="Stock and Expected Variations" attrs="{'invisible': [('type', '=', 'service')]}" groups="base.group_user">
 -                        <label for="qty_available"/>
 -                            <div>
 -                                <field name="qty_available" class="oe_inline"/>
 -                                <button name="%(action_view_change_product_quantity)d" string="⇒ Update"
 -                                    type="action"
 -                                    class="oe_link"/>
 -                            </div>
 -                        <label for="incoming_qty"/>
 -                        <div>
 -                            <field name="incoming_qty" class="oe_inline"/>
 -                        </div>
 -                        <field name="outgoing_qty" class="oe_inline"/>
 -                        <field name="virtual_available" class="oe_inline"/>
 -                    </group>
 -                    <group name="lot" groups="stock.group_tracking_lot,stock.group_production_lot" string="Lots">
 -                        <field name="track_production" groups="stock.group_production_lot"/>
 -                        <field name="track_incoming" groups="stock.group_tracking_lot"/>
 -                        <field name="track_outgoing" groups="stock.group_tracking_lot"/>
 -                    </group>
 -                </group>
 -                <group name="status" position="after" version="7.0">
 -                    <group name="store" string="Storage Location" attrs="{'invisible':[('type','=','service')]}">
 -                        <field name="loc_rack"/>
 -                        <field name="loc_row"/>
 -                        <field name="loc_case"/>
 -                    </group>
 -                </group>
 -                <group name="Weights" position="after">
 -                     <group name="store" groups="stock.group_locations" string="Counter-Part Locations Properties">
 -                         <field name="property_stock_procurement" attrs="{'readonly':['|', ('type','=','service'), ('is_only_child', '=', False) ]}" domain="[('usage','=','procurement')]"/>
 -                         <field name="property_stock_production" attrs="{'readonly':['|', ('type','=','service'), ('is_only_child', '=', False) ]}" domain="[('usage','=','production')]"/>
 -                         <field name="property_stock_inventory"  attrs="{'readonly':['|', ('type','=','service'), ('is_only_child', '=', False) ]}" domain="[('usage','=','inventory')]"/>
 -                     </group>
 -                </group>
 -                <field name="product_manager" position="attributes" version="7.0">
 -                    <attribute name="context">{'default_groups_ref': ['base.group_user', 'base.group_sale_manager', 'stock.group_stock_manager']}</attribute>
 -                </field>
 -            </field>
 -        </record>
 -
 -        <record id="view_product_standard_price_form" model="ir.ui.view">
 -            <field name="name">product.product.standard.price.form.inherit</field>
 -            <field name="model">product.product</field>
 -            <field name="inherit_id" ref="product.product_normal_form_view"/>
 -            <field name="arch" type="xml">
 -                <field name="standard_price" position="replace" version="7.0">
 -                    <label for="standard_price" align="1.0" groups="base.group_user"/>
 -                    <div groups="base.group_user">
 -                        <field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}" nolabel="1"/>
 -                        <button name="%(action_view_change_standard_price)d" string="- update"
 -                            type="action" attrs="{'invisible':[('cost_method','&lt;&gt;','average')]}"
 -                            class="oe_link" groups="product.group_costing_method"/>
 -                    </div>
 -                </field>
 -            </field>
 -        </record>
 -
 -        <record id="view_normal_property_acc_form" model="ir.ui.view">
 -            <field name="name">product.normal.stock.acc.property.form.inherit</field>
 -            <field name="model">product.product</field>
 -            <field name="inherit_id" ref="product.product_normal_form_view"/>
 -            <field name="priority">26</field>
 -            <field name="arch" type="xml">
 -                <xpath expr="//group[@name='properties']" position="before">
 -                    <group groups="stock.group_inventory_valuation">
 -                        <separator string="Inventory Valuation" colspan="4"/>
 -                        <group colspan="2" col="2">
 -                            <field name="valuation" attrs="{'readonly':[('type', '=', 'service')]}"/>
 -                        </group>
 -                        <group colspan="2" col="2">
 -                            <field name="property_stock_account_input"
 -                                attrs="{'invisible':[('valuation', '!=', 'real_time')],
 -                                        'readonly': [('is_only_child', '=', False)]}"
 -                                domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
 -                            <field name="property_stock_account_output"
 -                                attrs="{'invisible':[('valuation', '!=', 'real_time')],
 -                                        'readonly': [('is_only_child', '=', False)]}"
 -                                domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
 -                        </group>
 -                    </group>
 -                    <newline/>
 -                </xpath>
 -            </field>
 -        </record>
 -
 -
          <record id="action_receive_move" model="ir.actions.act_window">
              <field name="name">Receptions</field>
              <field name="res_model">stock.move</field>
              <field name="currency_id" ref="base.USD"/>
              <field name="partner_id" ref="res_partner_company_1"/>
              <field name="parent_id" ref="base.main_company"/>
-             <field name="name">Your Company, Chicago shop</field>
 -            <field name="name">Your Company</field>
 -        </record>
 -
 -        <!--        Child Company 2-->
 -        <record id="res_partner_company_2" model="res.partner">
 -            <field name="name">Your Company, Birmingham shop</field>
 -            <field eval="1" name="customer"/>
 -            <field eval="1" name="supplier"/>
 -            <field eval="1" name="active"/>
 -            <field name="is_company">1</field>
 -            <field name="street">82-85 Academy Avenue</field>
 -            <field name="city">Birmingham</field>
 -            <field name="zip">B46 3AG</field>
 -            <field model="res.country" name="country_id" search="[('code','ilike','gb')]"/>
 -            <field name="phone">+44 121 690 4596</field>
 -            <field name="email">birmingham@yourcompany.com</field>
 -            <field name="website">www.yourcompany.com</field>
 -        </record>
 -
 -        <record id="res_partner_address_40" model="res.partner">
 -            <field name="name">Donald Thompson</field>
 -            <field name="parent_id" ref="res_partner_company_2"/>
 -            <field name="use_parent_address" eval="1"/>
 -        </record>
 -
 -        <record id="res_company_2" model="res.company">
 -            <field name="currency_id" ref="base.GBP"/>
 -            <field name="partner_id" ref="res_partner_company_2"/>
 -            <field name="parent_id" ref="base.main_company"/>
 -            <field name="name">Your Company, Birmingham shop</field>
 -        </record>
 -
 -        <!--TOCHECK-->
 -        <record id="stock_location_shop0" model="stock.location">
 -            <field model="res.partner" name="partner_id" search="[('name','=','Fabien')]"/>
 -            <field name="location_id" ref="stock.stock_location_locations"/>
 -            <field name="company_id" ref="res_company_1"/>
 -            <field name="usage">internal</field>
 -            <field name="chained_location_type">none</field>
 -            <field eval="1" name="active"/>
+             <field name="name">Your Company, Chicago</field>
 -            <field name="chained_auto_packing">manual</field>
 -        </record>
 -        <record id="stock_location_shop1" model="stock.location">
 -            <field model="res.partner" name="partner_id" search="[('name','=','Eric')]"/>
 -            <field name="company_id" ref="res_company_1"/>
 -            <field name="location_id" ref="stock.stock_location_locations"/>
 -            <field name="usage">internal</field>
 -            <field eval="1" name="active"/>
 -            <field name="name">Your Company, Birmingham shop</field>
 -        </record>
 -        <record id="stock_location_intermediatelocation0" model="stock.location">
 -            <field name="partner_id" ref="base.main_partner"/>
 -            <field name="location_id" ref="stock.stock_location_locations_partner"/>
 -            <field name="usage">procurement</field>
 -            <field name="name">Internal Shippings</field>
          </record>
  
          <record id="stock_warehouse_shop0" model="stock.warehouse">
Simple merge
index 97fb61f,0000000..5e95d18
mode 100644,000000..100644
--- /dev/null
@@@ -1,95 -1,0 +1,93 @@@
 +<?xml version="1.0" encoding="utf-8"?>
 +<openerp>
 +    <data>
 +
 +        <record id="view_category_property_form" model="ir.ui.view">
 +            <field name="name">product.category.stock.property.form.inherit</field>
 +            <field name="model">product.category</field>
 +            <field name="inherit_id" ref="account.view_category_property_form"/>
 +            <field name="arch" type="xml">
 +                <data>
 +                    <group name="account_property" position="after">
 +                        <group name="account_stock_property" string="Account Stock Properties" colspan="2">
 +                            <field name="property_stock_account_input_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
 +                            <field name="property_stock_account_output_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
 +                            <field name="property_stock_valuation_account_id" domain="[('type','&lt;&gt;','view'), ('type','&lt;&gt;','consolidation')]"/>
 +                            <field name="property_stock_journal"/>
 +                        </group>
 +                    </group>
 +                </data>
 +            </field>
 +        </record>
 +
 +        <record id="view_template_property_form" model="ir.ui.view">
 +            <field name="name">product.template.stock.property.form.inherit</field>
 +            <field name="model">product.template</field>
 +            <field name="inherit_id" ref="product.product_template_form_view"/>
 +            <field name="arch" type="xml">
 +                <group name="delay" position="inside">
 +                    <field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}"/>
 +                </group>
 +                <group name="delay" position="after">
 +                    <group name="store" string="Storage Location">
 +                        <field name="loc_rack"/>
 +                        <field name="loc_row"/>
 +                        <field name="loc_case"/>
 +                    </group>
 +                </group>
-                 <page position="after" string="Information">
-                     <page name="properties" position="inside">
-                         <group string="Accounting Entries">
-                             <field name="property_stock_account_input" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
-                             <field name="property_stock_account_output" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
-                         </group>
-                     </page>
-                 </page>
++                <xpath expr="//group[@name='weight']" position="after">
++                    <group string="Accounting Entries">
++                        <field name="property_stock_account_input" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
++                        <field name="property_stock_account_output" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
++                    </group>
++              </xpath>
 +              <xpath expr="//field[@name='standard_price']" position='replace'>
 +                    <field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}"/>
 +                    <field name="cost_method"/>
 +              </xpath>
 +            </field>
 +        </record>
 +
 +        <record id="view_product_standard_price_form" model="ir.ui.view">
 +            <field name="name">product.product.standard.price.form.inherit</field>
 +            <field name="model">product.product</field>
 +            <field name="inherit_id" ref="product.product_normal_form_view"/>
 +            <field name="arch" type="xml">
 +                <field name="standard_price" position="replace" version="7.0">
 +                    <field name="cost_method" groups="product.group_costing_method"/>
 +                    <label string="Cost Price" for="standard_price" align="1.0" groups="base.group_user"/>
 +                    <div groups="base.group_user">
 +                        <field name="standard_price" attrs="{'readonly':[('valuation','=','real_time'), ('cost_method', 'in', ['standard', 'average'])]}" nolabel="1"/>
 +                        <button name="%(action_view_change_standard_price)d" string="- update"
 +                            type="action" attrs="{'invisible':['|', ('valuation','!=', 'real_time'), ('cost_method', 'not in', ['standard', 'average'])]}"
 +                            class="oe_link" groups="product.group_costing_method"/>
 +                    </div>
 +                </field>
 +            </field>
 +        </record>
 +
 +        <record id="view_normal_property_acc_form" model="ir.ui.view">
 +            <field name="name">product.normal.stock.acc.property.form.inherit</field>
 +            <field name="model">product.product</field>
 +            <field name="inherit_id" ref="product.product_normal_form_view"/>
 +            <field name="priority">26</field>
 +            <field name="arch" type="xml">
 +                <xpath expr="//group[@name='properties']" position="before">
 +                    <group>
 +                        <separator string="Inventory Valuation" colspan="4"/>
 +                        <group colspan="2" col="2">
 +                            <field name="valuation" attrs="{'readonly':[('type', '=', 'service')]}"/>
 +                        </group>
 +                        <group colspan="2" col="2">
 +                            <field name="property_stock_account_input" attrs="{'invisible':[('valuation', '!=', 'real_time')]}"
 +                                domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
 +                            <field name="property_stock_account_output" attrs="{'invisible':[('valuation', '!=', 'real_time')]}"
 +                                domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
 +                        </group>
 +                    </group>
 +                    <newline/>
 +                </xpath>
 +            </field>
 +        </record>
 +    </data>
 +</openerp>