summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/account_financial_report.py7
-rwxr-xr-xindoteknik_custom/models/product_template.py12
-rw-r--r--indoteknik_custom/models/stock_picking.py2
3 files changed, 14 insertions, 7 deletions
diff --git a/indoteknik_custom/models/account_financial_report.py b/indoteknik_custom/models/account_financial_report.py
index 6147a3f3..c2376d6f 100644
--- a/indoteknik_custom/models/account_financial_report.py
+++ b/indoteknik_custom/models/account_financial_report.py
@@ -70,7 +70,12 @@ class AccountingReport(models.TransientModel):
for date_range in date_ranges:
row_number = 9
data['form']['used_context']['date_to'] = date_range['date_to']
- data['form']['used_context']['date_from'] = first_journal_date
+
+ if obj.account_report_id.id in [338]:
+ data['form']['used_context']['date_from'] = datetime.date(2021, 11, 30)
+ else:
+ data['form']['used_context']['date_from'] = date_range['date_from']
+
comp_dic['state'] = 'posted'
comp_dic['journal_ids'] = data['form']['journal_ids']
data['form']['comparison_context'] = comp_dic
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index d6b9fcfe..019d229c 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -54,11 +54,11 @@ class ProductTemplate(models.Model):
@api.constrains('name')
def _validate_name(self):
- pattern = r'^[a-zA-Z0-9\[\]\(\)\.\s/%]+$'
+ pattern = r'^[a-zA-Z0-9\[\]\(\)\.\s/%-]+$'
if not re.match(pattern, self.name):
- pattern_suggest = r'[a-zA-Z0-9\[\]\(\)\.\s/%]+'
+ pattern_suggest = r'[a-zA-Z0-9\[\]\(\)\.\s/%-]+'
suggest = ''.join(re.findall(pattern_suggest, self.name))
- raise UserError(f'Nama hanya bisa menggunakan angka, huruf kecil, huruf besar, titik, kurung lengkung, kurung siku, garis miring. Contoh: {suggest}')
+ raise UserError(f'Nama hanya bisa menggunakan angka, strip, huruf kecil, huruf besar, titik, kurung lengkung, kurung siku, garis miring. Contoh: {suggest}')
# def write(self, vals):
# if 'solr_flag' not in vals and self.solr_flag == 1:
@@ -292,11 +292,11 @@ class ProductProduct(models.Model):
@api.constrains('name')
def _validate_name(self):
- pattern = r'^[a-zA-Z0-9\[\]\(\)\.\s/%]+$'
+ pattern = r'^[a-zA-Z0-9\[\]\(\)\.\s/%-]+$'
if not re.match(pattern, self.name):
- pattern_suggest = r'[a-zA-Z0-9\[\]\(\)\.\s/%]+'
+ pattern_suggest = r'[a-zA-Z0-9\[\]\(\)\.\s/%-]+'
suggest = ''.join(re.findall(pattern_suggest, self.name))
- raise UserError(f'Nama hanya bisa menggunakan angka, huruf kecil, huruf besar, titik, kurung lengkung, kurung siku, garis miring. Contoh: {suggest}')
+ raise UserError(f'Nama hanya bisa menggunakan angka, strip, huruf kecil, huruf besar, titik, kurung lengkung, kurung siku, garis miring. Contoh: {suggest}')
def _get_qty_incoming_bandengan(self):
for product in self:
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index d35cd9b8..1ffb9aef 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -70,6 +70,8 @@ class StockPicking(models.Model):
('partial', 'Kirim Parsial')
], string='Note', help='jika field ini diisi maka tidak akan dihitung ke lead time')
waybill_id = fields.One2many(comodel_name='airway.bill', inverse_name='do_id', string='Airway Bill')
+ purchase_representative_id = fields.Many2one('res.users', related='move_lines.purchase_line_id.order_id.user_id',
+ string="Purchase Representative", readonly=True)
def action_create_invoice_from_mr(self):
"""Create the invoice associated to the PO.