콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
9988 화면

Hello I'm getting the following error while trying to inherit sale.order form in my own module, I want to add a button in the sale.order form next to the print button which says "Orden de Trabajo" or "Work Order" this one generates a PDF with the following variables.. number of order, customer, product, quantity, the code is made, just don't know how to inherit correctly to add this button to the sale.order form


ParseError: "Error mientras se validavan las restricciones

El elemento '<xpath expr="//header[@name='print_quotation']">' no puede ser localizado en la vista padre

Error de contexto:
Vista `sale.order.form.inherit`
[view_id: 3446, xml_id: n/a, model: sale.order, parent_id: 547]
None" while parsing file:///c:/odoo 10.0e/server/odoo/custom_addons/orden_trabajo/views/boton_ot.xml:4, near
<record id="view_order_form_inherit" model="ir.ui.view">
        <field name="name">sale.order.form.inherit</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
	    <field name="arch" type="xml">
	<!--The action -->
        <xpath expr="//header[@name='print_quotation']" position="after">
                <button string="Orden de Trabajo" type="object" name="print_work_order"/>
        </xpath>
     </field>
    </record>
아바타
취소
작성자 베스트 답변

You're right, now I see my button but when I click it I see this... :(


Odoo Server Error
Traceback (most recent call last):
File "C:\Odoo 10.0e\server\odoo\http.py", line 640, in _handle_exception
File "C:\Odoo 10.0e\server\odoo\http.py", line 677, in dispatch
File "C:\Odoo 10.0e\server\odoo\http.py", line 333, in _call_function
File "C:\Odoo 10.0e\server\odoo\service\model.py", line 101, in wrapper
File "C:\Odoo 10.0e\server\odoo\http.py", line 326, in checked_call
File "C:\Odoo 10.0e\server\odoo\http.py", line 935, in __call__
File "C:\Odoo 10.0e\server\odoo\http.py", line 506, in response_wrap
File "C:\Odoo 10.0e\server\odoo\addons\web\controllers\main.py", line 889, in call_button
File "C:\Odoo 10.0e\server\odoo\addons\web\controllers\main.py", line 877, in _call_kw
File "C:\Odoo 10.0e\server\odoo\api.py", line 677, in call_kw

AttributeError: type object 'sale.order' has no attribute 'print_work_order'


Here is my module, I probably have a lot of mistakes, sorry but I'm new around here and I really want to be able to develop in odoo


https://github.com/dan18fan/dan




edit: Solved it, now I can print my work order, everything is working as intended, thanks for the help :)

아바타
취소
베스트 답변

Hii,
You need to change xpath 

Try like this ,

<xpath expr="//header/button[@name='print_quotation']" position="after">
     <button string="Orden de Trabajo" type="object" name="print_work_order"/>
</xpath>

Correct me,If I am wrong
Thank you

아바타
취소
관련 게시물 답글 화면 활동
2
1월 25
15576
0
4월 20
1749
0
2월 20
6322
3
1월 18
5566
0
4월 17
2580