<commit_before><?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2016 LasLabs Inc.
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>

    <record id="medical_patient_disease_view_search" model="ir.ui.view">
        <field name="name">medical.patient.disease.search</field>
        <field name="model">medical.patient.disease</field>
        <field name="arch" type="xml">
            <search string="Medical Patient Disease">
                <field name="name" />
                <field name="treatment_description" />
                <field name="date_healed" />
                <field name="pathology_id" />
                <field name="physician_id" />
                <field name="weeks_of_pregnancy" />
                <field name="date_diagnosed" />
                <field name="notes" />
                <field name="date_treatment_end" />
                <field name="patient_id" />
                <field name="age" />
                <field name="date_treatment_start" />
                <field name="short_comment" />
                <filter name="is_on_treatment"
                        string="Is on Treatment"
                        domain="[('is_on_treatment', '=', True)]" />
                <separator />
                <filter name="is_allergy"
                        string="Is Allergy"
                        domain="[('is_allergy', '=', True)]" />
                <separator />
                <filter name="inactive"
                        string="Inactive"
                        domain="[('active', '=', False)]" />
                <separator />
                <filter name="is_pregnant"
                        string="Pregnancy Warning"
                        domain="[('is_pregnant', '=', True)]" />
                <separator />
                <filter name="is_infectious"
                        string="Is Infectious"
                        domain="[('is_infectious', '=', True)]" />
                <filter name="is_not_infectious"
                        string="Not Infectious"
                        domain="[('is_infectious', '=', False)]" />
                <newline />
                <group expand="0" string="Group By...">
                    <filter string="Healed"
                            domain="[]"
                            context="{'group_by':'date_healed'}" />
                    <filter string="Disease"
                            domain="[]"
                            context="{'group_by':'pathology_id'}" />
                    <filter string="Allergic Disease"
                            domain="[]"
                            context="{'group_by':'is_allergy'}" />
                    <filter string="Physician"
                            domain="[]"
                            context="{'group_by':'physician_id'}" />
                    <filter string="Pregnancy warning"
                            domain="[]"
                            context="{'group_by':'is_pregnant'}" />
                    <filter string="Contracted in pregnancy week #"
                            domain="[]"
                            context="{'group_by':'weeks_of_pregnancy'}" />
                    <filter string="Currently on Treatment"
                            domain="[]"
                            context="{'group_by':'is_on_treatment'}" />
                    <filter string="Date of Diagnosis"
                            domain="[]"
                            context="{'group_by':'date_diagnosed'}" />
                    <filter string="Infectious Disease"
                            domain="[]"
                            context="{'group_by':'is_infectious'}" />
                    <filter string="Patient"
                            domain="[]"
                            context="{'group_by':'patient_id'}" />
                    <filter string="Age when diagnosed"
                            domain="[]"
                            context="{'group_by':'age'}" />
                    <filter string="Start"
                            domain="[]"
                            context="{'group_by':'date_treatment_start'}" />
                    <filter string="State"
                            domain="[]"
                            context="{'group_by':'state'}" />
                </group>
            </search>
        </field>
    </record>

    <record id="medical_patient_disease_view_tree" model="ir.ui.view">
        <field name="name">medical.patient.disease.tree</field>
        <field name="model">medical.patient.disease</field>
        <field name="arch" type="xml">
            <tree string="Medical Patient Disease">
                <field name="name" />
                <field name="patient_id" />
                <field name="physician_id" />
                <field name="date_treatment_start" />
                <field name="date_treatment_end" />
                <field name="state" />
            </tree>
        </field>
    </record>

    <record id="medical_patient_disease_view_form" model="ir.ui.view">
        <field name="name">medical.patient.disease.form</field>
        <field name="model">medical.patient.disease</field>
        <field name="arch" type="xml">
            <form string="Medical Patient Disease">
                <header>
                    <field name="state" widget="statusbar" clickable="True" />
                </header>
                <sheet>
                    <div class="oe_title" name="title">
                        <label for="name" class="edit_only" />
                        <h1><field name="name"/></h1>
                    </div>
                    <div class="oe_button_box" name="buttons">
                        <button name="toggle_active"
                                type="object"
                                class="oe_stat_button"
                                icon="fa-archive"
                                >
                            <field name="active"
                                   widget="boolean_button"
                                   options='{"terminology": "archive"}'
                                   />
                        </button>
                    </div>
                    <group name="data">
                        <group name="main">
                            <group name="group_main_left">
                                <field name="patient_id" />
                                <field name="short_comment" />
                                <field name="treatment_description" />
                            </group>
                            <group name="group_main_right">
                                <field name="pathology_id" />
                                <field name="physician_id" />
                                <field name="allergy_type"
                                       attrs="{'invisible': [('is_allergy', '=', False)]}" />
                                <field name="weeks_of_pregnancy"
                                       attrs="{'invisible': [('is_pregnant', '=', False)]}" />
                            </group>
                        </group>
                        <group name="supplementary">
                            <group name="group_supplementary_left">
                                <field name="age" />
                                <field name="is_infectious" />
                                <field name="is_allergy" />
                                <field name="is_pregnant" />
                            </group>
                            <group name="group_supplementary_right">
                                <field name="date_diagnosed" />
                                <field name="date_treatment_start" />
                                <field name="date_treatment_end" />
                                <field name="is_on_treatment" />
                                <field name="date_healed" />
                            </group>
                        </group>
                    </group>
                    <group name="state" attrs="{'invisible': [('id','=',False)]}">
                        <group name="group_validity">
                            <group>
                                <field name="create_date" />
                            </group>
                            <group>
                                <field name="date_expire"
                                       attrs="{'invisible': [('active','=',True)]}"
                                       />
                            </group>
                        </group>
                    </group>
                    <notebook>
                        <page string="Others" name="notes" autofocus="autofocus">
                            <separator string="Notes" />
                            <field name="notes" />
                        </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <record id="medical_patient_disease_action" model="ir.actions.act_window">
        <field name="name">Patient Diseases</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">medical.patient.disease</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
    </record>

