<commit_before># -*- coding: utf-8 -*-
# Copyright 2015 Eficent Business and IT Consulting Services S.L.
# (<NAME>)
# Copyright 2016 Matmoz d.o.o.
# (<NAME>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models

class AccountAnalyticLinePlan(models.Model):
    _name = 'account.analytic.line.plan'
    _description = 'Analytic Line'
    _order = 'date desc, id desc'

    @api.model
    def _default_user(self):
        return self.env.context.get('user_id', self.env.user.id)

    name = fields.Char(
        'Description',
        required=True
    )
    date = fields.Date(
        'Date',
        required=True,
        index=True,
        default=fields.Date.context_today
    )
    amount = fields.Float(
        'Amount',
        required=True,
        default=0.0
    )
    unit_amount = fields.Float(
        'Quantity',
        default=0.0
    )
    amount_currency = fields.Float(
        'Amount Currency',
        help="The amount expressed in an optional other currency."
    )
    account_id = fields.Many2one(
        'account.analytic.account',
        'Analytic Account',
        required=True,
        ondelete='restrict',
        index=True
    )
    partner_id = fields.Many2one(
        'res.partner',
        string='Partner'
    )
    user_id = fields.Many2one(
        'res.users',
        string='User',
        default=_default_user
    )
    company_id = fields.Many2one(
        related='account_id.company_id',
        string='Company',
        store=True,
        readonly=True
    )
    currency_id = fields.Many2one(
        related="company_id.currency_id",
        string="Currency",
        readonly=True
    )
    product_uom_id = fields.Many2one(
        'product.uom',
        'UoM'
    )
    product_id = fields.Many2one(
        'product.product',
        'Product'
    )
    general_account_id = fields.Many2one(
        'account.account',
        'General Account',
        required=True,
        ondelete='restrict'
    )
    journal_id = fields.Many2one(
        'account.analytic.plan.journal',
        'Planning Analytic Journal',
        required=True,
        ondelete='restrict',
        select=True,
        default=lambda self:
        self._context['journal_id'] if
        self._context and 'journal_id' in
        self._context else None
    )
    code = fields.Char(
        'Code'
    )
    ref = fields.Char(
        'Ref.'
    )
    notes = fields.Text(
        'Notes'
    )
    version_id = fields.Many2one(
        'account.analytic.plan.version',
        'Planning Version',<commit_msg>[FIX]journal field contained old attribute select<commit_after># -*- coding: utf-8 -*-
# Copyright 2015 Eficent Business and IT Consulting Services S.L.
# (<NAME>)
# Copyright 2016 Matmoz d.o.o.
# (<NAME>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models

class AccountAnalyticLinePlan(models.Model):
    _name = 'account.analytic.line.plan'
    _description = 'Analytic Line'
    _order = 'date desc, id desc'

    @api.model
    def _default_user(self):
        return self.env.context.get('user_id', self.env.user.id)

    name = fields.Char(
        'Description',
        required=True
    )
    date = fields.Date(
        'Date',
        required=True,
        index=True,
        default=fields.Date.context_today
    )
    amount = fields.Float(
        'Amount',
        required=True,
        default=0.0
    )
    unit_amount = fields.Float(
        'Quantity',
        default=0.0
    )
    amount_currency = fields.Float(
        'Amount Currency',
        help="The amount expressed in an optional other currency."
    )
    account_id = fields.Many2one(
        'account.analytic.account',
        'Analytic Account',
        required=True,
        ondelete='restrict',
        index=True
    )
    partner_id = fields.Many2one(
        'res.partner',
        string='Partner'
    )
    user_id = fields.Many2one(
        'res.users',
        string='User',
        default=_default_user
    )
    company_id = fields.Many2one(
        related='account_id.company_id',
        string='Company',
        store=True,
        readonly=True
    )
    currency_id = fields.Many2one(
        related="company_id.currency_id",
        string="Currency",
        readonly=True
    )
    product_uom_id = fields.Many2one(
        'product.uom',
        'UoM'
    )
    product_id = fields.Many2one(
        'product.product',
        'Product'
    )
    general_account_id = fields.Many2one(
        'account.account',
        'General Account',
        required=True,
        ondelete='restrict'
    )
    journal_id = fields.Many2one(
        'account.analytic.plan.journal',
        'Planning Analytic Journal',
        required=True,
        ondelete='restrict',
        index=True,
        default=lambda self:
        self._context['journal_id'] if
        self._context and 'journal_id' in
        self._context else None
    )
    code = fields.Char(
        'Code'
    )
    ref = fields.Char(
        'Ref.'
    )
    notes = fields.Text(
        'Notes'
    )
    version_id = fields.Many2one(
        'account.analytic.plan.version',
        'Planning Version',
{'fraction_non_alphanumeric': 0.11596414266641236, 'fraction_numerical': 0.009536524890329964, 'mean_word_length': 2.0382387022016224, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2264339', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1615, 'n_words': 314}