im trying to get the id of the current model that i edit or created but i cant get it
below is my code
def _get_basic_product_information_purchase(self, product_or_template, pricelist, combination, **kwargs):
basic_information = dict(
**product_or_template.read(['description_purchase', 'display_name'])[0]
)
if not product_or_template.is_product_variant:
basic_information['id'] = False
combination_name = combination._get_combination_name()
if combination_name:
basic_information.update(
display_name=f"{basic_information['display_name']} ({combination_name})"
)
price = product_or_template.standard_price
purchase_order_id = int(kwargs.get('id', 0))
if purchase_order_id:
purchase_order = request.env['purchase.order'].browse(purchase_order_id)
if purchase_order:
seller = product_or_template.seller_ids.filtered(lambda s: purchase_order.partner_id.id)
if seller:
price = seller[0].price
return dict(
**basic_information,
price=price
)