mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] report_label: black, isort, prettier
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from odoo import api, models, fields
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ReportLabelWizard(models.TransientModel):
|
||||
@@ -7,16 +7,20 @@ class ReportLabelWizard(models.TransientModel):
|
||||
|
||||
@api.model
|
||||
def _default_line_ids(self):
|
||||
""" Compute line_ids based on context """
|
||||
"""Compute line_ids based on context"""
|
||||
active_model = self.env.context.get("active_model")
|
||||
active_ids = self.env.context.get("active_ids", [])
|
||||
if not active_model or not active_ids:
|
||||
return False
|
||||
return [
|
||||
(0, 0, {
|
||||
"res_id": res_id,
|
||||
"quantity": 1,
|
||||
})
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"res_id": res_id,
|
||||
"quantity": 1,
|
||||
},
|
||||
)
|
||||
for res_id in active_ids
|
||||
]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
<record id="report_label_wizard_view_form" model="ir.ui.view">
|
||||
@@ -10,24 +10,30 @@
|
||||
</group>
|
||||
<field name="line_ids">
|
||||
<tree editable="bottom" create="false">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="res_id" invisible="1"/>
|
||||
<field name="res_name" string="Record"/>
|
||||
<field name="quantity"/>
|
||||
<field name="sequence" widget="handle" />
|
||||
<field name="res_id" invisible="1" />
|
||||
<field name="res_name" string="Record" />
|
||||
<field name="quantity" />
|
||||
</tree>
|
||||
</field>
|
||||
<group name="settings" string="Settings">
|
||||
<group>
|
||||
<field name="offset"/>
|
||||
<field name="model_id" invisible="1"/>
|
||||
<field name="label_paperformat_id"/>
|
||||
<field name="label_template" invisible="1"/>
|
||||
<field name="offset" />
|
||||
<field name="model_id" invisible="1" />
|
||||
<field name="label_paperformat_id" />
|
||||
<field name="label_template" invisible="1" />
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
<footer>
|
||||
<button name="print_report" string="Print" type="object" icon="fa-print" class="oe_highlight"/>
|
||||
<button special="cancel" string="Cancel"/>
|
||||
<button
|
||||
name="print_report"
|
||||
string="Print"
|
||||
type="object"
|
||||
icon="fa-print"
|
||||
class="oe_highlight"
|
||||
/>
|
||||
<button special="cancel" string="Cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user