limipa de loggers
This commit is contained in:
parent
6b3c0b1e67
commit
9d4020cbb9
1 changed files with 2 additions and 10 deletions
|
@ -2,11 +2,11 @@
|
||||||
# @author: Criptomart (<tech@criptomart.net>)
|
# @author: Criptomart (<tech@criptomart.net>)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
import logging
|
#import logging
|
||||||
|
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
#_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class SaleOrderOrderLine(models.Model):
|
class SaleOrderOrderLine(models.Model):
|
||||||
_inherit = 'sale.order.line'
|
_inherit = 'sale.order.line'
|
||||||
|
@ -17,21 +17,13 @@ class SaleOrderOrderLine(models.Model):
|
||||||
Compute the amounts of the SO line.
|
Compute the amounts of the SO line.
|
||||||
"""
|
"""
|
||||||
for line in self:
|
for line in self:
|
||||||
|
|
||||||
price = line.price_unit
|
price = line.price_unit
|
||||||
taxes = line.tax_id.compute_all(price, line.order_id.currency_id, line.product_uom_qty, product=line.product_id, partner=line.order_id.partner_shipping_id)
|
taxes = line.tax_id.compute_all(price, line.order_id.currency_id, line.product_uom_qty, product=line.product_id, partner=line.order_id.partner_shipping_id)
|
||||||
if line.discount:
|
if line.discount:
|
||||||
price_disc = taxes['total_excluded'] * (1 - (line.discount or 0.0) / 100.0)
|
price_disc = taxes['total_excluded'] * (1 - (line.discount or 0.0) / 100.0)
|
||||||
_logger.warning("price_list : %s" %price)
|
|
||||||
_logger.warning("total_excluded : %s" %taxes['total_excluded'])
|
|
||||||
_logger.warning("price_disc : %s" %price_disc)
|
|
||||||
ctx = dict(self.env.context, handle_price_include=False)
|
ctx = dict(self.env.context, handle_price_include=False)
|
||||||
taxes = line.tax_id.with_context(ctx).compute_all(price_disc, line.order_id.currency_id, line.product_uom_qty, product=line.product_id, partner=line.order_id.partner_shipping_id)
|
taxes = line.tax_id.with_context(ctx).compute_all(price_disc, line.order_id.currency_id, line.product_uom_qty, product=line.product_id, partner=line.order_id.partner_shipping_id)
|
||||||
|
|
||||||
_logger.warning("price_tax : %s" %sum(t.get('amount', 0.0) for t in taxes.get('taxes', [])) )
|
|
||||||
_logger.warning("price_total : %s" %taxes['total_included'])
|
|
||||||
_logger.warning("price_subtotal : %s" %taxes['total_excluded'])
|
|
||||||
|
|
||||||
line.update({
|
line.update({
|
||||||
'price_tax': sum(t.get('amount', 0.0) for t in taxes.get('taxes', [])),
|
'price_tax': sum(t.get('amount', 0.0) for t in taxes.get('taxes', [])),
|
||||||
'price_total': taxes['total_included'],
|
'price_total': taxes['total_included'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue