
from openerp import models, api

POSTED_MOVE_DOMAIN = ('move_id.state', '=', 'posted')


class PaymentOrderCreate(models.TransientModel):
    _inherit = 'payment.order.create'

    @api.model
    def extend_payment_order_domain(self, payment_order, domain):
        if POSTED_MOVE_DOMAIN in domain:
            domain.remove(POSTED_MOVE_DOMAIN)
        return super(PaymentOrderCreate, self)\
            .extend_payment_order_domain(payment_order, domain)


from openerp import models, api

POSTED_MOVE_DOMAIN = ('move_id.state', '=', 'posted')


class PaymentOrderCreate(models.TransientModel):
    _inherit = 'payment.order.create'

    @api.model
    def extend_payment_order_domain(self, payment_order, domain):
        if POSTED_MOVE_DOMAIN in domain:
            pos = domain.index(POSTED_MOVE_DOMAIN)
            domain[pos] = (1, '=', 1)
        return super(PaymentOrderCreate, self)\
            .extend_payment_order_domain(payment_order, domain)

Replace partial domain by (1,'=',1)
[IMP] Replace partial domain by (1,'=',1)

  
  from openerp import models, api
  
  POSTED_MOVE_DOMAIN = ('move_id.state', '=', 'posted')
  
  
  class PaymentOrderCreate(models.TransientModel):
      _inherit = 'payment.order.create'
  
      @api.model
      def extend_payment_order_domain(self, payment_order, domain):
          if POSTED_MOVE_DOMAIN in domain:
-             domain.remove(POSTED_MOVE_DOMAIN)
+             pos = domain.index(POSTED_MOVE_DOMAIN)
+             domain[pos] = (1, '=', 1)
          return super(PaymentOrderCreate, self)\
              .extend_payment_order_domain(payment_order, domain)
  
Replace partial domain by (1,'=',1)
## Code Before:

from openerp import models, api

POSTED_MOVE_DOMAIN = ('move_id.state', '=', 'posted')


class PaymentOrderCreate(models.TransientModel):
    _inherit = 'payment.order.create'

    @api.model
    def extend_payment_order_domain(self, payment_order, domain):
        if POSTED_MOVE_DOMAIN in domain:
            domain.remove(POSTED_MOVE_DOMAIN)
        return super(PaymentOrderCreate, self)\
            .extend_payment_order_domain(payment_order, domain)

## Instruction:
Replace partial domain by (1,'=',1)
## Code After:

from openerp import models, api

POSTED_MOVE_DOMAIN = ('move_id.state', '=', 'posted')


class PaymentOrderCreate(models.TransientModel):
    _inherit = 'payment.order.create'

    @api.model
    def extend_payment_order_domain(self, payment_order, domain):
        if POSTED_MOVE_DOMAIN in domain:
            pos = domain.index(POSTED_MOVE_DOMAIN)
            domain[pos] = (1, '=', 1)
        return super(PaymentOrderCreate, self)\
            .extend_payment_order_domain(payment_order, domain)
