mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[PORT] Printer Tray to V11
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Report to printer - Paper tray selection',
|
'name': 'Report to printer - Paper tray selection',
|
||||||
'version': '10.0.1.0.0',
|
'version': '11.0.1.0.0',
|
||||||
'category': 'Printer',
|
'category': 'Printer',
|
||||||
'author': "Camptocamp, Odoo Community Association (OCA)",
|
'author': "Camptocamp, Odoo Community Association (OCA)",
|
||||||
'maintainer': 'Camptocamp',
|
'maintainer': 'Camptocamp',
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
],
|
],
|
||||||
'data': [
|
'data': [
|
||||||
'views/res_users.xml',
|
'views/res_users.xml',
|
||||||
'views/ir_actions_report_xml.xml',
|
'views/ir_actions_report.xml',
|
||||||
'views/printing_printer.xml',
|
'views/printing_printer.xml',
|
||||||
'views/printing_report_xml_action.xml',
|
'views/printing_report_xml_action.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Copyright (C) 2013-2014 Camptocamp (<http://www.camptocamp.com>)
|
# Copyright (C) 2013-2014 Camptocamp (<http://www.camptocamp.com>)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from . import ir_actions_report_xml
|
from . import ir_actions_report
|
||||||
from . import printing_tray
|
from . import printing_tray
|
||||||
from . import printing_printer
|
from . import printing_printer
|
||||||
from . import res_users
|
from . import res_users
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
from odoo import api, fields, models
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
class IrActionsReportXml(models.Model):
|
class IrActionsReport(models.Model):
|
||||||
_inherit = 'ir.actions.report.xml'
|
_inherit = 'ir.actions.report'
|
||||||
|
|
||||||
printer_tray_id = fields.Many2one(
|
printer_tray_id = fields.Many2one(
|
||||||
comodel_name='printing.tray',
|
comodel_name='printing.tray',
|
||||||
@@ -7,7 +7,7 @@ from odoo.tests.common import TransactionCase
|
|||||||
|
|
||||||
class TestIrActionsReportXml(TransactionCase):
|
class TestIrActionsReportXml(TransactionCase):
|
||||||
def test_onchange_printer_tray_id_empty(self):
|
def test_onchange_printer_tray_id_empty(self):
|
||||||
action = self.env['ir.actions.report.xml'].new(
|
action = self.env['ir.actions.report'].new(
|
||||||
{'printer_tray_id': False})
|
{'printer_tray_id': False})
|
||||||
action.onchange_printing_printer_id()
|
action.onchange_printing_printer_id()
|
||||||
self.assertFalse(action.printer_tray_id)
|
self.assertFalse(action.printer_tray_id)
|
||||||
@@ -31,7 +31,7 @@ class TestIrActionsReportXml(TransactionCase):
|
|||||||
'printer_id': printer.id,
|
'printer_id': printer.id,
|
||||||
})
|
})
|
||||||
|
|
||||||
action = self.env['ir.actions.report.xml'].new(
|
action = self.env['ir.actions.report'].new(
|
||||||
{'printer_tray_id': tray.id})
|
{'printer_tray_id': tray.id})
|
||||||
self.assertEqual(action.printer_tray_id, tray)
|
self.assertEqual(action.printer_tray_id, tray)
|
||||||
action.onchange_printing_printer_id()
|
action.onchange_printing_printer_id()
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class TestPrintingPrinter(TransactionCase):
|
|||||||
"""
|
"""
|
||||||
It should generate the right options dictionnary
|
It should generate the right options dictionnary
|
||||||
"""
|
"""
|
||||||
report = self.env['ir.actions.report.xml'].search([], limit=1)
|
report = self.env['ir.actions.report'].search([], limit=1)
|
||||||
action = self.env['printing.report.xml.action'].create({
|
action = self.env['printing.report.xml.action'].create({
|
||||||
'user_id': self.env.user.id,
|
'user_id': self.env.user.id,
|
||||||
'report_id': report.id,
|
'report_id': report.id,
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class TestPrintingTray(TransactionCase):
|
|||||||
|
|
||||||
def test_report_behaviour(self):
|
def test_report_behaviour(self):
|
||||||
""" It should add the selected tray in the report data """
|
""" It should add the selected tray in the report data """
|
||||||
ir_report = self.env['ir.actions.report.xml'].search([], limit=1)
|
ir_report = self.env['ir.actions.report'].search([], limit=1)
|
||||||
report = self.env['printing.report.xml.action'].create({
|
report = self.env['printing.report.xml.action'].create({
|
||||||
'user_id': self.env.user.id,
|
'user_id': self.env.user.id,
|
||||||
'report_id': ir_report.id,
|
'report_id': ir_report.id,
|
||||||
|
|||||||
16
printer_tray/views/ir_actions_report.xml
Normal file
16
printer_tray/views/ir_actions_report.xml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<!-- ir.report form view -->
|
||||||
|
<record model="ir.ui.view" id="act_report_xml_view">
|
||||||
|
<field name="name">ir.actions.report.xml.add.printer.tray</field>
|
||||||
|
<field name="model">ir.actions.report</field>
|
||||||
|
<field name="inherit_id" ref="base_report_to_printer.act_report_xml_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="printing_printer_id" position="after">
|
||||||
|
<field name="printer_tray_id"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<openerp>
|
|
||||||
<data>
|
|
||||||
|
|
||||||
<!-- ir.report form view -->
|
|
||||||
<record model="ir.ui.view" id="act_report_xml_view">
|
|
||||||
<field name="name">ir.actions.report.xml.add.printer.tray</field>
|
|
||||||
<field name="model">ir.actions.report.xml</field>
|
|
||||||
<field name="inherit_id" ref="base_report_to_printer.act_report_xml_view" />
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="printing_printer_id" position="after">
|
|
||||||
<field name="printer_tray_id"/>
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
</data>
|
|
||||||
</openerp>
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<odoo>
|
||||||
<data noupdate="0">
|
|
||||||
<record model="ir.ui.view" id="printing_printer_view_form">
|
<record model="ir.ui.view" id="printing_printer_view_form">
|
||||||
<field name="name">printing.printer.form</field>
|
<field name="name">printing.printer.form</field>
|
||||||
<field name="model">printing.printer</field>
|
<field name="model">printing.printer</field>
|
||||||
@@ -21,5 +21,4 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<odoo>
|
||||||
<data noupdate="0">
|
|
||||||
<record id="printing_report_xml_action_view_form" model="ir.ui.view">
|
<record id="printing_report_xml_action_view_form" model="ir.ui.view">
|
||||||
<field name="name">printing.report.xml.action.form</field>
|
<field name="name">printing.report.xml.action.form</field>
|
||||||
<field name="model">printing.report.xml.action</field>
|
<field name="model">printing.report.xml.action</field>
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="printing_report_xml_action_view_tree" model="ir.ui.view">
|
<record id="printing_report_xml_action_view_tree" model="ir.ui.view">
|
||||||
<field name="name">printing.report.xml.action.form</field>
|
<field name="name">printing.report.xml.action.form</field>
|
||||||
<field name="model">printing.report.xml.action</field>
|
<field name="model">printing.report.xml.action</field>
|
||||||
@@ -21,5 +22,5 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
</data>
|
|
||||||
</openerp>
|
</odoo>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<!-- res.users form view -->
|
<!-- res.users form view -->
|
||||||
<record model="ir.ui.view" id="view_users_form">
|
<record model="ir.ui.view" id="view_users_form">
|
||||||
@@ -26,5 +25,4 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user