medication_event.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <openerp>
  3. <data>
  4. <record model="ir.actions.act_window" id="animal_group_open_medication_events">
  5. <field name="domain">[('animal_group', '=', active_ids)]</field>
  6. <field name="name">Medication events</field>
  7. <field name="res_model">farm.medication.event</field>
  8. </record>
  9. <record model="ir.actions.act_window" id="animal_open_medication_events">
  10. <field name="domain">[('animal', '=', active_ids)]</field>
  11. <field name="name">Medication events</field>
  12. <field name="res_model">farm.medication.event</field>
  13. </record>
  14. <record id="view_medication_event_tree" model="ir.ui.view">
  15. <field name="name">medication_event.tree</field>
  16. <field name="model">farm.medication.event</field>
  17. <field name="mode">primary</field>
  18. <field name="inherit_id" ref="view_abstract_event_tree"/>
  19. <field name="arch" type="xml">
  20. <field name="lot" position="after">
  21. <field name="feed_product"/>
  22. </field>
  23. </field>
  24. </record>
  25. <record id="view_medication_event_form" model="ir.ui.view">
  26. <field name="name">mediction_event.form</field>
  27. <field name="model">farm.medication.event</field>
  28. <field name="mode">primary</field>
  29. <field name="inherit_id" ref="view_abstract_event_form"/>
  30. <field name="arch" type="xml">
  31. <field name="state" position="after">
  32. <h1>Medication Event</h1>
  33. </field>
  34. <field name="animal_group" position="replace">
  35. <field name="medication_in_feed"/>
  36. <field name="animal_group"
  37. attrs="{'invisible':['|',('animal_type','!=','group'), ('medication_in_feed', '=', True)],
  38. 'required':[('animal_type','=','group')]}"
  39. domain="[('farm', '=', farm), ('state', '!=', 'sold')]"/>
  40. <field name="medicated_feed"
  41. attrs="{'invisible': [('medication_in_feed', '=', False)]}"/>
  42. <field name="feed_product"/>
  43. <field name="feed_product_uom_category"/>
  44. <field name="feed_quantity"/>
  45. <field name="uom"/>
  46. <field name="location" domain="[('location_id', '=', farm)]"/>
  47. <field name="quantity"/>
  48. <field name="feed_location"/>
  49. <field name="feed_lot" domain="[('product_id', '=', feed_product)]"/>
  50. <field name="start_date"/>
  51. <field name="end_date"/>
  52. <field name="move"/>
  53. </field>
  54. </field>
  55. </record>
  56. </data>
  57. </openerp>