Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1196 มุมมอง

I want to add new column in my Accounting -> Vendors -> Bills  an "Inventory Receipts" <- which comes from inventory module 


Please refer to this picture provided

Accounting


Inventory



How to do it?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

To add an "Inventory Receipts" field to your Vendor Bills list view in Odoo's Accounting module,Here's how to do it:


Python:-



from odoo import models, fields


class AccountMove(models.Model):

    _inherit = 'account.move'

    inventory_receipt_id = fields.Many2one(

        'stock.picking',

        string='Inventory Receipt',

        help='Related inventory receipt for this bill'

    )


Xml :-


<odoo>

    <record id="view_account_move_tree_inherit" model="ir.ui.view">

        <field name="name">account.move.tree.inherit</field>

        <field name="model">account.move</field>

        <field name="inherit_id" ref="account.view_move_tree"/>

        <field name="arch" type="xml">

            <xpath expr="//field[@name='invoice_date']" position="after">

                <field name="inventory_receipt_id" string="Inventory Receipt"/>

            </xpath>

        </field>

    </record>

</odoo>


Hope it helps

อวตาร
ละทิ้ง