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

Hello!


Has anyone ever needed yo change a project on a purchase order line, or several, once this has already been invoiced?

How can It be done?

Thanks you! 

Odoov15.




아바타
취소
베스트 답변

If you Reset Invoice to Draft and then Cancel, you can change the purchase order line.  

It is also possible to change Analytic Account on the Vendor bill, if you reset it to draft.

아바타
취소
베스트 답변

Hi,

The `product_id` field becomes read-only when the state is set to 'purchase'. Here's the condition that makes it read-only:

'readonly': [('state', 'in', ('purchase', 'to approve','done', 'cancel'))],

If you need to edit the `product_id` field after the state has been changed to 'purchase', you can achieve this by replacing the field with a new XML tag that has the same field name. This XML tag should not have the 'readonly' attribute set to restrict editing. This will allow you to modify the `product_id` field even when the state is 'purchase'.

<record id="purchase_order_form" model="ir.ui.view">

        <field name="name">purchase.order.inherit.your.module</field>

        <field name="model">purchase.order</field>

        <field name="inherit_id" ref="purchase.purchase_order_form"/>

        <field name="arch" type="xml">

            <field name="product_id" position="replace">

                <field name="product_id"

                       attrs="{'required': [('display_type', '=', False)]}"

                       context="{'partner_id':parent.partner_id, 'quantity':product_qty,'uom':product_uom, 'company_id': parent.company_id}"

                       force_save="1"

                       domain="[('purchase_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"/>

            </field>

        </field>

    </record>

Removing the 'readonly' attribute to allow editing of the `product_id` field after the state has changed to 'purchase' might introduce unintended or unwanted behavior. Carefully consider the implications of allowing edits in this state to ensure that it aligns with your business logic and requirements.


Hope it helps

아바타
취소

Please refrain from giving solutions that could potentially affect on someone's business data if you're not familiar with their specific context. Changing the product_id after stock moves are posted is a risky move, and it's vital to understand the business implications before making such suggestions. Let's prioritize responsible advice that respects the integrity of the data and business processes.

관련 게시물 답글 화면 활동
0
8월 23
1382
1
7월 22
97
1
5월 24
1237
1
11월 24
2465
1
8월 23
2649