How to have conditional product attributes in Odoo 13 - attributes

Scenario:
How to create a conditional product attribute in Odoo?
I have a product like:
Product: Pipe
Attributes: Size, Weight, Thickness
If I select Pipe,
I get option to choose(product variants): Sizes (10' ft, 11' ft.....20'ft) and Thickness (0.5mm, 0.8mm ........ 5mm)
now, this should directly show weight :
If size: 10' ft, Thickness: 0.5 mm
then weight should be populated as 5 kg

Are you stuck in adding 2 variants to a product and can't find the weight field in inventory tab?

Related

Excel chart Categories against variable quantity of Price Points

I have some data which I would like to plot, presumably in a scatter chart. The data is in the following format.
Category, ID
Cat1, 560000
Cat1, 560005
Cat1, 880011
Cat2, 580000
Cat2, 580001
Cat2, 580002
Cat2, 780052
Cat3, 600000
Cat3, 600010
Cat3, 600011
Cat3, 1003452
For non-developers, you could think of this as Categories of Tyres and their Prices. I'd like to see that in the "Car" category, we sell items in a set of different price points and in the "Bicycle" category we sell items at a different set of price points. This metaphor only breaks down in that no 2 products can use the same price.
For developers out there, these are in fact a Long, Primary-Key to a particular relational database table and I'm attempting to plot how much and what parts of the available ID range have been utilised already, based on splitting the data into some categories.
I have 13 categories, so these will have to become the x axis due to excel limiting that to 255. Therefore ID will be my Y axis.
By using a 2D Line Chart on just the IDs, and squashing the chart, I was able to plot the overall usage of the ID range.
However, I'm unable to get any chart type to split this by category - I presume XY Scatter or Heatmap has this ability somehow.
Update:- Since posting I have encountered this "Contiguity Chart" which is roughly what I'm after but in Excel if feasible
https://qvdesign.wordpress.com/2012/03/29/qlikview-contiguity-chart-aka-that-chart-from-the-windows-disk-defragmenter/

pandas how to split one row to multiple row for variable product?

I have multiple variable product in my csv. Assume I have an product which title "Car model145" and this "Car model145" have three different price and size. Now I want to expand price and color row with title. here is my data frame:
title price color image
0 Car model145 2,54.00,852.00,2532.00 black,white,blue car iamge url
#three different price
I also have problem in price column. how to remove first comma after 2? so I can split price row properly. I also don't want to expand image row. The result will be look like this:
title price color image
0 Car model145 254.00 black car iamge url
1 Car model145 852.00 white
2 Car model145 2532.00 blue
Something confusing is the extra price (2,). Do you have this for all prices? You first need to get rid of it.
Then you can simply apply str.split and explode:
(df.assign(price=df['price'].str.replace(',', '', 1)) # remove first comma
.apply(lambda s: s.str.split(',').explode())
.assign(image=lambda d: d['image'].mask(d['image'].duplicated(), ''))
.reset_index(drop=True)
# .to_csv('filename.csv') # uncomment to save output as csv
)
output:
title price color image
0 Car model145 254.00 black car iamge url
1 Car model145 852.00 white
2 Car model145 2532.00 blue

excel:changing the symbol and color of a marker based on grouping

I have a dataset that looks like
ID Vehicle_grp count mpg
000 Car 5 10
Motorbike 20 100
Other 1 25
001 Car 30 60
Motorbike 28 45
Other 85 35
002 Car 100 10
Motorbike 20 200
Other 1 65
etc.
In excel, how do i change the colors and marker symbols used based on the ID and vehicle group. I would like to change colors based on ID, and use a different symbol for each vehicle group (i.e car is circle, motorbike is triangle, and other is cross)
I don't know VBA, so if theres a way to do this through the menus, that would be appreciated
Just make sure you add each series separately. Here are the steps (assume Excel 2007 or greater):
Insert > Scatter
Click the chart > Design > Select Data
Add first series. Series Name = the cell containing 000. Series X Values = cells for count 5, 20, and 1. Series Y values = cells for mpg 10, 100 25.
Add the second series. Series Name = cell containing 001. Series X Values = cells for count 30, 28, 85. Series Y values = cells for mpg 60, 45, 35.
Add the third series according to above.
Following that process gives me:
A little clean-up and formatting, gives me:

How to get sales amount measure appear either red or green in MDX cube?

I am new to mdx, this is a simple task yet, am not able to get it right. I have a Sales measure group with sales amount, tax, order quantity etc.
I am trying to get the sales amount appear either green or red if sales amount> 50 then red else..whatever color preferred.
Thanks
You have to use the FORE_COLOR cell property.
Here is an example with a calculated member:
WITH MEMBER [Measures].[color] AS [Measures].[sales amount],
FORE_COLOR = IIf([Measures].[sales amount] > 50, 255, 65280)

Excel Graph - Category and Subcategory grouping

I seldom if ever use excel and have no deep understanding of graphs and graphing-related functions. Having said that...
I have dozens of rows of data, composed by 4 columns
column 1 = amount/price (in numbers)
column 2 = description (the what
in text)
column 3 = category (in text)
column 4 = subcategory (in
text)
I want to make a bar graph of my rows of data so that, the end result looks like this:
X axis - categories
Y axis - amount/price
The trick here is for categories NOT to repeat themselves. For example, if our data is something like...
100 | boat purchase | boats | 3 engine boat
200 | boat purchase |
boats | 2 engine boat
500 | plane purchase | planes | 4 engine plane
900 | car purchase | cars | 1 engine car
Then there should only be ONE instance of boats, planes and cars in my graph, under which all associated data would be summed up.
Last but not least, I have seen graphs where, these unique-not-repeated categories, instead of just being one single 'bar' so to speak, are composed of smaller bars. In this case, I want these smaller bars to be the sub categories, so that the end result would look like this:
In that sample image, I first present a 'basic, classic' graph where blue, yellow and red each represent a unique, different category. Right below it is what I want, a 'breakdown' of each category by subcategory where blue/yellow/red each represent an imaginary 3 different subcategories per category.
This means subcategories will repeat themselves for each category, but categories themselves will not.
For clarification, I currently only have 3 main categories and 6 or so sub-categories, but this could change in the future, hence the desire to have this in an automatic/dynamic fashion
Kind regards
G.Campos
EDIT: new image:
Here i my take on it. Unfortunately I can't post the screenshots as I don't have enough posts.
One solution is to use pivot charts put Amount in "Values", Category in "Row Lables", and SubCategory in "Column Labels".
I uploaded relevant images on a free image upload service.
This is our source data:
Amount Decription Category SubCategory
100 boat purchase boats 3 engine boat
200 boat purchase boats 2 engine boat
500 plane purchase planes 4 engine plane
900 car purchase cars 1 engine car
450 boat purchase boats 2 engine boat
110 plane purchase planes 4 engine plane
550 car purchase cars 1 engine car
230 car purchase cars 2 engine car
450 car purchase cars 5 engine car
This is the desired graph (Edit: This has ghost bars):
http://imageshack.us/photo/my-images/849/pivot.gif/
I just read the comment about no ghost graphs. This might be what you are looking for:
http://imageshack.us/photo/my-images/266/pivotnoghost.gif/
Just googled and found something very similar here:
peltiertech.com/WordPress/using-pivot-table-data-for-a-chart-with-a-dual-category-axis/
You need to add http:// ( I can't have more than two hyperlinks due to low number of posts)
I am not sure this will get you exactly where you want but I find in general in excel it is easiest to summarize your graph data on a separate tab.
For sample data like this
you would create a 2nd tab in the sheet that appears something like
the totals are calculated by using the sumif formula
=SUMIF(Data!C:C,Summary!A2,Data!A:A)
For the Category totals
and
=SUMIF(Data!D:D,Summary!E2,Data!A:A)
For the sub category totals (Assuming sub-categories are mutally exclusive). Now that that data is summarized, highlight the cells and insert a column chart for the following charts.
Adding new categories and/or sub categories will require you to add lines to the summary data, and then add series to the charts. You could use a vba macro to automate that task but I suspect that is overkill since your dataset is "dozens" rather than "thousands"

Resources