Skip to content

Commit

Permalink
Merge PR #3980 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by Borruso
  • Loading branch information
OCA-git-bot committed Feb 27, 2024
2 parents 0067dac + 0facfde commit ba48711
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 6 deletions.
13 changes: 11 additions & 2 deletions l10n_it_delivery_note_batch/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ITA - Documento di trasporto - Prelievo raggruppato
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:da84c4e3f2b1dd4e2cad2e8fd1ae8f735d8d9482b001d44e5232921ada784585
!! source digest: sha256:18e79c58d25911c3da9c99aad726d0b1bcd4a9755a5bfa7adfe336deb223936c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -96,10 +96,19 @@ promote its widespread use.
.. |maintainer-Borruso| image:: https://github.com/Borruso.png?size=40px
:target: https://github.com/Borruso
:alt: Borruso
.. |maintainer-aleuffre| image:: https://github.com/aleuffre.png?size=40px
:target: https://github.com/aleuffre
:alt: aleuffre
.. |maintainer-PicchiSeba| image:: https://github.com/PicchiSeba.png?size=40px
:target: https://github.com/PicchiSeba
:alt: PicchiSeba
.. |maintainer-renda-dev| image:: https://github.com/renda-dev.png?size=40px
:target: https://github.com/renda-dev
:alt: renda-dev

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-MarcoCalcagni| |maintainer-TheMule71| |maintainer-Borruso|
|maintainer-MarcoCalcagni| |maintainer-TheMule71| |maintainer-Borruso| |maintainer-aleuffre| |maintainer-PicchiSeba| |maintainer-renda-dev|

This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_delivery_note_batch>`_ project on GitHub.

Expand Down
9 changes: 8 additions & 1 deletion l10n_it_delivery_note_batch/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
"version": "16.0.1.0.1",
"category": "Localization/Italy",
"license": "AGPL-3",
"maintainers": ["MarcoCalcagni", "TheMule71", "Borruso"],
"maintainers": [
"MarcoCalcagni",
"TheMule71",
"Borruso",
"aleuffre",
"PicchiSeba",
"renda-dev",
],
"depends": [
"stock",
"stock_picking_batch",
Expand Down
9 changes: 9 additions & 0 deletions l10n_it_delivery_note_batch/models/stock_picking_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,20 @@ class StockPickingBatch(models.Model):
)

delivery_note_count = fields.Integer(compute="_compute_delivery_note_count")
all_pickings_have_delivery_note = fields.Boolean(
compute="_compute_all_pickings_have_delivery_note"
)

def _compute_delivery_note_count(self):
for rec in self:
rec.delivery_note_count = len(rec.delivery_note_ids)

def _compute_all_pickings_have_delivery_note(self):
for rec in self:
rec.all_pickings_have_delivery_note = all(
p.delivery_note_id for p in rec.picking_ids
)

def create_delivery_notes(self, **kwargs):
for rec in self:
if rec.state != "done":
Expand Down
4 changes: 2 additions & 2 deletions l10n_it_delivery_note_batch/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ <h1 class="title">ITA - Documento di trasporto - Prelievo raggruppato</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:da84c4e3f2b1dd4e2cad2e8fd1ae8f735d8d9482b001d44e5232921ada784585
!! source digest: sha256:18e79c58d25911c3da9c99aad726d0b1bcd4a9755a5bfa7adfe336deb223936c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_delivery_note_batch"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_delivery_note_batch"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><strong>Italiano</strong></p>
Expand Down Expand Up @@ -424,7 +424,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/MarcoCalcagni"><img alt="MarcoCalcagni" src="https://github.com/MarcoCalcagni.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/TheMule71"><img alt="TheMule71" src="https://github.com/TheMule71.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/Borruso"><img alt="Borruso" src="https://github.com/Borruso.png?size=40px" /></a></p>
<p><a class="reference external image-reference" href="https://github.com/MarcoCalcagni"><img alt="MarcoCalcagni" src="https://github.com/MarcoCalcagni.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/TheMule71"><img alt="TheMule71" src="https://github.com/TheMule71.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/Borruso"><img alt="Borruso" src="https://github.com/Borruso.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/aleuffre"><img alt="aleuffre" src="https://github.com/aleuffre.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/PicchiSeba"><img alt="PicchiSeba" src="https://github.com/PicchiSeba.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/renda-dev"><img alt="renda-dev" src="https://github.com/renda-dev.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_delivery_note_batch">OCA/l10n-italy</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@
<field name="model">stock.picking.batch</field>
<field name="inherit_id" ref="stock_picking_batch.stock_picking_batch_form" />
<field name="arch" type="xml">
<header position="inside">
<field name="all_pickings_have_delivery_note" invisible="1" />
</header>
<xpath expr="//button[@name='action_print']" position="before">
<button
class="oe_highlight"
name="create_delivery_notes"
type="object"
string="Create DNs"
style="margin-left:10px;"
attrs="{'invisible': [('state', '!=', 'done')]}"
attrs="{'invisible': [
'|',
('state', '=', 'done'),
('all_pickings_have_delivery_note', '=', True)
]}"
/>
<!-- attrs="{'invisible': ['|', ('state', '!=', 'done'), ('delivery_note_count', '!=', 0)]}" -->
</xpath>
Expand Down

0 comments on commit ba48711

Please sign in to comment.