跳至内容
菜单
此问题已终结
1 回复
2538 查看

This is the model file

from odoo import fields, models


class PropertyOffer(models.Model):

_name = 'longdick.estate.offer'
_description = 'Offers data of a property, One to Many relation. One: property, many: offers'

price = fields.Float(default = 500000, string = 'Offer Price', required = True)
status = fields.Selection(string = 'Offer Status',
default
= 'considering',
selection
= [
('accepted', 'Accepted'),
('considering', 'Considering'),
('negotiating', 'Negotiating'),
('refused', 'Refused'),
],
copy
= False)
offer_maker = fields.Many2one('res.partner', string = 'Offer Maker', required = True)
property = fields.Many2one('longdick.estate', string = 'Property', required = True)



==============================
This is my init file

from . import longdick_estate, \
longdick_estate_property_type, \
longdick_estate_property_tag, \
longdick_estate_offer

The first three models were just working fine, however, the fourth just couldn't be created
I even tried to reboot my PC, just not working.

I checked both technical setting and my database in postgreSQL, there's no my offer table.
However, estate/property_type/property_tag and estate&tag rel table are created properly.

I'm also sure about that my ir model access csv​ is set properly, as below:

id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_longdick_estate,longdick.estate,model_longdick_estate,base.group_user,1,1,1,1
access_longdick_estate_offer,longdick.estate.offer,model_longdick_estate_offer,base.group_user,1,1,1,1
access_longdick_estate_property_tag,longdick.estate.property.tag,model_longdick_estate_property_tag,base.group_user,1,1,1,1
access_longdick_estate_property_type,longdick.estate.property.type,model_longdick_estate_property_type,base.group_user,1,1,1,1

Furthermore, I'm using superuser mode, therefore, it's shouldn't be a problem, even if I have some typo in the access file.

Thanks for answering in advance!!!


@Mehjabin Farsana, Thank you miss mehjabin for answering my question so fast.
And sorry for replying your answer in such a way because I don't have enough karma points.
However, your answer doesn't quit solve my problem. Would you mind help me a little bit more?


Problem solved, I just uninstalled my App and then installed it. It began to work.





形象
丢弃
最佳答案

Hi,

Can you ensure that the model is created or not by checking in the Models menu under settings -> technical -> database structure -> models.

If it get added there and if you are talking about missing menu, please make sure that you have defined the access rights for your model in ir.model.access.csv file for users to access this model.

Points to check:
1. Ensure odoo service is restarted
2. python file is imported in the init
3. Module is upgraded in the db


Thanks

形象
丢弃
相关帖文 回复 查看 活动
4
11月 20
6533
0
12月 24
1344
1
3月 24
2404
1
6月 23
12428
0
1月 23
3127