Skip to Content
Menu
This question has been flagged
1 Reply
2594 Views

Im looking at how to create an RFQ  but i cant see some fields in the purchase.order model, 

in the browser the user can add products to the RFQ and their properties such as:

Description, Scheduled Date, Quantity , Unit Price, Product, 

However, the  Taxes field seems to be present. 

there is nothing akin these fields in the model:

models.execute_kw(
 db, uid, password, 'purchase.order', 'fields_get',
 [], {'attributes': ['string', 'help', 'type']})

i only see these fields:

['__last_update', 'amount_tax', 'amount_total', 'amount_untaxed', 'bid_date', 'bid_validity', 'company_id', 'create_date', 'create_uid', 'currency_id', 'date_approve', 'date_order', 'dest_address_id', 'display_name', 'fiscal_position', 'id', 'incoterm_id', 'invoice_count', 'invoice_ids', 'invoice_method', 'invoiced', 'invoiced_rate', 'journal_id', 'location_id', 'message_follower_ids', 'message_ids', 'message_is_follower', 'message_last_post', 'message_summary', 'message_unread', 'minimum_planned_date', 'name', 'notes', 'order_line', 'origin', 'partner_id', 'partner_ref', 'payment_term_id', 'picking_ids', 'picking_type_id', 'pricelist_id', 'product_id', 'related_location_id', 'related_usage', 'requisition_id', 'shipment_count', 'shipped', 'shipped_rate', 'state', 'validator', 'write_date', 'write_uid']


Avatar
Discard
Best Answer

 labsdcjkbcdjks,

There is another model 'purchase.order.line' that provides each of the lines that you see in the body of the purchase order.  The field that contains these order lines is 'order_line'

In order to insert these order lines, you need to learn the "command syntax" for inserting one2many fields.  See this link here: https://www.odoo.com/documentation/8.0/reference/orm.html and search for CRUD in the model reference.  The basic idea is that you would assign the field order_line a value of something like this: (0,0,{'description': description, 'other_dict_entries': etc. etc.})

Avatar
Discard
Related Posts Replies Views Activity
0
May 23
1099
0
Feb 22
1040
1
Oct 24
275
1
Apr 24
518
2
Mar 24
753