Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
4 Antwoorden
1822 Weergaven

Hello,

After adding and printing bill in Odoo POS I'm not able to valide payment anymore. I'm getting the following error:

You cannot edit a payment for a printed order.


I'm using odoo to manage a Bar/restaurant

Avatar
Annuleer
Beste antwoord

Hi,


This happens because Odoo treats a printed order (bill) as finalized, and blocks further payment edits to prevent inconsistencies.

The validation error is as follows.



If you want to allow payment even after bill is printed, patch the restriction check.

Override or remove this check in a custom module, if your business case allows.


* Warning: Bypassing this check may invalidate fiscal reports or audit trails in regulated regions.


Hope it helps

Avatar
Annuleer
Beste antwoord

By default in Odoo (including v18.0), once you print the bill (bill printing) in the Bar/Restaurant POS, the system locks the payment workflow for that order. This is by design to prevent discrepancies between what was given to the customer and what was later charged. That’s why you see the error:

You cannot edit a payment for a printed order.

Why does this happen?
  • Odoo treats the bill print as a “final” action.
  • Any change to payments after printing could cause accounting mismatches or disputes.
What are your options?
  1. Use "Print Bill" only for previews (don’t finalize until payment)
    • If you just want to give the customer a preview, use the "Print Bill" button but avoid finalizing any payments until the customer confirms.
  2. Enable the Bar/Restaurant split workflow
    • If you’re in Bar/Restaurant mode, you can split the bill or transfer items between tables without triggering the restriction.
  3. Customizing the logic (not recommended unless you know the impact)
    • Technically, you can remove the validation in:
      • point_of_sale/models/pos_order.py
      • point_of_sale/models/pos_payment.py
    • But this disables a safeguard that Odoo put in place for a reason. If you go this route, you should:
      • Fully test the behavior with invoicing/accounting.
      • Be aware that editing payments after printing can create serious discrepancies.
    Example (as shared above, comment out these lines):

    if order.nb_print > 0 and vals.get('payment_ids'): raise UserError(_('You cannot change the payment of a printed order.')) elif payment.pos_order_id.nb_print > 0: raise ValidationError(_('You cannot edit a payment for a printed order.'))

    Restart Odoo after the change.
Recommended approach

If you really need this behavior changed (e.g., your business process requires printing and still allowing payments), the safest way is to build a small custom module that overrides this restriction cleanly rather than modifying Odoo’s core files.

Avatar
Annuleer
Beste antwoord

I don't know why on earth is this logic exists but you can do

 

from "addons/point_of_sale/models/pos_order.py"

 

Comment This 2 lines

 

if order.nb_print > 0 and vals.get('payment_ids'):

      raise UserError(_('You cannot change the payment of a printed order.'))

 

 

from "addons/point_of_sale/models/pos_payment.py"

 

Comment This 2 lines

elif payment.pos_order_id.nb_print > 0:

      raise ValidationError(_('You cannot edit a payment for a printed order.'))

 

Save and restart odoo service

 

 

Hope it solves

Avatar
Annuleer
Beste antwoord

Did you find a solution ?

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
5
jul. 25
4523
1
mrt. 25
1383
1
aug. 25
76
1
nov. 24
1750
1
aug. 25
832