Help

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

Set Customer-Specific Product Names in Sale Orders Using the Quote Calculator [V18.3+]

Avatar
odoo
Avatar
Discard
2 Answers
0
Avatar
odoo
Best Answer


V18.2:


V18.3+


This was useful for cases in which our clients need to identify our products based on specific names or codes. 

 

We could achieve this again using the Quote Calculator:


Follow the these steps:



1) Enable Quotation Templates from settings and create one adding a Calculator 




2) Using Studio, create a new model with the following fields 

  1. Many2one to Contacts model (res.partner)
  2. Many2one to Products model (product.product)
  3. Char field to enter the new name
  4. Char field to enter the new code

 

💡

This step is optional, as you could use the vendor pricelists model



3) Add the list view to the Quote Calculator




4) Inside the Spreadsheet (Quote Calculator), add the field "ID" from the contact and from the Product

Tip: You can copy and paste one of the titles of the columns to copy the correct formula, and only add ".id" at the end of the technical name of the field. 


Don't forget to drag down the formula to fill the other cells.


Example:



5) Inside "Sheet1" Odoo will show automatically the information added to the current Sale Order Lines. In this table, add the next columns.


  1. Product ID (product_id.id)
  2. Quotation Customer ID (order_partner_id.id)


Tip: You can also copy and paste the original formulas from this table to add the columns. This table uses "=ODOO.LIST.HEADER" and "=ODOO.LIST" formulas.


If not needed, you can also delete/hide the other columns:




6) Then add other 3 columns with only the title as a text (not using formulas yet):

  1. Product code
  2. Product name
  3. Line description



7) Using a Spreadsheets formula, fill the cells for product code and product name in Sheet1, matching the product and customer ID from both sheets:

Option 1: =INDEX('Client product name (List #2)'!F:F,MATCH(1,('Client product name (List #2)'!B:B=B2)*('Client product name (List #2)'!D:D=L2),0))

Explanation: Retrieves column F value from second sheet (This is the "Client product name" column), in which the client ID and product id (in the second sheet) matches the IDs from sheet 1.



Option 2: You could also use an XLookUp, but first you would have to create a new column (in both tables) to, for example, concatenate Product ID and Customer ID in the same cell and use that to look for the correct record.


Example:



Use an "IFERROR" formula to avoid "#N/A" errors if the product doesn't have a new code or name created in the new model, and, moreover, to use the original product code (reference) and name.

You can add the columns to get this information using the same method in step 4 and 5.




8) In the Line Description column, add a formula that concatenates the Code and Name column, and sync the cell with the description field in sale order lines: 

To sync the field with the cell, right-click it > "Sync with field" > Select "Description" field, and drag down the cell.




Also add an IF formula to avoid adding brackets when no code is set.




9) Create a new sale order

  1. Select the customer
  2. Select the quotation template
  3. Select the products
  4. Enter the Quote Calculator smart button
  5. Click on Save

Now each product will have the custom names and codes based on the selected customer. If no match is found, Odoo will add the original product name and code.


Original sale order:


Custom product names model linked to the quote calculator:


Final customized description for each product in the sale order:


Result:



💡

You could also configure the Quote Calculator formulas to add the Sales Description field (from inside the product form) to emulate Odoo's standard behavior


Avatar
Discard
0
Avatar
odoo
Best Answer
1 Comment
Avatar
Discard
Avatar
odoo
-

Hello! Thanks for your comment.

It's a good workaround; however, using that method would have the following problems:

1. You would have to translate everything again (for example, the sales/purchase PDF reports) into the customer-specific language.

2. It wouldn't be scalable if you have many clients who need this feature, since you would need to create one language for each customer.

3. It wouldn't be possible to set a specific product code, because the Internal Reference field is not translatable.