odoo add one2many data

发布时间 2023-06-02 22:41:14作者: CrossPython
    def loadinvoiced(self):
        # filepath = r'D:\odoo\odoo16\fapiaos\invoices.xlsx'
        # df = pd.read_excel(filepath)
        vals = {
            'invoicecode': 'invoicecode123',
            'sellername': 'sellername123',
            'invoicetype': 'invoicetype123',
            'headid': [(0,0, {
                'taxgroup': 'taxgroup123',
                'taxname': 'taxname123',
            }), (0,0, {
                'taxgroup': 'taxgroup12344',
                'taxname': 'taxname12344',
            })]
        }
        super(InvoiceSourceHead, self).create(vals)
        print('ok, added......................')