Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions purchase_auto_bill_on_receipt/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
.. 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:137338ab34ea871f820d22f70aaf33c322560ab59cfd7f7425b56ee6b4aacdf8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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.
1 change: 1 addition & 0 deletions purchase_auto_bill_on_receipt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions purchase_auto_bill_on_receipt/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2026 Quartile
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)

{
"name": "Purchase Auto Bill on Receipt",
"summary": "Automatically create and post Vendor Bills when receipts are validated",
"version": "19.0.1.0.0",
"author": "Quartile, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"license": "AGPL-3",
"category": "Purchase Management",
"depends": ["purchase_stock"],
"data": [
"data/ir_cron.xml",
"views/res_config_settings_views.xml",
"views/res_partner_views.xml",
"views/purchase_order_views.xml",
],
"maintainers": ["yostashiro", "aungkokolin1997"],
"installable": True,
}
12 changes: 12 additions & 0 deletions purchase_auto_bill_on_receipt/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="ir_cron_auto_bill" model="ir.cron">
<field name="name">Purchase: Auto Bill on Receipt</field>
<field name="model_id" ref="stock.model_stock_picking" />
<field name="state">code</field>
<field name="code">model._cron_auto_bill()</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="active" eval="True" />
</record>
</odoo>
187 changes: 187 additions & 0 deletions purchase_auto_bill_on_receipt/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_auto_bill_on_receipt
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ja_JP\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. module: purchase_auto_bill_on_receipt
#. odoo-python
#: code:addons/purchase_auto_bill_on_receipt/models/purchase_order.py:0
msgid "Auto %(doc)s creation failed on %(src)s %(picking)s: %(error)s"
msgstr "%(src)s %(picking)s での %(doc)s の自動作成に失敗しました: %(error)s"

#. module: purchase_auto_bill_on_receipt
#. odoo-python
#: code:addons/purchase_auto_bill_on_receipt/models/purchase_order.py:0
msgid "Auto %(doc)s creation failed — manual review needed"
msgstr "%(doc)s の自動作成に失敗しました — 手動確認が必要です"

#. module: purchase_auto_bill_on_receipt
#. odoo-python
#: code:addons/purchase_auto_bill_on_receipt/models/purchase_order.py:0
msgid ""
"Auto %(doc)s posting failed on %(src)s %(picking)s (%(doc)s %(bill)s remains"
" in draft): %(error)s"
msgstr ""
"%(src)s %(picking)s での %(doc)s の仕訳の自動作成に失敗しました (%(doc)s %(bill)s は下書きのままです): %(error)s"

#. module: purchase_auto_bill_on_receipt
#. odoo-python
#: code:addons/purchase_auto_bill_on_receipt/models/purchase_order.py:0
msgid "Auto %(doc)s posting failed — manual review needed"
msgstr "%(doc)s の仕訳の自動作成に失敗しました — 手動確認が必要です"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields.selection,name:purchase_auto_bill_on_receipt.selection__res_partner__auto_bill_on_receipt__auto
msgid "Auto Bill"
msgstr "自動請求書"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_stock_picking__auto_bill_pending
msgid "Auto Bill Pending"
msgstr "自動請求書保留中"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_res_company__auto_bill_on_receipt
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_res_config_settings__auto_bill_on_receipt
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_res_partner__auto_bill_on_receipt
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_res_users__auto_bill_on_receipt
msgid "Auto Bill on Purchase Receipt"
msgstr "購買入荷時の自動請求書"

