|
| 1 | +<?xml version="1.0" ?> |
| 2 | +<odoo> |
| 3 | + <record id="sale_forecast_view_tree" model="ir.ui.view"> |
| 4 | + <field name="name">sale.forecast.tree</field> |
| 5 | + <field name="model">sale.forecast</field> |
| 6 | + <field name="arch" type="xml"> |
| 7 | + <tree edit="1" editable="bottom"> |
| 8 | + <field name="date_range_id" /> |
| 9 | + <field name="date_from" string="Date From" /> |
| 10 | + <field name="date_to" string="Date To" /> |
| 11 | + <field name="product_id" /> |
| 12 | + <field name="location_id" /> |
| 13 | + <field name="product_uom_qty" /> |
| 14 | + <field name="product_uom" /> |
| 15 | + <field name="product_qty" /> |
| 16 | + <field name="daily_qty" /> |
| 17 | + </tree> |
| 18 | + </field> |
| 19 | + </record> |
| 20 | + <record id="sale_forecast_view_form" model="ir.ui.view"> |
| 21 | + <field name="name">sale.forecast.form</field> |
| 22 | + <field name="model">sale.forecast</field> |
| 23 | + <field name="arch" type="xml"> |
| 24 | + <form> |
| 25 | + <sheet> |
| 26 | + <group> |
| 27 | + <group name="dates_read" class="oe_read_only"> |
| 28 | + <field name="date_from" string="Date From" /> |
| 29 | + <field name="date_to" string="Date To" /> |
| 30 | + <field name="duration" string="Duration" /> |
| 31 | + </group> |
| 32 | + <group name="dates_edit" class="oe_edit_only"> |
| 33 | + <field name="manual_date_from" string="Date From" /> |
| 34 | + <field name="manual_date_to" string="Date To" /> |
| 35 | + <field name="manual_duration" string="Duration" /> |
| 36 | + </group> |
| 37 | + <group> |
| 38 | + <field name="product_id" /> |
| 39 | + <field name="location_id" /> |
| 40 | + <field name="product_uom_qty" /> |
| 41 | + <field name="product_uom" /> |
| 42 | + <field name="daily_qty" /> |
| 43 | + </group> |
| 44 | + </group> |
| 45 | + </sheet> |
| 46 | + </form> |
| 47 | + </field> |
| 48 | + </record> |
| 49 | + <record id="sale_forecast_view_pivot" model="ir.ui.view"> |
| 50 | + <field name="name">sale.forecast.pivot</field> |
| 51 | + <field name="model">sale.forecast</field> |
| 52 | + <field name="arch" type="xml"> |
| 53 | + <pivot string="Sale Forecast"> |
| 54 | + <field name="product_qty" type="measure" /> |
| 55 | + <field name="product_id" type="row" /> |
| 56 | + <field name="date_range_id" type="col" /> |
| 57 | + <field name="date_from" type="col" /> |
| 58 | + </pivot> |
| 59 | + </field> |
| 60 | + </record> |
| 61 | + |
| 62 | + <record id="sale_forecast_view_graph" model="ir.ui.view"> |
| 63 | + <field name="name">sale.forecast.graph</field> |
| 64 | + <field name="model">sale.forecast</field> |
| 65 | + <field name="arch" type="xml"> |
| 66 | + <graph type="bar" stacked="True"> |
| 67 | + <field name="product_qty" type="measure" /> |
| 68 | + <field name="date_from" /> |
| 69 | + <field name="product_id" /> |
| 70 | + </graph> |
| 71 | + </field> |
| 72 | + </record> |
| 73 | + |
| 74 | + <record id="sale_forecast_view_search" model="ir.ui.view"> |
| 75 | + <field name="name">sale.forecast.search</field> |
| 76 | + <field name="model">sale.forecast</field> |
| 77 | + <field name="arch" type="xml"> |
| 78 | + <search string="Search Sale Forecast"> |
| 79 | + <field name="product_id" /> |
| 80 | + <field name="location_id" /> |
| 81 | + <field name="date_range_id" /> |
| 82 | + <separator /> |
| 83 | + <filter |
| 84 | + name="expired" |
| 85 | + string="Expired" |
| 86 | + domain="[('date_to', '<', context_today().strftime('%Y-%m-%d'))]" |
| 87 | + /> |
| 88 | + <filter |
| 89 | + name="not_expired" |
| 90 | + string="Not Expired" |
| 91 | + domain="['|', ('date_to', '=', False), ('date_to', '>', context_today().strftime('%Y-%m-%d'))]" |
| 92 | + /> |
| 93 | + <separator /> |
| 94 | + <group expand="0" string="Group By"> |
| 95 | + <filter |
| 96 | + string="Product" |
| 97 | + name="groupby_product" |
| 98 | + domain="[]" |
| 99 | + context="{'group_by':'product_id'}" |
| 100 | + /> |
| 101 | + <filter |
| 102 | + string="Location" |
| 103 | + name="groupby_location" |
| 104 | + domain="[]" |
| 105 | + context="{'group_by':'location_id'}" |
| 106 | + /> |
| 107 | + <filter |
| 108 | + string="Date (From)" |
| 109 | + name="groupby_date_from" |
| 110 | + domain="[]" |
| 111 | + context="{'group_by':'date_from'}" |
| 112 | + /> |
| 113 | + </group> |
| 114 | + </search> |
| 115 | + </field> |
| 116 | + </record> |
| 117 | + <record id="sale_forecast_action" model="ir.actions.act_window"> |
| 118 | + <field name="name">Sale Forecast</field> |
| 119 | + <field name="type">ir.actions.act_window</field> |
| 120 | + <field name="res_model">sale.forecast</field> |
| 121 | + <field name="view_mode">tree,form,pivot,graph</field> |
| 122 | + <field name="search_view_id" ref="sale_forecast_view_search" /> |
| 123 | + <field name="context">{"search_default_not_expired": 1}</field> |
| 124 | + </record> |
| 125 | + <menuitem |
| 126 | + id="sale_forecast_menu" |
| 127 | + name="Forecast" |
| 128 | + parent="sale.sale_menu_root" |
| 129 | + action="sale_forecast_action" |
| 130 | + sequence="10" |
| 131 | + /> |
| 132 | +</odoo> |
0 commit comments