i created a module for adding an custom tab named in odoo crm for adding products and while clicking on new quotation button we want to pass this product and credential to the quotation orderline..so here i will give the code
from odoo import models, fields
class CrmLead(models.Model):
_inherit = 'crm.lead'
crm_sale_order_lines_ids = fields.One2many('crm.lead.quotation.management', 'lead_id')
def action_new_quotation(self):
action = super().action_new_quotation()
order_lines = []
for line in self.crm_sale_order_lines_ids:
default_tax_ids = line.product_id.taxes_id.ids if line.product_id else []
order_line_data = {
'product_id': line.product_id.id,
'name': line.description,
'product_uom_qty': line.ordered_quantity,
'price_unit': line.unit_price,
}
order_lines.append((0, 0, order_line_data))
action['context']['default_order_line'] = order_lines
return action
here i added the product fields for adding,,,how can i add the tax field there...not just default only..if i add new tax value it also must be moved to quotation orderline
