跳至内容
菜单
此问题已终结
2 回复
9885 查看

"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
10907
0
8月 18
2670
1
5月 17
7624
2
12月 23
7075
2
12月 23
12682