Skip to content

Commit

Permalink
New Module:Related Partner Country for sale order and invoce documents
Browse files Browse the repository at this point in the history
  • Loading branch information
vandekul committed Jun 2, 2021
1 parent 3ae648e commit 1b9a82e
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 0 deletions.
1 change: 1 addition & 0 deletions zynthian_related_partner_country/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import models
37 changes: 37 additions & 0 deletions zynthian_related_partner_country/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#******************************************************************************
# ZYNTHIAN SALE ORDER
#
# Copyright (C) 2020 Susanna Fort <[email protected]>
#
#******************************************************************************
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the LICENSE.txt file.
#
#******************************************************************************

{
'name': "Zynthian Related Partner Country",

'summary': """This module modify sale order model Odoo v9.0""",
'author': "Vandekul",
'website': "https://github.com/vandekul",
'category': 'Sale Order',
'version': '9.0',
'license': 'GPL-3',
'application': True,
'depends': ['base','sale','account'],
'installable': True,
'auto_install': False,
'description': 'static/description/index.html',
'images': ['static/description/icon.png'],
}
2 changes: 2 additions & 0 deletions zynthian_related_partner_country/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import sale
import invoice
34 changes: 34 additions & 0 deletions zynthian_related_partner_country/models/invoice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#******************************************************************************
# Sale Order ODOO
#
#
#******************************************************************************
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the LICENSE.txt file.
#
#******************************************************************************

from openerp import api, fields, models, _
from openerp.osv import osv

import logging
import pprint
from openerp.http import request
from openerp import http, SUPERUSER_ID

_logger = logging.getLogger(__name__)

class AccountInvoice(models.Model):
_inherit = "account.invoice"

related_partner_country = fields.Char("Customer Country", related="partner_id.country_id.name", store=True)
34 changes: 34 additions & 0 deletions zynthian_related_partner_country/models/sale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#******************************************************************************
# Sale Order ODOO
#
#
#******************************************************************************
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the LICENSE.txt file.
#
#******************************************************************************

from openerp import api, fields, models, _
from openerp.osv import osv

import logging
import pprint
from openerp.http import request
from openerp import http, SUPERUSER_ID

_logger = logging.getLogger(__name__)

class SaleOrder(models.Model):
_inherit = "sale.order"

related_partner_country = fields.Char("Customer Country", related="partner_id.country_id.name", store=True)
22 changes: 22 additions & 0 deletions zynthian_related_partner_country/static/description/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<html xmlns="http://www.w3.org/1999/html">
<body>

<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Zynthian Related Partner Country</h2>
<h3 class="oe_slogan">This is the module that allows to filter by Partner Country in Odoo 9.0</h3>
<div class="oe_span6">
<!--<div class="oe_bg_img">
<img src="Btcpay_com.png" class="oe_picture oe_screenshot">
</div>-->
</div>
<div">
<p>
This module allows that you can filter and group by Partner Country in the invoice and sale order lists documents. Don't show this field in list view.
</p>
</div>
</div>
</section>

</body>
</html>

0 comments on commit 1b9a82e

Please sign in to comment.