Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

purchase_sale_*_company: to 15.0 #3

Draft
wants to merge 18 commits into
base: 15.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
92b3d53
[12.0][IMP] purchase_sale_inter_company: add sync_picking option
MateuGForgeFlow May 25, 2022
b243d6f
[12.0][IMP] purchase_sale_inter_company: sync pickings
MateuGForgeFlow Feb 9, 2023
6512d91
[12.0][IMP] purchas_sale_inter_company: sync lines and moves
MateuGForgeFlow Mar 15, 2023
3b2673a
fixup! [12.0][IMP] purchase_sale_inter_company: sync pickings
ntsirintanis Aug 22, 2024
82c9c02
[FIX] purchase_sale_inter_company: consider moves that contain same p…
MiquelRForgeFlow Sep 6, 2023
3e5db45
[IMP] account_invoice_inter_company: Remove duplicated partner creati…
renda-dev Oct 5, 2023
04009a4
[MIG] purchase_sale_inter_company: migrate sync pickings for v14
aleuffre Sep 19, 2023
9f8e7a0
[MIG] purchase_sale_inter_company: migrate sync pickings for v15
ntsirintanis Aug 26, 2024
7888e75
purchase_sale_inter_company: fix validation of several picking. self …
sebastienbeau Oct 23, 2023
ad33607
[MIG] purchase_sale_inter_company: fix validation of several picking.…
ntsirintanis Aug 26, 2024
bbb698a
[FIX]purchase_sale_inter_company: handle pickings with lots/serials
aleuffre Dec 6, 2023
ff8af96
[FIX] purchase_sale_inter_company: sync confirmed unlocked purchase u…
chienandalu Dec 27, 2023
37ca8d1
[IMP] purchase_sale_inter_company: manage and sync state
renda-dev Dec 27, 2023
2dc8052
[MIG][IMP] purchase_sale_inter_company: manage and sync state to v15
ntsirintanis Aug 28, 2024
76115e2
fixup! [FIX]purchase_sale_inter_company: handle pickings with lots/se…
ntsirintanis Aug 28, 2024
4c79a40
[IMP] purchase_sale_inter_company: remove user error on lines mismatch
renda-dev Mar 18, 2024
3e67891
[IMP]purchase_sale_inter_company: lock incoming picking validation if…
toita86 Mar 25, 2024
bb403c1
[IMP] purchase_sale_inter_company: Activity instead of hard raise
thomaspaulb Jul 4, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ def setUpClass(cls):
}
)
cls.chart.try_loading(company=cls.company_a, install_demo=False)
cls.partner_company_a = cls.env["res.partner"].create(
{"name": cls.company_a.name, "is_company": True}
)
cls.company_a.partner_id = cls.partner_company_a
cls.partner_company_a = cls.company_a.partner_id
cls.company_b = cls.env["res.company"].create(
{
"name": "Company B",
Expand All @@ -45,9 +42,7 @@ def setUpClass(cls):
}
)
cls.chart.try_loading(company=cls.company_b, install_demo=False)
cls.partner_company_b = cls.env["res.partner"].create(
{"name": cls.company_b.name, "is_company": True}
)
cls.partner_company_b = cls.company_b.partner_id
cls.child_partner_company_b = cls.env["res.partner"].create(
{
"name": "Child, Company B",
Expand All @@ -56,7 +51,6 @@ def setUpClass(cls):
"parent_id": cls.partner_company_b.id,
}
)
cls.company_b.partner_id = cls.partner_company_b
# cls.partner_company_b = cls.company_b.parent_id.partner_id
cls.user_company_a = cls.env["res.users"].create(
{
Expand Down
45 changes: 45 additions & 0 deletions purchase_sale_inter_company/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,29 @@ Imagine you have company A and company B in the same Odoo database:
* Company A will create a purchase order with company B as supplier.
* This module automate the creation of the sale order in company B with company A as customer.

It allows to create a sale order in company A from a purchase order in company B, and keep delivery/receipt pickings synced, including backorders.

When Company A sends a product tracked by lot or serial number, a new lot/serial number with the same name is created in Company B to match it, if one doesn't already exist.

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

Imagine you have company A and company B in the same Odoo database:


Company A purchases goods from company B.

Company A will create a purchase order with company B as supplier.

This module automates the creation of the sale order in company B with company A as customer.

Receipt picking(s) created from Company A purchase are synced with quantities delivered in picking(s) by Company B sale.

Installation
============

Expand All @@ -56,6 +74,16 @@ To configure this module, you need to:
#. Go to the tab *Inter-Company* then the group *Purchase To Sale*.
#. If you check the option *Sale Auto Validation* in the configuration of company B, then when you validate a *Purchase Order* in company A with company B as supplier, the *Sale Order* will be automatically validated in company B with company A as customer.

Usage
=====

Create a purchase with Company A, setting Company B as vendor > confirm PO > a SO for Company B with customer Company A is created automatically.


Validate SO for Company B > validate delivery picking > in PO for Company A, receipt picking is validated with quantities from Company B delivery picking.

If backorders have been created from delivery picking, they will be synchronized to receipt picking.

Known issues / Roadmap
======================

Expand Down Expand Up @@ -105,6 +133,12 @@ Contributors
* `Camptocamp <https://www.camptocamp.com>`:

* Maksym Yankin <[email protected]>
* Alessandro Uffreduzzi <[email protected]>

* Ooops404 <[email protected]>

* Francesco Foresti <[email protected]>
* Eduard Brahas <[email protected]>

Maintainers
~~~~~~~~~~~
Expand All @@ -119,6 +153,17 @@ 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-aleuffre| image:: https://github.com/aleuffre.png?size=40px
:target: https://github.com/aleuffre
:alt: aleuffre
.. |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-aleuffre| |maintainer-renda-dev|

This module is part of the `OCA/multi-company <https://github.com/OCA/multi-company/tree/15.0/purchase_sale_inter_company>`_ 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_sale_inter_company/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"category": "Purchase Management",
"website": "https://github.com/OCA/multi-company",
"author": "Odoo SA, Akretion, Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["aleuffre", "renda-dev"],
"license": "AGPL-3",
"installable": True,
"depends": ["sale", "purchase", "account_invoice_inter_company"],
Expand Down
2 changes: 1 addition & 1 deletion purchase_sale_inter_company/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from odoo import fields, models


class ResCompany(models.Model):

class ResCompany(models.Model):
_inherit = "res.company"

so_from_po = fields.Boolean(
Expand Down
1 change: 0 additions & 1 deletion purchase_sale_inter_company/models/res_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class InterCompanyRulesConfig(models.TransientModel):

_inherit = "res.config.settings"

so_from_po = fields.Boolean(
Expand Down
14 changes: 14 additions & 0 deletions purchase_sale_inter_company/readme/CONFIGURATION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
To configure this module, you need to:


#. Go to the menu Settings > General Settings > Multi-Company and enable ​Sale from purchase

#. Select the "Warehouse for Sale Orders": it is the warehouse that will be used in the Sale Orders generated from POs coming from other companies..

#. Select the "Intercompany Sale User": is it the user that will be used as creator of the Sale Orders generated from POs coming from other companies.

#. If you check the option "Sale Orders Auto Validation" in the configuration of company B, when you validate a Purchase Order in company A with company B as supplier, the Sale Order will be automatically validated in company B with company A as customer.

#. If you check the option "Sync picking" (for both companies), validating a picking generated by an inter-company purchase/sale will validate the respective picking for the other company.

#. If you check the option "Block manual validation of picking in the destination company" is not possible to validate manually the picking in the destination company.
10 changes: 10 additions & 0 deletions purchase_sale_inter_company/readme/CONTEXT.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Imagine you have company A and company B in the same Odoo database:


Company A purchases goods from company B.

Company A will create a purchase order with company B as supplier.

This module automates the creation of the sale order in company B with company A as customer.

Receipt picking(s) created from Company A purchase are synced with quantities delivered in picking(s) by Company B sale.
6 changes: 6 additions & 0 deletions purchase_sale_inter_company/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@
* `Camptocamp <https://www.camptocamp.com>`:

* Maksym Yankin <[email protected]>
* Alessandro Uffreduzzi <[email protected]>

* Ooops404 <[email protected]>

* Francesco Foresti <[email protected]>
* Eduard Brahas <[email protected]>
4 changes: 4 additions & 0 deletions purchase_sale_inter_company/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ Imagine you have company A and company B in the same Odoo database:
* Company A purchase goods from company B.
* Company A will create a purchase order with company B as supplier.
* This module automate the creation of the sale order in company B with company A as customer.

It allows to create a sale order in company A from a purchase order in company B, and keep delivery/receipt pickings synced, including backorders.

When Company A sends a product tracked by lot or serial number, a new lot/serial number with the same name is created in Company B to match it, if one doesn't already exist.
6 changes: 6 additions & 0 deletions purchase_sale_inter_company/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Create a purchase with Company A, setting Company B as vendor > confirm PO > a SO for Company B with customer Company A is created automatically.


Validate SO for Company B > validate delivery picking > in PO for Company A, receipt picking is validated with quantities from Company B delivery picking.

If backorders have been created from delivery picking, they will be synchronized to receipt picking.
70 changes: 50 additions & 20 deletions purchase_sale_inter_company/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -8,10 +9,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +276,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +302,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -377,35 +379,53 @@ <h1 class="title">Inter Company Module for Purchase to Sale Order</h1>
<li>Company A will create a purchase order with company B as supplier.</li>
<li>This module automate the creation of the sale order in company B with company A as customer.</li>
</ul>
<p>It allows to create a sale order in company A from a purchase order in company B, and keep delivery/receipt pickings synced, including backorders.</p>
<p>When Company A sends a product tracked by lot or serial number, a new lot/serial number with the same name is created in Company B to match it, if one doesn’t already exist.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li>
<li><a class="reference internal" href="#configuration" id="toc-entry-2">Configuration</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-3">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li>
<li><a class="reference internal" href="#use-cases-context" id="toc-entry-1">Use Cases / Context</a></li>
<li><a class="reference internal" href="#installation" id="toc-entry-2">Installation</a></li>
<li><a class="reference internal" href="#configuration" id="toc-entry-3">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-4">Usage</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-5">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-6">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-7">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-8">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-9">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-10">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="use-cases-context">
<h1><a class="toc-backref" href="#toc-entry-1">Use Cases / Context</a></h1>
<p>Imagine you have company A and company B in the same Odoo database:</p>
<p>Company A purchases goods from company B.</p>
<p>Company A will create a purchase order with company B as supplier.</p>
<p>This module automates the creation of the sale order in company B with company A as customer.</p>
<p>Receipt picking(s) created from Company A purchase are synced with quantities delivered in picking(s) by Company B sale.</p>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Installation</a></h1>
<p>If you want also to have different warehouses for your sales orders you can install <cite>stock</cite> and then <cite>purchase_sale_stock_inter_company</cite> will be auto installed.</p>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
<h1><a class="toc-backref" href="#toc-entry-3">Configuration</a></h1>
<p>To configure this module, you need to:
#. go to the menu <em>General Settings &gt; Companies &gt; Companies</em>.
#. Select one of the companies.
#. Go to the tab <em>Inter-Company</em> then the group <em>Purchase To Sale</em>.
#. If you check the option <em>Sale Auto Validation</em> in the configuration of company B, then when you validate a <em>Purchase Order</em> in company A with company B as supplier, the <em>Sale Order</em> will be automatically validated in company B with company A as customer.</p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-4">Usage</a></h1>
<p>Create a purchase with Company A, setting Company B as vendor &gt; confirm PO &gt; a SO for Company B with customer Company A is created automatically.</p>
<p>Validate SO for Company B &gt; validate delivery picking &gt; in PO for Company A, receipt picking is validated with quantities from Company B delivery picking.</p>
<p>If backorders have been created from delivery picking, they will be synchronized to receipt picking.</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
<h1><a class="toc-backref" href="#toc-entry-5">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>No synchronization is made from the generated sale order back to the purchase order.
This would be interesting in the case of price changes and discounts, that would be
Expand All @@ -415,25 +435,25 @@ <h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#toc-entry-6">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/multi-company/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/multi-company/issues/new?body=module:%20purchase_sale_inter_company%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-7">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-8">Authors</a></h2>
<ul class="simple">
<li>Odoo SA</li>
<li>Akretion</li>
<li>Tecnativa</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-9">Contributors</a></h2>
<ul class="simple">
<li>Odoo S.A. (original module <cite>inter_company_rules</cite>)</li>
<li>Andrea Stirpe &lt;<a class="reference external" href="mailto:a.stirpe&#64;onestein.nl">a.stirpe&#64;onestein.nl</a>&gt;</li>
Expand All @@ -453,17 +473,27 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
</li>
<li><cite>Camptocamp &lt;https://www.camptocamp.com&gt;</cite>:<ul>
<li>Maksym Yankin &lt;<a class="reference external" href="mailto:maksym.yankin&#64;camptocamp.com">maksym.yankin&#64;camptocamp.com</a>&gt;</li>
<li>Alessandro Uffreduzzi &lt;<a class="reference external" href="mailto:alessandro.uffreduzzi&#64;pytech.it">alessandro.uffreduzzi&#64;pytech.it</a>&gt;</li>
</ul>
</li>
<li>Ooops404 &lt;<a class="reference external" href="mailto:info&#64;ooops404.com">info&#64;ooops404.com</a>&gt;<ul>
<li>Francesco Foresti &lt;<a class="reference external" href="mailto:francesco.foresti&#64;ooops404.com">francesco.foresti&#64;ooops404.com</a>&gt;</li>
<li>Eduard Brahas &lt;<a class="reference external" href="mailto:eduardbrhas&#64;outlook.it">eduardbrhas&#64;outlook.it</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</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/aleuffre"><img alt="aleuffre" src="https://github.com/aleuffre.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/multi-company/tree/15.0/purchase_sale_inter_company">OCA/multi-company</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
Loading
Loading