0

I'm using odoo8, and create new menu on purchases. I'm making a new class that inherit purchses.order.line class:

class PurchaseOrderLine(models.Model):
   _inherit = 'purchase.order.line'

   order_name = fields.Char(string='PO Number', related='order_id.name')
   order_date = fields.Datetime(string='Date Order', related='order_id.date_order')
   vendor = fields.Char(string='Vendor', related='order_id.partner_id.name')
   internal_category_product = fields.Char(string='Internal Category Product', related='product_id.categ_id.name')
   internal_reference_product = fields.Char(string='Internal Referece Product', related='product_id.default_code')
   name_product = fields.Char(string='Product', related='product_id.name')

and make the action and views:

<record id="report_my_purchase_tree_view" model="ir.ui.view">
        <field name="name">report.my.purchase.tree.view</field>
        <field name="model">purchase.order.line</field>
        <field name="arch" type="xml">
            <tree string="My Purchases Report">
                <field name="order_name" />
                <field name="order_date" />
                <field name="vendor" />
                <field name="internal_category_product" />
                <field name="internal_reference_product" />
                <field name="name_product" />
                <field name="product_qty" />
                <field name="price_unit" />
                <field name="price_total" />
            </tree>
        </field>
    </record>

    <record id="action_report_my_purchase" model="ir.actions.act_window">
        <field name="name">Report My Purchase</field>
        <field name="res_model">purchase.order.line</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,pivot</field>
    </record>

and try to attach them into the Purchase menu:

<menuitem name="My Purchase Report" id="menu_report_my_purchase" parent="purchase.menu_procurement_management" action="action_report_my_purchase" />

After i update the module, the odoo shows no error but, the My Purchase Report menu that i created doesn't appear in the Purchase menu. Did anyone knows what have i missed?

user2265229
  • 141
  • 1
  • 2
  • 8

1 Answers1

0

Check below reasons for that:

  1. Is xml file added in openerp.py or menifest.py ?
  2. Check if menu created in "Settings => Technical => User Interface => Menu Items"

Note: for the second check you will need to enable developer mode

Ilesh Malani
  • 136
  • 3