Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
b8af4775
Commit
b8af4775
authored
10 years ago
by
Christophe Simonis
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] product: improve field labels about variant/attributes distinction
parent
138274e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addons/product/product.py
+7
-7
7 additions, 7 deletions
addons/product/product.py
with
7 additions
and
7 deletions
addons/product/product.py
+
7
−
7
View file @
b8af4775
...
...
@@ -318,7 +318,7 @@ class produce_price_history(osv.osv):
#----------------------------------------------------------
# Attributes
/ Variants
#
Product
Attributes
#----------------------------------------------------------
class
product_attribute
(
osv
.
osv
):
_name
=
"
product.attribute
"
...
...
@@ -362,11 +362,11 @@ class product_attribute_value(osv.osv):
'
name
'
:
fields
.
char
(
'
Value
'
,
translate
=
True
,
required
=
True
),
'
attribute_id
'
:
fields
.
many2one
(
'
product.attribute
'
,
'
Attribute
'
,
required
=
True
),
'
product_ids
'
:
fields
.
many2many
(
'
product.product
'
,
id1
=
'
att_id
'
,
id2
=
'
prod_id
'
,
string
=
'
Variants
'
,
readonly
=
True
),
'
price_extra
'
:
fields
.
function
(
_get_price_extra
,
type
=
'
float
'
,
string
=
'
Variant
Price Extra
'
,
'
price_extra
'
:
fields
.
function
(
_get_price_extra
,
type
=
'
float
'
,
string
=
'
Attribute
Price Extra
'
,
fnct_inv
=
_set_price_extra
,
digits_compute
=
dp
.
get_precision
(
'
Product Price
'
),
help
=
"
Price Extra: Extra price for the variant with this attribute value on sale price. eg. 200 price extra, 1000 + 200 = 1200.
"
),
'
price_ids
'
:
fields
.
one2many
(
'
product.attribute.price
'
,
'
value_id
'
,
string
=
'
Variant
Prices
'
,
readonly
=
True
),
'
price_ids
'
:
fields
.
one2many
(
'
product.attribute.price
'
,
'
value_id
'
,
string
=
'
Attribute
Prices
'
,
readonly
=
True
),
}
_sql_constraints
=
[
(
'
value_company_uniq
'
,
'
unique (name,attribute_id)
'
,
'
This attribute value already exists !
'
)
...
...
@@ -548,9 +548,9 @@ class product_template(osv.osv):
'
color
'
:
fields
.
integer
(
'
Color Index
'
),
'
is_product_variant
'
:
fields
.
function
(
_is_product_variant
,
type
=
'
boolean
'
,
string
=
'
Only one product variant
'
),
'
attribute_line_ids
'
:
fields
.
one2many
(
'
product.attribute.line
'
,
'
product_tmpl_id
'
,
'
Product
Variant
s
'
),
'
attribute_line_ids
'
:
fields
.
one2many
(
'
product.attribute.line
'
,
'
product_tmpl_id
'
,
'
Product
Attribute
s
'
),
'
product_variant_ids
'
:
fields
.
one2many
(
'
product.product
'
,
'
product_tmpl_id
'
,
'
Products
'
,
required
=
True
),
'
product_variant_count
'
:
fields
.
function
(
_get_product_variant_count
,
type
=
'
integer
'
,
string
=
'
Product Variant
Number
'
),
'
product_variant_count
'
:
fields
.
function
(
_get_product_variant_count
,
type
=
'
integer
'
,
string
=
'
# of
Product Variant
s
'
),
# related to display product product information if is_product_variant
'
ean13
'
:
fields
.
related
(
'
product_variant_ids
'
,
'
ean13
'
,
type
=
'
char
'
,
string
=
'
EAN13 Barcode
'
),
...
...
@@ -871,7 +871,7 @@ class product_product(osv.osv):
_columns
=
{
'
price
'
:
fields
.
function
(
_product_price
,
type
=
'
float
'
,
string
=
'
Price
'
,
digits_compute
=
dp
.
get_precision
(
'
Product Price
'
)),
'
price_extra
'
:
fields
.
function
(
_get_price_extra
,
type
=
'
float
'
,
string
=
'
Sum of
Variant
Price Extra
'
),
'
price_extra
'
:
fields
.
function
(
_get_price_extra
,
type
=
'
float
'
,
string
=
'
Variant
Extra Price
'
,
help
=
"
This is le sum of the extra price of all attributes
"
),
'
lst_price
'
:
fields
.
function
(
_product_lst_price
,
type
=
'
float
'
,
string
=
'
Public Price
'
,
digits_compute
=
dp
.
get_precision
(
'
Product Price
'
)),
'
code
'
:
fields
.
function
(
_product_code
,
type
=
'
char
'
,
string
=
'
Internal Reference
'
),
'
partner_ref
'
:
fields
.
function
(
_product_partner_ref
,
type
=
'
char
'
,
string
=
'
Customer ref
'
),
...
...
@@ -884,7 +884,7 @@ class product_product(osv.osv):
'
product.template
'
:
(
_get_name_template_ids
,
[
'
name
'
],
10
),
'
product.product
'
:
(
lambda
self
,
cr
,
uid
,
ids
,
c
=
None
:
ids
,
[],
10
),
},
select
=
True
),
'
attribute_value_ids
'
:
fields
.
many2many
(
'
product.attribute.value
'
,
id1
=
'
prod_id
'
,
id2
=
'
att_id
'
,
string
=
'
Variant
s
'
,
readonly
=
True
),
'
attribute_value_ids
'
:
fields
.
many2many
(
'
product.attribute.value
'
,
id1
=
'
prod_id
'
,
id2
=
'
att_id
'
,
string
=
'
Attribute
s
'
,
readonly
=
True
),
# image: all image fields are base64 encoded and PIL-supported
'
image_variant
'
:
fields
.
binary
(
"
Variant Image
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment