[IMP] repair_calendar_view: black, isort

This commit is contained in:
ps-tubtim
2020-03-26 13:55:54 +07:00
parent a627df231d
commit 90e50a29a1
3 changed files with 33 additions and 27 deletions

View File

@@ -3,13 +3,13 @@
{
'name': 'Repair Calendar View',
'version': '12.0.1.0.0',
'category': 'Manufacturing',
'author': "Agile Business Group, Odoo Community Association (OCA)",
'website': 'http://www.agilebg.com',
'license': 'LGPL-3',
'depends': ['repair'],
'data': ['views/mrp_repair_view.xml'],
'installable': True,
"name": "Repair Calendar View",
"version": "13.0.1.0.0",
"category": "Manufacturing",
"author": "Agile Business Group, Odoo Community Association (OCA)",
"website": "http://www.agilebg.com",
"license": "LGPL-3",
"depends": ["repair"],
"data": ["views/mrp_repair_view.xml"],
"installable": True,
}

View File

@@ -5,12 +5,17 @@ from odoo import fields, models
class RepairOrder(models.Model):
_inherit = 'repair.order'
_inherit = "repair.order"
user_id = fields.Many2one('res.users', 'User',
default=lambda self: self.env.user,
help="Person in charge for the repair")
date_repair = fields.Datetime('Repair Date', default=fields.Datetime.now,
copy=False,
help="Date of the repair, this field "
"and user_id defines the calendar")
user_id = fields.Many2one(
comodel_name="res.users",
string="User",
default=lambda self: self.env.user,
help="Person in charge for the repair",
)
date_repair = fields.Datetime(
string="Repair Date",
default=fields.Datetime.now,
copy=False,
help="Date of the repair, this field " "and user_id defines the calendar",
)

View File

@@ -1,32 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_repair_order_calendar_form" model="ir.ui.view">
<field name="name">repair.calendar.form</field>
<field name="model">repair.order</field>
<field name="inherit_id" ref="repair.view_repair_order_form"/>
<field name="inherit_id" ref="repair.view_repair_order_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='guarantee_limit']" position="after">
<field name="date_repair"/>
<field name="date_repair" />
</xpath>
<xpath expr="//field[@name='partner_id']" position="after">
<field name="user_id"/>
<field name="user_id" />
</xpath>
</field>
</record>
<record id="view_repair_order_calendar" model="ir.ui.view">
<field name="name">Repair Orders Calendar</field>
<field name="model">repair.order</field>
<field name="arch" type="xml">
<calendar string="Repair Orders Calendar" date_start="date_repair" color="user_id">
<field name="product_id"/>
<field name="partner_id"/>
<calendar
string="Repair Orders Calendar"
date_start="date_repair"
color="user_id"
>
<field name="product_id" />
<field name="partner_id" />
</calendar>
</field>
</record>
<record id="repair.action_repair_order_tree" model="ir.actions.act_window">
<field name="view_mode">tree,kanban,calendar,form</field>
</record>
</odoo>