mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-26 19:52:06 +02:00
19.0 vanilla
This commit is contained in:
parent
79f83631d5
commit
73afc09215
6267 changed files with 1534193 additions and 1130106 deletions
|
|
@ -6,16 +6,33 @@ from collections import defaultdict
|
|||
from odoo import _, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
def _prepare_data(env, data):
|
||||
|
||||
def _prepare_data(env, docids, data):
|
||||
# change product ids by actual product object to get access to fields in xml template
|
||||
# we needed to pass ids because reports only accepts native python types (int, float, strings, ...)
|
||||
|
||||
layout_wizard = env['product.label.layout'].browse(data.get('layout_wizard'))
|
||||
if data.get('active_model') == 'product.template':
|
||||
Product = env['product.template'].with_context(display_default_code=False)
|
||||
elif data.get('active_model') == 'product.product':
|
||||
Product = env['product.product'].with_context(display_default_code=False)
|
||||
elif data.get("studio") and docids:
|
||||
# special case: users trying to customize labels
|
||||
products = env['product.template'].with_context(display_default_code=False).browse(docids)
|
||||
quantity_by_product = defaultdict(list)
|
||||
for product in products:
|
||||
quantity_by_product[product].append((product.barcode, 1))
|
||||
return {
|
||||
'quantity': quantity_by_product,
|
||||
'page_numbers': 1,
|
||||
'pricelist': layout_wizard.pricelist_id,
|
||||
}
|
||||
else:
|
||||
raise UserError(_('Product model not defined, Please contact your administrator.'))
|
||||
|
||||
if not layout_wizard:
|
||||
return {}
|
||||
|
||||
total = 0
|
||||
qty_by_product_in = data.get('quantity_by_product')
|
||||
# search for products all at once, ordered by name desc since popitem() used in xml to print the labels
|
||||
|
|
@ -32,29 +49,50 @@ def _prepare_data(env, data):
|
|||
quantity_by_product[Product.browse(int(product))] += (barcodes_qtys)
|
||||
total += sum(qty for _, qty in barcodes_qtys)
|
||||
|
||||
layout_wizard = env['product.label.layout'].browse(data.get('layout_wizard'))
|
||||
if not layout_wizard:
|
||||
return {}
|
||||
|
||||
return {
|
||||
'quantity': quantity_by_product,
|
||||
'rows': layout_wizard.rows,
|
||||
'columns': layout_wizard.columns,
|
||||
'page_numbers': (total - 1) // (layout_wizard.rows * layout_wizard.columns) + 1,
|
||||
'price_included': data.get('price_included'),
|
||||
'extra_html': layout_wizard.extra_html,
|
||||
'pricelist': layout_wizard.pricelist_id,
|
||||
}
|
||||
|
||||
class ReportProductTemplateLabel(models.AbstractModel):
|
||||
_name = 'report.product.report_producttemplatelabel'
|
||||
_description = 'Product Label Report'
|
||||
|
||||
class ReportProductReport_Producttemplatelabel2x7(models.AbstractModel):
|
||||
_name = 'report.product.report_producttemplatelabel2x7'
|
||||
_description = 'Product Label Report 2x7'
|
||||
|
||||
def _get_report_values(self, docids, data):
|
||||
return _prepare_data(self.env, data)
|
||||
return _prepare_data(self.env, docids, data)
|
||||
|
||||
class ReportProductTemplateLabelDymo(models.AbstractModel):
|
||||
|
||||
class ReportProductReport_Producttemplatelabel4x7(models.AbstractModel):
|
||||
_name = 'report.product.report_producttemplatelabel4x7'
|
||||
_description = 'Product Label Report 4x7'
|
||||
|
||||
def _get_report_values(self, docids, data):
|
||||
return _prepare_data(self.env, docids, data)
|
||||
|
||||
|
||||
class ReportProductReport_Producttemplatelabel4x12(models.AbstractModel):
|
||||
_name = 'report.product.report_producttemplatelabel4x12'
|
||||
_description = 'Product Label Report 4x12'
|
||||
|
||||
def _get_report_values(self, docids, data):
|
||||
return _prepare_data(self.env, docids, data)
|
||||
|
||||
|
||||
class ReportProductReport_Producttemplatelabel4x12noprice(models.AbstractModel):
|
||||
_name = 'report.product.report_producttemplatelabel4x12noprice'
|
||||
_description = 'Product Label Report 4x12 No Price'
|
||||
|
||||
def _get_report_values(self, docids, data):
|
||||
return _prepare_data(self.env, docids, data)
|
||||
|
||||
|
||||
class ReportProductReport_Producttemplatelabel_Dymo(models.AbstractModel):
|
||||
_name = 'report.product.report_producttemplatelabel_dymo'
|
||||
_description = 'Product Label Report'
|
||||
|
||||
def _get_report_values(self, docids, data):
|
||||
return _prepare_data(self.env, data)
|
||||
return _prepare_data(self.env, docids, data)
|
||||
|
|
|
|||
|
|
@ -4,39 +4,41 @@
|
|||
<template id="report_packagingbarcode">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<div class="oe_structure"/>
|
||||
<t t-foreach="docs" t-as="packaging">
|
||||
<div class="col-4" style="padding:0;">
|
||||
<div class="oe_structure"></div>
|
||||
<table class="table table-condensed" style="border-bottom: 0px solid white !important;width: 3in;">
|
||||
<tr>
|
||||
<th style="text-align: left;">
|
||||
<strong t-field="packaging.name"/>
|
||||
<strong><span t-field="packaging.uom_id.name">Package Type A</span></strong>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong t-field="packaging.product_id.display_name"/>
|
||||
<strong><span t-field="packaging.product_id.display_name">Eco-friendly Wooden Chair</span></strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="o_row">
|
||||
<strong>Qty: </strong>
|
||||
<strong t-field="packaging.qty"/>
|
||||
<strong t-field="packaging.product_uom_id" groups="uom.group_uom"/>
|
||||
<strong><span t-field="packaging.uom_id.relative_factor">10</span></strong>
|
||||
<strong><span t-field="packaging.uom_id.relative_uom_id" groups="uom.group_uom">Units</span></strong>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<t t-if="packaging.barcode">
|
||||
<tr>
|
||||
<tr>
|
||||
<td style="text-align: center; vertical-align: middle;" class="col-5">
|
||||
<div t-field="packaging.barcode" t-options="{'widget': 'barcode', 'symbology': 'auto', 'width': 600, 'height': 150, 'img_style': 'width:100%;height:20%;'}"/>
|
||||
<span t-field="packaging.barcode"/>
|
||||
<span t-field="packaging.barcode">123456789012</span>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</table>
|
||||
<div class="oe_structure"/>
|
||||
</div>
|
||||
</t>
|
||||
<div class="oe_structure"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class ProductPricelistReport(models.AbstractModel):
|
||||
class ReportProductReport_Pricelist(models.AbstractModel):
|
||||
_name = 'report.product.report_pricelist'
|
||||
_description = 'Pricelist Report'
|
||||
|
||||
def _get_report_values(self, docids, data):
|
||||
return self._get_report_data(data, 'pdf')
|
||||
|
||||
@api.readonly
|
||||
@api.model
|
||||
def get_html(self, data):
|
||||
render_values = self._get_report_data(data, 'html')
|
||||
|
|
@ -18,7 +18,6 @@ class ProductPricelistReport(models.AbstractModel):
|
|||
|
||||
def _get_report_data(self, data, report_type='html'):
|
||||
quantities = data.get('quantities', [1])
|
||||
|
||||
data_pricelist_id = data.get('pricelist_id')
|
||||
pricelist_id = data_pricelist_id and int(data_pricelist_id)
|
||||
pricelist = self.env['product.pricelist'].browse(pricelist_id).exists()
|
||||
|
|
@ -30,7 +29,7 @@ class ProductPricelistReport(models.AbstractModel):
|
|||
is_product_tmpl = active_model == 'product.template'
|
||||
ProductClass = self.env[active_model]
|
||||
|
||||
products = ProductClass.browse(active_ids) if active_ids else ProductClass.search([('sale_ok', '=', True)])
|
||||
products = ProductClass.browse(active_ids) if active_ids else []
|
||||
products_data = [
|
||||
self._get_product_data(is_product_tmpl, product, pricelist, quantities)
|
||||
for product in products
|
||||
|
|
@ -39,10 +38,11 @@ class ProductPricelistReport(models.AbstractModel):
|
|||
return {
|
||||
'is_html_type': report_type == 'html',
|
||||
'is_product_tmpl': is_product_tmpl,
|
||||
'is_visible_title': data.get('is_visible_title', False) and bool(data['is_visible_title']),
|
||||
'display_pricelist_title': data.get('display_pricelist_title', False) and bool(data['display_pricelist_title']),
|
||||
'pricelist': pricelist,
|
||||
'products': products_data,
|
||||
'quantities': quantities,
|
||||
'docs': pricelist,
|
||||
}
|
||||
|
||||
def _get_product_data(self, is_product_tmpl, product, pricelist, quantities):
|
||||
|
|
|
|||
|
|
@ -3,70 +3,64 @@
|
|||
|
||||
<template id="report_pricelist_page">
|
||||
<div class="container bg-white p-4 my-4">
|
||||
<div class="oe_structure"></div>
|
||||
<div class="row my-3">
|
||||
<div class="col-12" t-if="is_visible_title">
|
||||
<div class="col-12">
|
||||
<h2 t-if="is_html_type">
|
||||
Pricelist:
|
||||
<a href="#" class="o_action" data-model="product.pricelist" t-att-data-res-id="pricelist.id">
|
||||
<t t-esc="pricelist.display_name"/>
|
||||
Pricelist <span t-if="display_pricelist_title">:</span>
|
||||
<a t-if="display_pricelist_title" href="#" class="o_action"
|
||||
data-model="product.pricelist" t-att-data-res-id="pricelist.id">
|
||||
<span t-field="pricelist.display_name">Gold Member Pricelist</span>
|
||||
</a>
|
||||
</h2>
|
||||
<h2 t-else="">
|
||||
Pricelist: <t t-esc="pricelist.display_name"/>
|
||||
Pricelist <span t-if="display_pricelist_title">:</span>
|
||||
<span t-if="display_pricelist_title" t-field="pricelist.display_name">Gold Member Pricelist</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div t-att-class="'text-center' + (' offset-4' if is_html_type else ' offset-3')">
|
||||
<strong>Sales Order Line Quantities (price per unit)</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"></div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<th class="text-end px-1" colspan="100%">Quantities (Price)</th>
|
||||
<tr>
|
||||
<th>Products</th>
|
||||
<th groups="uom.group_uom">UoM</th>
|
||||
<th class="px-1">Products</th>
|
||||
<th class="px-1" groups="uom.group_uom">UOM</th>
|
||||
<t t-foreach="quantities" t-as="qty">
|
||||
<th class="text-end"><t t-esc="qty"/></th>
|
||||
<th class="text-end px-1"><span t-out="qty">10 Units</span></th>
|
||||
</t>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-foreach="products" t-as="product">
|
||||
<tr>
|
||||
<td t-att-class="is_product_tmpl and 'fw-bold' or None">
|
||||
<td t-att-class="is_product_tmpl and 'fw-bold px-1' or None">
|
||||
<a t-if="is_html_type" href="#" class="o_action" t-att-data-model="is_product_tmpl and 'product.template' or 'product.product'" t-att-data-res-id="product['id']">
|
||||
<t t-esc="product['name']"/>
|
||||
<span t-out="product['name']">Virtual Interior Design</span>
|
||||
</a>
|
||||
<t t-else="">
|
||||
<t t-esc="product['name']"/>
|
||||
</t>
|
||||
</td>
|
||||
<td groups="uom.group_uom">
|
||||
<t t-esc="product['uom']"/>
|
||||
<span t-else="" t-out="product['name']">Acme Widget</span>
|
||||
</td>
|
||||
<td groups="uom.group_uom" class="px-1" t-out="product['uom']"/>
|
||||
<t t-foreach="quantities" t-as="qty">
|
||||
<td class="text-end">
|
||||
<t t-esc="product['price'][qty]" t-options='{"widget": "monetary", "display_currency": pricelist.currency_id}'/>
|
||||
<td class="text-end px-1">
|
||||
<span t-out="product['price'][qty]" t-options='{"widget": "monetary", "display_currency": pricelist.currency_id}'>$15.00</span>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
<t t-if="is_product_tmpl and 'variants' in product">
|
||||
<tr t-foreach="product['variants']" t-as="variant">
|
||||
<td>
|
||||
<td class="px-1">
|
||||
<a t-if="is_html_type" href="#" class="o_action ms-4" data-model="product.product" t-att-data-res-id="variant['id']">
|
||||
<t t-esc="variant['name']"/>
|
||||
<span t-out="variant['name']">Acme Widget - Blue</span>
|
||||
</a>
|
||||
<span t-else="" class="ms-4" t-esc="variant['name']"/>
|
||||
</td>
|
||||
<td groups="uom.group_uom">
|
||||
<t t-esc="product['uom']"/>
|
||||
<span t-else="" class="ms-4" t-out="variant['name']">Acme Widget - Blue</span>
|
||||
</td>
|
||||
<td groups="uom.group_uom" class="px-1" t-out="product['uom']"/>
|
||||
<t t-foreach="quantities" t-as="qty">
|
||||
<td class="text-end">
|
||||
<t t-esc="variant['price'][qty]" t-options='{"widget": "monetary", "display_currency": pricelist.currency_id}'/>
|
||||
<td class="text-end px-1">
|
||||
<span t-out="variant['price'][qty]" t-options='{"widget": "monetary", "display_currency": pricelist.currency_id}'>$14.00</span>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
|
|
@ -76,15 +70,24 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="report_pricelist">
|
||||
<t t-call="web.basic_layout">
|
||||
<t t-call="web.html_container">
|
||||
<div class="page">
|
||||
<t t-call="product.report_pricelist_page"/>
|
||||
<t t-if="is_html_type">
|
||||
<t t-call="product.report_pricelist_page"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-call="product.report_pricelist_page"/>
|
||||
</t>
|
||||
</t>
|
||||
</div>
|
||||
<p style="page-break-before:always;"> </p>
|
||||
<div class="oe_structure"></div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,12 +21,8 @@
|
|||
<div class="o_label_extra_data">
|
||||
<t t-out="extra_html"/>
|
||||
</div>
|
||||
<t t-if="product.is_product_variant">
|
||||
<strong class="o_label_price" t-field="product.lst_price" t-options="{'widget': 'monetary', 'label_price': True}"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<strong class="o_label_price" t-field="product.list_price" t-options="{'widget': 'monetary', 'label_price': True}"/>
|
||||
</t>
|
||||
<strong class="o_label_price" t-out="pricelist._get_product_price(product, 1, currency=pricelist.currency_id or product.currency_id)"
|
||||
t-options="{'widget': 'monetary', 'display_currency': pricelist.currency_id or product.currency_id, 'label_price': True}"/>
|
||||
</div>
|
||||
<div class="o_label_clear"></div>
|
||||
</div>
|
||||
|
|
@ -43,12 +39,8 @@
|
|||
<strong t-field="product.display_name"/>
|
||||
</div>
|
||||
<div class="text-end" style="padding-top:0;padding-bottom:0">
|
||||
<t t-if="product.is_product_variant">
|
||||
<strong class="o_label_price_medium" t-field="product.lst_price" t-options="{'widget': 'monetary', 'label_price': True}"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<strong class="o_label_price_medium" t-field="product.list_price" t-options="{'widget': 'monetary', 'label_price': True}"/>
|
||||
</t>
|
||||
<strong class="o_label_price_medium" t-out="pricelist._get_product_price(product, 1, currency=pricelist.currency_id or product.currency_id)"
|
||||
t-options="{'widget': 'monetary', 'display_currency': pricelist.currency_id or product.currency_id, 'label_price': True}"/>
|
||||
</div>
|
||||
<div class= "text-center o_label_small_barcode">
|
||||
<span class="text-nowrap" t-field="product.default_code"/>
|
||||
|
|
@ -69,24 +61,34 @@
|
|||
<div class="o_label_name">
|
||||
<strong t-field="product.display_name"/>
|
||||
</div>
|
||||
<t t-if="price_included">
|
||||
<div class="o_label_left_column">
|
||||
<span class="text-nowrap" t-field="product.default_code"/>
|
||||
</div>
|
||||
<div class="o_label_price_medium text-end">
|
||||
<t t-if="product.is_product_variant">
|
||||
<strong t-field="product.lst_price" t-options="{'widget': 'monetary', 'label_price': True}"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<strong t-field="product.list_price" t-options="{'widget': 'monetary', 'label_price': True}"/>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div class="o_label_left_column o_label_full_with">
|
||||
<span class="text-nowrap" t-field="product.default_code"/>
|
||||
</div>
|
||||
</t>
|
||||
<div class="o_label_left_column">
|
||||
<span class="text-nowrap" t-field="product.default_code"/>
|
||||
</div>
|
||||
<div class="o_label_price_medium text-end">
|
||||
<strong t-out="pricelist._get_product_price(product, 1, currency=pricelist.currency_id or product.currency_id)"
|
||||
t-options="{'widget': 'monetary', 'display_currency': pricelist.currency_id or product.currency_id, 'label_price': True}"/>
|
||||
</div>
|
||||
<div class= "text-center o_label_small_barcode">
|
||||
<t t-if="barcode">
|
||||
<div t-out="barcode" style="padding:0" t-options="{'widget': 'barcode', 'symbology': 'auto', 'img_style': barcode_size}"/>
|
||||
<span class="text-center" t-out="barcode"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</template>
|
||||
|
||||
<template id="report_simple_label4x12_no_price">
|
||||
<t t-set="barcode_size" t-value="'width:33mm;height:4mm'"/>
|
||||
<t t-set="table_style" t-value="'width:43mm;height:19mm;' + table_style"/>
|
||||
<td t-att-style="make_invisible and 'visibility:hidden;'" >
|
||||
<div class="o_label_full o_label_small_text" t-att-style="table_style">
|
||||
<div class="o_label_name">
|
||||
<strong t-field="product.display_name"/>
|
||||
</div>
|
||||
<div class="o_label_left_column o_label_full_with">
|
||||
<span class="text-nowrap" t-field="product.default_code"/>
|
||||
</div>
|
||||
<div class= "text-center o_label_small_barcode">
|
||||
<t t-if="barcode">
|
||||
<div t-out="barcode" style="padding:0" t-options="{'widget': 'barcode', 'symbology': 'auto', 'img_style': barcode_size}"/>
|
||||
|
|
@ -114,18 +116,11 @@
|
|||
<span t-else="" t-field="product.name"/>
|
||||
</div>
|
||||
<div class="o_label_left_column">
|
||||
<small class="text-nowrap" t-field="product.default_code"/>
|
||||
<small class="text-nowrap" t-field="product.default_code" style="font-size: 0.875em;"/>
|
||||
</div>
|
||||
<div class="text-end" style="padding: 0 4px;">
|
||||
<t t-if="product.is_product_variant">
|
||||
<strong class="o_label_price_small" t-field="product.lst_price" t-options="{'widget': 'monetary', 'label_price': True}"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<strong class="o_label_price_small" t-field="product.list_price" t-options="{'widget': 'monetary', 'label_price': True}"/>
|
||||
</t>
|
||||
<div t-if="False" class="o_label_extra_data">
|
||||
<t t-out="extra_html"/>
|
||||
</div>
|
||||
<strong class="o_label_price_small" t-out="pricelist._get_product_price(product, 1, currency=pricelist.currency_id or product.currency_id)"
|
||||
t-options="{'widget': 'monetary', 'display_currency': pricelist.currency_id or product.currency_id, 'label_price': True}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -136,15 +131,15 @@
|
|||
<t t-if="columns and rows">
|
||||
<t t-if="columns == 2 and rows == 7">
|
||||
<t t-set="padding_page" t-value="'padding: 14mm 3mm'"/>
|
||||
<t t-set="report_to_call" t-value="'product.report_simple_label2x7'"/>
|
||||
<t t-set="report_to_call" t-value="'2x7'"/>
|
||||
</t>
|
||||
<t t-if="columns == 4 and rows == 7">
|
||||
<t t-set="padding_page" t-value="'padding: 14mm 3mm'"/>
|
||||
<t t-set="report_to_call" t-value="'product.report_simple_label4x7'"/>
|
||||
<t t-set="report_to_call" t-value="'4x7'"/>
|
||||
</t>
|
||||
<t t-if="columns == 4 and rows == 12">
|
||||
<t t-set="padding_page" t-value="'padding: 20mm 8mm'"/>
|
||||
<t t-set="report_to_call" t-value="'product.report_simple_label4x12'"/>
|
||||
<t t-set="report_to_call" t-value="'4x12'"/>
|
||||
</t>
|
||||
<t t-foreach="range(page_numbers)" t-as="page">
|
||||
<div class="o_label_sheet" t-att-style="padding_page">
|
||||
|
|
@ -172,7 +167,21 @@
|
|||
<t t-set="make_invisible" t-value="True"/>
|
||||
</t>
|
||||
<t t-set="table_style" t-value="'border: 1px solid %s;' % (product.env.user.company_id.primary_color or 'black')"/>
|
||||
<t t-call="{{report_to_call}}"/>
|
||||
<!-- IMPORTANT: explictly call templates in place of {{template}} otherwise studio won't load report correctly -->
|
||||
<t t-if="report_to_call == '2x7'">
|
||||
<t t-call="product.report_simple_label2x7"/>
|
||||
</t>
|
||||
<t t-elif="report_to_call == '4x7'">
|
||||
<t t-call="product.report_simple_label4x7"/>
|
||||
</t>
|
||||
<t t-elif="report_to_call == '4x12'">
|
||||
<t t-if="price_included">
|
||||
<t t-call="product.report_simple_label4x12"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<t t-call="product.report_simple_label4x12_no_price"/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</tr>
|
||||
</t>
|
||||
|
|
|
|||
|
|
@ -15,12 +15,45 @@
|
|||
<field name="disable_shrinking" eval="True"/>
|
||||
<field name="dpi">96</field>
|
||||
</record>
|
||||
<record id="report_product_template_label" model="ir.actions.report">
|
||||
<field name="name">Product Label (PDF)</field>
|
||||
<record id="report_product_template_label_2x7" model="ir.actions.report">
|
||||
<field name="name">Product Label 2x7 (PDF)</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">product.report_producttemplatelabel</field>
|
||||
<field name="report_file">product.report_producttemplatelabel</field>
|
||||
<field name="report_name">product.report_producttemplatelabel2x7</field>
|
||||
<field name="report_file">product.report_producttemplatelabel2x7</field>
|
||||
<field name="paperformat_id" ref="product.paperformat_label_sheet"/>
|
||||
<field name="print_report_name">'Products Labels - %s' % (object.name)</field>
|
||||
<field name="binding_model_id" eval="False"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
<record id="report_product_template_label_4x7" model="ir.actions.report">
|
||||
<field name="name">Product Label 4x7 (PDF)</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">product.report_producttemplatelabel4x7</field>
|
||||
<field name="report_file">product.report_producttemplatelabel4x7</field>
|
||||
<field name="paperformat_id" ref="product.paperformat_label_sheet"/>
|
||||
<field name="print_report_name">'Products Labels - %s' % (object.name)</field>
|
||||
<field name="binding_model_id" eval="False"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
<record id="report_product_template_label_4x12" model="ir.actions.report">
|
||||
<field name="name">Product Label 4x12 (PDF)</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">product.report_producttemplatelabel4x12</field>
|
||||
<field name="report_file">product.report_producttemplatelabel4x12</field>
|
||||
<field name="paperformat_id" ref="product.paperformat_label_sheet"/>
|
||||
<field name="print_report_name">'Products Labels - %s' % (object.name)</field>
|
||||
<field name="binding_model_id" eval="False"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
<record id="report_product_template_label_4x12_noprice" model="ir.actions.report">
|
||||
<field name="name">Product Label 4x12 No Price (PDF)</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">product.report_producttemplatelabel4x12noprice</field>
|
||||
<field name="report_file">product.report_producttemplatelabel4x12noprice</field>
|
||||
<field name="paperformat_id" ref="product.paperformat_label_sheet"/>
|
||||
<field name="print_report_name">'Products Labels - %s' % (object.name)</field>
|
||||
<field name="binding_model_id" eval="False"/>
|
||||
|
|
@ -28,13 +61,13 @@
|
|||
</record>
|
||||
|
||||
<record id="report_product_packaging" model="ir.actions.report">
|
||||
<field name="name">Product Packaging (PDF)</field>
|
||||
<field name="model">product.packaging</field>
|
||||
<field name="name">Packaging Barcodes (PDF)</field>
|
||||
<field name="model">product.uom</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">product.report_packagingbarcode</field>
|
||||
<field name="report_file">product.report_packagingbarcode</field>
|
||||
<field name="print_report_name">'Products packaging - %s' % (object.name)</field>
|
||||
<field name="binding_model_id" ref="product.model_product_packaging"/>
|
||||
<field name="print_report_name">'Products packaging - %s' % (object.uom_id.name)</field>
|
||||
<field name="binding_model_id" ref="product.model_product_uom"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="report_producttemplatelabel">
|
||||
|
||||
<!-- IMPORTANT: explictly include col/row otherwise studio won't load report correctly -->
|
||||
<template id="report_producttemplatelabel2x7">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-call="product.report_productlabel">
|
||||
<t t-set="products" t-value="products"/>
|
||||
</t>
|
||||
<t t-set="columns" t-value="2"/>
|
||||
<t t-set="rows" t-value="7"/>
|
||||
<t t-call="product.report_productlabel"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="report_producttemplatelabel4x7">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-set="columns" t-value="4"/>
|
||||
<t t-set="rows" t-value="7"/>
|
||||
<t t-call="product.report_productlabel"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="report_producttemplatelabel4x12">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-set="columns" t-value="4"/>
|
||||
<t t-set="rows" t-value="12"/>
|
||||
<t t-set="price_included" t-value="True"/>
|
||||
<t t-call="product.report_productlabel"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="report_producttemplatelabel4x12noprice">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-set="columns" t-value="4"/>
|
||||
<t t-set="rows" t-value="12"/>
|
||||
<t t-set="price_included" t-value="False"/>
|
||||
<t t-call="product.report_productlabel"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
|
@ -13,9 +47,7 @@
|
|||
<template id="report_producttemplatelabel_dymo">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-call="product.report_productlabel_dymo">
|
||||
<t t-set="products" t-value="products"/>
|
||||
</t>
|
||||
<t t-call="product.report_productlabel_dymo"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue