diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-01-02 08:52:13 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-01-02 08:52:13 +0700 |
| commit | b2b458d4a642271b98f23403c74eb7aad06cd71d (patch) | |
| tree | e9d58bd5f6664c82236e82c95843a1f264e187aa | |
| parent | 7d5204a92422848f617af2d0e50d7069bf9f7824 (diff) | |
<iman> update merchant
| -rw-r--r-- | indoteknik_api/controllers/api_v1/lead.py | 4 | ||||
| -rw-r--r-- | indoteknik_api/models/res_users.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/res_partner.py | 8 | ||||
| -rw-r--r-- | indoteknik_custom/models/user_form_merchant.py | 4 | ||||
| -rw-r--r-- | indoteknik_custom/models/user_merchant_request.py | 4 | ||||
| -rw-r--r-- | indoteknik_custom/views/res_partner.xml | 16 | ||||
| -rw-r--r-- | indoteknik_custom/views/user_form_merchant.xml | 16 |
7 files changed, 41 insertions, 12 deletions
diff --git a/indoteknik_api/controllers/api_v1/lead.py b/indoteknik_api/controllers/api_v1/lead.py index 7a964b21..61a37dc6 100644 --- a/indoteknik_api/controllers/api_v1/lead.py +++ b/indoteknik_api/controllers/api_v1/lead.py @@ -33,6 +33,7 @@ class Lead(controller.Controller): def create_merchant(self, **kw): params = self.get_request_params(kw, { "name_merchant": ["required"], + "pic_merchant":[], "address": [], "state": [], "city": [], @@ -47,12 +48,15 @@ class Lead(controller.Controller): "email_finance": [], "phone": [], "mobile": [], + "harga_tayang": [], "file_dokumenKtpDirut ": [], "file_kartuNama": [], "file_npwp": [], "file_sppkp": [], "file_suratPernyataan": [], "file_fotoKantor": [], + "file_dataProduk": [], + "file_pricelist": [], "description": [], }) filtered_params = {key: value for key, value in params['value'].items() if value} diff --git a/indoteknik_api/models/res_users.py b/indoteknik_api/models/res_users.py index 77aeeef7..37441d7f 100644 --- a/indoteknik_api/models/res_users.py +++ b/indoteknik_api/models/res_users.py @@ -63,6 +63,7 @@ class ResUsers(models.Model): 'rajaongkir_city_id': user.kecamatan_id.rajaongkir_id or 0, 'alamat_wajib_pajak': user.alamat_lengkap_text or None, 'alamat_bisnis': user.street or None, + 'companyType': user.customer_type or 'nonpkp', 'longtitude': user.longtitude or None, 'latitude': user.latitude or None, 'address_map': user.address_map or None, diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py index 79962c2b..9e53dae1 100644 --- a/indoteknik_custom/models/res_partner.py +++ b/indoteknik_custom/models/res_partner.py @@ -77,6 +77,7 @@ class ResPartner(models.Model): # MERCHANT name_merchant = fields.Char(string='Name') + pic_merchant = fields.Char(string='PIC Merchant', required=True) address_merchant = fields.Char(string='Alamat') state_merchant = fields.Many2one('res.country.state', string='State') city_merchant = fields.Many2one('vit.kota', string='Kota') @@ -91,12 +92,15 @@ class ResPartner(models.Model): email_finance_merchant = fields.Char(string='Email Finance') phone_merchant = fields.Char(string='No. Telepon Perusahaan') mobile_merchant = fields.Char(string='No. Handphone') + harga_tayang = fields.Char(string='Harga Tayang (HET)') file_dokumenKtpDirut = fields.Binary(string="KTP Dirut/Direktur", tracking=True, track_visibility="onchange") file_kartuNama = fields.Binary(string="Kartu Nama", tracking=True, track_visibility="onchange") file_npwp = fields.Binary(string="NPWP", tracking=True, track_visibility="onchange") file_sppkp = fields.Binary(string="SPPKP", tracking=True, track_visibility="onchange") file_suratPernyataan = fields.Binary(string="Surat Pernyataan Nomor Rekening", tracking=True, track_visibility="onchange") file_fotoKantor = fields.Binary(string="Foto Gudang / Kantor Bagian Depan", tracking=True, track_visibility="onchange") + file_dataProduk = fields.Binary(string="Data Produk (Item Name, Gambar, Deskripsi)", tracking=True,track_visibility="onchange") + file_pricelist = fields.Binary(string="Pricelist", tracking=True, track_visibility="onchange") description = fields.Text(string='Deskripsi') @api.model @@ -162,6 +166,7 @@ class ResPartner(models.Model): # Merchant vals['name_merchant'] = vals.get('name_merchant', self.name_merchant) + vals['pic_merchant'] = vals.get('pic_merchant', self.pic_merchant) vals['address_merchant'] = vals.get('address_merchant', self.address_merchant) vals['state_merchant'] = vals.get('state_merchant', self.state_merchant) vals['city_merchant'] = vals.get('city_merchant', self.city_merchant) @@ -176,12 +181,15 @@ class ResPartner(models.Model): vals['email_finance_merchant'] = vals.get('email_finance_merchant', self.email_finance_merchant) vals['phone_merchant'] = vals.get('phone_merchant', self.phone_merchant) vals['mobile_merchant'] = vals.get('mobile_merchant', self.mobile_merchant) + vals['harga_tayang'] = vals.get('harga_tayang', self.harga_tayang) vals['file_dokumenKtpDirut'] = vals.get('file_dokumenKtpDirut', self.file_dokumenKtpDirut) vals['file_kartuNama'] = vals.get('file_kartuNama', self.file_kartuNama) vals['file_npwp'] = vals.get('file_npwp', self.file_npwp) vals['file_sppkp'] = vals.get('file_sppkp', self.file_sppkp) vals['file_suratPernyataan'] = vals.get('file_suratPernyataan', self.file_suratPernyataan) vals['file_fotoKantor'] = vals.get('file_fotoKantor', self.file_fotoKantor) + vals['file_dataProduk'] = vals.get('file_dataProduk', self.file_dataProduk) + vals['file_pricelist'] = vals.get('file_pricelist', self.file_pricelist) vals['description'] = vals.get('description', self.description) diff --git a/indoteknik_custom/models/user_form_merchant.py b/indoteknik_custom/models/user_form_merchant.py index 96568f6c..31c85481 100644 --- a/indoteknik_custom/models/user_form_merchant.py +++ b/indoteknik_custom/models/user_form_merchant.py @@ -7,6 +7,7 @@ class UserFormMerchant(models.Model): _name = 'user.form.merchant' _inherit = ['mail.thread', 'mail.activity.mixin'] name = fields.Char(string='Name', required=True) + pic_merchant = fields.Char(string='PIC Merchant', required=True) name_merchant = fields.Char(string='Name') address = fields.Char(string='Alamat') state = fields.Many2one('res.country.state', string='State') @@ -22,12 +23,15 @@ class UserFormMerchant(models.Model): email_finance = fields.Char(string='Email Finance') phone = fields.Char(string='No. Telepon Perusahaan') mobile = fields.Char(string='No. Handphone') + harga_tayang = fields.Char(string='Harga Tayang (HET)') file_dokumenKtpDirut = fields.Binary(string="KTP Dirut/Direktur", tracking=True, track_visibility="onchange") file_kartuNama = fields.Binary(string="Kartu Nama", tracking=True, track_visibility="onchange") file_npwp = fields.Binary(string="NPWP", tracking=True, track_visibility="onchange") file_sppkp = fields.Binary(string="SPPKP", tracking=True, track_visibility="onchange") file_suratPernyataan = fields.Binary(string="Surat Pernyataan Nomor Rekening", tracking=True, track_visibility="onchange") file_fotoKantor = fields.Binary(string="Foto Gudang / Kantor Bagian Depan", tracking=True, track_visibility="onchange") + file_dataProduk = fields.Binary(string="Data Produk (Item Name, Gambar, Deskripsi)", tracking=True, track_visibility="onchange") + file_pricelist = fields.Binary(string="Pricelist", tracking=True, track_visibility="onchange") description = fields.Text(string='Deskripsi') @api.depends('name', 'name_merchant') diff --git a/indoteknik_custom/models/user_merchant_request.py b/indoteknik_custom/models/user_merchant_request.py index b47f6d1d..7f6c5f3c 100644 --- a/indoteknik_custom/models/user_merchant_request.py +++ b/indoteknik_custom/models/user_merchant_request.py @@ -71,6 +71,7 @@ class UserMerchantRequest(models.Model): is_approve = True if self.state_merchant == 'approved' or vals.get('state_merchant') == 'approved' else False if is_approve: self.user_company_id.name_merchant = self.merchant_id.name_merchant + self.user_company_id.pic_merchant = self.merchant_id.pic_merchant self.user_company_id.address_merchant = self.merchant_id.address self.user_company_id.state_merchant = self.merchant_id.state self.user_company_id.city_merchant = self.merchant_id.city @@ -85,12 +86,15 @@ class UserMerchantRequest(models.Model): self.user_company_id.email_finance_merchant = self.merchant_id.email_finance self.user_company_id.phone_merchant = self.merchant_id.phone self.user_company_id.mobile_merchant = self.merchant_id.mobile + self.user_company_id.harga_tayang = self.merchant_id.harga_tayang self.user_company_id.file_dokumenKtpDirut = self.merchant_id.file_dokumenKtpDirut self.user_company_id.file_kartuNama = self.merchant_id.file_kartuNama self.user_company_id.file_npwp = self.merchant_id.file_npwp self.user_company_id.file_sppkp = self.merchant_id.file_sppkp self.user_company_id.file_suratPernyataan = self.merchant_id.file_suratPernyataan self.user_company_id.file_fotoKantor = self.merchant_id.file_fotoKantor + self.user_company_id.file_dataProduk = self.merchant_id.file_dataProduk + self.user_company_id.file_pricelist = self.merchant_id.file_pricelist self.user_company_id.description = self.merchant_id.description return super(UserMerchantRequest, self).write(vals)
\ No newline at end of file diff --git a/indoteknik_custom/views/res_partner.xml b/indoteknik_custom/views/res_partner.xml index 5fcc7de5..d3ef2657 100644 --- a/indoteknik_custom/views/res_partner.xml +++ b/indoteknik_custom/views/res_partner.xml @@ -85,6 +85,7 @@ <group> <group> <field name="name_merchant" /> + <field name="pic_merchant" /> <field name="address_merchant" /> <field name="state_merchant" /> <field name="city_merchant" /> @@ -98,12 +99,14 @@ <field name="account_number_merchant" /> </group> <group> - <field name="file_dokumenKtpDirut" widget="pdf_viewer"/> - <field name="file_kartuNama" widget="pdf_viewer"/> - <field name="file_npwp" widget="pdf_viewer"/> - <field name="file_sppkp" widget="pdf_viewer"/> - <field name="file_suratPernyataan" widget="pdf_viewer"/> - <field name="file_fotoKantor" widget="image"/> + <field name="file_dokumenKtpDirut" /> + <field name="file_kartuNama" /> + <field name="file_npwp" /> + <field name="file_sppkp" /> + <field name="file_suratPernyataan" /> + <field name="file_fotoKantor" /> + <field name="file_dataProduk" /> + <field name="file_pricelist" /> </group> <group> <field name="email_company_merchant" widget="email"/> @@ -111,6 +114,7 @@ <field name="email_finance_merchant" widget="email"/> <field name="phone_merchant" widget="phone"/> <field name="mobile_merchant" widget="phone"/> + <field name="harga_tayang" /> </group> <group> <field name="description" /> diff --git a/indoteknik_custom/views/user_form_merchant.xml b/indoteknik_custom/views/user_form_merchant.xml index f4f91933..c30f2756 100644 --- a/indoteknik_custom/views/user_form_merchant.xml +++ b/indoteknik_custom/views/user_form_merchant.xml @@ -23,6 +23,7 @@ <group> <group> <field name="name_merchant" /> + <field name="pic_merchant" /> <field name="address" /> <field name="state" /> <field name="city" /> @@ -36,12 +37,14 @@ <field name="account_number" /> </group> <group> - <field name="file_dokumenKtpDirut" widget="pdf_viewer"/> - <field name="file_kartuNama" widget="pdf_viewer"/> - <field name="file_npwp" widget="pdf_viewer"/> - <field name="file_sppkp" widget="pdf_viewer"/> - <field name="file_suratPernyataan" widget="pdf_viewer"/> - <field name="file_fotoKantor" widget="image"/> + <field name="file_dokumenKtpDirut" /> + <field name="file_kartuNama" /> + <field name="file_npwp" /> + <field name="file_sppkp" /> + <field name="file_suratPernyataan" /> + <field name="file_fotoKantor" /> + <field name="file_dataProduk" /> + <field name="file_pricelist" /> </group> <group> <field name="email_company" widget="email"/> @@ -49,6 +52,7 @@ <field name="email_finance" widget="email"/> <field name="phone" widget="phone"/> <field name="mobile" widget="phone"/> + <field name="harga_tayang" /> </group> <group> <field name="description" /> |
