11 changed files with 270 additions and 169 deletions
			
			
		@ -1,95 +1,133 @@ | 
				
			|||||
<?xml version="1.0" encoding="utf-8"?> | 
					<?xml version="1.0" encoding="utf-8"?> | 
				
			||||
<odoo> | 
					<odoo> | 
				
			||||
    <template id="top_selling_reports"> | 
						<!-- Template for Top Selling Products Report --> | 
				
			||||
        <t t-call="web.html_container"> | 
						<template id="top_selling_reports"> | 
				
			||||
            <t t-call="top_selling_product_report.internal_layout"> | 
							<t t-call="web.html_container"> | 
				
			||||
                <div class="page"> | 
								<!-- The "top_selling_product_report.internal_layout" template is used as the main layout for the report --> | 
				
			||||
                    <div class="oe_structure"/> | 
								<t t-call="top_selling_product_report.internal_layout"> | 
				
			||||
                    <center> | 
									<div class="page"> | 
				
			||||
                        <t t-if="other['least']"> | 
										<div class="oe_structure"/> | 
				
			||||
                        <h2 style="font-size:35px;"><b>Least Selling Products</b></h2> | 
										<center> | 
				
			||||
                        </t> | 
											<!-- Display report title based on whether it shows top-selling or least selling products --> | 
				
			||||
                        <t t-if="not other['least']"> | 
											<t t-if="other['least']"> | 
				
			||||
                            <h2 style="font-size:35px;"><b>Top Selling Products</b></h2> | 
												<h2 style="font-size:35px;"> | 
				
			||||
                        </t> | 
													<b>Least Selling Products</b> | 
				
			||||
                    </center> | 
												</h2> | 
				
			||||
                    <div class="oe_structure"/> | 
											</t> | 
				
			||||
                    <br /> | 
											<t t-if="not other['least']"> | 
				
			||||
                    <span> | 
												<h2 style="font-size:35px;"> | 
				
			||||
                        <t t-if="other['range']"> | 
													<b>Top Selling Products</b> | 
				
			||||
                            <b>Top Product of :</b> <t t-esc="other['range']"/><br /> | 
												</h2> | 
				
			||||
                        </t> | 
											</t> | 
				
			||||
                        <t t-if="other['date_selected_from']"> | 
										</center> | 
				
			||||
                            <b>Top Product of :</b> <t t-esc="other['date_selected_from']"/> To <t t-esc="other['date_selected_to']"/><br /> | 
										<div class="oe_structure"/> | 
				
			||||
                        </t> | 
										<br /> | 
				
			||||
                        <t t-if="other['limit']"> | 
										<span> | 
				
			||||
                            <b>Product Range :</b> <t t-esc="other['limit']"/> Products<br /> | 
											<!-- Display the date range or selected period for the report --> | 
				
			||||
                        </t> | 
											<t t-if="other['range']"> | 
				
			||||
                    </span> | 
												<b>Top Product of :</b> | 
				
			||||
                </div> | 
												<t t-esc="other['range']"/> | 
				
			||||
                <br /> | 
												<br /> | 
				
			||||
                <table class="table table-bordered" style="border: 1px solid #000;"> | 
											</t> | 
				
			||||
                    <tbody> | 
											<t t-if="other['date_selected_from']"> | 
				
			||||
                        <tr> | 
												<b>Top Product of :</b> | 
				
			||||
                            <th style="text-align: center;color: #000;text-color: #000;">Product</th> | 
												<t t-esc="other['date_selected_from']"/> To | 
				
			||||
                            <th style="text-align: center;color: #000;text-color: #000;">Sold Quantity</th> | 
												<t t-esc="other['date_selected_to']"/> | 
				
			||||
                            <th style="text-align: center;color: #000;text-color: #000;">UoM</th> | 
												<br /> | 
				
			||||
                        </tr> | 
											</t> | 
				
			||||
                        <tr t-foreach="data" t-as="value"> | 
											<!-- Display the number of products to show in the report --> | 
				
			||||
                          <td style="height:5px;color: #000;text-color: #000"><t t-esc="value['product_name']"/></td> | 
											<t t-if="other['limit']"> | 
				
			||||
                          <td style="height:5px;text-align: center;color: #000;text-color: #000;"><t t-esc="value['sum']"/></td> | 
												<b>Product Range :</b> | 
				
			||||
                          <td style="height:5x;text-align: center;color: #000;text-color: #000;"><t t-esc="value['name']"/></td> | 
												<t t-esc="other['limit']"/> Products | 
				
			||||
                       </tr> | 
												<br /> | 
				
			||||
                    </tbody> | 
											</t> | 
				
			||||
                </table> | 
										</span> | 
				
			||||
            </t> | 
									</div> | 
				
			||||
        </t> | 
									<br /> | 
				
			||||
    </template> | 
									<!-- Display the table containing the top-selling products data --> | 
				
			||||
    <template id="internal_layout"> | 
									<table class="table table-bordered" style="border: 1px solid #000;"> | 
				
			||||
        <t t-if="not o and doc"> | 
										<tbody> | 
				
			||||
            <t t-set="o" t-value="doc"/> | 
											<tr> | 
				
			||||
        </t> | 
												<th style="text-align: center;color: #000;text-color: #000;">Product</th> | 
				
			||||
 | 
												<th style="text-align: center;color: #000;text-color: #000;">Sold Quantity</th> | 
				
			||||
        <t t-if="o and 'company_id' in o"> | 
												<th style="text-align: center;color: #000;text-color: #000;">UoM</th> | 
				
			||||
            <t t-set="company" t-value="o.company_id.sudo()"/> | 
											</tr> | 
				
			||||
        </t> | 
											<!-- Loop through the data to display product information --> | 
				
			||||
        <t t-if="not o or not 'company_id' in o"> | 
											<tr t-foreach="data" t-as="value"> | 
				
			||||
            <t t-set="company" t-value="res_company"/> | 
												<td style="height:5px;color: #000;text-color: #000"> | 
				
			||||
        </t> | 
													<t t-esc="value['product_name']"/> | 
				
			||||
        <div class="header o_boxed_header"> | 
												</td> | 
				
			||||
        <div class="row mb8"> | 
												<td style="height:5px;text-align: center;color: #000;text-color: #000;"> | 
				
			||||
        <div class="col-xs-6"> | 
													<t t-esc="value['sold_quantity']"/> | 
				
			||||
            <img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/> | 
												</td> | 
				
			||||
        </div> | 
												<td style="height:5x;text-align: center;color: #000;text-color: #000;"> | 
				
			||||
        <div class="col-xs-6 text-right mb4"> | 
													<t t-esc="value['uom']"/> | 
				
			||||
         <h4 class="mt0" t-field="company.report_header"/> | 
												</td> | 
				
			||||
            <div name="company_address" class="mb4"> | 
											</tr> | 
				
			||||
                <span style="color: #000;font-color:#000000;" class="company_address" t-field="company.partner_id" | 
										</tbody> | 
				
			||||
 | 
									</table> | 
				
			||||
 | 
								</t> | 
				
			||||
 | 
							</t> | 
				
			||||
 | 
						</template> | 
				
			||||
 | 
						<!-- Template for the Internal Layout of the Report --> | 
				
			||||
 | 
						<template id="internal_layout"> | 
				
			||||
 | 
							<t t-if="not o and doc"> | 
				
			||||
 | 
								<t t-set="o" t-value="doc"/></t> | 
				
			||||
 | 
							<!-- Set the company variable based on the document's company_id if available --> | 
				
			||||
 | 
							<t t-if="o and 'company_id' in o"> | 
				
			||||
 | 
								<t t-set="company" t-value="o.company_id.sudo()"/></t> | 
				
			||||
 | 
							<!-- If company_id is not available, use the default company from "res_company" --> | 
				
			||||
 | 
							<t t-if="not o or not 'company_id' in o"> | 
				
			||||
 | 
								<t t-set="company" t-value="res_company"/></t> | 
				
			||||
 | 
							<!-- Header section of the report layout --> | 
				
			||||
 | 
							<div class="header o_boxed_header"> | 
				
			||||
 | 
								<div class="row mb8"> | 
				
			||||
 | 
									<div class="col-xs-6"> | 
				
			||||
 | 
										<!-- Display the company logo if available --> | 
				
			||||
 | 
										<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/> | 
				
			||||
 | 
									</div> | 
				
			||||
 | 
									<div class="col-xs-6 text-right mb4"> | 
				
			||||
 | 
										<!-- Display the company name and address --> | 
				
			||||
 | 
										<h4 class="mt0" t-field="company.report_header"/> | 
				
			||||
 | 
										<div name="company_address" class="mb4"> | 
				
			||||
 | 
											<span style="color: #000;font-color:#000000;" class="company_address" t-field="company.partner_id" | 
				
			||||
                t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/> | 
					                t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/> | 
				
			||||
                </div> | 
										</div> | 
				
			||||
            </div> | 
									</div> | 
				
			||||
            </div> | 
								</div> | 
				
			||||
            <div style="border-bottom: 1px solid black;"/> | 
								<div style="border-bottom: 1px solid black;"/></div> | 
				
			||||
            </div> | 
							<div class="article o_report_layout_background"> | 
				
			||||
            <div class="article o_report_layout_background"> | 
								<t t-raw="0" /> | 
				
			||||
            <t t-raw="0" /> | 
							</div> | 
				
			||||
            </div> | 
							<div class="footer"> | 
				
			||||
            <div class="footer"> | 
								<div class="text-center" style="border-top: 1px solid black;"> | 
				
			||||
                <div class="text-center" style="border-top: 1px solid black;"> | 
									<ul class="list-inline mb4"> | 
				
			||||
                <ul class="list-inline mb4"> | 
										<!-- Display company contact information --> | 
				
			||||
                <li t-if="company.phone">Phone: <span t-field="company.phone"/></li> | 
										<li t-if="company.phone">Phone: | 
				
			||||
                <li t-if="company.email">Email: <span t-field="company.email"/></li> | 
											<span t-field="company.phone"/> | 
				
			||||
                <li t-if="company.website">Web: <span t-field="company.website"/></li> | 
										</li> | 
				
			||||
                <li t-if="company.vat"><t t-esc="company.country_id.vat_label or 'TIN'"/>: <span t-field="company.vat"/></li> | 
										<li t-if="company.email">Email: | 
				
			||||
                </ul> | 
											<span t-field="company.email"/> | 
				
			||||
                <div name="financial_infos"> | 
										</li> | 
				
			||||
                <span t-field="company.report_footer"/> | 
										<li t-if="company.website">Web: | 
				
			||||
                </div> | 
											<span t-field="company.website"/> | 
				
			||||
                <div class="text-muted"> | 
										</li> | 
				
			||||
                Page: <span class="page"/> / <span class="topage"/> | 
										<li t-if="company.vat"> | 
				
			||||
            </div> | 
											<t t-esc="company.country_id.vat_label or 'TIN'"/>: | 
				
			||||
            </div> | 
											<span t-field="company.vat"/> | 
				
			||||
            </div> | 
										</li> | 
				
			||||
    </template> | 
									</ul> | 
				
			||||
 | 
									<div name="financial_infos"> | 
				
			||||
</odoo> | 
										<!-- Display additional financial information if available --> | 
				
			||||
 | 
										<span t-field="company.report_footer"/> | 
				
			||||
 | 
									</div> | 
				
			||||
 | 
									<div class="text-muted"> | 
				
			||||
 | 
										<!-- Display the current page and total pages of the report --> | 
				
			||||
 | 
					                Page: | 
				
			||||
 | 
										<span class="page"/> / | 
				
			||||
 | 
										<span class="topage"/> | 
				
			||||
 | 
									</div> | 
				
			||||
 | 
								</div> | 
				
			||||
 | 
							</div> | 
				
			||||
 | 
						</template> | 
				
			||||
 | 
					</odoo> | 
				
			||||
 | 
				
			|||||
		
		
			
  | 
					Loading…
					
					
				
		Reference in new issue