fix views"
This commit is contained in:
parent
c2fafc377d
commit
7f7474dd4d
3 changed files with 53 additions and 11 deletions
|
|
@ -27,6 +27,25 @@ class ResPartner(models.Model):
|
||||||
string="Partner Type",
|
string="Partner Type",
|
||||||
tracking=True)
|
tracking=True)
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def change_color_on_kanban(self):
|
||||||
|
for record in self:
|
||||||
|
color = 0
|
||||||
|
if record.odoo_partner_type == 'learning':
|
||||||
|
color = 2
|
||||||
|
elif record.status == 'ready':
|
||||||
|
color = 10
|
||||||
|
elif record.cleaning_status == 'silver':
|
||||||
|
color = 7
|
||||||
|
elif record.cleaning_status == 'gold':
|
||||||
|
color = 3
|
||||||
|
else:
|
||||||
|
if record.is_odoo_user:
|
||||||
|
color = 4
|
||||||
|
record.color = color
|
||||||
|
|
||||||
|
color = fields.Integer('Color Index', compute="change_color_on_kanban")
|
||||||
|
|
||||||
def set_image_from_url(self, url):
|
def set_image_from_url(self, url):
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,31 @@
|
||||||
<field name="model">res.partner</field>
|
<field name="model">res.partner</field>
|
||||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="phone" position="before">
|
<field name="company_type" position="after">
|
||||||
<field name="is_odoo_user"/>
|
<br/>
|
||||||
<field name="is_odoo_partner"/>
|
<field name="is_odoo_user"/>Odoo User
|
||||||
<field name="odoo_partner_type" attrs="{'invisible': [('is_odoo_partner', '=', False)]}"/>
|
<field name="is_odoo_partner"/>Odoo Partner
|
||||||
|
<br/>
|
||||||
|
<div attrs="{'invisible': [('is_odoo_partner', '=', False)]}">
|
||||||
|
<h3><field name="odoo_partner_type"/> Partner</h3>
|
||||||
|
</div>
|
||||||
</field>
|
</field>
|
||||||
|
<group name="container_row_2" position="after">
|
||||||
|
<group name="container_row_3">
|
||||||
|
<field name="relation_all_ids">
|
||||||
|
<tree>
|
||||||
|
<field name="other_partner_id" required="True" options="{'no_create': True}"
|
||||||
|
string="Customer" domain="[['relation_all_ids.type_selection_id.id', '=', 1]]"/>
|
||||||
|
<field name="date_start"/>
|
||||||
|
<field name="date_end"/>
|
||||||
|
<field name="active" invisible="1"/>
|
||||||
|
<field name="active" invisible="1"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_partner_tree_inherit" model="ir.ui.view">
|
<record id="view_partner_tree_inherit" model="ir.ui.view">
|
||||||
|
|
@ -41,12 +60,14 @@
|
||||||
<xpath expr="//kanban" position="inside">
|
<xpath expr="//kanban" position="inside">
|
||||||
<field name="odoo_partner_type"/>
|
<field name="odoo_partner_type"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<field name="display_name" position="after">
|
<xpath expr="//div[@class='oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban']" position="attributes">
|
||||||
<!-- <t t-if="record.odoo_partner_type.raw_value">-->
|
<attribute name="t-attf-class">oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban oe_kanban_color_#{record.color}</attribute>
|
||||||
<br/>
|
</xpath>
|
||||||
<field name="odoo_partner_type"/>
|
<xpath expr="//strong[@class='o_kanban_record_title oe_partner_heading']" position="before">
|
||||||
<!-- </t>-->
|
<strong t-if="record.odoo_partner_type.raw_value" class="o_kanban_record_subtitle oe_partner_heading">
|
||||||
</field>
|
<field name="odoo_partner_type"/>
|
||||||
|
</strong>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@
|
||||||
'license': 'GPL-3',
|
'license': 'GPL-3',
|
||||||
'author': 'Bemade',
|
'author': 'Bemade',
|
||||||
'website': 'https://www.bemade.org',
|
'website': 'https://www.bemade.org',
|
||||||
'depends': ['base', 'contacts', 'sale_management', 'sale' , 'partner_multi_relation'],
|
'depends': [
|
||||||
|
'bemade_odoo_partner_scrapper'
|
||||||
|
],
|
||||||
'data': [
|
'data': [
|
||||||
],
|
],
|
||||||
"assets": {
|
"assets": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue