Odoo Help

0

0
2 Answers
0
arthur
21.03.19, 10:59

Thanks to your answer @subbarao, Unfortunately, the changes  you mentioned didn't work for me =/

I will post my whole view to clarify things, but basically I created to two menuitems and two actions for them, that open the same list and form views, but with different domains.

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <menuitem
        id="raizs_receipt_root_menu"
        name="Recebimentos"
    />

<record id="raizs_stock_picking_form_view" model="ir.ui.view">
    <field name="name">raizs.stock.picking.form.view</field>
    <field name="model">stock.picking</field>
    <field name="priority" eval="20"/>
    <field name="arch" type="xml">
    <form string="Movimentos">
        <sheet>
            <group>
                <field name="name"></field>
                <field name="partner_id"></field>
                <field name="state"></field>
           </group>
           <notebook>
                <page string="Produtos" >
                    <field name="id" invisible="1"/>
                    <field name="move_lines">
                        <tree create="false" editable="bottom" options="{'no_open': True}">
                            <field name="state" invisible="True"/>
                            <field name="additional" invisible="True"/>
                            <field name="is_initial_demand_editable" invisible="True"/>
                            <field name="is_quantity_done_editable" invisible="True"/>
                            <field name="has_move_lines" invisible="True"/>
                            <field name="product_id" required="1" attrs="{'readonly': ['|', '&amp;', ('state', '!=', 'draft'),                             ('additional', '=', False), ('has_move_lines', '=', True)]}"/>
                            <field name="product_uom_qty" string="Initial Demand" attrs="{'readonly':                             [('is_initial_demand_editable', '=', False)]}"/>
                            <field name="quantity_done" string="Done" attrs="{'readonly': [('is_quantity_done_editable', '=',                             False)]}"/>
                            <field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}"                             options="{'no_open': True, 'no_create': True}" string="Unit of Measure"                             groups="product.group_uom"/>
                            <button name="add_quantity_done" string="+" type="object"/>
                            <button name="remove_quantity_done" string="-" type="object"/>
                        </tree>
                    </field>
                </page>
                </notebook>
            </sheet>
         </form>
    </field>
</record>

<record id="raizs_stock_picking_tree_view" model="ir.ui.view">
    <field name="name">raizs.stock.picking.tree.view</field>
    <field name="model">stock.picking</field>
    <field name="arch" type="xml">
        <tree string="Movimentos">
            <field name="partner_id"></field>
            <field name="scheduled_date"></field>
            <field name="state"></field>
        </tree>
    </field>
</record>

<record model="ir.actions.act_window" id="action_raizs_today_receipts">
    <field name="name">Recebimentos de hoje</field>
    <field name="res_pmodel">stock.picking</field>
    <field name="view_model">tree,form</field>
    <field name="view_ids" eval="[(5, 0, 0),
            (0, 0, {'view_mode': 'tree', 'view_id': ref('raizs_stock_picking_tree_view')}),
            (0, 0, {'view_mode': 'form', 'view_id': ref('raizs_stock_picking_form_view')})]"
    />
    <field name="domain">
        [
            ('scheduled_date','&gt;=',(context_today().strftime('%Y-%m-%d'))),
            ('location_dest_id','=',38)
        ]
    </field>
</record>
<menuitem
    id="raizs_today_receipts_menu"
    parent="raizs_receipt_root_menu"
    action="action_raizs_today_receipts"
/>

<record model="ir.actions.act_window" id="action_raizs_late_receipts">
    <field name="name">Recebimentos atrasados</field>
    <field name="res_model">stock.picking</field>
    <field name="view_model">tree,form</field>
    <field name="view_ids" eval="[(5, 0, 0),
        (0, 0, {'view_mode': 'tree', 'view_id': ref('raizs_stock_picking_tree_view')}),
        (0, 0, {'view_mode': 'form', 'view_id': ref('raizs_stock_picking_form_view')})]"
    />
    <field name="domain">
    [
        ('scheduled_date','&lt;=',(context_today().strftime('%Y-%m-%d'))),
        ('location_dest_id','=',38)
    ]
    </field>
</record>
<menuitem
    id="raizs_late_receipts_menu"
    parent="raizs_receipt_root_menu"
    action="action_raizs_late_receipts"
/>

</odoo> 


0
Avatar

subbarao

--subbarao--

1226
| 5 1 7
Chennai, India
--subbarao--


subbarao
21.03.19, 02:46

solution for Point 1

edit="false"  you have to remove
create="false" if you use ting you can't able to add new lines only possible to edit the existing lines

<field name="move_lines" style="pointer-events:none;">
                            <tree create="false" editable="bottom" options="{'no_open': True}">
                                    <field name="state" invisible="True"/>
                                    <field name="is_initial_demand_editable" invisible="True"/>
                                    <field name="is_quantity_done_editable" invisible="True"/>
                                    <field name="has_move_lines" invisible="True"/>
                                    <field name="product_id" required="1" attrs="{'readonly': ['|', '&amp;', ('state', '!=', 'draft'),                                                 ('additional', '=', False), ('has_move_lines', '=', True)]}"/>
                                    <field name="product_uom_qty" string="Initial Demand" attrs="{'readonly':                                                 [('is_initial_demand_editable', '=', False)]}"/>
                                    <field name="quantity_done" string="Done" attrs="{'readonly': [('is_quantity_done_editable',                                                 '=', False)]}"/>
                                    <field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}"                                             options="{'no_open': True, 'no_create': True}" string="Unit of Measure"                                            groups="product.group_uom"/>
                            </tree>
                    </field>


to reflect these changes you have inherit and add menu action of picking
form view_id = raizs_stock_picking_form_view
Ask a Question
Writer
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now