Skip to content

Commit 999426c

Browse files
author
mathieu
committed
[ADD] module phs_responsible_supplier which adds a field responsible_supplier
on the res_partner and on the receipt
1 parent 67e5061 commit 999426c

File tree

9 files changed

+77
-0
lines changed

9 files changed

+77
-0
lines changed

phs_responsible_supplier/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2020 Pharmasimple (https://www.pharmasimple.be)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Phs Responsible Supplier",
5+
"category": "Tools",
6+
"summary": "",
7+
"version": "14.0.1.0.0",
8+
"author": "Pharmasimple",
9+
"license": "AGPL-3",
10+
"website": "https://github.com/akretion/phs-addons",
11+
"depends": ["stock"],
12+
"data": [
13+
"views/res_partner_views.xml",
14+
"views/stock_picking_views.xml",
15+
],
16+
"installable": True,
17+
"application": False,
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import res_partner
2+
from . import stock_picking
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from odoo import fields, models
2+
3+
4+
class ResPartner(models.Model):
5+
_inherit = "res.partner"
6+
7+
responsible_supplier_id = fields.Many2one(
8+
string="Responsible Supplier", comodel_name="res.partner"
9+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from odoo import fields, models
2+
3+
4+
class StockPicking(models.Model):
5+
_inherit = "stock.picking"
6+
7+
responsible_supplier_id = fields.Many2one(
8+
string="Responsible Supplier",
9+
comodel_name="res.partner",
10+
related="partner_id.responsible_supplier_id",
11+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo>
3+
<record id="res_partner_form_view" model="ir.ui.view">
4+
<field name="name">res.partner.view.form</field>
5+
<field name="model">res.partner</field>
6+
<field name="inherit_id" ref="base.view_partner_form" />
7+
<field name="arch" type="xml">
8+
<group name="purchase" position="inside">
9+
<field
10+
name="responsible_supplier_id"
11+
attrs="{'invisible': [('company_type', '=', 'person')]}"
12+
/>
13+
</group>
14+
</field>
15+
</record>
16+
</odoo>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo>
3+
<record id="stock_picking_form_view" model="ir.ui.view">
4+
<field name="name">stock.picking.view.form</field>
5+
<field name="model">stock.picking</field>
6+
<field name="inherit_id" ref="stock.view_picking_form" />
7+
<field name="arch" type="xml">
8+
<xpath expr="//field[@name='partner_id']" position="after">
9+
<field name="responsible_supplier_id" />
10+
</xpath>
11+
</field>
12+
</record>
13+
</odoo>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../phs_responsible_supplier
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

0 commit comments

Comments
 (0)