Skip to content
Extraits de code Groupes Projets
Valider 874d2572 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[update] compo report + file reorganization

parent e8e18860
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -5,7 +5,7 @@ exclude: |
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
# We don't want to mess with tool-generated files
.svg$|/tests/([^/]+/)?cassettes/|
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
# Library files can have extraneous formatting (even minimized)
/static/(src/)?lib/|
# Repos using Sphinx to generate docs don't need prettying
......@@ -26,10 +26,12 @@ repos:
language: fail
files: "\\.rej$"
- repo: https://github.com/oca/maintainer-tools
rev: ab1d7f6
rev: 7d8a9f9ad73db0976fb03cbee43d953bc29b89e9
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
- id: oca-fix-manifest-website
args: ["https://le-filament.com"]
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
......@@ -42,11 +44,11 @@ repos:
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.1.2
rev: v2.6.2
hooks:
- id: prettier
name: prettier (with plugin-xml)
......@@ -57,7 +59,7 @@ repos:
- --plugin=@prettier/plugin-xml
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v7.8.1
rev: v8.15.0
hooks:
- id: eslint
verbose: true
......@@ -65,7 +67,7 @@ repos:
- --color
- --fix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.2.0
hooks:
- id: trailing-whitespace
# exclude autogenerated files
......@@ -87,12 +89,12 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v2.32.1
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/PyCQA/isort
rev: 5.5.1
rev: 5.10.1
hooks:
- id: isort
name: isort except __init__.py
......@@ -100,13 +102,13 @@ repos:
- --settings=.
exclude: /__init__\.py$
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.8.3
rev: 3.9.2
hooks:
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==20.1.4"]
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.5.3
rev: v2.11.1
hooks:
- id: pylint
name: pylint with optional checks
......@@ -115,7 +117,7 @@ repos:
- --exit-zero
verbose: true
additional_dependencies: &pylint_deps
- pylint-odoo==3.5.0
- pylint-odoo==5.0.5
- id: pylint
name: pylint with mandatory checks
args:
......
......@@ -7,14 +7,18 @@
"depends": ["web", "ap_sale_project"],
"qweb": [],
"data": [
# datas
"data/paperformat_data.xml",
"views/res_company_views.xml",
"views/report_templates.xml",
"views/report_sale.xml",
"views/report_account.xml",
"data/report_layout.xml",
"views/report_compositions.xml",
"views/report_composition_templates.xml",
"views/report_delivery_ap_template.xml",
"data/ir_actions_report.xml",
# templates
"templates/assets.xml",
"templates/report_layout.xml",
"templates/report_sale.xml",
"templates/report_account.xml",
"templates/report_composition.xml",
"templates/report_delivery_ap_template.xml",
# views
"views/res_company_views.xml",
],
}
......@@ -5,7 +5,6 @@
<record id="action_compostion" model="ir.actions.report">
<field name="name">Compositions</field>
<field name="model">sale.order</field>
<!-- <field name="report_type">qweb-html</field>-->
<field name="report_type">qweb-pdf</field>
<field name="report_name">ap_report.report_composition</field>
<field name="report_file">ap_report.report_composition</field>
......
......@@ -13,7 +13,7 @@
<field name="margin_left">7</field>
<field name="margin_right">7</field>
<field name="header_line" eval="False" />
<field name="header_spacing">15</field>
<field name="header_spacing">0</field>
<field name="dpi">90</field>
</record>
......
......@@ -10,12 +10,5 @@
<field name="pdf">/ap_report/static/pdf/preview_generic.pdf</field>
</record>
<record id="ap_report_layout_compo" model="report.layout">
<field name="name">Arbre et Paysage Composition</field>
<field name="sequence">6</field>
<field name="view_id" ref="ap_report.ap_external_layout_generic_compo" />
<field name="image">/ap_report/static/src/img/preview_generic.png</field>
<field name="pdf">/ap_report/static/pdf/preview_generic.pdf</field>
</record>
</data>
</odoo>
......@@ -18,49 +18,30 @@ address .align-items-baseline {
font-size: 15px !important;
}
.o_report_layout_boxed .row > div > table.table-compo tr:last-child td {
background-color: inherit !important;
color: inherit !important;
}
.o_report_layout_boxed .row > div > table.table-compo tr:last-child td:first-child {
border-right: 1px solid #495057;
}
.o_report_layout_boxed table.table-compo tbody tr td {
font-size: 14px !important;
border-top: 1px solid;
border-right: 1px solid #495057;
}
.o_report_layout_boxed
.row:not(#total)
> div
> table.table-compo
tr:not(:first-child):not(:last-child)
td:last-child {
background-color: inherit !important;
}
.o_report_layout_boxed .table-prepa tbody td {
font-size: 17px;
border: 1px solid #495057;
}
.o_report_layout_boxed
.row:not(#total)
> div
> table.table-compo
tbody
tr:not(:last-child)
td:last-child {
background-color: #fff !important;
}
.o_boxed_footer_compo {
font-size: 12px !important;
}
/***
Compositions
***/
.header_compo,
.footer-compo {
font-size: 12px;
}
.o_report_compo {
font-size: 14px !important;
font-size: 12px !important;
}
.table-compo td {
color: #000 !important;
font-size: 11px;
border: thin solid #000;
padding: 2px;
padding-left: 5px;
padding-right: 5px;
}
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Assets for reports -->
<template id="report_assets_common" inherit_id="web.report_assets_common">
<xpath expr="." position="inside">-->
<link
rel="stylesheet"
type="text/scss"
href="/ap_report/static/src/scss/layout_generic.scss"
/>
</xpath>
</template>
</odoo>
Fichier déplacé
......@@ -4,13 +4,14 @@
<template id="report_picking" inherit_id="stock.report_picking">
<div class="page" position="replace">
<h1 class="mt0 mb-2 text-center">Bon de préparation</h1>
<h1 class="mt0 mb-6 text-center">Bon de préparation</h1>
<hr />
<div class="page">
<div class="row">
<div class="col-8" name="div_outgoing_address">
<h2>
<h4>
<span>Devis N° </span><span t-field="o.origin" />
</h2>
</h4>
<div class="mw-100 mb-3">
<p class="m-0">Du <span
t-field="o.scheduled_date"
......@@ -25,6 +26,7 @@
class="m-0"
>Longueur de Haie: <span
t-field="o.intervention_length"
t-options="{'widget': 'float', 'precision': 0}"
/><span> m</span></p>
<p
t-if="o.plant_qty"
......@@ -59,33 +61,23 @@
</thead>
<tbody>
<t t-set="product_category" t-value="[]" />
<t t-foreach="o.move_ids_without_package" t-as="l">
<t
t-set="product_category"
t-value="product_category+[l.product_id.categ_id.parent_id]"
/>
</t>
<t t-foreach="set(product_category)" t-as="category">
<tr>
<td />
<td>
<td colspan="3">
<div><strong t-esc="category.name" /></div>
</td>
<td>
</td>
</tr>
<t t-foreach="o.move_ids_without_package" t-as="l">
<t
t-if="category.id==l.product_id.categ_id.parent_id.id"
>
<tr>
<td />
<td>
......@@ -100,18 +92,22 @@
<span
t-if="l.state != 'done'"
t-field="l.product_uom_qty"
t-options="{'widget': 'float', 'precision': 0}"
/>
<span
t-if="l.state == 'done'"
t-field="l.quantity_done"
t-options="{'widget': 'float', 'precision': 0}"
/>
<span
t-if="l.product_uom.id != %(uom.product_uom_unit)d"
t-field="l.product_uom"
/>
<span t-field="l.product_uom" />
</td>
</tr>
</t>
</t>
</t>
</tbody>
</table>
</div>
......
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Assets for reports -->
<template id="report_assets_common" inherit_id="web.report_assets_common">
<xpath expr="." position="inside">-->
<link
rel="stylesheet"
type="text/scss"
href="/ap_report/static/src/scss/layout_generic.scss"
/>
</xpath>
</template>
<template id="ap_external_layout_generic">
<div
......@@ -98,56 +88,7 @@
</div>
</template>
<template id="ap_external_layout_generic_compo">
<div
t-attf-class="article o_report_layout_boxed o_report_compo o_company_#{company.id}_layout"
t-att-data-oe-model="o and o._name"
t-att-data-oe-id="o and o.id"
t-att-data-oe-lang="o and o.env.context.get('lang')"
>
<div class="pt-1">
<!-- This div ensures that the address is not cropped by the header. -->
<t t-call="web.address_layout" />
</div>
<t t-raw="0" />
</div>
<div
t-attf-class="footer o_boxed_footer o_boxed_footer_compo o_company_#{company.id}_layout"
>
<div class="text-center">
<ul class="list-inline">
<li class="list-inline-item">
<t t-if="company.phone"><span
class="o_force_ltr"
t-field="company.phone"
/></t>
<t t-if="company.email"> - <span t-field="company.email" /></t>
<t t-if="company.website"> - <span
t-field="company.website"
/></t>
<t t-if="company.vat"> - <t
t-esc="company.country_id.vat_label or 'Tax ID'"
/>: <span t-field="company.vat" /></t>
<t t-if="company.company_type"><span
t-field="company.company_type"
/></t>
<t t-if="company.siret"> - SIRET: <span
t-field="company.siret"
/></t>
<t t-if="company.ape"> - Code NAF: <span
t-field="company.ape"
/></t>
</li>
</ul>
<div t-if="report_type == 'pdf'" class="text-muted">
Page: <span class="page" /> / <span class="topage" />
</div>
</div>
</div>
</template>
<template id="external_layout_spe">
<template id="external_layout_compo">
<t t-if="not o" t-set="o" t-value="doc" />
<t t-if="not company">
......@@ -163,7 +104,9 @@
</t>
</t>
<t t-call="ap_report.ap_external_layout_generic_compo"><t t-raw="0" /></t>
<t t-call="ap_report.external_layout_generic_compo">
<t t-raw="0" />
</t>
</template>
......
Fichier déplacé
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter