
from openerp import api, _, models
from openerp.exceptions import UserError


class AccountInvoice(models.Model):
    _inherit = 'account.invoice'

    @api.multi
    def action_move_create(self):
        for inv in self:
            for line in inv.invoice_line_ids:
                if line.price_unit <= 0:
                    raise UserError(_('At least one of the lines of the \
                    invoice has price unit zero!' '\n Please make sure \
                    that all lines have successfully captured the unit price.')
                                    )

        return super(AccountInvoice, self).action_move_create()


from openerp import api, _, models
from openerp.exceptions import UserError


class AccountInvoice(models.Model):
    _inherit = 'account.invoice'

    @api.multi
    def action_move_create(self):

        for inv in self:
            for line in inv.invoice_line_ids:
                if line.product_id.id in (975887, 975888, 507890):
                    return []
                elif line.price_unit <= 0:
                    raise UserError(_('At least one of the lines of the \
                    invoice has price unit zero!' '\n Please make sure \
                    that all lines have successfully captured the unit price.')
                                    )

        return super(AccountInvoice, self).action_move_create()

Add ids for balance product in transactions_not_entry_line
[FIX] Add ids for balance product in transactions_not_entry_line

  
  from openerp import api, _, models
  from openerp.exceptions import UserError
  
  
  class AccountInvoice(models.Model):
      _inherit = 'account.invoice'
  
      @api.multi
      def action_move_create(self):
+ 
          for inv in self:
              for line in inv.invoice_line_ids:
+                 if line.product_id.id in (975887, 975888, 507890):
+                     return []
-                 if line.price_unit <= 0:
+                 elif line.price_unit <= 0:
                      raise UserError(_('At least one of the lines of the \
                      invoice has price unit zero!' '\n Please make sure \
                      that all lines have successfully captured the unit price.')
                                      )
  
          return super(AccountInvoice, self).action_move_create()
  
Add ids for balance product in transactions_not_entry_line
## Code Before:

from openerp import api, _, models
from openerp.exceptions import UserError


class AccountInvoice(models.Model):
    _inherit = 'account.invoice'

    @api.multi
    def action_move_create(self):
        for inv in self:
            for line in inv.invoice_line_ids:
                if line.price_unit <= 0:
                    raise UserError(_('At least one of the lines of the \
                    invoice has price unit zero!' '\n Please make sure \
                    that all lines have successfully captured the unit price.')
                                    )

        return super(AccountInvoice, self).action_move_create()

## Instruction:
Add ids for balance product in transactions_not_entry_line
## Code After:

from openerp import api, _, models
from openerp.exceptions import UserError


class AccountInvoice(models.Model):
    _inherit = 'account.invoice'

    @api.multi
    def action_move_create(self):

        for inv in self:
            for line in inv.invoice_line_ids:
                if line.product_id.id in (975887, 975888, 507890):
                    return []
                elif line.price_unit <= 0:
                    raise UserError(_('At least one of the lines of the \
                    invoice has price unit zero!' '\n Please make sure \
                    that all lines have successfully captured the unit price.')
                                    )

        return super(AccountInvoice, self).action_move_create()
