[IMP] nfu_wholesaler_exporter: change limiter and visibility

This commit is contained in:
Niels Göttsch 2025-09-30 20:42:41 +02:00 committed by madmooose
parent 7c97f818f5
commit 155c91051a
7 changed files with 26 additions and 31 deletions

View file

@ -7,7 +7,7 @@ NFU Wholesaler Exporter
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f5c1fd3329fff4e1de63fae68edca9ba70a1f2444b6674d5fac9ede1a6ff1f94 !! source digest: sha256:28b8f6f6ee63fced0ebd3f78299f4d04bc9630718533ef7c93d34b67d335384e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@ -27,7 +27,7 @@ It exports the article number (default_code) and the qty of the Sale Order Batch
Product view. Product view.
Großhändler bieten die Möglichkeit Bestellungen als CSV hochzuladen. Dafür werden lediglich 2 Spalten benötigt Großhändler bieten die Möglichkeit Bestellungen als CSV hochzuladen. Dafür werden lediglich 2 Spalten benötigt
\|Artnr\|Menge\| \|Artnr\|Menge\|. Als Trennezeichen dient das ";"
* Artnr * Artnr
Artikelnummer beim Hersteller Artikelnummer beim Hersteller
@ -43,10 +43,11 @@ Großhändler bieten die Möglichkeit Bestellungen als CSV hochzuladen. Dafür w
Changelog Changelog
========= =========
:0.0.1: Initial module. - 16.0.0.0.1: Initial module.
:1.0.0: Adjust to Grell format specification - 16.0.1.0.0: Adjust to Grell format specification
:1.0.1: Rename to CSV Exporter - 16.0.1.0.1: Rename to CSV Exporter
:1.1.0: Add rounding for float values and remove zero lines - 16.0.1.1.0: Add rounding for float values and remove zero lines
- 16.0.1.2.0: Change limiter to ";" and only show exporter in closed state
Bug Tracker Bug Tracker
=========== ===========

View file

@ -4,7 +4,7 @@
"author": "BAKEUP", "author": "BAKEUP",
"website": "https://www.bakeup.org", "website": "https://www.bakeup.org",
"category": "Sale", "category": "Sale",
"version": "16.0.1.1.0", "version": "16.0.1.2.0",
"depends": ["sale_order_batch", "nfu_sale_order_batch_packaging"], "depends": ["sale_order_batch", "nfu_sale_order_batch_packaging"],
"data": ["views/sale_order_batch_views.xml"], "data": ["views/sale_order_batch_views.xml"],
"license": "LGPL-3", "license": "LGPL-3",

View file