</odoo>
<commit_msg>[FIX][10.0] Fixes LasLabs#147 - allows disease creation in medical_patient_disease (LasLabs#158)<commit_after><?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2016 LasLabs Inc.
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>

    <record id="medical_patient_disease_view_search" model="ir.ui.view">
        <field name="name">medical.patient.disease.search</field>
        <field name="model">medical.patient.disease</field>
        <field name="arch" type="xml">
            <search string="Medical Patient Disease">
                <field name="name" />
                <field name="treatment_description" />
                <field name="date_healed" />
                <field name="pathology_id" />
                <field name="physician_id" />
                <field name="weeks_of_pregnancy" />
                <field name="date_diagnosed" />
                <field name="notes" />
                <field name="date_treatment_end" />
                <field name="patient_id" />
                <field name="age" />
                <field name="date_treatment_start" />
                <field name="short_comment" />
                <filter name="is_on_treatment"
                        string="Is on Treatment"
                        domain="[('is_on_treatment', '=', True)]" />
                <separator />
                <filter name="is_allergy"
                        string="Is Allergy"
                        domain="[('is_allergy', '=', True)]" />
                <separator />
                <filter name="inactive"
                        string="Inactive"
                        domain="[('active', '=', False)]" />
                <separator />
                <filter name="is_pregnant"
                        string="Pregnancy Warning"
                        domain="[('is_pregnant', '=', True)]" />
                <separator />
                <filter name="is_infectious"
                        string="Is Infectious"
                        domain="[('is_infectious', '=', True)]" />
                <filter name="is_not_infectious"
                        string="Not Infectious"
                        domain="[('is_infectious', '=', False)]" />
                <newline />
                <group expand="0" string="Group By...">
                    <filter string="Healed"
                            domain="[]"
                            context="{'group_by':'date_healed'}" />
                    <filter string="Disease"
                            domain="[]"
                            context="{'group_by':'pathology_id'}" />
                    <filter string="Allergic Disease"
                            domain="[]"
                            context="{'group_by':'is_allergy'}" />
                    <filter string="Physician"
                            domain="[]"
                            context="{'group_by':'physician_id'}" />
                    <filter string="Pregnancy warning"
                            domain="[]"
                            context="{'group_by':'is_pregnant'}" />
                    <filter string="Contracted in pregnancy week #"
                            domain="[]"
                            context="{'group_by':'weeks_of_pregnancy'}" />
                    <filter string="Currently on Treatment"
                            domain="[]"
                            context="{'group_by':'is_on_treatment'}" />
                    <filter string="Date of Diagnosis"
                            domain="[]"
                            context="{'group_by':'date_diagnosed'}" />
                    <filter string="Infectious Disease"
                            domain="[]"
                            context="{'group_by':'is_infectious'}" />
                    <filter string="Patient"
                            domain="[]"
                            context="{'group_by':'patient_id'}" />
                    <filter string="Age when diagnosed"
                            domain="[]"
                            context="{'group_by':'age'}" />
                    <filter string="Start"
                            domain="[]"
                            context="{'group_by':'date_treatment_start'}" />
                    <filter string="State"
                            domain="[]"
                            context="{'group_by':'state'}" />
                </group>
            </search>
        </field>
    </record>

    <record id="medical_patient_disease_view_tree" model="ir.ui.view">
        <field name="name">medical.patient.disease.tree</field>
        <field name="model">medical.patient.disease</field>
        <field name="arch" type="xml">
            <tree string="Medical Patient Disease">
                <field name="name" />
                <field name="patient_id" />
                <field name="physician_id" />
                <field name="date_treatment_start" />
                <field name="date_treatment_end" />
                <field name="state" />
            </tree>
        </field>
    </record>

    <record id="medical_patient_disease_view_form" model="ir.ui.view">
        <field name="name">medical.patient.disease.form</field>
        <field name="model">medical.patient.disease</field>
        <field name="arch" type="xml">
            <form string="Medical Patient Disease">
                <header>
                    <field name="state" widget="statusbar" clickable="True" />
                </header>
                <sheet>
                    <div class="oe_title" name="title">
                        <label for="name" class="edit_only" />
                        <h1><field name="name"/></h1>
                    </div>
                    <div class="oe_button_box" name="buttons">
                        <button name="toggle_active"
                                type="object"
                                class="oe_stat_button"
                                icon="fa-archive"
                                >
                            <field name="active"
                                   widget="boolean_button"
                                   options='{"terminology": "archive"}'
                                   />
                        </button>
                    </div>
                    <group name="data">
                        <group name="main">
                            <group name="group_main_left">
                                <field name="patient_id" />
                                <field name="short_comment" />
                                <field name="treatment_description" />
                            </group>
                            <group name="group_main_right">
                                <field name="pathology_id" />
                                <field name="physician_id" />
                                <field name="allergy_type"
                                       attrs="{'invisible': [('is_allergy', '=', False)]}" />
                                <field name="weeks_of_pregnancy"
                                       attrs="{'invisible': [('is_pregnant', '=', False)]}" />
                            </group>
                        </group>
                        <group name="supplementary">
                            <group name="group_supplementary_left">
                                <field name="age" />
                                <field name="is_infectious" />
                                <field name="is_allergy" />
                                <field name="is_pregnant" />
                            </group>
                            <group name="group_supplementary_right">
                                <field name="date_diagnosed" />
                                <field name="date_treatment_start" />
                                <field name="date_treatment_end" />
                                <field name="is_on_treatment" />
                                <field name="date_healed" />
                                <field name="id" invisible="1" />
                            </group>
                        </group>
                    </group>
                    <group name="state" attrs="{'invisible': [('id','=',False)]}">
                        <group name="group_validity">
                            <group>
                                <field name="create_date" />
                            </group>
                            <group>
                                <field name="date_expire"
                                       attrs="{'invisible': [('active','=',True)]}"
                                       />
                            </group>
                        </group>
                    </group>
                    <notebook>
                        <page string="Others" name="notes" autofocus="autofocus">
                            <separator string="Notes" />
                            <field name="notes" />
                        </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <record id="medical_patient_disease_action" model="ir.actions.act_window">
        <field name="name">Patient Diseases</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">medical.patient.disease</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
    </record>

</odoo>

{'fraction_non_alphanumeric': 0.1291364430560703, 'fraction_numerical': 0.0018001800180018, 'mean_word_length': 1.0519282998370452, 'pattern_counts': {'":': 2, '<': 310, '<?xml version=': 2, '>': 310, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4263099', 'n_tokens_mistral': 4782, 'n_tokens_neox': 4285, 'n_words': 707}