#. module: purchase_auto_bill_on_receipt
#: model_terms:ir.ui.view,arch_db:purchase_auto_bill_on_receipt.res_config_settings_view_form
msgid ""
"Automatically create and post a Vendor Bill when a purchase receipt is "
"validated, and a Credit Note when a purchase return is validated. Can be "
"overridden per vendor."
msgstr ""
"購買入荷の確認時に仕入先請求書と仕訳を自動作成、購買返品の確認時にクレジットノートとその仕訳を自動作成します。仕入先ごとに上書き設定が可能です。"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_purchase_order__block_auto_bill
msgid "Block Auto Bill"
msgstr "自動請求書をブロック"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model,name:purchase_auto_bill_on_receipt.model_res_company
msgid "Companies"
msgstr "会社"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model,name:purchase_auto_bill_on_receipt.model_res_partner
msgid "Contact"
msgstr "連絡先"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_purchase_order__display_name
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_res_company__display_name
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_res_config_settings__display_name
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_res_partner__display_name
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_stock_picking__display_name
msgid "Display Name"
msgstr "表示名"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_purchase_order__id
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_res_company__id
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_res_config_settings__id
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_res_partner__id
#: model:ir.model.fields,field_description:purchase_auto_bill_on_receipt.field_stock_picking__id
msgid "ID"
msgstr "ID"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields.selection,name:purchase_auto_bill_on_receipt.selection__res_partner__auto_bill_on_receipt__no_auto
msgid "No Auto Bill"
msgstr "自動請求書なし"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields,help:purchase_auto_bill_on_receipt.field_res_partner__auto_bill_on_receipt
#: model:ir.model.fields,help:purchase_auto_bill_on_receipt.field_res_users__auto_bill_on_receipt
msgid ""
"Override the company default for auto-billing on purchase receipt. Leave "
"empty to inherit the company setting."
msgstr ""
"購買入荷時の自動請求書作成に関する会社のデフォルト設定を上書きします。会社の設定を継承するには空のままにしてください。"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model,name:purchase_auto_bill_on_receipt.model_res_config_settings
msgid "Procurement purchase grouping settings"
msgstr "調達購買グループ設定"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model,name:purchase_auto_bill_on_receipt.model_purchase_order
msgid "Purchase Order"
msgstr "購買オーダ"

#. module: purchase_auto_bill_on_receipt
#: model:ir.actions.server,name:purchase_auto_bill_on_receipt.ir_cron_auto_bill_ir_actions_server
msgid "Purchase: Auto Bill on Receipt"
msgstr "購買: 入荷時の自動請求書"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields,help:purchase_auto_bill_on_receipt.field_stock_picking__auto_bill_pending
msgid ""
"Set when a validated receipt or return is queued for auto-billing. The "
"scheduled action picks it up to create and post the Vendor Bill or Credit "
"Note."
msgstr ""
"確認済みの入荷または返品が自動請求書作成のキューに追加されたときにセットされます。スケジュールアクションがこれを取得し、仕入先請求書またはクレジットノートとその仕訳を作成します。"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model,name:purchase_auto_bill_on_receipt.model_stock_picking
msgid "Transfer"
msgstr "転送"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields,help:purchase_auto_bill_on_receipt.field_purchase_order__block_auto_bill
msgid ""
"When enabled, suppresses automatic bill creation on receipt for this order, "
"regardless of the company or vendor settings."
msgstr ""
"有効にすると、会社または仕入先の設定に関わらず、この注文の入荷時に自動請求書の作成を抑制します。"

#. module: purchase_auto_bill_on_receipt
#: model:ir.model.fields,help:purchase_auto_bill_on_receipt.field_res_company__auto_bill_on_receipt
#: model:ir.model.fields,help:purchase_auto_bill_on_receipt.field_res_config_settings__auto_bill_on_receipt
msgid ""
"When enabled, validating an incoming purchase receipt automatically creates "
"and posts a Vendor Bill. This is the default for all vendors and can be "
"overridden per vendor."
msgstr ""
"有効にすると、仕入入荷の確認時に自動的に仕入先請求書と仕訳を作成します。これはすべての仕入先のデフォルト設定であり、仕入先ごとに上書きできます。"

#. module: purchase_auto_bill_on_receipt
#. odoo-python
#: code:addons/purchase_auto_bill_on_receipt/models/purchase_order.py:0
msgid "bill"
msgstr "請求書"

#. module: purchase_auto_bill_on_receipt
#. odoo-python
#: code:addons/purchase_auto_bill_on_receipt/models/purchase_order.py:0
msgid "credit note"
msgstr "クレジットノート"

#. module: purchase_auto_bill_on_receipt
#. odoo-python
#: code:addons/purchase_auto_bill_on_receipt/models/purchase_order.py:0
msgid "receipt"
msgstr "入荷"

#. module: purchase_auto_bill_on_receipt
#. odoo-python
#: code:addons/purchase_auto_bill_on_receipt/models/purchase_order.py:0
msgid "return"
msgstr "返品"
Loading
Loading