Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
1817 Tampilan

Regarding serial numbers, I assemble, program and test a printed circuit board for a product. As part of the programming, I assign a serial number to the PCB, which is programmed into a chip, along with other firmware. Associated with this serial number are other feature unlock codes that are unique to the PCB.

I have serial number control enabled in Odoo, so Odoo is aware that each assembled PCB has a unique serial number and a set of associated unlock codes.

The programmed and tested PCBs are then used in a top level assembly, that includes a plastic case, USB cable, packaging etc. to make a saleable product. 

What I'd like to be able to do is have the top level assembly inherit the serial number from the PCB that is part of it's BOM, so that when I sell the final product, it can display the correct serial number on the picking slip / other paperwork. 

Is this possible?


Avatar
Buang
Jawaban Terbai

In Odoo, achieving the serialization inheritance you described, where the top-level assembly inherits the serial number from a component (PCB) within its Bill of Materials (BOM), typically requires some customization as this behavior isn't directly supported out of the box. Here's a general approach you could follow:

1. Custom Field for Top-Level Assembly:


    Serial Number Field:

        Add a custom field (e.g., serial_number) to the top-level assembly model (e.g., mrp.production or your custom model).


2. Inherit Serial Number from Component:


    Custom Logic:

        Implement custom logic to inherit the serial number from the component (PCB) to the top-level assembly.

        This logic could be implemented using Python code in a custom module.


    Use Signals or Overrides:

        You might use signals (@api.model decorators) or overrides (@api.onchange, @api.depends) to trigger this logic when creating or updating the top-level assembly.


3. Update Picking Slip and Paperwork:


    Custom Reports:

        Modify the picking slip and other paperwork templates to include the serial_number of the top-level assembly.


4. Custom Module:


    Create a Custom Module:

        Develop a custom module to encapsulate your changes.




Important Considerations:


    This code is a basic example and may need to be adjusted based on your specific requirements and Odoo version.

    It assumes that your top-level assembly's BOM is defined with the PCB as a component.

    Odoo version compatibility is crucial, and the code may need adjustments based on the version you are using.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Des 23
1283
1
Mar 22
4538
0
Mei 20
4423
0
Okt 19
2991
0
Jun 17
5240