remove logging
This commit is contained in:
parent
116b132b30
commit
790d003f1c
@ -3,9 +3,6 @@ from collections import defaultdict
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.tools import float_is_zero, float_compare
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PosSession(models.Model):
|
||||
@ -25,19 +22,8 @@ class PosSession(models.Model):
|
||||
payment_income_account = payment_methods_with_income[:1].income_account_id
|
||||
|
||||
if payment_income_account:
|
||||
_logger.info(
|
||||
"Product '%s' (id:%s) has no income account. "
|
||||
"Using payment method '%s' income account %s as fallback.",
|
||||
product.name, product.id,
|
||||
payment_methods_with_income[:1].name,
|
||||
payment_income_account.display_name
|
||||
)
|
||||
income_account = payment_income_account
|
||||
else:
|
||||
_logger.warning(
|
||||
"Product '%s' (id:%s) has no income account and no payment methods provide an income account.",
|
||||
product.name, product.id
|
||||
)
|
||||
raise UserError(_('Please define income account for this product: "%s" (id:%d).\n'
|
||||
'Or configure the Income Account in your payment methods.',
|
||||
product.name, product.id))
|
||||
@ -208,10 +194,6 @@ class PosSession(models.Model):
|
||||
target_account_id = payment.payment_method_id.discount_account_id.id
|
||||
elif payment.payment_method_id.income_account_id:
|
||||
target_account_id = payment.payment_method_id.income_account_id.id
|
||||
_logger.warning(
|
||||
"Payment method %s has no discount account configured; using income account instead for discount lines.",
|
||||
payment.payment_method_id.name,
|
||||
)
|
||||
else:
|
||||
if payment.payment_method_id.income_account_id:
|
||||
target_account_id = payment.payment_method_id.income_account_id.id
|
||||
|
||||
Loading…
Reference in New Issue
Block a user