links internal description with website_description
This commit is contained in:
parent
cb788d4a45
commit
70679c57a3
4 changed files with 27 additions and 0 deletions
1
website_description_internal/__init__.py
Normal file
1
website_description_internal/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from . import models
|
10
website_description_internal/__manifest__.py
Normal file
10
website_description_internal/__manifest__.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
'name': 'Website Descrition Internal',
|
||||||
|
'version': '16.0.1.0.0',
|
||||||
|
'summary': 'Sobrescribe el campo website_description y devuelve el campo internal description.',
|
||||||
|
'author': 'Criptomart',
|
||||||
|
'depends': ['product','website_sale'],
|
||||||
|
'data': [],
|
||||||
|
'installable': True,
|
||||||
|
'application': False,
|
||||||
|
}
|
1
website_description_internal/models/__init__.py
Normal file
1
website_description_internal/models/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from . import product_template
|
15
website_description_internal/models/product_template.py
Normal file
15
website_description_internal/models/product_template.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
class ProductTemplate(models.Model):
|
||||||
|
_inherit = 'product.template'
|
||||||
|
|
||||||
|
website_description = fields.Html(
|
||||||
|
string='Website Description',
|
||||||
|
compute='_compute_website_description',
|
||||||
|
store=True
|
||||||
|
)
|
||||||
|
|
||||||
|
@api.depends('description')
|
||||||
|
def _compute_website_description(self):
|
||||||
|
for record in self:
|
||||||
|
record.website_description = record.description
|
Loading…
Add table
Reference in a new issue