Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] fieldservice_stock_request: remove route_ids fields from requests #1260

Closed
wants to merge 1 commit into from

Conversation

tafaRU
Copy link
Member

@tafaRU tafaRU commented Nov 12, 2024

This is due after merge of OCA/stock-logistics-warehouse#2179
Ortherwise the module upgrade raises a ValidationError while validating view.

I paste below the tracebak error (sorry if it's in italian):

Il campo "route_ids" non esiste nel modello "stock.request"

View name: fsm.order.form.stock.request
Error context:
 view: ir.ui.view(1684,)
 xmlid: view_fsm_order_form_inherit_stock_request
 view.model: fsm.order
 view.parent: ir.ui.view(1614,)
 file: /srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/addons/fieldservice_stock_request/views/fsm_order.xml


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/modules/registry.py", line 89, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/modules/loading.py", line 455, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/modules/loading.py", line 347, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/modules/loading.py", line 222, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package)
  File "/srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/modules/loading.py", line 69, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
  File "/srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/tools/convert.py", line 733, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate)
  File "/srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/tools/convert.py", line 799, in convert_xml_import
    obj.parse(doc.getroot())
  File "/srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/tools/convert.py", line 719, in parse
    self._tag_root(de)
  File "/srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/tools/convert.py", line 681, in _tag_root
    raise ParseError('while parsing %s:%s, near\n%s' % (
odoo.tools.convert.ParseError: while parsing /srv/odoo/.pyenv/versions/3.8.13/lib/python3.8/site-packages/odoo/addons/fieldservice_stock_request/views/fsm_order.xml:2, near
<record id="view_fsm_order_form_inherit_stock_request" model="ir.ui.view">
        <field name="name">fsm.order.form.stock.request</field>
        <field name="model">fsm.order</field>
        <field name="inherit_id" ref="fieldservice_stock.view_fsm_order_form_inherit_stock"/>
        <field name="arch" type="xml">
            <data><xpath expr="//notebook/page[@id='stock']" position="inside">
                <header>
                    <button name="action_request_submit" attrs="{'invisible': [('request_stage', 'not in', ['draft'])]}" type="object" class="oe_highlight" string="Submit"/>
                    <button name="action_request_draft" type="object" attrs="{'invisible': [('request_stage', 'not in', ['cancel'])]}" class="oe_highlight" string="Set to Draft"/>
                    <button name="action_request_cancel" attrs="{'invisible': [('request_stage', 'not in', ['draft','submitted','open'])]}" type="object" string="Cancel"/>
                    <field name="request_stage" widget="statusbar"/>
                </header>
            </xpath>
            <field name="move_ids" position="before">
                <field name="stock_request_ids" nolabel="1">
                    <tree editable="bottom">
                        <field name="name" readonly="1"/>
                        <field name="product_id"/>
                        <field name="order_id" force_save="1"/>
                        <field name="allowed_uom_categ_id" invisible="1"/>
                        <field name="allow_virtual_location" invisible="1"/>
                        <field name="product_uom_id" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom"/>
                        <field name="direction" required="1"/>
                        <field name="route_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations" invisible="1"/>
                        <field name="route_ids" invisible="1"/>
                        <field name="product_uom_qty"/>
                        <field name="qty_in_progress"/>
                        <field name="qty_done"/>
                        <field name="expected_date"/>
                        <field name="picking_policy" invisible="1"/>
                        <field name="warehouse_id" invisible="1"/>
                        <field name="location_id" invisible="0"/>
                        <field name="procurement_group_id" invisible="1"/>
                        <field name="company_id" invisible="1"/>
                        <field name="state"/>
                    </tree>
                </field>
            </field>
        </data></field>
    </record>

@OCA-git-bot
Copy link
Contributor

Hi @max3903, @brian10048, @smangukiya, @wolfhall,
some modules you are maintaining are being modified, check this out!

@tafaRU
Copy link
Member Author

tafaRU commented Nov 12, 2024

The error with OCB build seems unrelated with this change. Please let me know if you have some hints in order to fix it.

@OCA/field-service-maintainers note that this is a hot fix so please review it asap. Thank you in advance.

@max3903 max3903 added this to the 14.0 milestone Nov 12, 2024
@max3903 max3903 self-assigned this Nov 12, 2024
@max3903
Copy link
Member

max3903 commented Nov 12, 2024

@tafaRU Sounds like OCA/stock-logistics-warehouse#2179 has been merged a little too quickly.

@max3903
Copy link
Member

max3903 commented Nov 12, 2024

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 14.0-ocabot-merge-pr-1260-by-max3903-bump-minor, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Nov 12, 2024
Signed-off-by max3903
@OCA-git-bot
Copy link
Contributor

@max3903 your merge command was aborted due to failed check(s), which you can inspect on this commit of 14.0-ocabot-merge-pr-1260-by-max3903-bump-minor.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@tafaRU
Copy link
Member Author

tafaRU commented Nov 13, 2024

thank you @max3903!

@tafaRU
Copy link
Member Author

tafaRU commented Nov 13, 2024

ah wait! Bot evidently failed due to #1260 (comment):

The error with OCB build seems unrelated with this change. Please let me know if you have some hints in order to fix it.

@max3903
Copy link
Member

max3903 commented Nov 13, 2024

@tafaRU Can you fix it? I believe we should have a decimal accuracy for coordinates evaluation and avoid those problems.

@tafaRU
Copy link
Member Author

tafaRU commented Nov 14, 2024

I believe we should have a decimal accuracy for coordinates evaluation

Do you mean something different to:

?

Can you fix it?

I think I don't know the subject well enough.
Just looking at the error raised a quick solution should be:

But I would prefer to hear your (@max3903) opinion and @wolfhall's opinion first.

@max3903
Copy link
Member

max3903 commented Nov 14, 2024

@tafaRU #1261

@tafaRU
Copy link
Member Author

tafaRU commented Nov 14, 2024

@max3903 the two PRs need to be joined otherwise tests still failed. Considering that I saw how you want to solve the problem, I can apply the same change here.

This is due after merge of OCA/stock-logistics-warehouse#2179
Ortherwise the module upgrade raises a ValidationError while validating view.
@tafaRU tafaRU force-pushed the 14.0-fix-fieldservice_stock_request branch from 465a3b2 to 690f7b3 Compare November 14, 2024 17:09
@tafaRU
Copy link
Member Author

tafaRU commented Nov 14, 2024

@tafaRU
Copy link
Member Author

tafaRU commented Nov 14, 2024

@tafaRU tafaRU force-pushed the 14.0-fix-fieldservice_stock_request branch from 690f7b3 to 111bbd0 Compare November 15, 2024 10:39
@tafaRU
Copy link
Member Author

tafaRU commented Nov 15, 2024

@max3903 seeing #1261 was 🟢 I tried to drop the last commit and I don't know exactly why but it works!
If it's not a problem I'd prefer merging this. Thanks!

@max3903
Copy link
Member

max3903 commented Nov 15, 2024

@tafaRU
Copy link
Member Author

tafaRU commented Nov 18, 2024

Ok thanks for sharing, I close this then.

@tafaRU tafaRU closed this Nov 18, 2024
@tafaRU tafaRU deleted the 14.0-fix-fieldservice_stock_request branch November 18, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants