def METHOD_NAME(
    self, diff_p1=0, diff_p2=0, quant_p1=0, quant_p2=0, auto_post=True
):
    invoice = Form(
        self.env["account.move"].with_context(
            default_move_type="in_invoice",
            default_invoice_date=fields.Date.today(),
            active_model="accoun.move",
        )
    )
    bill_union = self.env["purchase.bill.union"].search(
        [("purchase_order_id", "=", self.po.id)]
    )
    invoice.partner_id = self.vendor
    invoice.purchase_vendor_bill_id = bill_union
    with invoice.invoice_line_ids.edit(0) as line_form:
        line_form.quantity += quant_p1
        line_form.price_unit += diff_p1
    with invoice.invoice_line_ids.edit(1) as line_form:
        line_form.quantity += quant_p1
        line_form.price_unit += diff_p1
    with invoice.invoice_line_ids.edit(2) as line_form:
        line_form.quantity += quant_p2
        line_form.price_unit += diff_p2
    with invoice.invoice_line_ids.edit(3) as line_form:
        line_form.quantity += quant_p2
        line_form.price_unit += diff_p2
    invoice = invoice.save()
    if invoice.amount_total < 0:
        invoice.action_switch_invoice_into_refund_credit_note()
    if quant_p1 or quant_p2 or diff_p1 or diff_p2:
        invoice = invoice.with_context(l10n_ro_approved_price_difference=True)
    if auto_post:
        invoice.action_post()
    self.invoice = invoice
    _logger.debug("Factura introdusa")