Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
7995 มุมมอง

Hi All,

I am using Odoo 11.0 CE, on Windows 10,

And I am using PyCharm as an editor.

I Try to add new fields to stock.move.line but it does not add the field to database.


the code is:

class StockMoveLines2(models.Model):
_inherit = "stock.move.line"
br_qty_av = fields.Float(string='Av. Qty', store=True)

Any one can help
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I use Odoo 16 on Linux, and I recently learned that I included a module directory with the same name. I just need to rename the module directory.


For example, if you are creating a module named "account" that has the same name as Odoo base, look into your config and see which folder is last. If you include Odoo base last in the addons_folder, "account" in Odoo base will be used and "account" in your project folder will be ignored.


How do you know if your module is read by Odoo? To find out, run Odoo in debug mode and set a breakpoint in the class or field you want to add. If it's not triggered, then Odoo must have called the previous module folder.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

i have this problem but with odoo 12

have you any solution !!?

.

I found a solution, you must upgrade the module with the command line:

"python odoo-bin -u <namemodule> -d <name-data-base>"

Windows

อวตาร
ละทิ้ง

Did you installed the module successfully in database ?

yes ,

I found a solution, you must upgrade my module with the command line: "python odoo-bin -u <namemodule> -d <name-data-base>"

Windows

ผู้เขียน คำตอบที่ดีที่สุด

Hi, Ibrahim, subbarao

I already do all your trials, really I do not know the reason.


Thanks for your answers,

May I will add through sql as you sugest ibrahim

Thanks again

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi, 

1- Check your files and make sure the one where your field is declared is added to your __init__.py

2- If All OK, Check in your database if the field is indeed not added to stock_move_line table : 

select br_qty_av from stock_move_line limit 1; 

3- If it does not exist,  Try to change the field's name and try upgrading again ( make sure you upgrade the correct module and check 2nd Point )

4- If it 's not working, well i suggest you add the field via sql request : 

alter table stock_move_line add column br_qty_av FLOAT;
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Ahmed,

Please check your python file added on __init__.py and your xml file added on __manifest__.py files.

stock module dependency on your module.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 25
1024
Upgrade 17 to 18 on prem แก้ไขแล้ว
2
ม.ค. 25
2212
Upgrade Odoo v16 to v17 on windows แก้ไขแล้ว
2
ม.ค. 25
2676
0
มี.ค. 23
2918
0
ส.ค. 22
2474