Hi,
We use odoo 11,
Form sale order and custom form Communicate via field x_field.
I want click button in sale order, all product_id in order_line , append to custom Form lines.
Please help me.
class SaleOrder(models.Model):
_name = "sale.order"
x_field = fields.Many2one('custom.model',string='relation field')
@api.multi
def sent_to_delivery(self):
??????
??????
xml:
<button name="sent_to_delivery" class="oe_highlight" type="object" string="Delivery"/>
class custom(models.Model):
_name = 'custom.model'
c_items = fields.One2many('con.item', 't_field', string='Items')
class con_item(models.Model):
_name = con.item'
product = fields.Many2one('product.product', string='Product Name' ,change_default=True,required=True)
saleorder_number = fields.Many2one('sale.order', string='Sale Order Number')
t_field = fields.Many2one('custom.model')
How write function sent_to_delivery?