Skip to Content
Menu
This question has been flagged
10 Replies
3873 Views

I want to create a many2many relationship with another model, but I can't figure out where the Vendor Bill records go.

Avatar
Discard
Best Answer

Hi Kito,

The vendor bills are stored on the model account.invoice. You can easily find out on which model records are by activating developer mode and hovering over a field:


Regards,
Yenthe

Avatar
Discard
Author

I've actually seen that, but it confused me more. Aren't customer invoices saved stored in account.invoice as well?

Yes both are saved in the same model, ie account.invoice , customer and invoice are distinguished by the field named type

*customer invoice and vendor

Author

I only want to use it to add/edit vendor bills just like you can add/edit customers on the Customer Invoices form. How do I refer to the vendor form?

You simply fill in the field 'type' with 'in_invoice' - which means it is an incoming invoice (vendor bill)

Author

Great, but where's the documentation for things like 'type' and 'widget' fields? I added the the 'type' field, but the area still appears disabled probably because I need to define the 'widget' for dropdown, and I don't know what's the widget string for dropdown with add/edit.

Author

Okay, it's something else. In account.invoice.line, I made a many2many field with two models (to try it out) account.invoice and account.payment models. Both appear as grey uninteractive fields. I think I should define some identifying strings from the models, but I don't know how.

Author

I was wrong, I needed the many2one field. Is there anyway I can make it display the vendor reference instead of the autogenerated bill no as the string?

Best Answer

You can get the vendor bills data and shipment data according to the PO ....

For vendor bills data ....

self.invoice_ids

For shipments data ....

self.picking_ids


Avatar
Discard
Related Posts Replies Views Activity
3
Jun 21
4354
1
Feb 18
2373
2
Jul 24
939
1
Jun 24
3560
1
Oct 23
8582