Browse Source

Mar 7 :[UPDT] Updated 'mobile_service_shop'

pull/346/merge
AjmalCybro 2 months ago
parent
commit
ca5efde35b
  1. 1
      mobile_service_shop/models/mobile_brand.py
  2. 1
      mobile_service_shop/models/mobile_complaint.py
  3. 2
      mobile_service_shop/models/mobile_complaint_description.py
  4. 14
      mobile_service_shop/models/product_template.py
  5. 1
      mobile_service_shop/models/terms_condition.py
  6. 4
      mobile_service_shop/static/description/index.html
  7. 21
      mobile_service_shop/views/mobile_brand_views.xml
  8. 21
      mobile_service_shop/views/mobile_complaint_views.xml
  9. 2
      mobile_service_shop/views/mobile_service_views.xml
  10. 2
      mobile_service_shop/views/product_product_views.xml
  11. 3
      mobile_service_shop/views/product_template_views.xml
  12. 19
      mobile_service_shop/views/terms_and_condition_views.xml

1
mobile_service_shop/models/mobile_brand.py

@ -26,7 +26,6 @@ class MobileBrand(models.Model):
"""This model represents the Mobile Brand""" """This model represents the Mobile Brand"""
_name = 'mobile.brand' _name = 'mobile.brand'
_description = 'Mobile Brand' _description = 'Mobile Brand'
_inherit = ['mail.thread', 'mail.activity.mixin']
_rec_name = 'brand_name' _rec_name = 'brand_name'
brand_name = fields.Char(string="Mobile Brand", required=True, brand_name = fields.Char(string="Mobile Brand", required=True,

1
mobile_service_shop/models/mobile_complaint.py

@ -26,7 +26,6 @@ class MobileComplaint(models.Model):
"""This model represents for the mobile Complaint type managing""" """This model represents for the mobile Complaint type managing"""
_name = 'mobile.complaint' _name = 'mobile.complaint'
_description = 'Mobile Complaint' _description = 'Mobile Complaint'
_inherit = ['mail.thread', 'mail.activity.mixin']
_rec_name = 'complaint_type' _rec_name = 'complaint_type'
complaint_type = fields.Char(string="Complaint Type", required=True, complaint_type = fields.Char(string="Complaint Type", required=True,

2
mobile_service_shop/models/mobile_complaint_description.py

@ -31,7 +31,7 @@ class MobileComplaintDescription(models.Model):
complaint_type_template = fields.Many2one('mobile.complaint', complaint_type_template = fields.Many2one('mobile.complaint',
string="Complaint Type", string="Complaint Type",
required=True, required=True, copy=False,
help="Complaint type template.") help="Complaint type template.")
description = fields.Text(string="Description", description = fields.Text(string="Description",
help="Complaint description.") help="Complaint description.")

14
mobile_service_shop/models/product_template.py

@ -19,7 +19,7 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import fields, models from odoo import api, fields, models
class ProductTemplate(models.Model): class ProductTemplate(models.Model):
@ -31,9 +31,19 @@ class ProductTemplate(models.Model):
help="Specify if the product is a mobile part or not.") help="Specify if the product is a mobile part or not.")
brand_name = fields.Many2one('mobile.brand', string="Brand", brand_name = fields.Many2one('mobile.brand', string="Brand",
help="Select a mobile brand for the part.") help="Select a mobile brand for the part.")
allowed_model_ids = fields.Many2many('brand.model', compute='_compute_allowed_model_ids')
model_name = fields.Many2one('brand.model', string="Model Name", model_name = fields.Many2one('brand.model', string="Model Name",
domain="[('mobile_brand_name','=',brand_name)]",
help="Select a model for the part.") help="Select a model for the part.")
model_colour = fields.Char(string="Colour", help="Colour for the part.") model_colour = fields.Char(string="Colour", help="Colour for the part.")
extra_descriptions = fields.Text(string="Note", help="Extra description " extra_descriptions = fields.Text(string="Note", help="Extra description "
"for the part.") "for the part.")
@api.depends('brand_name')
def _compute_allowed_model_ids(self):
for rec in self:
if rec.brand_name:
rec.allowed_model_ids = self.env['brand.model'].search([
('mobile_brand_name', '=', rec.brand_name.id)
]).ids
else:
rec.allowed_model_ids = self.env['brand.model'].search([]).ids

1
mobile_service_shop/models/terms_condition.py

@ -26,7 +26,6 @@ class TermsConditions(models.Model):
"""Used to add the Mobile Service Terms and Conditions""" """Used to add the Mobile Service Terms and Conditions"""
_name = 'terms.conditions' _name = 'terms.conditions'
_description = 'Terms and Conditions' _description = 'Terms and Conditions'
_inherit = ['mail.thread', 'mail.activity.mixin']
_rec_name = 'terms_id' _rec_name = 'terms_id'
terms_id = fields.Char(String="Terms and condition", terms_id = fields.Char(String="Terms and condition",

4
mobile_service_shop/static/description/index.html

@ -132,7 +132,7 @@
font-size: 46px; font-size: 46px;
font-weight: 700; font-weight: 700;
line-height: normal; line-height: normal;
">Mobile Service Management</span> ">Mobile Service Management
</h1> </h1>
</div> </div>
<div class="col-lg-12 d-flex justify-content-center align-items-center" <div class="col-lg-12 d-flex justify-content-center align-items-center"
@ -1313,6 +1313,7 @@
</a> </a>
</div> </div>
</div> </div>
</section>
</div> </div>
<!-- licence --> <!-- licence -->
<div class="tab-pane fade" id="profile" role="tabpanel" <div class="tab-pane fade" id="profile" role="tabpanel"
@ -1323,7 +1324,6 @@
</div> </div>
<!-- --> <!-- -->
</div> </div>
</section>
<!-- --> <!-- -->
</div> </div>
</div> </div>

21
mobile_service_shop/views/mobile_brand_views.xml

@ -1,28 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<!-- Mobile.brand model form view-->
<record id="mobile_brand_view_form" model="ir.ui.view">
<field name="name">mobile.brand.view.form</field>
<field name="model">mobile.brand</field>
<field name="arch" type="xml">
<form string="Brand">
<sheet>
<group>
<group>
<field name="brand_name"/>
</group>
</group>
</sheet>
<chatter/>
</form>
</field>
</record>
<!--Mobile.brand model tree view--> <!--Mobile.brand model tree view-->
<record id="mobile_brand_view_tree" model="ir.ui.view"> <record id="mobile_brand_view_tree" model="ir.ui.view">
<field name="name">mobile.brand.view.tree</field> <field name="name">mobile.brand.view.tree</field>
<field name="model">mobile.brand</field> <field name="model">mobile.brand</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<list> <list editable="bottom">
<field name="brand_name"/> <field name="brand_name"/>
</list> </list>
</field> </field>
@ -31,7 +14,7 @@
<record id="mobile_brand_action" model="ir.actions.act_window"> <record id="mobile_brand_action" model="ir.actions.act_window">
<field name="name">Mobile Brand</field> <field name="name">Mobile Brand</field>
<field name="res_model">mobile.brand</field> <field name="res_model">mobile.brand</field>
<field name="view_mode">list,form</field> <field name="view_mode">list</field>
<field name="view_id" ref="mobile_brand_view_tree"/> <field name="view_id" ref="mobile_brand_view_tree"/>
<field name="help" type="html"> <field name="help" type="html">
<p class="oe_view_nocontent_create"> <p class="oe_view_nocontent_create">

21
mobile_service_shop/views/mobile_complaint_views.xml

@ -1,28 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<!-- Mobile complaint model form view-->
<record id="mobile_complaint_view_form" model="ir.ui.view">
<field name="name">mobile.complaint.view.form</field>
<field name="model">mobile.complaint</field>
<field name="arch" type="xml">
<form string="Complaint Type">
<sheet>
<group>
<group>
<field name="complaint_type"/>
</group>
</group>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- Mobile complaint model tree view--> <!-- Mobile complaint model tree view-->
<record id="mobile_complaint_view_tree" model="ir.ui.view"> <record id="mobile_complaint_view_tree" model="ir.ui.view">
<field name="name">mobile.complaint.view.tree</field> <field name="name">mobile.complaint.view.tree</field>
<field name="model">mobile.complaint</field> <field name="model">mobile.complaint</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<list> <list editable="bottom">
<field name="complaint_type"/> <field name="complaint_type"/>
</list> </list>
</field> </field>
@ -31,7 +14,7 @@
<record id="mobile_complaint_action" model="ir.actions.act_window"> <record id="mobile_complaint_action" model="ir.actions.act_window">
<field name="name">Complaint Types</field> <field name="name">Complaint Types</field>
<field name="res_model">mobile.complaint</field> <field name="res_model">mobile.complaint</field>
<field name="view_mode">list,form</field> <field name="view_mode">list</field>
<field name="view_id" ref="mobile_complaint_view_tree"/> <field name="view_id" ref="mobile_complaint_view_tree"/>
<field name="help" type="html"> <field name="help" type="html">
<p class="oe_view_nocontent_create"> <p class="oe_view_nocontent_create">

2
mobile_service_shop/views/mobile_service_views.xml

@ -264,7 +264,7 @@
</record> </record>
<!--Mobile service model menus--> <!--Mobile service model menus-->
<menuitem id="mobile_service_shop_menu_root" web_icon="mobile_service_shop,static/description/icon.png" <menuitem id="mobile_service_shop_menu_root" web_icon="mobile_service_shop,static/description/icon.png"
name="Mobile Service" sequence="20"/> name="Mobile Service" sequence="20" groups="mobile_service_shop.mobile_service_group_executer"/>
<menuitem id="mobile_service_shop_menu" parent="mobile_service_shop_menu_root" sequence="20"/> <menuitem id="mobile_service_shop_menu" parent="mobile_service_shop_menu_root" sequence="20"/>
<menuitem action="mobile_service_action_request" id="mobile_service_menu_request" <menuitem action="mobile_service_action_request" id="mobile_service_menu_request"
parent="mobile_service_shop_menu_root" parent="mobile_service_shop_menu_root"

2
mobile_service_shop/views/product_product_views.xml

@ -40,7 +40,7 @@
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field> <field name="res_model">product.product</field>
<field name="view_mode">kanban,list,form</field> <field name="view_mode">kanban,list,form</field>
<field name="context">{"search_default_consumable":1, 'default_type': 'consu'}</field> <field name="context">{"search_default_consumable":1, 'default_type': 'consu', 'default_is_a_parts': 1}</field>
<field name="domain">[('is_a_parts', '=', True)]</field> <field name="domain">[('is_a_parts', '=', True)]</field>
<field name="help" type="html"> <field name="help" type="html">
<p class="oe_view_nocontent_create"> <p class="oe_view_nocontent_create">

3
mobile_service_shop/views/product_template_views.xml

@ -15,7 +15,8 @@
<group> <group>
<group> <group>
<field name="brand_name" required="is_a_parts == True"/> <field name="brand_name" required="is_a_parts == True"/>
<field name="model_name" required="is_a_parts == True"/> <field name="model_name" domain="[('id', 'in', allowed_model_ids)]" required="is_a_parts == True"/>
<field name="allowed_model_ids" invisible="1"/>
</group> </group>
<group> <group>
<field name="model_colour"/> <field name="model_colour"/>

19
mobile_service_shop/views/terms_and_condition_views.xml

@ -1,26 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<!--Model terms and conditions form view-->
<record id="terms_conditions_view_form" model="ir.ui.view">
<field name="name">terms.conditions.view.form</field>
<field name="model">terms.conditions</field>
<field name="arch" type="xml">
<form string="Complaint Type">
<sheet>
<group>
<field name="terms_conditions"/>
</group>
</sheet>
<chatter/>
</form>
</field>
</record>
<!--Model terms and conditions tree view--> <!--Model terms and conditions tree view-->
<record id="terms_conditions_view_tree" model="ir.ui.view"> <record id="terms_conditions_view_tree" model="ir.ui.view">
<field name="name">terms.conditions.view.tree</field> <field name="name">terms.conditions.view.tree</field>
<field name="model">terms.conditions</field> <field name="model">terms.conditions</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<list> <list editable="bottom">
<field name="terms_conditions"/> <field name="terms_conditions"/>
</list> </list>
</field> </field>
@ -29,7 +14,7 @@
<record id="terms_and_conditions_action" model="ir.actions.act_window"> <record id="terms_and_conditions_action" model="ir.actions.act_window">
<field name="name">Terms and Conditions</field> <field name="name">Terms and Conditions</field>
<field name="res_model">terms.conditions</field> <field name="res_model">terms.conditions</field>
<field name="view_mode">list,form</field> <field name="view_mode">list</field>
<field name="view_id" ref="terms_conditions_view_tree"/> <field name="view_id" ref="terms_conditions_view_tree"/>
<field name="help" type="html"> <field name="help" type="html">
<p class="oe_view_nocontent_create"> <p class="oe_view_nocontent_create">

Loading…
Cancel
Save