odoo-addon-purchase-billing-address 17.0.1.0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/purchase_billing_address/README.rst +122 -0
- odoo/addons/purchase_billing_address/__init__.py +4 -0
- odoo/addons/purchase_billing_address/__manifest__.py +18 -0
- odoo/addons/purchase_billing_address/i18n/purchase_billing_address.pot +60 -0
- odoo/addons/purchase_billing_address/models/__init__.py +5 -0
- odoo/addons/purchase_billing_address/models/purchase_order.py +57 -0
- odoo/addons/purchase_billing_address/models/res_partner.py +13 -0
- odoo/addons/purchase_billing_address/readme/CONTRIBUTORS.md +2 -0
- odoo/addons/purchase_billing_address/readme/DESCRIPTION.md +1 -0
- odoo/addons/purchase_billing_address/readme/USAGE.md +31 -0
- odoo/addons/purchase_billing_address/static/description/icon.png +0 -0
- odoo/addons/purchase_billing_address/static/description/index.html +477 -0
- odoo/addons/purchase_billing_address/static/img/readme/ADDRESS_PURCHASE.png +0 -0
- odoo/addons/purchase_billing_address/static/img/readme/PURCHASE_INVOICE.png +0 -0
- odoo/addons/purchase_billing_address/static/img/readme/SELECT_ADDRESS_PURCHASE.png +0 -0
- odoo/addons/purchase_billing_address/tests/__init__.py +5 -0
- odoo/addons/purchase_billing_address/tests/test_purchase_invoice_partner_type.py +67 -0
- odoo/addons/purchase_billing_address/views/purchase_order_views.xml +24 -0
- odoo_addon_purchase_billing_address-17.0.1.0.0.2.dist-info/METADATA +138 -0
- odoo_addon_purchase_billing_address-17.0.1.0.0.2.dist-info/RECORD +22 -0
- odoo_addon_purchase_billing_address-17.0.1.0.0.2.dist-info/WHEEL +5 -0
- odoo_addon_purchase_billing_address-17.0.1.0.0.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
.. image:: https://odoo-community.org/readme-banner-image
|
|
2
|
+
:target: https://odoo-community.org/get-involved?utm_source=readme
|
|
3
|
+
:alt: Odoo Community Association
|
|
4
|
+
|
|
5
|
+
========================
|
|
6
|
+
Purchase billing address
|
|
7
|
+
========================
|
|
8
|
+
|
|
9
|
+
..
|
|
10
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
11
|
+
!! This file is generated by oca-gen-addon-readme !!
|
|
12
|
+
!! changes will be overwritten. !!
|
|
13
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
14
|
+
!! source digest: sha256:93a27a2e91961c1fb66e81f5db577c8ee0f68560fdc2f0637d7f032fc0abcdd2
|
|
15
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
16
|
+
|
|
17
|
+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
18
|
+
:target: https://odoo-community.org/page/development-status
|
|
19
|
+
:alt: Beta
|
|
20
|
+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
|
21
|
+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
22
|
+
:alt: License: AGPL-3
|
|
23
|
+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
|
|
24
|
+
:target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_billing_address
|
|
25
|
+
:alt: OCA/purchase-workflow
|
|
26
|
+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
27
|
+
:target: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_billing_address
|
|
28
|
+
:alt: Translate me on Weblate
|
|
29
|
+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
30
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=17.0
|
|
31
|
+
:alt: Try me on Runboat
|
|
32
|
+
|
|
33
|
+
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
34
|
+
|
|
35
|
+
This module allows you to add a billing address to purchase orders.
|
|
36
|
+
|
|
37
|
+
**Table of contents**
|
|
38
|
+
|
|
39
|
+
.. contents::
|
|
40
|
+
:local:
|
|
41
|
+
|
|
42
|
+
Usage
|
|
43
|
+
=====
|
|
44
|
+
|
|
45
|
+
Purchase billing contact
|
|
46
|
+
------------------------
|
|
47
|
+
|
|
48
|
+
- Go to *Purchase* > *Orders* > *Vendors*
|
|
49
|
+
- Select or create a supplier.
|
|
50
|
+
- Go to the Contacts and Addresses tab, add a new one, select the
|
|
51
|
+
*Purchase invoice address* type, and fill in the *email* field.
|
|
52
|
+
|ADDRESS_PURCHASE|
|
|
53
|
+
- Save the contact.
|
|
54
|
+
|
|
55
|
+
Select a billing address on purchase orders
|
|
56
|
+
-------------------------------------------
|
|
57
|
+
|
|
58
|
+
- Go to *Purchase* > *Orders* > *Request for Quotation*
|
|
59
|
+
- Select or create a purchase order.
|
|
60
|
+
- Select a supplier. If they have a *Purchase invoice address*, the
|
|
61
|
+
first option will be displayed, but you can change the default.
|
|
62
|
+
|SELECT_ADDRESS_PURCHASE|
|
|
63
|
+
- Complete all other fields in the order.
|
|
64
|
+
- Confirm the order.
|
|
65
|
+
- When creating the invoice, check whether a billing address is selected
|
|
66
|
+
and assign it to the invoice. If not, follow the normal Purchase Order
|
|
67
|
+
process. |PURCHASE_INVOICE|
|
|
68
|
+
|
|
69
|
+
Billing address selection order.
|
|
70
|
+
--------------------------------
|
|
71
|
+
|
|
72
|
+
1. First, we search to see if there is a *Purchase invoice address* type
|
|
73
|
+
contact among the selected supplier's contacts.
|
|
74
|
+
2. If none exist in the previous step, the supplier's contacts, i.e.,
|
|
75
|
+
secondary contacts, are searched using the same criteria as above.
|
|
76
|
+
3. If none are met, the same supplier is selected.
|
|
77
|
+
|
|
78
|
+
.. |ADDRESS_PURCHASE| image:: https://raw.githubusercontent.com/OCA/purchase-workflow/17.0/purchase_billing_address/static/img/readme/ADDRESS_PURCHASE.png
|
|
79
|
+
.. |SELECT_ADDRESS_PURCHASE| image:: https://raw.githubusercontent.com/OCA/purchase-workflow/17.0/purchase_billing_address/static/img/readme/SELECT_ADDRESS_PURCHASE.png
|
|
80
|
+
.. |PURCHASE_INVOICE| image:: https://raw.githubusercontent.com/OCA/purchase-workflow/17.0/purchase_billing_address/static/img/readme/PURCHASE_INVOICE.png
|
|
81
|
+
|
|
82
|
+
Bug Tracker
|
|
83
|
+
===========
|
|
84
|
+
|
|
85
|
+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
|
|
86
|
+
In case of trouble, please check there if your issue has already been reported.
|
|
87
|
+
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
88
|
+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_billing_address%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
89
|
+
|
|
90
|
+
Do not contact contributors directly about support or help with technical issues.
|
|
91
|
+
|
|
92
|
+
Credits
|
|
93
|
+
=======
|
|
94
|
+
|
|
95
|
+
Authors
|
|
96
|
+
-------
|
|
97
|
+
|
|
98
|
+
* Binhex <https://www.binhex.cloud>
|
|
99
|
+
|
|
100
|
+
Contributors
|
|
101
|
+
------------
|
|
102
|
+
|
|
103
|
+
- [Binhex] (https://www.binhex.cloud):
|
|
104
|
+
|
|
105
|
+
- Edilio Escalona Almira e.escalona@binhex.cloud
|
|
106
|
+
|
|
107
|
+
Maintainers
|
|
108
|
+
-----------
|
|
109
|
+
|
|
110
|
+
This module is maintained by the OCA.
|
|
111
|
+
|
|
112
|
+
.. image:: https://odoo-community.org/logo.png
|
|
113
|
+
:alt: Odoo Community Association
|
|
114
|
+
:target: https://odoo-community.org
|
|
115
|
+
|
|
116
|
+
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
117
|
+
mission is to support the collaborative development of Odoo features and
|
|
118
|
+
promote its widespread use.
|
|
119
|
+
|
|
120
|
+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/17.0/purchase_billing_address>`_ project on GitHub.
|
|
121
|
+
|
|
122
|
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Copyright 2025 Binhex <https://www.binhex.cloud>
|
|
2
|
+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
3
|
+
|
|
4
|
+
{
|
|
5
|
+
"name": "Purchase billing address",
|
|
6
|
+
"summary": """Create a new partner type (purchase), to differentiate
|
|
7
|
+
the purchase order and invoice addresses.""",
|
|
8
|
+
"version": "17.0.1.0.0",
|
|
9
|
+
"license": "AGPL-3",
|
|
10
|
+
"author": "Binhex <https://www.binhex.cloud>,Odoo Community Association (OCA)",
|
|
11
|
+
"website": "https://github.com/OCA/purchase-workflow",
|
|
12
|
+
"depends": [
|
|
13
|
+
"purchase",
|
|
14
|
+
],
|
|
15
|
+
"data": [
|
|
16
|
+
"views/purchase_order_views.xml",
|
|
17
|
+
],
|
|
18
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Translation of Odoo Server.
|
|
2
|
+
# This file contains the translation of the following modules:
|
|
3
|
+
# * purchase_billing_address
|
|
4
|
+
#
|
|
5
|
+
msgid ""
|
|
6
|
+
msgstr ""
|
|
7
|
+
"Project-Id-Version: Odoo Server 17.0\n"
|
|
8
|
+
"Report-Msgid-Bugs-To: \n"
|
|
9
|
+
"Last-Translator: \n"
|
|
10
|
+
"Language-Team: \n"
|
|
11
|
+
"MIME-Version: 1.0\n"
|
|
12
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
13
|
+
"Content-Transfer-Encoding: \n"
|
|
14
|
+
"Plural-Forms: \n"
|
|
15
|
+
|
|
16
|
+
#. module: purchase_billing_address
|
|
17
|
+
#: model:ir.model.fields,help:purchase_billing_address.field_res_partner__type
|
|
18
|
+
#: model:ir.model.fields,help:purchase_billing_address.field_res_users__type
|
|
19
|
+
msgid ""
|
|
20
|
+
"- Contact: Use this to organize the contact details of employees of a given company (e.g. CEO, CFO, ...).\n"
|
|
21
|
+
"- Invoice Address: Preferred address for all invoices. Selected by default when you invoice an order that belongs to this company.\n"
|
|
22
|
+
"- Delivery Address: Preferred address for all deliveries. Selected by default when you deliver an order that belongs to this company.\n"
|
|
23
|
+
"- Other: Other address for the company (e.g. subsidiary, ...)"
|
|
24
|
+
msgstr ""
|
|
25
|
+
|
|
26
|
+
#. module: purchase_billing_address
|
|
27
|
+
#: model:ir.model.fields,field_description:purchase_billing_address.field_res_partner__type
|
|
28
|
+
#: model:ir.model.fields,field_description:purchase_billing_address.field_res_users__type
|
|
29
|
+
msgid "Address Type"
|
|
30
|
+
msgstr ""
|
|
31
|
+
|
|
32
|
+
#. module: purchase_billing_address
|
|
33
|
+
#: model:ir.model.fields,field_description:purchase_billing_address.field_purchase_order__available_partner_invoice_ids
|
|
34
|
+
msgid "Allowed invoice addresses"
|
|
35
|
+
msgstr ""
|
|
36
|
+
|
|
37
|
+
#. module: purchase_billing_address
|
|
38
|
+
#: model:ir.model,name:purchase_billing_address.model_res_partner
|
|
39
|
+
msgid "Contact"
|
|
40
|
+
msgstr ""
|
|
41
|
+
|
|
42
|
+
#. module: purchase_billing_address
|
|
43
|
+
#: model:ir.model.fields,field_description:purchase_billing_address.field_purchase_order__partner_invoice_id
|
|
44
|
+
msgid "Invoice address"
|
|
45
|
+
msgstr ""
|
|
46
|
+
|
|
47
|
+
#. module: purchase_billing_address
|
|
48
|
+
#: model:ir.model.fields,help:purchase_billing_address.field_purchase_order__partner_invoice_id
|
|
49
|
+
msgid "Invoice address for this purchase order"
|
|
50
|
+
msgstr ""
|
|
51
|
+
|
|
52
|
+
#. module: purchase_billing_address
|
|
53
|
+
#: model:ir.model,name:purchase_billing_address.model_purchase_order
|
|
54
|
+
msgid "Purchase Order"
|
|
55
|
+
msgstr ""
|
|
56
|
+
|
|
57
|
+
#. module: purchase_billing_address
|
|
58
|
+
#: model:ir.model.fields.selection,name:purchase_billing_address.selection__res_partner__type__purchase_invoice
|
|
59
|
+
msgid "Purchase invoice address"
|
|
60
|
+
msgstr ""
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Copyright 2025 Binhex <https://www.binhex.cloud>
|
|
2
|
+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
3
|
+
|
|
4
|
+
from odoo import Command, api, fields, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class PurchaseOrder(models.Model):
|
|
8
|
+
_inherit = "purchase.order"
|
|
9
|
+
|
|
10
|
+
available_partner_invoice_ids = fields.Many2many(
|
|
11
|
+
comodel_name="res.partner",
|
|
12
|
+
string="Allowed invoice addresses",
|
|
13
|
+
compute="_compute_available_partner_invoice_ids",
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
partner_invoice_id = fields.Many2one(
|
|
17
|
+
comodel_name="res.partner",
|
|
18
|
+
string="Invoice address",
|
|
19
|
+
help="Invoice address for this purchase order",
|
|
20
|
+
domain="[('id', 'in', available_partner_invoice_ids)]",
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
def _address_purchase_invoice_get(self):
|
|
24
|
+
child_ids = self.partner_id.child_ids
|
|
25
|
+
partner_invoice_ids = child_ids.filtered(
|
|
26
|
+
lambda child: child.type == "purchase_invoice"
|
|
27
|
+
)
|
|
28
|
+
if not partner_invoice_ids:
|
|
29
|
+
partner_invoice_ids = child_ids.child_ids.filtered(
|
|
30
|
+
lambda child: child.type == "purchase_invoice"
|
|
31
|
+
)
|
|
32
|
+
return partner_invoice_ids.ids
|
|
33
|
+
|
|
34
|
+
@api.onchange("partner_id")
|
|
35
|
+
def onchange_partner_id(self):
|
|
36
|
+
result = super().onchange_partner_id()
|
|
37
|
+
for order in self:
|
|
38
|
+
purchase_invoice_address = order._address_purchase_invoice_get()
|
|
39
|
+
order.partner_invoice_id = (
|
|
40
|
+
purchase_invoice_address[0]
|
|
41
|
+
if purchase_invoice_address
|
|
42
|
+
else order.partner_id.id
|
|
43
|
+
)
|
|
44
|
+
return result
|
|
45
|
+
|
|
46
|
+
@api.depends("partner_id")
|
|
47
|
+
def _compute_available_partner_invoice_ids(self):
|
|
48
|
+
for order in self:
|
|
49
|
+
order.available_partner_invoice_ids = [
|
|
50
|
+
Command.set(order._address_purchase_invoice_get())
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
def _prepare_invoice(self):
|
|
54
|
+
res = super()._prepare_invoice()
|
|
55
|
+
if self.partner_invoice_id:
|
|
56
|
+
res["partner_id"] = self.partner_invoice_id.id
|
|
57
|
+
return res
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Copyright 2025 Binhex <https://www.binhex.cloud>
|
|
2
|
+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
3
|
+
|
|
4
|
+
from odoo import fields, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ResPartner(models.Model):
|
|
8
|
+
_inherit = "res.partner"
|
|
9
|
+
|
|
10
|
+
type = fields.Selection(
|
|
11
|
+
selection_add=[("purchase_invoice", "Purchase invoice address")],
|
|
12
|
+
ondelete={"purchase_invoice": "set null"},
|
|
13
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This module allows you to add a billing address to purchase orders.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Purchase billing contact
|
|
2
|
+
-------------------
|
|
3
|
+
|
|
4
|
+
- Go to *Purchase* > *Orders* > *Vendors*
|
|
5
|
+
- Select or create a supplier.
|
|
6
|
+
- Go to the Contacts and Addresses tab, add a new one,
|
|
7
|
+
select the *Purchase invoice address* type, and fill in the *email* field.
|
|
8
|
+

|
|
9
|
+
- Save the contact.
|
|
10
|
+
|
|
11
|
+
Select a billing address on purchase orders
|
|
12
|
+
-------------------
|
|
13
|
+
|
|
14
|
+
- Go to *Purchase* > *Orders* > *Request for Quotation*
|
|
15
|
+
- Select or create a purchase order.
|
|
16
|
+
- Select a supplier. If they have a *Purchase invoice address*,
|
|
17
|
+
the first option will be displayed, but you can change the default.
|
|
18
|
+

|
|
19
|
+
- Complete all other fields in the order.
|
|
20
|
+
- Confirm the order.
|
|
21
|
+
- When creating the invoice, check whether a billing address is selected and assign it to the invoice.
|
|
22
|
+
If not, follow the normal Purchase Order process.
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
Billing address selection order.
|
|
26
|
+
-------------------
|
|
27
|
+
|
|
28
|
+
1. First, we search to see if there is a *Purchase invoice address* type contact among the selected supplier's contacts.
|
|
29
|
+
2. If none exist in the previous step, the supplier's contacts, i.e., secondary contacts, are searched using the same
|
|
30
|
+
criteria as above.
|
|
31
|
+
3. If none are met, the same supplier is selected.
|
|
Binary file
|
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
|
+
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
|
6
|
+
<title>README.rst</title>
|
|
7
|
+
<style type="text/css">
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
:Author: David Goodger (goodger@python.org)
|
|
11
|
+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
|
12
|
+
:Copyright: This stylesheet has been placed in the public domain.
|
|
13
|
+
|
|
14
|
+
Default cascading style sheet for the HTML output of Docutils.
|
|
15
|
+
Despite the name, some widely supported CSS2 features are used.
|
|
16
|
+
|
|
17
|
+
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
|
18
|
+
customize this style sheet.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/* used to remove borders from tables and images */
|
|
22
|
+
.borderless, table.borderless td, table.borderless th {
|
|
23
|
+
border: 0 }
|
|
24
|
+
|
|
25
|
+
table.borderless td, table.borderless th {
|
|
26
|
+
/* Override padding for "table.docutils td" with "! important".
|
|
27
|
+
The right padding separates the table cells. */
|
|
28
|
+
padding: 0 0.5em 0 0 ! important }
|
|
29
|
+
|
|
30
|
+
.first {
|
|
31
|
+
/* Override more specific margin styles with "! important". */
|
|
32
|
+
margin-top: 0 ! important }
|
|
33
|
+
|
|
34
|
+
.last, .with-subtitle {
|
|
35
|
+
margin-bottom: 0 ! important }
|
|
36
|
+
|
|
37
|
+
.hidden {
|
|
38
|
+
display: none }
|
|
39
|
+
|
|
40
|
+
.subscript {
|
|
41
|
+
vertical-align: sub;
|
|
42
|
+
font-size: smaller }
|
|
43
|
+
|
|
44
|
+
.superscript {
|
|
45
|
+
vertical-align: super;
|
|
46
|
+
font-size: smaller }
|
|
47
|
+
|
|
48
|
+
a.toc-backref {
|
|
49
|
+
text-decoration: none ;
|
|
50
|
+
color: black }
|
|
51
|
+
|
|
52
|
+
blockquote.epigraph {
|
|
53
|
+
margin: 2em 5em ; }
|
|
54
|
+
|
|
55
|
+
dl.docutils dd {
|
|
56
|
+
margin-bottom: 0.5em }
|
|
57
|
+
|
|
58
|
+
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
|
63
|
+
dl.docutils dt {
|
|
64
|
+
font-weight: bold }
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
div.abstract {
|
|
68
|
+
margin: 2em 5em }
|
|
69
|
+
|
|
70
|
+
div.abstract p.topic-title {
|
|
71
|
+
font-weight: bold ;
|
|
72
|
+
text-align: center }
|
|
73
|
+
|
|
74
|
+
div.admonition, div.attention, div.caution, div.danger, div.error,
|
|
75
|
+
div.hint, div.important, div.note, div.tip, div.warning {
|
|
76
|
+
margin: 2em ;
|
|
77
|
+
border: medium outset ;
|
|
78
|
+
padding: 1em }
|
|
79
|
+
|
|
80
|
+
div.admonition p.admonition-title, div.hint p.admonition-title,
|
|
81
|
+
div.important p.admonition-title, div.note p.admonition-title,
|
|
82
|
+
div.tip p.admonition-title {
|
|
83
|
+
font-weight: bold ;
|
|
84
|
+
font-family: sans-serif }
|
|
85
|
+
|
|
86
|
+
div.attention p.admonition-title, div.caution p.admonition-title,
|
|
87
|
+
div.danger p.admonition-title, div.error p.admonition-title,
|
|
88
|
+
div.warning p.admonition-title, .code .error {
|
|
89
|
+
color: red ;
|
|
90
|
+
font-weight: bold ;
|
|
91
|
+
font-family: sans-serif }
|
|
92
|
+
|
|
93
|
+
/* Uncomment (and remove this text!) to get reduced vertical space in
|
|
94
|
+
compound paragraphs.
|
|
95
|
+
div.compound .compound-first, div.compound .compound-middle {
|
|
96
|
+
margin-bottom: 0.5em }
|
|
97
|
+
|
|
98
|
+
div.compound .compound-last, div.compound .compound-middle {
|
|
99
|
+
margin-top: 0.5em }
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
div.dedication {
|
|
103
|
+
margin: 2em 5em ;
|
|
104
|
+
text-align: center ;
|
|
105
|
+
font-style: italic }
|
|
106
|
+
|
|
107
|
+
div.dedication p.topic-title {
|
|
108
|
+
font-weight: bold ;
|
|
109
|
+
font-style: normal }
|
|
110
|
+
|
|
111
|
+
div.figure {
|
|
112
|
+
margin-left: 2em ;
|
|
113
|
+
margin-right: 2em }
|
|
114
|
+
|
|
115
|
+
div.footer, div.header {
|
|
116
|
+
clear: both;
|
|
117
|
+
font-size: smaller }
|
|
118
|
+
|
|
119
|
+
div.line-block {
|
|
120
|
+
display: block ;
|
|
121
|
+
margin-top: 1em ;
|
|
122
|
+
margin-bottom: 1em }
|
|
123
|
+
|
|
124
|
+
div.line-block div.line-block {
|
|
125
|
+
margin-top: 0 ;
|
|
126
|
+
margin-bottom: 0 ;
|
|
127
|
+
margin-left: 1.5em }
|
|
128
|
+
|
|
129
|
+
div.sidebar {
|
|
130
|
+
margin: 0 0 0.5em 1em ;
|
|
131
|
+
border: medium outset ;
|
|
132
|
+
padding: 1em ;
|
|
133
|
+
background-color: #ffffee ;
|
|
134
|
+
width: 40% ;
|
|
135
|
+
float: right ;
|
|
136
|
+
clear: right }
|
|
137
|
+
|
|
138
|
+
div.sidebar p.rubric {
|
|
139
|
+
font-family: sans-serif ;
|
|
140
|
+
font-size: medium }
|
|
141
|
+
|
|
142
|
+
div.system-messages {
|
|
143
|
+
margin: 5em }
|
|
144
|
+
|
|
145
|
+
div.system-messages h1 {
|
|
146
|
+
color: red }
|
|
147
|
+
|
|
148
|
+
div.system-message {
|
|
149
|
+
border: medium outset ;
|
|
150
|
+
padding: 1em }
|
|
151
|
+
|
|
152
|
+
div.system-message p.system-message-title {
|
|
153
|
+
color: red ;
|
|
154
|
+
font-weight: bold }
|
|
155
|
+
|
|
156
|
+
div.topic {
|
|
157
|
+
margin: 2em }
|
|
158
|
+
|
|
159
|
+
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
|
160
|
+
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
|
161
|
+
margin-top: 0.4em }
|
|
162
|
+
|
|
163
|
+
h1.title {
|
|
164
|
+
text-align: center }
|
|
165
|
+
|
|
166
|
+
h2.subtitle {
|
|
167
|
+
text-align: center }
|
|
168
|
+
|
|
169
|
+
hr.docutils {
|
|
170
|
+
width: 75% }
|
|
171
|
+
|
|
172
|
+
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
|
173
|
+
clear: left ;
|
|
174
|
+
float: left ;
|
|
175
|
+
margin-right: 1em }
|
|
176
|
+
|
|
177
|
+
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
|
178
|
+
clear: right ;
|
|
179
|
+
float: right ;
|
|
180
|
+
margin-left: 1em }
|
|
181
|
+
|
|
182
|
+
img.align-center, .figure.align-center, object.align-center {
|
|
183
|
+
display: block;
|
|
184
|
+
margin-left: auto;
|
|
185
|
+
margin-right: auto;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
table.align-center {
|
|
189
|
+
margin-left: auto;
|
|
190
|
+
margin-right: auto;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.align-left {
|
|
194
|
+
text-align: left }
|
|
195
|
+
|
|
196
|
+
.align-center {
|
|
197
|
+
clear: both ;
|
|
198
|
+
text-align: center }
|
|
199
|
+
|
|
200
|
+
.align-right {
|
|
201
|
+
text-align: right }
|
|
202
|
+
|
|
203
|
+
/* reset inner alignment in figures */
|
|
204
|
+
div.align-right {
|
|
205
|
+
text-align: inherit }
|
|
206
|
+
|
|
207
|
+
/* div.align-center * { */
|
|
208
|
+
/* text-align: left } */
|
|
209
|
+
|
|
210
|
+
.align-top {
|
|
211
|
+
vertical-align: top }
|
|
212
|
+
|
|
213
|
+
.align-middle {
|
|
214
|
+
vertical-align: middle }
|
|
215
|
+
|
|
216
|
+
.align-bottom {
|
|
217
|
+
vertical-align: bottom }
|
|
218
|
+
|
|
219
|
+
ol.simple, ul.simple {
|
|
220
|
+
margin-bottom: 1em }
|
|
221
|
+
|
|
222
|
+
ol.arabic {
|
|
223
|
+
list-style: decimal }
|
|
224
|
+
|
|
225
|
+
ol.loweralpha {
|
|
226
|
+
list-style: lower-alpha }
|
|
227
|
+
|
|
228
|
+
ol.upperalpha {
|
|
229
|
+
list-style: upper-alpha }
|
|
230
|
+
|
|
231
|
+
ol.lowerroman {
|
|
232
|
+
list-style: lower-roman }
|
|
233
|
+
|
|
234
|
+
ol.upperroman {
|
|
235
|
+
list-style: upper-roman }
|
|
236
|
+
|
|
237
|
+
p.attribution {
|
|
238
|
+
text-align: right ;
|
|
239
|
+
margin-left: 50% }
|
|
240
|
+
|
|
241
|
+
p.caption {
|
|
242
|
+
font-style: italic }
|
|
243
|
+
|
|
244
|
+
p.credits {
|
|
245
|
+
font-style: italic ;
|
|
246
|
+
font-size: smaller }
|
|
247
|
+
|
|
248
|
+
p.label {
|
|
249
|
+
white-space: nowrap }
|
|
250
|
+
|
|
251
|
+
p.rubric {
|
|
252
|
+
font-weight: bold ;
|
|
253
|
+
font-size: larger ;
|
|
254
|
+
color: maroon ;
|
|
255
|
+
text-align: center }
|
|
256
|
+
|
|
257
|
+
p.sidebar-title {
|
|
258
|
+
font-family: sans-serif ;
|
|
259
|
+
font-weight: bold ;
|
|
260
|
+
font-size: larger }
|
|
261
|
+
|
|
262
|
+
p.sidebar-subtitle {
|
|
263
|
+
font-family: sans-serif ;
|
|
264
|
+
font-weight: bold }
|
|
265
|
+
|
|
266
|
+
p.topic-title {
|
|
267
|
+
font-weight: bold }
|
|
268
|
+
|
|
269
|
+
pre.address {
|
|
270
|
+
margin-bottom: 0 ;
|
|
271
|
+
margin-top: 0 ;
|
|
272
|
+
font: inherit }
|
|
273
|
+
|
|
274
|
+
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|
275
|
+
margin-left: 2em ;
|
|
276
|
+
margin-right: 2em }
|
|
277
|
+
|
|
278
|
+
pre.code .ln { color: gray; } /* line numbers */
|
|
279
|
+
pre.code, code { background-color: #eeeeee }
|
|
280
|
+
pre.code .comment, code .comment { color: #5C6576 }
|
|
281
|
+
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
282
|
+
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
|
283
|
+
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
|
284
|
+
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
|
285
|
+
pre.code .inserted, code .inserted { background-color: #A3D289}
|
|
286
|
+
|
|
287
|
+
span.classifier {
|
|
288
|
+
font-family: sans-serif ;
|
|
289
|
+
font-style: oblique }
|
|
290
|
+
|
|
291
|
+
span.classifier-delimiter {
|
|
292
|
+
font-family: sans-serif ;
|
|
293
|
+
font-weight: bold }
|
|
294
|
+
|
|
295
|
+
span.interpreted {
|
|
296
|
+
font-family: sans-serif }
|
|
297
|
+
|
|
298
|
+
span.option {
|
|
299
|
+
white-space: nowrap }
|
|
300
|
+
|
|
301
|
+
span.pre {
|
|
302
|
+
white-space: pre }
|
|
303
|
+
|
|
304
|
+
span.problematic, pre.problematic {
|
|
305
|
+
color: red }
|
|
306
|
+
|
|
307
|
+
span.section-subtitle {
|
|
308
|
+
/* font-size relative to parent (h1..h6 element) */
|
|
309
|
+
font-size: 80% }
|
|
310
|
+
|
|
311
|
+
table.citation {
|
|
312
|
+
border-left: solid 1px gray;
|
|
313
|
+
margin-left: 1px }
|
|
314
|
+
|
|
315
|
+
table.docinfo {
|
|
316
|
+
margin: 2em 4em }
|
|
317
|
+
|
|
318
|
+
table.docutils {
|
|
319
|
+
margin-top: 0.5em ;
|
|
320
|
+
margin-bottom: 0.5em }
|
|
321
|
+
|
|
322
|
+
table.footnote {
|
|
323
|
+
border-left: solid 1px black;
|
|
324
|
+
margin-left: 1px }
|
|
325
|
+
|
|
326
|
+
table.docutils td, table.docutils th,
|
|
327
|
+
table.docinfo td, table.docinfo th {
|
|
328
|
+
padding-left: 0.5em ;
|
|
329
|
+
padding-right: 0.5em ;
|
|
330
|
+
vertical-align: top }
|
|
331
|
+
|
|
332
|
+
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
|
333
|
+
font-weight: bold ;
|
|
334
|
+
text-align: left ;
|
|
335
|
+
white-space: nowrap ;
|
|
336
|
+
padding-left: 0 }
|
|
337
|
+
|
|
338
|
+
/* "booktabs" style (no vertical lines) */
|
|
339
|
+
table.docutils.booktabs {
|
|
340
|
+
border: 0px;
|
|
341
|
+
border-top: 2px solid;
|
|
342
|
+
border-bottom: 2px solid;
|
|
343
|
+
border-collapse: collapse;
|
|
344
|
+
}
|
|
345
|
+
table.docutils.booktabs * {
|
|
346
|
+
border: 0px;
|
|
347
|
+
}
|
|
348
|
+
table.docutils.booktabs th {
|
|
349
|
+
border-bottom: thin solid;
|
|
350
|
+
text-align: left;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
|
354
|
+
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
|
355
|
+
font-size: 100% }
|
|
356
|
+
|
|
357
|
+
ul.auto-toc {
|
|
358
|
+
list-style-type: none }
|
|
359
|
+
|
|
360
|
+
</style>
|
|
361
|
+
</head>
|
|
362
|
+
<body>
|
|
363
|
+
<div class="document">
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
|
|
367
|
+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
|
|
368
|
+
</a>
|
|
369
|
+
<div class="section" id="purchase-billing-address">
|
|
370
|
+
<h1>Purchase billing address</h1>
|
|
371
|
+
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
372
|
+
!! This file is generated by oca-gen-addon-readme !!
|
|
373
|
+
!! changes will be overwritten. !!
|
|
374
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
375
|
+
!! source digest: sha256:93a27a2e91961c1fb66e81f5db577c8ee0f68560fdc2f0637d7f032fc0abcdd2
|
|
376
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
377
|
+
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/17.0/purchase_billing_address"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_billing_address"><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/purchase-workflow&target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
378
|
+
<p>This module allows you to add a billing address to purchase orders.</p>
|
|
379
|
+
<p><strong>Table of contents</strong></p>
|
|
380
|
+
<div class="contents local topic" id="contents">
|
|
381
|
+
<ul class="simple">
|
|
382
|
+
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a><ul>
|
|
383
|
+
<li><a class="reference internal" href="#purchase-billing-contact" id="toc-entry-2">Purchase billing contact</a></li>
|
|
384
|
+
<li><a class="reference internal" href="#select-a-billing-address-on-purchase-orders" id="toc-entry-3">Select a billing address on purchase orders</a></li>
|
|
385
|
+
<li><a class="reference internal" href="#billing-address-selection-order" id="toc-entry-4">Billing address selection order.</a></li>
|
|
386
|
+
</ul>
|
|
387
|
+
</li>
|
|
388
|
+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-5">Bug Tracker</a></li>
|
|
389
|
+
<li><a class="reference internal" href="#credits" id="toc-entry-6">Credits</a><ul>
|
|
390
|
+
<li><a class="reference internal" href="#authors" id="toc-entry-7">Authors</a></li>
|
|
391
|
+
<li><a class="reference internal" href="#contributors" id="toc-entry-8">Contributors</a></li>
|
|
392
|
+
<li><a class="reference internal" href="#maintainers" id="toc-entry-9">Maintainers</a></li>
|
|
393
|
+
</ul>
|
|
394
|
+
</li>
|
|
395
|
+
</ul>
|
|
396
|
+
</div>
|
|
397
|
+
<div class="section" id="usage">
|
|
398
|
+
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
|
|
399
|
+
<div class="section" id="purchase-billing-contact">
|
|
400
|
+
<h3><a class="toc-backref" href="#toc-entry-2">Purchase billing contact</a></h3>
|
|
401
|
+
<ul class="simple">
|
|
402
|
+
<li>Go to <em>Purchase</em> > <em>Orders</em> > <em>Vendors</em></li>
|
|
403
|
+
<li>Select or create a supplier.</li>
|
|
404
|
+
<li>Go to the Contacts and Addresses tab, add a new one, select the
|
|
405
|
+
<em>Purchase invoice address</em> type, and fill in the <em>email</em> field.
|
|
406
|
+
<img alt="ADDRESS_PURCHASE" src="https://raw.githubusercontent.com/OCA/purchase-workflow/17.0/purchase_billing_address/static/img/readme/ADDRESS_PURCHASE.png" /></li>
|
|
407
|
+
<li>Save the contact.</li>
|
|
408
|
+
</ul>
|
|
409
|
+
</div>
|
|
410
|
+
<div class="section" id="select-a-billing-address-on-purchase-orders">
|
|
411
|
+
<h3><a class="toc-backref" href="#toc-entry-3">Select a billing address on purchase orders</a></h3>
|
|
412
|
+
<ul class="simple">
|
|
413
|
+
<li>Go to <em>Purchase</em> > <em>Orders</em> > <em>Request for Quotation</em></li>
|
|
414
|
+
<li>Select or create a purchase order.</li>
|
|
415
|
+
<li>Select a supplier. If they have a <em>Purchase invoice address</em>, the
|
|
416
|
+
first option will be displayed, but you can change the default.
|
|
417
|
+
<img alt="SELECT_ADDRESS_PURCHASE" src="https://raw.githubusercontent.com/OCA/purchase-workflow/17.0/purchase_billing_address/static/img/readme/SELECT_ADDRESS_PURCHASE.png" /></li>
|
|
418
|
+
<li>Complete all other fields in the order.</li>
|
|
419
|
+
<li>Confirm the order.</li>
|
|
420
|
+
<li>When creating the invoice, check whether a billing address is selected
|
|
421
|
+
and assign it to the invoice. If not, follow the normal Purchase Order
|
|
422
|
+
process. <img alt="PURCHASE_INVOICE" src="https://raw.githubusercontent.com/OCA/purchase-workflow/17.0/purchase_billing_address/static/img/readme/PURCHASE_INVOICE.png" /></li>
|
|
423
|
+
</ul>
|
|
424
|
+
</div>
|
|
425
|
+
<div class="section" id="billing-address-selection-order">
|
|
426
|
+
<h3><a class="toc-backref" href="#toc-entry-4">Billing address selection order.</a></h3>
|
|
427
|
+
<ol class="arabic simple">
|
|
428
|
+
<li>First, we search to see if there is a <em>Purchase invoice address</em> type
|
|
429
|
+
contact among the selected supplier’s contacts.</li>
|
|
430
|
+
<li>If none exist in the previous step, the supplier’s contacts, i.e.,
|
|
431
|
+
secondary contacts, are searched using the same criteria as above.</li>
|
|
432
|
+
<li>If none are met, the same supplier is selected.</li>
|
|
433
|
+
</ol>
|
|
434
|
+
</div>
|
|
435
|
+
</div>
|
|
436
|
+
<div class="section" id="bug-tracker">
|
|
437
|
+
<h2><a class="toc-backref" href="#toc-entry-5">Bug Tracker</a></h2>
|
|
438
|
+
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
|
|
439
|
+
In case of trouble, please check there if your issue has already been reported.
|
|
440
|
+
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
441
|
+
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_billing_address%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
|
442
|
+
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
|
443
|
+
</div>
|
|
444
|
+
<div class="section" id="credits">
|
|
445
|
+
<h2><a class="toc-backref" href="#toc-entry-6">Credits</a></h2>
|
|
446
|
+
<div class="section" id="authors">
|
|
447
|
+
<h3><a class="toc-backref" href="#toc-entry-7">Authors</a></h3>
|
|
448
|
+
<ul class="simple">
|
|
449
|
+
<li>Binhex <<a class="reference external" href="https://www.binhex.cloud">https://www.binhex.cloud</a>></li>
|
|
450
|
+
</ul>
|
|
451
|
+
</div>
|
|
452
|
+
<div class="section" id="contributors">
|
|
453
|
+
<h3><a class="toc-backref" href="#toc-entry-8">Contributors</a></h3>
|
|
454
|
+
<ul class="simple">
|
|
455
|
+
<li>[Binhex] (<a class="reference external" href="https://www.binhex.cloud">https://www.binhex.cloud</a>):<ul>
|
|
456
|
+
<li>Edilio Escalona Almira <a class="reference external" href="mailto:e.escalona@binhex.cloud">e.escalona@binhex.cloud</a></li>
|
|
457
|
+
</ul>
|
|
458
|
+
</li>
|
|
459
|
+
</ul>
|
|
460
|
+
</div>
|
|
461
|
+
<div class="section" id="maintainers">
|
|
462
|
+
<h3><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h3>
|
|
463
|
+
<p>This module is maintained by the OCA.</p>
|
|
464
|
+
<a class="reference external image-reference" href="https://odoo-community.org">
|
|
465
|
+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
|
466
|
+
</a>
|
|
467
|
+
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
468
|
+
mission is to support the collaborative development of Odoo features and
|
|
469
|
+
promote its widespread use.</p>
|
|
470
|
+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/17.0/purchase_billing_address">OCA/purchase-workflow</a> project on GitHub.</p>
|
|
471
|
+
<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>
|
|
472
|
+
</div>
|
|
473
|
+
</div>
|
|
474
|
+
</div>
|
|
475
|
+
</div>
|
|
476
|
+
</body>
|
|
477
|
+
</html>
|
|
Binary file
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Copyright 2025 Binhex <https://www.binhex.cloud>
|
|
2
|
+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from odoo import Command
|
|
6
|
+
from odoo.tests import tagged
|
|
7
|
+
from odoo.tests.common import TransactionCase
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@tagged("post_install", "-at_install")
|
|
11
|
+
class TestPurchaseInvoicePartnerType(TransactionCase):
|
|
12
|
+
@classmethod
|
|
13
|
+
def setUpClass(cls):
|
|
14
|
+
super().setUpClass()
|
|
15
|
+
|
|
16
|
+
ResPartner = cls.env["res.partner"]
|
|
17
|
+
PurchaseOrder = cls.env["purchase.order"]
|
|
18
|
+
cls.partner_id = ResPartner.create(
|
|
19
|
+
{"name": "Supplier parent", "type": "purchase_invoice", "supplier_rank": 1}
|
|
20
|
+
)
|
|
21
|
+
cls.supplier_id = ResPartner.create(
|
|
22
|
+
{
|
|
23
|
+
"name": "Supplier",
|
|
24
|
+
"type": "purchase_invoice",
|
|
25
|
+
"supplier_rank": 1,
|
|
26
|
+
"parent_id": cls.partner_id.id,
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
cls.product_id = cls.env.ref("product.product_product_5")
|
|
30
|
+
cls.product_id.write({"purchase_method": "purchase"})
|
|
31
|
+
cls.purchase_order_id = PurchaseOrder.create(
|
|
32
|
+
{
|
|
33
|
+
"partner_id": cls.partner_id.id,
|
|
34
|
+
"order_line": [
|
|
35
|
+
Command.create(
|
|
36
|
+
{
|
|
37
|
+
"product_id": cls.product_id.id,
|
|
38
|
+
"product_uom": cls.env.ref("uom.product_uom_unit").id,
|
|
39
|
+
"product_uom_qty": 1,
|
|
40
|
+
"price_unit": 100,
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
],
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
def test_address_purchase_invoice_get(self):
|
|
48
|
+
partner_ids = self.purchase_order_id._address_purchase_invoice_get()
|
|
49
|
+
self.assertEqual(partner_ids, [self.supplier_id.id])
|
|
50
|
+
|
|
51
|
+
def test_compute_available_partner_invoice_ids(self):
|
|
52
|
+
self.purchase_order_id._compute_available_partner_invoice_ids()
|
|
53
|
+
self.assertEqual(
|
|
54
|
+
self.purchase_order_id.available_partner_invoice_ids.ids,
|
|
55
|
+
[self.supplier_id.id],
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
def test_onchange_partner_id(self):
|
|
59
|
+
self.purchase_order_id.onchange_partner_id()
|
|
60
|
+
self.assertEqual(self.purchase_order_id.partner_invoice_id, self.supplier_id)
|
|
61
|
+
|
|
62
|
+
def test_create_invoice(self):
|
|
63
|
+
self.purchase_order_id.onchange_partner_id()
|
|
64
|
+
self.purchase_order_id.button_confirm()
|
|
65
|
+
self.purchase_order_id.action_create_invoice()
|
|
66
|
+
invoice = self.purchase_order_id.invoice_ids[0]
|
|
67
|
+
self.assertEqual(invoice.partner_id, self.supplier_id)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
+
<!-- Copyright 2023 CreuBlanca
|
|
3
|
+
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
|
4
|
+
<odoo>
|
|
5
|
+
|
|
6
|
+
<record model="ir.ui.view" id="purchase_order_form_view">
|
|
7
|
+
<field
|
|
8
|
+
name="name"
|
|
9
|
+
>purchase.order.form.inherit,purchase.invoice.partner.type</field>
|
|
10
|
+
<field name="model">purchase.order</field>
|
|
11
|
+
<field name="inherit_id" ref="purchase.purchase_order_form" />
|
|
12
|
+
<field name="arch" type="xml">
|
|
13
|
+
<field name="partner_id" position="after">
|
|
14
|
+
<field name="available_partner_invoice_ids" invisible="1" />
|
|
15
|
+
<field
|
|
16
|
+
name="partner_invoice_id"
|
|
17
|
+
readonly="state in ('cancel', 'done', 'purchase')"
|
|
18
|
+
context="{'default_type': 'purchase_invoice','default_parent_id': partner_id}"
|
|
19
|
+
/>
|
|
20
|
+
</field>
|
|
21
|
+
</field>
|
|
22
|
+
</record>
|
|
23
|
+
|
|
24
|
+
</odoo>
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: odoo-addon-purchase_billing_address
|
|
3
|
+
Version: 17.0.1.0.0.2
|
|
4
|
+
Requires-Python: >=3.10
|
|
5
|
+
Requires-Dist: odoo>=17.0a,<17.1dev
|
|
6
|
+
Summary: Create a new partner type (purchase), to differentiate the purchase order and invoice addresses.
|
|
7
|
+
Home-page: https://github.com/OCA/purchase-workflow
|
|
8
|
+
License: AGPL-3
|
|
9
|
+
Author: Binhex <https://www.binhex.cloud>,Odoo Community Association (OCA)
|
|
10
|
+
Author-email: support@odoo-community.org
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Framework :: Odoo
|
|
13
|
+
Classifier: Framework :: Odoo :: 17.0
|
|
14
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
15
|
+
Description-Content-Type: text/x-rst
|
|
16
|
+
|
|
17
|
+
.. image:: https://odoo-community.org/readme-banner-image
|
|
18
|
+
:target: https://odoo-community.org/get-involved?utm_source=readme
|
|
19
|
+
:alt: Odoo Community Association
|
|
20
|
+
|
|
21
|
+
========================
|
|
22
|
+
Purchase billing address
|
|
23
|
+
========================
|
|
24
|
+
|
|
25
|
+
..
|
|
26
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
27
|
+
!! This file is generated by oca-gen-addon-readme !!
|
|
28
|
+
!! changes will be overwritten. !!
|
|
29
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
30
|
+
!! source digest: sha256:93a27a2e91961c1fb66e81f5db577c8ee0f68560fdc2f0637d7f032fc0abcdd2
|
|
31
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
32
|
+
|
|
33
|
+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
34
|
+
:target: https://odoo-community.org/page/development-status
|
|
35
|
+
:alt: Beta
|
|
36
|
+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
|
37
|
+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
38
|
+
:alt: License: AGPL-3
|
|
39
|
+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
|
|
40
|
+
:target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_billing_address
|
|
41
|
+
:alt: OCA/purchase-workflow
|
|
42
|
+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
43
|
+
:target: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_billing_address
|
|
44
|
+
:alt: Translate me on Weblate
|
|
45
|
+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
46
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=17.0
|
|
47
|
+
:alt: Try me on Runboat
|
|
48
|
+
|
|
49
|
+
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
50
|
+
|
|
51
|
+
This module allows you to add a billing address to purchase orders.
|
|
52
|
+
|
|
53
|
+
**Table of contents**
|
|
54
|
+
|
|
55
|
+
.. contents::
|
|
56
|
+
:local:
|
|
57
|
+
|
|
58
|
+
Usage
|
|
59
|
+
=====
|
|
60
|
+
|
|
61
|
+
Purchase billing contact
|
|
62
|
+
------------------------
|
|
63
|
+
|
|
64
|
+
- Go to *Purchase* > *Orders* > *Vendors*
|
|
65
|
+
- Select or create a supplier.
|
|
66
|
+
- Go to the Contacts and Addresses tab, add a new one, select the
|
|
67
|
+
*Purchase invoice address* type, and fill in the *email* field.
|
|
68
|
+
|ADDRESS_PURCHASE|
|
|
69
|
+
- Save the contact.
|
|
70
|
+
|
|
71
|
+
Select a billing address on purchase orders
|
|
72
|
+
-------------------------------------------
|
|
73
|
+
|
|
74
|
+
- Go to *Purchase* > *Orders* > *Request for Quotation*
|
|
75
|
+
- Select or create a purchase order.
|
|
76
|
+
- Select a supplier. If they have a *Purchase invoice address*, the
|
|
77
|
+
first option will be displayed, but you can change the default.
|
|
78
|
+
|SELECT_ADDRESS_PURCHASE|
|
|
79
|
+
- Complete all other fields in the order.
|
|
80
|
+
- Confirm the order.
|
|
81
|
+
- When creating the invoice, check whether a billing address is selected
|
|
82
|
+
and assign it to the invoice. If not, follow the normal Purchase Order
|
|
83
|
+
process. |PURCHASE_INVOICE|
|
|
84
|
+
|
|
85
|
+
Billing address selection order.
|
|
86
|
+
--------------------------------
|
|
87
|
+
|
|
88
|
+
1. First, we search to see if there is a *Purchase invoice address* type
|
|
89
|
+
contact among the selected supplier's contacts.
|
|
90
|
+
2. If none exist in the previous step, the supplier's contacts, i.e.,
|
|
91
|
+
secondary contacts, are searched using the same criteria as above.
|
|
92
|
+
3. If none are met, the same supplier is selected.
|
|
93
|
+
|
|
94
|
+
.. |ADDRESS_PURCHASE| image:: https://raw.githubusercontent.com/OCA/purchase-workflow/17.0/purchase_billing_address/static/img/readme/ADDRESS_PURCHASE.png
|
|
95
|
+
.. |SELECT_ADDRESS_PURCHASE| image:: https://raw.githubusercontent.com/OCA/purchase-workflow/17.0/purchase_billing_address/static/img/readme/SELECT_ADDRESS_PURCHASE.png
|
|
96
|
+
.. |PURCHASE_INVOICE| image:: https://raw.githubusercontent.com/OCA/purchase-workflow/17.0/purchase_billing_address/static/img/readme/PURCHASE_INVOICE.png
|
|
97
|
+
|
|
98
|
+
Bug Tracker
|
|
99
|
+
===========
|
|
100
|
+
|
|
101
|
+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
|
|
102
|
+
In case of trouble, please check there if your issue has already been reported.
|
|
103
|
+
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
104
|
+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_billing_address%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
105
|
+
|
|
106
|
+
Do not contact contributors directly about support or help with technical issues.
|
|
107
|
+
|
|
108
|
+
Credits
|
|
109
|
+
=======
|
|
110
|
+
|
|
111
|
+
Authors
|
|
112
|
+
-------
|
|
113
|
+
|
|
114
|
+
* Binhex <https://www.binhex.cloud>
|
|
115
|
+
|
|
116
|
+
Contributors
|
|
117
|
+
------------
|
|
118
|
+
|
|
119
|
+
- [Binhex] (https://www.binhex.cloud):
|
|
120
|
+
|
|
121
|
+
- Edilio Escalona Almira e.escalona@binhex.cloud
|
|
122
|
+
|
|
123
|
+
Maintainers
|
|
124
|
+
-----------
|
|
125
|
+
|
|
126
|
+
This module is maintained by the OCA.
|
|
127
|
+
|
|
128
|
+
.. image:: https://odoo-community.org/logo.png
|
|
129
|
+
:alt: Odoo Community Association
|
|
130
|
+
:target: https://odoo-community.org
|
|
131
|
+
|
|
132
|
+
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
133
|
+
mission is to support the collaborative development of Odoo features and
|
|
134
|
+
promote its widespread use.
|
|
135
|
+
|
|
136
|
+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/17.0/purchase_billing_address>`_ project on GitHub.
|
|
137
|
+
|
|
138
|
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
odoo/addons/purchase_billing_address/README.rst,sha256=J2dPpwPn7hpKnuC5CbAUgNL-Gww6ovSTWULCEXrI3CQ,4931
|
|
2
|
+
odoo/addons/purchase_billing_address/__init__.py,sha256=vkgigsfGV5ms2_GV5olduqqZSl3kyC7dwTCwgYKZtRM,138
|
|
3
|
+
odoo/addons/purchase_billing_address/__manifest__.py,sha256=Joqd69k29xNShnR0XJI0Wyx7AbDxe5G6WErMmgml51s,602
|
|
4
|
+
odoo/addons/purchase_billing_address/i18n/purchase_billing_address.pot,sha256=6bTAAglM21GssgtxjRcNUMu7Wrn21jWnU_6ZRY6p3Bo,2312
|
|
5
|
+
odoo/addons/purchase_billing_address/models/__init__.py,sha256=CjSCGEMSMYf4xWxTHCcxGzToZT-lZmApgSvkSWw2gMc,172
|
|
6
|
+
odoo/addons/purchase_billing_address/models/purchase_order.py,sha256=2jRtJAgstKtT6aM3jE27oOeiwP8_pEcUzSj8XxL_mX8,1956
|
|
7
|
+
odoo/addons/purchase_billing_address/models/res_partner.py,sha256=egNvVsu7UlvPW3wEuPrB3Tel7N-UgLug360L1YNEiZY,373
|
|
8
|
+
odoo/addons/purchase_billing_address/readme/CONTRIBUTORS.md,sha256=lR9eQZSI7YzDMLESNhJw5k9O4fjVP7yeiqN2iNA1vhY,92
|
|
9
|
+
odoo/addons/purchase_billing_address/readme/DESCRIPTION.md,sha256=yd3T2ieiieDNwHYQ-7euLDd_zDiBJ9wx85w5gsrNsEk,68
|
|
10
|
+
odoo/addons/purchase_billing_address/readme/USAGE.md,sha256=J9NdWLvSqKAj4Wq-91qXeqIabtmmyc2QTDk6kQmefy4,1358
|
|
11
|
+
odoo/addons/purchase_billing_address/static/description/icon.png,sha256=CgnOEZCwoe6f1vlLwkqFVfc2q_uwBMU0UnXN8j6X5ag,10254
|
|
12
|
+
odoo/addons/purchase_billing_address/static/description/index.html,sha256=E6IVHP2fQD5LduXI5G8qr4WCzjpKJXjVjuARedK5CBE,15486
|
|
13
|
+
odoo/addons/purchase_billing_address/static/img/readme/ADDRESS_PURCHASE.png,sha256=NDfaDlZTfPnLoh0C7_sRGklwRxn0ZcoZ_cQLHmPwPR8,34645
|
|
14
|
+
odoo/addons/purchase_billing_address/static/img/readme/PURCHASE_INVOICE.png,sha256=YMz27lUiryTTZdD5mMN_8JEAxqxnnJavLd5WoPg8gIA,55954
|
|
15
|
+
odoo/addons/purchase_billing_address/static/img/readme/SELECT_ADDRESS_PURCHASE.png,sha256=BhkN-R8mOAY2Na9bzeD9niXFoagGkkKz7RR-HgLtheY,51439
|
|
16
|
+
odoo/addons/purchase_billing_address/tests/__init__.py,sha256=MOBCjRsQzMAgGkA3hGJqT36796x6lVtq5Bax3m65EUE,167
|
|
17
|
+
odoo/addons/purchase_billing_address/tests/test_purchase_invoice_partner_type.py,sha256=ZbL52g4Yq_jKrC10xyrQyVkOeDhFmXN_-z4pvpwRI8k,2492
|
|
18
|
+
odoo/addons/purchase_billing_address/views/purchase_order_views.xml,sha256=YwnWkxiLC7jb2Vz1wCurUuK5o-o9iWnYOCl6LhiUTQA,939
|
|
19
|
+
odoo_addon_purchase_billing_address-17.0.1.0.0.2.dist-info/METADATA,sha256=o0gnUBh0MmZkUKBAW3k9ujPSd4gtcOJSBXCFrIbAbDo,5592
|
|
20
|
+
odoo_addon_purchase_billing_address-17.0.1.0.0.2.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
|
|
21
|
+
odoo_addon_purchase_billing_address-17.0.1.0.0.2.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
|
|
22
|
+
odoo_addon_purchase_billing_address-17.0.1.0.0.2.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
odoo
|