|
@ -1,5 +1,4 @@ |
|
|
# -*- coding: utf-8 -*- |
|
|
|
|
|
from openerp import models, fields, api, _ |
|
|
|
|
|
|
|
|
from odoo import models, fields, api, _ |
|
|
import logging |
|
|
import logging |
|
|
|
|
|
|
|
|
_logger = logging.getLogger(__name__) |
|
|
_logger = logging.getLogger(__name__) |
|
@ -76,23 +75,24 @@ class BeescoopPosPartner(models.Model): |
|
|
eater1, eater2, eater3 = self._get_eater() |
|
|
eater1, eater2, eater3 = self._get_eater() |
|
|
return eater1, eater2, eater3 |
|
|
return eater1, eater2, eater3 |
|
|
|
|
|
|
|
|
from openerp.addons.point_of_sale.report import pos_receipt |
|
|
|
|
|
|
|
|
|
|
|
class order_tva_included(pos_receipt.order): |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, cr, uid, name, context): |
|
|
|
|
|
super(order_tva_included, self).__init__(cr, uid, name, context=context) |
|
|
|
|
|
self.env = api.Environment(cr, uid, context) |
|
|
|
|
|
|
|
|
|
|
|
def netamount(self, order_line_id): |
|
|
|
|
|
order_line = self.env['pos.order.line'].browse(order_line_id) |
|
|
|
|
|
if order_line.order_id.config_id.iface_tax_included: |
|
|
|
|
|
return order_line.price_subtotal_incl |
|
|
|
|
|
else: |
|
|
|
|
|
return order_line.price_subtotal |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class report_order_receipt(models.AbstractModel): |
|
|
|
|
|
_inherit = 'report.point_of_sale.report_receipt' |
|
|
|
|
|
_template = 'point_of_sale.report_receipt' |
|
|
|
|
|
_wrapped_report_class = order_tva_included |
|
|
|
|
|
|
|
|
# TODO: put back when 'pos_receipt.order' will be back point_of_sale.action_report_pos_receipt |
|
|
|
|
|
# from odoo.addons.point_of_sale.report import pos_receipt |
|
|
|
|
|
# |
|
|
|
|
|
# class order_tva_included(pos_receipt.order): |
|
|
|
|
|
# |
|
|
|
|
|
# def __init__(self, cr, uid, name, context): |
|
|
|
|
|
# super(order_tva_included, self).__init__(cr, uid, name, context=context) |
|
|
|
|
|
# self.env = api.Environment(cr, uid, context) |
|
|
|
|
|
# |
|
|
|
|
|
# def netamount(self, order_line_id): |
|
|
|
|
|
# order_line = self.env['pos.order.line'].browse(order_line_id) |
|
|
|
|
|
# if order_line.order_id.config_id.iface_tax_included: |
|
|
|
|
|
# return order_line.price_subtotal_incl |
|
|
|
|
|
# else: |
|
|
|
|
|
# return order_line.price_subtotal |
|
|
|
|
|
# |
|
|
|
|
|
# |
|
|
|
|
|
# class report_order_receipt(models.AbstractModel): |
|
|
|
|
|
# _inherit = 'report.point_of_sale.report_receipt' |
|
|
|
|
|
# _template = 'point_of_sale.report_receipt' |
|
|
|
|
|
# _wrapped_report_class = order_tva_included |