コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
9899 ビュー

"XMLFile"

<form>
                    <sheet>
                        <h1 align="center">Fatora</h1>
                        <group>
                            <field name="name" string="client name"/>
                            <field name="bill_number" string="Number"/>
                            <field name="bill_date" string="Purchase date"/>
                            <field name="Product_id" string="products" widget="many2many_tags"/>
                        </group>
                    </sheet>
                </form>


model market.bills.py

class PurchaseBill(models.Model): 

_name = 

_rec_name = 

bill_number = fields.Integer() 

Product_id = fields.Many2many('market.products')  

bill_date = fields.Datetime() 

client = fields.One2many('market.clients','bills')


model market.clients.py

class MarketClients(models.Model):
    _name = 'market.clients'

    name = fields.Char()
    bills = fields.Many2one('market.bills', string='client bills')

アバター
破棄

Hope this will helps you: https://youtu.be/tx1ONN2e8hk

最善の回答

Dear Omar Ahmed,


Try to use Context on .XML One2many field like this:


context="{'default_field_o2m':field_of_your_parent_view}"


I hope I helped you..

アバター
破棄
最善の回答

Hi

can you please refer this answer:

https://www.odoo.com/forum/help-1/question/how-can-i-get-the-parent-value-in-the-creation-of-a-child-in-odoo-9-134451

https://stackoverflow.com/questions/31244937/how-to-get-a-field-of-the-parent-form-from-a-pop-up-in-odoo

Thank you.


アバター
破棄
関連投稿 返信 ビュー 活動
2
11月 19
10913
0
8月 18
2673
1
5月 17
7634
2
12月 23
7082
2
12月 23
12691