addons14/contract/models/contract.py
def _onchange_contract_template_id(self):
        """Update the contract fields with that of the template.

        Take special consideration with the `contract_line_ids`,
        which must be created using the data from the contract lines. Cascade
        deletion ensures that any errant lines that are created are also
        deleted.
        """
        contract_template_id = self.contract_template_id
        if not contract_template_id:
            return
        for field_name, field in contract_template_id._fields.items():
            if field.name == "contract_line_ids":
                lines = self._convert_contract_lines(contract_template_id)
                self.contract_line_ids += lines
            elif not any(
                (
                    field.compute,
                    field.related,
                    field.automatic,
                    field.readonly,
                    field.company_dependent,
                    field.name in self.NO_SYNC,
                )
            ):
                if self.contract_template_id[field_name]:
                    self[field_name] = self.contract_template_id[field_name]
Update the contract fields with that of the template.

        Take special consideration with the `contract_line_ids`,
        which must be created using the data from the contract lines. Cascade
        deletion ensures that any errant lines that are created are also
        deleted.
        
Update the contract fields with that of the template.
Take special consideration with the `contract_line_ids`,
which must be created using the data from the contract lines. Cascade
deletion ensures that any errant lines that are created are also
deleted.
Update the contract fields with that of the template . Take special consideration with the ` contract_line_ids ` which must be created using the data from the contract lines . Cascade deletion ensures that any errant lines that are created are also deleted .
def _onchange_contract_template_id(self):
        contract_template_id = self.contract_template_id
        if not contract_template_id:
            return
        for field_name, field in contract_template_id._fields.items():
            if field.name == "contract_line_ids":
                lines = self._convert_contract_lines(contract_template_id)
                self.contract_line_ids += lines
            elif not any(
                (
                    field.compute,
                    field.related,
                    field.automatic,
                    field.readonly,
                    field.company_dependent,
                    field.name in self.NO_SYNC,
                )
            ):
                if self.contract_template_id[field_name]:
                    self[field_name] = self.contract_template_id[field_name]
def _onchange_contract_template_id ( self ) : contract_template_id = self . contract_template_id if not contract_template_id : return for field_name , field in contract_template_id . _fields . items ( ) : if field . name == "contract_line_ids" : lines = self . _convert_contract_lines ( contract_template_id ) self . contract_line_ids += lines elif not any ( ( field . compute , field . related , field . automatic , field . readonly , field . company_dependent , field . name in self . NO_SYNC , ) ) : if self . contract_template_id [ field_name ] : self [ field_name ] = self . contract_template_id [ field_name ]
Update the contract fields with that of the template.
Update the contract fields with that of the template .
"""Update the contract fields with that of the template.

        Take special consideration with the `contract_line_ids`,
        which must be created using the data from the contract lines. Cascade
        deletion ensures that any errant lines that are created are also
        deleted.
        """
self