Metadata-Version: 2.1
Name: odoo-addon-purchase_auto_bill_on_receipt
Version: 19.0.1.0.0.2
Requires-Dist: odoo==19.0.*
Summary: Automatically create and post Vendor Bills when receipts are validated
Home-page: https://github.com/OCA/purchase-workflow
License: AGPL-3
Author: Quartile, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 19.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

=============================
Purchase Auto Bill on Receipt
=============================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:e26d5d655ceaf1c1dbd21234d9c8c11cc2198ff27e23a758d9e4afa66fd01f9b
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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%2Fpurchase--workflow-lightgray.png?logo=github
    :target: https://github.com/OCA/purchase-workflow/tree/19.0/purchase_auto_bill_on_receipt
    :alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/purchase-workflow-19-0/purchase-workflow-19-0-purchase_auto_bill_on_receipt
    :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/purchase-workflow&target_branch=19.0
    :alt: Try me on Runboat

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

This module automatically creates and posts a Vendor Bill when a
purchase receipt is validated. It also creates and posts a Credit Note
when a purchase return is validated, provided the return lines are
marked as *Update quantities on SO/PO* in the return wizard.

**Table of contents**

.. contents::
   :local:

Configuration
=============

Whether a Purchase Order is auto-billed when its receipt is validated is
resolved from two configuration levels, plus a per-order kill switch:

1. **Company** → *Settings > Purchase > Invoicing > Auto Bill on
   Receipt* (boolean). Sets the default for all vendors.
2. **Vendor** → *Auto Bill on Receipt* (selection: *Auto* / *No Auto* /
   empty), on the vendor form. Leave empty to inherit from the company.
   *Auto* or *No Auto* overrides the company default for this vendor.
3. **Purchase Order** → *Block Auto Bill* (boolean, on the *Other
   Information* tab). When ticked, suppresses auto-billing for this
   order regardless of the company or vendor settings.

The bill date uses the timezone set on the company's contact. To set it,
install the
`partner_tz <https://github.com/OCA/partner-contact/tree/19.0/partner_tz>`__
module and configure the timezone on the company's contact.

Usage
=====

Once auto-billing is configured, validate a purchase receipt as usual. A
Vendor Bill is automatically created and posted shortly after via the
scheduled action. The bill only includes PO lines whose product bill
control policy is *On received quantities* and that have a positive
quantity to invoice.

**Returns / Credit Notes:** When a return is validated and its return
lines have *Update quantities on SO/PO* enabled in the return wizard, a
Credit Note is automatically created and posted for the returned
quantities. The credit note is only created when a Vendor Bill has
already been posted (i.e. the PO line has a negative *Quantity to
Invoice*).

The bill/credit note date is the receipt/return validation date
converted to the company's timezone (falls back to UTC when no timezone
is set).

If creation or posting fails, the error is logged in the Purchase Order
chatter and a To-Do activity is scheduled for follow-up.

**Case 1 — Cancelling an auto-bill:** An auto-posted bill can be
cancelled like any other Vendor Bill. However, the module will not
automatically create a new bill for the same receipt.

**Case 2 — Reprocessing an auto-bill:** This is not supported. Once the
scheduled action processes a receipt or return, it will not be picked up
again. To bill or refund the same quantities, create the document
manually from the Purchase Order.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/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/purchase-workflow/issues/new?body=module:%20purchase_auto_bill_on_receipt%0Aversion:%2019.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
-------

* Quartile

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

- `Quartile <https://www.quartile.co>`__:

  - Aung Ko Ko Lin
  - Yoshi Tashiro

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.

.. |maintainer-yostashiro| image:: https://github.com/yostashiro.png?size=40px
    :target: https://github.com/yostashiro
    :alt: yostashiro
.. |maintainer-aungkokolin1997| image:: https://github.com/aungkokolin1997.png?size=40px
    :target: https://github.com/aungkokolin1997
    :alt: aungkokolin1997

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

|maintainer-yostashiro| |maintainer-aungkokolin1997| 

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/19.0/purchase_auto_bill_on_receipt>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
