def _build_partner_header(self, header_element): builder = EssersEdiBuilder() # sold-to sale_order = self.env['sale.order'].search( [('name', '=', self.origin)], limit=1) if sale_order: builder.build_e1bpdlvpartner_element( header_element, '1', 'AG', sale_order.partner_id.expertm_reference) builder.build_e1bpadr1_element( header_element, sequence='1', name=sale_order.partner_id.name, city=sale_order.partner_id.city, zipcode=sale_order.partner_id.zip, street1=sale_order.partner_id.street, street2=sale_order.partner_id.street2, country=sale_order.partner_id.country_id.code, language=sale_order.partner_id.lang[3:5]) # ship-to builder.build_e1bpdlvpartner_element(header_element, '2', 'WE', self.partner_id.expertm_reference) builder.build_e1bpadr1_element(header_element, sequence='2', name=self.partner_id.name, city=self.partner_id.city, zipcode=self.partner_id.zip, street1=self.partner_id.street, street2=self.partner_id.street2, country=self.partner_id.country_id.code, language=self.partner_id.lang[3:5])
def _build_partner_header(self, header_element): builder = EssersEdiBuilder() # sold-to sale_order = self.env['sale.order'].search([('name', '=', self.origin)], limit=1) if sale_order: builder.build_e1bpdlvpartner_element(header_element, '1', 'AG', sale_order.partner_id.ref) builder.build_e1bpadr1_element(header_element, sequence='1', name=sale_order.partner_id.name, city=sale_order.partner_id.city, zipcode=sale_order.partner_id.zip, street1=sale_order.partner_id.street, street2=sale_order.partner_id.street2, country=sale_order.partner_id.country_id.code, language=sale_order.partner_id.lang[3:5]) # ship-to builder.build_e1bpdlvpartner_element(header_element, '2', 'WE', self.partner_id.ref) builder.build_e1bpadr1_element(header_element, sequence='2', name=self.partner_id.name, city=self.partner_id.city, zipcode=self.partner_id.zip, street1=self.partner_id.street, street2=self.partner_id.street2, country=self.partner_id.country_id.code, language=self.partner_id.lang[3:5])
def _build_instruction_header(self, header_element): if self.instruction_1: EssersEdiBuilder().build_e1bptext_element(header_element, self._name_edi(6), '001', 'CMT', self.instruction_1[:70]) if self.instruction_2: EssersEdiBuilder().build_e1bptext_element(header_element, self._name_edi(6), '002', 'CMT', self.instruction_2[:70])
def _build_line_customerinfo(self, header_element, line_num): sale_order = self.env['sale.order'].search( [('name', '=', self.picking_id.origin)], limit=1) if sale_order: for customer_id in self.product_id.customer_ids: if customer_id.name.id == sale_order.partner_id.parent_id.id: EssersEdiBuilder().build_e1bptext_element( header_element, self._name_edi(line_num), '0', 'CIC', customer_id.product_code) elif customer_id.name.id == sale_order.partner_id.id: EssersEdiBuilder().build_e1bptext_element( header_element, self._name_edi(line_num), '0', 'CIC', customer_id.product_code)
def _build_partner_header(self, header_element): builder = EssersEdiBuilder() # sold-to company = self.env['res.company'].search( [('id', '=', self.company_id.id)], limit=1) if company: builder.build_e1bpdlvpartner_element( header_element, '1', 'AG', company.partner_id.expertm_reference) builder.build_e1bpadr1_element( header_element, sequence='1', name=company.partner_id.name, city=company.partner_id.city, zipcode=company.partner_id.zip, street1=company.partner_id.street, street2=company.partner_id.street2, country=company.partner_id.country_id.code, language=company.partner_id.lang[3:5])
def _build_priority_header(self, header_element): if self.priority == '3': EssersEdiBuilder().build_e1bptext_element(header_element, self._name_edi(6), '0', 'SBY', '1')
def _build_groupage_overrule_header(self, header_element): if self.groupage_overrule: EssersEdiBuilder().build_e1bptext_element(header_element, self._name_edi(6), '0', 'SOP', self.groupage_overrule)
def _build_crossdock_overrule_header(self, header_element): if self.crossdock_overrule: EssersEdiBuilder().build_e1bptext_element(header_element, self._name_edi(6), '0', 'SSP', self.crossdock_overrule)
def _build_delivery_date_header(self, header_element): sale_order = self.env['sale.order'].search( [('name', '=', self.origin)], limit=1) if sale_order and sale_order.requested_date: EssersEdiBuilder().build_e1bpdlvdeadln_element( header_element, self._name_edi(), self.min_date, 'CET')
def _build_delivery_date_header(self, header_element): EssersEdiBuilder().build_e1bpdlvdeadln_element(header_element, self._name_edi(), self.date_planned, 'CET')