@ -11,7 +11,7 @@ class SaleOrderBatch(models.Model):
def export_wholesaler_csv(self): def export_wholesaler_csv(self):
self.ensure_one() self.ensure_one()
# Prepare CSV content # Prepare CSV content
csv_content = "Artnr,Menge\n" csv_content = "Artnr;Menge\n"
for product in self.product_ids.filtered(lambda p: p.product_id.default_code): for product in self.product_ids.filtered(lambda p: p.product_id.default_code):
if not float_is_zero( if not float_is_zero(
product.product_uom_qty, product.product_uom_qty,
@ -29,7 +29,7 @@ class SaleOrderBatch(models.Model):
wholesaler_qty = int( wholesaler_qty = int(
round(product.product_uom_qty / product.product_packaging_qty) round(product.product_uom_qty / product.product_packaging_qty)
) )
csv_content += f"{product.product_id.default_code},{wholesaler_qty}\n" # noqa: E231 csv_content += f"{product.product_id.default_code};{wholesaler_qty}\n" # noqa: E702,E231
# Encode CSV content to base64 # Encode CSV content to base64
csv_base64 = base64.b64encode(csv_content.encode("utf-8")) csv_base64 = base64.b64encode(csv_content.encode("utf-8"))

View file

@ -3,7 +3,7 @@ It exports the article number (default_code) and the qty of the Sale Order Batch
Product view. Product view.
Großhändler bieten die Möglichkeit Bestellungen als CSV hochzuladen. Dafür werden lediglich 2 Spalten benötigt Großhändler bieten die Möglichkeit Bestellungen als CSV hochzuladen. Dafür werden lediglich 2 Spalten benötigt
\|Artnr\|Menge\| \|Artnr\|Menge\|. Als Trennezeichen dient das ";"
* Artnr * Artnr
Artikelnummer beim Hersteller Artikelnummer beim Hersteller

View file

@ -1,4 +1,5 @@
:0.0.1: Initial module. - 16.0.0.0.1: Initial module.
:1.0.0: Adjust to Grell format specification - 16.0.1.0.0: Adjust to Grell format specification
:1.0.1: Rename to CSV Exporter - 16.0.1.0.1: Rename to CSV Exporter
:1.1.0: Add rounding for float values and remove zero lines - 16.0.1.1.0: Add rounding for float values and remove zero lines
- 16.0.1.2.0: Change limiter to ";" and only show exporter in closed state

View file

@ -367,14 +367,14 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f5c1fd3329fff4e1de63fae68edca9ba70a1f2444b6674d5fac9ede1a6ff1f94 !! source digest: sha256:28b8f6f6ee63fced0ebd3f78299f4d04bc9630718533ef7c93d34b67d335384e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/bakeupboys/nfu/tree/16.0/nfu_wholesaler_exporter"><img alt="bakeupboys/nfu" src="https://img.shields.io/badge/github-bakeupboys%2Fnfu-lightgray.png?logo=github" /></a></p> <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/bakeupboys/nfu/tree/16.0/nfu_wholesaler_exporter"><img alt="bakeupboys/nfu" src="https://img.shields.io/badge/github-bakeupboys%2Fnfu-lightgray.png?logo=github" /></a></p>
<p>This module adds a CSV exporter action to Sale Order Batch module. <p>This module adds a CSV exporter action to Sale Order Batch module.
It exports the article number (default_code) and the qty of the Sale Order Batch It exports the article number (default_code) and the qty of the Sale Order Batch
Product view.</p> Product view.</p>
<p>Großhändler bieten die Möglichkeit Bestellungen als CSV hochzuladen. Dafür werden lediglich 2 Spalten benötigt <p>Großhändler bieten die Möglichkeit Bestellungen als CSV hochzuladen. Dafür werden lediglich 2 Spalten benötigt
|Artnr|Menge|</p> |Artnr|Menge|. Als Trennezeichen dient das “;”</p>
<ul class="simple"> <ul class="simple">
<li><dl class="first docutils"> <li><dl class="first docutils">
<dt>Artnr</dt> <dt>Artnr</dt>
@ -403,20 +403,13 @@ Das ist aktuell der default_code, falls wir den mal prefixen, muss das hier ange
</div> </div>
<div class="section" id="changelog"> <div class="section" id="changelog">
<h1><a class="toc-backref" href="#toc-entry-1">Changelog</a></h1> <h1><a class="toc-backref" href="#toc-entry-1">Changelog</a></h1>
<table class="docutils field-list" frame="void" rules="none"> <ul class="simple">
<col class="field-name" /> <li>16.0.0.0.1: Initial module.</li>
<col class="field-body" /> <li>16.0.1.0.0: Adjust to Grell format specification</li>
<tbody valign="top"> <li>16.0.1.0.1: Rename to CSV Exporter</li>
<tr class="field"><th class="field-name">0.0.1:</th><td class="field-body">Initial module.</td> <li>16.0.1.1.0: Add rounding for float values and remove zero lines</li>
</tr> <li>16.0.1.2.0: Change limiter to “;” and only show exporter in closed state</li>
<tr class="field"><th class="field-name">1.0.0:</th><td class="field-body">Adjust to Grell format specification</td> </ul>
</tr>
<tr class="field"><th class="field-name">1.0.1:</th><td class="field-body">Rename to CSV Exporter</td>
</tr>
<tr class="field"><th class="field-name">1.1.0:</th><td class="field-body">Add rounding for float values and remove zero lines</td>
</tr>
</tbody>
</table>
</div> </div>
<div class="section" id="bug-tracker"> <div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1> <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>

View file

@ -11,7 +11,7 @@
type="object" type="object"
string="Export Wholesaler CSV" string="Export Wholesaler CSV"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible': [('state', '=','open')]}" attrs="{'invisible': [('state', '!=','closed')]}"
/> />
</xpath> </xpath>
</field> </field>