Skip to content

Commit

Permalink
[16.0][ADD] partner_invoicing_mode_at_shipping_by_partner_by_carrier
Browse files Browse the repository at this point in the history
  • Loading branch information
rousseldenis committed Jan 16, 2025
1 parent 18c9290 commit e5f7d0b
Show file tree
Hide file tree
Showing 12 changed files with 649 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
==============================================================
Partner Invoicing Mode At Shipping Group By Partner By Carrier
==============================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b83769b79c6e2dbf6e686c211541069b17c042a19582ccc533aa334f71497ba0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoicing/tree/16.0/partner_invoicing_mode_at_shipping_group_by_partner_by_carrier
:alt: OCA/account-invoicing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-partner_invoicing_mode_at_shipping_group_by_partner_by_carrier
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

As the ``stock_picking_group_by_partner_by_carrier`` module does not use
the ``sale_id`` field on the ``stock.picking`` module, there is no more
trigger to create the invoice at picking validation.

This module handles that use case restablishing the trigger.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20partner_invoicing_mode_at_shipping_group_by_partner_by_carrier%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ACSONE SA/NV

Contributors
------------

- Denis Roussel [email protected]

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/16.0/partner_invoicing_mode_at_shipping_group_by_partner_by_carrier>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Partner Invoicing Mode At Shipping Group By Partner By Carrier",
"summary": """This module allows to take into account the non use of
sale_id field on stock picking""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-invoicing",
"depends": [
"partner_invoicing_mode_at_shipping",
"stock_picking_group_by_partner_by_carrier",
],
"auto_install": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_picking
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class StockPicking(models.Model):

_inherit = "stock.picking"

def _invoice_at_shipping(self):
self.ensure_one()
# As we cannot base the logic on sale_id field (it is set to void in grouping module),
# and as the invoicing mode and one_invoice_per_shipping are commercial fields
# (same value for all partner hierarchy), we check if any value is set
return self.picking_type_code == "outgoing" and (
any(
(
partner.invoicing_mode == "at_shipping"
or partner.invoicing_mode.one_invoice_per_shipping
)
for partner in self.move_ids.sale_line_id.order_id.partner_invoice_id
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Denis Roussel <[email protected]>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
As the `stock_picking_group_by_partner_by_carrier` module does not use the `sale_id` field
on the `stock.picking` module, there is no more trigger to create the invoice at
picking validation.

This module handles that use case restablishing the trigger.
Loading

0 comments on commit e5f7d0b

Please sign in to comment.