mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update app-odoo , app base
This commit is contained in:
@@ -32,14 +32,14 @@
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
'name': "Base Pro, 基础增强",
|
||||
'version': '13.19.10.16',
|
||||
'name': "Partner set customer vendor",
|
||||
'version': '13.19.10.28',
|
||||
'author': 'Sunpop.cn',
|
||||
'category': 'Base',
|
||||
'website': 'https://www.sunpop.cn',
|
||||
'license': 'LGPL-3',
|
||||
'sequence': 2,
|
||||
'price': 0.00,
|
||||
'price': 18.00,
|
||||
'currency': 'EUR',
|
||||
'images': ['static/description/banner.png'],
|
||||
'depends': [
|
||||
@@ -47,12 +47,13 @@
|
||||
'purchase',
|
||||
],
|
||||
'summary': """
|
||||
Add customer, vendor (supplier) field to partner model and views.
|
||||
Set and view partner type: customer or vendor.
|
||||
Odoo App of Sunpop.cn
|
||||
""",
|
||||
'description': """
|
||||
Support Odoo 13,12, 11, Enterprise and Community Edition
|
||||
1. Add customer, supplier field to partner
|
||||
2.
|
||||
Support Odoo 13, Enterprise and Community Edition
|
||||
1. Add customer, vendor field to partner
|
||||
3. Multi-language Support.
|
||||
4. Multi-Company Support.
|
||||
5. Support Odoo 13,12, 11, Enterprise and Community Edition
|
||||
|
||||
@@ -23,6 +23,14 @@ def pre_init_hook(cr):
|
||||
# cr.execute("")
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
try:
|
||||
#
|
||||
sql = "UPDATE res_partner SET customer = TRUE WHERE customer_rank >= 1;"
|
||||
cr.execute(sql)
|
||||
sql = "UPDATE res_partner SET supplier = TRUE WHERE supplier_rank >= 1"
|
||||
cr.execute(sql)
|
||||
except Exception as e:
|
||||
pass
|
||||
pass
|
||||
# cr.execute("")
|
||||
|
||||
|
||||
@@ -24,7 +24,41 @@ from odoo.tools import pycompat
|
||||
|
||||
class Partner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
customer = fields.Boolean(string='Is a Customer', default=True,
|
||||
|
||||
def _get_default_customer(self):
|
||||
search_partner_mode = self.env.context.get('res_partner_search_mode')
|
||||
is_customer = search_partner_mode == 'customer'
|
||||
if is_customer and not self.env.context.get('default_customer'):
|
||||
return is_customer
|
||||
else:
|
||||
return None
|
||||
|
||||
def _get_default_supplier(self):
|
||||
search_partner_mode = self.env.context.get('res_partner_search_mode')
|
||||
is_supplier = search_partner_mode == 'supplier'
|
||||
if is_supplier and not self.env.context.get('default_supplier'):
|
||||
return is_supplier
|
||||
else:
|
||||
return None
|
||||
|
||||
customer = fields.Boolean(string='Is a Customer', default=_get_default_customer, inverse='_set_customer',
|
||||
help="Check this box if this contact is a customer. It can be selected in sales orders.")
|
||||
supplier = fields.Boolean(string='Is a Vendor',
|
||||
supplier = fields.Boolean(string='Is a Vendor', default=_get_default_supplier, inverse='_set_supplier',
|
||||
help="Check this box if this contact is a vendor. It can be selected in purchase orders.")
|
||||
|
||||
def _set_customer(self):
|
||||
for rec in self:
|
||||
if rec.customer:
|
||||
if rec.customer_rank < 1 or not rec.customer_rank:
|
||||
rec.customer_rank = 1
|
||||
else:
|
||||
rec.customer_rank = 0
|
||||
|
||||
def _set_supplier(self):
|
||||
for rec in self:
|
||||
if rec.supplier:
|
||||
if rec.supplier_rank < 1 or not rec.supplier_rank:
|
||||
rec.supplier_rank = 1
|
||||
else:
|
||||
rec.supplier_rank = 0
|
||||
|
||||
|
||||
BIN
app_base/static/description/demo1.jpg
Normal file
BIN
app_base/static/description/demo1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
@@ -1,10 +1,10 @@
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced" >
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan"> </h2>
|
||||
<h3 class="oe_slogan"> </h3>
|
||||
<h2 class="oe_slogan"> Partner set customer vendor </h2>
|
||||
<h3 class="oe_slogan"> Set and view partner type: customer or vendor. </h3>
|
||||
<div class="oe_row">
|
||||
<h3>Lastest update: v12.19.04.28</h3>
|
||||
<h3>Lastest update: v13.19.10.28</h3>
|
||||
<div class="oe_span12">
|
||||
<img class="oe_demo oe_screenshot" style="max-height: 100%;" src="banner.png">
|
||||
</div>
|
||||
@@ -14,19 +14,11 @@
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
<i class="fa fa-check-square-o text-primary"></i>
|
||||
Put key function here.
|
||||
Add customer, vendor field to partner model and views. Like odoo 12.
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-check-square-o text-primary"></i>
|
||||
3. Multi-language Support.
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-check-square-o text-primary"></i>
|
||||
4. Multi-Company Support.
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-check-square-o text-primary"></i>
|
||||
5. Support Odoo 13,12, 11, Enterprise and Community Edition.
|
||||
Set and view partner type: customer or supplier.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -38,10 +30,10 @@
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h1 class="text-danger text-center">So Easy to navigator and search any data.</h1>
|
||||
<h1 class="text-danger text-center">So Easy to set and show customer or vendor.</h1>
|
||||
<h4 class="oe_slogan"> </h4>
|
||||
<div class="oe_demo oe_screenshot">
|
||||
<img src=".jpg"/>
|
||||
<img src="demo1.jpg"/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user