別のモジュールを使用してモジュールの動作を変更しようとしていますが、同じエラーメッセージが表示され続けます。Odoo - エラーコンテキスト
Traceback (most recent call last):
File "/home/carlos/dbTest/codigo/OCB/openerp/http.py", line 537, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/carlos/dbTest/codigo/OCB/openerp/http.py", line 574, in dispatch
result = self._call_function(**self.params)
File "/home/carlos/dbTest/codigo/OCB/openerp/http.py", line 310, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/carlos/dbTest/codigo/OCB/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/home/carlos/dbTest/codigo/OCB/openerp/http.py", line 307, in checked_call
return self.endpoint(*a, **kw)
File "/home/carlos/dbTest/codigo/OCB/openerp/http.py", line 803, in __call__
return self.method(*args, **kw)
File "/home/carlos/dbTest/codigo/OCB/openerp/http.py", line 403, in response_wrap
response = f(*args, **kw)
File "/home/carlos/dbTest/codigo/OCB/addons/web/controllers/main.py", line 944, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/carlos/dbTest/codigo/OCB/addons/web/controllers/main.py", line 936, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/home/carlos/dbTest/codigo/OCB/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/carlos/dbTest/codigo/OCB/addons/mail/mail_thread.py", line 348, in fields_view_get
res = super(mail_thread, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
File "/home/carlos/dbTest/codigo/OCB/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/carlos/dbTest/codigo/OCB/openerp/models.py", line 1545, in fields_view_get
xarch, xfields = View.postprocess_and_fields(cr, uid, self._name, etree.fromstring(result['arch']), view_id, context=ctx)
File "/home/carlos/dbTest/codigo/OCB/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/carlos/dbTest/codigo/OCB/openerp/addons/base/ir/ir_ui_view.py", line 837, in postprocess_and_fields
self.raise_view_error(cr, user, message, view_id, context)
File "/home/carlos/dbTest/codigo/OCB/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/carlos/dbTest/codigo/OCB/openerp/addons/base/ir/ir_ui_view.py", line 360, in raise_view_error
raise AttributeError(message)
AttributeError: Field `code` does not exist
Error context:
View `CRM - Claims Tree`
[view_id: 1015, xml_id: crm_claim.crm_case_claims_tree_view, model: crm.claim, parent_id: n/a]
これは私が修正しようとしているモジュールです。このモジュールは、crm.claimの動作を変更し、これはこれは私のモジュールであるpreviouのモジュールのXMLビュー
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="crm_claim_add_seq_form_view_inh">
<field name="name">crm.claim.add.seq.form.view.inh</field>
<field name="model">crm.claim</field>
<field name="inherit_id" ref="crm_claim.crm_case_claims_form_view" />
<field name="arch" type="xml">
<field name="name" position="before">
<field name="code" />
</field>
</field>
</record>
<record model="ir.ui.view" id="crm_claim_add_seq_tree_view_inh">
<field name="name">crm.claim.add.seq.tree.view.inh</field>
<field name="model">crm.claim</field>
<field name="inherit_id" ref="crm_claim.crm_case_claims_tree_view" />
<field name="arch" type="xml">
<field name="name" position="before">
<field name="code" />
</field>
</field>
</record>
<record model="ir.ui.view" id="view_crm_case_claims_filter_inh_claimseq">
<field name="name">view.crm.case.claims.filter.inh.claimseq</field>
<field name="model">crm.claim</field>
<field name="inherit_id" ref="crm_claim.view_crm_case_claims_filter" />
<field name="arch" type="xml">
<field name="name" position="attributes">
<attribute name="filter_domain">['|', ('name', 'ilike', self), ('code', 'ilike', self)]</attribute>
</field>
</field>
</record>
</data>
</openerp>
ある
from openerp import models, fields, api
class CrmClaim(models.Model):
_name = "crm.claim.code"
_inherit = "crm.claim"
code = fields.Char(
string='Claim Number', required=True, default="/", readonly=True)
_sql_constraints = [
('crm_claim_unique_code', 'UNIQUE (code)',
'The code must be unique!'),
]
@api.model
def create(self, vals):
if vals.get('code', '/') == '/':
vals['code'] = self.env['ir.sequence'].get('crm.claim')
#vals['stage_id'] = '1' #Set stage to "New" automatically
return super(CrmClaim, self).create(vals)
、私はちょうど舞台セットを強制しようとして正常に動作しますクレームが作成された後は1(新規)になります。
from openerp import models, fields, api
class CrmClaim(models.Model):
_name = "crm.claim.code"
_inherit = "crm.claim"
code = fields.Char(
string='Claim Number', required=True, default="/", readonly=True)
_sql_constraints = [
('crm_claim_unique_code', 'UNIQUE (code)',
'The code must be unique!'),
]
@api.model
def create(self, vals):
if vals.get('code', '/') == '/':
vals['code'] = self.env['ir.sequence'].get('crm.claim')
#vals['stage_id'] = '1' #Set stage to "New" automatically
return super(CrmClaim, self).create(vals)
そして、これは何が起こっているのか
odoo
|[...]
|Upgrade (This is mine)
| |crm_claim_create
| |crmClaimCreate.py
|
|crm (This is the one I'm trying to modify)
| |crm_claim_code
| |models
| | |crm_claim.py
| |views
| |crm_claim_view.xml
|OCB (Odoo's base one)
|addons
|crm_claim
|crm_claim.py
すべてのアイデアは私のディレクトリの構造ですか?
ありがとうございます
これは実際にはCRMタグで定義されているCRM質問ですか? –
今すぐコメントするfilter_domain(view_crm_case_claims_filter_inh_claimseq)問題が依然として持続するかどうか教えてください – prakash
CRMモジュールの依存関係を__openerp__.pyファイルに入れましたか? – dccdany