Browse Source

beesdoo_pos module : migration to version 10.0, 11.0 and 12.0

pull/103/head
Manuel Claeys Bouuaert 5 years ago
parent
commit
ab4d15d19f
  1. 3
      beesdoo_pos/__init__.py
  2. 1
      beesdoo_pos/__manifest__.py
  3. 5
      beesdoo_pos/data/cron.xml
  4. 3
      beesdoo_pos/data/email.xml
  5. 2
      beesdoo_pos/models/__init__.py
  6. 44
      beesdoo_pos/models/beesdoo_pos.py
  7. 6
      beesdoo_pos/views/beesdoo_pos.xml

3
beesdoo_pos/__init__.py

@ -1,2 +1 @@
# -*- coding: utf-8 -*-
import models
from . import models

1
beesdoo_pos/__openerp__.py → beesdoo_pos/__manifest__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
{
'name': "Beescoop Point of sale",

5
beesdoo_pos/data/cron.xml

@ -6,9 +6,8 @@
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
<field name="model">pos.order</field>
<field name="function">_send_order_cron</field>
<field name="args">()</field>
<field name="model_id" ref="model_pos_order"/>
<field name="code">model._send_order_cron()</field>
</record>
</data>
</odoo>

3
beesdoo_pos/data/email.xml

@ -10,7 +10,8 @@
<field name="partner_to">${object.partner_id.id}</field>
<field name="model_id" ref="point_of_sale.model_pos_order" />
<field name="auto_delete" eval="True" />
<field name="report_template" ref="point_of_sale.action_report_pos_receipt" />
<!-- TODO: put back when 'pos_report' will be back -->
<!--<field name="report_template" ref="point_of_sale.action_report_pos_receipt" />-->
<field name="report_name">Ticket ${object.pos_reference}</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="body_html"><![CDATA[

2
beesdoo_pos/models/__init__.py

@ -1 +1 @@
import beesdoo_pos
from . import beesdoo_pos

44
beesdoo_pos/models/beesdoo_pos.py

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from openerp import models, fields, api, _
from odoo import models, fields, api, _
import logging
_logger = logging.getLogger(__name__)
@ -76,23 +75,24 @@ class BeescoopPosPartner(models.Model):
eater1, eater2, eater3 = self._get_eater()
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

6
beesdoo_pos/views/beesdoo_pos.xml

@ -1,9 +1,9 @@
<openerp>
<odoo>
<data>
<record model="ir.ui.view" id="beescoop_pos_inherit">
<field name="name">bees.pos.config.form.view</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.view_pos_config_form" />
<field name="inherit_id" ref="point_of_sale.pos_config_view_form" />
<field name="arch" type="xml">
<field name="iface_tax_included" position="after">
<separator string="Bill Value" colspan="2" />
@ -35,4 +35,4 @@
</xpath>
</template>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save